DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
To: Prashant Upadhyaya <praupadhyaya@gmail.com>
Cc: dev@dpdk.org
Subject: Re: Regarding port numbers assigned by DPDK for PCI devices
Date: Mon, 29 Jul 2024 20:43:29 +0300	[thread overview]
Message-ID: <20240729204329.58b888fe@sovereign> (raw)
In-Reply-To: <CAPBAu3UWH9Kq4NnuR-E1xzW2q4EcEB7=OuCT_46UNyVZjZCfeA@mail.gmail.com>

2024-07-29 22:18 (UTC+0530), Prashant Upadhyaya:
> Hi,
> 
> I have 4 ethernet interfaces available as PCI devices.
> The PCI addresses are known.
> When I start my DPDK application, it starts up properly and assigns the
> port numbers to them as 0, 1, 2, 3 expectedly.
> 
> However, is there a way I can force that a particular PCI address should be
> identified as port 0 by DPDK, another one as port 1 and so forth ?
> Does passing the arguments like -a <address1> -a <address2> to rte_eal_init
> ensure that, or is there any other way, or is there no way ?
> 
> I am on 24.03
> 
> Regards
> -Prashant

Hi,

Why do you need specific port numbers assigned to devices?

If you're going to use devices for different purposes,
you'd better have an application-level configuration
to specify PCI addresses to use for each purpose.
Iterate devices to match the address and find the port number.

It is also possible to disable automatic probing with "-a 0:0.0",
then to use rte_dev_probe() + rte_dev_event_callback_register()
to add devices and to get their port numbers.
However, this API, strictly speaking, does not guarantee
that the numbers will be assigned sequentially.
One advantage of using hot-plug is that you can build devargs
from within the application (or from configuration).

Refer to "rte_dev.h" in any case.
Multiple "-a" don't work the way you've described.

  reply	other threads:[~2024-07-29 17:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-29 16:48 Prashant Upadhyaya
2024-07-29 17:43 ` Dmitry Kozlyuk [this message]
2024-07-30  5:36   ` Prashant Upadhyaya
2024-07-30  8:15     ` Bruce Richardson
2024-07-31  9:55       ` Prashant Upadhyaya
2024-07-31  9:05     ` Ferruh Yigit
2024-07-31  9:54       ` Prashant Upadhyaya

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=20240729204329.58b888fe@sovereign \
    --to=dmitry.kozliuk@gmail.com \
    --cc=dev@dpdk.org \
    --cc=praupadhyaya@gmail.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).