All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] bna: don't disable VLAN tag stripping in promisc mode
@ 2014-02-27 18:17 Ivan Vecera
  2014-02-27 19:59 ` Jiri Pirko
  2014-02-27 22:24 ` David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Ivan Vecera @ 2014-02-27 18:17 UTC (permalink / raw)
  To: netdev; +Cc: Rasesh Mody

The recent commit "fe1624c bna: RX Filter Enhancements" disables
VLAN tag stripping if the NIC is in promiscuous mode. Received VLAN tagged
packets are recognized by the driver via BNA_CQ_EF_VLAN flag and for such
packets the driver calls __vlan_hwaccel_put_tag(). The problem is the HW
marks the tagged packets with this flags also when the stripping is
disabled and thus __vlan_hwaccel_put_tag() should not be called for them.

A solution can be to call __vlan_hwaccel_put_tag() only when stripping is
enabled or to leave VLAN stripping engine enabled. The 2nd restores the
previous behavior and is IMHO better.

Cc: Rasesh Mody <rmody@brocade.com>
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
---
 drivers/net/ethernet/brocade/bna/bnad.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
index cf64f3d..137e91a 100644
--- a/drivers/net/ethernet/brocade/bna/bnad.c
+++ b/drivers/net/ethernet/brocade/bna/bnad.c
@@ -3245,11 +3245,6 @@ bnad_set_rx_mode(struct net_device *netdev)
 			BNA_RXMODE_ALLMULTI;
 	bna_rx_mode_set(bnad->rx_info[0].rx, new_mode, mode_mask, NULL);
 
-	if (bnad->cfg_flags & BNAD_CF_PROMISC)
-		bna_rx_vlan_strip_disable(bnad->rx_info[0].rx);
-	else
-		bna_rx_vlan_strip_enable(bnad->rx_info[0].rx);
-
 	spin_unlock_irqrestore(&bnad->bna_lock, flags);
 }
 
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net] bna: don't disable VLAN tag stripping in promisc mode
  2014-02-27 18:17 [PATCH net] bna: don't disable VLAN tag stripping in promisc mode Ivan Vecera
@ 2014-02-27 19:59 ` Jiri Pirko
  2014-02-27 22:24 ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: Jiri Pirko @ 2014-02-27 19:59 UTC (permalink / raw)
  To: Ivan Vecera; +Cc: netdev, Rasesh Mody

Thu, Feb 27, 2014 at 07:17:22PM CET, ivecera@redhat.com wrote:
>The recent commit "fe1624c bna: RX Filter Enhancements" disables
>VLAN tag stripping if the NIC is in promiscuous mode. Received VLAN tagged
>packets are recognized by the driver via BNA_CQ_EF_VLAN flag and for such
>packets the driver calls __vlan_hwaccel_put_tag(). The problem is the HW
>marks the tagged packets with this flags also when the stripping is
>disabled and thus __vlan_hwaccel_put_tag() should not be called for them.
>
>A solution can be to call __vlan_hwaccel_put_tag() only when stripping is
>enabled or to leave VLAN stripping engine enabled. The 2nd restores the
>previous behavior and is IMHO better.
>
>Cc: Rasesh Mody <rmody@brocade.com>
>Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Jiri Pirko <jiri@resnulli.us>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net] bna: don't disable VLAN tag stripping in promisc mode
  2014-02-27 18:17 [PATCH net] bna: don't disable VLAN tag stripping in promisc mode Ivan Vecera
  2014-02-27 19:59 ` Jiri Pirko
@ 2014-02-27 22:24 ` David Miller
  2014-02-28  6:31   ` Jiri Pirko
  1 sibling, 1 reply; 6+ messages in thread
From: David Miller @ 2014-02-27 22:24 UTC (permalink / raw)
  To: ivecera; +Cc: netdev, rmody

From: Ivan Vecera <ivecera@redhat.com>
Date: Thu, 27 Feb 2014 19:17:22 +0100

> The recent commit "fe1624c bna: RX Filter Enhancements" disables
> VLAN tag stripping if the NIC is in promiscuous mode. Received VLAN tagged
> packets are recognized by the driver via BNA_CQ_EF_VLAN flag and for such
> packets the driver calls __vlan_hwaccel_put_tag(). The problem is the HW
> marks the tagged packets with this flags also when the stripping is
> disabled and thus __vlan_hwaccel_put_tag() should not be called for them.
> 
> A solution can be to call __vlan_hwaccel_put_tag() only when stripping is
> enabled or to leave VLAN stripping engine enabled. The 2nd restores the
> previous behavior and is IMHO better.
> 
> Cc: Rasesh Mody <rmody@brocade.com>
> Signed-off-by: Ivan Vecera <ivecera@redhat.com>

At best, this is an incomplete change, because if we fix it like this
then the stripping enable/disable functions are completely unused and
therefore should be removed from the driver.

But I really thing that checking if stripping is enabled at the
__vlan_hwaccel_put_tag() call site is the best solution.

You just need to check rxf->vlan_strip_status in addition to the
descriptor flag.

