From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org, therbert@google.com, hadi@cyberus.ca
Subject: Re: [PATCH net-next-2.6] net: eth_type_trans() should inline skb_pull()
Date: Sun, 02 May 2010 03:03:21 -0700 (PDT) [thread overview]
Message-ID: <20100502.030321.191163013.davem@davemloft.net> (raw)
In-Reply-To: <1272783032.2173.8.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 02 May 2010 08:50:32 +0200
> Excellent !
Great, here is the commit message I will use:
--------------------
net: Inline skb_pull() in eth_type_trans().
In commit 6be8ac2f ("[NET]: uninline skb_pull, de-bloats a lot")
we uninlined skb_pull.
But in some critical paths it makes sense to inline this thing
and it helps performance significantly.
Create an skb_pull_inline() so that we can do this in a way that
serves also as annotation.
Based upon a patch by Eric Dumazet.
Signed-off-by: David S. Miller <davem@davemloft.net>
--------------------
> Could we assume all eth_type_trans() must call it with initial
> skb->len >= (46 + 12) or not ? (According to ethernet specs, all
> frames should have a minimum payload of 46 bytes)
>
> If not sure, maybe we should issue a WARN_ON_ONCE()
>
> If yes, tests could be removed and we could gain two cycles ;)
Isn't the minimum ETH_ZLEN?
But yes, regardless of whether the minimum ethernet frame is 58 or 60
bytes, we should require it's at least that big, and use that test
consistently throughout.
Anything smaller is a runt packet and should be tossed or marked as an
error in some other way by the hardware. They should never make it to
eth_type_trans().
prev parent reply other threads:[~2010-05-02 10:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-01 6:42 [PATCH net-next-2.6] net: eth_type_trans() should inline skb_pull() Eric Dumazet
2010-05-02 1:15 ` David Miller
2010-05-02 6:50 ` Eric Dumazet
2010-05-02 10:03 ` David Miller [this message]
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=20100502.030321.191163013.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=hadi@cyberus.ca \
--cc=netdev@vger.kernel.org \
--cc=therbert@google.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).