net/vmxnet3: fix filtering on promiscuous disabling
authorChas Williams <ciwillia@brocade.com>
Mon, 24 Jul 2017 14:22:42 +0000 (10:22 -0400)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 3 Aug 2017 20:23:49 +0000 (22:23 +0200)
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>
drivers/net/vmxnet3/vmxnet3_ethdev.c

index ab5a824..3910991 100644 (file)
@@ -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);