netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: amirv@mellanox.com, alexander.h.duyck@intel.com,
	netdev@vger.kernel.org, ogerlitz@mellanox.com,
	yevgenyp@mellanox.com, idos@mellanox.com
Subject: Re: [PATCH net-next 1/2] net: Header length compution function
Date: Wed, 30 Jul 2014 18:34:10 -0700 (PDT)	[thread overview]
Message-ID: <20140730.183410.2278759968683814587.davem@davemloft.net> (raw)
In-Reply-To: <1406703644.3178.30.camel@edumazet-glaptop2.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.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.

  parent reply	other threads:[~2014-07-31  1:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-28 10:14 [PATCH net-next 0/2] Helper to find length of headers in an ethernet frame Amir Vadai
2014-07-28 10:14 ` [PATCH net-next 1/2] net: Header length compution function Amir Vadai
2014-07-30  4:58   ` David Miller
2014-07-30  7:00     ` Eric Dumazet
2014-07-30 14:26       ` Alexander Duyck
2014-07-31  1:39         ` David Miller
2014-07-31 15:34           ` Alexander Duyck
2014-08-23 19:19             ` David Miller
2014-08-25 22:21               ` Alexander Duyck
2014-08-25 22:32                 ` David Miller
2014-07-31  1:34       ` David Miller [this message]
2014-07-28 10:14 ` [PATCH net-next 2/2] net/mlx4_en: Copy exact header to SKB linear part Amir Vadai
2014-07-28 10:56   ` Sergei Shtylyov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140730.183410.2278759968683814587.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=alexander.h.duyck@intel.com \
    --cc=amirv@mellanox.com \
    --cc=eric.dumazet@gmail.com \
    --cc=idos@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=yevgenyp@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).