From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 79B397CAA for ; Fri, 14 Jul 2017 23:12:43 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id 15so936688wmm.3 for ; Fri, 14 Jul 2017 14:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=jAqL/2RMcNdMEpBWLrBMjCt4e9wjXn8DMdWj9hI1Who=; b=t8tkAi08Cchha+dgQLW169ddeZl53D3KYGpktqgaAHeslP11Jik1FGvy4P7uVVHNKu kYTBoC5z7hGSyDBu6Yf9ZyxA4PQl8Qwl4E5ztxjaNKtMDlNPncI7XIFYFMBkxfHoQisy Agjnkf4WLw6Rk5ux2JfPwDqLbAwq4vbXEE2tCdMTaxNwbWbTzWfSk3CUWEFYHDzC77AD +zGync09KPnKlm5mbF7+f92cF1WUofY/h4fCmDwGphuUpgaHhB3m7igWquYONVJtDGVk M5QEKQS3PZ8+rUUGnqTKjwz1WT0viAUmogADGMggMAC8HMv2vJFYJxpIYVYtg3vGmsul Nx8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=jAqL/2RMcNdMEpBWLrBMjCt4e9wjXn8DMdWj9hI1Who=; b=Cgx8hd7SimeBxM40LPBIS73tV0W0iysb8Gu8hmcWvsFBVKaRFZGHOunV9LqoK/PnYV hDM1uFgYEUSsgKZTTrdwESld1Wm+p0DCWWAlkXb+y9NIsH0QBpkXR/TZmbqs/v2AztvH L1f62Ym6GHwIz5I9CJGWddlg4H92fOMJOXFBWe8BI0ex3+4J7SgHrgY6QBRe8WcVKQPu VTIxWaicl4Ujp1oxmr5TEGYO2OEQBZErVnRSVq5aBNhb3Nw63npeGll7dMfsjw7AMXiM hk5ijUdpmVL8qpq8Ey6mNCe+gLpvt5sjpK8ASl+qY3LvGWsSjwC3Jx/voWMxrR3OyKkA 3MzQ== X-Gm-Message-State: AIVw110LR9WlN9/rE4mFpSmi0pL5Yu3rLwEU/M9TT1wZu9+u01rAxjsx kzJ0j6PgiuB7r2ej X-Received: by 10.80.172.21 with SMTP id v21mr8186825edc.141.1500066763115; Fri, 14 Jul 2017 14:12:43 -0700 (PDT) Received: from localhost.localdomain ([37.228.147.16]) by smtp.gmail.com with ESMTPSA id c11sm4892223eda.0.2017.07.14.14.12.41 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 14 Jul 2017 14:12:41 -0700 (PDT) Sender: Jan Blunck From: Jan Blunck To: dev@dpdk.org Date: Fri, 14 Jul 2017 17:12:09 -0400 Message-Id: <20170714211213.34436-12-jblunck@infradead.org> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170714211213.34436-1-jblunck@infradead.org> References: <20170711232512.54641-1-jblunck@infradead.org> <20170714211213.34436-1-jblunck@infradead.org> Subject: [dpdk-dev] [PATCH v2 11/15] pci: use busname X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 21:12:43 -0000 Signed-off-by: Jan Blunck --- drivers/net/virtio/virtio_pci.c | 3 +-- lib/librte_eal/common/eal_common_pci.c | 9 +++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c index e6eda75b6..dfc6edac2 100644 --- a/drivers/net/virtio/virtio_pci.c +++ b/drivers/net/virtio/virtio_pci.c @@ -685,8 +685,7 @@ vtpci_init(struct rte_pci_device *dev, struct virtio_hw *hw) if (rte_pci_ioport_map(dev, 0, VTPCI_IO(hw)) < 0) { if (dev->kdrv == RTE_KDRV_UNKNOWN && (!dev->device.devargs || - dev->device.devargs->bus != - rte_bus_find_by_name("pci"))) { + strcmp("pci", dev->device.devargs->busname) != 0)) { PMD_INIT_LOG(INFO, "skip kernel managed virtio device."); return 1; diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c index fb0e29ac4..834db50de 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -71,17 +71,18 @@ const char *pci_get_sysfs_path(void) return path; } +static int pci_parse(const char *name, void *addr); + static struct rte_devargs *pci_devargs_lookup(struct rte_pci_device *dev) { struct rte_devargs *devargs; struct rte_pci_addr addr; - struct rte_bus *pbus; - pbus = rte_bus_find_by_name("pci"); TAILQ_FOREACH(devargs, &devargs_list, next) { - if (devargs->bus != pbus) + if (strcmp(devargs->busname, rte_pci_bus.bus.name) != 0) + continue; + if (pci_parse(devargs->name, &addr) != 0) continue; - devargs->bus->parse(devargs->name, &addr); if (!rte_eal_compare_pci_addr(&dev->addr, &addr)) return devargs; } -- 2.13.2