All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/vmxnet3: restore correct filtering
@ 2017-07-24 14:22 Charles (Chas) Williams
  2017-07-30 21:38 ` Thomas Monjalon
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Charles (Chas) Williams @ 2017-07-24 14:22 UTC (permalink / raw)
  To: dev; +Cc: skhare, Charles (Chas) Williams, stable

We should only restore shadow_vfta when hw_vlan_filter is active.
Otherwise, we should restore the previous filtering behavior.

Fixes: f003fc383487("vmxnet3: enable vlan filtering")
Cc: stable@dpdk.org

Signed-off-by: Chas Williams <ciwillia@brocade.com>
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index ab5a824..3910991 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -1219,7 +1219,10 @@ vmxnet3_dev_promiscuous_disable(struct rte_eth_dev *dev)
 	struct vmxnet3_hw *hw = dev->data->dev_private;
 	uint32_t *vf_table = hw->shared->devRead.rxFilterConf.vfTable;
 
-	memcpy(vf_table, hw->shadow_vfta, VMXNET3_VFT_TABLE_SIZE);
+	if (dev->data->dev_conf.rxmode.hw_vlan_filter)
+		memcpy(vf_table, hw->shadow_vfta, VMXNET3_VFT_TABLE_SIZE);
+	else
+		memset(vf_table, 0xff, VMXNET3_VFT_TABLE_SIZE);
 	vmxnet3_dev_set_rxmode(hw, VMXNET3_RXM_PROMISC, 0);
 	VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD,
 			       VMXNET3_CMD_UPDATE_VLAN_FILTERS);
-- 
2.1.4

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

* Re: [PATCH] net/vmxnet3: restore correct filtering
  2017-07-24 14:22 [PATCH] net/vmxnet3: restore correct filtering Charles (Chas) Williams
@ 2017-07-30 21:38 ` Thomas Monjalon
  2017-08-01 14:02   ` Shrikrishna Khare
  2017-08-01 23:41 ` Shrikrishna Khare
  2017-08-02  1:36 ` Shrikrishna Khare
  2 siblings, 1 reply; 8+ messages in thread
From: Thomas Monjalon @ 2017-07-30 21:38 UTC (permalink / raw)
  To: skhare; +Cc: dev, Charles (Chas) Williams, stable

24/07/2017 16:22, Charles (Chas) Williams:
> We should only restore shadow_vfta when hw_vlan_filter is active.
> Otherwise, we should restore the previous filtering behavior.
> 
> Fixes: f003fc383487("vmxnet3: enable vlan filtering")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Chas Williams <ciwillia@brocade.com>

Any review from VMware please?

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

* Re: [PATCH] net/vmxnet3: restore correct filtering
  2017-07-30 21:38 ` Thomas Monjalon
@ 2017-08-01 14:02   ` Shrikrishna Khare
  0 siblings, 0 replies; 8+ messages in thread
From: Shrikrishna Khare @ 2017-08-01 14:02 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: skhare, dev, Charles (Chas) Williams, stable



On Sun, 30 Jul 2017, Thomas Monjalon wrote:

> 24/07/2017 16:22, Charles (Chas) Williams:
> > We should only restore shadow_vfta when hw_vlan_filter is active.
> > Otherwise, we should restore the previous filtering behavior.
> > 
> > Fixes: f003fc383487("vmxnet3: enable vlan filtering")
> > Cc: stable@dpdk.org
> > 
> > Signed-off-by: Chas Williams <ciwillia@brocade.com>
> 
> Any review from VMware please?

I will reply back on this later today.

Thanks,
Shri

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

* Re: [PATCH] net/vmxnet3: restore correct filtering
  2017-07-24 14:22 [PATCH] net/vmxnet3: restore correct filtering Charles (Chas) Williams
  2017-07-30 21:38 ` Thomas Monjalon
