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 6F86446729; Mon, 12 May 2025 18:04:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E66514026C; Mon, 12 May 2025 18:04:28 +0200 (CEST) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id B4FFF4025F for ; Mon, 12 May 2025 18:04:27 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id 93AB82178D; Mon, 12 May 2025 18:04:26 +0200 (CEST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH v2 1/2] ethdev: remove unnecessary type conversion X-MimeOLE: Produced By Microsoft Exchange V6.5 Date: Mon, 12 May 2025 18:04:25 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9FC46@smartserver.smartshare.dk> In-Reply-To: <20250512150732.65743-1-skori@marvell.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH v2 1/2] ethdev: remove unnecessary type conversion Thread-Index: AdvDT6vjnJfap0mpQXyh7HmowhssTAABs/ww References: <20250429181132.2544771-1-skori@marvell.com> <20250512150732.65743-1-skori@marvell.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: , "Shepard Siegel" , "Ed Czeck" , "John Miller" , "Igor Russkikh" , "Ajit Khaparde" , "Somnath Kotur" , "Nithin Dabilpuram" , "Kiran Kumar K" , "Satha Rao" , "Harman Kalra" , "Hemant Agrawal" , "Sachin Saxena" , "John Daley" , "Hyong Youb Kim" , "Jie Hai" , "Ian Stokes" , "Bruce Richardson" , "Vladimir Medvedkin" , "Anatoly Burakov" , "Dariusz Sosnowski" , "Viacheslav Ovsiienko" , "Bing Zhao" , "Ori Kam" , "Suanming Mou" , "Matan Azrad" , "Long Li" , "Wei Hu" , "Chaoyong He" , "Jiawen Wu" , "Andrew Rybchenko" , "Jerin Jacob" , "Maciej Czekaj" , "Jian Wang" , "Maxime Coquelin" , "Chenbo Xia" , "Jochen Behrens" , "Thomas Monjalon" , "Ferruh Yigit" Cc: 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 > From: Sunil Kumar Kori > Sent: Monday, 12 May 2025 17.07 >=20 > As rte_eth_rx_queue_count() returns signed value to represent > the error cases but internally invoked callback is returning > unsigned value. Hence unnecessary type conversion is done. >=20 > To avoid this typecasting from signed to unsigned, fixed > return type of callback functions. >=20 > Signed-off-by: Sunil Kumar Kori Note for other reviewers: The tx_queue_count callback already returns int, and doesn't need to be = updated. Acked-by: Morten Br=F8rup > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h > index ea7f8c4a1a..b3031ab9e6 100644 > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -6401,7 +6401,7 @@ rte_eth_rx_queue_count(uint16_t port_id, = uint16_t > queue_id) >=20 > if (p->rx_queue_count =3D=3D NULL) > return -ENOTSUP; > - return (int)p->rx_queue_count(qd); > + return p->rx_queue_count(qd); > } >=20 > /**@{@name Rx hardware descriptor states > diff --git a/lib/ethdev/rte_ethdev_core.h > b/lib/ethdev/rte_ethdev_core.h > index e55fb42996..4ffae4921a 100644 > --- a/lib/ethdev/rte_ethdev_core.h > +++ b/lib/ethdev/rte_ethdev_core.h > @@ -45,7 +45,7 @@ typedef uint16_t (*eth_tx_prep_t)(void *txq, >=20 >=20 > /** @internal Get number of used descriptors on a receive queue. */ > -typedef uint32_t (*eth_rx_queue_count_t)(void *rxq); > +typedef int (*eth_rx_queue_count_t)(void *rxq); >=20 > /** @internal Check the status of a Rx descriptor */ > typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t = offset); > -- > 2.43.0 For the ethdev library changes: Reviewed-by: Morten Br=F8rup