From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 225DD532C for ; Fri, 2 Feb 2018 04:38:16 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Feb 2018 19:38:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,445,1511856000"; d="scan'208";a="31370081" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga002.jf.intel.com with ESMTP; 01 Feb 2018 19:38:15 -0800 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 1 Feb 2018 19:38:15 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 1 Feb 2018 19:38:15 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.124]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.116]) with mapi id 14.03.0319.002; Fri, 2 Feb 2018 11:37:18 +0800 From: "Wu, Yanglong" To: Shahaf Shuler , "dev@dpdk.org" CC: "Lu, Wenzhuo" Thread-Topic: [PATCH] app/testpmd:vlan filter fail Thread-Index: AQHTmvwPIbemLSmdr0q2TkF/BunQn6OOhx2AgAHJ4vA= Date: Fri, 2 Feb 2018 03:37:17 +0000 Message-ID: References: <20180201012653.173890-1-yanglong.wu@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDViNmZmNGEtNTg2ZC00MWZmLTg3MWMtNzU3MTZhODhiZDQ1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjZpNnJMcjlGRkxCd0hUQXhoMndrWGN6dkJhSURCemtQY1VzSzl0R0o3MnM9In0= x-ctpclassification: CTP_NT x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] app/testpmd:vlan filter fail 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: Fri, 02 Feb 2018 03:38:17 -0000 Hi, This patch is wrong, but there is bug absolutely.=20 The problem can be stated as following=1B$B!'=1B(B in your patch(0074d02fc), @@ -2224,7 +2221,7 @@ init_port_dcb_config(portid_t pid, retval =3D get_eth_dcb_conf(&port_conf, dcb_mode, num_tcs, pfc_en); if (retval < 0) return retval; - port_conf.rxmode.hw_vlan_filter =3D 1; + port_conf.rxmode.offloads |=3D DEV_RX_OFFLOAD_VLAN_FILTER; You remove out port_conf.rxmode.hw_vlan_filter =3D 1 and assign port_conf.r= xmode.offloads directly, so here port_conf.rxmode.hw_vlan_filter will equal= to 0 and port_conf.rxmode.offloads will equal to DEV_RX_OFFLOAD_VLAN_FILTE= R, right? =20 But next in the function rte_eth_dev_configure(pid, 0, 0, &port_conf) --> = rte_eth_convert_rx_offload_bitfield , it will assign port_conf.rxmode.offlo= ads according to value of port_conf.rxmode.hw_vlan_filter again. As you re= move out port_conf.rxmode.hw_vlan_filter =3D 1 and it equal to 0 now, port= _conf.rxmode.offloads is assigned as 0 again. So it will always lead to fai= l for vlan filter setting. So I think port_Conf.rxmode.hw_vlan_filter should equeal to 1 and removing = out port_conf.rxmode.hw_vlan_filter =3D 1 will leads it assigning as a wro= ng number and vlan filter failing. So port_conf.rxmode.hw_vlan_filter =3D 1= shouldn=1B$B!G=1B(Bt be removed out, do you think so?=20 I will add this line and sent patch again Wu yanglong -----Original Message----- From: Shahaf Shuler [mailto:shahafs@mellanox.com]=20 Sent: Thursday, February 1, 2018 1:58 PM To: Wu, Yanglong ; dev@dpdk.org Cc: Lu, Wenzhuo Subject: RE: [PATCH] app/testpmd:vlan filter fail Thursday, February 1, 2018 3:27 AM, Yanglong Wu: > And-operartion with a constant will > always lead to fail for vlan filter. It will work after dev->data->dev_conf.rxmode.offloads |=3D DEV_RX_OFFLOAD= _VLAN_FILTER , right? I don't understand what this patch tries to fix.=20 >=20 > fix:0074d02fc(convert to new Rx offloads API) > Signed-off-by: Yanglong Wu > --- > lib/librte_ether/rte_ethdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/lib/librte_ether/rte_ethdev.c=20 > b/lib/librte_ether/rte_ethdev.c index f285ba278..d468bb4a1 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -2288,7 +2288,7 @@ rte_eth_dev_vlan_filter(uint16_t port_id,=20 > uint16_t vlan_id, int on) >=20 > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev =3D &rte_eth_devices[port_id]; > - if (!(dev->data->dev_conf.rxmode.offloads & > + if (!(dev->data->dev_conf.rxmode.offloads || > DEV_RX_OFFLOAD_VLAN_FILTER)) { > RTE_PMD_DEBUG_TRACE("port %d: vlan-filtering disabled\n", port_id); > return -ENOSYS; > -- > 2.11.0