@ 2017-08-01 23:41 ` Shrikrishna Khare
  2017-08-01 23:47   ` Charles (Chas) Williams
  2017-08-02  1:36 ` Shrikrishna Khare
  2 siblings, 1 reply; 8+ messages in thread
From: Shrikrishna Khare @ 2017-08-01 23:41 UTC (permalink / raw)
  To: Charles (Chas) Williams; +Cc: dev, skhare, stable



On Mon, 24 Jul 2017, Charles (Chas) Williams wrote:

> We should only restore shadow_vfta when hw_vlan_filter is active.
> Otherwise, we should restore the previous filtering behavior.
> 
> Fixes: f003fc383487("vmxnet3: enable vlan filtering")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Chas Williams <ciwillia@brocade.com>
> ---
>  drivers/net/vmxnet3/vmxnet3_ethdev.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> index ab5a824..3910991 100644
> --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
> +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> @@ -1219,7 +1219,10 @@ vmxnet3_dev_promiscuous_disable(struct rte_eth_dev *dev)
>  	struct vmxnet3_hw *hw = dev->data->dev_private;
>  	uint32_t *vf_table = hw->shared->devRead.rxFilterConf.vfTable;
>  
> -	memcpy(vf_table, hw->shadow_vfta, VMXNET3_VFT_TABLE_SIZE);
> +	if (dev->data->dev_conf.rxmode.hw_vlan_filter)
> +		memcpy(vf_table, hw->shadow_vfta, VMXNET3_VFT_TABLE_SIZE);
> +	else
> +		memset(vf_table, 0xff, VMXNET3_VFT_TABLE_SIZE);

>From the device emulation standpoint, vf_table array set to all 1s means 
that rx filtering is enabled but all vlan ID are allowed, while vf_table 
array set to all 0s means that no vlan ID filtering is done.

So, it is better to go with all 0s rather than all 1s, it is also more 
efficient for the emulation.

This is an existing problem in vmxnet3_dev_vlan_offload_set as well.

>  	vmxnet3_dev_set_rxmode(hw, VMXNET3_RXM_PROMISC, 0);
>  	VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD,
>  			       VMXNET3_CMD_UPDATE_VLAN_FILTERS);
> -- 
> 2.1.4
> 
> 

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

* Re: [PATCH] net/vmxnet3: restore correct filtering
  2017-08-01 23:41 ` Shrikrishna Khare
@ 2017-08-01 23:47   ` Charles (Chas) Williams
  2017-08-02  1:23     ` Shrikrishna Khare
  0 siblings, 1 reply; 8+ messages in thread
From: Charles (Chas) Williams @ 2017-08-01 23:47 UTC (permalink / raw)
  To: Shrikrishna Khare; +Cc: dev, skhare, stable



On 08/01/2017 07:41 PM, Shrikrishna Khare wrote:
>
>
> On Mon, 24 Jul 2017, Charles (Chas) Williams wrote:
>
>> We should only restore shadow_vfta when hw_vlan_filter is active.
>> Otherwise, we should restore the previous filtering behavior.
>>
>> Fixes: f003fc383487("vmxnet3: enable vlan filtering")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Chas Williams <ciwillia@brocade.com>
>> ---
>>  drivers/net/vmxnet3/vmxnet3_ethdev.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
>> index ab5a824..3910991 100644
>> --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
>> +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
>> @@ -1219,7 +1219,10 @@ vmxnet3_dev_promiscuous_disable(struct rte_eth_dev *dev)
>>  	struct vmxnet3_hw *hw = dev->data->dev_private;
>>  	uint32_t *vf_table = hw->shared->devRead.rxFilterConf.vfTable;
>>
>> -	memcpy(vf_table, hw->shadow_vfta, VMXNET3_VFT_TABLE_SIZE);
>> +	if (dev->data->dev_conf.rxmode.hw_vlan_filter)
>> +		memcpy(vf_table, hw->shadow_vfta, VMXNET3_VFT_TABLE_SIZE);
>> +	else
>> +		memset(vf_table, 0xff, VMXNET3_VFT_TABLE_SIZE);
>
> From the device emulation standpoint, vf_table array set to all 1s means
> that rx filtering is enabled but all vlan ID are allowed, while vf_table
> array set to all 0s means that no vlan ID filtering is done.
>
> So, it is better to go with all 0s rather than all 1s, it is also more
> efficient for the emulation.
>
> This is an existing problem in vmxnet3_dev_vlan_offload_set as well.

That may be the case, but this patch isn't the place to address that.
If this needs changed, there should be a follow on patch that makes
this change.

>
>>  	vmxnet3_dev_set_rxmode(hw, VMXNET3_RXM_PROMISC, 0);
>>  	VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD,
>>  			       VMXNET3_CMD_UPDATE_VLAN_FILTERS);
>> --
>> 2.1.4
>>
>>

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

* Re: [PATCH] net/vmxnet3: restore correct filtering
  2017-08-01 23:47   ` Charles (Chas) Williams
@ 2017-08-02  1:23     ` Shrikrishna Khare
  0 siblings, 0 replies; 8+ messages in thread
From: Shrikrishna Khare @ 2017-08-02  1:23 UTC (permalink / raw)
  To: Charles (Chas) Williams; +Cc: dev, skhare, stable



On Tue, 1 Aug 2017, Charles (Chas) Williams wrote:

