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 E4A23A034F; Mon, 11 Oct 2021 10:33:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CFD3B410E2; Mon, 11 Oct 2021 10:33:24 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id E0C33410DB for ; Mon, 11 Oct 2021 10:33:22 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10133"; a="207633932" X-IronPort-AV: E=Sophos;i="5.85,364,1624345200"; d="scan'208";a="207633932" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2021 01:32:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,364,1624345200"; d="scan'208";a="523737299" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by orsmga001.jf.intel.com with ESMTP; 11 Oct 2021 01:32:50 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 11 Oct 2021 01:32:50 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 11 Oct 2021 01:32:50 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.174) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 11 Oct 2021 01:32:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lv4IokvHecCuv1+heFeuO4oL/QhIMcfqqeuLY+PhSxNwO7pFt+ZFS6948EvjGtNXaUttPTdKhVoCnvGAM8b+uTyQw1Dldai8OGlQLXsKnzLXe0TS3iMDyh+ITwX26sDrtfCkaTaVjr2DEjAd5OaJ/lOmAjM0zgthuLHDag/YDm+IH/5zv/v8dNausaCQGUL0TGJuHKANVHHuOvsx7hgSm5rc2A/c75EMzdThfDGnM3RN7h5q7OpcBo8iT30gKq6OYy/e8QilU9TUw0eqXexWhWtAxji2X6hVeSY8VkedhQDn4ee5jcuxDMsOhLAJjQYr2Qw/WOJIT2OxYPXvGS/vjg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CrUbVYP3n/rG+/5+7/6+GHj34rHxeh2Vz97taMUqsAY=; b=W1dMBdZSojTc11Z5h+WnR7mXUAYBXHZWnpPI93PDGWFnRlfAKZBA/UC+D1Ksn4CwmNrWOZti80Xx2B3KgpqPj4eDIzxaiWYed5I7CiIS9OqLmuFqSnaaF+4IsoBk3/wRyEPezHjwRNuH4nIhupM4xE1+ZSFZd5e9sVV35nESSMy5VwL09PgNePwMFELIArjAvx2HPwksDaZDRCQln2SY1UZ5WpBBxv9KjG5et94ZV4vAGbI9CnibXQCY3vcggEfLRnQGWBDqu0ai2O90YgU9VRTG/3609nsZ2/khBTuMqv6HFQ/0vxDVKQbvprTzFpFQyzbGpgtBQeo3Sz0hYnNN+g== 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=CrUbVYP3n/rG+/5+7/6+GHj34rHxeh2Vz97taMUqsAY=; b=O8vYZDsN84qMZEreHHdiEmVLTaBW92G54uw7VOOMxtCZ1D4WCDjW+yNI7RxcFCMn90ofzI87b7kyQT4GGDy+dIzZdhXinahPzT7gikM2F3Ix18Oz9QZiQyP9WpXXAKk9S8Us6LOMl2Zfu4Kqwa3GGCUanqUL1ymv44OY7QWgB8U= Received: from DM4PR11MB5534.namprd11.prod.outlook.com (2603:10b6:5:391::22) by DM6PR11MB4298.namprd11.prod.outlook.com (2603:10b6:5:204::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.22; Mon, 11 Oct 2021 08:32:48 +0000 Received: from DM4PR11MB5534.namprd11.prod.outlook.com ([fe80::3d9b:76d7:e274:bad3]) by DM4PR11MB5534.namprd11.prod.outlook.com ([fe80::3d9b:76d7:e274:bad3%3]) with mapi id 15.20.4587.026; Mon, 11 Oct 2021 08:32:48 +0000 From: "Li, Xiaoyun" To: Andrew Rybchenko CC: "dev@dpdk.org" , Xueming Li , Viacheslav Galaktionov , Andy Moreton Thread-Topic: [PATCH v3] app/testpmd: add command to print representor info Thread-Index: AQHXqjhcQhruwLQzJUiLwqfmmyNxMqvNn1Pg Date: Mon, 11 Oct 2021 08:32:48 +0000 Message-ID: References: <20210827063935.1834143-1-andrew.rybchenko@oktetlabs.ru> <20210915134745.3915643-1-andrew.rybchenko@oktetlabs.ru> In-Reply-To: <20210915134745.3915643-1-andrew.rybchenko@oktetlabs.ru> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: oktetlabs.ru; dkim=none (message not signed) header.d=none;oktetlabs.ru; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1b892fc8-4376-4d52-ec65-08d98c91b4f4 x-ms-traffictypediagnostic: DM6PR11MB4298: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cXNGOhKhVhkoaDqrA8gihbkDdIqcljEnKI4AVVaAR1C7Z7S2z3qnX2b8XLUYSDblcP9gmPVE/XJXvrEspyOzgj5QCgYqYsnO5sp+TrxcKWsGdL2Z46g1CwmG6kd5uGdX4v7FoAAxjFQ0NeiRbKPfJzfki06eMLfMkUwstY3yOP7kAqGS4Z+Jy39KYQRZcqvNHBbah+W15ijp0BYq20URfIbsHQ/fJ6tBorbo40mxFywKnxkQ6ylTYGKAbIRIAcUHstoUQojyxQ/OVZRmcCtxs0QD3fiJMKVct8K8jtweHQyrZQaqHQNyqin724LTqlvfjG8hy3pwFhyciqDHF+FqRNGj0GS/nlJC4WDMMQtd74L3bDbYI/2+q8UA4bKlOspechnIVmx3pIQHMPlFi+QKdSp45UIN0jvRDZbsAI52LEMCtPbbetWEemgVoRDWbihvSkeO4oADy6nafph3boSA4GVIRFwQ+FxrcuQqfhxzNIhMwVeWmvRsi6r8IlCcDCYNLpHjHopUTdaRct/6bntHeBjAk8iUX3Zw++tL6rf9pZEN5ZuC49pBOJ3bj4lTRlFiHciZb1v97opxSxIfrWG/T+6O159K8CtKKaSa4UtTEuPfDrUHQHFBxy/YRzsTGr3X8IV5XgK5M8sqE9DhC4ALX6g93s3PAGMCQD6Ct+EChZqYaU78Bcwx9EPRWEVL2/TO9LxWE2OGmn3UCK1qIvMGQg== 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)(54906003)(52536014)(38100700002)(6506007)(186003)(122000001)(4326008)(83380400001)(38070700005)(508600001)(33656002)(26005)(8936002)(53546011)(316002)(5660300002)(71200400001)(2906002)(6916009)(86362001)(55016002)(66946007)(76116006)(66476007)(66556008)(64756008)(66446008)(9686003)(7696005)(8676002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?fXxy6Zzx1s1RWUMfwOhS7rgQp7vFtUMpncoW6nfMMyWJj+zI6kHj4ESwdbAt?= =?us-ascii?Q?vlEALfWjNEAPAQ6LxIsay4pgMnbh5PuR7On9kSZBKkwv6yg+clewcJlU91MZ?= =?us-ascii?Q?iLoDfKB9SeJ0/0IMZN33dD2aHYFEg80dl5tkM1IrNqN7zbrkwbBy2TSClcp6?= =?us-ascii?Q?fUUqhiQodCHOHaYK3X87a1DMwVzMuBZC9N8iu/xjDPSZhnr5NJyKPp7K0S1o?= =?us-ascii?Q?DQLUmj7ZacZXsMYthuwAGb35dwDoVePAVZ2cLFLUH1RvrvY81OspZVhzewaK?= =?us-ascii?Q?MD5xl0riX9u58TrKgGsvEI3BxR1I/OiITYjEcLMNKEKlJfxQ913s7t1v3ZOY?= =?us-ascii?Q?DkzWzJ1YSz/IY0Mkt5kMKQoTPqnAUxekmlqVbGvbw32lPhM7ipcQrzQrSOxo?= =?us-ascii?Q?x5ceTUvO0TUvA2IwBuW2ECp+cbR88l3lyQBtAH0Iky5CVDgi2YNiJ6cnhA+y?= =?us-ascii?Q?iRTDaywX8yazobGYZLOMZo5+nFuTYGYeiuc/zI3Co4QcaZbZt1o1GZvG5XzV?= =?us-ascii?Q?ZoLtjL6+47sixae9i9HQpwx5ey6GhgtQv4DJcNWs7tFScyFnd9jEDittkf6H?= =?us-ascii?Q?IJZphTZ77innhbVj5eyRgCK1pa8bt8pCqd3dXo1Tuv2QufhMOxH8UpcOk41a?= =?us-ascii?Q?6vMNGpL0qsn9n4SApRt1drhtiM1jqImQcOAgb9W9WUIzyJXUqTCyZ/5FkUJe?= =?us-ascii?Q?u834ubDGA0gR63IQ/11WX8CMgnaVX5zJKzw4rSihpYGOp/yPYEnfGK+S1vCG?= =?us-ascii?Q?XknOl64D3Z3fMKF06SvLjAZBLtNHVjIxJK3CBp5yKbxp+2lgxSFdAN9pB687?= =?us-ascii?Q?/BhKA7vUVmtmJJy9gbkY3K76+6mzVlhAaS5Apr7u69G+IkXP6iov0dNPV85c?= =?us-ascii?Q?55oSg43K9wDV5tYJXgCW/7eXp6GwKnPUth8jF9PyoqJM4/vm9fyTcGcizSC9?= =?us-ascii?Q?zTxdXB8IWFYbRpfddCk4Ex9OE32dY7SDhyRqTMk1o6ih5y6dB8P1pYIJtRqY?= =?us-ascii?Q?kU43qMRS50sOR5bPegNTuDjvbVN8vnqPmEAmjfoLg3aCb3evzCAKRxHwTmCf?= =?us-ascii?Q?I9xpt19WNjtfLb3B0YSHaKaX6DhrAgkfqVx/M5xpEiy9/Bjru98SXX+FiXqZ?= =?us-ascii?Q?3XC3teeZnEZ47RgytZx1ahjDDsn8MSYn6o73z8Dho3IHZgLTkHkQpmS62GN5?= =?us-ascii?Q?jckzJdFrQRCPHxJVxyhLT99wnFBWYNXCulWUKXXfpk7cXtD4QKAXCgIRyvr5?= =?us-ascii?Q?E21wcgG1wWWW+Af9is/rxCRbWNPK0yx8br0t1KeX1HVibO2qu0oBJ1G4ykzo?= =?us-ascii?Q?qzhhLKTxwt4uAtfrl4LtY6AI?= x-ms-exchange-transport-forked: True 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: 1b892fc8-4376-4d52-ec65-08d98c91b4f4 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Oct 2021 08:32:48.2259 (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: sVzIpAoJrD88AomArmM4XclhTj1Jmh9tamZEWnBg0D7dO1U28gBOGu7sIYFo0oV1+ddlYbjQNHpy0ppo6n8sFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4298 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3] app/testpmd: add command to print representor info 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: Andrew Rybchenko > Sent: Wednesday, September 15, 2021 21:48 > To: Li, Xiaoyun > Cc: dev@dpdk.org; Xueming Li ; Viacheslav Galaktiono= v > ; Andy Moreton > Subject: [PATCH v3] app/testpmd: add command to print representor info >=20 > From: Viacheslav Galaktionov >=20 > Make it simpler to debug configurations and code related to the represent= or > info API. >=20 > Signed-off-by: Viacheslav Galaktionov > Signed-off-by: Andrew Rybchenko > Reviewed-by: Andy Moreton > Reviewed-by: Xueming(Steven) Li > --- > v3: > - change command to "show port info (port_id) representor" >=20 > v2: > - change output format to log just one line per range >=20 > app/test-pmd/cmdline.c | 137 > +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 137 insertions(+) >=20 > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > 7dd3965d6f..2f24d33337 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -162,6 +162,10 @@ static void cmd_help_long_parsed(void *parsed_result= , > "show port (info|stats|summary|xstats|fdir|dcb_tc) > (port_id|all)\n" > " Display information for port_id, or all.\n\n" >=20 > + "show port info (port_id) representor\n" > + " Show supported representors" > + " for a specific port\n\n" Why not just put " Show supported representors for a specific port\n\n" = in one sentence? > + > "show port port_id (module_eeprom|eeprom)\n" > " Display the module EEPROM or EEPROM > information for port_id.\n\n" >=20 > @@ -7904,6 +7908,138 @@ cmdline_parse_inst_t cmd_showport =3D { > }, > }; >=20 > + printf("Controller %d, PF %d", range->controller, range->pf); > + > + switch (range->type) { > + case RTE_ETH_REPRESENTOR_NONE: > + printf(", NONE\n"); > + break; > + case RTE_ETH_REPRESENTOR_VF: > + if (range_diff > 0) { > + printf(", VF %d..%d\n", range->vf, > + range->vf + range_diff); > + } else { > + printf(", VF %d\n", range->vf); > + } There's no need of braces for this "if else" like others. BRs Xiaoyun > + break; > + case RTE_ETH_REPRESENTOR_SF: > + printf(", SF %d\n", range->sf); > + break; > + case RTE_ETH_REPRESENTOR_PF: > + if (range_diff > 0) > + printf("..%d\n", range->pf + range_diff); > + else > + printf("\n"); > + break; > + default: > + printf(", UNKNOWN TYPE %d\n", range->type); > + break; > + } > + } > + > + free(info); > +} > + > -- > 2.30.2