From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EX13-EDG-OU-002.vmware.com (ex13-edg-ou-002.vmware.com [208.91.0.190]) by dpdk.org (Postfix) with ESMTP id 52E5BA0DC; Wed, 2 Aug 2017 01:41:23 +0200 (CEST) Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Tue, 1 Aug 2017 16:40:52 -0700 Received: from shri-linux.eng.vmware.com (shri-linux.eng.vmware.com [10.33.72.16]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 7ECC5405A8; Tue, 1 Aug 2017 16:41:22 -0700 (PDT) Date: Tue, 1 Aug 2017 16:41:22 -0700 From: Shrikrishna Khare To: "Charles (Chas) Williams" CC: , , In-Reply-To: <1500906162-18009-1-git-send-email-ciwillia@brocade.com> Message-ID: References: <1500906162-18009-1-git-send-email-ciwillia@brocade.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Received-SPF: None (EX13-EDG-OU-002.vmware.com: skhare@shri-linux.eng.vmware.com does not designate permitted sender hosts) Subject: Re: [dpdk-dev] [PATCH] net/vmxnet3: restore correct filtering X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Aug 2017 23:41:23 -0000 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 > --- > 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 > >