From patchwork Mon Feb 5 01:51:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yanglong Wu X-Patchwork-Id: 34934 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9A7431B1BA; Mon, 5 Feb 2018 02:51:45 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 364A41B1B0 for ; Mon, 5 Feb 2018 02:51:43 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Feb 2018 17:51:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,462,1511856000"; d="scan'208";a="15835077" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga006.jf.intel.com with ESMTP; 04 Feb 2018 17:51:40 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 4 Feb 2018 17:51:40 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.124]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.253]) with mapi id 14.03.0319.002; Mon, 5 Feb 2018 09:51:39 +0800 From: "Wu, Yanglong" To: Shahaf Shuler , "dev@dpdk.org" CC: "Lu, Wenzhuo" Thread-Topic: [PATCH] app/testpmd:vlan filter fail Thread-Index: AQHTm+RjZ+iGej6hEECmzpQoDbs9ZKOTRHuAgAHLLcA= Date: Mon, 5 Feb 2018 01:51:38 +0000 Message-ID: References: <20180202050950.64400-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTk2NmNhOGUtZjZkNC00Mjk1LWJmZWItNTBjY2EwMzRjMWIwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Ik5nUSt3TzlzM2VwcUNGb1c3ZVhTZHA0QmNWUmpIUHNENExFV2s5UmYzS0U9In0= x-ctpclassification: CTP_NT x-originating-ip: [10.239.127.40] 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, Thanks for your review. I got it! Yanglong Wu -----Original Message----- From: Shahaf Shuler [mailto:shahafs@mellanox.com] Sent: Sunday, February 4, 2018 2:27 PM To: Wu, Yanglong ; dev@dpdk.org Cc: Lu, Wenzhuo Subject: RE: [PATCH] app/testpmd:vlan filter fail Hi Wu, Indeed there is an issue here, but this is not the right fix. Friday, February 2, 2018 7:10 AM, Yanglong Wu: > Subject: [PATCH] app/testpmd:vlan filter fail > > Removing out port_conf.rxmode.hw_vlan_filter = 1 will let it equal to > 0 and port_conf.rxmode.offloads is assigned as 0 again if > hw_vlan_filter = 1. So it will always lead to fail for vlan filter > setting > > Fix:0074d02fc(convert to new Rx offloads API) > Signed-off-by: Yanglong Wu > --- > app/test-pmd/testpmd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index > 5dc8ccac5..0751e573c 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -2328,7 +2328,7 @@ init_port_dcb_config(portid_t pid, > retval = get_eth_dcb_conf(&port_conf, dcb_mode, num_tcs, pfc_en); > if (retval < 0) > return retval; > - port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_VLAN_FILTER; > + port_conf.rxmode.hw_vlan_filter = 1; The VLAN filter resets because the rxmode.ignore_offload_bitfield is not set. If it was set, the ethdev rxmode convert functions would have convert the new flag to the old API (rxmode.hw_vlan_filter). Am not much familiar with this configuration but here is a suggested fix: The port_conf for the dcb configuration will inherit the same configuration of the port (which has the ignore_offload_bitfield set). Otherwise, at least the rxmode.ignore_offload_bitfield must be set. > > /** > * Write the configuration into the device. > -- > 2.11.0 diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index d8ac43268..caf282386 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2324,6 +2324,8 @@ init_port_dcb_config(portid_t pid, rte_port = &ports[pid]; memset(&port_conf, 0, sizeof(struct rte_eth_conf)); + port_conf.rxmode = rte_port->dev_conf.rxmode; + port_conf.txmode = rte_port->dev_conf.txmode; /* Enter DCB configuration status */ dcb_config = 1;