[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20140730.183410.2278759968683814587.davem@davemloft.net>
Date: Wed, 30 Jul 2014 18:34:10 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: eric.dumazet@...il.com
Cc: amirv@...lanox.com, alexander.h.duyck@...el.com,
netdev@...r.kernel.org, ogerlitz@...lanox.com,
yevgenyp@...lanox.com, idos@...lanox.com
Subject: Re: [PATCH net-next 1/2] net: Header length compution function
From: Eric Dumazet <eric.dumazet@...il.com>
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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists