From: Prashant Sreedharan <prashant@broadcom.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Vladislav Yasevich <vyasevich@gmail.com>,
<netdev@vger.kernel.org>,
Vladislav Yasevich <vyasevic@redhat.com>,
Michael Chan <mchan@broadcom.com>
Subject: Re: [PATCH v2 2/2] tg3: Allow for receive of full-size 8021AD frames
Date: Fri, 19 Sep 2014 16:14:35 -0700 [thread overview]
Message-ID: <1411168475.6401.37.camel@prashant> (raw)
In-Reply-To: <1411167552.26859.58.camel@edumazet-glaptop2.roam.corp.google.com>
On Fri, 2014-09-19 at 15:59 -0700, Eric Dumazet wrote:
> On Fri, 2014-09-19 at 18:23 -0400, Vladislav Yasevich wrote:
> > When receiving a vlan-tagged frame that still contains
> > a vlan header, the length of the packet will be greater
> > then MTU+ETH_HLEN since it will account of the extra
> > vlan header. TG3 checks this for the case for 802.1Q,
> > but not for 802.1ad. As a result, full sized 802.1ad
> > frames get dropped by the card.
> >
> > Add a check for 802.1ad protocol when receiving full
> > sized frames.
> >
> > Suggested-by: Prashant Sreedharan <prashant@broadcom.com>
> > CC: Prashant Sreedharan <prashant@broadcom.com>
> > CC: Michael Chan <mchan@broadcom.com>
> > Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
> > ---
> > drivers/net/ethernet/broadcom/tg3.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> > index 0a0938d..4f674f9 100644
> > --- a/drivers/net/ethernet/broadcom/tg3.c
> > +++ b/drivers/net/ethernet/broadcom/tg3.c
> > @@ -6918,7 +6918,8 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
> > skb->protocol = eth_type_trans(skb, tp->dev);
> >
> > if (len > (tp->dev->mtu + ETH_HLEN) &&
> > - skb->protocol != htons(ETH_P_8021Q)) {
> > + skb->protocol != htons(ETH_P_8021Q) &&
> > + skb->protocol != htons(ETH_P_8021AD)) {
> > dev_kfree_skb_any(skb);
> > goto drop_it_no_recycle;
> > }
>
> Really I do not understand what is the value of this check.
>
> If NIC is dumb enough to send oversized frames, what prevents these
> frames being VLAN ones, and this test wont avoid the crash anyway ?
>
The NIC will not receive frames of size > mtu + ETH_HLEN + VLAN_HLEN it
will update the oversize_frame count and drop it. The check is to make
sure the additional 4 bytes is due to a valid vlan header.
next prev parent reply other threads:[~2014-09-19 23:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-19 22:23 [PATCH v2 0/2] tg3: Fix handling of non-acceleration vlans Vladislav Yasevich
2014-09-19 22:23 ` [PATCH v2 1/2] tg3: Work around HW/FW limitations with vlan encapsulated frames Vladislav Yasevich
2014-09-19 22:23 ` [PATCH v2 2/2] tg3: Allow for receive of full-size 8021AD frames Vladislav Yasevich
2014-09-19 22:59 ` Eric Dumazet
2014-09-19 23:14 ` Prashant Sreedharan [this message]
2014-09-19 23:37 ` Eric Dumazet
2014-09-20 0:39 ` [PATCH v2 0/2] tg3: Fix handling of non-acceleration vlans Prashant Sreedharan
2014-09-30 18:53 ` [PATCH] tg3: Allow for receive of full-size 8021AD frames Vlad Yasevich
2014-09-30 21:02 ` David Miller
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=1411168475.6401.37.camel@prashant \
--to=prashant@broadcom.com \
--cc=eric.dumazet@gmail.com \
--cc=mchan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=vyasevic@redhat.com \
--cc=vyasevich@gmail.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).