From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by dpdk.org (Postfix) with ESMTP id AF938919D for ; Mon, 18 Jan 2016 13:31:07 +0100 (CET) Received: by mail-wm0-f43.google.com with SMTP id r129so49350498wmr.0 for ; Mon, 18 Jan 2016 04:31:07 -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=7JUIBbqKG0Hjn70ARZuuUzhH+s62p6PyzekE3XqQDnM=; b=ezLg19TiAbZTawybPkskZqv2naDAicz3MU9s3ByUHI8hkve/ctXZDC3hg5tVSwG2dY Xz5VIvCm+vkQPt/PPjBvpXrGSnTtmmPxQl3WTjeM2yo72LvNX26Vl3ybVVOKXi92HaoV c/BhWptGima4D2IR98DT1eaJ7jtIHxnJJlKP/iGGioUtvj0A3Y2757Jd7vst40j+W7w/ 5wJ2ODsV1GLe2KZW/XQeJ/J0wHjMEqFm1wcvaLaHOcMV6SMh8Ybiwdjl6aeilLIJak8Z xVULyKaVRw5W9pPQUk8gvYiS/RsdGbxJ+JwZIybie8eRF6dhHJbjoXiOkpUauyr0mntI 2N4g== 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=7JUIBbqKG0Hjn70ARZuuUzhH+s62p6PyzekE3XqQDnM=; b=MsvRMK3Fac25EF49Kw6+zEAAz6mBng2p9wPgu/c4zYt6lvWz2frGh/1R7XAUwUXPT4 hj9WRD/vNhkL2d85j1tpJpIz8NKkcfICdL+8f0beZDG1qhu5q3MqZNyRK61E59Oyz0y5 ReapgqNYUZBQK8lwWSXfL1sZr5NjpNcYS7Dqsh+Ia+pbOzrQd5lrns7yRhoOEBJE1sXj ta0bmaZpXw5PT/bkWc7AeiRSZMmS042s2zM9vDkvSGi7xqtctUGz+Zmzz51r0cfXJLqe o5xqvHKeTePDy3jdaTrvXWEVNn4dPcDD2ytjV5uoJ8Yi9iNYaggSP8aqKbCAcXL0VMmF u4/A== X-Gm-Message-State: AG10YOSzK+sXIRSPhCXCiZSfUL05jZmQCDQp0Y/apldPUes6Zq5LQzTshgLVaomD+jp2PPC6 X-Received: by 10.28.111.194 with SMTP id c63mr13428414wmi.90.1453120266551; Mon, 18 Jan 2016 04:31:06 -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 u191sm15606572wmd.4.2016.01.18.04.31.05 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 18 Jan 2016 04:31:05 -0800 (PST) From: David Marchand To: dev@dpdk.org Date: Mon, 18 Jan 2016 13:30:48 +0100 Message-Id: <1453120248-28274-11-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1453120248-28274-1-git-send-email-david.marchand@6wind.com> References: <1452430254-30390-1-git-send-email-david.marchand@6wind.com> <1453120248-28274-1-git-send-email-david.marchand@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 10/10] 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: , X-List-Received-Date: Mon, 18 Jan 2016 12:31:08 -0000 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 7655124..72546bd 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 a70c364..493b154 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 2c4905c..4e5748c 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 e9f6587..6801b9f 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 9302f27..f925265 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 94486e6..9cbb5dd 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 304f076..6d03695 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. */ -- 1.9.1