> 
> 
> On 08/01/2017 07:41 PM, Shrikrishna Khare wrote:
> > 
> > 
> > On Mon, 24 Jul 2017, Charles (Chas) Williams wrote:
> > 
> > > We should only restore shadow_vfta when hw_vlan_filter is active.
> > > Otherwise, we should restore the previous filtering behavior.
> > > 
> > > Fixes: f003fc383487("vmxnet3: enable vlan filtering")
> > > Cc: stable@dpdk.org
> > > 
> > > Signed-off-by: Chas Williams <ciwillia@brocade.com>
> > > ---
> > >  drivers/net/vmxnet3/vmxnet3_ethdev.c | 5 ++++-
> > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c
> > > b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> > > index ab5a824..3910991 100644
> > > --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
> > > +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> > > @@ -1219,7 +1219,10 @@ vmxnet3_dev_promiscuous_disable(struct rte_eth_dev
> > > *dev)
> > >  	struct vmxnet3_hw *hw = dev->data->dev_private;
> > >  	uint32_t *vf_table = hw->shared->devRead.rxFilterConf.vfTable;
> > > 
> > > -	memcpy(vf_table, hw->shadow_vfta, VMXNET3_VFT_TABLE_SIZE);
> > > +	if (dev->data->dev_conf.rxmode.hw_vlan_filter)
> > > +		memcpy(vf_table, hw->shadow_vfta, VMXNET3_VFT_TABLE_SIZE);
> > > +	else
> > > +		memset(vf_table, 0xff, VMXNET3_VFT_TABLE_SIZE);
> > 
> > From the device emulation standpoint, vf_table array set to all 1s means
> > that rx filtering is enabled but all vlan ID are allowed, while vf_table
> > array set to all 0s means that no vlan ID filtering is done.
> > 
> > So, it is better to go with all 0s rather than all 1s, it is also more
> > efficient for the emulation.
> > 
> > This is an existing problem in vmxnet3_dev_vlan_offload_set as well.
> 
> That may be the case, but this patch isn't the place to address that.
> If this needs changed, there should be a follow on patch that makes
> this change.

Fair enough. You have my ack for this patch.

> 
> > 
> > >  	vmxnet3_dev_set_rxmode(hw, VMXNET3_RXM_PROMISC, 0);
> > >  	VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD,
> > >  			       VMXNET3_CMD_UPDATE_VLAN_FILTERS);
> > > --
> > > 2.1.4
> > > 
> > > 
> 

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

* Re: [PATCH] net/vmxnet3: restore correct filtering
  2017-07-24 14:22 [PATCH] net/vmxnet3: restore correct filtering Charles (Chas) Williams
  2017-07-30 21:38 ` Thomas Monjalon
  2017-08-01 23:41 ` Shrikrishna Khare
@ 2017-08-02  1:36 ` Shrikrishna Khare
  2017-08-03 20:14   ` Thomas Monjalon
  2 siblings, 1 reply; 8+ messages in thread
From: Shrikrishna Khare @ 2017-08-02  1:36 UTC (permalink / raw)
  To: Charles (Chas) Williams; +Cc: dev, skhare, stable



On Mon, 24 Jul 2017, Charles (Chas) Williams wrote:

> We should only restore shadow_vfta when hw_vlan_filter is active.
> Otherwise, we should restore the previous filtering behavior.
> 
> Fixes: f003fc383487("vmxnet3: enable vlan filtering")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Chas Williams <ciwillia@brocade.com>

Acked-by: Shrikrishna Khare <skhare@vmware.com>

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

* Re: [PATCH] net/vmxnet3: restore correct filtering
  2017-08-02  1:36 ` Shrikrishna Khare
@ 2017-08-03 20:14   ` Thomas Monjalon
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Monjalon @ 2017-08-03 20:14 UTC (permalink / raw)
  To: Charles (Chas) Williams; +Cc: dev, Shrikrishna Khare, skhare, stable

> > We should only restore shadow_vfta when hw_vlan_filter is active.
> > Otherwise, we should restore the previous filtering behavior.
> > 
> > Fixes: f003fc383487("vmxnet3: enable vlan filtering")
> > Cc: stable@dpdk.org
> > 
> > Signed-off-by: Chas Williams <ciwillia@brocade.com>
> 
> Acked-by: Shrikrishna Khare <skhare@vmware.com>

Applied, thanks

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

end of thread, other threads:[~2017-08-03 20:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-24 14:22 [PATCH] net/vmxnet3: restore correct filtering Charles (Chas) Williams
2017-07-30 21:38 ` Thomas Monjalon
2017-08-01 14:02   ` Shrikrishna Khare
2017-08-01 23:41 ` Shrikrishna Khare
2017-08-01 23:47   ` Charles (Chas) Williams
2017-08-02  1:23     ` Shrikrishna Khare
2017-08-02  1:36 ` Shrikrishna Khare
2017-08-03 20:14   ` Thomas Monjalon

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.