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 36C2145BC6; Thu, 24 Oct 2024 18:49:07 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AFD6E43511; Thu, 24 Oct 2024 18:49:06 +0200 (CEST) Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by mails.dpdk.org (Postfix) with ESMTP id 49739434F5 for ; Thu, 24 Oct 2024 18:49:05 +0200 (CEST) Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-71e74900866so829197b3a.1 for ; Thu, 24 Oct 2024 09:49:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1729788544; x=1730393344; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=T3Rkybl+D+TZkW1u6FIlbANDEM1qJIGCUZc00hiPUrw=; b=D25mFMxmOQjGLQzy8Jduk/zlhlg/MDdn5qxSZ00v3AFRW/0ivxERt29z+hmTg4uE20 uE+C6PDObrg0GS/0le6uYwZe4BQCwV1McRi48oOTi8vQQNn6O4IPo1sp5wyaRBdMrIxg mPN0W7zR8DlR/BYuMKia9MOgsYYvreKQxwA2ShdPVFmn/V9uWJnp10S5/OL+N253tq5G lOf0Ll51tAdfHpHL+05HjALIy6g63ZRXzniJchvYGr1WvDKaAu1uXe7yXYCkX8gnMH6N xgKDPZYNR73WFNtPshp/c+5Gba8545QpXJbX16Q6pFB9eE3S9/tqHpBHqZf4HgQSmBMZ Bj9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729788544; x=1730393344; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T3Rkybl+D+TZkW1u6FIlbANDEM1qJIGCUZc00hiPUrw=; b=oo7HeCK9zwqee9V4dGsgIj1dnCSOXOeX8PbMvFiFF0liFaQi/4zH4C/34LtS8/EqI7 s53bJ2ypOBMrTPyD4EAkJXDJEid55ycurrq2/d03FvvXhzmVQMVjeVsmMw4198+WqsQ2 6kIansaEZAtdt3UbWOOx9Jb2GQ9WnZXavN5xVcx0hJxodzOj/px5e6CMHfEyO+q8baAq UB0SFR8KYQ9q7DSh0Wc2Tk477pa64h2ynraaRHMQCehS40eXF02qhC/eaZtgkQ6xlfdP A4ItOHKl+If6Tv36Xzt6u67M2iyXKpqxrd3wm9XEMcS2zRbD9EJYE2lnz+iIpc2cBowF XXww== X-Gm-Message-State: AOJu0Yzd2BvsTMwfCP8hHjLYPMESyaHIdkXFTk1US5XQsD7138kOcJIn JEMK2MKqShtjaM7Yo6RZmB/NyVtd792L2mOHMesU+s5NOdY2gAX5IYGjtPnga2Q= X-Google-Smtp-Source: AGHT+IHmfCOxM0+Kd3IlNNrqgDv1+tf+iyz8SQdB4GSh3mjz8omrWpyVo/zE59s60hj3oClhBQIDfA== X-Received: by 2002:aa7:88c3:0:b0:71e:72b5:3094 with SMTP id d2e1a72fcca58-72045facc76mr2950165b3a.28.1729788544077; Thu, 24 Oct 2024 09:49:04 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71ec13d75a2sm8125051b3a.135.2024.10.24.09.49.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 09:49:03 -0700 (PDT) Date: Thu, 24 Oct 2024 09:49:02 -0700 From: Stephen Hemminger To: Morten =?UTF-8?B?QnLDuHJ1cA==?= Cc: dev@dpdk.org, Bruce Richardson Subject: Re: [PATCH] net/ixgbe: fix per-queue stats for less queues Message-ID: <20241024094902.69cdb3d1@hermes.local> In-Reply-To: <20241024111757.791634-1-mb@smartsharesystems.com> References: <20241024111757.791634-1-mb@smartsharesystems.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 On Thu, 24 Oct 2024 11:17:57 +0000 Morten Br=C3=B8rup wrote: > Remove the requirement that the configured number of queues to provide > statistics for (RTE_ETHDEV_QUEUE_STAT_CNTRS) cannot be less than the > driver's max supported number of the same (IXGBE_QUEUE_STAT_COUNTERS). >=20 > Signed-off-by: Morten Br=C3=B8rup > --- > drivers/net/ixgbe/ixgbe_ethdev.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_e= thdev.c > index ab37c37469..895d6e7169 100644 > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > @@ -3385,7 +3385,8 @@ ixgbe_dev_stats_get(struct rte_eth_dev *dev, struct= rte_eth_stats *stats) > stats->opackets =3D hw_stats->gptc; > stats->obytes =3D hw_stats->gotc; > =20 > - 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++)= { Maybe use RTE_MIN_T to avoid using typeof directly here. diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_eth= dev.c index ab37c37469..cdf689c22d 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -3385,7 +3385,8 @@ ixgbe_dev_stats_get(struct rte_eth_dev *dev, struct r= te_eth_stats *stats) stats->opackets =3D hw_stats->gptc; stats->obytes =3D hw_stats->gotc; =20 - for (i =3D 0; i < IXGBE_QUEUE_STAT_COUNTERS; i++) { + for (i =3D 0; i < RTE_MIN_T(IXGBE_QUEUE_STAT_COUNTERS, + RTE_ETHDEV_QUEUE_STAT_CNTRS, unsigned); i++) { stats->q_ipackets[i] =3D hw_stats->qprc[i]; stats->q_opackets[i] =3D hw_stats->qptc[i]; stats->q_ibytes[i] =3D hw_stats->qbrc[i];