From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 8C16D2BA1 for ; Tue, 27 Sep 2016 04:42:21 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP; 26 Sep 2016 19:42:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,402,1470726000"; d="scan'208";a="1057027931" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga002.jf.intel.com with ESMTP; 26 Sep 2016 19:42:20 -0700 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.248.2; Mon, 26 Sep 2016 19:42:19 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.234]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.118]) with mapi id 14.03.0248.002; Tue, 27 Sep 2016 10:42:17 +0800 From: "Wu, Jingjing" To: "Frederico.Cadete-ext@oneaccess-net.com" , "dev@dpdk.org" CC: "frederico@cadete.eu" , "De Lara Guarch, Pablo" Thread-Topic: [dpdk-dev] [PATCH] testpmd: fix fdir command on MAC and tunnel modes Thread-Index: AQHSGGbpbnp/m5eI7U+WLH//MgtZ2qCMnpaA Date: Tue, 27 Sep 2016 02:42:17 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F80E273098@SHSMSX103.ccr.corp.intel.com> References: <1471943445-20696-1-git-send-email-Frederico.Cadete-ext@oneaccess-net.com> In-Reply-To: <1471943445-20696-1-git-send-email-Frederico.Cadete-ext@oneaccess-net.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] testpmd: fix fdir command on MAC and tunnel modes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2016 02:42:22 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Frederico.Cadete- > ext@oneaccess-net.com > Sent: Tuesday, August 23, 2016 5:11 PM > To: dev@dpdk.org > Cc: frederico@cadete.eu; Frederico Cadete > Subject: [dpdk-dev] [PATCH] testpmd: fix fdir command on MAC and tunnel > modes >=20 > From: Frederico Cadete >=20 > The flow_director_filter commands has a pf|vf option for most modes > except for MAC-VLAN and tunnel. On Intel NIC's these modes are not > supported under virtualized environments. > But the application was checking that this field was parsed for these cas= es, > even though this token is not registered with the cmdline parser. >=20 > This patch skips checking of this field for the commands that don't accep= t it. >=20 > Signed-off-by: Frederico Cadete > --- > app/test-pmd/cmdline.c | 32 ++++++++++++++++++-------------- > 1 file changed, 18 insertions(+), 14 deletions(-) >=20 > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > f90befc..f516b1b 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -8502,24 +8502,28 @@ cmd_flow_director_filter_parsed(void > *parsed_result, > else > entry.action.behavior =3D RTE_ETH_FDIR_ACCEPT; >=20 > - if (!strcmp(res->pf_vf, "pf")) > - entry.input.flow_ext.is_vf =3D 0; > - else if (!strncmp(res->pf_vf, "vf", 2)) { > - struct rte_eth_dev_info dev_info; > + if (fdir_conf.mode !=3D RTE_FDIR_MODE_PERFECT_MAC_VLAN && > + fdir_conf.mode !=3D RTE_FDIR_MODE_PERFECT_TUNNEL){ >=20 > - memset(&dev_info, 0, sizeof(dev_info)); > - rte_eth_dev_info_get(res->port_id, &dev_info); > - errno =3D 0; > - vf_id =3D strtoul(res->pf_vf + 2, &end, 10); > - if (errno !=3D 0 || *end !=3D '\0' || vf_id >=3D dev_info.max_vfs) { > + if (!strcmp(res->pf_vf, "pf")) > + entry.input.flow_ext.is_vf =3D 0; > + else if (!strncmp(res->pf_vf, "vf", 2)) { > + struct rte_eth_dev_info dev_info; > + > + memset(&dev_info, 0, sizeof(dev_info)); > + rte_eth_dev_info_get(res->port_id, &dev_info); > + errno =3D 0; > + vf_id =3D strtoul(res->pf_vf + 2, &end, 10); > + if (errno !=3D 0 || *end !=3D '\0' || vf_id >=3D > dev_info.max_vfs) { > + printf("invalid parameter %s.\n", res->pf_vf); > + return; > + } > + entry.input.flow_ext.is_vf =3D 1; > + entry.input.flow_ext.dst_id =3D (uint16_t)vf_id; > + } else { > printf("invalid parameter %s.\n", res->pf_vf); > return; > } > - entry.input.flow_ext.is_vf =3D 1; > - entry.input.flow_ext.dst_id =3D (uint16_t)vf_id; > - } else { > - printf("invalid parameter %s.\n", res->pf_vf); > - return; > } Thanks for the patch. But with this change the field of pf_vf cannot omit e= ither. I think it still looks confused because it will allow any meaningless strin= g. In=20 MAC_VLAN or TUNNEL mode, why not just use pf. Maybe an optional field supporting on DPDK cmdline library is exactly what = we Are waiting for :) =20 Thanks Jingjing