Please implement it this way, thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net] bna: don't disable VLAN tag stripping in promisc mode
  2014-02-27 22:24 ` David Miller
@ 2014-02-28  6:31   ` Jiri Pirko
  2014-02-28  9:09     ` Ivan Vecera
  2014-02-28 17:55     ` David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Jiri Pirko @ 2014-02-28  6:31 UTC (permalink / raw)
  To: David Miller; +Cc: ivecera, netdev, rmody

Thu, Feb 27, 2014 at 11:24:03PM CET, davem@davemloft.net wrote:
>From: Ivan Vecera <ivecera@redhat.com>
>Date: Thu, 27 Feb 2014 19:17:22 +0100
>
>> The recent commit "fe1624c bna: RX Filter Enhancements" disables
>> VLAN tag stripping if the NIC is in promiscuous mode. Received VLAN tagged
>> packets are recognized by the driver via BNA_CQ_EF_VLAN flag and for such
>> packets the driver calls __vlan_hwaccel_put_tag(). The problem is the HW
>> marks the tagged packets with this flags also when the stripping is
>> disabled and thus __vlan_hwaccel_put_tag() should not be called for them.
>> 
>> A solution can be to call __vlan_hwaccel_put_tag() only when stripping is
>> enabled or to leave VLAN stripping engine enabled. The 2nd restores the
>> previous behavior and is IMHO better.
>> 
>> Cc: Rasesh Mody <rmody@brocade.com>
>> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
>
>At best, this is an incomplete change, because if we fix it like this
>then the stripping enable/disable functions are completely unused and
>therefore should be removed from the driver.
>
>But I really thing that checking if stripping is enabled at the
>__vlan_hwaccel_put_tag() call site is the best solution.
>
>You just need to check rxf->vlan_strip_status in addition to the
>descriptor flag.
>
>Please implement it this way, thanks.

Dave, do you think that enabling/disabling of vlan stripping should
depend on promisc on/off? That seems very odd to me...

Jiri

>
>
>--
>To unsubscribe from this list: send the line "unsubscribe netdev" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net] bna: don't disable VLAN tag stripping in promisc mode
  2014-02-28  6:31   ` Jiri Pirko
@ 2014-02-28  9:09     ` Ivan Vecera
  2014-02-28 17:55     ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: Ivan Vecera @ 2014-02-28  9:09 UTC (permalink / raw)
  To: Jiri Pirko, David Miller; +Cc: netdev, rmody

On 02/28/2014 07:31 AM, Jiri Pirko wrote:
> Thu, Feb 27, 2014 at 11:24:03PM CET, davem@davemloft.net wrote:
>> From: Ivan Vecera <ivecera@redhat.com>
>> Date: Thu, 27 Feb 2014 19:17:22 +0100
>>
>>> The recent commit "fe1624c bna: RX Filter Enhancements" disables
>>> VLAN tag stripping if the NIC is in promiscuous mode. Received VLAN tagged
>>> packets are recognized by the driver via BNA_CQ_EF_VLAN flag and for such
>>> packets the driver calls __vlan_hwaccel_put_tag(). The problem is the HW
>>> marks the tagged packets with this flags also when the stripping is
>>> disabled and thus __vlan_hwaccel_put_tag() should not be called for them.
>>>
>>> A solution can be to call __vlan_hwaccel_put_tag() only when stripping is
>>> enabled or to leave VLAN stripping engine enabled. The 2nd restores the
>>> previous behavior and is IMHO better.
>>>
>>> Cc: Rasesh Mody <rmody@brocade.com>
>>> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
>>
>> At best, this is an incomplete change, because if we fix it like this
>> then the stripping enable/disable functions are completely unused and
>> therefore should be removed from the driver.
>>
>> But I really thing that checking if stripping is enabled at the
>> __vlan_hwaccel_put_tag() call site is the best solution.
>>
>> You just need to check rxf->vlan_strip_status in addition to the
>> descriptor flag.
>>
>> Please implement it this way, thanks.
>
> Dave, do you think that enabling/disabling of vlan stripping should
> depend on promisc on/off? That seems very odd to me...
>
> Jiri
>
You are right both. The VLAN stripping should not depend on promisc mode 
and the functions should not be unused.
My idea was to fix the regression by reverting of problematic part of 
offending commit and to use the helper function to implement the VLAN 
tag strip toggling.

I have prepared the 2nd version that implements the above functionality.

Ivan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net] bna: don't disable VLAN tag stripping in promisc mode
  2014-02-28  6:31   ` Jiri Pirko
  2014-02-28  9:09     ` Ivan Vecera
@ 2014-02-28 17:55     ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2014-02-28 17:55 UTC (permalink / raw)
  To: jiri; +Cc: ivecera, netdev, rmody

From: Jiri Pirko <jiri@resnulli.us>
Date: Fri, 28 Feb 2014 07:31:42 +0100

> Dave, do you think that enabling/disabling of vlan stripping should
> depend on promisc on/off? That seems very odd to me...

Absolutely, when you're in promisc mode you really want to see the
full raw frames, VLAN headers and all.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-02-28 17:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-27 18:17 [PATCH net] bna: don't disable VLAN tag stripping in promisc mode Ivan Vecera
2014-02-27 19:59 ` Jiri Pirko
2014-02-27 22:24 ` David Miller
2014-02-28  6:31   ` Jiri Pirko
2014-02-28  9:09     ` Ivan Vecera
2014-02-28 17:55     ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.