Message ID | 1469201650-32447-1-git-send-email-okaya@codeaurora.org (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Thomas Monjalon |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 03BCA4A63; Fri, 22 Jul 2016 17:34:26 +0200 (CEST) Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by dpdk.org (Postfix) with ESMTP id 29A9B47CD for <dev@dpdk.org>; Fri, 22 Jul 2016 17:34:24 +0200 (CEST) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 6899C60F78; Fri, 22 Jul 2016 15:34:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 990A46029F; Fri, 22 Jul 2016 15:34:21 +0000 (UTC) From: Sinan Kaya <okaya@codeaurora.org> To: dev@dpdk.org Cc: Sinan Kaya <okaya@codeaurora.org> Date: Fri, 22 Jul 2016 11:34:10 -0400 Message-Id: <1469201650-32447-1-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 Subject: [dpdk-dev] [PATCH] ethdev: support PCI domains X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Sinan Kaya
July 22, 2016, 3:34 p.m. UTC
The current code is enumerating devices based on bus, device and function
pairs. This does not work well for architectures with multiple PCI
segments/domains. Multiple PCI devices will have the same BDF value but
different segment numbers (01:01:01.0 and 02:01:01.0) for instance.
Adding segment numbers to device naming so that we can uniquely identify
devices.
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
lib/librte_ether/rte_ethdev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On Fri, 22 Jul 2016 11:34:10 -0400 Sinan Kaya <okaya@codeaurora.org> wrote: > The current code is enumerating devices based on bus, device and function > pairs. This does not work well for architectures with multiple PCI > segments/domains. Multiple PCI devices will have the same BDF value but > different segment numbers (01:01:01.0 and 02:01:01.0) for instance. > > Adding segment numbers to device naming so that we can uniquely identify > devices. > > Signed-off-by: Sinan Kaya <okaya@codeaurora.org> I ran into this yes. There is a small risk of breaking some application that assumed something about names though. Acked-by: Stephen Hemminger <stephen@networkplumber.org>
On 7/22/2016 5:12 PM, Stephen Hemminger wrote: > On Fri, 22 Jul 2016 11:34:10 -0400 > Sinan Kaya <okaya@codeaurora.org> wrote: > >> The current code is enumerating devices based on bus, device and function >> pairs. This does not work well for architectures with multiple PCI >> segments/domains. Multiple PCI devices will have the same BDF value but >> different segment numbers (01:01:01.0 and 02:01:01.0) for instance. >> >> Adding segment numbers to device naming so that we can uniquely identify >> devices. >> >> Signed-off-by: Sinan Kaya <okaya@codeaurora.org> > > I ran into this yes. There is a small risk of breaking some application that > assumed something about names though. > > Acked-by: Stephen Hemminger <stephen@networkplumber.org> > Thanks, hopefully the change is minor and can be contained until next release.
2016-07-22 18:56, Sinan Kaya: > On 7/22/2016 5:12 PM, Stephen Hemminger wrote: > > On Fri, 22 Jul 2016 11:34:10 -0400 > > Sinan Kaya <okaya@codeaurora.org> wrote: > > > >> The current code is enumerating devices based on bus, device and function > >> pairs. This does not work well for architectures with multiple PCI > >> segments/domains. Multiple PCI devices will have the same BDF value but > >> different segment numbers (01:01:01.0 and 02:01:01.0) for instance. > >> > >> Adding segment numbers to device naming so that we can uniquely identify > >> devices. > >> > >> Signed-off-by: Sinan Kaya <okaya@codeaurora.org> > > > > I ran into this yes. There is a small risk of breaking some application that > > assumed something about names though. > > > > Acked-by: Stephen Hemminger <stephen@networkplumber.org> > > > > Thanks, hopefully the change is minor and can be contained until next release. It is part of the EAL rework. The function has been moved in EAL and includes the PCI domain: http://dpdk.org/commit/affe1cdc
On 10/4/2016 4:15 AM, Thomas Monjalon wrote: > 2016-07-22 18:56, Sinan Kaya: >> On 7/22/2016 5:12 PM, Stephen Hemminger wrote: >>> On Fri, 22 Jul 2016 11:34:10 -0400 >>> Sinan Kaya <okaya@codeaurora.org> wrote: >>> >>>> The current code is enumerating devices based on bus, device and function >>>> pairs. This does not work well for architectures with multiple PCI >>>> segments/domains. Multiple PCI devices will have the same BDF value but >>>> different segment numbers (01:01:01.0 and 02:01:01.0) for instance. >>>> >>>> Adding segment numbers to device naming so that we can uniquely identify >>>> devices. >>>> >>>> Signed-off-by: Sinan Kaya <okaya@codeaurora.org> >>> >>> I ran into this yes. There is a small risk of breaking some application that >>> assumed something about names though. >>> >>> Acked-by: Stephen Hemminger <stephen@networkplumber.org> >>> >> >> Thanks, hopefully the change is minor and can be contained until next release. > > It is part of the EAL rework. > The function has been moved in EAL and includes the PCI domain: > http://dpdk.org/commit/affe1cdc > Thanks for taking care of it.
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 0a6e3f1..929240f 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -226,7 +226,8 @@ rte_eth_dev_create_unique_device_name(char *name, size_t size, { int ret; - ret = snprintf(name, size, "%d:%d.%d", + ret = snprintf(name, size, "%d:%d:%d.%d", + pci_dev->addr.domain, pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function); if (ret < 0)