From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id 83F6B7CAF for ; Wed, 12 Jul 2017 01:25:45 +0200 (CEST) Received: by mail-wr0-f195.google.com with SMTP id k67so1741532wrc.1 for ; Tue, 11 Jul 2017 16:25:45 -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=0XhidE2w/fTZVCsPcLTS+fPO9D1gzFL4G+TIaTItjhw=; b=QEl+oGtEyrBjeQq8bs8gJnZ7+Aim+gJe5NCeVgrZHKud2jypvOTpvOcFXK3ZLqmCKu 97WRSBj6NBfgWeQnn0LUga4xr/SEODnAns1Eec0LsaWvG4W5xQhPq2sV2lvJjC5otc26 U+4qyG06A9HdYWgHF2wXOe46+dO6mqBHkf2xfB7qJdbXCDRgqcOYs9msnIJaF20AmOMO C6l378uGfd9sc/wSZwx/oe48IBHnjSIbfZ7fnERgTj9m6SYZZvJqqSh0bJr345sqsszM G0iltQLL9Ea80/10tvfx4QtKfWRKXud9XFfoj/ZlcqNGRXsryOZsEUSJ5ssiMEIP6hz2 faJQ== 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=0XhidE2w/fTZVCsPcLTS+fPO9D1gzFL4G+TIaTItjhw=; b=tc8gvz/pOJ/MICdufB+Y2DzP0HmfIx25FIZuqb93pCpvXrxRT0ElOmy3QJOl8iraZR LQhiGxh+mwlINSVmX73R4d4I6hUyG+qL9T0oBgjA2RX1r0AO+xbgC6aEsBP/Q73y00fe znrxBKAT864Z8gDCEIxN4PTxDaefEtmLkn/YJedk61mnDCSghGGGFiGS4xm7/cMggh1m A4R8W2OJxIeZZ2YSg67XFYRz7XSliwoC2ALzxVrVIaCgt2Xby4OADgRCY3ZauHI40PUO 7MCsKNf6meyt1nPHQ9dL6wDYUqxKmaUbH2ptrKy/yvU2vT0F7WgoNi3kme68WkarIS4i tqWw== X-Gm-Message-State: AIVw1112o9WWfbpfn0Fx+zNyryy/ynC9BCKUYNrjhDcGxwmkgYIzZNkU 6LsgKosd7KJ5Esev X-Received: by 10.80.220.138 with SMTP id r10mr4122686edk.91.1499815545124; Tue, 11 Jul 2017 16:25:45 -0700 (PDT) Received: from localhost.localdomain ([37.228.147.16]) by smtp.gmail.com with ESMTPSA id k45sm311516ede.16.2017.07.11.16.25.43 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 11 Jul 2017 16:25:43 -0700 (PDT) Sender: Jan Blunck From: Jan Blunck To: dev@dpdk.org Date: Tue, 11 Jul 2017 19:25:09 -0400 Message-Id: <20170711232512.54641-11-jblunck@infradead.org> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170711232512.54641-1-jblunck@infradead.org> References: <20170711232512.54641-1-jblunck@infradead.org> Subject: [dpdk-dev] [PATCH 10/13] 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: Tue, 11 Jul 2017 23:25:46 -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..a81322969 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