DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ben Magistro <koncept1@gmail.com>
To: Olivier Matz <olivier.matz@6wind.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	ferruh.yigit@amd.com,  andrew.rybchenko@oktetlabs.ru
Cc: ben.magistro@trinitycyber.com, dev@dpdk.org,
	 Stefan Baranoff <stefan.baranoff@trinitycyber.com>
Subject: Sign changes through function signatures
Date: Thu, 2 Feb 2023 14:23:39 -0500	[thread overview]
Message-ID: <CAKx8PBjc5b4L44Dt5Xj1rk7i3UscfKQh=08HoshC9e_Jso6U6A@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1673 bytes --]

Hello,

While making some updates to our code base for 22.11.1 that were missed in
our first pass through, we hit the numa node change[1].  In the process of
updating our code, we noticed that a couple functions (rx/tx_queue_setup,
maybe more that we aren't using) state they accept `SOCKET_ID_ANY` but the
function signature then asks for an unsigned integer while `SOCKET_ID_ANY`
is `-1`.  Following it through the redirect to the "real" function it also
asks for an unsigned integer which is then passed on to one or more
functions asking for an integer.  As an example using the the i40e driver
-- we would call `rte_eth_tx_queue_setup` [2] which ultimately calls
`i40e_dev_tx_queue_setup`[3] which finally calls `rte_zmalloc_socket`[4]
and `rte_eth_dma_zone_reserve`[5].

I guess what I am looking for is clarification on if this is intentional or
if this is additional cleanup that may need to be completed/be desirable so
that signs are maintained through the call paths and avoid potentially
producing sign-conversion warnings.  From the very quick glance I took at
the i40e driver, it seems these are just passed through to other functions
and no direct use/manipulation occurs (at least in the mentioned functions).

1)
https://patches.dpdk.org/project/dpdk/patch/20221004145850.32331-1-olivier.matz@6wind.com/
2)
https://doc.dpdk.org/api/rte__ethdev_8h.html#a796c2f20778984c6f41b271e36bae50e
3) https://github.com/DPDK/dpdk/blob/main/drivers/net/i40e/i40e_rxtx.c#L1949
4)
https://doc.dpdk.org/api/rte__malloc_8h.html#a7e9f76b7e0b0921a617c6ab8b28f53b3
5)
https://github.com/DPDK/dpdk/blob/1094dd940ec0cc4e3ce2c5cd94807350855a17f9/lib/ethdev/ethdev_driver.h#L1566

[-- Attachment #2: Type: text/html, Size: 2335 bytes --]

             reply	other threads:[~2023-02-02 19:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-02 19:23 Ben Magistro [this message]
2023-02-02 20:26 ` Tyler Retzlaff
2023-02-02 20:45   ` Thomas Monjalon
2023-02-02 21:26     ` Morten Brørup
2023-02-03 12:05       ` Bruce Richardson
2023-02-03 22:12         ` Tyler Retzlaff
2023-02-04  8:09           ` Morten Brørup
2023-02-06 15:57             ` Ben Magistro

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='CAKx8PBjc5b4L44Dt5Xj1rk7i3UscfKQh=08HoshC9e_Jso6U6A@mail.gmail.com' \
    --to=koncept1@gmail.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=ben.magistro@trinitycyber.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=olivier.matz@6wind.com \
    --cc=stefan.baranoff@trinitycyber.com \
    --cc=thomas@monjalon.net \
    /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).