From: Bruce Richardson <bruce.richardson@intel.com>
To: "Morten Brørup" <mb@smartsharesystems.com>
Cc: Anatoly Burakov <anatoly.burakov@intel.com>,
Vladimir Medvedkin <vladimir.medvedkin@intel.com>, <dev@dpdk.org>
Subject: Re: [PATCH] net/ixgbe: fix per-queue stats for less queues
Date: Thu, 24 Oct 2024 17:46:25 +0100 [thread overview]
Message-ID: <Zxp54R0ZVYrdbGwV@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F81E@smartserver.smartshare.dk>
On Thu, Oct 24, 2024 at 06:28:27PM +0200, Morten Brørup wrote:
> > > > - for (i = 0; i < IXGBE_QUEUE_STAT_COUNTERS; i++) {
> > > > + for (i = 0; i < RTE_MIN(IXGBE_QUEUE_STAT_COUNTERS,
> > > > +
> > > > (typeof(IXGBE_QUEUE_STAT_COUNTERS))RTE_ETHDEV_QUEUE_STAT_CNTRS);
> > > > i++) {
> >
> > 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.
>
If I may suggest it, "typeof(i)" is shorter :-)
next prev parent reply other threads:[~2024-10-24 16:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-24 11:17 Morten Brørup
2024-10-24 15:15 ` Morten Brørup
2024-10-24 16:02 ` Bruce Richardson
2024-10-24 16:28 ` Morten Brørup
2024-10-24 16:46 ` Bruce Richardson [this message]
2024-10-24 19:00 ` Morten Brørup
2024-10-24 16:49 ` Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zxp54R0ZVYrdbGwV@bricha3-mobl1.ger.corp.intel.com \
--to=bruce.richardson@intel.com \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=mb@smartsharesystems.com \
--cc=vladimir.medvedkin@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).