From patchwork Sun Jan 10 12:50:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 9793 Return-Path: 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 981408E9D; Sun, 10 Jan 2016 13:51:21 +0100 (CET) Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id 317378E6C for ; Sun, 10 Jan 2016 13:51:18 +0100 (CET) Received: by mail-wm0-f48.google.com with SMTP id f206so183777471wmf.0 for ; Sun, 10 Jan 2016 04:51:18 -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 :mime-version:content-type:content-transfer-encoding; bh=DxMq9Mjkn125CCKWGPUgmJWgwXKAAuBwJkZhXobUm6A=; b=A7xHDluoXpBWorcaPhYW9wbR2gubl+b/ISL3dmpkaRqhItVyFvNN08JQao+3DfDaPZ BCujhPyC727suVdj804LxugwrXDRNmA0p/wcUGMh16bZCjxR7HGLziKFwgKhoX3e75mh nVY/29HSAYyZYl9H4LGS/6ZiAxqzAy5w0/EAJMotcXw8mbazSteu9mym80xheZuYfCSK UA/OU+dxgW8xvtcVihBkwJWDw7XeumYjmAZ2UHJlmutPPgA0WC+TI08Ny/8xxL3UO1O/ jtZ3xocm7KQZ01IHdCwIC7pcfc0jP48n/XFCiStQOymb3MWW7rVO5qCsLfik7HZcRaFO xF6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=DxMq9Mjkn125CCKWGPUgmJWgwXKAAuBwJkZhXobUm6A=; b=hRuzimCTy7xBmUoiXSCS7tbWola+b0djEcjUIkYBWJwofnkJa7QjSmd1TBaAGhZ+0P 2Z5vJRS3surxkbHRglk/hULSLw3Qz/Zm8Puqn9iZ9PjJNlliaJ1AxL8lJWwFyzARbq96 TUa8pyK1NYQfNb/y6GHR3aieWytmM0WG9n4k06ozDffOwAHalLrE+MYgCyks6h/XelfF Me43jgTg1yHB6Elc4+lkAKFcR85qTklSBSxIT7qBY5dwo4GV/ii3eNCO3ZxFiB2d8GxR DFnS4R/rEmVRTBO3X3uQlleWD9Wpjem0hhaTmLH2uw0w4hSdwtV0GeZxsHX2awEyBbkW QlMA== X-Gm-Message-State: ALoCoQlz8GnAQs25wAXhDligYdsTefmEyM65/03srknSUV095eSY12hp4NJD7qjHUEPC4LqP1ZBMjGPR8YOsT5ads7T9kh0WqA== X-Received: by 10.28.194.69 with SMTP id s66mr9034308wmf.93.1452430278045; Sun, 10 Jan 2016 04:51:18 -0800 (PST) Received: from gloops.dev.6wind.com (144.77.126.78.rev.sfr.net. [78.126.77.144]) by smtp.gmail.com with ESMTPSA id u12sm8088011wmu.10.2016.01.10.04.51.16 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 10 Jan 2016 04:51:17 -0800 (PST) From: David Marchand To: dev@dpdk.org Date: Sun, 10 Jan 2016 13:50:54 +0100 Message-Id: <1452430254-30390-12-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1452430254-30390-1-git-send-email-david.marchand@6wind.com> References: <1452430254-30390-1-git-send-email-david.marchand@6wind.com> MIME-Version: 1.0 Cc: thomas.monjalon@dpdk.org Subject: [dpdk-dev] [PATCH 11/11] pci: place all uio pci device ids in a dedicated section X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" We could do something à la modinfo, but let's keep it simple for now. With this, you can extract the devices that need to be bound to uio / vfio with tools like objdump : $ objdump -j rte_pci_id_uio -s build/lib/librte_pmd_fm10k.so Contents of section rte_pci_id_uio: 15760 8680a415 ffffffff 8680d015 ffffffff ................ 15770 8680a515 ffffffff 00000000 00000000 ................ Signed-off-by: David Marchand --- drivers/crypto/qat/rte_qat_cryptodev.c | 2 +- drivers/net/bnx2x/bnx2x_ethdev.c | 4 ++-- drivers/net/cxgbe/cxgbe_ethdev.c | 2 +- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/igb_ethdev.c | 4 ++-- drivers/net/enic/enic_ethdev.c | 2 +- drivers/net/fm10k/fm10k_ethdev.c | 2 +- drivers/net/i40e/i40e_ethdev.c | 2 +- drivers/net/i40e/i40e_ethdev_vf.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++-- drivers/net/nfp/nfp_net.c | 2 +- drivers/net/virtio/virtio_ethdev.c | 2 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- lib/librte_eal/common/include/rte_pci.h | 2 ++ 14 files changed, 18 insertions(+), 16 deletions(-) diff --git a/drivers/crypto/qat/rte_qat_cryptodev.c b/drivers/crypto/qat/rte_qat_cryptodev.c index e500c1e..c9f5790 100644 --- a/drivers/crypto/qat/rte_qat_cryptodev.c +++ b/drivers/crypto/qat/rte_qat_cryptodev.c @@ -67,7 +67,7 @@ static struct rte_cryptodev_ops crypto_qat_ops = { * The set of PCI devices this driver supports */ -static struct rte_pci_id pci_id_qat_map[] = { +static struct rte_pci_id RTE_PCI_ID_UIO_SECTION pci_id_qat_map[] = { { .vendor_id = 0x8086, .device_id = 0x0443, diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c index f822cfd..7599ec6 100644 --- a/drivers/net/bnx2x/bnx2x_ethdev.c +++ b/drivers/net/bnx2x/bnx2x_ethdev.c @@ -17,7 +17,7 @@ * The set of PCI devices this driver supports */ #define PCI_VENDOR_ID_BROADCOM 0x14E4 -static struct rte_pci_id pci_id_bnx2x_map[] = { +static struct rte_pci_id RTE_PCI_ID_UIO_SECTION pci_id_bnx2x_map[] = { { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57800) }, { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57711) }, { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57810) }, @@ -33,7 +33,7 @@ static struct rte_pci_id pci_id_bnx2x_map[] = { { .vendor_id = 0, } }; -static struct rte_pci_id pci_id_bnx2xvf_map[] = { +static struct rte_pci_id RTE_PCI_ID_UIO_SECTION pci_id_bnx2xvf_map[] = { { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57800_VF) }, { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57810_VF) }, { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57811_VF) }, diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c index 97ef152..2620130 100644 --- a/drivers/net/cxgbe/cxgbe_ethdev.c +++ b/drivers/net/cxgbe/cxgbe_ethdev.c @@ -68,7 +68,7 @@ * Macros needed to support the PCI Device ID Table ... */ #define CH_PCI_DEVICE_ID_TABLE_DEFINE_BEGIN \ - static struct rte_pci_id cxgb4_pci_tbl[] = { + static struct rte_pci_id RTE_PCI_ID_UIO_SECTION cxgb4_pci_tbl[] = { #define CH_PCI_DEVICE_ID_FUNCTION 0x4 #define PCI_VENDOR_ID_CHELSIO 0x1425 diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index 4cf9217..fb71686 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -136,7 +136,7 @@ static enum e1000_fc_mode em_fc_setting = e1000_fc_full; /* * The set of PCI devices this driver supports */ -static const struct rte_pci_id pci_id_em_map[] = { +static const struct rte_pci_id RTE_PCI_ID_UIO_SECTION pci_id_em_map[] = { #define RTE_PCI_DEV_ID_DECL_EM(vend, dev) {RTE_PCI_DEVICE(vend, dev)}, #include "em_pci_dev_ids.h" diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index 3f85a2c..f71bcd1 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -273,7 +273,7 @@ static enum e1000_fc_mode igb_fc_setting = e1000_fc_full; /* * The set of PCI devices this driver supports */ -static const struct rte_pci_id pci_id_igb_map[] = { +static const struct rte_pci_id RTE_PCI_ID_UIO_SECTION pci_id_igb_map[] = { #define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) {RTE_PCI_DEVICE(vend, dev)}, #include "igb_pci_dev_ids.h" @@ -284,7 +284,7 @@ static const struct rte_pci_id pci_id_igb_map[] = { /* * The set of PCI devices this driver supports (for 82576&I350 VF) */ -static const struct rte_pci_id pci_id_igbvf_map[] = { +static const struct rte_pci_id RTE_PCI_ID_UIO_SECTION pci_id_igbvf_map[] = { #define RTE_PCI_DEV_ID_DECL_IGBVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)}, #include "igb_pci_dev_ids.h" diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index e3bd8ec..d67f643 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -58,7 +58,7 @@ * The set of PCI devices this driver supports */ #define PCI_VENDOR_ID_CISCO 0x1137 -static const struct rte_pci_id pci_id_enic_map[] = { +static const struct rte_pci_id RTE_PCI_ID_UIO_SECTION pci_id_enic_map[] = { { RTE_PCI_DEVICE(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET) }, { RTE_PCI_DEVICE(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET_VF) }, {.vendor_id = 0, /* sentinel */}, diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 3ab744a..6b50abf 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -2740,7 +2740,7 @@ eth_fm10k_dev_uninit(struct rte_eth_dev *dev) * The set of PCI devices this driver supports. This driver will enable both PF * and SRIOV-VF devices. */ -static const struct rte_pci_id pci_id_fm10k_map[] = { +static const struct rte_pci_id RTE_PCI_ID_UIO_SECTION pci_id_fm10k_map[] = { { RTE_PCI_DEVICE(FM10K_INTEL_VENDOR_ID, FM10K_DEV_ID_PF) }, { RTE_PCI_DEVICE(FM10K_INTEL_VENDOR_ID, FM10K_DEV_ID_SDI_FM10420_QDA2) }, { RTE_PCI_DEVICE(FM10K_INTEL_VENDOR_ID, FM10K_DEV_ID_VF) }, diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 3213264..80dfd98 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -415,7 +415,7 @@ static int i40e_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id); -static const struct rte_pci_id pci_id_i40e_map[] = { +static const struct rte_pci_id RTE_PCI_ID_UIO_SECTION pci_id_i40e_map[] = { { RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_XL710) }, { RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QEMU) }, { RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_A) }, diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index fd963fd..47f5fab 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -1116,7 +1116,7 @@ i40evf_get_link_status(struct rte_eth_dev *dev, struct rte_eth_link *link) return 0; } -static const struct rte_pci_id pci_id_i40evf_map[] = { +static const struct rte_pci_id RTE_PCI_ID_UIO_SECTION pci_id_i40evf_map[] = { { RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_VF) }, { RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_VF_HV) }, { RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_X722_VF) }, diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index b31f52e..f970ca9 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -378,7 +378,7 @@ static int ixgbe_timesync_write_time(struct rte_eth_dev *dev, /* * The set of PCI devices this driver supports */ -static const struct rte_pci_id pci_id_ixgbe_map[] = { +static const struct rte_pci_id RTE_PCI_ID_UIO_SECTION pci_id_ixgbe_map[] = { #define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) {RTE_PCI_DEVICE(vend, dev)}, #include "ixgbe_pci_dev_ids.h" @@ -390,7 +390,7 @@ static const struct rte_pci_id pci_id_ixgbe_map[] = { /* * The set of PCI devices this driver supports (for 82599 VF) */ -static const struct rte_pci_id pci_id_ixgbevf_map[] = { +static const struct rte_pci_id RTE_PCI_ID_UIO_SECTION pci_id_ixgbevf_map[] = { #define RTE_PCI_DEV_ID_DECL_IXGBEVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)}, #include "ixgbe_pci_dev_ids.h" diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index bc2089f..32bcec1 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -2444,7 +2444,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev) return 0; } -static struct rte_pci_id pci_id_nfp_net_map[] = { +static struct rte_pci_id RTE_PCI_ID_UIO_SECTION pci_id_nfp_net_map[] = { { .vendor_id = PCI_VENDOR_ID_NETRONOME, .device_id = PCI_DEVICE_ID_NFP6000_PF_NIC, diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index e9af0d7..c1d9d11 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -105,7 +105,7 @@ static int virtio_dev_queue_stats_mapping_set( /* * The set of PCI devices this driver supports */ -static const struct rte_pci_id pci_id_virtio_map[] = { +static const struct rte_pci_id RTE_PCI_ID_UIO_SECTION pci_id_virtio_map[] = { { RTE_PCI_DEVICE(VIRTIO_PCI_VENDORID, VIRTIO_PCI_DEVICEID_MIN) }, { .vendor_id = 0, /* sentinel */ }, }; diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c index b9de8eb..724ab4b 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -100,7 +100,7 @@ static void vmxnet3_process_events(struct vmxnet3_hw *); */ #define PCI_VENDOR_ID_VMWARE 0x15AD #define VMWARE_DEV_ID_VMXNET3 0x07B0 -static const struct rte_pci_id pci_id_vmxnet3_map[] = { +static const struct rte_pci_id RTE_PCI_ID_UIO_SECTION pci_id_vmxnet3_map[] = { { RTE_PCI_DEVICE(PCI_VENDOR_ID_VMWARE, VMWARE_DEV_ID_VMXNET3) }, { .vendor_id = 0, /* sentinel */ }, }; diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h index 334c12e..094b1c0 100644 --- a/lib/librte_eal/common/include/rte_pci.h +++ b/lib/librte_eal/common/include/rte_pci.h @@ -131,6 +131,8 @@ struct rte_pci_id { uint16_t subsystem_device_id; /**< Subsystem device ID or PCI_ANY_ID. */ }; +#define RTE_PCI_ID_UIO_SECTION __attribute__((section("rte_pci_id_uio"))) + /** * A structure describing the location of a PCI device. */