DPDK patches and discussions
 help / color / mirror / Atom feed
From: 이근홍 <dlrmsghd@gmail.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [ethdev] Multiple devices with single PCI
Date: Thu, 28 Aug 2014 19:54:18 +0900	[thread overview]
Message-ID: <CAKBXKmCi1UMBySckOEVurQoS916O-6gMfFpTETOKkkNzj=ZLpA@mail.gmail.com> (raw)

Hello.
I found that DPDK has an abstraction for having multiple devices with
single PCI.
(RTE_PCI_DRV_MULTIPLE flag)
However, their is a naming collision while registering multiple devices.
Here is my possible solution.

Best regards.
Keunhong.


=====================================================

commit b4fb08c42584283a7c5fbb251ab23f0e2b5f099e
Author: leeopop <dlrmsghd@gmail.com> 2014-07-24 22:28:12
Committer: leeopop <dlrmsghd@gmail.com> 2014-07-24 22:28:12
Parent: bcc733c4780a007f56564277a79309c427367cc2 (ethdev: fix build of
named allocation debug)
Branches: master, github/master

multiple dev support

------------------------ lib/librte_ether/rte_ethdev.c
------------------------
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index fd1010a..06dda6b 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -204,8 +204,12 @@
  eth_drv = (struct eth_driver *)pci_drv;

  /* Create unique Ethernet device name using PCI address */
- snprintf(ethdev_name, RTE_ETH_NAME_MAX_LEN, "%d:%d.%d",
- pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function);
+ if(pci_drv->drv_flags & RTE_PCI_DRV_MULTIPLE)
+ snprintf(ethdev_name, RTE_ETH_NAME_MAX_LEN, "%d:%d.%d-%d",
+ pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function, nb_ports);
+ else
+ snprintf(ethdev_name, RTE_ETH_NAME_MAX_LEN, "%d:%d.%d",
+ pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function);

  eth_dev = rte_eth_dev_allocate(ethdev_name);
  if (eth_dev == NULL)

             reply	other threads:[~2014-08-28 10:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-28 10:54 이근홍 [this message]
2014-08-28 12:42 ` David Marchand
2014-08-28 12:46   ` Thomas Monjalon

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='CAKBXKmCi1UMBySckOEVurQoS916O-6gMfFpTETOKkkNzj=ZLpA@mail.gmail.com' \
    --to=dlrmsghd@gmail.com \
    --cc=dev@dpdk.org \
    /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).