From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7AAB7A0C41; Fri, 27 Aug 2021 09:36:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3C947406B4; Fri, 27 Aug 2021 09:36:23 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id AF95B4067C for ; Fri, 27 Aug 2021 09:36:20 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10088"; a="240130952" X-IronPort-AV: E=Sophos;i="5.84,356,1620716400"; d="scan'208";a="240130952" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2021 00:36:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,356,1620716400"; d="scan'208";a="508647438" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga001.jf.intel.com with ESMTP; 27 Aug 2021 00:36:05 -0700 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Fri, 27 Aug 2021 00:36:05 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Fri, 27 Aug 2021 00:36:05 -0700 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.177) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Fri, 27 Aug 2021 00:36:05 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hrcnDUEwUJZ+OFKg2e5YfTOa2a+PxE1BdnwBNzunJichLksNQ6mE2kS9nckvARrecFxckLP0+ESr8OjrRmvOsiGFwUL/nMO/Lv8sRIz1i8bYEdkufIAac+UNfV9Mdsx/PQVNjPFoVYlvvUSYFuFmoWPCQY/9x0nEDWAlu0V8WE94EfP/skJh8dseUcGClQeU1vaZQkRA9/cDCR3WrfGloMobuAm4FHIyRjnU0C3/VnJ604qyp6KhFo0GYV4y0YmjrrovtLoZ/fjlsmo0/3LqfsF+VeWqfQWv47l6EoIdt9YEoJF3wqqTKestyrZDger/C9ZBnkaPFpNSBCxJCqQ4IQ== 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=7mB4IO66MjohAtCk4aHHUoox66H8LxZjoOcBdMx0Dpg=; b=VwRiMTkobwPqbzt6RtLFgsy5qxqckw6/19MKZcrmRBjCHr6htHGiXNL0GV98v55jflUJUnl5YjwVQ1IS+JWFnVFfoVguY/GReMSFDI8dbe33e9MADZ2z7CVxtMbhZ1++4gsxngF/XF3dz6VKopPP+hVp/mUjwX+xa/ksjNzZrzSY94Wtx90bzpaXkn6gxlpwIUG/OH0vJUouT5VZ8S2WnXPB8tzkmZA7HUHV6ji5bK3IhigVQVk3VAisvGNBCdHuePjT1dqecfIoKpDwwG3zsFr4FTwlO4ppXzVIYCYnXL+Sd3h5d9KEjr6H3FeK8iBVOxV0fS7O3gObYiyfBCCSbA== 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=7mB4IO66MjohAtCk4aHHUoox66H8LxZjoOcBdMx0Dpg=; b=DoN9xb7oYkr6pEZqvBKSmbwN2oHJ8zUy+cqrPmokoWKkcrVRk/ykcAH6WTWGrsVPUFgSkkP4S/AWAMIfXca1IRwoKwr5uuD4IcswZckq6tTtBriEHAePRvF5D5JKgtbrt4HmZcclnUdCMq0alABK36WO2KAUNKD6mZfYtFBShSw= Received: from DM4PR11MB5534.namprd11.prod.outlook.com (2603:10b6:5:391::22) by DM5PR1101MB2089.namprd11.prod.outlook.com (2603:10b6:4:54::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.22; Fri, 27 Aug 2021 07:36:04 +0000 Received: from DM4PR11MB5534.namprd11.prod.outlook.com ([fe80::d019:aaeb:94c0:1c45]) by DM4PR11MB5534.namprd11.prod.outlook.com ([fe80::d019:aaeb:94c0:1c45%8]) with mapi id 15.20.4415.029; Fri, 27 Aug 2021 07:36:04 +0000 From: "Li, Xiaoyun" To: "Wang, Jie1X" , "dev@dpdk.org" CC: "andrew.rybchenko@oktetlabs.ru" , "thomas@monjalon.net" , "Yigit, Ferruh" Thread-Topic: [PATCH v7 2/2] app/testpmd: fix testpmd doesn't show RSS hash offload Thread-Index: AQHXmkl4cfaJolQy+ku4Tuwq1Q+9/6uG9yYg Date: Fri, 27 Aug 2021 07:36:04 +0000 Message-ID: References: <20210824171049.138208-1-jie1x.wang@intel.com> <20210826070924.308368-1-jie1x.wang@intel.com> <20210826070924.308368-3-jie1x.wang@intel.com> In-Reply-To: <20210826070924.308368-3-jie1x.wang@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-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 25d98016-22e0-4f59-874b-08d9692d5353 x-ms-traffictypediagnostic: DM5PR1101MB2089: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4714; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: EF9RqwV/GQQmm0mYiEglciIzJTHSEsiZ0yB9BkQBjUEp5A5y5GaDgLCNT6AV39cMskeUcdV41tSNum1MZuv/Eq3vqTzu9Bm/FRKhKRj6BqstguY3JjfSvcobREYfNz/Vnyp9m1PcUCD5vNOBe5YuhS8DxlQVINBUYTyYCcvlbjuScUnWjLrir7gvGWX4e9Knqr44iy2XAPxQEVczjCeZj2c4rJxVwZfT/8hLUXKYOSuzCdTe2wGXHc6glYiCLYFY0uJXIqDw0v0iH3cH6gdnnktm7j/pukN7Bwb2I/WIhun25S+yn/tfraslUxBXQ52J+YvkmLBzea8d8H9nAWMid8Tk8ho/2XtVDPvuFdbaNidlC53kP7BjJvUC0dpJjyTQ2lTa4cWpf8fbzm+AkWXIc24aCcnXk1XKxfa+cd4Oh6iSdS7IaxZdFfIRDfBVf6B0OOFgiKR95bg6NB3Vp8TYd31V0Pkoie/lNI9Sg6iBhib1ey6bXWJnSgvEBjxLGvxxR2odsmq4PI9/oDmsw7ZG6pv6Ml6tTlK2pB/LDQXJMr5nVrzpH+0jQGQ4KwOdbj59V/Us+8ffyzKSzgYll6ImRGUvX1cwcMY4grFEqJq8ifxw7YIg89b7ktnfNpA8WcscU13AgUM45dO9NqEycKkbfGf6q4jMTVep6OFjN/YXuzi2VmiAlovBZ1IMtN/UkxlqtO357qZjPTqG8WQW+V4nmw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5534.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(136003)(376002)(346002)(39860400002)(396003)(4326008)(107886003)(38070700005)(55016002)(478600001)(71200400001)(8676002)(52536014)(83380400001)(9686003)(7696005)(6506007)(66556008)(54906003)(33656002)(8936002)(5660300002)(66446008)(26005)(38100700002)(122000001)(86362001)(64756008)(66476007)(2906002)(66946007)(53546011)(110136005)(76116006)(186003)(316002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?so00y3Sq/05jkDCPe2Wt4AG+PQnhQQR0z/9Jy30RPRCroGJgURtYdnU9k9w3?= =?us-ascii?Q?pX0n7E/oFDcoAqGWOTgAbACQH6zEkTxTLu6XEh0EBlXq1jkuJGzGRDWr/IBj?= =?us-ascii?Q?GuXgWvsNr5tQsO/5SmDEF2/VSd4HWB6ylyonzsWYSDVPo94nkr40ia5GBdsv?= =?us-ascii?Q?eXF1LoA0T5kIFFj2xTls9vDDRO0sycUydDTT2UMN8jsbBhnkLZkffGnn0NF8?= =?us-ascii?Q?2O6T9hzg5wPUskkF8AtPbJSVnzm8V1HFQXKnJtDGuUkfJeUAkx8meM47JwVA?= =?us-ascii?Q?xG4Pqq3RXtOcC/zYhxs9bVjph6cvAqK8ufOrYMXsY4M4/cpbylviV7V+iT4s?= =?us-ascii?Q?jq0F6CLxvu18M95MoLvKXi1/C1wV8YczRxK9KHJOBFSS1U0LpMvgkee4giNZ?= =?us-ascii?Q?trUVi6HFT42EI83wO1iGEVI640l3Uv6DIUG45sqLyLI/wrQuNYJgniUTQ0eE?= =?us-ascii?Q?QuIKs3ASSkb8WA6Adbxt+omk4Qhi1Sbld5xSk/E/j284XJeQp0EOEXQUnVfD?= =?us-ascii?Q?RC7sSmYrqg8fcNts+Z6+Y7G5Wd/lNOKdff2S8itKUXLZnol82o6KVZyf4I3d?= =?us-ascii?Q?DooteO/KynqJTmgCofYB3Pv9udnZ1wKyCBKt+vwPyqGeCxBU4EJwZ7XLWl3y?= =?us-ascii?Q?Tcpuo3mXY8RpkyolCPBOIslXvLViJXCpz/J8U7nHkx2WSSZ03pVajPXsNt2d?= =?us-ascii?Q?GTkh8FNCRjIpxlVmLD8A+ybQIF9ZfWw0NcX/BEYsk2Ih04sqDx8IG7aE6zW1?= =?us-ascii?Q?kahr0s6iT5lq7mjF7ZKlTE09BMJDL78lyXFEjTFOoCSH899Pl8+HVOwfaIPd?= =?us-ascii?Q?yA8WkmhUI+/6NiKbxDPTxlzbcoUyyPeau3C7FfNU431+qMcvsKMSfgfDrkpZ?= =?us-ascii?Q?no6rcAYK16LStW0ClGHs4iXf6Lq02/eyLekKljktVm/9zt6pmQAPvDhGYljw?= =?us-ascii?Q?5wMsTgmUX2IdJvD0WOVMNCJOvILv8TpzG+5pQrqyDE++c1VVDuN5LDT9uiI3?= =?us-ascii?Q?dVqbPh06ccFcDwrlSEpoElLne2WH4sua3TqfF0FQtM/jQy9Pxvho0Zp1S3sT?= =?us-ascii?Q?tG3viV2eQiz5efMpZoqaVB8NG4Vxc1JbyksnXrZuGuHVonqPNbovHUg6kESn?= =?us-ascii?Q?YTh7lV0p2OYV4udDQ2zocSEzpnZrRcvlOaQYkqYeOjDdlrZkFea1Rrh9eoou?= =?us-ascii?Q?3EUWVQbJh5l0ffBxoBYQDdkH8qhIC5NI+p3P+YYQPK4jBItiIKKtg4I05KVu?= =?us-ascii?Q?hDdXfPoxE1yYmB3s2QEJpSL2eXoh5IsyVF7vRsbHBZECpy3ipCXcpYE2rZDq?= =?us-ascii?Q?5mKlsXHRXCN4rDxN3oOc/AQt?= 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: DM4PR11MB5534.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 25d98016-22e0-4f59-874b-08d9692d5353 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Aug 2021 07:36:04.1386 (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: tT1noEd+VfWHEFGdKFKGuw8akoyKBnEX50IMxbQ86wAkz18Ar9TQpm6dCV+A8ycxSi+HRN9KwifV4hHiJwMbhw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1101MB2089 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v7 2/2] app/testpmd: fix testpmd doesn't show RSS hash offload X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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 > -----Original Message----- > From: Wang, Jie1X > Sent: Thursday, August 26, 2021 15:09 > To: dev@dpdk.org > Cc: Li, Xiaoyun ; andrew.rybchenko@oktetlabs.ru; > thomas@monjalon.net; Yigit, Ferruh ; Wang, Jie1X > > Subject: [PATCH v7 2/2] app/testpmd: fix testpmd doesn't show RSS hash > offload >=20 > The driver may change offloads info into dev->data->dev_conf in dev_confi= gure > which may cause port->dev_conf and port->rx_conf contain outdated values. >=20 > This patch updates the offloads info if it changes to fix this issue. >=20 > Fixes: ce8d561418d4 ("app/testpmd: add port configuration settings") >=20 > Signed-off-by: Jie Wang > --- > app/test-pmd/testpmd.c | 33 +++++++++++++++++++++++++++++++++ > app/test-pmd/testpmd.h | 2 ++ > app/test-pmd/util.c | 15 +++++++++++++++ > 3 files changed, 50 insertions(+) >=20 > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index > 6cbe9ba3c8..c0bdb740fe 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -2461,6 +2461,9 @@ start_port(portid_t pid) > } >=20 > if (port->need_reconfig > 0) { > + struct rte_eth_conf dev_conf_info; > + int k; > + > port->need_reconfig =3D 0; >=20 > if (flow_isolate_all) { > @@ -2498,6 +2501,36 @@ start_port(portid_t pid) > port->need_reconfig =3D 1; > return -1; > } > + /* get offloads */ > + if (0 !=3D > + eth_dev_conf_info_get_print_err(pi, > + &dev_conf_info)) { > + rte_exit(EXIT_FAILURE, > + "rte_eth_dev_conf_info_get() failed\n"); rte_exit will directly exit the program. "return -1" after this won't work.= Please just print errlog and return -1 like other failures. > + return -1; > + } > + /* Apply Rx offloads configuration */ > + if (dev_conf_info.rxmode.offloads !=3D > + port->dev_conf.rxmode.offloads) { > + port->dev_conf.rxmode.offloads =3D > + dev_conf_info.rxmode.offloads; > + for (k =3D 0; > + k < port->dev_info.max_rx_queues; > + k++) > + port->rx_conf[k].offloads =3D > + > dev_conf_info.rxmode.offloads; > + } > + /* Apply Tx offloads configuration */ > + if (dev_conf_info.txmode.offloads !=3D > + port->dev_conf.txmode.offloads) { > + port->dev_conf.txmode.offloads =3D > + dev_conf_info.txmode.offloads; > + for (k =3D 0; > + k < port->dev_info.max_tx_queues; > + k++) > + port->tx_conf[k].offloads =3D > + > dev_conf_info.txmode.offloads; > + } > } > if (port->need_reconfig_queues > 0) { > port->need_reconfig_queues =3D 0; > diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index > 16a3598e48..6970a20ee4 100644 > --- a/app/test-pmd/testpmd.h > +++ b/app/test-pmd/testpmd.h > @@ -950,6 +950,8 @@ void show_gro(portid_t port_id); void setup_gso(cons= t > char *mode, portid_t port_id); int eth_dev_info_get_print_err(uint16_t p= ort_id, > struct rte_eth_dev_info *dev_info); > +int eth_dev_conf_info_get_print_err(uint16_t port_id, > + struct rte_eth_conf *dev_conf_info); > void eth_set_promisc_mode(uint16_t port_id, int enable); void > eth_set_allmulticast_mode(uint16_t port, int enable); int > eth_link_get_nowait_print_err(uint16_t port_id, struct rte_eth_link *link= ); diff -- > git a/app/test-pmd/util.c b/app/test-pmd/util.c index 5dd7157947..170d8f5= c61 > 100644 > --- a/app/test-pmd/util.c > +++ b/app/test-pmd/util.c > @@ -440,6 +440,21 @@ eth_dev_info_get_print_err(uint16_t port_id, > return ret; > } >=20 > +int > +eth_dev_conf_info_get_print_err(uint16_t port_id, > + struct rte_eth_conf *dev_conf_info) { > + int ret; > + > + ret =3D rte_eth_dev_conf_info_get(port_id, dev_conf_info); > + if (ret !=3D 0) > + fprintf(stderr, > + "Error during getting device configuration (port %u) > info: %s\n", > + port_id, strerror(-ret)); > + > + return ret; > +} > + > void > eth_set_promisc_mode(uint16_t port, int enable) { > -- > 2.25.1