From: Ben Hutchings <bhutchings@solarflare.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: David Miller <davem@davemloft.net>,
Michael Chan <mchan@broadcom.com>,
netdev@vger.kernel.org
Subject: Re: RFC - should network devices trim frames > soft mtu
Date: Wed, 31 Aug 2011 23:45:28 +0100 [thread overview]
Message-ID: <1314830728.3274.52.camel@bwh-desktop> (raw)
In-Reply-To: <20110831151823.23cfb7bc@nehalam.ftrdhcpuser.net>
On Wed, 2011-08-31 at 15:18 -0700, Stephen Hemminger wrote:
> I noticed the following in the bnx2 driver.
>
>
> static int
> bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget)
> {
> ...
> skb->protocol = eth_type_trans(skb, bp->dev);
>
> if ((len > (bp->dev->mtu + ETH_HLEN)) &&
> (ntohs(skb->protocol) != 0x8100)) {
>
> dev_kfree_skb(skb);
> goto next_rx;
>
> }
>
> This means that for non-VLAN tagged frames, the device drops received
> packets if the length is greater than the MTU. I don't see that in
> other devices. What is the correct method? IMHO the bnx2 driver is
> wrong here and if the policy is desired it should be enforced at
> the next level (netif_receive_skb). Hardcoding a protocol value is
> kind of a giveaway that something is fishy.
According to netdevices.txt:
"MTU is symmetrical and applies both to receive and transmit. ...
The device may either: drop, truncate, or pass up oversize packets, but
dropping oversize packets is preferred."
I believe UNH interop tests expect that MRU = MTU and oversize packets
are dropped. However, I seem to recall that David has said more
recently that it's preferable to always use the maximum possible MRU if
DMA scatter is supported (so that this doesn't require page allocations
of order > 0).
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
prev parent reply other threads:[~2011-08-31 22:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-31 22:18 RFC - should network devices trim frames > soft mtu Stephen Hemminger
2011-08-31 22:26 ` Ben Greear
2011-08-31 22:27 ` Michael Chan
2011-09-01 0:10 ` David Lamparter
2011-08-31 22:45 ` Ben Hutchings [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=1314830728.3274.52.camel@bwh-desktop \
--to=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=mchan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.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