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 8B3CDA04B1; Mon, 23 Nov 2020 12:50:57 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3F9E1375B; Mon, 23 Nov 2020 12:50:55 +0100 (CET) Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by dpdk.org (Postfix) with ESMTP id 1AED2160 for ; Mon, 23 Nov 2020 12:50:52 +0100 (CET) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Mon, 23 Nov 2020 03:50:57 -0800 Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 23 Nov 2020 11:50:41 +0000 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.103) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Mon, 23 Nov 2020 11:50:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F8L+5ohaaQ5uQC1L55t9X3p0iDcsfI1RqGdPM+NMpoHqfw05DY1ve1aguiQ/vzGLWtz4wREvaEBjhllhO21KiImlwdt7FOBk4RQ98SfX4xmY+uXLzK2GJWs/yYxAsjw6O3Bvm9OTwYUJuJgPiUAzhI/4gcig8czUxewJzQpQgIT+waj0tx+SgfHWVYBMUZ0w3W30IgFFOwr9eRu5Q9CDL3brCLfSrgM8w+1Jdwx5Fp8424kBVRblGzGcwHJZWTaGVNnmGA2X0sLOF5ib/MaDsPEYzoHfmakJUywcG/fVRhYqmrAdXsltOhiMTcp8O3GGzOnAQ5sCkAgtm7IY05ynIw== 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=K2nueW7Z8ZIX2T++2eNtKe9FKaF1nSvpizfhnRJxzlc=; b=I2NofIu8fAnsvQ7+BMaEQEqAf207je6SZZ4Z5qo3w1wG8+m6Nq9+dXK1chleVbyJZDTSZOAalA1xkg1/PKJpvU+4QHqLYzmxPx+bv1G5uHgIVxJXIuGPKLPl5hjXeJBy5R1Q9H6o1ehnIvCUjABNhoeenPuxsiP5oz8oFEHQbCDzjSlKr5FgBLmDQ+mIC6E3VQUeV/Uuar98BcRxMhoxmMum3izWpzm8Xmlx1lpa5xSVk0BDyUWolwIk47dGVyaE0IC/KgPdeLrc13EDvu9mICH4aNQFR44l2HrJ3cnxjHGzhaBLQeFwZ37iILqYT2C92pTkDfkJEXFVkHCsrn1/JA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from MWHPR12MB1501.namprd12.prod.outlook.com (2603:10b6:301:f::18) by MWHPR1201MB0142.namprd12.prod.outlook.com (2603:10b6:301:55::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.22; Mon, 23 Nov 2020 11:50:40 +0000 Received: from MWHPR12MB1501.namprd12.prod.outlook.com ([fe80::ec4d:f17d:402c:78b4]) by MWHPR12MB1501.namprd12.prod.outlook.com ([fe80::ec4d:f17d:402c:78b4%6]) with mapi id 15.20.3589.030; Mon, 23 Nov 2020 11:50:39 +0000 From: Slava Ovsiienko To: "Wei Hu (Xavier)" , "dev@dpdk.org" CC: "xavier.huwei@huawei.com" , "ferruh.yigit@intel.com" Thread-Topic: [dpdk-dev] [PATCH v4 3/6] app/testpmd: remove restriction on txpkts set Thread-Index: AQHWkzotyiij/xExH0i1C/re0S8zFKnV9f0Q Date: Mon, 23 Nov 2020 11:50:39 +0000 Message-ID: References: <20200818120254.72792-1-huwei013@chinasoftinc.com> <20200925124719.26001-1-huwei013@chinasoftinc.com> <20200925124719.26001-4-huwei013@chinasoftinc.com> In-Reply-To: <20200925124719.26001-4-huwei013@chinasoftinc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: chinasoftinc.com; dkim=none (message not signed) header.d=none;chinasoftinc.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [95.164.10.10] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 03c81a07-3b7e-412f-aa94-08d88fa5ffd4 x-ms-traffictypediagnostic: MWHPR1201MB0142: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1GPvQZV2BXPJIwLNI1xCKLvhnGHn7sBiZyHL+xzbiCuxzjrPa7FHTr9a7tPH4OyEY47fD3iyG5vdhX4MpkkRP+AI1Bn0GazuTG4WD9qAuiW4UI8QfYjWd/NCq2iU5oggte68V0/tebSHvGh/mXpxpHGqdQiRlZuo48gAxPRB/IZKa8NQCmwhqW5Slvl/sggWjveVdhEgDmV+Cs9c5wQv5Dp+KoyuyajRqVt8N5b8YS6xCnFuhZUnPGzDTiWPqqjWR3I+z0yWnjgBALS9cxEKXdmvgRplNSvxY/v8td7m8LTva3R1g982voSaVToICWCnQykEMERFAxAf5BdTm5Ce7yUX4bpmfKQ0xLGL4/fYUHzsFLnmSc9aPNl+OAB+IpA+ x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR12MB1501.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(136003)(39860400002)(346002)(396003)(376002)(2906002)(26005)(110136005)(55016002)(4326008)(71200400001)(5660300002)(86362001)(83380400001)(52536014)(8936002)(9686003)(316002)(6506007)(7696005)(33656002)(53546011)(66476007)(66946007)(54906003)(76116006)(66446008)(186003)(64756008)(478600001)(66556008)(40753002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: nBSruRjUxvcPjNDQrqMXzIs4HF9za6rnrgdgDjskV7KU1U6GijusChkDAujfLpyoZ32pSGkZ3S9QcnqXuiuMf368KsiQjQF/YKWZP+TFaqBWvF488UOs57eLpfLXHR5E4yaHHh/HF8Mh6ic2OJarCTmC8X9GdpZW42UEIkXou53SEjNC/6YVtQAhUCFs4LKP/KN9DYouGlRhyzgSWVm9hQhMTHYJbthCL59G04CFE+CHO0aaJh+R7xdYhQnRBIyYmjF5K9jU6GTZPDDMQyQWGzAqWaoHfkffRdDRmkh2aKfrthJRHHtvZ4AaA+06uiqL/wSwajQ81N0iI2Y8IBh0/pr0LupkIhlU/ZA4W2m9GJM8qPRwKSxoZc7ef5EPdkIloOTFVyE3fxFUgan5g89HkPurOFAw+lOVv5Gkp2LCAnYorkdADhKM8S9Lxqc8LDdMP5IPMTh0KeKrDdJarwGtYKwi5aLocuGAw5FExMQkM0T2MagjJhvi48IHdiCgOJqQau9ekPYo0fEQbcBOMNnXL91dkViNHy9SsoSS312jfKEAymPTXdf/N+4p38GiZRIOeew7miFulR2X0i0ncYMxTap4R9NqI4cAlubc4MDPuhYxH11WoXsszmCxJw1698m53LIQnqbwbrL5dGd0mIXhn4EsFOQZQJAQdQYoac/kD2kyQHsCGLel/Oyjxt7OeUwhOQ8+DsJtMusZxYol+Elo8iN1XVXlYxWaOTyRoXwpUV3ry97BJoUqhnC7qxAr92Y3Ea/w8wUu0NnlOqnJ4PFLV41YgDlS7c+LzXEh+mIlZJA3CBs5YOZ3QO5L9hP0NAIqNbGrTBSbeWpSp0eiwWN93tiO81MITqZFetsNaAsI0l0zWouq7BIKxZDK/EbsFaYH9dF1Srmma3VeyUHutToFeA== 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: MWHPR12MB1501.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 03c81a07-3b7e-412f-aa94-08d88fa5ffd4 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Nov 2020 11:50:39.6328 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Vzzc4I9s7NQ8COZSIuE/VuABdrLWIBDcOBCjGtXROtgR0rz6I8RYOEOX0qYe3TiLwkYH+ZTbWOF+K8WaKdVXvQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0142 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1606132257; bh=K2nueW7Z8ZIX2T++2eNtKe9FKaF1nSvpizfhnRJxzlc=; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To: CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References: In-Reply-To:Accept-Language:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:authentication-results:x-originating-ip: x-ms-publictraffictype:x-ms-office365-filtering-correlation-id: x-ms-traffictypediagnostic:x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers:x-ms-exchange-senderadcheck: x-microsoft-antispam:x-microsoft-antispam-message-info: x-forefront-antispam-report:x-ms-exchange-antispam-messagedata: x-ms-exchange-transport-forked:Content-Type: Content-Transfer-Encoding:MIME-Version: X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-AuthSource: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; b=pvARb2BT2EesCOVMxyLkNiLjSYSsNcNoFP/ruOfSCJfmg9QV4rFDkR+nrTT3gK2zb ODjvAu4a6fkXSSibfCtdNj4wK8nFWdOXsjZmS4RWNy1McNMSa+sZcxZ1UA4PmGB8Aj 4okL+Ph/jlQWYoclbVSVO9v5JPyupnriGXUswyNwaxgFjTYWRI7p6SO4m+dqe5aGD1 S0p5wXE9eYuV3+JUKyzJI/n4PC4zxfvrhJj0n845E5HgzEiIUtEeu3iSkUOljPcWlO cy+T1Ik/wwJJngDpSBluL5d/Su1b+JLSxW7fKD6HAtO/6bf1Z+YsUD4R3OKpvAiRdr HJRy4RoHfhNWg== Subject: Re: [dpdk-dev] [PATCH v4 3/6] app/testpmd: remove restriction on txpkts set 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" Hi, Wei It was found this patch rejects the --txpkts command line settings. set_tx_pkt_segments() is called before device started and we have failure chain: set_tx_pkt_segments() nb_segs_is_invalid() get_tx_ring_size () rte_eth_tx_queue_info_get() It causes --txpkts testpmd command line option is ignored. With best regards, Slava > -----Original Message----- > From: dev On Behalf Of Wei Hu (Xavier) > Sent: Friday, September 25, 2020 15:47 > To: dev@dpdk.org > Cc: xavier.huwei@huawei.com > Subject: [dpdk-dev] [PATCH v4 3/6] app/testpmd: remove restriction on txp= kts > set >=20 > From: Chengchang Tang >=20 > Currently, if nb_txd is not set, the txpkts is not allowed to be set beca= use the > nb_txd is used to avoid the numer of segments exceed the Tx ring size and= the > default value of nb_txd is 0. And there is a bug that nb_txd is the globa= l > configuration for Tx ring size and the ring size could be changed by some > command per queue. So these valid check is unreliable and introduced > unnecessary constraints. >=20 > This patch adds a valid check function to use the real Tx ring size to ch= eck the > validity of txpkts. >=20 > Fixes: af75078fece3 ("first public release") > Cc: stable@dpdk.org >=20 > Signed-off-by: Chengchang Tang > Signed-off-by: Wei Hu (Xavier) > --- > v3 -> v4: > add check 'rte_eth_rx_queue_info_get()' return value and > if it is '-ENOSTUP' calculate the 'ring_size'. > v3: initial version. > --- > app/test-pmd/config.c | 64 > +++++++++++++++++++++++++++++++++++++++++++++++---- > 1 file changed, 60 insertions(+), 4 deletions(-) >=20 > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index > 6496d2f..8ebb927 100644 > --- a/app/test-pmd/config.c > +++ b/app/test-pmd/config.c > @@ -1893,6 +1893,38 @@ tx_queue_id_is_invalid(queueid_t txq_id) } >=20 > static int > +get_tx_ring_size(portid_t port_id, queueid_t txq_id, uint16_t > +*ring_size) { > + struct rte_port *port =3D &ports[port_id]; > + struct rte_eth_txq_info tx_qinfo; > + int ret; > + > + ret =3D rte_eth_tx_queue_info_get(port_id, txq_id, &tx_qinfo); > + if (ret =3D=3D 0) { > + *ring_size =3D tx_qinfo.nb_desc; > + return ret; > + } > + > + if (ret !=3D -ENOTSUP) > + return ret; > + /* > + * If the rte_eth_tx_queue_info_get is not support for this PMD, > + * ring_size stored in testpmd will be used for validity verification. > + * When configure the txq by rte_eth_tx_queue_setup with > nb_tx_desc > + * being 0, it will use a default value provided by PMDs to setup this > + * txq. If the default value is 0, it will use the > + * RTE_ETH_DEV_FALLBACK_TX_RINGSIZE to setup this txq. > + */ > + if (port->nb_tx_desc[txq_id]) > + *ring_size =3D port->nb_tx_desc[txq_id]; > + else if (port->dev_info.default_txportconf.ring_size) > + *ring_size =3D port->dev_info.default_txportconf.ring_size; > + else > + *ring_size =3D RTE_ETH_DEV_FALLBACK_TX_RINGSIZE; > + return 0; > +} > + > +static int > rx_desc_id_is_invalid(uint16_t rxdesc_id) { > if (rxdesc_id < nb_rxd) > @@ -2986,17 +3018,41 @@ show_tx_pkt_segments(void) > printf("Split packet: %s\n", split); > } >=20 > +static bool > +nb_segs_is_invalid(unsigned int nb_segs) { > + uint16_t ring_size; > + uint16_t queue_id; > + uint16_t port_id; > + int ret; > + > + RTE_ETH_FOREACH_DEV(port_id) { > + for (queue_id =3D 0; queue_id < nb_txq; queue_id++) { > + ret =3D get_tx_ring_size(port_id, queue_id, &ring_size); > + > + if (ret) > + return true; > + > + if (ring_size < nb_segs) { > + printf("nb segments per TX packets=3D%u >=3D " > + "TX queue(%u) ring_size=3D%u - ignored\n", > + nb_segs, queue_id, ring_size); > + return true; > + } > + } > + } > + > + return false; > +} > + > void > set_tx_pkt_segments(unsigned *seg_lengths, unsigned nb_segs) { > uint16_t tx_pkt_len; > unsigned i; >=20 > - if (nb_segs >=3D (unsigned) nb_txd) { > - printf("nb segments per TX packets=3D%u >=3D nb_txd=3D%u - > ignored\n", > - nb_segs, (unsigned int) nb_txd); > + if (nb_segs_is_invalid(nb_segs)) > return; > - } >=20 > /* > * Check that each segment length is greater or equal than > -- > 2.9.5