From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 25010A00C5; Mon, 6 Jul 2020 11:10:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7EC961D8DE; Mon, 6 Jul 2020 11:10:45 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 7362B1D711 for ; Mon, 6 Jul 2020 11:10:43 +0200 (CEST) IronPort-SDR: DRxTFQjYsnZ1sWY8zdpeB/yKz6X9JM90Q68nW16DmYXRTp4LOB6GUwRus3YcKoe/EkjVQ0bgCD tj2JvSoZUi9g== X-IronPort-AV: E=McAfee;i="6000,8403,9673"; a="146459020" X-IronPort-AV: E=Sophos;i="5.75,318,1589266800"; d="scan'208";a="146459020" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2020 02:10:42 -0700 IronPort-SDR: rGsZk6ykg3gE5sH+wT4Xghb1qqyr6wz3xw1zZfH0J/dFl4f1vY/H0e95OH9FpmFBm3Xv2vLbRO YTeBYMMgOmNw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,318,1589266800"; d="scan'208";a="427030013" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga004.jf.intel.com with ESMTP; 06 Jul 2020 02:10:42 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 6 Jul 2020 02:10:41 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 6 Jul 2020 02:10:41 -0700 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (104.47.44.58) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 6 Jul 2020 02:10:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e9B9V2RwguOnrjoFgxdMc0t6JAhKy93d/68oHc8ieobXYXMHYoOp7UkNQNQzi03vzfgf2YLjWP1pHlaRLieL36dVuSM1gJrBRA+5Be48ZGHWE6fNaFZb6oTshT43Zt5Nbfy1OA4sCwT2Yrug0skQhqO/I51biCa1rULGr3zVcjpkk9lqX7cOAOEDTYQloPE7pymovb0JOEcruOBseaCGiK3Uj4+fnO7jXsv2DjZ7ZjdGNVmqtqLrB2xyC6OWo9FneZirY+0W94fNkLr/0jqmeA0Dz9iZnxFESoZLFmqvZkdMAQJQEf+kQXUya6I5vWn1e6ck0ckX2+cP9tPd/98xGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mw3pD0jLB9pHs+w13byiEUbkBSbXG9zwBecHPF441Qc=; b=nNmVFSU9p2JBrrVWz+55ybkVLwEXyFiCesMyVFgl5mDv+IIH5HGgOMYx8NbIqij4f7vtwxcr/uDlsny+2gG6qdRdD0Pisoci676y+SliadnmZ4Jmku/vegB3bQxbGqRIKtB3nfMYfRV8QdpLbA5x2DcS7jZuk3XurJaP83nxGivbxd+XDfXU2eugsP0P6MXBsL7RhLnUEcypX0LfH8+rkBhDbWDkPN2xzoVkBPwSIAEyvyO3hSI+vLuqUVQQciPcpbxEJhq6m+iQd51MoLXfYGhvfUHdYdc/fUCT7/F8GyFvdbz6nKlv+R0yo6rmqCbpy1pp9D7Bh7QM3Tx89qHFxA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mw3pD0jLB9pHs+w13byiEUbkBSbXG9zwBecHPF441Qc=; b=zi3UmwIftqPiE3Y+aJOj1jPDEVFAoLY8siDLHN8dAkBxMQ3RBo3AeEJEpFPzel6mOYQLY8VhdsUGmZ5avx4RSzAACrsf/XuH0oykcdUgG+rpWO36KTyqWpNtlRDsR7y23Umf6dSgRoSHsXcMKySuCeHl7CCsViZpCN+b020TzSo= Received: from BN6PR11MB0017.namprd11.prod.outlook.com (2603:10b6:405:6c::34) by BN7PR11MB2706.namprd11.prod.outlook.com (2603:10b6:406:b3::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22; Mon, 6 Jul 2020 09:10:39 +0000 Received: from BN6PR11MB0017.namprd11.prod.outlook.com ([fe80::c8eb:f4c9:5b58:3120]) by BN6PR11MB0017.namprd11.prod.outlook.com ([fe80::c8eb:f4c9:5b58:3120%6]) with mapi id 15.20.3153.029; Mon, 6 Jul 2020 09:10:39 +0000 From: "Yang, Qiming" To: "Di, ChenxuX" , "dev@dpdk.org" CC: "Guo, Jia" Thread-Topic: [PATCH v3 3/5] app/testpmd: re-implement commands by using private API Thread-Index: AQHWT4RP1X4F547cekKJ1UqMGHPasqj6SiSg Date: Mon, 6 Jul 2020 09:10:39 +0000 Message-ID: References: <20200611060142.75465-1-chenxux.di@intel.com> <20200701082451.34511-1-chenxux.di@intel.com> <20200701082451.34511-4-chenxux.di@intel.com> In-Reply-To: <20200701082451.34511-4-chenxux.di@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.45] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d62bdd52-a536-44af-74a3-08d8218c7405 x-ms-traffictypediagnostic: BN7PR11MB2706: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:628; x-forefront-prvs: 04569283F9 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 33SgR6TG6Yg0eSejHy2W5526injgAs51XsvB4wDPoDsXYoqt9eoQGOzx35jaBReChDhVOsVrp0qJcUNPYKb1coMu5ZyDFpGLLz2EvB3TNIYmk5fY6vvfPhxoVGdNEmhGXyqYl2lZi2UGeOwItVquv6115k/wWv3+E5JUmWGc/eDGgf1lrAhnQ9qzQwRmga23hdeNqjhvD9296xwuiBEb700CqOY/MidnCZXhl1WPKzN+07L209vs2ta0Yct231jtjONEcOrnMtIeLx/qjNpzYu4nTrsZfvwlhh0jBpgubZfj9xMW+2LDCMaEeQDNZrvHG2tjSakJ+P7yKC915LOHPQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN6PR11MB0017.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(136003)(396003)(366004)(346002)(376002)(39860400002)(6506007)(53546011)(71200400001)(26005)(8676002)(2906002)(186003)(64756008)(66556008)(66946007)(66476007)(76116006)(66446008)(7696005)(478600001)(110136005)(316002)(52536014)(86362001)(4326008)(5660300002)(33656002)(8936002)(9686003)(55016002)(83380400001)(107886003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: 3dpCmF54LFIubaBYlH3RedfUCtBMP2NngFl6YjfHRIEOq310BNQ3yytKOXbAc4uwXQAIDoqRQLwdVeLf8Echi4Ar8j48MaDWjHjwRvt8oQrenGJktS66yFvlxTbsoa4/XoEBAisgaVxEWaBRwvfMolEKzw2IEBBUXV2LhGaeWz1JQneKywqTK7Rhg7WTVSAR9luXdbqyMn/hVuen8mod1Zc904uRNomep3fzZXmNXEMR9cBKZvIksca7EHcFjTXM0h4N+5mI0U9vRd03GLUP1jF8xvt/VlvJ1O+M3wypJKbwMsTn1FDFdz2AzhpN/hriAdWp5u0CKSuRm0AfKgFbwITFy7zU89drID5UY5UCAvq1TdSX6kehIHsCJ5aHOG16OS3g3CnzgajNdtdWYigcyT6QrmRsXdr26/slJNGxqSJ+pgiwjkOCE5ocYqaQItDeDpOaGXZI5HUHckMWiYIUVoV2QdVN5hneWlaNaYSVkDorMASh3xf9j3Xjg7wArOcc Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN6PR11MB0017.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d62bdd52-a536-44af-74a3-08d8218c7405 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jul 2020 09:10:39.6039 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: WR6CWPM12xXzJW10gssBvI7ztoV0DnUk4fg+3n3fSFvGuVSteJm2F/oAi7qyhoLb1gSlA4Ll6mOZZ4SV3TgDAg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR11MB2706 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3 3/5] app/testpmd: re-implement commands by using private API 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" > -----Original Message----- > From: Di, ChenxuX > Sent: Wednesday, July 1, 2020 16:25 > To: dev@dpdk.org > Cc: Yang, Qiming ; Guo, Jia ; D= i, > ChenxuX > Subject: [PATCH v3 3/5] app/testpmd: re-implement commands by using > private API >=20 > The legacy filter API will be superseded. This patch use private api to c= hange > the implementation of commands global_config gre-key-len > and show port fdir >=20 > Signed-off-by: Chenxu Di > --- > app/test-pmd/cmdline.c | 6 ++++ > app/test-pmd/config.c | 65 +++++++++++++++++++++++++++++++++++--- > ---- > 2 files changed, 61 insertions(+), 10 deletions(-) >=20 > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > 996a49876..466c54aa9 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -9287,6 +9287,12 @@ cmd_global_config_parsed(void *parsed_result, > conf.cfg.gre_key_len =3D res->len; > ret =3D rte_eth_dev_filter_ctrl(res->port_id, RTE_ETH_FILTER_NONE, > RTE_ETH_FILTER_SET, &conf); > + > +#ifdef RTE_LIBRTE_I40E_PMD > + if (ret =3D=3D -ENOTSUP) > + ret =3D rte_pmd_i40e_set_gre_key_len(res->port_id, res- > >len); #endif > + > if (ret !=3D 0) > printf("Global config error\n"); > } > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index > a7112c998..ed341c715 100644 > --- a/app/test-pmd/config.c > +++ b/app/test-pmd/config.c > @@ -3727,6 +3727,50 @@ print_fdir_flow_type(uint32_t flow_types_mask) > printf("\n"); > } >=20 > +static int > +get_fdir_info(portid_t port_id, struct rte_eth_fdir_info *fdir_info) { > + int ret; > + > + ret =3D rte_eth_dev_filter_supported(port_id, > + RTE_ETH_FILTER_FDIR); > + if (!ret) > + rte_eth_dev_filter_ctrl(port_id, RTE_ETH_FILTER_FDIR, > + RTE_ETH_FILTER_INFO, fdir_info); > + > +#ifdef RTE_LIBRTE_I40E_PMD > + if (ret =3D=3D -ENOTSUP) > + ret =3D rte_pmd_i40e_get_fdir_info(port_id, fdir_info); #endif No return value check. > #ifdef > +RTE_LIBRTE_IXGBE_PMD > + if (ret =3D=3D -ENOTSUP) > + ret =3D rte_pmd_ixgbe_get_fdir_info(port_id, fdir_info); > #endif We'd better use If(ret =3D=3D -ENOTSUP) #ifdef RTE_LIBRTE_I40E_PMD ... #endif #ifdef RTE_LIBRTE_IXGBE_PMD ... #endif Same issue in patch 5 > + return ret; > +} > + > +static int > +get_fdir_stat(portid_t port_id, struct rte_eth_fdir_stats *fdir_stat) { > + int ret; > + > + ret =3D rte_eth_dev_filter_supported(port_id, > + RTE_ETH_FILTER_FDIR); > + if (!ret) > + rte_eth_dev_filter_ctrl(port_id, RTE_ETH_FILTER_FDIR, > + RTE_ETH_FILTER_STATS, fdir_stat); > + > +#ifdef RTE_LIBRTE_I40E_PMD > + if (ret =3D=3D -ENOTSUP) > + ret =3D rte_pmd_i40e_get_fdir_stats(port_id, fdir_stat); #endif > #ifdef > +RTE_LIBRTE_IXGBE_PMD > + if (ret =3D=3D -ENOTSUP) > + ret =3D rte_pmd_ixgbe_get_fdir_stats(port_id, fdir_stat); > #endif Same as above > + return ret; > +} > + > void > fdir_get_infos(portid_t port_id) > { > @@ -3738,19 +3782,20 @@ fdir_get_infos(portid_t port_id) >=20 > if (port_id_is_invalid(port_id, ENABLED_WARN)) > return; > - ret =3D rte_eth_dev_filter_supported(port_id, RTE_ETH_FILTER_FDIR); > - if (ret < 0) { > - printf("\n FDIR is not supported on port %-2d\n", > - port_id); > - return; > - } >=20 > memset(&fdir_info, 0, sizeof(fdir_info)); > - rte_eth_dev_filter_ctrl(port_id, RTE_ETH_FILTER_FDIR, > - RTE_ETH_FILTER_INFO, &fdir_info); > + ret =3D get_fdir_info(port_id, &fdir_info); > + if (ret) { > + printf("Get fdir infos error: (%s)\n", strerror(-ret)); > + return; > + } > memset(&fdir_stat, 0, sizeof(fdir_stat)); > - rte_eth_dev_filter_ctrl(port_id, RTE_ETH_FILTER_FDIR, > - RTE_ETH_FILTER_STATS, &fdir_stat); > + ret =3D get_fdir_stat(port_id, &fdir_stat); Why you add new function here, it's no need to do that > + if (ret) { > + printf("Get fdir status error: (%s)\n", strerror(-ret)); > + return; > + } > + > printf("\n %s FDIR infos for port %-2d %s\n", > fdir_stats_border, port_id, fdir_stats_border); > printf(" MODE: "); > -- > 2.17.1