From: Jesse Gross <jesse@nicira.com>
To: Sathya Perla <sathya.perla@emulex.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next-2.6 2/6] be2net: fix to not drop unfiltered vlan pkts
Date: Fri, 18 Mar 2011 13:35:19 -0700 [thread overview]
Message-ID: <AANLkTimNHmvFznX-XHmhdVmkRBBjrkEa1OyAB=gSCciu@mail.gmail.com> (raw)
In-Reply-To: <e340379d-68e1-42af-b7b7-94e07e729884@exht1.ad.emulex.com>
On Fri, Mar 18, 2011 at 6:20 AM, Sathya Perla <sathya.perla@emulex.com> wrote:
> When the device is in promiscuous mode, the driver can receive vlan packets
> (tag is always stripped by card) even when there is no vlan configuration.
> Such packets must be sent to the stack and not dropped.
>
> Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
> ---
> drivers/net/benet/be_main.c | 9 ++-------
> 1 files changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
> index 97c5167..18c6da4 100644
> --- a/drivers/net/benet/be_main.c
> +++ b/drivers/net/benet/be_main.c
> @@ -1013,15 +1013,10 @@ static void be_rx_compl_process(struct be_adapter *adapter,
> skb->truesize = skb->len + sizeof(struct sk_buff);
> skb->protocol = eth_type_trans(skb, adapter->netdev);
>
> - if (unlikely(rxcp->vlanf)) {
> - if (!adapter->vlan_grp || adapter->vlans_added == 0) {
> - kfree_skb(skb);
> - return;
> - }
> + if (unlikely(rxcp->vlanf))
> vlan_hwaccel_receive_skb(skb, adapter->vlan_grp, rxcp->vid);
It would be better to use __vlan_hwaccel_put_tag() here - it's
equivalent but at least moves in the right direction. Under the old
vlan model (which vlan_hwaccel_receive_skb() is left over from)
passing in a NULL vlan group is illegal, so it's inconsistent anyways.
Of course even better would be to fully convert over to the new vlan
model. A quick skim through the code shows that there might be
similar issue with vlan_gro_frags() as above, so it could help catch
some of that.
next prev parent reply other threads:[~2011-03-18 20:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1300454462-1234-1-git-send-email-sathya.perla@emulex.com>
2011-03-18 13:20 ` [PATCH net-next-2.6 1/6] be2net: refactor code that decides adapter->num_rx_queues Sathya Perla
[not found] ` <1300454462-1234-2-git-send-email-sathya.perla@emulex.com>
2011-03-18 13:20 ` [PATCH net-next-2.6 2/6] be2net: fix to not drop unfiltered vlan pkts Sathya Perla
2011-03-18 20:35 ` Jesse Gross [this message]
2011-03-21 5:41 ` Sathya.Perla
2011-03-22 2:21 ` Jesse Gross
[not found] ` <1300454462-1234-3-git-send-email-sathya.perla@emulex.com>
2011-03-18 13:20 ` [PATCH net-next-2.6 3/6] be2net: parse vid and vtm fields of rx-compl only if vlanf bit is set Sathya Perla
[not found] ` <1300454462-1234-4-git-send-email-sathya.perla@emulex.com>
2011-03-18 13:21 ` [PATCH net-next-2.6 4/6] be2net: remove redundant code in be_worker() Sathya Perla
[not found] ` <1300454462-1234-5-git-send-email-sathya.perla@emulex.com>
2011-03-18 13:21 ` [PATCH net-next-2.6 5/6] be2net: cancel be_worker() in be_shutdown() even when i/f is down Sathya Perla
[not found] ` <1300454462-1234-6-git-send-email-sathya.perla@emulex.com>
2011-03-18 13:21 ` [PATCH net-next-2.6 6/6] be2net: remove one useless line Sathya Perla
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='AANLkTimNHmvFznX-XHmhdVmkRBBjrkEa1OyAB=gSCciu@mail.gmail.com' \
--to=jesse@nicira.com \
--cc=netdev@vger.kernel.org \
--cc=sathya.perla@emulex.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).