Thread (13 messages) 13 messages, 5 authors, 2014-08-25

Re: [PATCH net-next 1/2] net: Header length compution function

From: David Miller <davem@davemloft.net>
Date: 2014-07-31 01:34:13

From: Eric Dumazet <redacted>
Date: Wed, 30 Jul 2014 09:00:44 +0200
This adds quite large number of conditional jumps, as
skb_header_pointer() is heavily used in the stack.
There is only one, in __skb_header_pointer(), testing "!skb" when we
have to take the slow path of copying from a non-linear area.

The NULL check could even be moved into skb_copy_bits() so that it
would not be inlined.  It should be unlikely() (or even WARN_ON()),
and thus terribly easily to be predicted properly all the time.

We could even pass around a "sentinel" global const SKB for these
cases that would simply make skb_copy_bits() return immediately (just
having skb->len == 0 would do the trick) even if we accidently got
there with one.

Then there would be no extra conditional jumps.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help