From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id EE117A00C3;
	Fri,  7 Oct 2022 16:43:35 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id AD38B40DFB;
	Fri,  7 Oct 2022 16:43:35 +0200 (CEST)
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by mails.dpdk.org (Postfix) with ESMTP id E7F8440A80
 for <dev@dpdk.org>; Fri,  7 Oct 2022 16:43:33 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
 d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
 t=1665153814; x=1696689814;
 h=from:to:cc:subject:date:message-id:references:
 in-reply-to:content-transfer-encoding:mime-version;
 bh=/XPuNiY/ZSt+v/K7xOX04k56c7obUcm7JkjNl2ze1yM=;
 b=HbXqFtiW0784uDLLgmdVhJOSf1QlCWtRIiQ1gFfdfhIO4eLH8OiBV2/x
 5Z59RLmeWVZiQrw9fVG3udZWjiQK5awKsf6AaBLIQqhRV0mqFb1dWCMns
 0gTxlHrRj2ca7eEsxbxOFJbs8HuCtE658MBtHCdNRiFhJf6ca/L8F6KeL
 /+1egqDhrZuMOsNSKuLuj/yFh46b9hB116o5bSybb2R7CmgBiaJBYRbV2
 GvFyFEQoB7YXLFCYsMak1oZRf+NsqzE4CdoIdeIm2UlqmVC++hUtY1bSi
 07BuTr708yJTwdb9kucA+0fbtecV/DACzD2jZ9ubXwb9Y1PJwqYho4Y7M g==;
X-IronPort-AV: E=McAfee;i="6500,9779,10493"; a="301350214"
X-IronPort-AV: E=Sophos;i="5.95,166,1661842800"; d="scan'208";a="301350214"
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
 by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 07 Oct 2022 07:43:33 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6500,9779,10493"; a="729635859"
