From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id 99C1C1B1F1 for ; Mon, 6 Nov 2017 17:09:21 +0100 (CET) Received: by mail-wm0-f66.google.com with SMTP id z3so15307416wme.5 for ; Mon, 06 Nov 2017 08:09:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=USyckjAxsPIa26Rog7sdDsRfPPM+J2lEFcanR/iKvPM=; b=Egudh1a3RQ6cUVfD1ufQT6lYEAND+e8VzAec+tzb+EI9mIDXAFS5tivjdV9Izs/y2t 1sk3OVUSbqNOR8CqyKNS0ybBEaaib7QKqbKAkCF305sCwLjEQF1+p7yEtlhZyEKTscgM 58Txkkz5sc/zJQ+qc/tc3ZR9P26famoKnWH1hXrtOA3gfG6CWblXNVs5cp110xkZ1ZjY vx7rYTV6yGOtVS9DyyC3RO+OgfKqGTbmF3ge6jINDZN/j57QwA5Xwp5taFTR8UleiUSu 76HAckwWC7qUnXEIEqoRzYyWqF8qfJDQr8PIg2WnJFMczna/5GcTLarXwl9ETdURZobp YF4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=USyckjAxsPIa26Rog7sdDsRfPPM+J2lEFcanR/iKvPM=; b=h+b2Nr9fkweb5GfB17eQfixsHSRkmEzmxT9gvnDeMAkPNWntFuaGgmVF+jp4rtIt/e MCWdAd7GE2iRxTbrM2T4S414oruGq+/8f3jx+Xco2ulnbyITL3Swr0UysBo1Iagf13AK nC6EcvSArAgmclX5pE24whsDRUWZr2WkPGzvKOWICXpDWKn5xyfzwptY2K7V15ubaY2O PcxkZvQWTexaednbA66l5KwhEl5tmJe/m145ln+DJ5icaWzeFN0Jr9mzZPPX8WjJm4rw E5jQEG3TrO3f+9o+aW+fJyaaxZzkRn2uEMEHhnC3QcVID9GsjHStSviVSOwqy2Xj/U5F FIZw== X-Gm-Message-State: AMCzsaUSV+/ncLFQLqN576mDiPYPyEWaHtXYXpKS8i4OliuRH5Cdxea5 GRU0mMaei4sllGMDMQ2/d8ybb/hX X-Google-Smtp-Source: ABhQp+SMZqgNZxZVLU18Nsi+04Rw6/xoqCa78d6qmPaxDQlm7Zp2x1DhcNYKvgXQJNpIkKQqC9paAQ== X-Received: by 10.80.175.66 with SMTP id g60mr21344770edd.283.1509984560457; Mon, 06 Nov 2017 08:09:20 -0800 (PST) Received: from bidouze.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id k5sm9947619edc.61.2017.11.06.08.09.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 Nov 2017 08:09:19 -0800 (PST) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Mon, 6 Nov 2017 17:08:58 +0100 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v1 1/2] eal: use proper namespace for VFIO symbols 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: Mon, 06 Nov 2017 16:09:21 -0000 Exposed VFIO functions simply uses a "vfio" prefix. Use the proper "rte_vfio" prefix for those symbols. Fixes: 279b581c897d ("vfio: expose functions") Signed-off-by: Gaetan Rivet --- drivers/bus/pci/linux/pci.c | 2 +- drivers/bus/pci/linux/pci_vfio.c | 12 ++++++------ lib/librte_eal/bsdapp/eal/eal.c | 20 ++++++++++---------- lib/librte_eal/common/include/rte_vfio.h | 10 +++++----- lib/librte_eal/linuxapp/eal/eal.c | 4 ++-- lib/librte_eal/linuxapp/eal/eal_vfio.c | 10 +++++----- lib/librte_eal/rte_eal_version.map | 10 +++++----- 7 files changed, 34 insertions(+), 34 deletions(-) diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c index cdf8106..e81969b 100644 --- a/drivers/bus/pci/linux/pci.c +++ b/drivers/bus/pci/linux/pci.c @@ -594,7 +594,7 @@ rte_pci_get_iommu_class(void) has_iova_va = pci_one_device_has_iova_va(); is_bound_uio = pci_one_device_bound_uio(); #ifdef VFIO_PRESENT - is_vfio_noiommu_enabled = vfio_noiommu_is_enabled() == true ? + is_vfio_noiommu_enabled = rte_vfio_noiommu_is_enabled() == true ? true : false; #endif diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c index 3ca35b6..035ff50 100644 --- a/drivers/bus/pci/linux/pci_vfio.c +++ b/drivers/bus/pci/linux/pci_vfio.c @@ -325,7 +325,7 @@ pci_vfio_is_ioport_bar(int vfio_dev_fd, int bar_index) } static int -pci_vfio_setup_device(struct rte_pci_device *dev, int vfio_dev_fd) +pci_rte_vfio_setup_device(struct rte_pci_device *dev, int vfio_dev_fd) { if (pci_vfio_setup_interrupts(dev, vfio_dev_fd) != 0) { RTE_LOG(ERR, EAL, "Error setting up interrupts!\n"); @@ -465,7 +465,7 @@ pci_vfio_map_resource_primary(struct rte_pci_device *dev) snprintf(pci_addr, sizeof(pci_addr), PCI_PRI_FMT, loc->domain, loc->bus, loc->devid, loc->function); - ret = vfio_setup_device(pci_get_sysfs_path(), pci_addr, + ret = rte_vfio_setup_device(pci_get_sysfs_path(), pci_addr, &vfio_dev_fd, &device_info); if (ret) return ret; @@ -546,7 +546,7 @@ pci_vfio_map_resource_primary(struct rte_pci_device *dev) dev->mem_resource[i].addr = maps[i].addr; } - if (pci_vfio_setup_device(dev, vfio_dev_fd) < 0) { + if (pci_rte_vfio_setup_device(dev, vfio_dev_fd) < 0) { RTE_LOG(ERR, EAL, " %s setup device failed\n", pci_addr); goto err_vfio_res; } @@ -582,7 +582,7 @@ pci_vfio_map_resource_secondary(struct rte_pci_device *dev) snprintf(pci_addr, sizeof(pci_addr), PCI_PRI_FMT, loc->domain, loc->bus, loc->devid, loc->function); - ret = vfio_setup_device(pci_get_sysfs_path(), pci_addr, + ret = rte_vfio_setup_device(pci_get_sysfs_path(), pci_addr, &vfio_dev_fd, &device_info); if (ret) return ret; @@ -662,7 +662,7 @@ pci_vfio_unmap_resource(struct rte_pci_device *dev) return -1; } - ret = vfio_release_device(pci_get_sysfs_path(), pci_addr, + ret = rte_vfio_release_device(pci_get_sysfs_path(), pci_addr, dev->intr_handle.vfio_dev_fd); if (ret < 0) { RTE_LOG(ERR, EAL, @@ -758,6 +758,6 @@ pci_vfio_ioport_unmap(struct rte_pci_ioport *p) int pci_vfio_is_enabled(void) { - return vfio_is_enabled("vfio_pci"); + return rte_vfio_is_enabled("vfio_pci"); } #endif diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index 09112b6..e1ac564 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -743,14 +743,14 @@ rte_eal_vfio_intr_mode(void) struct vfio_device_info; /* dummy prototypes. */ -int vfio_setup_device(const char *sysfs_base, const char *dev_addr, +int rte_vfio_setup_device(const char *sysfs_base, const char *dev_addr, int *vfio_dev_fd, struct vfio_device_info *device_info); -int vfio_release_device(const char *sysfs_base, const char *dev_addr, int fd); -int vfio_enable(const char *modname); -int vfio_is_enabled(const char *modname); -int vfio_noiommu_is_enabled(void); +int rte_vfio_release_device(const char *sysfs_base, const char *dev_addr, int fd); +int rte_vfio_enable(const char *modname); +int rte_vfio_is_enabled(const char *modname); +int rte_vfio_noiommu_is_enabled(void); -int vfio_setup_device(__rte_unused const char *sysfs_base, +int rte_vfio_setup_device(__rte_unused const char *sysfs_base, __rte_unused const char *dev_addr, __rte_unused int *vfio_dev_fd, __rte_unused struct vfio_device_info *device_info) @@ -758,24 +758,24 @@ int vfio_setup_device(__rte_unused const char *sysfs_base, return -1; } -int vfio_release_device(__rte_unused const char *sysfs_base, +int rte_vfio_release_device(__rte_unused const char *sysfs_base, __rte_unused const char *dev_addr, __rte_unused int fd) { return -1; } -int vfio_enable(__rte_unused const char *modname) +int rte_vfio_enable(__rte_unused const char *modname) { return -1; } -int vfio_is_enabled(__rte_unused const char *modname) +int rte_vfio_is_enabled(__rte_unused const char *modname) { return 0; } -int vfio_noiommu_is_enabled(void) +int rte_vfio_noiommu_is_enabled(void) { return 0; } diff --git a/lib/librte_eal/common/include/rte_vfio.h b/lib/librte_eal/common/include/rte_vfio.h index d5934cd..a69c4ff 100644 --- a/lib/librte_eal/common/include/rte_vfio.h +++ b/lib/librte_eal/common/include/rte_vfio.h @@ -82,7 +82,7 @@ * <0 on failure. * >1 if the device cannot be managed this way. */ -int vfio_setup_device(const char *sysfs_base, const char *dev_addr, +int rte_vfio_setup_device(const char *sysfs_base, const char *dev_addr, int *vfio_dev_fd, struct vfio_device_info *device_info); /** @@ -104,7 +104,7 @@ int vfio_setup_device(const char *sysfs_base, const char *dev_addr, * 0 on success. * <0 on failure. */ -int vfio_release_device(const char *sysfs_base, const char *dev_addr, int fd); +int rte_vfio_release_device(const char *sysfs_base, const char *dev_addr, int fd); /** * Enable a VFIO-related kmod. @@ -119,7 +119,7 @@ int vfio_release_device(const char *sysfs_base, const char *dev_addr, int fd); * 0 on success. * <0 on failure. */ -int vfio_enable(const char *modname); +int rte_vfio_enable(const char *modname); /** * Check whether a VFIO-related kmod is enabled. @@ -134,7 +134,7 @@ int vfio_enable(const char *modname); * !0 if true. * 0 otherwise. */ -int vfio_is_enabled(const char *modname); +int rte_vfio_is_enabled(const char *modname); /** * Whether VFIO NOIOMMU mode is enabled. @@ -146,7 +146,7 @@ int vfio_is_enabled(const char *modname); * !0 if true. * 0 otherwise. */ -int vfio_noiommu_is_enabled(void); +int rte_vfio_noiommu_is_enabled(void); #endif /* VFIO_PRESENT */ diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index 017c402..0c36b76 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -710,9 +710,9 @@ static int rte_eal_vfio_setup(void) { int vfio_enabled = 0; - if (vfio_enable("vfio")) + if (rte_vfio_enable("vfio")) return -1; - vfio_enabled = vfio_is_enabled("vfio"); + vfio_enabled = rte_vfio_is_enabled("vfio"); if (vfio_enabled) { diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c index 5bbcdf9..b8fd37a 100644 --- a/lib/librte_eal/linuxapp/eal/eal_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c @@ -284,7 +284,7 @@ clear_group(int vfio_group_fd) } int -vfio_setup_device(const char *sysfs_base, const char *dev_addr, +rte_vfio_setup_device(const char *sysfs_base, const char *dev_addr, int *vfio_dev_fd, struct vfio_device_info *device_info) { struct vfio_group_status group_status = { @@ -416,7 +416,7 @@ vfio_setup_device(const char *sysfs_base, const char *dev_addr, } int -vfio_release_device(const char *sysfs_base, const char *dev_addr, +rte_vfio_release_device(const char *sysfs_base, const char *dev_addr, int vfio_dev_fd) { struct vfio_group_status group_status = { @@ -478,7 +478,7 @@ vfio_release_device(const char *sysfs_base, const char *dev_addr, } int -vfio_enable(const char *modname) +rte_vfio_enable(const char *modname) { /* initialize group list */ int i; @@ -523,7 +523,7 @@ vfio_enable(const char *modname) } int -vfio_is_enabled(const char *modname) +rte_vfio_is_enabled(const char *modname) { const int mod_available = rte_eal_check_module(modname); return vfio_cfg.vfio_enabled && mod_available; @@ -841,7 +841,7 @@ vfio_noiommu_dma_map(int __rte_unused vfio_container_fd) } int -vfio_noiommu_is_enabled(void) +rte_vfio_noiommu_is_enabled(void) { int fd, ret, cnt __rte_unused; char c; diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map index d2a4ff9..07cd081 100644 --- a/lib/librte_eal/rte_eal_version.map +++ b/lib/librte_eal/rte_eal_version.map @@ -235,10 +235,10 @@ DPDK_17.11 { rte_eal_vfio_intr_mode; rte_lcore_has_role; rte_memcpy_ptr; - vfio_enable; - vfio_is_enabled; - vfio_noiommu_is_enabled; - vfio_release_device; - vfio_setup_device; + rte_vfio_enable; + rte_vfio_is_enabled; + rte_vfio_noiommu_is_enabled; + rte_vfio_release_device; + rte_vfio_setup_device; } DPDK_17.08; -- 2.1.4