From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id 4A5561B78E for ; Thu, 26 Oct 2017 12:06:40 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id p75so6851988wmg.3 for ; Thu, 26 Oct 2017 03:06:40 -0700 (PDT) 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=Z3d1ThQMXUnu2GPdGNs0woSj3x5ALhnylgy8+uYcfhE=; b=F0UU7SCfMqGCepkTFnUxjlCaEjbHU7kpgybgZ3ZVELmsnFXXZ3Qe/V0V/51dBhcw8Z C8CUma5NRqlO0NJNCT6AGMlVNuXmt4O5ipKYy9bDFp0cEbdYkhMa0NNLAaAPHSgeV2Jr Av86d/6uxOucHADixho6PzU1af5DJW43ywj/LpRPPeut/DWkpq2ztRdvK4qqLuDuFDXf we+2blOpsQAgq1XGdlFqJFIZD+9qeLsCF4Vof97G+dXlmxKl973i81c0KJbsWgF49rk2 sw93TszK34BPUr8PUAVA95zOxJqJrdiYmoarOJfWU0aadQKpno6P3MDkyTikRleGyfOu aZOQ== 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=Z3d1ThQMXUnu2GPdGNs0woSj3x5ALhnylgy8+uYcfhE=; b=tN4y1/OqBnutop8CxFlYidXeC2/f5IoDyYzNVfx27SsF7iJkh+dgAV/hDcT2sSFD00 23BWLGYgAZCvLDdymwzRT4DgAirG1rljqYUEEn2WSvp7KeFAPeGeORtPBy05cpZ8UMfY ltasigZIAzwmBEFliSiZgT+7TqqonlmcK+My1aURHidhPsq7D+jROotMnJ1ijhGfPTPv lC0n2GImwZEPVppY7wMQ+hFwKtMBrl+Nw99WNwC8agcmEzE+rFNnpdu5rCPLUB70oZj4 ztKWc6k9RWa8tNM8eDSHGfJulPv4c1mJPVO2RhaQAN6edXJ6LID+vz+j7/oNlHYlVWkP Otfw== X-Gm-Message-State: AMCzsaWYPvuPUrZJRRDBeIZztoTPBUa6jm9a6OznpT9/fXIvtshPXfdw Z35b9xfrCUMxFxae2/Y1QUNYL9SA X-Google-Smtp-Source: ABhQp+RfJjk49dtcRZ2be6+b9LRJw+maUeBeHkrC7Mu7XnS5/C2Z5j3a/xofxJk9zTXRCludu046Xg== X-Received: by 10.80.145.77 with SMTP id f13mr27453896eda.250.1509012399652; Thu, 26 Oct 2017 03:06:39 -0700 (PDT) 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 u12sm3339619edk.45.2017.10.26.03.06.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Oct 2017 03:06:38 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Thu, 26 Oct 2017 12:05:55 +0200 Message-Id: <9607de0663b6d9e499b88dfddad1c037e3b9be83.1509012196.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v8 10/25] vfio: move PCI-related symbols out of vfio header 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: Thu, 26 Oct 2017 10:06:40 -0000 These symbols are only relevant to PCI operations. Move them to a private PCI-related header, allowing to remove the dependency of the PCI subsystem upon private eal_vfio.h. Signed-off-by: Gaetan Rivet --- lib/librte_eal/linuxapp/eal/eal_pci_init.h | 14 ++++++++++++++ lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 3 +-- lib/librte_eal/linuxapp/eal/eal_vfio.h | 12 ------------ 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_init.h b/lib/librte_eal/linuxapp/eal/eal_pci_init.h index a20783d..99d7a2e 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci_init.h +++ b/lib/librte_eal/linuxapp/eal/eal_pci_init.h @@ -34,6 +34,8 @@ #ifndef EAL_PCI_INIT_H_ #define EAL_PCI_INIT_H_ +#include + #include /** IO resource type: */ @@ -74,6 +76,16 @@ int pci_uio_ioport_unmap(struct rte_pci_ioport *p); #ifdef RTE_EAL_VFIO +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) +#define RTE_PCI_MSIX_TABLE_BIR 0x7 +#define RTE_PCI_MSIX_TABLE_OFFSET 0xfffffff8 +#define RTE_PCI_MSIX_FLAGS_QSIZE 0x07ff +#else +#define RTE_PCI_MSIX_TABLE_BIR PCI_MSIX_TABLE_BIR +#define RTE_PCI_MSIX_TABLE_OFFSET PCI_MSIX_TABLE_OFFSET +#define RTE_PCI_MSIX_FLAGS_QSIZE PCI_MSIX_FLAGS_QSIZE +#endif + /* access config space */ int pci_vfio_read_config(const struct rte_intr_handle *intr_handle, void *buf, size_t len, off_t offs); @@ -92,6 +104,8 @@ int pci_vfio_ioport_unmap(struct rte_pci_ioport *p); int pci_vfio_map_resource(struct rte_pci_device *dev); int pci_vfio_unmap_resource(struct rte_pci_device *dev); +int pci_vfio_is_enabled(void); + #endif #endif /* EAL_PCI_INIT_H_ */ diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c index 8fa101b..19994c8 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c @@ -48,7 +48,6 @@ #include "eal_filesystem.h" #include "eal_pci_init.h" -#include "eal_vfio.h" #include "eal_private.h" /** @@ -61,7 +60,7 @@ * This file is only compiled if CONFIG_RTE_EAL_VFIO is set to "y". */ -#ifdef VFIO_PRESENT +#ifdef RTE_EAL_VFIO #define PAGE_SIZE (sysconf(_SC_PAGESIZE)) #define PAGE_MASK (~(PAGE_SIZE - 1)) diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.h b/lib/librte_eal/linuxapp/eal/eal_vfio.h index 8eb12db..766d004 100644 --- a/lib/librte_eal/linuxapp/eal/eal_vfio.h +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.h @@ -42,16 +42,6 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) -#define RTE_PCI_MSIX_TABLE_BIR 0x7 -#define RTE_PCI_MSIX_TABLE_OFFSET 0xfffffff8 -#define RTE_PCI_MSIX_FLAGS_QSIZE 0x07ff -#else -#define RTE_PCI_MSIX_TABLE_BIR PCI_MSIX_TABLE_BIR -#define RTE_PCI_MSIX_TABLE_OFFSET PCI_MSIX_TABLE_OFFSET -#define RTE_PCI_MSIX_FLAGS_QSIZE PCI_MSIX_FLAGS_QSIZE -#endif - #define RTE_VFIO_TYPE1 VFIO_TYPE1_IOMMU #ifndef VFIO_SPAPR_TCE_v2_IOMMU @@ -183,8 +173,6 @@ vfio_get_group_fd(int iommu_group_no); int clear_group(int vfio_group_fd); -int pci_vfio_is_enabled(void); - int vfio_mp_sync_setup(void); #define SOCKET_REQ_CONTAINER 0x100 -- 2.1.4