X-IronPort-AV: E=Sophos;i="5.95,166,1661842800"; d="scan'208";a="729635859"
Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82])
 by fmsmga002.fm.intel.com with ESMTP; 07 Oct 2022 07:43:32 -0700
Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) 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.2375.31; Fri, 7 Oct 2022 07:43:32 -0700
Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by
 fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2375.31; Fri, 7 Oct 2022 07:43:31 -0700
Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by
 fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2375.31 via Frontend Transport; Fri, 7 Oct 2022 07:43:31 -0700
Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.40) 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.2375.31; Fri, 7 Oct 2022 07:43:31 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=VS5+aMFAmzFECRCcpbJemTOy7on9QY4aWqcOThcgZxG/ykBgl31j6bXBP8pwY5oZ4yGgmDD10H39LLbl3IOIJrKHv49lKB3XPQc0i710OpzEPAheqlZ/cfZy1kmilbP4BcG0iyJYqVBeFVNRwp3E3y0q3hxCtXv89aQ6sQcnzHBRuH2h3zw2aAnD2CaWO8B963GOkgcZaHrRzxlEvXiuIiEyoGr5mD6PQU1XtOepc0NanS700KIWvbU6xW/bBGsRngmm/DAXd9F2r6MZ0PTwHgntIXF797kzZm15dMZtR64vyMfzGBtG8TEbcyto/gPuiH23cgfLTb6VPNP8ssvvfQ==
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=Kw8DZnfMf5VgWo/3E6IJsjzVDwLKa2fzSmESA9YVb3M=;
 b=fQTq9hscWiktXkYzku0sD7kv7FFUpJ5LwTPMGlGUK+NPIkT35ptfsDgnVQhWRFdfR0qWIrYfE7wkXmsG4IyGIoAdtjNXOfewmdNOYoFPwQbOHoPkt7sz7/KyKacRI/v9EsjMymBCOfjXkk968+XCpJprkUlDgOI6dZI1TbrlBqb5y1YVIImQAiy/3Rk0SNMuKuDDkEKg4D+HIm5LL4VDGdWsyC/BYwd5ABSdKuZ7Bk5ZMODwWrUP4WwPij/ad1zv3L1w1Kiv1NlpwcA+of+8cvDMVXSvqNPmQBsXPMJRHjhpLcK24zU/1Yz3nOd1FyrJ8VbhcE+j6QCYCGFsHvqqpQ==
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
Received: from BYAPR11MB3366.namprd11.prod.outlook.com (2603:10b6:a03:7f::20)
 by BN9PR11MB5433.namprd11.prod.outlook.com (2603:10b6:408:11e::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Fri, 7 Oct
 2022 14:43:28 +0000
Received: from BYAPR11MB3366.namprd11.prod.outlook.com
 ([fe80::e7bb:69c6:ff4f:1d84]) by BYAPR11MB3366.namprd11.prod.outlook.com
 ([fe80::e7bb:69c6:ff4f:1d84%4]) with mapi id 15.20.5676.032; Fri, 7 Oct 2022
 14:43:27 +0000
From: "Pattan, Reshma" <reshma.pattan@intel.com>
To: Dongdong Liu <liudongdong3@huawei.com>, "dev@dpdk.org" <dev@dpdk.org>,
 "thomas@monjalon.net" <thomas@monjalon.net>, "ferruh.yigit@amd.com"
 <ferruh.yigit@amd.com>, "andrew.rybchenko@oktetlabs.ru"
 <andrew.rybchenko@oktetlabs.ru>, "stephen@networkplumber.org"
 <stephen@networkplumber.org>, "mdr@ashroe.eu" <mdr@ashroe.eu>
CC: Min Hu <humin29@huawei.com>, Maryam Tahhan <maryam.tahhan@intel.com>
Subject: RE: [PATCH v5 3/3] app/procinfo: support descriptor dump
Thread-Topic: [PATCH v5 3/3] app/procinfo: support descriptor dump
Thread-Index: AQHY2Xwy96RMGQO460OIVXbg4RYUV64C/rsA
Date: Fri, 7 Oct 2022 14:43:27 +0000
Message-ID: <BYAPR11MB33664A16646C126FDC34C9DFFF5F9@BYAPR11MB3366.namprd11.prod.outlook.com>
References: <20220527023351.40577-1-humin29@huawei.com>
 <20221006120514.28830-1-liudongdong3@huawei.com>
 <20221006120514.28830-4-liudongdong3@huawei.com>
In-Reply-To: <20221006120514.28830-4-liudongdong3@huawei.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
dlp-product: dlpe-windows
dlp-reaction: no-action
dlp-version: 11.6.500.17
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=intel.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BYAPR11MB3366:EE_|BN9PR11MB5433:EE_
x-ms-office365-filtering-correlation-id: 26a9580d-ac6d-4986-09ec-08daa8724bea
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: KU/K66gHHWT47UlJm+5sMpQlqzh5b26NLvZ9neVu9or/4i6Ve6PmaUmBP+Clghji+3i1CR/MiByCmKXXdjzPyTNCDmzkvQ/AflPaT3Op0QJfuRWaJvAUY1T7hyHQjfogxJq1nB0U7o0Tvs2LJCYgf7i9itUEDJYhlyb5Io8BngGr9tErLWC0b/SeV+p3tl8CV5NAnzIsr/1fSSXPH0lwhijblufWm2TICCXMaiHsvxIOqWyf7pgl10crQinPZ4OtPjakAwdyRa3BvibnUkmaK4TQHzytgYAPY5iv5hzS9/FhgRfNGQl2c8EJ6d1Xl/9jxna3dT2Wt0C68cZRIAflY1orapGLS1DFdkkM3mC2RHbFcbOEuyD/5Z+RjmHB7oBvdmVZnfV7L35/ubfNESfFI3rFO6HlVfXmnXsc4YBfqTVqNlodhCXlQEihwHjvBeL4Do3yvPO/vvEPXK4sSaIdPje6CKeI/Gv7Debz4YyYkwiFxVKNERzc5ZHNmNfCuXZhKY74BCcuS9bnlV7NMb/n5m9pbykkbPrsfY1b1b2YZLkd/z2KpGU1aH2l8970kvEXJ2vB/UU41ue8ZHfFQuO4B1mHnntExmgQlDCKaTPswg6l6AOhnaET8YClz1YJwUyKYaTOv73ZlehqNZXr5TUPS0gz18boR/vXiw3WvKgvSum2k+d/9a8qR8c3Lz8LDzvuUgeP/zgJuhFE1tS+DVgUWfv0NkHIvtCe1Y+6gpKhcQIj2+dl2J80mvCjfZXym/o+oX6JmRheSl0c/CHxfa4j/w==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
 IPV:NLI; SFV:NSPM; H:BYAPR11MB3366.namprd11.prod.outlook.com; PTR:; CAT:NONE;
 SFS:(13230022)(136003)(376002)(396003)(39860400002)(366004)(346002)(451199015)(33656002)(86362001)(38070700005)(122000001)(83380400001)(38100700002)(4326008)(82960400001)(41300700001)(186003)(107886003)(6506007)(71200400001)(64756008)(478600001)(66446008)(54906003)(76116006)(8676002)(66556008)(66476007)(316002)(9686003)(66946007)(2906002)(5660300002)(110136005)(8936002)(55016003)(52536014)(7696005);
 DIR:OUT; SFP:1102; 
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?kEWZIN2Alr9OTxQSovWnx9KtXAueASvHLXzPjGFq7xgymt/2d0I4K4IwoKQJ?=
 =?us-ascii?Q?oWY/pYrTqhOikydsk9roYl4L6ZZtgp7WP0AFp1yluyYBuD7QdI4x5s4VAj64?=
 =?us-ascii?Q?wxrHwSQjNUTZg0lKem3qLy5QmUeIeGfaAmJeJVflTdlC5DScGsNY4j+xFQiD?=
 =?us-ascii?Q?1jtar0BX7WyfHjHxJN4VaiPIzHCG1lmeWLexGs6ISzw85wG4ETddBD3MeywR?=
 =?us-ascii?Q?oX6HS46vto9/hGvONrTbD1IZ1RipWVM9uhtzhMu9I1lAZVnJcfYqmdpW70Gl?=
 =?us-ascii?Q?Ie8+JgUzh7JnLvXAmRBWVpwup4DqP6VbOldRT3hZWdevGRNTCA4kCWCIjNRb?=
 =?us-ascii?Q?GzojIWFrU5qqo5ReFF/PgI8vU/xxAIHWH48KlFrtS5reM1/qcNaIit9jNNOG?=
 =?us-ascii?Q?r1x/AV8o9gy4sgX6MARq9EcGaYnDXlOd2B2XulSX7UdeDiO5YZj8d+0aZhU8?=
 =?us-ascii?Q?M6s4/+Y+pxePdaMOOWfEsDVyTvyER37FcPmrLwCpcNq0upMfkn+/ECioS11y?=
 =?us-ascii?Q?6WrQvJHYF9p0BtzzLk73GybeaWEgdLjfyiqhojN0yqSm0+BU9FHtKtV6wFFa?=
 =?us-ascii?Q?dqMWQddBM/fgTelCp/yjM+x3nQOgvzNJj1eiuwYGeXznD/MLezbDR2pKVZza?=
 =?us-ascii?Q?FTIgQJqflGqM+6UmI5XkUn4Jh+45kveyKNScVGPf+OUxfKzTssxoZ3qnJV6J?=
 =?us-ascii?Q?7hkxfxVDcYXg495Dn1qUfFBuWkZzK/gRxvD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uHMHIL6trZ?=
 =?us-ascii?Q?gKWDgu4UpFoo9zUslMCMKT8q44v9ohioGqrngAaET1sV?=
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: BYAPR11MB3366.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 26a9580d-ac6d-4986-09ec-08daa8724bea
X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Oct 2022 14:43:27.9245 (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: LIxPkTpzpS1tBgFMZoHfr8r1FeyDW082Wrgp6F0fRREeMLWdGL/Kh2O6FzcpzLyNk2fJkS17ydv9ymxsUtkktg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR11MB5433
X-OriginatorOrg: intel.com
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org



> -----Original Message-----
> +/* Enable dump Rx/Tx descriptor. */
> +#define DESC_PARAM_NUM 3
> +
> +struct desc_param {
> +	uint16_t queue_id;  /* A queue identifier on this port. */
> +	uint16_t offset;    /* The offset of the descriptor starting from tail.=
 */
> +	uint16_t num;       /* The number of the descriptors to dump. */
> +	bool valid;

You don't need to keep if the descriptor parameters are valid or not, as yo=
u are exiting the application when you see invalid parameters are entered b=
y user.

>=20
> +static int
> +parse_descriptor_param(char *list, struct desc_param *desc) {
> +	int ret;
> +
> +	ret =3D sscanf(list, "%hu:%hu:%hu", &desc->queue_id, &desc->offset,
> +		     &desc->num);
> +	if (ret !=3D DESC_PARAM_NUM) {
> +		desc->valid =3D false;
> +		return -EINVAL;

On error return application is exiting , so no need to maintain desc->valid

>  main(int argc, char **argv)
>  {
> @@ -1564,6 +1638,12 @@ main(int argc, char **argv)
>  			metrics_display(i);
>  #endif
>=20
> +		if (rx_desc_param.valid)

So if rx_desc dump is requested in command line you can set some global var=
iable like "enable-show-rx-desc-dump" and display below info only if that v=
ariable is set.=20
So we no need to use valid here.

=20

> +			nic_descriptor_display(i, &rx_desc_param,
> +					       rte_eth_rx_descriptor_dump);
> +		if (tx_desc_param.valid)

Same here as above comment.