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 57C4D45BC6; Thu, 24 Oct 2024 18:28:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4437D434F6; Thu, 24 Oct 2024 18:28:30 +0200 (CEST) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id C751D4025C for ; Thu, 24 Oct 2024 18:28:28 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id A5F732027D; Thu, 24 Oct 2024 18:28:28 +0200 (CEST) Content-class: urn:content-classes:message Subject: RE: [PATCH] net/ixgbe: fix per-queue stats for less queues MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Thu, 24 Oct 2024 18:28:27 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F81E@smartserver.smartshare.dk> X-MimeOLE: Produced By Microsoft Exchange V6.5 In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] net/ixgbe: fix per-queue stats for less queues Thread-Index: AdsmLiPpmHqjjWwXTL2vRs2k7YMKRQAAgxyQ References: <20241024111757.791634-1-mb@smartsharesystems.com> <98CBD80474FA8B44BF855DF32C47DC35E9F81C@smartserver.smartshare.dk> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Bruce Richardson" Cc: "Anatoly Burakov" , "Vladimir Medvedkin" , 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 > > > - for (i =3D 0; i < IXGBE_QUEUE_STAT_COUNTERS; i++) { > > > + for (i =3D 0; i < RTE_MIN(IXGBE_QUEUE_STAT_COUNTERS, > > > + > > > (typeof(IXGBE_QUEUE_STAT_COUNTERS))RTE_ETHDEV_QUEUE_STAT_CNTRS); > > > i++) { >=20 > The big cast using "typeof" is awkward-looking but is probably the = best > way > to do this! Yes. It fixes a signed/unsigned comparison warning. RTE_ETHDEV_QUEUE_STAT_CNTRS is int, "i" is unsigned, and = IXGBE_QUEUE_STAT_COUNTERS is size_t. Not easy choosing a good common type without adding an explanation. The = typeof() seemed like an acceptable compromise.