Skip to contentSkip to conversation

time to kill rte_pci_dev_ids.h

PATCH Superseded Stephen Hemminger 10 participants 92 messages Jan 5, 2016 – Jul 11, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Has anyone looked at getting rid of rte_pci_dev_ids.h? The current method with #ifdef's and putting all devices in one file really doesn't scale well. Something more like other OS's where the data is only in each device driver would be better.

#1 lore raw

2016-01-05 11:37, Stephen Hemminger:

Quoted 4 lines

Has anyone looked at getting rid of rte_pci_dev_ids.h? The current method with #ifdef's and putting all devices in one file really doesn't scale well. Something more like other OS's where the data is only in each device driver would be better.

I agree.
The PCI ids should be embedded in drivers.
If I remember well, it's already the case for some of them. I would love to see a tool able to list the supported devices by reading a binary libraries.

#2 lore raw

Hello,

Quoted 6 lines · Thomas Monjalon

2016-01-05 11:37, Stephen Hemminger:

Quoted 4 lines

Has anyone looked at getting rid of rte_pci_dev_ids.h? The current method with #ifdef's and putting all devices in one file really doesn't scale well. Something more like other OS's where the data is only in each device driver would be better.

Quoted 6 lines

I agree.
The PCI ids should be embedded in drivers.
If I remember well, it's already the case for some of them. I would love to see a tool able to list the supported devices by reading a binary libraries.

I have done the first part of the job, moving all pci dev ids to the pmds, just rebased it.
I can post this.

In the last patch of the series, I put all those ids in a dedicated section, that can be dumped with objdump.
Having a tool for this (like what I proposed some time ago) would be great but I did not find time to write it.

The thing is, what do we want to achieve with such a tool ?

My usecase at the moment is for "automatic" device binding to kernel drivers before starting dpdk or when hotplugging.
But for this, I think that introducing a hook system in the pci probe functions is better.
I am thinking of a hook system that would execute an external tool (shell scripts, C, ...) with all needed informations: pci device, pmd that wants it, driver flags etc...
Return value would tell eal what to do next.
This would make it possible to implement the blacklist / whitelist out of eal itself, implement auto bind and maybe more.

If I go this way, I don't think that we need to expose the pci dev ids :-)

Signature · 1 line
David Marchand
#3 lore raw

cover kill global pci device id list

This patchset moves all pci device ids from eal to the pmds that need them (patches 1 to 8).
Global pci device id list is then removed (patches 9, 10).

In last patch, all those device ids are put in a dedicated section for retrieval by external tools.

Signature · 51 lines
David Marchand

David Marchand (11):
  e1000: move pci device ids to driver
  ixgbe: move pci device ids to driver
  i40e: move pci device ids to driver
  fm10k: move pci device ids to driver
  virtio: move pci device ids to driver
  vmxnet3: move pci device ids to driver
  enic: move pci device ids to driver
  bnx2x: move pci device ids to driver
  doc: refresh headers list
  pci: no need for global device ids list
  pci: place all uio pci device ids in a dedicated section

 app/test-pmd/Makefile                           |   2 +
 app/test-pmd/cmdline.c                          |   2 +-
 app/test/Makefile                               |   4 +
 app/test/test_pci.c                             |   5 +-
 doc/api/doxy-api-index.md                       |   1 -
 doc/guides/prog_guide/dev_kit_build_system.rst  |  56 +-
 drivers/crypto/qat/rte_qat_cryptodev.c          |   2 +-
 drivers/net/bnx2x/bnx2x.c                       |   3 +-
 drivers/net/bnx2x/bnx2x_ethdev.c                |  29 +-
 drivers/net/cxgbe/cxgbe_ethdev.c                |   2 +-
 drivers/net/e1000/em_ethdev.c                   |   4 +-
 drivers/net/e1000/em_pci_dev_ids.h              | 200 +++++++
 drivers/net/e1000/igb_ethdev.c                  |   8 +-
 drivers/net/e1000/igb_pci_dev_ids.h             | 164 ++++++
 drivers/net/enic/enic_ethdev.c                  |  14 +-
 drivers/net/fm10k/fm10k_ethdev.c                |  10 +-
 drivers/net/i40e/i40e_ethdev.c                  |  20 +-
 drivers/net/i40e/i40e_ethdev_vf.c               |   8 +-
 drivers/net/ixgbe/ixgbe_ethdev.c                |   8 +-
 drivers/net/ixgbe/ixgbe_pci_dev_ids.h           | 185 +++++++
 drivers/net/nfp/nfp_net.c                       |   2 +-
 drivers/net/virtio/virtio_ethdev.c              |   7 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c            |   9 +-
 lib/librte_eal/common/Makefile                  |   2 +-
 lib/librte_eal/common/include/rte_pci.h         |   2 +
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 667 ------------------------
 lib/librte_eal/linuxapp/kni/Makefile            |   2 +
 lib/librte_eal/linuxapp/kni/kni_misc.c          |   8 +-
 28 files changed, 678 insertions(+), 748 deletions(-)
 create mode 100644 drivers/net/e1000/em_pci_dev_ids.h
 create mode 100644 drivers/net/e1000/igb_pci_dev_ids.h
 create mode 100644 drivers/net/ixgbe/ixgbe_pci_dev_ids.h
 delete mode 100644 lib/librte_eal/common/include/rte_pci_dev_ids.h

-- 
1.9.1
#4 lore raw

PATCH 1/11 e1000: move pci device ids to driver

test application and kni still want to know e1000 pci devices. So let's create headers in the driver that will be used by them.

---
 app/test/Makefile                               |   3 +
 app/test/test_pci.c                             |   3 +-
 drivers/net/e1000/em_ethdev.c                   |   2 +-
 drivers/net/e1000/em_pci_dev_ids.h              | 200 +++++++++++++++++++
 drivers/net/e1000/igb_ethdev.c                  |   4 +-
 drivers/net/e1000/igb_pci_dev_ids.h             | 164 ++++++++++++++++
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 245 ------------------------
 lib/librte_eal/linuxapp/kni/Makefile            |   1 +
 lib/librte_eal/linuxapp/kni/kni_misc.c          |   4 +-
 9 files changed, 375 insertions(+), 251 deletions(-)
 create mode 100644 drivers/net/e1000/em_pci_dev_ids.h
 create mode 100644 drivers/net/e1000/igb_pci_dev_ids.h
app/test/Makefile +3 -0
index ec33e1a..687ae59 100644
@@ -168,6 +168,9 @@ CFLAGS_test_memcpy_perf.o += -fno-var-tracking-assignments
 endif
 endif
 
+# pci tests want to know some pci devices ids
+CFLAGS_test_pci.o += -I$(RTE_SDK)/drivers/net/e1000
+
 # this application needs libraries first
 DEPDIRS-y += lib drivers
 
app/test/test_pci.c +2 -1
index 5530d99..b289138 100644
@@ -77,8 +77,9 @@ struct rte_pci_id my_driver_id2[] = {
 
 /* IGB & EM NICS */
 #define RTE_PCI_DEV_ID_DECL_EM(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
+#include <em_pci_dev_ids.h>
 #define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include <rte_pci_dev_ids.h>
+#include <igb_pci_dev_ids.h>
 
 { .vendor_id = 0, /* sentinel */ },
 };
drivers/net/e1000/em_ethdev.c +1 -1
index 66e8993..4cf9217 100644
@@ -139,7 +139,7 @@ static enum e1000_fc_mode em_fc_setting = e1000_fc_full;
 static const struct rte_pci_id pci_id_em_map[] = {
 
 #define RTE_PCI_DEV_ID_DECL_EM(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+#include "em_pci_dev_ids.h"
 
 {0},
 };
drivers/net/e1000/em_pci_dev_ids.h new file +200 -0

200 lines not on this page · raw message

drivers/net/e1000/igb_ethdev.c +2 -2
index d1bbcda..3f85a2c 100644
@@ -276,7 +276,7 @@ static enum e1000_fc_mode igb_fc_setting = e1000_fc_full;
 static const struct rte_pci_id pci_id_igb_map[] = {
 
 #define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+#include "igb_pci_dev_ids.h"
 
 {0},
 };
@@ -287,7 +287,7 @@ static const struct rte_pci_id pci_id_igb_map[] = {
 static const struct rte_pci_id pci_id_igbvf_map[] = {
 
 #define RTE_PCI_DEV_ID_DECL_IGBVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+#include "igb_pci_dev_ids.h"
 
 {0},
 };
drivers/net/e1000/igb_pci_dev_ids.h new file +164 -0

164 lines not on this page · raw message

lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -245

275 lines not on this page · raw message

lib/librte_eal/linuxapp/kni/Makefile +1 -0
index ac99d3f..6ac7637 100644
@@ -43,6 +43,7 @@ MODULE_CFLAGS += -I$(SRCDIR) --param max-inline-insns-single=50
 MODULE_CFLAGS += -I$(RTE_OUTPUT)/include -I$(SRCDIR)/ethtool/ixgbe -I$(SRCDIR)/ethtool/igb
 MODULE_CFLAGS += -include $(RTE_OUTPUT)/include/rte_config.h
 MODULE_CFLAGS += -Wall -Werror
+MODULE_CFLAGS += -I$(RTE_SDK)/drivers/net/e1000
 
 ifeq ($(shell lsb_release -si 2>/dev/null),Ubuntu)
 MODULE_CFLAGS += -DUBUNTU_RELEASE_CODE=$(shell lsb_release -sr | tr -d .)
lib/librte_eal/linuxapp/kni/kni_misc.c +2 -2
index f5f18f0..96b07c2 100644
@@ -353,7 +353,7 @@ kni_dev_remove(struct kni_dev *dev)
 
 	switch (dev->device_id) {
 	#define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) case (dev):
-	#include <rte_pci_dev_ids.h>
+	#include <igb_pci_dev_ids.h>
 		igb_kni_remove(dev->pci_dev);
 		break;
 	#define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) case (dev):
@@ -510,7 +510,7 @@ kni_ioctl_create(struct net *net,
 			found_pci = pci;
 			switch (dev_info.device_id) {
 			#define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) case (dev):
-			#include <rte_pci_dev_ids.h>
+			#include <igb_pci_dev_ids.h>
 				ret = igb_kni_probe(found_pci, &lad_dev);
 				break;
 			#define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) \
Signature · 1 line
1.9.1
#5 lore raw

PATCH 2/11 ixgbe: move pci device ids to driver

In reply to David Marchand

test application and kni still want to know ixgbe pci devices. So let's create a header in the driver that will be used by them.

---
 app/test-pmd/Makefile                           |   2 +
 app/test-pmd/cmdline.c                          |   2 +-
 app/test/Makefile                               |   1 +
 app/test/test_pci.c                             |   2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c                |   4 +-
 drivers/net/ixgbe/ixgbe_pci_dev_ids.h           | 185 ++++++++++++++++++++++++
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 130 -----------------
 lib/librte_eal/linuxapp/kni/Makefile            |   1 +
 lib/librte_eal/linuxapp/kni/kni_misc.c          |   4 +-
 9 files changed, 195 insertions(+), 136 deletions(-)
 create mode 100644 drivers/net/ixgbe/ixgbe_pci_dev_ids.h
app/test-pmd/Makefile +2 -0
index 72426f3..a8899b8 100644
@@ -64,6 +64,8 @@ ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y)
 CFLAGS_mempool_anon.o := -D_GNU_SOURCE
 endif
 CFLAGS_cmdline.o := -D_GNU_SOURCE
+# for bypass pci device ids
+CFLAGS_cmdline.o += -I$(RTE_SDK)/drivers/net/ixgbe
 
 # this application needs libraries first
 DEPDIRS-y += lib drivers
app/test-pmd/cmdline.c +1 -1
index 73298c9..fdb2e1b 100644
@@ -9816,7 +9816,7 @@ cmd_reconfig_device_queue(portid_t id, uint8_t dev, uint8_t queue)
 }
 
 #ifdef RTE_NIC_BYPASS
-#include <rte_pci_dev_ids.h>
+#include <ixgbe_pci_dev_ids.h>
 uint8_t
 bypass_is_supported(portid_t port_id)
 {
app/test/Makefile +1 -0
index 687ae59..13fed78 100644
@@ -170,6 +170,7 @@ endif
 
 # pci tests want to know some pci devices ids
 CFLAGS_test_pci.o += -I$(RTE_SDK)/drivers/net/e1000
+CFLAGS_test_pci.o += -I$(RTE_SDK)/drivers/net/ixgbe
 
 # this application needs libraries first
 DEPDIRS-y += lib drivers
app/test/test_pci.c +1 -1
index b289138..d6a23d6 100644
@@ -68,7 +68,7 @@ static int my_driver_init(struct rte_pci_driver *dr,
 struct rte_pci_id my_driver_id[] = {
 
 #define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include <rte_pci_dev_ids.h>
+#include <ixgbe_pci_dev_ids.h>
 
 { .vendor_id = 0, /* sentinel */ },
 };
drivers/net/ixgbe/ixgbe_ethdev.c +2 -2
index 4c4c6df..b31f52e 100644
@@ -381,7 +381,7 @@ static int ixgbe_timesync_write_time(struct rte_eth_dev *dev,
 static const struct rte_pci_id pci_id_ixgbe_map[] = {
 
 #define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+#include "ixgbe_pci_dev_ids.h"
 
 { .vendor_id = 0, /* sentinel */ },
 };
@@ -393,7 +393,7 @@ static const struct rte_pci_id pci_id_ixgbe_map[] = {
 static const struct rte_pci_id pci_id_ixgbevf_map[] = {
 
 #define RTE_PCI_DEV_ID_DECL_IXGBEVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+#include "ixgbe_pci_dev_ids.h"
 { .vendor_id = 0, /* sentinel */ },
 
 };
drivers/net/ixgbe/ixgbe_pci_dev_ids.h new file +185 -0

185 lines not on this page · raw message

lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -130

160 lines not on this page · raw message

lib/librte_eal/linuxapp/kni/Makefile +1 -0
index 6ac7637..3bdf352 100644
@@ -44,6 +44,7 @@ MODULE_CFLAGS += -I$(RTE_OUTPUT)/include -I$(SRCDIR)/ethtool/ixgbe -I$(SRCDIR)/e
 MODULE_CFLAGS += -include $(RTE_OUTPUT)/include/rte_config.h
 MODULE_CFLAGS += -Wall -Werror
 MODULE_CFLAGS += -I$(RTE_SDK)/drivers/net/e1000
+MODULE_CFLAGS += -I$(RTE_SDK)/drivers/net/ixgbe
 
 ifeq ($(shell lsb_release -si 2>/dev/null),Ubuntu)
 MODULE_CFLAGS += -DUBUNTU_RELEASE_CODE=$(shell lsb_release -sr | tr -d .)
lib/librte_eal/linuxapp/kni/kni_misc.c +2 -2
index 96b07c2..f731d7c 100644
@@ -357,7 +357,7 @@ kni_dev_remove(struct kni_dev *dev)
 		igb_kni_remove(dev->pci_dev);
 		break;
 	#define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) case (dev):
-	#include <rte_pci_dev_ids.h>
+	#include <ixgbe_pci_dev_ids.h>
 		ixgbe_kni_remove(dev->pci_dev);
 		break;
 	default:
@@ -515,7 +515,7 @@ kni_ioctl_create(struct net *net,
 				break;
 			#define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) \
 							case (dev):
-			#include <rte_pci_dev_ids.h>
+			#include <ixgbe_pci_dev_ids.h>
 				ret = ixgbe_kni_probe(found_pci, &lad_dev);
 				break;
 			default:
Signature · 1 line
1.9.1
#6 lore raw

PATCH 3/11 i40e: move pci device ids to driver

In reply to David Marchand

Since the base driver already defines all pci device ids, no need to redefine them, let's just drop the previous RTE_PCI_DEV_ID_DECL* stuff.

---
 drivers/net/i40e/i40e_ethdev.c                  | 18 +++++++-
 drivers/net/i40e/i40e_ethdev_vf.c               |  6 ++-
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 60 -------------------------
 3 files changed, 20 insertions(+), 64 deletions(-)
drivers/net/i40e/i40e_ethdev.c +16 -2
index bf6220d..3213264 100644
@@ -416,8 +416,22 @@ static int i40e_dev_rx_queue_intr_disable(struct rte_eth_dev *dev,
 
 
 static const struct rte_pci_id pci_id_i40e_map[] = {
-#define RTE_PCI_DEV_ID_DECL_I40E(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+{ 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) },
+{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_B) },
+{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_C) },
+{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_A) },
+{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_B) },
+{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_C) },
+{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T) },
+{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_20G_KR2) },
+{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_20G_KR2_A) },
+{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T4) },
+{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_X722_A0) },
+{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_X722) },
+{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_1G_BASE_T_X722) },
+{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T_X722) },
 { .vendor_id = 0, /* sentinel */ },
 };
 
drivers/net/i40e/i40e_ethdev_vf.c +4 -2
index 14d2a50..fd963fd 100644
@@ -1117,8 +1117,10 @@ i40evf_get_link_status(struct rte_eth_dev *dev, struct rte_eth_link *link)
 }
 
 static const struct rte_pci_id pci_id_i40evf_map[] = {
-#define RTE_PCI_DEV_ID_DECL_I40EVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+{ 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) },
+{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_X722_VF_HV) },
 { .vendor_id = 0, /* sentinel */ },
 };
 
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -60

90 lines not on this page · raw message

Signature · 1 line
1.9.1
#9 lore raw

PATCH 4/11 fm10k: move pci device ids to driver

In reply to David Marchand

Since the base driver already defines all pci device ids, no need to redefine them, let's just drop the previous RTE_PCI_DEV_ID_DECL* stuff.

---
 drivers/net/fm10k/fm10k_ethdev.c                |  8 +++----
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 29 -------------------------
 2 files changed, 4 insertions(+), 33 deletions(-)
drivers/net/fm10k/fm10k_ethdev.c +4 -4
index e4aed94..3ab744a 100644
@@ -2741,10 +2741,10 @@ eth_fm10k_dev_uninit(struct rte_eth_dev *dev)
  * and SRIOV-VF devices.
  */
 static const struct rte_pci_id pci_id_fm10k_map[] = {
-#define RTE_PCI_DEV_ID_DECL_FM10K(vend, dev) { RTE_PCI_DEVICE(vend, dev) },
-#define RTE_PCI_DEV_ID_DECL_FM10KVF(vend, dev) { RTE_PCI_DEVICE(vend, dev) },
-#include "rte_pci_dev_ids.h"
-	{ .vendor_id = 0, /* sentinel */ },
+{ 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) },
+{ .vendor_id = 0, /* sentinel */ },
 };
 
 static struct eth_driver rte_pmd_fm10k = {
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -29
index f1f3e13..a19fdfa 100644
@@ -97,14 +97,6 @@
 #define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev)
 #endif
 
-#ifndef RTE_PCI_DEV_ID_DECL_FM10K
-#define RTE_PCI_DEV_ID_DECL_FM10K(vend, dev)
-#endif
-
-#ifndef RTE_PCI_DEV_ID_DECL_FM10KVF
-#define RTE_PCI_DEV_ID_DECL_FM10KVF(vend, dev)
-#endif
-
 #ifndef RTE_PCI_DEV_ID_DECL_ENIC
 #define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev)
 #endif
@@ -117,11 +109,6 @@
 #define RTE_PCI_DEV_ID_DECL_BNX2XVF(vend, dev)
 #endif
 
-#ifndef PCI_VENDOR_ID_INTEL
-/** Vendor ID used by Intel devices */
-#define PCI_VENDOR_ID_INTEL 0x8086
-#endif
-
 #ifndef PCI_VENDOR_ID_QUMRANET
 /** Vendor ID used by virtio devices */
 #define PCI_VENDOR_ID_QUMRANET 0x1AF4
@@ -142,14 +129,6 @@
 #define PCI_VENDOR_ID_BROADCOM 0x14E4
 #endif
 
-/*************** Physical FM10K devices from fm10k_type.h ***************/
-
-#define FM10K_DEV_ID_PF                   0x15A4
-#define FM10K_DEV_ID_SDI_FM10420_QDA2     0x15D0
-
-RTE_PCI_DEV_ID_DECL_FM10K(PCI_VENDOR_ID_INTEL, FM10K_DEV_ID_PF)
-RTE_PCI_DEV_ID_DECL_FM10K(PCI_VENDOR_ID_INTEL, FM10K_DEV_ID_SDI_FM10420_QDA2)
-
 /****************** Virtio devices from virtio.h ******************/
 
 #define QUMRANET_DEV_ID_VIRTIO                  0x1000
@@ -162,12 +141,6 @@ RTE_PCI_DEV_ID_DECL_VIRTIO(PCI_VENDOR_ID_QUMRANET, QUMRANET_DEV_ID_VIRTIO)
 
 RTE_PCI_DEV_ID_DECL_VMXNET3(PCI_VENDOR_ID_VMWARE, VMWARE_DEV_ID_VMXNET3)
 
-/*************** Virtual FM10K devices from fm10k_type.h ***************/
-
-#define FM10K_DEV_ID_VF                   0x15A5
-
-RTE_PCI_DEV_ID_DECL_FM10KVF(PCI_VENDOR_ID_INTEL, FM10K_DEV_ID_VF)
-
 /****************** Cisco VIC devices ******************/
 
 #define PCI_DEVICE_ID_CISCO_VIC_ENET         0x0043  /* ethernet vnic */
@@ -228,5 +201,3 @@ RTE_PCI_DEV_ID_DECL_BNX2X(PCI_VENDOR_ID_BROADCOM, BNX2X_DEV_ID_57840_MF)
 #undef RTE_PCI_DEV_ID_DECL_BNX2XVF
 #undef RTE_PCI_DEV_ID_DECL_VIRTIO
 #undef RTE_PCI_DEV_ID_DECL_VMXNET3
-#undef RTE_PCI_DEV_ID_DECL_FM10K
-#undef RTE_PCI_DEV_ID_DECL_FM10KVF
Signature · 1 line
1.9.1
#10 lore raw

PATCH 5/11 virtio: move pci device ids to driver

In reply to David Marchand

Reused defines from virtio_pci.h.

---
 drivers/net/virtio/virtio_ethdev.c              |  5 +----
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 17 -----------------
 2 files changed, 1 insertion(+), 21 deletions(-)
drivers/net/virtio/virtio_ethdev.c +1 -4
index d928339..e9af0d7 100644
@@ -106,10 +106,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[] = {
-
-#define RTE_PCI_DEV_ID_DECL_VIRTIO(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
-
+{ RTE_PCI_DEVICE(VIRTIO_PCI_VENDORID, VIRTIO_PCI_DEVICEID_MIN) },
 { .vendor_id = 0, /* sentinel */ },
 };
 
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -17
index a19fdfa..448b5e1 100644
@@ -68,7 +68,6 @@
  * driver which is a para virtualization driver running in guest virtual machine.
  * The inclusion of these in an array built using this file depends on the
  * definition of
- * RTE_PCI_DEV_ID_DECL_VIRTIO
  * at the time when this file is included.
  *
  * In order to populate an array, the user of this file must define this macro:
@@ -89,10 +88,6 @@
  * Note that this file can be included multiple times within the same file.
  */
 
-#ifndef RTE_PCI_DEV_ID_DECL_VIRTIO
-#define RTE_PCI_DEV_ID_DECL_VIRTIO(vend, dev)
-#endif
-
 #ifndef RTE_PCI_DEV_ID_DECL_VMXNET3
 #define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev)
 #endif
@@ -109,11 +104,6 @@
 #define RTE_PCI_DEV_ID_DECL_BNX2XVF(vend, dev)
 #endif
 
-#ifndef PCI_VENDOR_ID_QUMRANET
-/** Vendor ID used by virtio devices */
-#define PCI_VENDOR_ID_QUMRANET 0x1AF4
-#endif
-
 #ifndef PCI_VENDOR_ID_VMWARE
 /** Vendor ID used by VMware devices */
 #define PCI_VENDOR_ID_VMWARE 0x15AD
@@ -129,12 +119,6 @@
 #define PCI_VENDOR_ID_BROADCOM 0x14E4
 #endif
 
-/****************** Virtio devices from virtio.h ******************/
-
-#define QUMRANET_DEV_ID_VIRTIO                  0x1000
-
-RTE_PCI_DEV_ID_DECL_VIRTIO(PCI_VENDOR_ID_QUMRANET, QUMRANET_DEV_ID_VIRTIO)
-
 /****************** VMware VMXNET3 devices ******************/
 
 #define VMWARE_DEV_ID_VMXNET3                   0x07B0
@@ -199,5 +183,4 @@ RTE_PCI_DEV_ID_DECL_BNX2X(PCI_VENDOR_ID_BROADCOM, BNX2X_DEV_ID_57840_MF)
  */
 #undef RTE_PCI_DEV_ID_DECL_BNX2X
 #undef RTE_PCI_DEV_ID_DECL_BNX2XVF
-#undef RTE_PCI_DEV_ID_DECL_VIRTIO
 #undef RTE_PCI_DEV_ID_DECL_VMXNET3
Signature · 1 line
1.9.1
#11 lore raw

PATCH 6/11 vmxnet3: move pci device ids to driver

In reply to David Marchand

Moved vmware device ids macro since the driver had no such information.

---
 drivers/net/vmxnet3/vmxnet3_ethdev.c            |  7 +++----
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 16 ----------------
 2 files changed, 3 insertions(+), 20 deletions(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +3 -4
index c363bf6..b9de8eb 100644
@@ -98,11 +98,10 @@ static void vmxnet3_process_events(struct vmxnet3_hw *);
 /*
  * The set of PCI devices this driver supports
  */
+#define PCI_VENDOR_ID_VMWARE 0x15AD
+#define VMWARE_DEV_ID_VMXNET3 0x07B0
 static const struct rte_pci_id pci_id_vmxnet3_map[] = {
-
-#define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
-
+{ RTE_PCI_DEVICE(PCI_VENDOR_ID_VMWARE, VMWARE_DEV_ID_VMXNET3) },
 { .vendor_id = 0, /* sentinel */ },
 };
 
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -16
index 448b5e1..0ecff3c 100644
@@ -88,10 +88,6 @@
  * Note that this file can be included multiple times within the same file.
  */
 
-#ifndef RTE_PCI_DEV_ID_DECL_VMXNET3
-#define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev)
-#endif
-
 #ifndef RTE_PCI_DEV_ID_DECL_ENIC
 #define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev)
 #endif
@@ -104,11 +100,6 @@
 #define RTE_PCI_DEV_ID_DECL_BNX2XVF(vend, dev)
 #endif
 
-#ifndef PCI_VENDOR_ID_VMWARE
-/** Vendor ID used by VMware devices */
-#define PCI_VENDOR_ID_VMWARE 0x15AD
-#endif
-
 #ifndef PCI_VENDOR_ID_CISCO
 /** Vendor ID used by Cisco VIC devices */
 #define PCI_VENDOR_ID_CISCO 0x1137
@@ -119,12 +110,6 @@
 #define PCI_VENDOR_ID_BROADCOM 0x14E4
 #endif
 
-/****************** VMware VMXNET3 devices ******************/
-
-#define VMWARE_DEV_ID_VMXNET3                   0x07B0
-
-RTE_PCI_DEV_ID_DECL_VMXNET3(PCI_VENDOR_ID_VMWARE, VMWARE_DEV_ID_VMXNET3)
-
 /****************** Cisco VIC devices ******************/
 
 #define PCI_DEVICE_ID_CISCO_VIC_ENET         0x0043  /* ethernet vnic */
@@ -183,4 +168,3 @@ RTE_PCI_DEV_ID_DECL_BNX2X(PCI_VENDOR_ID_BROADCOM, BNX2X_DEV_ID_57840_MF)
  */
 #undef RTE_PCI_DEV_ID_DECL_BNX2X
 #undef RTE_PCI_DEV_ID_DECL_BNX2XVF
-#undef RTE_PCI_DEV_ID_DECL_VMXNET3
Signature · 1 line
1.9.1
#12 lore raw

PATCH 7/11 enic: move pci device ids to driver

In reply to David Marchand

Moved cisco vendor id since the driver had no such information.

---
 drivers/net/enic/enic_ethdev.c                  | 12 ++++--------
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 17 -----------------
 2 files changed, 4 insertions(+), 25 deletions(-)
drivers/net/enic/enic_ethdev.c +4 -8
index 2a88043..e3bd8ec 100644
@@ -57,15 +57,11 @@
 /*
  * The set of PCI devices this driver supports
  */
+#define PCI_VENDOR_ID_CISCO 0x1137
 static const struct rte_pci_id pci_id_enic_map[] = {
-#define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#ifndef PCI_VENDOR_ID_CISCO
-#define PCI_VENDOR_ID_CISCO	0x1137
-#endif
-#include "rte_pci_dev_ids.h"
-RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET)
-RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET_VF)
-{.vendor_id = 0, /* Sentinal */},
+{ 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 */},
 };
 
 static int
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -17
index 0ecff3c..1c22c04 100644
@@ -88,10 +88,6 @@
  * Note that this file can be included multiple times within the same file.
  */
 
-#ifndef RTE_PCI_DEV_ID_DECL_ENIC
-#define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev)
-#endif
-
 #ifndef RTE_PCI_DEV_ID_DECL_BNX2X
 #define RTE_PCI_DEV_ID_DECL_BNX2X(vend, dev)
 #endif
@@ -100,24 +96,11 @@
 #define RTE_PCI_DEV_ID_DECL_BNX2XVF(vend, dev)
 #endif
 
-#ifndef PCI_VENDOR_ID_CISCO
-/** Vendor ID used by Cisco VIC devices */
-#define PCI_VENDOR_ID_CISCO 0x1137
-#endif
-
 #ifndef PCI_VENDOR_ID_BROADCOM
 /** Vendor ID used by Broadcom devices */
 #define PCI_VENDOR_ID_BROADCOM 0x14E4
 #endif
 
-/****************** Cisco VIC devices ******************/
-
-#define PCI_DEVICE_ID_CISCO_VIC_ENET         0x0043  /* ethernet vnic */
-#define PCI_DEVICE_ID_CISCO_VIC_ENET_VF      0x0071  /* enet SRIOV VF */
-
-RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET)
-RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET_VF)
-
 /****************** QLogic devices ******************/
 
 /* Broadcom/QLogic BNX2X */
Signature · 1 line
1.9.1
#13 lore raw

PATCH 8/11 bnx2x: move pci device ids to driver

In reply to David Marchand

Reused defines from the driver and moved broadcom vendor id macro.

---
 drivers/net/bnx2x/bnx2x.c                       |  3 +-
 drivers/net/bnx2x/bnx2x_ethdev.c                | 25 ++++++++---
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 60 -------------------------
 3 files changed, 20 insertions(+), 68 deletions(-)
drivers/net/bnx2x/bnx2x.c +1 -2
index 67af5da..bf6dd71 100644
@@ -22,7 +22,6 @@
 #include "ecore_init_ops.h"
 
 #include "rte_version.h"
-#include "rte_pci_dev_ids.h"
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -9592,7 +9591,7 @@ void bnx2x_load_firmware(struct bnx2x_softc *sc)
 	int f;
 	struct stat st;
 
-	fwname = sc->devinfo.device_id == BNX2X_DEV_ID_57711
+	fwname = sc->devinfo.device_id == CHIP_NUM_57711
 		? FW_NAME_57711 : FW_NAME_57810;
 	f = open(fwname, O_RDONLY);
 	if (f < 0) {
drivers/net/bnx2x/bnx2x_ethdev.c +19 -6
index 69df02e..f822cfd 100644
@@ -16,16 +16,29 @@
 /*
  * The set of PCI devices this driver supports
  */
+#define PCI_VENDOR_ID_BROADCOM 0x14E4
 static struct rte_pci_id pci_id_bnx2x_map[] = {
-#define RTE_PCI_DEV_ID_DECL_BNX2X(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
-	{ .vendor_id = 0, }
+{ 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) },
+{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57811) },
+{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57840_OBS) },
+{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57840_4_10) },
+{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57840_2_20) },
+#ifdef RTE_LIBRTE_BNX2X_MF_SUPPORT
+{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57810_MF) },
+{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57811_MF) },
+{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57840_MF) },
+#endif
+{ .vendor_id = 0, }
 };
 
 static struct rte_pci_id pci_id_bnx2xvf_map[] = {
-#define RTE_PCI_DEV_ID_DECL_BNX2XVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
-	{ .vendor_id = 0, }
+{ 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) },
+{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57840_VF) },
+{ .vendor_id = 0, }
 };
 
 static void
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -60

66 lines not on this page · raw message

Signature · 1 line
1.9.1
#14 lore raw

PATCH 9/11 doc: refresh headers list

In reply to David Marchand

Since we are going to remove a header in next commit, let's first refresh documentation.

---
 doc/guides/prog_guide/dev_kit_build_system.rst | 57 +++++++++++++++++---------
 1 file changed, 38 insertions(+), 19 deletions(-)
doc/guides/prog_guide/dev_kit_build_system.rst +38 -19
index dd3e3d0..bbb9ea0 100644
@@ -89,25 +89,44 @@ Each build directory contains include files, libraries, and applications:
 
 
     ~/DEV/DPDK$ ls i686-native-linuxapp-gcc/include/
-    arch                       rte_cpuflags.h       rte_memcpy.h
-    cmdline_cirbuf.h           rte_cycles.h         rte_memory.h
-    cmdline.h                  rte_debug.h          rte_mempool.h
-    cmdline_parse_etheraddr.h  rte_eal.h            rte_memzone.h
-    cmdline_parse.h            rte_errno.h          rte_pci_dev_ids.h
-    cmdline_parse_ipaddr.h     rte_ethdev.h         rte_pci.h
-    cmdline_parse_num.h        rte_ether.h          rte_per_lcore.h
-    cmdline_parse_portlist.h   rte_fbk_hash.h       rte_prefetch.h
-    cmdline_parse_string.h     rte_hash_crc.h       rte_random.h
-    cmdline_rdline.h           rte_hash.h           rte_ring.h
-    cmdline_socket.h           rte_interrupts.h     rte_rwlock.h
-    cmdline_vt100.h            rte_ip.h             rte_sctp.h
-    exec-env                   rte_jhash.h          rte_spinlock.h
-    rte_alarm.h                rte_launch.h         rte_string_fns.h
-    rte_atomic.h               rte_lcore.h          rte_tailq.h
-    rte_branch_prediction.h    rte_log.h            rte_tcp.h
-    rte_byteorder.h            rte_lpm.h            rte_timer.h
-    rte_common.h               rte_malloc.h         rte_udp.h
-    rte_config.h               rte_mbuf.h
+    cmdline_cirbuf.h           rte_eal_memconfig.h         rte_per_lcore.h
+    cmdline.h                  rte_errno.h                 rte_pipeline.h
+    cmdline_parse_etheraddr.h  rte_eth_af_packet.h         rte_port_ethdev.h
+    cmdline_parse.h            rte_eth_bond_8023ad.h       rte_port_frag.h
+    cmdline_parse_ipaddr.h     rte_eth_bond.h              rte_port.h
+    cmdline_parse_num.h        rte_eth_ctrl.h              rte_port_ras.h
+    cmdline_parse_portlist.h   rte_ethdev.h                rte_port_ring.h
+    cmdline_parse_string.h     rte_ether.h                 rte_port_sched.h
+    cmdline_rdline.h           rte_eth_ring.h              rte_port_source_sink.h
+    cmdline_socket.h           rte_fbk_hash.h              rte_power.h
+    cmdline_vt100.h            rte_hash_crc.h              rte_prefetch.h
+    exec-env                   rte_hash.h                  rte_random.h
+    generic                    rte_hexdump.h               rte_red.h
+    rte_acl.h                  rte_icmp.h                  rte_reorder.h
+    rte_acl_osdep.h            rte_interrupts.h            rte_ring.h
+    rte_alarm.h                rte_ip_frag.h               rte_rtm.h
+    rte_approx.h               rte_ip.h                    rte_rwlock.h
+    rte_arp.h                  rte_jhash.h                 rte_sched_common.h
+    rte_atomic_32.h            rte_jobstats.h              rte_sched.h
+    rte_atomic_64.h            rte_kvargs.h                rte_sctp.h
+    rte_atomic.h               rte_launch.h                rte_spinlock.h
+    rte_bitmap.h               rte_lcore.h                 rte_string_fns.h
+    rte_branch_prediction.h    rte_log.h                   rte_table_acl.h
+    rte_byteorder_32.h         rte_lpm6.h                  rte_table_array.h
+    rte_byteorder_64.h         rte_lpm.h                   rte_table.h
+    rte_byteorder.h            rte_lru.h                   rte_table_hash.h
+    rte_cfgfile.h              rte_malloc.h                rte_table_lpm.h
+    rte_common.h               rte_malloc_heap.h           rte_table_lpm_ipv6.h
+    rte_compat.h               rte_mbuf.h                  rte_table_stub.h
+    rte_config.h               rte_memcpy.h                rte_tailq.h
+    rte_cpuflags.h             rte_memory.h                rte_tcp.h
+    rte_cycles.h               rte_mempool.h               rte_thash.h
+    rte_debug.h                rte_memzone.h               rte_timer.h
+    rte_devargs.h              rte_meter.h                 rte_udp.h
+    rte_dev.h                  rte_pci_dev_feature_defs.h  rte_vect.h
+    rte_dev_info.h             rte_pci_dev_features.h      rte_version.h
+    rte_distributor.h          rte_pci_dev_ids.h           rte_virtio_net.h
+    rte_eal.h                  rte_pci.h
 
 
 A build directory is specific to a configuration that includes architecture + execution environment + toolchain.
Signature · 1 line
1.9.1
#19 lore raw

PATCH 10/11 pci: no need for global device ids list

In reply to David Marchand

Now that all pci device ids are in their respective drivers, we can remove this header.

---
 doc/api/doxy-api-index.md                       |  1 -
 doc/guides/prog_guide/dev_kit_build_system.rst  | 75 ++++++++++----------
 lib/librte_eal/common/Makefile                  |  2 +-
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 93 -------------------------
 4 files changed, 38 insertions(+), 133 deletions(-)
 delete mode 100644 lib/librte_eal/common/include/rte_pci_dev_ids.h
doc/api/doxy-api-index.md +0 -1
index 7a91001..0540aba 100644
@@ -45,7 +45,6 @@ There are many libraries, so their headers may be grouped by topics:
   [vhost]              (@ref rte_virtio_net.h),
   [KNI]                (@ref rte_kni.h),
   [PCI]                (@ref rte_pci.h),
-  [PCI IDs]            (@ref rte_pci_dev_ids.h)
 
 - **memory**:
   [memseg]             (@ref rte_memory.h),
doc/guides/prog_guide/dev_kit_build_system.rst +37 -38

81 lines not on this page · raw message

lib/librte_eal/common/Makefile +1 -1
index f5ea0ee..bb9810d 100644
@@ -34,7 +34,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 INC := rte_branch_prediction.h rte_common.h
 INC += rte_debug.h rte_eal.h rte_errno.h rte_launch.h rte_lcore.h
 INC += rte_log.h rte_memory.h rte_memzone.h rte_pci.h
-INC += rte_pci_dev_ids.h rte_per_lcore.h rte_random.h
+INC += rte_per_lcore.h rte_random.h
 INC += rte_tailq.h rte_interrupts.h rte_alarm.h
 INC += rte_string_fns.h rte_version.h
 INC += rte_eal_memconfig.h rte_malloc_heap.h
lib/librte_eal/common/include/rte_pci_dev_ids.h deleted +0 -93

93 lines not on this page · raw message

Signature · 1 line
1.9.1
#20 lore raw

PATCH 11/11 pci: place all uio pci device ids in a dedicated section

In reply to David Marchand

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 ................

---
 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(-)
drivers/crypto/qat/rte_qat_cryptodev.c +1 -1
index e500c1e..c9f5790 100644
@@ -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,
drivers/net/bnx2x/bnx2x_ethdev.c +2 -2
index f822cfd..7599ec6 100644
@@ -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) },
drivers/net/cxgbe/cxgbe_ethdev.c +1 -1
index 97ef152..2620130 100644
@@ -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
drivers/net/e1000/em_ethdev.c +1 -1
index 4cf9217..fb71686 100644
@@ -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"
drivers/net/e1000/igb_ethdev.c +2 -2
index 3f85a2c..f71bcd1 100644
@@ -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"
drivers/net/enic/enic_ethdev.c +1 -1
index e3bd8ec..d67f643 100644
@@ -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 */},
drivers/net/fm10k/fm10k_ethdev.c +1 -1
index 3ab744a..6b50abf 100644
@@ -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) },
drivers/net/i40e/i40e_ethdev.c +1 -1
index 3213264..80dfd98 100644
@@ -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) },
drivers/net/i40e/i40e_ethdev_vf.c +1 -1
index fd963fd..47f5fab 100644
@@ -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) },
drivers/net/ixgbe/ixgbe_ethdev.c +2 -2
index b31f52e..f970ca9 100644
@@ -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"
drivers/net/nfp/nfp_net.c +1 -1
index bc2089f..32bcec1 100644
@@ -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,
drivers/net/virtio/virtio_ethdev.c +1 -1
index e9af0d7..c1d9d11 100644
@@ -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 */ },
 };
drivers/net/vmxnet3/vmxnet3_ethdev.c +1 -1
index b9de8eb..724ab4b 100644
@@ -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 */ },
 };
lib/librte_eal/common/include/rte_pci.h +2 -0
index 334c12e..094b1c0 100644
@@ -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.
  */
Signature · 1 line
1.9.1
#21 lore raw

Re: [PATCH 00/11] kill global pci device id list

In reply to David Marchand

Hello Thomas,

Sorry, don't know how I ended up with this, I wrote an incorrect mail address for you (I should not send patches after sunday meal ;-)).

Signature · 1 line
David Marchand
#22 lore raw

Re: [PATCH 00/11] kill global pci device id list

2016-01-10 13:58, David Marchand:

Quoted 4 lines

Hello Thomas,

Sorry, don't know how I ended up with this, I wrote an incorrect mail address for you (I should not send patches after sunday meal ;-)).

No worries :)
I was not expecting a patch so quickly after introducing you in this thread. Glad to see that you take time for - at least - your sunday meal :)

#23 lore raw

Re: [PATCH 00/11] kill global pci device id list

Quoted 11 lines · Thomas Monjalon

2016-01-10 13:58, David Marchand:

Quoted 4 lines

Hello Thomas,

Sorry, don't know how I ended up with this, I wrote an incorrect mail address for you (I should not send patches after sunday meal ;-)).

No worries :)
I was not expecting a patch so quickly after introducing you in this thread.
Glad to see that you take time for - at least - your sunday meal :)

#24 lore raw

Re: [PATCH 00/11] kill global pci device id list

Really ...
Last mail for today ...

Quoted 8 lines · David Marchand
Quoted 3 lines · Thomas Monjalon

2016-01-10 13:58, David Marchand:

Quoted 2 lines

Hello Thomas,

Quoted 10 lines
Quoted 8 lines
Quoted 2 lines

Sorry, don't know how I ended up with this, I wrote an incorrect mail address for you (I should not send patches after sunday meal ;-)).

No worries :)
I was not expecting a patch so quickly after introducing you in this thread.
Glad to see that you take time for - at least - your sunday meal :)

The patches were ready for a long time, just sent them today as it is rainy outside.

Signature · 1 line
David Marchand
#25 lore raw

Re: [PATCH 00/11] kill global pci device id list

In reply to David Marchand

Hello David

Thanks for your huge contribution!
May you help to describe more details of why you made these huge changes?
What benefit we can have with your changes. I guess there must have, while you did not tell that here.

Regards,
Helin

Quoted 66 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of David Marchand
Sent: Sunday, January 10, 2016 8:51 PM
To: [email protected]
Cc: [email protected]
Subject: [dpdk-dev] [PATCH 00/11] kill global pci device id list

This patchset moves all pci device ids from eal to the pmds that need them (patches 1 to 8).
Global pci device id list is then removed (patches 9, 10).

In last patch, all those device ids are put in a dedicated section for retrieval by external tools.

--
David Marchand

David Marchand (11):
e1000: move pci device ids to driver
ixgbe: move pci device ids to driver
i40e: move pci device ids to driver
fm10k: move pci device ids to driver
virtio: move pci device ids to driver
vmxnet3: move pci device ids to driver
enic: move pci device ids to driver
bnx2x: move pci device ids to driver
doc: refresh headers list
pci: no need for global device ids list
pci: place all uio pci device ids in a dedicated section

 app/test-pmd/Makefile                           |   2 +
 app/test-pmd/cmdline.c                          |   2 +-
 app/test/Makefile                               |   4 +
 app/test/test_pci.c                             |   5 +-
 doc/api/doxy-api-index.md                       |   1 -
 doc/guides/prog_guide/dev_kit_build_system.rst  |  56 +-
 drivers/crypto/qat/rte_qat_cryptodev.c          |   2 +-
 drivers/net/bnx2x/bnx2x.c                       |   3 +-
 drivers/net/bnx2x/bnx2x_ethdev.c                |  29 +-
 drivers/net/cxgbe/cxgbe_ethdev.c                |   2 +-
 drivers/net/e1000/em_ethdev.c                   |   4 +-
 drivers/net/e1000/em_pci_dev_ids.h              | 200 +++++++
 drivers/net/e1000/igb_ethdev.c                  |   8 +-
 drivers/net/e1000/igb_pci_dev_ids.h             | 164 ++++++
 drivers/net/enic/enic_ethdev.c                  |  14 +-
 drivers/net/fm10k/fm10k_ethdev.c                |  10 +-
 drivers/net/i40e/i40e_ethdev.c                  |  20 +-
 drivers/net/i40e/i40e_ethdev_vf.c               |   8 +-
 drivers/net/ixgbe/ixgbe_ethdev.c                |   8 +-
 drivers/net/ixgbe/ixgbe_pci_dev_ids.h           | 185 +++++++
 drivers/net/nfp/nfp_net.c                       |   2 +-
 drivers/net/virtio/virtio_ethdev.c              |   7 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c            |   9 +-
 lib/librte_eal/common/Makefile                  |   2 +-
 lib/librte_eal/common/include/rte_pci.h         |   2 +
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 667 ------------------------
 lib/librte_eal/linuxapp/kni/Makefile            |   2 +
 lib/librte_eal/linuxapp/kni/kni_misc.c          |   8 +-
 28 files changed, 678 insertions(+), 748 deletions(-)  create mode 100644
drivers/net/e1000/em_pci_dev_ids.h
 create mode 100644 drivers/net/e1000/igb_pci_dev_ids.h
 create mode 100644 drivers/net/ixgbe/ixgbe_pci_dev_ids.h
 delete mode 100644 lib/librte_eal/common/include/rte_pci_dev_ids.h

--
1.9.1

#7 lore raw

Re: [PATCH 03/11] i40e: move pci device ids to driver

In reply to David Marchand

drivers/net/i40e/i40e_ethdev.c static int i40e_dev_rx_queue_intr_disable(struct rte_eth_dev *dev,

Quoted 4 lines · On Sun, 10 Jan 2016 13:50:46 +0100 David Marchand <[email protected]>…
drivers/net/i40e/i40e_ethdev.c +4 -0
+{ 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) },
+{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_B) }

You should indent the initializers.

#8 lore raw

Re: [PATCH 03/11] i40e: move pci device ids to driver

Quoted 10 lines · Stephen Hemminger

drivers/net/i40e/i40e_ethdev.c static int i40e_dev_rx_queue_intr_disable(struct rte_eth_dev *dev,

Quoted 4 lines · On Sun, 10 Jan 2016 13:50:46 +0100 David Marchand <[email protected]>…
drivers/net/i40e/i40e_ethdev.c +4 -0
+{ 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) },
+{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_B) }

You should indent the initializers.

Ok will do, but I don't like having to break lines because of the 80-columns limit (which happens in some drivers).

Signature · 1 line
David Marchand
#15 lore raw

Re: [PATCH 09/11] doc: refresh headers list

In reply to David Marchand
Quoted 9 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of David Marchand
Sent: Sunday, January 10, 2016 12:51 PM
To: [email protected]
Cc: [email protected]
Subject: [dpdk-dev] [PATCH 09/11] doc: refresh headers list

Since we are going to remove a header in next commit, let's first refresh documentation.

Hi,

I don't like these parts of the docs that list files since they go out of date quite easily and, in general, the same information can be conveyed by just listing the directories. (That isn't future-proof either but it should be less subject to change.)

In this case you could just remove everything in the console section after the output from "ls x86_64-native-linuxapp-gcc" like this:

Each build directory contains include files, libraries, and applications like the following::

    $ ls
    app                       tools
    config                    MAINTAINERS
    Makefile                  GNUmakefile
    drivers                   mk
    examples                  pkg
    doc                       README
    lib                       scripts
    LICENSE.GPL               LICENSE.LGPL
    i686-native-linuxapp-gcc  x86_64-native-linuxapp-gcc
    i686-native-linuxapp-icc  x86_64-native-linuxapp-icc
    $ ls x86_64-native-linuxapp-gcc
    app  build  include  kmod  lib  Makefile

John.

#26 lore raw

Re: [PATCH 00/11] kill global pci device id list

In reply to Zhang, Helin

Hello Helin,

Quoted 2 lines · Helin

Thanks for your huge contribution!
May you help to describe more details of why you made these huge changes?

As far as I can see, the only reason why we have a centralised header maintained in eal with all pci device ids is the need to identify pci devices that require a special treatment before starting a dpdk application (here, bind those pci devices to igb_uio / vfio).

This patchset splits this header into small pieces maintained by the drivers themselves, then tries to come up with a way to retrieve those pci device ids from the final dpdk application and from the drivers compiled as shared libraries.

With this, supported pci device ids are maintained by the drivers themselves rather than eal, pci devices ids requiring uio/vfio binding are still available.

Regards,

Signature · 1 line
David Marchand
#16 lore raw

Re: [PATCH 09/11] doc: refresh headers list

In reply to Mcnamara, John

Hello John,

Quoted 7 lines · John
Quoted 7 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of David Marchand
Sent: Sunday, January 10, 2016 12:51 PM
To: [email protected]
Cc: [email protected]
Subject: [dpdk-dev] [PATCH 09/11] doc: refresh headers list

Quoted 7 lines
Quoted 2 lines

Since we are going to remove a header in next commit, let's first refresh documentation.

I don't like these parts of the docs that list files since they go out of date quite easily and, in general, the same information can be conveyed by just listing the directories. (That isn't future-proof either but it should be less subject to change.)

Well, we could imagine something automatic (in the build process), but I agree that the quickest solution is to get rid of it.

Quoted 19 lines

In this case you could just remove everything in the console section after the output from "ls x86_64-native-linuxapp-gcc" like this:

Each build directory contains include files, libraries, and applications like the following::

    $ ls
    app                       tools
    config                    MAINTAINERS
    Makefile                  GNUmakefile
    drivers                   mk
    examples                  pkg
    doc                       README
    lib                       scripts
    LICENSE.GPL               LICENSE.LGPL
    i686-native-linuxapp-gcc  x86_64-native-linuxapp-gcc
    i686-native-linuxapp-icc  x86_64-native-linuxapp-icc
Quoted 3 lines
    $ ls x86_64-native-linuxapp-gcc
    app  build  include  kmod  lib  Makefile

Well, from my pov, it is the same issue here. How about just removing all those files listings ? I am not sure they really help.

If we go with this, I will send this patch out of the series since it would not really belong to it.

Regards,

Signature · 1 line
David Marchand
#17 lore raw

Re: [PATCH 09/11] doc: refresh headers list

2016-01-16 16:10, David Marchand:

Quoted 9 lines · John
Quoted 8 lines

From: dev [mailto:[email protected]] On Behalf Of David Marchand

Quoted 2 lines

Since we are going to remove a header in next commit, let's first refresh documentation.

I don't like these parts of the docs that list files since they go out of date quite easily and, in general, the same information can be conveyed by just listing the directories. (That isn't future-proof either but it should be less subject to change.)

+1

Quoted 12 lines
Quoted 12 lines
    $ ls
    app                       tools
    config                    MAINTAINERS
    Makefile                  GNUmakefile
    drivers                   mk
    examples                  pkg
    doc                       README
    lib                       scripts
    LICENSE.GPL               LICENSE.LGPL
    i686-native-linuxapp-gcc  x86_64-native-linuxapp-gcc
    i686-native-linuxapp-icc  x86_64-native-linuxapp-icc
Quoted 7 lines
Quoted 3 lines
    $ ls x86_64-native-linuxapp-gcc
    app  build  include  kmod  lib  Makefile

Well, from my pov, it is the same issue here. How about just removing all those files listings ? I am not sure they really help.

+1

#28 lore raw

v2 cover kill global pci device id list

In reply to David Marchand

This patchset moves all pci device ids from eal to the pmds that need them (patches 1 to 8).
Global pci device id list is then removed (patch 9).
In last patch, all those device ids are put in a dedicated section for retrieval by external tools.

Changes since v1:
- indent fixes in i40e, fm10k, virtio, vmxnet3, enic, bnx2c.
- rebased on head (ixgbe update)
- removed doc update (will be sent separately)

Signature · 49 lines
David Marchand

David Marchand (10):
  e1000: move pci device ids to driver
  ixgbe: move pci device ids to driver
  i40e: move pci device ids to driver
  fm10k: move pci device ids to driver
  virtio: move pci device ids to driver
  vmxnet3: move pci device ids to driver
  enic: move pci device ids to driver
  bnx2x: move pci device ids to driver
  pci: no need for global device ids list
  pci: place all uio pci device ids in a dedicated section

 app/test-pmd/Makefile                           |   2 +
 app/test-pmd/cmdline.c                          |   2 +-
 app/test/Makefile                               |   4 +
 app/test/test_pci.c                             |   5 +-
 doc/api/doxy-api-index.md                       |   1 -
 drivers/crypto/qat/rte_qat_cryptodev.c          |   2 +-
 drivers/net/bnx2x/bnx2x.c                       |   3 +-
 drivers/net/bnx2x/bnx2x_ethdev.c                |  25 +-
 drivers/net/cxgbe/cxgbe_ethdev.c                |   2 +-
 drivers/net/e1000/em_ethdev.c                   |   4 +-
 drivers/net/e1000/em_pci_dev_ids.h              | 200 +++++++
 drivers/net/e1000/igb_ethdev.c                  |   8 +-
 drivers/net/e1000/igb_pci_dev_ids.h             | 164 ++++++
 drivers/net/enic/enic_ethdev.c                  |  14 +-
 drivers/net/fm10k/fm10k_ethdev.c                |   8 +-
 drivers/net/i40e/i40e_ethdev.c                  |  22 +-
 drivers/net/i40e/i40e_ethdev_vf.c               |  10 +-
 drivers/net/ixgbe/ixgbe_ethdev.c                |   8 +-
 drivers/net/ixgbe/ixgbe_pci_dev_ids.h           | 191 +++++++
 drivers/net/nfp/nfp_net.c                       |   2 +-
 drivers/net/virtio/virtio_ethdev.c              |   9 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c            |  11 +-
 lib/librte_eal/common/Makefile                  |   2 +-
 lib/librte_eal/common/include/rte_pci.h         |   2 +
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 669 ------------------------
 lib/librte_eal/linuxapp/kni/Makefile            |   2 +
 lib/librte_eal/linuxapp/kni/kni_misc.c          |   8 +-
 27 files changed, 648 insertions(+), 732 deletions(-)
 create mode 100644 drivers/net/e1000/em_pci_dev_ids.h
 create mode 100644 drivers/net/e1000/igb_pci_dev_ids.h
 create mode 100644 drivers/net/ixgbe/ixgbe_pci_dev_ids.h
 delete mode 100644 lib/librte_eal/common/include/rte_pci_dev_ids.h

-- 
1.9.1
#29 lore raw

PATCH v2 1/10 e1000: move pci device ids to driver

test application and kni still want to know e1000 pci devices. So let's create headers in the driver that will be used by them.

---
 app/test/Makefile                               |   3 +
 app/test/test_pci.c                             |   3 +-
 drivers/net/e1000/em_ethdev.c                   |   2 +-
 drivers/net/e1000/em_pci_dev_ids.h              | 200 +++++++++++++++++++
 drivers/net/e1000/igb_ethdev.c                  |   4 +-
 drivers/net/e1000/igb_pci_dev_ids.h             | 164 ++++++++++++++++
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 245 ------------------------
 lib/librte_eal/linuxapp/kni/Makefile            |   1 +
 lib/librte_eal/linuxapp/kni/kni_misc.c          |   4 +-
 9 files changed, 375 insertions(+), 251 deletions(-)
 create mode 100644 drivers/net/e1000/em_pci_dev_ids.h
 create mode 100644 drivers/net/e1000/igb_pci_dev_ids.h
app/test/Makefile +3 -0
index ec33e1a..687ae59 100644
@@ -168,6 +168,9 @@ CFLAGS_test_memcpy_perf.o += -fno-var-tracking-assignments
 endif
 endif
 
+# pci tests want to know some pci devices ids
+CFLAGS_test_pci.o += -I$(RTE_SDK)/drivers/net/e1000
+
 # this application needs libraries first
 DEPDIRS-y += lib drivers
 
app/test/test_pci.c +2 -1
index 5530d99..b289138 100644
@@ -77,8 +77,9 @@ struct rte_pci_id my_driver_id2[] = {
 
 /* IGB & EM NICS */
 #define RTE_PCI_DEV_ID_DECL_EM(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
+#include <em_pci_dev_ids.h>
 #define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include <rte_pci_dev_ids.h>
+#include <igb_pci_dev_ids.h>
 
 { .vendor_id = 0, /* sentinel */ },
 };
drivers/net/e1000/em_ethdev.c +1 -1
index 66e8993..4cf9217 100644
@@ -139,7 +139,7 @@ static enum e1000_fc_mode em_fc_setting = e1000_fc_full;
 static const struct rte_pci_id pci_id_em_map[] = {
 
 #define RTE_PCI_DEV_ID_DECL_EM(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+#include "em_pci_dev_ids.h"
 
 {0},
 };
drivers/net/e1000/em_pci_dev_ids.h new file +200 -0

200 lines not on this page · raw message

drivers/net/e1000/igb_ethdev.c +2 -2
index d1bbcda..3f85a2c 100644
@@ -276,7 +276,7 @@ static enum e1000_fc_mode igb_fc_setting = e1000_fc_full;
 static const struct rte_pci_id pci_id_igb_map[] = {
 
 #define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+#include "igb_pci_dev_ids.h"
 
 {0},
 };
@@ -287,7 +287,7 @@ static const struct rte_pci_id pci_id_igb_map[] = {
 static const struct rte_pci_id pci_id_igbvf_map[] = {
 
 #define RTE_PCI_DEV_ID_DECL_IGBVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+#include "igb_pci_dev_ids.h"
 
 {0},
 };
drivers/net/e1000/igb_pci_dev_ids.h new file +164 -0

164 lines not on this page · raw message

lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -245

275 lines not on this page · raw message

lib/librte_eal/linuxapp/kni/Makefile +1 -0
index ac99d3f..6ac7637 100644
@@ -43,6 +43,7 @@ MODULE_CFLAGS += -I$(SRCDIR) --param max-inline-insns-single=50
 MODULE_CFLAGS += -I$(RTE_OUTPUT)/include -I$(SRCDIR)/ethtool/ixgbe -I$(SRCDIR)/ethtool/igb
 MODULE_CFLAGS += -include $(RTE_OUTPUT)/include/rte_config.h
 MODULE_CFLAGS += -Wall -Werror
+MODULE_CFLAGS += -I$(RTE_SDK)/drivers/net/e1000
 
 ifeq ($(shell lsb_release -si 2>/dev/null),Ubuntu)
 MODULE_CFLAGS += -DUBUNTU_RELEASE_CODE=$(shell lsb_release -sr | tr -d .)
lib/librte_eal/linuxapp/kni/kni_misc.c +2 -2
index f5f18f0..96b07c2 100644
@@ -353,7 +353,7 @@ kni_dev_remove(struct kni_dev *dev)
 
 	switch (dev->device_id) {
 	#define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) case (dev):
-	#include <rte_pci_dev_ids.h>
+	#include <igb_pci_dev_ids.h>
 		igb_kni_remove(dev->pci_dev);
 		break;
 	#define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) case (dev):
@@ -510,7 +510,7 @@ kni_ioctl_create(struct net *net,
 			found_pci = pci;
 			switch (dev_info.device_id) {
 			#define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) case (dev):
-			#include <rte_pci_dev_ids.h>
+			#include <igb_pci_dev_ids.h>
 				ret = igb_kni_probe(found_pci, &lad_dev);
 				break;
 			#define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) \
Signature · 1 line
1.9.1
#30 lore raw

PATCH v2 2/10 ixgbe: move pci device ids to driver

In reply to David Marchand

test application and kni still want to know ixgbe pci devices. So let's create a header in the driver that will be used by them.

---
 app/test-pmd/Makefile                           |   2 +
 app/test-pmd/cmdline.c                          |   2 +-
 app/test/Makefile                               |   1 +
 app/test/test_pci.c                             |   2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c                |   4 +-
 drivers/net/ixgbe/ixgbe_pci_dev_ids.h           | 191 ++++++++++++++++++++++++
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 132 ----------------
 lib/librte_eal/linuxapp/kni/Makefile            |   1 +
 lib/librte_eal/linuxapp/kni/kni_misc.c          |   4 +-
 9 files changed, 201 insertions(+), 138 deletions(-)
 create mode 100644 drivers/net/ixgbe/ixgbe_pci_dev_ids.h
app/test-pmd/Makefile +2 -0
index 72426f3..a8899b8 100644
@@ -64,6 +64,8 @@ ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y)
 CFLAGS_mempool_anon.o := -D_GNU_SOURCE
 endif
 CFLAGS_cmdline.o := -D_GNU_SOURCE
+# for bypass pci device ids
+CFLAGS_cmdline.o += -I$(RTE_SDK)/drivers/net/ixgbe
 
 # this application needs libraries first
 DEPDIRS-y += lib drivers
app/test-pmd/cmdline.c +1 -1
index 73298c9..fdb2e1b 100644
@@ -9816,7 +9816,7 @@ cmd_reconfig_device_queue(portid_t id, uint8_t dev, uint8_t queue)
 }
 
 #ifdef RTE_NIC_BYPASS
-#include <rte_pci_dev_ids.h>
+#include <ixgbe_pci_dev_ids.h>
 uint8_t
 bypass_is_supported(portid_t port_id)
 {
app/test/Makefile +1 -0
index 687ae59..13fed78 100644
@@ -170,6 +170,7 @@ endif
 
 # pci tests want to know some pci devices ids
 CFLAGS_test_pci.o += -I$(RTE_SDK)/drivers/net/e1000
+CFLAGS_test_pci.o += -I$(RTE_SDK)/drivers/net/ixgbe
 
 # this application needs libraries first
 DEPDIRS-y += lib drivers
app/test/test_pci.c +1 -1
index b289138..d6a23d6 100644
@@ -68,7 +68,7 @@ static int my_driver_init(struct rte_pci_driver *dr,
 struct rte_pci_id my_driver_id[] = {
 
 #define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include <rte_pci_dev_ids.h>
+#include <ixgbe_pci_dev_ids.h>
 
 { .vendor_id = 0, /* sentinel */ },
 };
drivers/net/ixgbe/ixgbe_ethdev.c +2 -2
index 4c4c6df..b31f52e 100644
@@ -381,7 +381,7 @@ static int ixgbe_timesync_write_time(struct rte_eth_dev *dev,
 static const struct rte_pci_id pci_id_ixgbe_map[] = {
 
 #define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+#include "ixgbe_pci_dev_ids.h"
 
 { .vendor_id = 0, /* sentinel */ },
 };
@@ -393,7 +393,7 @@ static const struct rte_pci_id pci_id_ixgbe_map[] = {
 static const struct rte_pci_id pci_id_ixgbevf_map[] = {
 
 #define RTE_PCI_DEV_ID_DECL_IXGBEVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+#include "ixgbe_pci_dev_ids.h"
 { .vendor_id = 0, /* sentinel */ },
 
 };
drivers/net/ixgbe/ixgbe_pci_dev_ids.h new file +191 -0

191 lines not on this page · raw message

lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -132

162 lines not on this page · raw message

lib/librte_eal/linuxapp/kni/Makefile +1 -0
index 6ac7637..3bdf352 100644
@@ -44,6 +44,7 @@ MODULE_CFLAGS += -I$(RTE_OUTPUT)/include -I$(SRCDIR)/ethtool/ixgbe -I$(SRCDIR)/e
 MODULE_CFLAGS += -include $(RTE_OUTPUT)/include/rte_config.h
 MODULE_CFLAGS += -Wall -Werror
 MODULE_CFLAGS += -I$(RTE_SDK)/drivers/net/e1000
+MODULE_CFLAGS += -I$(RTE_SDK)/drivers/net/ixgbe
 
 ifeq ($(shell lsb_release -si 2>/dev/null),Ubuntu)
 MODULE_CFLAGS += -DUBUNTU_RELEASE_CODE=$(shell lsb_release -sr | tr -d .)
lib/librte_eal/linuxapp/kni/kni_misc.c +2 -2
index 96b07c2..f731d7c 100644
@@ -357,7 +357,7 @@ kni_dev_remove(struct kni_dev *dev)
 		igb_kni_remove(dev->pci_dev);
 		break;
 	#define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) case (dev):
-	#include <rte_pci_dev_ids.h>
+	#include <ixgbe_pci_dev_ids.h>
 		ixgbe_kni_remove(dev->pci_dev);
 		break;
 	default:
@@ -515,7 +515,7 @@ kni_ioctl_create(struct net *net,
 				break;
 			#define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) \
 							case (dev):
-			#include <rte_pci_dev_ids.h>
+			#include <ixgbe_pci_dev_ids.h>
 				ret = ixgbe_kni_probe(found_pci, &lad_dev);
 				break;
 			default:
Signature · 1 line
1.9.1
#31 lore raw

PATCH v2 3/10 i40e: move pci device ids to driver

In reply to David Marchand

Since the base driver already defines all pci device ids, no need to redefine them, let's just drop the previous RTE_PCI_DEV_ID_DECL* stuff.

---

Changes since v1:
- indent fix

 drivers/net/i40e/i40e_ethdev.c                  | 20 +++++++--
 drivers/net/i40e/i40e_ethdev_vf.c               |  8 ++--
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 60 -------------------------
 3 files changed, 22 insertions(+), 66 deletions(-)
drivers/net/i40e/i40e_ethdev.c +17 -3
index bf6220d..e9f6587 100644
@@ -416,9 +416,23 @@ static int i40e_dev_rx_queue_intr_disable(struct rte_eth_dev *dev,
 
 
 static const struct rte_pci_id pci_id_i40e_map[] = {
-#define RTE_PCI_DEV_ID_DECL_I40E(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
-{ .vendor_id = 0, /* sentinel */ },
+	{ 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) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_B) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_C) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_A) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_B) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_C) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_20G_KR2) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_20G_KR2_A) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T4) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_X722_A0) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_X722) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_1G_BASE_T_X722) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T_X722) },
+	{ .vendor_id = 0, /* sentinel */ },
 };
 
 static const struct eth_dev_ops i40e_eth_dev_ops = {
drivers/net/i40e/i40e_ethdev_vf.c +5 -3
index 14d2a50..9302f27 100644
@@ -1117,9 +1117,11 @@ i40evf_get_link_status(struct rte_eth_dev *dev, struct rte_eth_link *link)
 }
 
 static const struct rte_pci_id pci_id_i40evf_map[] = {
-#define RTE_PCI_DEV_ID_DECL_I40EVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
-{ .vendor_id = 0, /* sentinel */ },
+	{ 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) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_X722_VF_HV) },
+	{ .vendor_id = 0, /* sentinel */ },
 };
 
 static inline int
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -60

90 lines not on this page · raw message

Signature · 1 line
1.9.1
#32 lore raw

PATCH v2 4/10 fm10k: move pci device ids to driver

In reply to David Marchand

Since the base driver already defines all pci device ids, no need to redefine them, let's just drop the previous RTE_PCI_DEV_ID_DECL* stuff.

---

Changes since v1:
- indent fix

 drivers/net/fm10k/fm10k_ethdev.c                |  6 ++---
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 29 -------------------------
 2 files changed, 3 insertions(+), 32 deletions(-)
drivers/net/fm10k/fm10k_ethdev.c +3 -3
index e4aed94..2c4905c 100644
@@ -2741,9 +2741,9 @@ eth_fm10k_dev_uninit(struct rte_eth_dev *dev)
  * and SRIOV-VF devices.
  */
 static const struct rte_pci_id pci_id_fm10k_map[] = {
-#define RTE_PCI_DEV_ID_DECL_FM10K(vend, dev) { RTE_PCI_DEVICE(vend, dev) },
-#define RTE_PCI_DEV_ID_DECL_FM10KVF(vend, dev) { RTE_PCI_DEVICE(vend, dev) },
-#include "rte_pci_dev_ids.h"
+	{ 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) },
 	{ .vendor_id = 0, /* sentinel */ },
 };
 
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -29
index f1f3e13..a19fdfa 100644
@@ -97,14 +97,6 @@
 #define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev)
 #endif
 
-#ifndef RTE_PCI_DEV_ID_DECL_FM10K
-#define RTE_PCI_DEV_ID_DECL_FM10K(vend, dev)
-#endif
-
-#ifndef RTE_PCI_DEV_ID_DECL_FM10KVF
-#define RTE_PCI_DEV_ID_DECL_FM10KVF(vend, dev)
-#endif
-
 #ifndef RTE_PCI_DEV_ID_DECL_ENIC
 #define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev)
 #endif
@@ -117,11 +109,6 @@
 #define RTE_PCI_DEV_ID_DECL_BNX2XVF(vend, dev)
 #endif
 
-#ifndef PCI_VENDOR_ID_INTEL
-/** Vendor ID used by Intel devices */
-#define PCI_VENDOR_ID_INTEL 0x8086
-#endif
-
 #ifndef PCI_VENDOR_ID_QUMRANET
 /** Vendor ID used by virtio devices */
 #define PCI_VENDOR_ID_QUMRANET 0x1AF4
@@ -142,14 +129,6 @@
 #define PCI_VENDOR_ID_BROADCOM 0x14E4
 #endif
 
-/*************** Physical FM10K devices from fm10k_type.h ***************/
-
-#define FM10K_DEV_ID_PF                   0x15A4
-#define FM10K_DEV_ID_SDI_FM10420_QDA2     0x15D0
-
-RTE_PCI_DEV_ID_DECL_FM10K(PCI_VENDOR_ID_INTEL, FM10K_DEV_ID_PF)
-RTE_PCI_DEV_ID_DECL_FM10K(PCI_VENDOR_ID_INTEL, FM10K_DEV_ID_SDI_FM10420_QDA2)
-
 /****************** Virtio devices from virtio.h ******************/
 
 #define QUMRANET_DEV_ID_VIRTIO                  0x1000
@@ -162,12 +141,6 @@ RTE_PCI_DEV_ID_DECL_VIRTIO(PCI_VENDOR_ID_QUMRANET, QUMRANET_DEV_ID_VIRTIO)
 
 RTE_PCI_DEV_ID_DECL_VMXNET3(PCI_VENDOR_ID_VMWARE, VMWARE_DEV_ID_VMXNET3)
 
-/*************** Virtual FM10K devices from fm10k_type.h ***************/
-
-#define FM10K_DEV_ID_VF                   0x15A5
-
-RTE_PCI_DEV_ID_DECL_FM10KVF(PCI_VENDOR_ID_INTEL, FM10K_DEV_ID_VF)
-
 /****************** Cisco VIC devices ******************/
 
 #define PCI_DEVICE_ID_CISCO_VIC_ENET         0x0043  /* ethernet vnic */
@@ -228,5 +201,3 @@ RTE_PCI_DEV_ID_DECL_BNX2X(PCI_VENDOR_ID_BROADCOM, BNX2X_DEV_ID_57840_MF)
 #undef RTE_PCI_DEV_ID_DECL_BNX2XVF
 #undef RTE_PCI_DEV_ID_DECL_VIRTIO
 #undef RTE_PCI_DEV_ID_DECL_VMXNET3
-#undef RTE_PCI_DEV_ID_DECL_FM10K
-#undef RTE_PCI_DEV_ID_DECL_FM10KVF
Signature · 1 line
1.9.1
#33 lore raw

PATCH v2 5/10 virtio: move pci device ids to driver

In reply to David Marchand

Reused defines from virtio_pci.h.

---

Changes since v1:
- indent fix

 drivers/net/virtio/virtio_ethdev.c              |  7 ++-----
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 17 -----------------
 2 files changed, 2 insertions(+), 22 deletions(-)
drivers/net/virtio/virtio_ethdev.c +2 -5
index d928339..94486e6 100644
@@ -106,11 +106,8 @@ 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[] = {
-
-#define RTE_PCI_DEV_ID_DECL_VIRTIO(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
-
-{ .vendor_id = 0, /* sentinel */ },
+	{ RTE_PCI_DEVICE(VIRTIO_PCI_VENDORID, VIRTIO_PCI_DEVICEID_MIN) },
+	{ .vendor_id = 0, /* sentinel */ },
 };
 
 struct rte_virtio_xstats_name_off {
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -17
index a19fdfa..448b5e1 100644
@@ -68,7 +68,6 @@
  * driver which is a para virtualization driver running in guest virtual machine.
  * The inclusion of these in an array built using this file depends on the
  * definition of
- * RTE_PCI_DEV_ID_DECL_VIRTIO
  * at the time when this file is included.
  *
  * In order to populate an array, the user of this file must define this macro:
@@ -89,10 +88,6 @@
  * Note that this file can be included multiple times within the same file.
  */
 
-#ifndef RTE_PCI_DEV_ID_DECL_VIRTIO
-#define RTE_PCI_DEV_ID_DECL_VIRTIO(vend, dev)
-#endif
-
 #ifndef RTE_PCI_DEV_ID_DECL_VMXNET3
 #define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev)
 #endif
@@ -109,11 +104,6 @@
 #define RTE_PCI_DEV_ID_DECL_BNX2XVF(vend, dev)
 #endif
 
-#ifndef PCI_VENDOR_ID_QUMRANET
-/** Vendor ID used by virtio devices */
-#define PCI_VENDOR_ID_QUMRANET 0x1AF4
-#endif
-
 #ifndef PCI_VENDOR_ID_VMWARE
 /** Vendor ID used by VMware devices */
 #define PCI_VENDOR_ID_VMWARE 0x15AD
@@ -129,12 +119,6 @@
 #define PCI_VENDOR_ID_BROADCOM 0x14E4
 #endif
 
-/****************** Virtio devices from virtio.h ******************/
-
-#define QUMRANET_DEV_ID_VIRTIO                  0x1000
-
-RTE_PCI_DEV_ID_DECL_VIRTIO(PCI_VENDOR_ID_QUMRANET, QUMRANET_DEV_ID_VIRTIO)
-
 /****************** VMware VMXNET3 devices ******************/
 
 #define VMWARE_DEV_ID_VMXNET3                   0x07B0
@@ -199,5 +183,4 @@ RTE_PCI_DEV_ID_DECL_BNX2X(PCI_VENDOR_ID_BROADCOM, BNX2X_DEV_ID_57840_MF)
  */
 #undef RTE_PCI_DEV_ID_DECL_BNX2X
 #undef RTE_PCI_DEV_ID_DECL_BNX2XVF
-#undef RTE_PCI_DEV_ID_DECL_VIRTIO
 #undef RTE_PCI_DEV_ID_DECL_VMXNET3
Signature · 1 line
1.9.1
#34 lore raw

PATCH v2 6/10 vmxnet3: move pci device ids to driver

In reply to David Marchand

Moved vmware device ids macro since the driver had no such information.

---

Changes since v1:
- indent fix

 drivers/net/vmxnet3/vmxnet3_ethdev.c            |  9 ++++-----
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 16 ----------------
 2 files changed, 4 insertions(+), 21 deletions(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +4 -5
index c363bf6..304f076 100644
@@ -98,12 +98,11 @@ static void vmxnet3_process_events(struct vmxnet3_hw *);
 /*
  * The set of PCI devices this driver supports
  */
+#define PCI_VENDOR_ID_VMWARE 0x15AD
+#define VMWARE_DEV_ID_VMXNET3 0x07B0
 static const struct rte_pci_id pci_id_vmxnet3_map[] = {
-
-#define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
-
-{ .vendor_id = 0, /* sentinel */ },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_VMWARE, VMWARE_DEV_ID_VMXNET3) },
+	{ .vendor_id = 0, /* sentinel */ },
 };
 
 static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -16
index 448b5e1..0ecff3c 100644
@@ -88,10 +88,6 @@
  * Note that this file can be included multiple times within the same file.
  */
 
-#ifndef RTE_PCI_DEV_ID_DECL_VMXNET3
-#define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev)
-#endif
-
 #ifndef RTE_PCI_DEV_ID_DECL_ENIC
 #define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev)
 #endif
@@ -104,11 +100,6 @@
 #define RTE_PCI_DEV_ID_DECL_BNX2XVF(vend, dev)
 #endif
 
-#ifndef PCI_VENDOR_ID_VMWARE
-/** Vendor ID used by VMware devices */
-#define PCI_VENDOR_ID_VMWARE 0x15AD
-#endif
-
 #ifndef PCI_VENDOR_ID_CISCO
 /** Vendor ID used by Cisco VIC devices */
 #define PCI_VENDOR_ID_CISCO 0x1137
@@ -119,12 +110,6 @@
 #define PCI_VENDOR_ID_BROADCOM 0x14E4
 #endif
 
-/****************** VMware VMXNET3 devices ******************/
-
-#define VMWARE_DEV_ID_VMXNET3                   0x07B0
-
-RTE_PCI_DEV_ID_DECL_VMXNET3(PCI_VENDOR_ID_VMWARE, VMWARE_DEV_ID_VMXNET3)
-
 /****************** Cisco VIC devices ******************/
 
 #define PCI_DEVICE_ID_CISCO_VIC_ENET         0x0043  /* ethernet vnic */
@@ -183,4 +168,3 @@ RTE_PCI_DEV_ID_DECL_BNX2X(PCI_VENDOR_ID_BROADCOM, BNX2X_DEV_ID_57840_MF)
  */
 #undef RTE_PCI_DEV_ID_DECL_BNX2X
 #undef RTE_PCI_DEV_ID_DECL_BNX2XVF
-#undef RTE_PCI_DEV_ID_DECL_VMXNET3
Signature · 1 line
1.9.1
#35 lore raw

PATCH v2 7/10 enic: move pci device ids to driver

In reply to David Marchand

Moved cisco vendor id since the driver had no such information.

---

Changes since v1:
- indent fix

 drivers/net/enic/enic_ethdev.c                  | 12 ++++--------
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 17 -----------------
 2 files changed, 4 insertions(+), 25 deletions(-)
drivers/net/enic/enic_ethdev.c +4 -8
index 2a88043..a70c364 100644
@@ -57,15 +57,11 @@
 /*
  * The set of PCI devices this driver supports
  */
+#define PCI_VENDOR_ID_CISCO 0x1137
 static const struct rte_pci_id pci_id_enic_map[] = {
-#define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#ifndef PCI_VENDOR_ID_CISCO
-#define PCI_VENDOR_ID_CISCO	0x1137
-#endif
-#include "rte_pci_dev_ids.h"
-RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET)
-RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET_VF)
-{.vendor_id = 0, /* Sentinal */},
+	{ 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 */},
 };
 
 static int
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -17
index 0ecff3c..1c22c04 100644
@@ -88,10 +88,6 @@
  * Note that this file can be included multiple times within the same file.
  */
 
-#ifndef RTE_PCI_DEV_ID_DECL_ENIC
-#define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev)
-#endif
-
 #ifndef RTE_PCI_DEV_ID_DECL_BNX2X
 #define RTE_PCI_DEV_ID_DECL_BNX2X(vend, dev)
 #endif
@@ -100,24 +96,11 @@
 #define RTE_PCI_DEV_ID_DECL_BNX2XVF(vend, dev)
 #endif
 
-#ifndef PCI_VENDOR_ID_CISCO
-/** Vendor ID used by Cisco VIC devices */
-#define PCI_VENDOR_ID_CISCO 0x1137
-#endif
-
 #ifndef PCI_VENDOR_ID_BROADCOM
 /** Vendor ID used by Broadcom devices */
 #define PCI_VENDOR_ID_BROADCOM 0x14E4
 #endif
 
-/****************** Cisco VIC devices ******************/
-
-#define PCI_DEVICE_ID_CISCO_VIC_ENET         0x0043  /* ethernet vnic */
-#define PCI_DEVICE_ID_CISCO_VIC_ENET_VF      0x0071  /* enet SRIOV VF */
-
-RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET)
-RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET_VF)
-
 /****************** QLogic devices ******************/
 
 /* Broadcom/QLogic BNX2X */
Signature · 1 line
1.9.1
#36 lore raw

PATCH v2 8/10 bnx2x: move pci device ids to driver

In reply to David Marchand

Reused defines from the driver and moved broadcom vendor id macro.

---

Changes since v1:
- indent fix

 drivers/net/bnx2x/bnx2x.c                       |  3 +-
 drivers/net/bnx2x/bnx2x_ethdev.c                | 21 +++++++--
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 60 -------------------------
 3 files changed, 18 insertions(+), 66 deletions(-)
drivers/net/bnx2x/bnx2x.c +1 -2
index 67af5da..bf6dd71 100644
@@ -22,7 +22,6 @@
 #include "ecore_init_ops.h"
 
 #include "rte_version.h"
-#include "rte_pci_dev_ids.h"
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -9592,7 +9591,7 @@ void bnx2x_load_firmware(struct bnx2x_softc *sc)
 	int f;
 	struct stat st;
 
-	fwname = sc->devinfo.device_id == BNX2X_DEV_ID_57711
+	fwname = sc->devinfo.device_id == CHIP_NUM_57711
 		? FW_NAME_57711 : FW_NAME_57810;
 	f = open(fwname, O_RDONLY);
 	if (f < 0) {
drivers/net/bnx2x/bnx2x_ethdev.c +17 -4
index 69df02e..7655124 100644
@@ -16,15 +16,28 @@
 /*
  * The set of PCI devices this driver supports
  */
+#define PCI_VENDOR_ID_BROADCOM 0x14E4
 static struct rte_pci_id pci_id_bnx2x_map[] = {
-#define RTE_PCI_DEV_ID_DECL_BNX2X(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+	{ 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) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57811) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57840_OBS) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57840_4_10) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57840_2_20) },
+#ifdef RTE_LIBRTE_BNX2X_MF_SUPPORT
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57810_MF) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57811_MF) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57840_MF) },
+#endif
 	{ .vendor_id = 0, }
 };
 
 static struct rte_pci_id pci_id_bnx2xvf_map[] = {
-#define RTE_PCI_DEV_ID_DECL_BNX2XVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+	{ 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) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57840_VF) },
 	{ .vendor_id = 0, }
 };
 
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -60

66 lines not on this page · raw message

Signature · 1 line
1.9.1
#37 lore raw

PATCH v2 9/10 pci: no need for global device ids list

In reply to David Marchand

Now that all pci device ids are in their respective drivers, we can remove this header.

---
 doc/api/doxy-api-index.md                       |  1 -
 lib/librte_eal/common/Makefile                  |  2 +-
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 93 -------------------------
 3 files changed, 1 insertion(+), 95 deletions(-)
 delete mode 100644 lib/librte_eal/common/include/rte_pci_dev_ids.h
doc/api/doxy-api-index.md +0 -1
index 7a91001..0540aba 100644
@@ -45,7 +45,6 @@ There are many libraries, so their headers may be grouped by topics:
   [vhost]              (@ref rte_virtio_net.h),
   [KNI]                (@ref rte_kni.h),
   [PCI]                (@ref rte_pci.h),
-  [PCI IDs]            (@ref rte_pci_dev_ids.h)
 
 - **memory**:
   [memseg]             (@ref rte_memory.h),
lib/librte_eal/common/Makefile +1 -1
index f5ea0ee..bb9810d 100644
@@ -34,7 +34,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 INC := rte_branch_prediction.h rte_common.h
 INC += rte_debug.h rte_eal.h rte_errno.h rte_launch.h rte_lcore.h
 INC += rte_log.h rte_memory.h rte_memzone.h rte_pci.h
-INC += rte_pci_dev_ids.h rte_per_lcore.h rte_random.h
+INC += rte_per_lcore.h rte_random.h
 INC += rte_tailq.h rte_interrupts.h rte_alarm.h
 INC += rte_string_fns.h rte_version.h
 INC += rte_eal_memconfig.h rte_malloc_heap.h
lib/librte_eal/common/include/rte_pci_dev_ids.h deleted +0 -93

93 lines not on this page · raw message

Signature · 1 line
1.9.1
#38 lore raw

PATCH v2 10/10 pci: place all uio pci device ids in a dedicated section

In reply to David Marchand

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 ................

---
 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(-)
drivers/crypto/qat/rte_qat_cryptodev.c +1 -1
index e500c1e..c9f5790 100644
@@ -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,
drivers/net/bnx2x/bnx2x_ethdev.c +2 -2
index 7655124..72546bd 100644
@@ -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) },
drivers/net/cxgbe/cxgbe_ethdev.c +1 -1
index 97ef152..2620130 100644
@@ -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
drivers/net/e1000/em_ethdev.c +1 -1
index 4cf9217..fb71686 100644
@@ -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"
drivers/net/e1000/igb_ethdev.c +2 -2
index 3f85a2c..f71bcd1 100644
@@ -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"
drivers/net/enic/enic_ethdev.c +1 -1
index a70c364..493b154 100644
@@ -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 */},
drivers/net/fm10k/fm10k_ethdev.c +1 -1
index 2c4905c..4e5748c 100644
@@ -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) },
drivers/net/i40e/i40e_ethdev.c +1 -1
index e9f6587..6801b9f 100644
@@ -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) },
drivers/net/i40e/i40e_ethdev_vf.c +1 -1
index 9302f27..f925265 100644
@@ -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) },
drivers/net/ixgbe/ixgbe_ethdev.c +2 -2
index b31f52e..f970ca9 100644
@@ -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"
drivers/net/nfp/nfp_net.c +1 -1
index bc2089f..32bcec1 100644
@@ -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,
drivers/net/virtio/virtio_ethdev.c +1 -1
index 94486e6..9cbb5dd 100644
@@ -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 */ },
 };
drivers/net/vmxnet3/vmxnet3_ethdev.c +1 -1
index 304f076..6d03695 100644
@@ -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 */ },
 };
lib/librte_eal/common/include/rte_pci.h +2 -0
index 334c12e..094b1c0 100644
@@ -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.
  */
Signature · 1 line
1.9.1
#18 lore raw

Re: [PATCH 09/11] doc: refresh headers list

In reply to David Marchand
Quoted 51 lines

-----Original Message-----
From: David Marchand [mailto:[email protected]]
Sent: Saturday, January 16, 2016 3:11 PM
To: Mcnamara, John
Cc: [email protected]; Thomas Monjalon
Subject: Re: [dpdk-dev] [PATCH 09/11] doc: refresh headers list

Hello John,

Quoted 7 lines · John
Quoted 7 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of David Marchand
Sent: Sunday, January 10, 2016 12:51 PM
To: [email protected]
Cc: [email protected]
Subject: [dpdk-dev] [PATCH 09/11] doc: refresh headers list

Quoted 7 lines
Quoted 2 lines

Since we are going to remove a header in next commit, let's first refresh documentation.

I don't like these parts of the docs that list files since they go out of date quite easily and, in general, the same information can be conveyed by just listing the directories. (That isn't future-proof either but it should be less subject to change.)

Well, we could imagine something automatic (in the build process), but I agree that the quickest solution is to get rid of it.

Quoted 6 lines

In this case you could just remove everything in the console section after the output from "ls x86_64-native-linuxapp-gcc" like this:

Each build directory contains include files, libraries, and applications

like the following::

Quoted 13 lines
    $ ls
    app                       tools
    config                    MAINTAINERS
    Makefile                  GNUmakefile
    drivers                   mk
    examples                  pkg
    doc                       README
    lib                       scripts
    LICENSE.GPL               LICENSE.LGPL
    i686-native-linuxapp-gcc  x86_64-native-linuxapp-gcc
    i686-native-linuxapp-icc  x86_64-native-linuxapp-icc
Quoted 7 lines
Quoted 3 lines
    $ ls x86_64-native-linuxapp-gcc
    app  build  include  kmod  lib  Makefile

Well, from my pov, it is the same issue here. How about just removing all those files listings ? I am not sure they really help.

Hi,

I'm fine with that. I don't think the file listing adds much information to the previous paragraph.

Or we could just add text that leaves out some of the information so that the reader doesn’t expect an exact representation and isn't confused when their file structure doesn't match. Something like:

    $ ls
    ...
    app
    config
    doc
    drivers
    examples
    lib
    ...
    i686-native-linuxapp-gcc  
    i686-native-linuxapp-icc  
    x86_64-native-linuxapp-gcc
    x86_64-native-linuxapp-icc
    ...

John.

#39 lore raw

Re: [PATCH v2 10/10] pci: place all uio pci device ids in a dedicated section

In reply to David Marchand

2016-01-18 13:30, David Marchand:

Quoted 10 lines

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 ................

Yes we need a modinfo-like tool.
Currently, the UIO/VFIO binding can be done after parsing the PCI device list. It is better to define the device ids locally to their drivers but it must be integrated with an appropriate parsing tool at the same time. And more importantly than any tool, the format of these ELF data must be properly defined, documented and extensible.

Is there someone experimented with such format definition? Stephen, you were asking for this change, what is your opinion? I remember that Neil was also interested in this change:

	http://dpdk.org/ml/archives/dev/2015-January/012115.html

Panu, Christian, this change could be related to distribution packaging. Thanks for helping to move this change forward.

#40 lore raw

Re: [PATCH v2 10/10] pci: place all uio pci device ids in a dedicated section

Quoted 19 lines · Thomas Monjalon

2016-01-18 13:30, David Marchand:

Quoted 10 lines

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 ................

Yes we need a modinfo-like tool.
Currently, the UIO/VFIO binding can be done after parsing the PCI device list. It is better to define the device ids locally to their drivers but it must be integrated with an appropriate parsing tool at the same time. And more importantly than any tool, the format of these ELF data must be properly defined, documented and extensible.

Quoted 6 lines

Is there someone experimented with such format definition? Stephen, you were asking for this change, what is your opinion? I remember that Neil was also interested in this change:

	http://dpdk.org/ml/archives/dev/2015-January/012115.html

Panu, Christian, this change could be related to distribution packaging. Thanks for helping to move this change forward.

Yes, I would be interested in seeing this. Is the ask here that someone do it? As I recall from the last thread that you reference, I thought David M was interested in writing it and soliciting for ideas. If thats no longer the case, I can take a stab at writing it.

Neil

#41 lore raw

Re: [PATCH v2 10/10] pci: place all uio pci device ids in a dedicated section

Quoted 27 lines · On Tue, 19 Jan 2016 09:29:31 -0500 Neil Horman <[email protected]> wrote:
Quoted 19 lines · Thomas Monjalon

2016-01-18 13:30, David Marchand:

Quoted 10 lines

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 ................

Yes we need a modinfo-like tool.
Currently, the UIO/VFIO binding can be done after parsing the PCI device list. It is better to define the device ids locally to their drivers but it must be integrated with an appropriate parsing tool at the same time. And more importantly than any tool, the format of these ELF data must be properly defined, documented and extensible.

Quoted 6 lines

Is there someone experimented with such format definition? Stephen, you were asking for this change, what is your opinion? I remember that Neil was also interested in this change:

	http://dpdk.org/ml/archives/dev/2015-January/012115.html

Panu, Christian, this change could be related to distribution packaging. Thanks for helping to move this change forward.

Quoted 7 lines

Yes, I would be interested in seeing this. Is the ask here that someone do it? As I recall from the last thread that you reference, I thought David M was interested in writing it and soliciting for ideas. If thats no longer the case, I can take a stab at writing it.

Neil

If these are libraries is there a way to have a real entry point to dump PCI id's.

#42 lore raw

Re: [PATCH v2 10/10] pci: place all uio pci device ids in a dedicated section

Quoted 35 lines · Stephen Hemminger
Quoted 32 lines · On Tue, 19 Jan 2016 09:29:31 -0500 Neil Horman <[email protected]> wrote:
Quoted 19 lines · Thomas Monjalon

2016-01-18 13:30, David Marchand:

Quoted 10 lines

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 ................

Yes we need a modinfo-like tool.
Currently, the UIO/VFIO binding can be done after parsing the PCI device list. It is better to define the device ids locally to their drivers but it must be integrated with an appropriate parsing tool at the same time. And more importantly than any tool, the format of these ELF data must be properly defined, documented and extensible.

Quoted 6 lines

Is there someone experimented with such format definition? Stephen, you were asking for this change, what is your opinion? I remember that Neil was also interested in this change:

	http://dpdk.org/ml/archives/dev/2015-January/012115.html

Panu, Christian, this change could be related to distribution packaging. Thanks for helping to move this change forward.

Yes, I would be interested in seeing this. Is the ask here that someone do it? As I recall from the last thread that you reference, I thought David M was interested in writing it and soliciting for ideas. If thats no longer the case, I can take a stab at writing it.

Quoted 6 lines
Quoted 2 lines

Neil

If these are libraries is there a way to have a real entry point to dump PCI id's.

Sure, you could write a method that could be dlsym-ed easily enough to fetch an array of pci ids, or just print stuff the console. Not sure thats the best way, but definately an option
Neil

#43 lore raw

Re: [PATCH v2 10/10] pci: place all uio pci device ids in a dedicated section

Quoted 39 lines · On Tue, 19 Jan 2016 15:56:14 -0500 Neil Horman <[email protected]> wrote:
Quoted 38 lines · Stephen Hemminger
Quoted 34 lines · On Tue, 19 Jan 2016 09:29:31 -0500 Neil Horman <[email protected]> wrote:
Quoted 19 lines · Thomas Monjalon

2016-01-18 13:30, David Marchand:

Quoted 10 lines

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 ................

Yes we need a modinfo-like tool.
Currently, the UIO/VFIO binding can be done after parsing the PCI device list. It is better to define the device ids locally to their drivers but it must be integrated with an appropriate parsing tool at the same time. And more importantly than any tool, the format of these ELF data must be properly defined, documented and extensible.

Quoted 6 lines

Is there someone experimented with such format definition? Stephen, you were asking for this change, what is your opinion? I remember that Neil was also interested in this change:

	http://dpdk.org/ml/archives/dev/2015-January/012115.html

Panu, Christian, this change could be related to distribution packaging. Thanks for helping to move this change forward.

Yes, I would be interested in seeing this. Is the ask here that someone do it? As I recall from the last thread that you reference, I thought David M was interested in writing it and soliciting for ideas. If thats no longer the case, I can take a stab at writing it.

Neil

Quoted 7 lines
Quoted 3 lines

If these are libraries is there a way to have a real entry point to dump PCI id's.

Sure, you could write a method that could be dlsym-ed easily enough to fetch an array of pci ids, or just print stuff the console. Not sure thats the best way, but definately an option
Neil

It is just that reading data with objdump is a kludge likely to get broken.

#44 lore raw

Re: [PATCH v2 10/10] pci: place all uio pci device ids in a dedicated section

Quoted 45 lines · Stephen Hemminger
Quoted 42 lines · On Tue, 19 Jan 2016 15:56:14 -0500 Neil Horman <[email protected]> wrote:
Quoted 41 lines · Stephen Hemminger
Quoted 27 lines · On Tue, 19 Jan 2016 09:29:31 -0500 Neil Horman <[email protected]> wrote:
Quoted 19 lines · Thomas Monjalon

2016-01-18 13:30, David Marchand:

Quoted 10 lines

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 ................

Yes we need a modinfo-like tool.
Currently, the UIO/VFIO binding can be done after parsing the PCI device list. It is better to define the device ids locally to their drivers but it must be integrated with an appropriate parsing tool at the same time. And more importantly than any tool, the format of these ELF data must be properly defined, documented and extensible.

Quoted 6 lines

Is there someone experimented with such format definition? Stephen, you were asking for this change, what is your opinion? I remember that Neil was also interested in this change:

	http://dpdk.org/ml/archives/dev/2015-January/012115.html

Panu, Christian, this change could be related to distribution packaging. Thanks for helping to move this change forward.

Quoted 7 lines

Yes, I would be interested in seeing this. Is the ask here that someone do it? As I recall from the last thread that you reference, I thought David M was interested in writing it and soliciting for ideas. If thats no longer the case, I can take a stab at writing it.

Neil

If these are libraries is there a way to have a real entry point to dump PCI id's.

Quoted 7 lines
Quoted 4 lines

Sure, you could write a method that could be dlsym-ed easily enough to fetch an array of pci ids, or just print stuff the console. Not sure thats the best way, but definately an option
Neil

It is just that reading data with objdump is a kludge likely to get broken.

Not suggesting that we rely on objdump in perpituity, only that we export the data, rather than a method to access it so that it can be reached via libelf. Using a function to return the information has implicit issues at the moment (specifically if you dlopen a dpdk driver, its constructor will attempt to register it with the core libraries). While thats not catastrophic, it means more stuff than you expect gets loaded, which might have wierd side effects. Adding a separate section that you could reach via libelf would be nice I think

Neil

#27 lore raw

Re: [PATCH 00/11] kill global pci device id list

In reply to David Marchand

Hello David

Yes, long time ago, the same device IDs need to be filled in 3 or 4 places. Then it would be better to have a centralized one, to avoid missing any.
And yes, it would be good to maintain device IDs per PMD.
As basically we don't expose any base driver header files, and sometimes those device IDs need to be defined into different meanings, I'd prefer to have each PMD has its own centralized device ID list header file, like you did for ixgbe.

Thanks a lot!

Regards,
Helin

Quoted 32 lines

-----Original Message-----
From: David Marchand [mailto:[email protected]]
Sent: Saturday, January 16, 2016 11:03 PM
To: Zhang, Helin
Cc: [email protected]; Thomas Monjalon
Subject: Re: [dpdk-dev] [PATCH 00/11] kill global pci device id list

Hello Helin,

Quoted 2 lines · Helin

Thanks for your huge contribution!
May you help to describe more details of why you made these huge

changes?

As far as I can see, the only reason why we have a centralised header maintained in eal with all pci device ids is the need to identify pci devices that require a special treatment before starting a dpdk application (here, bind those pci devices to igb_uio / vfio).

This patchset splits this header into small pieces maintained by the drivers themselves, then tries to come up with a way to retrieve those pci device ids from the final dpdk application and from the drivers compiled as shared libraries.

With this, supported pci device ids are maintained by the drivers themselves rather than eal, pci devices ids requiring uio/vfio binding are still available.

Regards,
--
David Marchand

#45 lore raw

Re: [PATCH v2 10/10] pci: place all uio pci device ids in a dedicated section

In reply to Neil Horman
Quoted 61 lines · Neil Horman
Quoted 45 lines · Stephen Hemminger
Quoted 42 lines · On Tue, 19 Jan 2016 15:56:14 -0500 Neil Horman <[email protected]> wrote:
Quoted 41 lines · Stephen Hemminger
Quoted 27 lines · On Tue, 19 Jan 2016 09:29:31 -0500 Neil Horman <[email protected]> wrote:
Quoted 19 lines · Thomas Monjalon

2016-01-18 13:30, David Marchand:

Quoted 10 lines

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 ................

Yes we need a modinfo-like tool.
Currently, the UIO/VFIO binding can be done after parsing the PCI device list. It is better to define the device ids locally to their drivers but it must be integrated with an appropriate parsing tool at the same time. And more importantly than any tool, the format of these ELF data must be properly defined, documented and extensible.

Quoted 6 lines

Is there someone experimented with such format definition? Stephen, you were asking for this change, what is your opinion? I remember that Neil was also interested in this change:

	http://dpdk.org/ml/archives/dev/2015-January/012115.html

Panu, Christian, this change could be related to distribution packaging. Thanks for helping to move this change forward.

Quoted 7 lines

Yes, I would be interested in seeing this. Is the ask here that someone do it? As I recall from the last thread that you reference, I thought David M was interested in writing it and soliciting for ideas. If thats no longer the case, I can take a stab at writing it.

Neil

If these are libraries is there a way to have a real entry point to dump PCI id's.

Quoted 7 lines
Quoted 4 lines

Sure, you could write a method that could be dlsym-ed easily enough to fetch an array of pci ids, or just print stuff the console. Not sure thats the best way, but definately an option
Neil

It is just that reading data with objdump is a kludge likely to get broken.

Not suggesting that we rely on objdump in perpituity, only that we export the data, rather than a method to access it so that it can be reached via libelf. Using a function to return the information has implicit issues at the moment (specifically if you dlopen a dpdk driver, its constructor will attempt to register it with the core libraries). While thats not catastrophic, it means more stuff than you expect gets loaded, which might have wierd side effects. Adding a separate section that you could reach via libelf would be nice I think

Quoted 2 lines

Neil

Hi,

while there is interesting discussion on tools, are there any objections to taking and merging this patchset as-is to at least do the cleanup of the existing pci ids list? I would assume that any tools for querying the patchlist can be done as additional work once this is applied.

Regards,
/Bruce

#46 lore raw

Re: [PATCH v2 10/10] pci: place all uio pci device ids in a dedicated section

2016-02-24 11:37, Bruce Richardson:

Quoted 62 lines · Neil Horman
Quoted 61 lines · Stephen Hemminger
Quoted 45 lines
Quoted 42 lines · On Tue, 19 Jan 2016 15:56:14 -0500 Neil Horman <[email protected]> wrote:
Quoted 41 lines · Stephen Hemminger
Quoted 27 lines · On Tue, 19 Jan 2016 09:29:31 -0500 Neil Horman <[email protected]> wrote:
Quoted 19 lines · Thomas Monjalon

2016-01-18 13:30, David Marchand:

Quoted 10 lines

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 ................

Yes we need a modinfo-like tool.
Currently, the UIO/VFIO binding can be done after parsing the PCI device list. It is better to define the device ids locally to their drivers but it must be integrated with an appropriate parsing tool at the same time. And more importantly than any tool, the format of these ELF data must be properly defined, documented and extensible.

Quoted 6 lines

Is there someone experimented with such format definition? Stephen, you were asking for this change, what is your opinion? I remember that Neil was also interested in this change:

	http://dpdk.org/ml/archives/dev/2015-January/012115.html

Panu, Christian, this change could be related to distribution packaging. Thanks for helping to move this change forward.

Quoted 7 lines

Yes, I would be interested in seeing this. Is the ask here that someone do it? As I recall from the last thread that you reference, I thought David M was interested in writing it and soliciting for ideas. If thats no longer the case, I can take a stab at writing it.

Neil

If these are libraries is there a way to have a real entry point to dump PCI id's.

Quoted 7 lines
Quoted 4 lines

Sure, you could write a method that could be dlsym-ed easily enough to fetch an array of pci ids, or just print stuff the console. Not sure thats the best way, but definately an option
Neil

It is just that reading data with objdump is a kludge likely to get broken.

Not suggesting that we rely on objdump in perpituity, only that we export the data, rather than a method to access it so that it can be reached via libelf. Using a function to return the information has implicit issues at the moment (specifically if you dlopen a dpdk driver, its constructor will attempt to register it with the core libraries). While thats not catastrophic, it means more stuff than you expect gets loaded, which might have wierd side effects. Adding a separate section that you could reach via libelf would be nice I think

Quoted 8 lines
Quoted 2 lines

Neil

Hi,

while there is interesting discussion on tools, are there any objections to taking and merging this patchset as-is to at least do the cleanup of the existing pci ids list? I would assume that any tools for querying the patchlist can be done as additional work once this is applied.

Today we can parse the global PCI list to bind devices to DPDK. If we remove this list, we must replace it by another convenient method. And more importantly, the informations in the ELF files must be extendible and in a stable syntax.
The problem here is that it is poorly specified.
Please let's describe a syntax for these ELF data, first.

#47 lore raw

Re: [PATCH v2 10/10] pci: place all uio pci device ids in a dedicated section

Quoted 72 lines · Thomas Monjalon

2016-02-24 11:37, Bruce Richardson:

Quoted 62 lines · Neil Horman
Quoted 61 lines · Stephen Hemminger
Quoted 45 lines
Quoted 42 lines · On Tue, 19 Jan 2016 15:56:14 -0500 Neil Horman <[email protected]> wrote:
Quoted 41 lines · Stephen Hemminger
Quoted 27 lines · On Tue, 19 Jan 2016 09:29:31 -0500 Neil Horman <[email protected]> wrote:
Quoted 19 lines · Thomas Monjalon

2016-01-18 13:30, David Marchand:

Quoted 10 lines

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 ................

Yes we need a modinfo-like tool.
Currently, the UIO/VFIO binding can be done after parsing the PCI device list. It is better to define the device ids locally to their drivers but it must be integrated with an appropriate parsing tool at the same time. And more importantly than any tool, the format of these ELF data must be properly defined, documented and extensible.

Quoted 6 lines

Is there someone experimented with such format definition? Stephen, you were asking for this change, what is your opinion? I remember that Neil was also interested in this change:

	http://dpdk.org/ml/archives/dev/2015-January/012115.html

Panu, Christian, this change could be related to distribution packaging. Thanks for helping to move this change forward.

Quoted 7 lines

Yes, I would be interested in seeing this. Is the ask here that someone do it? As I recall from the last thread that you reference, I thought David M was interested in writing it and soliciting for ideas. If thats no longer the case, I can take a stab at writing it.

Neil

If these are libraries is there a way to have a real entry point to dump PCI id's.

Quoted 7 lines
Quoted 4 lines

Sure, you could write a method that could be dlsym-ed easily enough to fetch an array of pci ids, or just print stuff the console. Not sure thats the best way, but definately an option
Neil

It is just that reading data with objdump is a kludge likely to get broken.

Not suggesting that we rely on objdump in perpituity, only that we export the data, rather than a method to access it so that it can be reached via libelf. Using a function to return the information has implicit issues at the moment (specifically if you dlopen a dpdk driver, its constructor will attempt to register it with the core libraries). While thats not catastrophic, it means more stuff than you expect gets loaded, which might have wierd side effects. Adding a separate section that you could reach via libelf would be nice I think

Quoted 8 lines
Quoted 2 lines

Neil

Hi,

while there is interesting discussion on tools, are there any objections to taking and merging this patchset as-is to at least do the cleanup of the existing pci ids list? I would assume that any tools for querying the patchlist can be done as additional work once this is applied.

Quoted 6 lines

Today we can parse the global PCI list to bind devices to DPDK. If we remove this list, we must replace it by another convenient method. And more importantly, the informations in the ELF files must be extendible and in a stable syntax.
The problem here is that it is poorly specified.
Please let's describe a syntax for these ELF data, first.

Agreed, I'd be fine with taking the patch if it didn't preclude admins from being able to identify which drivers match which devices without loading the modules first.
Neil

#48 lore raw

v3 cover kill global pci device id list

In reply to David Marchand

This patchset moves all pci device ids from eal to the pmds that need them. Global pci device id list is then removed.

A new tool (name to be discussed) has been added to retrieve some information from the dpdk elf objects.

I can't work on this subject at the moment, so please feel free to make these patches yours if you have better ideas / ways to achieve the same result.

Changes since v2:
- rebased on HEAD
- ena driver has been aligned
- this patchset now depends on [1] as it avoids touching all drivers this way
- not storing the pci ids in a dedicated section anymore, pci drivers are exported and parsed by a quickly written (and naive) tool

Changes since v1:
- indent fixes in i40e, fm10k, virtio, vmxnet3, enic, bnx2c.
- rebased on head (ixgbe update)
- removed doc update (will be sent separately)

[1]: http://dpdk.org/ml/archives/dev/2016-April/037686.html

Signature · 60 lines
David Marchand

David Marchand (13):
  e1000: move pci device ids to driver
  ixgbe: move pci device ids to driver
  i40e: move pci device ids to driver
  fm10k: move pci device ids to driver
  virtio: move pci device ids to driver
  vmxnet3: move pci device ids to driver
  enic: move pci device ids to driver
  bnx2x: move pci device ids to driver
  ena: remove unneeded pci macro
  pci: no need for global device ids list
  drivers: constify pci id tables
  drivers: export pci drivers
  app: introduce dpdk-obj-info tool

 app/Makefile                                    |   1 +
 app/dpdk-obj-info/Makefile                      |  45 ++
 app/dpdk-obj-info/dpdk-obj-info.c               | 188 +++++++
 app/test-pmd/Makefile                           |   2 +
 app/test-pmd/cmdline.c                          |   2 +-
 app/test/Makefile                               |   4 +
 app/test/test_pci.c                             |   5 +-
 doc/api/doxy-api-index.md                       |   1 -
 drivers/crypto/qat/rte_qat_cryptodev.c          |   2 +-
 drivers/net/bnx2x/bnx2x.c                       |   3 +-
 drivers/net/bnx2x/bnx2x_ethdev.c                |  25 +-
 drivers/net/cxgbe/cxgbe_ethdev.c                |   2 +-
 drivers/net/e1000/em_ethdev.c                   |   2 +-
 drivers/net/e1000/em_pci_dev_ids.h              | 208 +++++++
 drivers/net/e1000/igb_ethdev.c                  |   4 +-
 drivers/net/e1000/igb_pci_dev_ids.h             | 165 ++++++
 drivers/net/ena/ena_ethdev.c                    |  10 +-
 drivers/net/enic/enic_ethdev.c                  |  13 +-
 drivers/net/fm10k/fm10k_ethdev.c                |   7 +-
 drivers/net/i40e/i40e_ethdev.c                  |  21 +-
 drivers/net/i40e/i40e_ethdev_vf.c               |   9 +-
 drivers/net/ixgbe/ixgbe_ethdev.c                |   4 +-
 drivers/net/ixgbe/ixgbe_pci_dev_ids.h           | 213 +++++++
 drivers/net/mlx4/mlx4.c                         |   1 +
 drivers/net/mlx5/mlx5.c                         |   1 +
 drivers/net/nfp/nfp_net.c                       |   2 +-
 drivers/net/virtio/virtio_ethdev.c              |   8 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c            |   9 +-
 lib/librte_eal/common/Makefile                  |   2 +-
 lib/librte_eal/common/include/rte_pci.h         |   7 +
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 704 ------------------------
 lib/librte_eal/linuxapp/kni/Makefile            |   2 +
 lib/librte_eal/linuxapp/kni/kni_misc.c          |   8 +-
 33 files changed, 918 insertions(+), 762 deletions(-)
 create mode 100644 app/dpdk-obj-info/Makefile
 create mode 100644 app/dpdk-obj-info/dpdk-obj-info.c
 create mode 100644 drivers/net/e1000/em_pci_dev_ids.h
 create mode 100644 drivers/net/e1000/igb_pci_dev_ids.h
 create mode 100644 drivers/net/ixgbe/ixgbe_pci_dev_ids.h
 delete mode 100644 lib/librte_eal/common/include/rte_pci_dev_ids.h

-- 
1.9.1
#49 lore raw

PATCH v3 1/13 e1000: move pci device ids to driver

test application and kni still want to know e1000 pci devices. So let's create headers in the driver that will be used by them.

I wanted to reuse base/ headers, but because of some headaches trying to resolve macros redefinition collisions in kni (with ixgbe next commit), I left it as is.

---
 app/test/Makefile                               |   3 +
 app/test/test_pci.c                             |   3 +-
 drivers/net/e1000/em_ethdev.c                   |   2 +-
 drivers/net/e1000/em_pci_dev_ids.h              | 208 +++++++++++++++++++
 drivers/net/e1000/igb_ethdev.c                  |   4 +-
 drivers/net/e1000/igb_pci_dev_ids.h             | 165 +++++++++++++++
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 254 ------------------------
 lib/librte_eal/linuxapp/kni/Makefile            |   1 +
 lib/librte_eal/linuxapp/kni/kni_misc.c          |   4 +-
 9 files changed, 384 insertions(+), 260 deletions(-)
 create mode 100644 drivers/net/e1000/em_pci_dev_ids.h
 create mode 100644 drivers/net/e1000/igb_pci_dev_ids.h
app/test/Makefile +3 -0
index a4907d5..8a1f54c 100644
@@ -171,6 +171,9 @@ CFLAGS_test_memcpy_perf.o += -fno-var-tracking-assignments
 endif
 endif
 
+# pci tests want to know some pci devices ids
+CFLAGS_test_pci.o += -I$(RTE_SDK)/drivers/net/e1000
+
 # this application needs libraries first
 DEPDIRS-y += lib drivers
 
app/test/test_pci.c +2 -1
index 0ed357e..7215936 100644
@@ -77,8 +77,9 @@ struct rte_pci_id my_driver_id2[] = {
 
 /* IGB & EM NICS */
 #define RTE_PCI_DEV_ID_DECL_EM(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
+#include <em_pci_dev_ids.h>
 #define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include <rte_pci_dev_ids.h>
+#include <igb_pci_dev_ids.h>
 
 { .vendor_id = 0, /* sentinel */ },
 };
drivers/net/e1000/em_ethdev.c +1 -1
index 1f80c05..203a9e5 100644
@@ -139,7 +139,7 @@ static enum e1000_fc_mode em_fc_setting = e1000_fc_full;
 static const struct rte_pci_id pci_id_em_map[] = {
 
 #define RTE_PCI_DEV_ID_DECL_EM(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+#include "em_pci_dev_ids.h"
 
 {0},
 };
drivers/net/e1000/em_pci_dev_ids.h new file +208 -0

208 lines not on this page · raw message

drivers/net/e1000/igb_ethdev.c +2 -2
index 9b5f985..ba4195e 100644
@@ -284,7 +284,7 @@ static enum e1000_fc_mode igb_fc_setting = e1000_fc_full;
 static const struct rte_pci_id pci_id_igb_map[] = {
 
 #define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+#include "igb_pci_dev_ids.h"
 
 {0},
 };
@@ -295,7 +295,7 @@ static const struct rte_pci_id pci_id_igb_map[] = {
 static const struct rte_pci_id pci_id_igbvf_map[] = {
 
 #define RTE_PCI_DEV_ID_DECL_IGBVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+#include "igb_pci_dev_ids.h"
 
 {0},
 };
drivers/net/e1000/igb_pci_dev_ids.h new file +165 -0

165 lines not on this page · raw message

lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -254

284 lines not on this page · raw message

lib/librte_eal/linuxapp/kni/Makefile +1 -0
index ac99d3f..6ac7637 100644
@@ -43,6 +43,7 @@ MODULE_CFLAGS += -I$(SRCDIR) --param max-inline-insns-single=50
 MODULE_CFLAGS += -I$(RTE_OUTPUT)/include -I$(SRCDIR)/ethtool/ixgbe -I$(SRCDIR)/ethtool/igb
 MODULE_CFLAGS += -include $(RTE_OUTPUT)/include/rte_config.h
 MODULE_CFLAGS += -Wall -Werror
+MODULE_CFLAGS += -I$(RTE_SDK)/drivers/net/e1000
 
 ifeq ($(shell lsb_release -si 2>/dev/null),Ubuntu)
 MODULE_CFLAGS += -DUBUNTU_RELEASE_CODE=$(shell lsb_release -sr | tr -d .)
lib/librte_eal/linuxapp/kni/kni_misc.c +2 -2
index ae8133f..5342c53 100644
@@ -352,7 +352,7 @@ kni_dev_remove(struct kni_dev *dev)
 
 	switch (dev->device_id) {
 	#define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) case (dev):
-	#include <rte_pci_dev_ids.h>
+	#include <igb_pci_dev_ids.h>
 		igb_kni_remove(dev->pci_dev);
 		break;
 	#define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) case (dev):
@@ -509,7 +509,7 @@ kni_ioctl_create(struct net *net,
 			found_pci = pci;
 			switch (dev_info.device_id) {
 			#define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) case (dev):
-			#include <rte_pci_dev_ids.h>
+			#include <igb_pci_dev_ids.h>
 				ret = igb_kni_probe(found_pci, &lad_dev);
 				break;
 			#define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) \
Signature · 1 line
1.9.1
#64 lore raw

PATCH v3 2/13 ixgbe: move pci device ids to driver

In reply to David Marchand

test application and kni still want to know ixgbe pci devices. So let's create a header in the driver that will be used by them.

Same comment as for e1000 driver, we can't reuse base/ headers at the moment because of macros redefinitions nightmare.

---
 app/test-pmd/Makefile                           |   2 +
 app/test-pmd/cmdline.c                          |   2 +-
 app/test/Makefile                               |   1 +
 app/test/test_pci.c                             |   2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c                |   4 +-
 drivers/net/ixgbe/ixgbe_pci_dev_ids.h           | 213 ++++++++++++++++++++++++
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 154 -----------------
 lib/librte_eal/linuxapp/kni/Makefile            |   1 +
 lib/librte_eal/linuxapp/kni/kni_misc.c          |   4 +-
 9 files changed, 223 insertions(+), 160 deletions(-)
 create mode 100644 drivers/net/ixgbe/ixgbe_pci_dev_ids.h
app/test-pmd/Makefile +2 -0
index 72426f3..a8899b8 100644
@@ -64,6 +64,8 @@ ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y)
 CFLAGS_mempool_anon.o := -D_GNU_SOURCE
 endif
 CFLAGS_cmdline.o := -D_GNU_SOURCE
+# for bypass pci device ids
+CFLAGS_cmdline.o += -I$(RTE_SDK)/drivers/net/ixgbe
 
 # this application needs libraries first
 DEPDIRS-y += lib drivers
app/test-pmd/cmdline.c +1 -1
index c5b9479..45cbcff 100644
@@ -10586,7 +10586,7 @@ cmd_reconfig_device_queue(portid_t id, uint8_t dev, uint8_t queue)
 }
 
 #ifdef RTE_NIC_BYPASS
-#include <rte_pci_dev_ids.h>
+#include <ixgbe_pci_dev_ids.h>
 uint8_t
 bypass_is_supported(portid_t port_id)
 {
app/test/Makefile +1 -0
index 8a1f54c..051eb8c 100644
@@ -173,6 +173,7 @@ endif
 
 # pci tests want to know some pci devices ids
 CFLAGS_test_pci.o += -I$(RTE_SDK)/drivers/net/e1000
+CFLAGS_test_pci.o += -I$(RTE_SDK)/drivers/net/ixgbe
 
 # this application needs libraries first
 DEPDIRS-y += lib drivers
app/test/test_pci.c +1 -1
index 7215936..cdb79ab 100644
@@ -68,7 +68,7 @@ static int my_driver_init(struct rte_pci_driver *dr,
 struct rte_pci_id my_driver_id[] = {
 
 #define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include <rte_pci_dev_ids.h>
+#include <ixgbe_pci_dev_ids.h>
 
 { .vendor_id = 0, /* sentinel */ },
 };
drivers/net/ixgbe/ixgbe_ethdev.c +2 -2
index 5103c7c..098918a 100644
@@ -421,7 +421,7 @@ static int ixgbe_dev_udp_tunnel_port_del(struct rte_eth_dev *dev,
 static const struct rte_pci_id pci_id_ixgbe_map[] = {
 
 #define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+#include "ixgbe_pci_dev_ids.h"
 
 { .vendor_id = 0, /* sentinel */ },
 };
@@ -433,7 +433,7 @@ static const struct rte_pci_id pci_id_ixgbe_map[] = {
 static const struct rte_pci_id pci_id_ixgbevf_map[] = {
 
 #define RTE_PCI_DEV_ID_DECL_IXGBEVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+#include "ixgbe_pci_dev_ids.h"
 { .vendor_id = 0, /* sentinel */ },
 
 };
drivers/net/ixgbe/ixgbe_pci_dev_ids.h new file +213 -0

213 lines not on this page · raw message

lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -154

184 lines not on this page · raw message

lib/librte_eal/linuxapp/kni/Makefile +1 -0
index 6ac7637..3bdf352 100644
@@ -44,6 +44,7 @@ MODULE_CFLAGS += -I$(RTE_OUTPUT)/include -I$(SRCDIR)/ethtool/ixgbe -I$(SRCDIR)/e
 MODULE_CFLAGS += -include $(RTE_OUTPUT)/include/rte_config.h
 MODULE_CFLAGS += -Wall -Werror
 MODULE_CFLAGS += -I$(RTE_SDK)/drivers/net/e1000
+MODULE_CFLAGS += -I$(RTE_SDK)/drivers/net/ixgbe
 
 ifeq ($(shell lsb_release -si 2>/dev/null),Ubuntu)
 MODULE_CFLAGS += -DUBUNTU_RELEASE_CODE=$(shell lsb_release -sr | tr -d .)
lib/librte_eal/linuxapp/kni/kni_misc.c +2 -2
index 5342c53..c6f42f2 100644
@@ -356,7 +356,7 @@ kni_dev_remove(struct kni_dev *dev)
 		igb_kni_remove(dev->pci_dev);
 		break;
 	#define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) case (dev):
-	#include <rte_pci_dev_ids.h>
+	#include <ixgbe_pci_dev_ids.h>
 		ixgbe_kni_remove(dev->pci_dev);
 		break;
 	default:
@@ -514,7 +514,7 @@ kni_ioctl_create(struct net *net,
 				break;
 			#define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) \
 							case (dev):
-			#include <rte_pci_dev_ids.h>
+			#include <ixgbe_pci_dev_ids.h>
 				ret = ixgbe_kni_probe(found_pci, &lad_dev);
 				break;
 			default:
Signature · 1 line
1.9.1
#67 lore raw

PATCH v3 3/13 i40e: move pci device ids to driver

In reply to David Marchand

Since the base driver already defines all pci device ids, no need to redefine them, let's just drop the previous RTE_PCI_DEV_ID_DECL* stuff.

---
 drivers/net/i40e/i40e_ethdev.c                  | 21 ++++++--
 drivers/net/i40e/i40e_ethdev_vf.c               |  9 ++--
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 64 -------------------------
 3 files changed, 24 insertions(+), 70 deletions(-)
drivers/net/i40e/i40e_ethdev.c +18 -3
index 4e87399..b43acf1 100644
@@ -448,9 +448,24 @@ static void i40e_set_default_mac_addr(struct rte_eth_dev *dev,
 				      struct ether_addr *mac_addr);
 
 static const struct rte_pci_id pci_id_i40e_map[] = {
-#define RTE_PCI_DEV_ID_DECL_I40E(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
-{ .vendor_id = 0, /* sentinel */ },
+	{ 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_B) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_C) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_A) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_B) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_C) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_20G_KR2) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_20G_KR2_A) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T4) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_X722_A0) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_X722) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_X722) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_X722) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_1G_BASE_T_X722) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T_X722) },
+	{ .vendor_id = 0, /* sentinel */ },
 };
 
 static const struct eth_dev_ops i40e_eth_dev_ops = {
drivers/net/i40e/i40e_ethdev_vf.c +6 -3
index 1e41b3a..967324c 100644
@@ -1089,9 +1089,12 @@ i40evf_get_link_status(struct rte_eth_dev *dev, struct rte_eth_link *link)
 }
 
 static const struct rte_pci_id pci_id_i40evf_map[] = {
-#define RTE_PCI_DEV_ID_DECL_I40EVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
-{ .vendor_id = 0, /* sentinel */ },
+	{ 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_A0_VF) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_X722_VF) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_X722_VF_HV) },
+	{ .vendor_id = 0, /* sentinel */ },
 };
 
 static inline int
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -64

94 lines not on this page · raw message

Signature · 1 line
1.9.1
#68 lore raw

PATCH v3 4/13 fm10k: move pci device ids to driver

In reply to David Marchand

Since the base driver already defines all pci device ids, no need to redefine them, let's just drop the previous RTE_PCI_DEV_ID_DECL* stuff.

---
 drivers/net/fm10k/fm10k_ethdev.c                |  7 +++---
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 29 -------------------------
 2 files changed, 4 insertions(+), 32 deletions(-)
drivers/net/fm10k/fm10k_ethdev.c +4 -3
index 146bc2a..40b57f9 100644
@@ -3018,9 +3018,10 @@ eth_fm10k_dev_uninit(struct rte_eth_dev *dev)
  * and SRIOV-VF devices.
  */
 static const struct rte_pci_id pci_id_fm10k_map[] = {
-#define RTE_PCI_DEV_ID_DECL_FM10K(vend, dev) { RTE_PCI_DEVICE(vend, dev) },
-#define RTE_PCI_DEV_ID_DECL_FM10KVF(vend, dev) { RTE_PCI_DEVICE(vend, dev) },
-#include "rte_pci_dev_ids.h"
+	{ 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) },
 	{ .vendor_id = 0, /* sentinel */ },
 };
 
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -29
index f1f3e13..a19fdfa 100644
@@ -97,14 +97,6 @@
 #define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev)
 #endif
 
-#ifndef RTE_PCI_DEV_ID_DECL_FM10K
-#define RTE_PCI_DEV_ID_DECL_FM10K(vend, dev)
-#endif
-
-#ifndef RTE_PCI_DEV_ID_DECL_FM10KVF
-#define RTE_PCI_DEV_ID_DECL_FM10KVF(vend, dev)
-#endif
-
 #ifndef RTE_PCI_DEV_ID_DECL_ENIC
 #define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev)
 #endif
@@ -117,11 +109,6 @@
 #define RTE_PCI_DEV_ID_DECL_BNX2XVF(vend, dev)
 #endif
 
-#ifndef PCI_VENDOR_ID_INTEL
-/** Vendor ID used by Intel devices */
-#define PCI_VENDOR_ID_INTEL 0x8086
-#endif
-
 #ifndef PCI_VENDOR_ID_QUMRANET
 /** Vendor ID used by virtio devices */
 #define PCI_VENDOR_ID_QUMRANET 0x1AF4
@@ -142,14 +129,6 @@
 #define PCI_VENDOR_ID_BROADCOM 0x14E4
 #endif
 
-/*************** Physical FM10K devices from fm10k_type.h ***************/
-
-#define FM10K_DEV_ID_PF                   0x15A4
-#define FM10K_DEV_ID_SDI_FM10420_QDA2     0x15D0
-
-RTE_PCI_DEV_ID_DECL_FM10K(PCI_VENDOR_ID_INTEL, FM10K_DEV_ID_PF)
-RTE_PCI_DEV_ID_DECL_FM10K(PCI_VENDOR_ID_INTEL, FM10K_DEV_ID_SDI_FM10420_QDA2)
-
 /****************** Virtio devices from virtio.h ******************/
 
 #define QUMRANET_DEV_ID_VIRTIO                  0x1000
@@ -162,12 +141,6 @@ RTE_PCI_DEV_ID_DECL_VIRTIO(PCI_VENDOR_ID_QUMRANET, QUMRANET_DEV_ID_VIRTIO)
 
 RTE_PCI_DEV_ID_DECL_VMXNET3(PCI_VENDOR_ID_VMWARE, VMWARE_DEV_ID_VMXNET3)
 
-/*************** Virtual FM10K devices from fm10k_type.h ***************/
-
-#define FM10K_DEV_ID_VF                   0x15A5
-
-RTE_PCI_DEV_ID_DECL_FM10KVF(PCI_VENDOR_ID_INTEL, FM10K_DEV_ID_VF)
-
 /****************** Cisco VIC devices ******************/
 
 #define PCI_DEVICE_ID_CISCO_VIC_ENET         0x0043  /* ethernet vnic */
@@ -228,5 +201,3 @@ RTE_PCI_DEV_ID_DECL_BNX2X(PCI_VENDOR_ID_BROADCOM, BNX2X_DEV_ID_57840_MF)
 #undef RTE_PCI_DEV_ID_DECL_BNX2XVF
 #undef RTE_PCI_DEV_ID_DECL_VIRTIO
 #undef RTE_PCI_DEV_ID_DECL_VMXNET3
-#undef RTE_PCI_DEV_ID_DECL_FM10K
-#undef RTE_PCI_DEV_ID_DECL_FM10KVF
Signature · 1 line
1.9.1
#69 lore raw

PATCH v3 5/13 virtio: move pci device ids to driver

In reply to David Marchand

Reused defines from virtio_pci.h.

---
 drivers/net/virtio/virtio_ethdev.c              |  7 ++-----
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 17 -----------------
 2 files changed, 2 insertions(+), 22 deletions(-)
drivers/net/virtio/virtio_ethdev.c +2 -5
index f8cc158..ee95cab 100644
@@ -102,11 +102,8 @@ 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[] = {
-
-#define RTE_PCI_DEV_ID_DECL_VIRTIO(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
-
-{ .vendor_id = 0, /* sentinel */ },
+	{ RTE_PCI_DEVICE(VIRTIO_PCI_VENDORID, VIRTIO_PCI_DEVICEID_MIN) },
+	{ .vendor_id = 0, /* sentinel */ },
 };
 
 struct rte_virtio_xstats_name_off {
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -17
index a19fdfa..448b5e1 100644
@@ -68,7 +68,6 @@
  * driver which is a para virtualization driver running in guest virtual machine.
  * The inclusion of these in an array built using this file depends on the
  * definition of
- * RTE_PCI_DEV_ID_DECL_VIRTIO
  * at the time when this file is included.
  *
  * In order to populate an array, the user of this file must define this macro:
@@ -89,10 +88,6 @@
  * Note that this file can be included multiple times within the same file.
  */
 
-#ifndef RTE_PCI_DEV_ID_DECL_VIRTIO
-#define RTE_PCI_DEV_ID_DECL_VIRTIO(vend, dev)
-#endif
-
 #ifndef RTE_PCI_DEV_ID_DECL_VMXNET3
 #define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev)
 #endif
@@ -109,11 +104,6 @@
 #define RTE_PCI_DEV_ID_DECL_BNX2XVF(vend, dev)
 #endif
 
-#ifndef PCI_VENDOR_ID_QUMRANET
-/** Vendor ID used by virtio devices */
-#define PCI_VENDOR_ID_QUMRANET 0x1AF4
-#endif
-
 #ifndef PCI_VENDOR_ID_VMWARE
 /** Vendor ID used by VMware devices */
 #define PCI_VENDOR_ID_VMWARE 0x15AD
@@ -129,12 +119,6 @@
 #define PCI_VENDOR_ID_BROADCOM 0x14E4
 #endif
 
-/****************** Virtio devices from virtio.h ******************/
-
-#define QUMRANET_DEV_ID_VIRTIO                  0x1000
-
-RTE_PCI_DEV_ID_DECL_VIRTIO(PCI_VENDOR_ID_QUMRANET, QUMRANET_DEV_ID_VIRTIO)
-
 /****************** VMware VMXNET3 devices ******************/
 
 #define VMWARE_DEV_ID_VMXNET3                   0x07B0
@@ -199,5 +183,4 @@ RTE_PCI_DEV_ID_DECL_BNX2X(PCI_VENDOR_ID_BROADCOM, BNX2X_DEV_ID_57840_MF)
  */
 #undef RTE_PCI_DEV_ID_DECL_BNX2X
 #undef RTE_PCI_DEV_ID_DECL_BNX2XVF
-#undef RTE_PCI_DEV_ID_DECL_VIRTIO
 #undef RTE_PCI_DEV_ID_DECL_VMXNET3
Signature · 1 line
1.9.1
#70 lore raw

PATCH v3 6/13 vmxnet3: move pci device ids to driver

In reply to David Marchand

Moved vmware device ids macro since the driver had no such information.

---
 drivers/net/vmxnet3/vmxnet3_ethdev.c            |  9 ++++-----
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 16 ----------------
 2 files changed, 4 insertions(+), 21 deletions(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +4 -5
index 375e681..e3cfee4 100644
@@ -100,12 +100,11 @@ static void vmxnet3_process_events(struct vmxnet3_hw *);
 /*
  * The set of PCI devices this driver supports
  */
+#define PCI_VENDOR_ID_VMWARE 0x15AD
+#define VMWARE_DEV_ID_VMXNET3 0x07B0
 static const struct rte_pci_id pci_id_vmxnet3_map[] = {
-
-#define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
-
-{ .vendor_id = 0, /* sentinel */ },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_VMWARE, VMWARE_DEV_ID_VMXNET3) },
+	{ .vendor_id = 0, /* sentinel */ },
 };
 
 static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -16
index 448b5e1..0ecff3c 100644
@@ -88,10 +88,6 @@
  * Note that this file can be included multiple times within the same file.
  */
 
-#ifndef RTE_PCI_DEV_ID_DECL_VMXNET3
-#define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev)
-#endif
-
 #ifndef RTE_PCI_DEV_ID_DECL_ENIC
 #define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev)
 #endif
@@ -104,11 +100,6 @@
 #define RTE_PCI_DEV_ID_DECL_BNX2XVF(vend, dev)
 #endif
 
-#ifndef PCI_VENDOR_ID_VMWARE
-/** Vendor ID used by VMware devices */
-#define PCI_VENDOR_ID_VMWARE 0x15AD
-#endif
-
 #ifndef PCI_VENDOR_ID_CISCO
 /** Vendor ID used by Cisco VIC devices */
 #define PCI_VENDOR_ID_CISCO 0x1137
@@ -119,12 +110,6 @@
 #define PCI_VENDOR_ID_BROADCOM 0x14E4
 #endif
 
-/****************** VMware VMXNET3 devices ******************/
-
-#define VMWARE_DEV_ID_VMXNET3                   0x07B0
-
-RTE_PCI_DEV_ID_DECL_VMXNET3(PCI_VENDOR_ID_VMWARE, VMWARE_DEV_ID_VMXNET3)
-
 /****************** Cisco VIC devices ******************/
 
 #define PCI_DEVICE_ID_CISCO_VIC_ENET         0x0043  /* ethernet vnic */
@@ -183,4 +168,3 @@ RTE_PCI_DEV_ID_DECL_BNX2X(PCI_VENDOR_ID_BROADCOM, BNX2X_DEV_ID_57840_MF)
  */
 #undef RTE_PCI_DEV_ID_DECL_BNX2X
 #undef RTE_PCI_DEV_ID_DECL_BNX2XVF
-#undef RTE_PCI_DEV_ID_DECL_VMXNET3
Signature · 1 line
1.9.1
#71 lore raw

PATCH v3 7/13 enic: move pci device ids to driver

In reply to David Marchand

Moved cisco vendor id since the driver had no such information.

---
 drivers/net/enic/enic_ethdev.c                  | 13 +++++--------
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 17 -----------------
 2 files changed, 5 insertions(+), 25 deletions(-)
drivers/net/enic/enic_ethdev.c +5 -8
index 7539811..0e26aa9 100644
@@ -57,15 +57,12 @@
 /*
  * The set of PCI devices this driver supports
  */
+#define PCI_VENDOR_ID_CISCO 0x1137
 static const struct rte_pci_id pci_id_enic_map[] = {
-#define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#ifndef PCI_VENDOR_ID_CISCO
-#define PCI_VENDOR_ID_CISCO	0x1137
-#endif
-#include "rte_pci_dev_ids.h"
-RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET)
-RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET_VF)
-{.vendor_id = 0, /* Sentinal */},
+	{ 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 */},
 };
 
 static int
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -17
index 0ecff3c..1c22c04 100644
@@ -88,10 +88,6 @@
  * Note that this file can be included multiple times within the same file.
  */
 
-#ifndef RTE_PCI_DEV_ID_DECL_ENIC
-#define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev)
-#endif
-
 #ifndef RTE_PCI_DEV_ID_DECL_BNX2X
 #define RTE_PCI_DEV_ID_DECL_BNX2X(vend, dev)
 #endif
@@ -100,24 +96,11 @@
 #define RTE_PCI_DEV_ID_DECL_BNX2XVF(vend, dev)
 #endif
 
-#ifndef PCI_VENDOR_ID_CISCO
-/** Vendor ID used by Cisco VIC devices */
-#define PCI_VENDOR_ID_CISCO 0x1137
-#endif
-
 #ifndef PCI_VENDOR_ID_BROADCOM
 /** Vendor ID used by Broadcom devices */
 #define PCI_VENDOR_ID_BROADCOM 0x14E4
 #endif
 
-/****************** Cisco VIC devices ******************/
-
-#define PCI_DEVICE_ID_CISCO_VIC_ENET         0x0043  /* ethernet vnic */
-#define PCI_DEVICE_ID_CISCO_VIC_ENET_VF      0x0071  /* enet SRIOV VF */
-
-RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET)
-RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET_VF)
-
 /****************** QLogic devices ******************/
 
 /* Broadcom/QLogic BNX2X */
Signature · 1 line
1.9.1
#72 lore raw

PATCH v3 8/13 bnx2x: move pci device ids to driver

In reply to David Marchand

Reused defines from the driver and moved broadcom vendor id macro.

---
 drivers/net/bnx2x/bnx2x.c                       |  3 +-
 drivers/net/bnx2x/bnx2x_ethdev.c                | 21 +++++++--
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 60 -------------------------
 3 files changed, 18 insertions(+), 66 deletions(-)
drivers/net/bnx2x/bnx2x.c +1 -2
index 6edb2f9..8264a74 100644
@@ -22,7 +22,6 @@
 #include "ecore_init_ops.h"
 
 #include "rte_version.h"
-#include "rte_pci_dev_ids.h"
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -9588,7 +9587,7 @@ void bnx2x_load_firmware(struct bnx2x_softc *sc)
 	int f;
 	struct stat st;
 
-	fwname = sc->devinfo.device_id == BNX2X_DEV_ID_57711
+	fwname = sc->devinfo.device_id == CHIP_NUM_57711
 		? FW_NAME_57711 : FW_NAME_57810;
 	f = open(fwname, O_RDONLY);
 	if (f < 0) {
drivers/net/bnx2x/bnx2x_ethdev.c +17 -4
index ba194b5..06a0add 100644
@@ -16,15 +16,28 @@
 /*
  * The set of PCI devices this driver supports
  */
+#define PCI_VENDOR_ID_BROADCOM 0x14E4
 static struct rte_pci_id pci_id_bnx2x_map[] = {
-#define RTE_PCI_DEV_ID_DECL_BNX2X(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+	{ 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) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57811) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57840_OBS) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57840_4_10) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57840_2_20) },
+#ifdef RTE_LIBRTE_BNX2X_MF_SUPPORT
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57810_MF) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57811_MF) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57840_MF) },
+#endif
 	{ .vendor_id = 0, }
 };
 
 static struct rte_pci_id pci_id_bnx2xvf_map[] = {
-#define RTE_PCI_DEV_ID_DECL_BNX2XVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+	{ 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) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, CHIP_NUM_57840_VF) },
 	{ .vendor_id = 0, }
 };
 
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -60

66 lines not on this page · raw message

Signature · 1 line
1.9.1
#73 lore raw

PATCH v3 9/13 ena: remove unneeded pci macro

In reply to David Marchand

I suppose this is a remnant of rte_pci_dev_ids.h, just remove this.

---
 drivers/net/ena/ena_ethdev.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/net/ena/ena_ethdev.c +3 -5
index 2b60a67..efa5e31 100644
@@ -80,11 +80,9 @@
 #define PCI_DEVICE_ID_ENA_LLQ_VF	0xEC21
 
 static struct rte_pci_id pci_id_ena_map[] = {
-#define RTE_PCI_DEV_ID_DECL_ENA(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-
-	RTE_PCI_DEV_ID_DECL_ENA(PCI_VENDOR_ID_AMAZON, PCI_DEVICE_ID_ENA_VF)
-	RTE_PCI_DEV_ID_DECL_ENA(PCI_VENDOR_ID_AMAZON, PCI_DEVICE_ID_ENA_LLQ_VF)
-	{.device_id = 0},
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_AMAZON, PCI_DEVICE_ID_ENA_VF) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_AMAZON, PCI_DEVICE_ID_ENA_LLQ_VF) },
+	{ .device_id = 0 },
 };
 
 static int ena_device_init(struct ena_com_dev *ena_dev,
Signature · 1 line
1.9.1
#74 lore raw

PATCH v3 10/13 pci: no need for global device ids list

In reply to David Marchand

Now that all pci device ids are in their respective drivers, we can remove this header.

---
 doc/api/doxy-api-index.md                       |  1 -
 lib/librte_eal/common/Makefile                  |  2 +-
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 93 -------------------------
 3 files changed, 1 insertion(+), 95 deletions(-)
 delete mode 100644 lib/librte_eal/common/include/rte_pci_dev_ids.h
doc/api/doxy-api-index.md +0 -1
index f626386..6b0ea11 100644
@@ -45,7 +45,6 @@ There are many libraries, so their headers may be grouped by topics:
   [vhost]              (@ref rte_virtio_net.h),
   [KNI]                (@ref rte_kni.h),
   [PCI]                (@ref rte_pci.h),
-  [PCI IDs]            (@ref rte_pci_dev_ids.h)
 
 - **memory**:
   [memseg]             (@ref rte_memory.h),
lib/librte_eal/common/Makefile +1 -1
index f5ea0ee..bb9810d 100644
@@ -34,7 +34,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 INC := rte_branch_prediction.h rte_common.h
 INC += rte_debug.h rte_eal.h rte_errno.h rte_launch.h rte_lcore.h
 INC += rte_log.h rte_memory.h rte_memzone.h rte_pci.h
-INC += rte_pci_dev_ids.h rte_per_lcore.h rte_random.h
+INC += rte_per_lcore.h rte_random.h
 INC += rte_tailq.h rte_interrupts.h rte_alarm.h
 INC += rte_string_fns.h rte_version.h
 INC += rte_eal_memconfig.h rte_malloc_heap.h
lib/librte_eal/common/include/rte_pci_dev_ids.h deleted +0 -93

93 lines not on this page · raw message

Signature · 1 line
1.9.1
#75 lore raw

PATCH v3 11/13 drivers: constify pci id tables

In reply to 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/ena/ena_ethdev.c           | 2 +-
 drivers/net/nfp/nfp_net.c              | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)
drivers/crypto/qat/rte_qat_cryptodev.c +1 -1
index 54f0c95..bce962f 100644
@@ -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 const struct rte_pci_id pci_id_qat_map[] = {
 		{
 			.vendor_id = 0x8086,
 			.device_id = 0x0443,
drivers/net/bnx2x/bnx2x_ethdev.c +2 -2
index 06a0add..a94b2e2 100644
@@ -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 const struct rte_pci_id 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 const struct rte_pci_id 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) },
drivers/net/cxgbe/cxgbe_ethdev.c +1 -1
index 72b1a7b..919b4b7 100644
@@ -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 const struct rte_pci_id cxgb4_pci_tbl[] = {
 #define CH_PCI_DEVICE_ID_FUNCTION 0x4
 
 #define PCI_VENDOR_ID_CHELSIO 0x1425
drivers/net/ena/ena_ethdev.c +1 -1
index efa5e31..2f53d84 100644
@@ -79,7 +79,7 @@
 #define PCI_DEVICE_ID_ENA_VF	0xEC20
 #define PCI_DEVICE_ID_ENA_LLQ_VF	0xEC21
 
-static struct rte_pci_id pci_id_ena_map[] = {
+static const struct rte_pci_id pci_id_ena_map[] = {
 	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_AMAZON, PCI_DEVICE_ID_ENA_VF) },
 	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_AMAZON, PCI_DEVICE_ID_ENA_LLQ_VF) },
 	{ .device_id = 0 },
drivers/net/nfp/nfp_net.c +1 -1
index baa840e..33256c9 100644
@@ -2455,7 +2455,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
 	return 0;
 }
 
-static struct rte_pci_id pci_id_nfp_net_map[] = {
+static const struct rte_pci_id pci_id_nfp_net_map[] = {
 	{
 		.vendor_id = PCI_VENDOR_ID_NETRONOME,
 		.device_id = PCI_DEVICE_ID_NFP6000_PF_NIC,
Signature · 1 line
1.9.1
#76 lore raw

PATCH v3 12/13 drivers: export pci drivers

In reply to David Marchand
---
 drivers/net/mlx4/mlx4.c                 | 1 +
 drivers/net/mlx5/mlx5.c                 | 1 +
 drivers/net/virtio/virtio_ethdev.c      | 1 +
 lib/librte_eal/common/include/rte_pci.h | 7 +++++++
 4 files changed, 10 insertions(+)
drivers/net/mlx4/mlx4.c +1 -0
index 0c76e72..14fe9dd 100644
@@ -5789,6 +5789,7 @@ static struct eth_driver mlx4_driver = {
 	.dev_private_size = sizeof(struct priv)
 };
 
+RTE_EAL_PCI_DRIVER_EXPORT(mlx4, mlx4_driver.pci_drv);
 RTE_INIT(rte_mlx4_pmd_init);
 static void
 rte_mlx4_pmd_init(void)
drivers/net/mlx5/mlx5.c +1 -0
index f6399fc..975bb3f 100644
@@ -646,6 +646,7 @@ static struct eth_driver mlx5_driver = {
 	.dev_private_size = sizeof(struct priv)
 };
 
+RTE_EAL_PCI_DRIVER_EXPORT(mlx5, mlx5_driver.pci_drv);
 RTE_INIT(rte_mlx5_pmd_init);
 static void
 rte_mlx5_pmd_init(void)
drivers/net/virtio/virtio_ethdev.c +1 -0
index ee95cab..587ba60 100644
@@ -1211,6 +1211,7 @@ static struct eth_driver rte_virtio_pmd = {
 	.dev_private_size = sizeof(struct virtio_hw),
 };
 
+RTE_EAL_PCI_DRIVER_EXPORT(virtio, rte_virtio_pmd.pci_drv);
 RTE_INIT(rte_virtio_pmd_init);
 static void
 rte_virtio_pmd_init(void)
lib/librte_eal/common/include/rte_pci.h +7 -0
index 3bb1833..3095f94 100644
@@ -497,12 +497,19 @@ void rte_eal_pci_dump(FILE *f);
 void rte_eal_pci_register(struct rte_pci_driver *driver);
 
 #define RTE_EAL_PCI_REGISTER(name, d) \
+RTE_EAL_PCI_DRIVER_EXPORT(name, d); \
 RTE_INIT(pciinitfn_ ##name); \
 static void pciinitfn_ ##name(void) \
 { \
 	rte_eal_pci_register(&d); \
 }
 
+#define RTE_EAL_PCI_DRIVER_PREFIX "pcidriver_"
+
+#define RTE_EAL_PCI_DRIVER_EXPORT(name, d) \
+extern const typeof(d) *pcidriver_ ##name; \
+const typeof(d) *pcidriver_ ##name = &d
+
 /**
  * Unregister a PCI driver.
  *
Signature · 1 line
1.9.1
#77 lore raw

PATCH v3 13/13 app: introduce dpdk-obj-info tool

In reply to David Marchand

Export some useful information for startup scripts and debug. For now, only pci drivers are handled.

Example for a static binary:

marchand@gloops:~/git/dpdk$ ./build/app/dpdk-obj-info ./build/app/testpmd
pci:driver=cxgbe,flags=needmapping,lsc
pci:driver=cxgbe,id=vendor=1425,device=5400,subvendor=ffff,subdevice=ffff
pci:driver=cxgbe,id=vendor=1425,device=5401,subvendor=ffff,subdevice=ffff
pci:driver=cxgbe,id=vendor=1425,device=5402,subvendor=ffff,subdevice=ffff

Example for a dso:

marchand@gloops:~/git/dpdk$ ./build/app/dpdk-obj-info ./build/lib/librte_pmd_ixgbe.so
pci:driver=ixgbe,flags=needmapping,lsc,detachable
pci:driver=ixgbe,id=vendor=8086,device=10b6,subvendor=ffff,subdevice=ffff
pci:driver=ixgbe,id=vendor=8086,device=1508,subvendor=ffff,subdevice=ffff
pci:driver=ixgbe,id=vendor=8086,device=10c6,subvendor=ffff,subdevice=ffff
---
 app/Makefile                      |   1 +
 app/dpdk-obj-info/Makefile        |  45 +++++++++
 app/dpdk-obj-info/dpdk-obj-info.c | 188 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 234 insertions(+)
 create mode 100644 app/dpdk-obj-info/Makefile
 create mode 100644 app/dpdk-obj-info/dpdk-obj-info.c
app/Makefile +1 -0
index 1151e09..0461a35 100644
@@ -37,5 +37,6 @@ DIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) += test-pipeline
 DIRS-$(CONFIG_RTE_TEST_PMD) += test-pmd
 DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_test
 DIRS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += proc_info
+DIRS-y += dpdk-obj-info
 
 include $(RTE_SDK)/mk/rte.subdir.mk
app/dpdk-obj-info/Makefile new file +45 -0

45 lines not on this page · raw message

app/dpdk-obj-info/dpdk-obj-info.c new file +188 -0

188 lines not on this page · raw message

Signature · 1 line
1.9.1
#50 lore raw

Re: [PATCH v3 01/13] e1000: move pci device ids to driver

In reply to David Marchand
Quoted 124 lines · David Marchand

test application and kni still want to know e1000 pci devices. So let's create headers in the driver that will be used by them.

I wanted to reuse base/ headers, but because of some headaches trying to resolve macros redefinition collisions in kni (with ixgbe next commit), I left it as is.

---
 app/test/Makefile                               |   3 +
 app/test/test_pci.c                             |   3 +-
 drivers/net/e1000/em_ethdev.c                   |   2 +-
 drivers/net/e1000/em_pci_dev_ids.h              | 208 +++++++++++++++++++
 drivers/net/e1000/igb_ethdev.c                  |   4 +-
 drivers/net/e1000/igb_pci_dev_ids.h             | 165 +++++++++++++++
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 254 ------------------------
 lib/librte_eal/linuxapp/kni/Makefile            |   1 +
 lib/librte_eal/linuxapp/kni/kni_misc.c          |   4 +-
 9 files changed, 384 insertions(+), 260 deletions(-)
 create mode 100644 drivers/net/e1000/em_pci_dev_ids.h
 create mode 100644 drivers/net/e1000/igb_pci_dev_ids.h
app/test/Makefile +3 -0
index a4907d5..8a1f54c 100644
@@ -171,6 +171,9 @@ CFLAGS_test_memcpy_perf.o += -fno-var-tracking-assignments
 endif
 endif
 
+# pci tests want to know some pci devices ids
+CFLAGS_test_pci.o += -I$(RTE_SDK)/drivers/net/e1000
+
 # this application needs libraries first
 DEPDIRS-y += lib drivers
 
app/test/test_pci.c +2 -1
index 0ed357e..7215936 100644
@@ -77,8 +77,9 @@ struct rte_pci_id my_driver_id2[] = {
 
 /* IGB & EM NICS */
 #define RTE_PCI_DEV_ID_DECL_EM(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
+#include <em_pci_dev_ids.h>
 #define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include <rte_pci_dev_ids.h>
+#include <igb_pci_dev_ids.h>
 
 { .vendor_id = 0, /* sentinel */ },
 };
drivers/net/e1000/em_ethdev.c +1 -1
index 1f80c05..203a9e5 100644
@@ -139,7 +139,7 @@ static enum e1000_fc_mode em_fc_setting = e1000_fc_full;
 static const struct rte_pci_id pci_id_em_map[] = {
 
 #define RTE_PCI_DEV_ID_DECL_EM(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+#include "em_pci_dev_ids.h"
 
 {0},
 };
drivers/net/e1000/em_pci_dev_ids.h new file +55 -0
new file mode 100644
index 0000000..736a68e
@@ -0,0 +1,208 @@
+/*-
+ * This file is provided under a dual BSD/GPLv2 license.  When using or
+ *   redistributing this file, you may do so under either license.
+ *
+ *   GPL LICENSE SUMMARY
+ *
+ *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of version 2 of the GNU General Public License as
+ *   published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful, but
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *   General Public License for more details.
+ *
+ *   The full GNU General Public License is included in this distribution
+ *   in the file called LICENSE.GPL.
+ *
+ *   Contact Information:
+ *   Intel Corporation
+ *
+ *   BSD LICENSE
+ *
+ *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   All rights reserved.
+ *
+ *   Redistribution and use in source and binary forms, with or without
+ *   modification, are permitted provided that the following conditions
+ *   are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *     * Neither the name of Intel Corporation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */

drivers/net/e1000/em_pci_dev_ids.h line 65

Quoted 10 lines
drivers/net/e1000/em_pci_dev_ids.h new file +10 -0
+
+#ifndef RTE_PCI_DEV_ID_DECL_EM
+#define RTE_PCI_DEV_ID_DECL_EM(vend, dev)
+#endif
+
+#ifndef PCI_VENDOR_ID_INTEL
+/** Vendor ID used by Intel devices */
+#define PCI_VENDOR_ID_INTEL 0x8086
+#endif
+

This is broken, PCI_VENDOR_ID_INTEL should be defined in a central location for all pci drivers, not redefined in every compilation unit. And you can likely just remvoe the RTE_PCI_DEV_ID_DECL_* macros from each patch and use the RTE_PCI_DEV macro, as all the DECL macros just evaluate to that anyway.

drivers/net/e1000/em_pci_dev_ids.h

Quoted 4 lines

<snip>

drivers/net/e1000/em_pci_dev_ids.h new file +2 -0
+
+#undef RTE_PCI_DEV_ID_DECL_EM

Why are you undefining this here? Is it because its in a header file and you're concerned about multiple inclusion? You should use an ifdef guard instead, or just define all the device id's in the header and ennumerate the pci table in one of the C files for the driver. That should apply to all the patches in this series I think

Neil

#51 lore raw

Re: [PATCH v3 01/13] e1000: move pci device ids to driver

Quoted 11 lines · Neil Horman

drivers/net/e1000/em_pci_dev_ids.h line 65

Quoted 9 lines
drivers/net/e1000/em_pci_dev_ids.h new file +9 -0
+#ifndef RTE_PCI_DEV_ID_DECL_EM
+#define RTE_PCI_DEV_ID_DECL_EM(vend, dev)
+#endif
+
+#ifndef PCI_VENDOR_ID_INTEL
+/** Vendor ID used by Intel devices */
+#define PCI_VENDOR_ID_INTEL 0x8086
+#endif
+

This is broken, PCI_VENDOR_ID_INTEL should be defined in a central location for all pci drivers, not redefined in every compilation unit. And you can likely

Well we can keep the vendors in a common header, but I don't see the benefit.

Quoted 2 lines

just remvoe the RTE_PCI_DEV_ID_DECL_* macros from each patch and use the RTE_PCI_DEV macro, as all the DECL macros just evaluate to that anyway.

app/test/test_pci.c:#define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) {RTE_PCI_DEVICE(vend, dev)}, lib/librte_eal/linuxapp/kni/kni_misc.c: #define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) case (dev):

All this stuff is because of pci tests and kni code.

Quoted 9 lines

Review

Quoted 4 lines

<snip>

(quoted diff) +2 -0
+
+#undef RTE_PCI_DEV_ID_DECL_EM

Why are you undefining this here? Is it because its in a header file and you're concerned about multiple inclusion? You should use an ifdef guard instead, or just define all the device id's in the header and ennumerate the pci table in one of the C files for the driver. That should apply to all the patches in this series I think

Just moved the code.

Signature · 1 line
David Marchand
#52 lore raw

Re: [PATCH v3 01/13] e1000: move pci device ids to driver

Quoted 13 lines · David Marchand
Quoted 11 lines · Neil Horman

drivers/net/e1000/em_pci_dev_ids.h line 65

Quoted 9 lines
drivers/net/e1000/em_pci_dev_ids.h new file +9 -0
+#ifndef RTE_PCI_DEV_ID_DECL_EM
+#define RTE_PCI_DEV_ID_DECL_EM(vend, dev)
+#endif
+
+#ifndef PCI_VENDOR_ID_INTEL
+/** Vendor ID used by Intel devices */
+#define PCI_VENDOR_ID_INTEL 0x8086
+#endif
+

This is broken, PCI_VENDOR_ID_INTEL should be defined in a central location for all pci drivers, not redefined in every compilation unit. And you can likely

Quoted 2 lines

Well we can keep the vendors in a common header, but I don't see the benefit.

?
The fact that you won't have to do this
#ifndef PCI_VENDOR_ID_INTEL
#define PCI_VENDOR_ID_INTEL ...
#endif
in every pmd

Quoted 10 lines
Quoted 2 lines

just remvoe the RTE_PCI_DEV_ID_DECL_* macros from each patch and use the RTE_PCI_DEV macro, as all the DECL macros just evaluate to that anyway.

app/test/test_pci.c:#define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) {RTE_PCI_DEVICE(vend, dev)}, lib/librte_eal/linuxapp/kni/kni_misc.c: #define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) case (dev):

All this stuff is because of pci tests and kni code.

You're going to have to explain a bit further than that. Why does the kni code and pci testing code require that each driver have their own macro that just maps to the same macro underneath? Looking at the test_pci code, it appears its done because we used to contain all our pci device ids in a single file, and the device specific macros were used to selectively enable devices that were there for testing. But the point of this series is in part to separate out the device ids to their own locations, so it seems like you will have to fix up the pci tests anyway (and additionally it would be nice to include more than just EM, IGB, and IXGBE in thsoe tests anyway, though I understand thats outside the scope of this series)

Quoted 10 lines
Quoted 9 lines

Review

Quoted 4 lines

<snip>

(quoted diff) +2 -0
+
+#undef RTE_PCI_DEV_ID_DECL_EM

Why are you undefining this here? Is it because its in a header file and you're concerned about multiple inclusion? You should use an ifdef guard instead, or just define all the device id's in the header and ennumerate the pci table in one of the C files for the driver. That should apply to all the patches in this series I think

Quoted 2 lines

Just moved the code.

Ok, do you plan on cleaning that up?

Neil

Quoted 4 lines
Signature · 2 lines
-- 
David Marchand
#53 lore raw

Re: [PATCH v3 01/13] e1000: move pci device ids to driver

Quoted 14 lines · Neil Horman
Quoted 13 lines · David Marchand
Quoted 11 lines · Neil Horman

drivers/net/e1000/em_pci_dev_ids.h line 65

Quoted 9 lines
drivers/net/e1000/em_pci_dev_ids.h new file +9 -0
+#ifndef RTE_PCI_DEV_ID_DECL_EM
+#define RTE_PCI_DEV_ID_DECL_EM(vend, dev)
+#endif
+
+#ifndef PCI_VENDOR_ID_INTEL
+/** Vendor ID used by Intel devices */
+#define PCI_VENDOR_ID_INTEL 0x8086
+#endif
+

This is broken, PCI_VENDOR_ID_INTEL should be defined in a central location for all pci drivers, not redefined in every compilation unit. And you can likely

Quoted 8 lines
Quoted 2 lines

Well we can keep the vendors in a common header, but I don't see the benefit.

?
The fact that you won't have to do this
#ifndef PCI_VENDOR_ID_INTEL
#define PCI_VENDOR_ID_INTEL ...
#endif
in every pmd

Ok, so you would keep the rte_pci_dev_ids.h with just the vendors in it ?

Or, we could rely on linux kernel headers (pci_ids.h), rather than maintain a header in dpdk.
But this would add a dependency build on dpdk and I am not sure there is something equivalent on freebsd (afaics all drivers seem to duplicate the pci vendor id).
Any freebsd gourou reading this ?

Quoted 10 lines
Quoted 10 lines
Quoted 2 lines

just remvoe the RTE_PCI_DEV_ID_DECL_* macros from each patch and use the RTE_PCI_DEV macro, as all the DECL macros just evaluate to that anyway.

app/test/test_pci.c:#define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) {RTE_PCI_DEVICE(vend, dev)}, lib/librte_eal/linuxapp/kni/kni_misc.c: #define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) case (dev):

All this stuff is because of pci tests and kni code.

Quoted 10 lines

You're going to have to explain a bit further than that. Why does the kni code and pci testing code require that each driver have their own macro that just maps to the same macro underneath? Looking at the test_pci code, it appears its done because we used to contain all our pci device ids in a single file, and the device specific macros were used to selectively enable devices that were there for testing. But the point of this series is in part to separate out the device ids to their own locations, so it seems like you will have to fix up the pci tests anyway (and additionally it would be nice to include more than just EM, IGB, and IXGBE in thsoe tests anyway, though I understand thats outside the scope of this series)

- test_pci.c should be about testing pci infrastructure. Relying on igb / ixgbe (or whatever pci device if we extend the list to all pci ids) being present on the system to run successfully is flawed but I have no better idea.

- kni implements specific ethtool stuff based on pci ids. kni contains duplicated code from the kernel and it uses those ids to drive to the right ops.

The solutions I have imagined so far :
* use a shared header for the devices that it supports
* drop the use of pci ids between kni library and kni kernel driver, instead use the pmd name that would be resolved internally by the kni library at RTE_KNI_IOCTL_CREATE time, and use this in the kni kernel driver
* drop kni :-)

I don't mind doing trivial changes, but I don't have time for more on this series.

Signature · 1 line
David Marchand
#78 lore raw

Re: [PATCH v3 00/13] kill global pci device id list

In reply to David Marchand
Quoted 2 lines · David Marchand

- not storing the pci ids in a dedicated section anymore, pci drivers are exported and parsed by a quickly written (and naive) tool

Rethinking about this, this part won't do.
Stripping symbols breaks it, and I had to go some gymnastics to get the symbols, while having exported information sanitised as strings in a dedicated section constructed at build time would be saner. Yes, this really sounds like modinfo ...

Volunteers ?

Signature · 1 line
David Marchand
#54 lore raw

Re: [PATCH v3 01/13] e1000: move pci device ids to driver

In reply to David Marchand
Quoted 17 lines · David Marchand
Quoted 16 lines · Neil Horman
Quoted 15 lines · David Marchand
Quoted 11 lines · Neil Horman

drivers/net/e1000/em_pci_dev_ids.h line 65

Quoted 9 lines
drivers/net/e1000/em_pci_dev_ids.h new file +9 -0
+#ifndef RTE_PCI_DEV_ID_DECL_EM
+#define RTE_PCI_DEV_ID_DECL_EM(vend, dev)
+#endif
+
+#ifndef PCI_VENDOR_ID_INTEL
+/** Vendor ID used by Intel devices */
+#define PCI_VENDOR_ID_INTEL 0x8086
+#endif
+

This is broken, PCI_VENDOR_ID_INTEL should be defined in a central location for all pci drivers, not redefined in every compilation unit. And you can likely

Well we can keep the vendors in a common header, but I don't see the benefit.

Quoted 9 lines
Quoted 6 lines

?
The fact that you won't have to do this
#ifndef PCI_VENDOR_ID_INTEL
#define PCI_VENDOR_ID_INTEL ...
#endif
in every pmd

Ok, so you would keep the rte_pci_dev_ids.h with just the vendors in it ?

Thats an option, yes, I'd rename it rte_pci_vendor_ids.h perhaps, but you get the idea.

Quoted 2 lines

Or, we could rely on linux kernel headers (pci_ids.h), rather than maintain a header in dpdk.

Thats also a good idea.

Quoted 5 lines

But this would add a dependency build on dpdk and I am not sure there is something equivalent on freebsd (afaics all drivers seem to duplicate the pci vendor id).
Any freebsd gourou reading this ?

If the dependency is unpalitable, I suppose its fine to duplicate the header file. My more direct point was really more just that you didn't need to duplicate the vendor id macro multiple times within the dpdk project. You can still define the device ids internally to each pmd if you don't need it in other locations, and the duplication against other projects there is ok by me.

Quoted 22 lines
Quoted 11 lines
Quoted 11 lines
Quoted 3 lines

just remvoe the RTE_PCI_DEV_ID_DECL_* macros from each patch and use the RTE_PCI_DEV macro, as all the DECL macros just evaluate to that anyway.

app/test/test_pci.c:#define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) {RTE_PCI_DEVICE(vend, dev)}, lib/librte_eal/linuxapp/kni/kni_misc.c: #define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) case (dev):

All this stuff is because of pci tests and kni code.

Quoted 10 lines

You're going to have to explain a bit further than that. Why does the kni code and pci testing code require that each driver have their own macro that just maps to the same macro underneath? Looking at the test_pci code, it appears its done because we used to contain all our pci device ids in a single file, and the device specific macros were used to selectively enable devices that were there for testing. But the point of this series is in part to separate out the device ids to their own locations, so it seems like you will have to fix up the pci tests anyway (and additionally it would be nice to include more than just EM, IGB, and IXGBE in thsoe tests anyway, though I understand thats outside the scope of this series)

Quoted 5 lines

- test_pci.c should be about testing pci infrastructure. Relying on igb / ixgbe (or whatever pci device if we extend the list to all pci ids) being present on the system to run successfully is flawed but I have no better idea.

Ok, so if I'm reading you correctly, you're indicating that test_pci is just there to test the pci common infrastructure code, and happens to use a few well known and supported pci id's (igb and ixgbe) to do that. i.e. theres no need for exhaustive pci device enumeration there, right? If thats the case then you can just create a data structure with the RTE_PCI_DEV macro and stop aliasing it to all the device specific DECL macros, no? My main concern here is really just the needless aliasing of those macros.

Quoted 5 lines

- kni implements specific ethtool stuff based on pci ids. kni contains duplicated code from the kernel and it uses those ids to drive to the right ops.

Ok, but how does that relate to the use of device specific PCI ennumeration values? Looking at the KNI code I see no reason that they are required any longer (or previously were), and if you're going to move them around you may as well clean up the usage at the same time.

Quoted 8 lines

The solutions I have imagined so far :
* use a shared header for the devices that it supports
* drop the use of pci ids between kni library and kni kernel driver, instead use the pmd name that would be resolved internally by the kni library at RTE_KNI_IOCTL_CREATE time, and use this in the kni kernel driver
* drop kni :-)

These all sound good :)

Quoted 3 lines

I don't mind doing trivial changes, but I don't have time for more on this series.

Um, I'm not sure what to say here. The whole point of review is to help improve the code. If you don't have time to do anything non-trivial, Why are we reviewing it?

Neil

Quoted 4 lines
Signature · 2 lines
-- 
David Marchand
#79 lore raw

Re: [PATCH v3 00/13] kill global pci device id list

In reply to David Marchand
Quoted 5 lines · David Marchand
Quoted 2 lines · David Marchand

- not storing the pci ids in a dedicated section anymore, pci drivers are exported and parsed by a quickly written (and naive) tool

Quoted 7 lines

Rethinking about this, this part won't do.
Stripping symbols breaks it, and I had to go some gymnastics to get the symbols, while having exported information sanitised as strings in a dedicated section constructed at build time would be saner. Yes, this really sounds like modinfo ...

Volunteers ?

modinfo (or a tool likes it), requires more gymnastics in the actual code than what we have. It requires the auto-generation of extra c code that gets linked into its own section (which implies the need for a linker script).

Not saying its a bad idea, its a pretty good one, just that its alot of work.

We might be able to do something a bit more simple, perhaps convert the macros to strings that we can extract with a tool? not sure

Neil

Quoted 5 lines
Signature · 2 lines
-- 
David Marchand
#55 lore raw

Re: [PATCH v3 01/13] e1000: move pci device ids to driver

In reply to Neil Horman

2016-04-21 08:08, Neil Horman:

Quoted 7 lines · David Marchand
Quoted 3 lines

I don't mind doing trivial changes, but I don't have time for more on this series.

Um, I'm not sure what to say here. The whole point of review is to help improve the code. If you don't have time to do anything non-trivial, Why are we reviewing it?

Neil, thanks for reviewing.
If David has no time to improve this series, maybe someone else can take over. I don't see any problem to have several authors on the same series.

#56 lore raw

Re: [PATCH v3 01/13] e1000: move pci device ids to driver

Quoted 5 lines · Thomas Monjalon

2016-04-21 08:08, Neil Horman:

Quoted 4 lines · David Marchand
Quoted 3 lines

I don't mind doing trivial changes, but I don't have time for more on this series.

Quoted 8 lines
Quoted 3 lines

Um, I'm not sure what to say here. The whole point of review is to help improve the code. If you don't have time to do anything non-trivial, Why are we reviewing it?

Neil, thanks for reviewing.
If David has no time to improve this series, maybe someone else can take over. I don't see any problem to have several authors on the same series.

Fair point, and yes, I've not done anything toward this goal at all, so I admit some work is better than none. We just can't allow lack of time to be a reason to do something halfway.

#57 lore raw

Re: [PATCH v3 01/13] e1000: move pci device ids to driver

2016-04-22 08:13, Neil Horman:

Quoted 10 lines · Thomas Monjalon
Quoted 9 lines

2016-04-21 08:08, Neil Horman:

Quoted 7 lines · David Marchand
Quoted 3 lines

I don't mind doing trivial changes, but I don't have time for more on this series.

Um, I'm not sure what to say here. The whole point of review is to help improve the code. If you don't have time to do anything non-trivial, Why are we reviewing it?

Quoted 7 lines
Quoted 3 lines

Neil, thanks for reviewing.
If David has no time to improve this series, maybe someone else can take over. I don't see any problem to have several authors on the same series.

Fair point, and yes, I've not done anything toward this goal at all, so I admit some work is better than none. We just can't allow lack of time to be a reason to do something halfway.

Yes we can have steps in patchwork.
But no, it won't be merged until it is complete. Volunteers are welcome to follow-up on this series. Thanks

#65 lore raw

Re: [PATCH v3 02/13] ixgbe: move pci device ids to driver

In reply to David Marchand

Hi, David

For the changes on igb, ixgbe, I saw you create a new header file called **__pci_dev_ids.h to replace the rte_pci_dev_ids.h for each driver. But for the changes on i40e, you didn't do that way.
If you look into the base code, you will find for each Intel NIC, the device ids are defined there, such as ixgbe_type.h; i40e_devid.h; E1000_hw.h.

I'd prefer the way you did in i40e driver. It's clearer and with minor change.

Thanks
Jingjing

Quoted 32 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of David Marchand
Sent: Wednesday, April 20, 2016 8:44 PM
To: [email protected]
Cc: [email protected]; [email protected]; Richardson, Bruce; [email protected]; [email protected]; [email protected]; Zhang, Helin; Ananyev, Konstantin
Subject: [dpdk-dev] [PATCH v3 02/13] ixgbe: move pci device ids to driver

test application and kni still want to know ixgbe pci devices. So let's create a header in the driver that will be used by them.

Same comment as for e1000 driver, we can't reuse base/ headers at the moment because of macros redefinitions nightmare.

---
 app/test-pmd/Makefile                           |   2 +
 app/test-pmd/cmdline.c                          |   2 +-
 app/test/Makefile                               |   1 +
 app/test/test_pci.c                             |   2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c                |   4 +-
 drivers/net/ixgbe/ixgbe_pci_dev_ids.h           | 213
++++++++++++++++++++++++
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 154 -----------------
 lib/librte_eal/linuxapp/kni/Makefile            |   1 +
 lib/librte_eal/linuxapp/kni/kni_misc.c          |   4 +-
 9 files changed, 223 insertions(+), 160 deletions(-)  create mode 100644

drivers/net/ixgbe/ixgbe_pci_dev_ids.h

app/test-pmd/Makefile index renamed from app/test-pmd/Makefile +0 -0

72426f3..a8899b8 100644

#66 lore raw

Re: [PATCH v3 02/13] ixgbe: move pci device ids to driver

Quoted 7 lines · Jingjing

Hi, David

For the changes on igb, ixgbe, I saw you create a new header file called **__pci_dev_ids.h to replace the rte_pci_dev_ids.h for each driver. But for the changes on i40e, you didn't do that way.
If you look into the base code, you will find for each Intel NIC, the device ids are defined there, such as ixgbe_type.h; i40e_devid.h; E1000_hw.h.

I'd prefer the way you did in i40e driver. It's clearer and with minor change.

This is what I wanted to do, but this requires a rework in kni and the pci test.

Signature · 1 line
David Marchand
#58 lore raw

Re: [PATCH v3 01/13] e1000: move pci device ids to driver

In reply to David Marchand

2016-04-20 14:43, David Marchand:

Quoted 2 lines

test application and kni still want to know e1000 pci devices. So let's create headers in the driver that will be used by them.

There is also an usage of ixgbe ID for the broken bypass API.

Sharing those PCI ids outside of the drivers was really a wrong idea. So this a plan to get rid of them:

1/ remove need in PCI autotest (done: http://dpdk.org/commit/1dbba165)
2/ move PCI ids in bnx2x, bnxt, e1000, enic, fm10k, i40e, virtio, vmxnet3 3/ remove KNI ethtool (only igb/ixgbe support)
4/ remove bypass API or move it to ixgbe specific API
5/ move remaining PCI ids in igb and ixgbe drivers

Please driver maintainers, move your PCI ids in your drivers as soon as possible. Thanks

#59 lore raw

Re: [PATCH v3 01/13] e1000: move pci device ids to driver

Quoted 9 lines · Thomas Monjalon

2016-04-20 14:43, David Marchand:

Quoted 2 lines

test application and kni still want to know e1000 pci devices. So let's create headers in the driver that will be used by them.

There is also an usage of ixgbe ID for the broken bypass API.

Sharing those PCI ids outside of the drivers was really a wrong idea. So this a plan to get rid of them:

Quoted 8 lines

1/ remove need in PCI autotest (done: http://dpdk.org/commit/1dbba165)
2/ move PCI ids in bnx2x, bnxt, e1000, enic, fm10k, i40e, virtio, vmxnet3 3/ remove KNI ethtool (only igb/ixgbe support)
4/ remove bypass API or move it to ixgbe specific API
5/ move remaining PCI ids in igb and ixgbe drivers

Please driver maintainers, move your PCI ids in your drivers as soon as possible. Thanks

Hi Thomas,

I'm not quite sure I understood it well: are you asking us to resend what David has already send, say me for resending the virtio part?

If so, what's the point of that? What's worse, it's likely to fail apply (due to conflicts), as every one of us make a patch based on the same base while touching some same files.

	--yliu
#60 lore raw

Re: [PATCH v3 01/13] e1000: move pci device ids to driver

2016-07-11 13:33, Yuanhan Liu:

Quoted 19 lines · Thomas Monjalon
Quoted 9 lines

2016-04-20 14:43, David Marchand:

Quoted 2 lines

test application and kni still want to know e1000 pci devices. So let's create headers in the driver that will be used by them.

There is also an usage of ixgbe ID for the broken bypass API.

Sharing those PCI ids outside of the drivers was really a wrong idea. So this a plan to get rid of them:

Quoted 8 lines

1/ remove need in PCI autotest (done: http://dpdk.org/commit/1dbba165)
2/ move PCI ids in bnx2x, bnxt, e1000, enic, fm10k, i40e, virtio, vmxnet3 3/ remove KNI ethtool (only igb/ixgbe support)
4/ remove bypass API or move it to ixgbe specific API
5/ move remaining PCI ids in igb and ixgbe drivers

Please driver maintainers, move your PCI ids in your drivers as soon as possible. Thanks

Quoted 8 lines

Hi Thomas,

I'm not quite sure I understood it well: are you asking us to resend what David has already send, say me for resending the virtio part?

If so, what's the point of that? What's worse, it's likely to fail apply (due to conflicts), as every one of us make a patch based on the same base while touching some same files.

Good point.
There were some changes since the patches from David (and a new bnxt). That's why I was thinking to ask maintainers to take care of this change. But maybe it's better to do the change in one patchset. David, ok to refresh these patches?

#61 lore raw

Re: [PATCH v3 01/13] e1000: move pci device ids to driver

Quoted 25 lines · Thomas Monjalon

2016-07-11 13:33, Yuanhan Liu:

Quoted 24 lines · Thomas Monjalon
Quoted 9 lines

2016-04-20 14:43, David Marchand:

Quoted 2 lines

test application and kni still want to know e1000 pci devices. So let's create headers in the driver that will be used by them.

There is also an usage of ixgbe ID for the broken bypass API.

Sharing those PCI ids outside of the drivers was really a wrong idea. So this a plan to get rid of them:

Quoted 8 lines

1/ remove need in PCI autotest (done: http://dpdk.org/commit/1dbba165)
2/ move PCI ids in bnx2x, bnxt, e1000, enic, fm10k, i40e, virtio, vmxnet3 3/ remove KNI ethtool (only igb/ixgbe support)
4/ remove bypass API or move it to ixgbe specific API
5/ move remaining PCI ids in igb and ixgbe drivers

Please driver maintainers, move your PCI ids in your drivers as soon as possible. Thanks

Hi Thomas,

I'm not quite sure I understood it well: are you asking us to resend what David has already send, say me for resending the virtio part?

Quoted 8 lines
Quoted 3 lines

If so, what's the point of that? What's worse, it's likely to fail apply (due to conflicts), as every one of us make a patch based on the same base while touching some same files.

Good point.
There were some changes since the patches from David (and a new bnxt). That's why I was thinking to ask maintainers to take care of this change. But maybe it's better to do the change in one patchset.

Yes, I'd think so.

	--yliu
Quoted 1 line

David, ok to refresh these patches?

#62 lore raw

Re: [PATCH v3 01/13] e1000: move pci device ids to driver

In reply to Thomas Monjalon

Hello all,

Quoted 8 lines · Thomas Monjalon

2016-07-11 13:33, Yuanhan Liu:

Quoted 6 lines

I'm not quite sure I understood it well: are you asking us to resend what David has already send, say me for resending the virtio part?

If so, what's the point of that? What's worse, it's likely to fail apply (due to conflicts), as every one of us make a patch based on the same base while touching some same files.

Quoted 5 lines

Good point.
There were some changes since the patches from David (and a new bnxt). That's why I was thinking to ask maintainers to take care of this change. But maybe it's better to do the change in one patchset. David, ok to refresh these patches?

Now that we have a modinfo-like infra and the test code is exempt from igb pci ids, all that remains (to fully get rid of this header) are bypass api and kni/ethtool.
So the deal with Thomas is that I refresh those patches letting igb and ixgbe pmd as is.

Will send this later.

Signature · 1 line
David Marchand
Acked-by
#63 lore raw

Re: [PATCH v3 01/13] e1000: move pci device ids to driver

Quoted 18 lines · David Marchand

Hello all,

Quoted 8 lines · Thomas Monjalon

2016-07-11 13:33, Yuanhan Liu:

Quoted 6 lines

I'm not quite sure I understood it well: are you asking us to resend what David has already send, say me for resending the virtio part?

If so, what's the point of that? What's worse, it's likely to fail apply (due to conflicts), as every one of us make a patch based on the same base while touching some same files.

Quoted 5 lines

Good point.
There were some changes since the patches from David (and a new bnxt). That's why I was thinking to ask maintainers to take care of this change. But maybe it's better to do the change in one patchset. David, ok to refresh these patches?

Quoted 7 lines

Now that we have a modinfo-like infra and the test code is exempt from igb pci ids, all that remains (to fully get rid of this header) are bypass api and kni/ethtool.
So the deal with Thomas is that I refresh those patches letting igb and ixgbe pmd as is.

Will send this later.

Thanks, and feel free to put my ack for the virtio part.

Great work, BTW!

	--yliu
#80 lore raw

v4 cover kill global pci device id list (almost)

In reply to David Marchand

With the introduction of pmdinfo by Neil, we have almost everything in place to get rid of the pci devices in eal.

We still have some ties with some pmds for functionalities like kni/ethtool or ixgbe bypass api, so the plan has switched to touch all pmds but those igb and ixgbe drivers.

Since we still need rte_pci_dev_ids.h for those drivers, I just stripped the doxygen parts to stop referencing it in the documentation.

I have validated this patchset by comparing the pmdinfo outputs and just noticed a difference for enic (where the pci ids were registered twice before).
Yet, please maintainers review carefully.

Thanks.

Changes since v3:
- dropped my approach at extracting informations from binaries
- let igb{,vf} and ixgbe{,vf} untouched
- rebased on HEAD
- added bnxt

Changes since v2:
- rebased on HEAD
- ena driver has been aligned
- this patchset now depends on [1] as it avoids touching all drivers this way
- not storing the pci ids in a dedicated section anymore, pci drivers are exported and parsed by a quickly written (and naive) tool

Changes since v1:
- indent fixes in i40e, fm10k, virtio, vmxnet3, enic, bnx2x.
- rebased on head (ixgbe update)
- removed doc update (will be sent separately)

[1]: http://dpdk.org/ml/archives/dev/2016-April/037686.html

Signature · 32 lines
David Marchand

David Marchand (10):
  eal: remove PCI device ids header from doxygen
  net/e1000: move em PCI device ids to the driver
  net/i40e: move PCI device ids to the driver
  net/fm10k: move PCI device ids to the driver
  net/virtio: move PCI device ids to the driver
  net/vmxnet3: move PCI device ids to the driver
  net/enic: move PCI device ids to the driver
  net/bnx2x: move PCI device ids to the driver
  net/bnxt: move PCI device ids to the driver
  net/ena: remove unneeded pci macro

 doc/api/doxy-api-index.md                       |   1 -
 drivers/net/bnx2x/bnx2x.c                       |   3 +-
 drivers/net/bnx2x/bnx2x_ethdev.c                |  21 +-
 drivers/net/bnxt/bnxt_ethdev.c                  |  27 +-
 drivers/net/e1000/e1000_ethdev.h                |   2 +
 drivers/net/e1000/em_ethdev.c                   |  37 ++-
 drivers/net/ena/ena_ethdev.c                    |   7 +-
 drivers/net/enic/enic_ethdev.c                  |  12 +-
 drivers/net/fm10k/fm10k_ethdev.c                |   6 +-
 drivers/net/i40e/i40e_ethdev.c                  |  25 +-
 drivers/net/i40e/i40e_ethdev_vf.c               |   9 +-
 drivers/net/virtio/virtio_ethdev.c              |   7 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c            |   9 +-
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 420 ------------------------
 14 files changed, 120 insertions(+), 466 deletions(-)

-- 
1.9.1
#81 lore raw

PATCH v4 1/10 eal: remove PCI device ids header from doxygen

This file is going to disappear, remove the doxygen parts that reference various drivers and remove it from the doxygen index.

---
 doc/api/doxy-api-index.md                       |  1 -
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 40 -------------------------
 2 files changed, 41 deletions(-)
doc/api/doxy-api-index.md +0 -1
index 5e7f024..2284a53 100644
@@ -45,7 +45,6 @@ There are many libraries, so their headers may be grouped by topics:
   [vhost]              (@ref rte_virtio_net.h),
   [KNI]                (@ref rte_kni.h),
   [PCI]                (@ref rte_pci.h),
-  [PCI IDs]            (@ref rte_pci_dev_ids.h)
 
 - **memory**:
   [memseg]             (@ref rte_memory.h),
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -40
index af39fbb..ecb877c 100644
@@ -57,46 +57,6 @@
  *
  */
 
-/**
- * @file
- *
- * This file contains a list of the PCI device IDs recognised by DPDK, which
- * can be used to fill out an array of structures describing the devices.
- *
- * Currently five families of devices are recognised: those supported by the
- * IGB driver, by EM driver, those supported by the IXGBE driver, those
- * supported by the BNXT driver, and by virtio driver which is a para
- * virtualization driver running in guest virtual machine. The inclusion of
- * these in an array built using this file depends on the definition of
- * RTE_PCI_DEV_ID_DECL_BNXT
- * RTE_PCI_DEV_ID_DECL_EM
- * RTE_PCI_DEV_ID_DECL_IGB
- * RTE_PCI_DEV_ID_DECL_IGBVF
- * RTE_PCI_DEV_ID_DECL_IXGBE
- * RTE_PCI_DEV_ID_DECL_IXGBEVF
- * RTE_PCI_DEV_ID_DECL_I40E
- * RTE_PCI_DEV_ID_DECL_I40EVF
- * RTE_PCI_DEV_ID_DECL_VIRTIO
- * at the time when this file is included.
- *
- * In order to populate an array, the user of this file must define this macro:
- * RTE_PCI_DEV_ID_DECL_IXGBE(vendorID, deviceID). For example:
- *
- * @code
- * struct device {
- *     int vend;
- *     int dev;
- * };
- *
- * struct device devices[] = {
- * #define RTE_PCI_DEV_ID_DECL_IXGBE(vendorID, deviceID) {vend, dev},
- * #include <rte_pci_dev_ids.h>
- * };
- * @endcode
- *
- * Note that this file can be included multiple times within the same file.
- */
-
 #ifndef RTE_PCI_DEV_ID_DECL_EM
 #define RTE_PCI_DEV_ID_DECL_EM(vend, dev)
 #endif
Signature · 1 line
1.9.1
#82 lore raw

PATCH v4 2/10 net/e1000: move em PCI device ids to the driver

In reply to David Marchand

Reused defines from the driver and added a Intel vendor id macro for use by igb later.
Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff.

igb/igbvf is left as is, waiting for kni/ethtool cleanup.

---
Changes since v3:
- dropped all but em pci device ids

---
 drivers/net/e1000/e1000_ethdev.h                |   2 +
 drivers/net/e1000/em_ethdev.c                   |  37 +++++-
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 148 ------------------------
 3 files changed, 34 insertions(+), 153 deletions(-)
drivers/net/e1000/e1000_ethdev.h +2 -0
index e8bf8da..6c25c8d 100644
@@ -35,6 +35,8 @@
 #define _E1000_ETHDEV_H_
 #include <rte_time.h>
 
+#define E1000_INTEL_VENDOR_ID 0x8086
+
 /* need update link, bit flag */
 #define E1000_FLAG_NEED_LINK_UPDATE (uint32_t)(1 << 0)
 #define E1000_FLAG_MAILBOX          (uint32_t)(1 << 1)
drivers/net/e1000/em_ethdev.c +32 -5
index 4de5eb2..ad104ed 100644
@@ -137,11 +137,38 @@ 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[] = {
-
-#define RTE_PCI_DEV_ID_DECL_EM(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
-
-{0},
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82540EM) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82545EM_COPPER) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82545EM_FIBER) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82546EB_COPPER) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82546EB_FIBER) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82546EB_QUAD_COPPER) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82571EB_COPPER) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82571EB_FIBER) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82571EB_SERDES) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82571EB_SERDES_DUAL) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82571EB_SERDES_QUAD) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82571EB_QUAD_COPPER) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82571PT_QUAD_COPPER) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82571EB_QUAD_FIBER) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82571EB_QUAD_COPPER_LP) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82572EI_COPPER) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82572EI_FIBER) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82572EI_SERDES) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82572EI) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82573L) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82574L) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82574LA) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82583V) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_LPT_I217_LM) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_LPT_I217_V) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_LPTLP_I218_LM) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_LPTLP_I218_V) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_I218_LM2) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_I218_V2) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_I218_LM3) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_I218_V3) },
+	{ .vendor_id = 0, /* sentinel */ },
 };
 
 static const struct eth_dev_ops eth_em_ops = {
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -148

166 lines not on this page · raw message

Signature · 1 line
1.9.1
#83 lore raw

PATCH v4 3/10 net/i40e: move PCI device ids to the driver

In reply to David Marchand

Reused defines from the driver.
Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff.

---
Changes since v3
- added new pci ids from HEAD

---
 drivers/net/i40e/i40e_ethdev.c                  | 25 +++++++--
 drivers/net/i40e/i40e_ethdev_vf.c               |  9 ++--
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 70 -------------------------
 3 files changed, 28 insertions(+), 76 deletions(-)
drivers/net/i40e/i40e_ethdev.c +22 -3
index 31c2e11..daac236 100644
@@ -454,9 +454,28 @@ static void i40e_set_default_mac_addr(struct rte_eth_dev *dev,
 static int i40e_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);
 
 static const struct rte_pci_id pci_id_i40e_map[] = {
-#define RTE_PCI_DEV_ID_DECL_I40E(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
-{ .vendor_id = 0, /* sentinel */ },
+	{ 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_B) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_C) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_A) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_B) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_C) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_20G_KR2) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_20G_KR2_A) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T4) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_25G_B) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_25G_SFP28) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_X722_A0) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_X722) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_X722) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_X722) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_1G_BASE_T_X722) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T_X722) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_I_X722) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_I_X722) },
+	{ .vendor_id = 0, /* sentinel */ },
 };
 
 static const struct eth_dev_ops i40e_eth_dev_ops = {
drivers/net/i40e/i40e_ethdev_vf.c +6 -3
index 31547db..a616ae0 100644
@@ -1110,9 +1110,12 @@ i40evf_get_link_status(struct rte_eth_dev *dev, struct rte_eth_link *link)
 }
 
 static const struct rte_pci_id pci_id_i40evf_map[] = {
-#define RTE_PCI_DEV_ID_DECL_I40EVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
-{ .vendor_id = 0, /* sentinel */ },
+	{ 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_A0_VF) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_X722_VF) },
+	{ RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_X722_VF_HV) },
+	{ .vendor_id = 0, /* sentinel */ },
 };
 
 static inline int
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -70

94 lines not on this page · raw message

Signature · 1 line
1.9.1
#84 lore raw

PATCH v4 4/10 net/fm10k: move PCI device ids to the driver

In reply to David Marchand

Reused defines from the driver.
Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff.

---
 drivers/net/fm10k/fm10k_ethdev.c                |  6 +++---
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 24 ------------------------
 2 files changed, 3 insertions(+), 27 deletions(-)
drivers/net/fm10k/fm10k_ethdev.c +3 -3
index 66be9c6..217853f 100644
@@ -3049,9 +3049,9 @@ eth_fm10k_dev_uninit(struct rte_eth_dev *dev)
  * and SRIOV-VF devices.
  */
 static const struct rte_pci_id pci_id_fm10k_map[] = {
-#define RTE_PCI_DEV_ID_DECL_FM10K(vend, dev) { RTE_PCI_DEVICE(vend, dev) },
-#define RTE_PCI_DEV_ID_DECL_FM10KVF(vend, dev) { RTE_PCI_DEVICE(vend, dev) },
-#include "rte_pci_dev_ids.h"
+	{ 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) },
 	{ .vendor_id = 0, /* sentinel */ },
 };
 
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -24
index 30fcdee..9e97d7c 100644
@@ -81,14 +81,6 @@
 #define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev)
 #endif
 
-#ifndef RTE_PCI_DEV_ID_DECL_FM10K
-#define RTE_PCI_DEV_ID_DECL_FM10K(vend, dev)
-#endif
-
-#ifndef RTE_PCI_DEV_ID_DECL_FM10KVF
-#define RTE_PCI_DEV_ID_DECL_FM10KVF(vend, dev)
-#endif
-
 #ifndef RTE_PCI_DEV_ID_DECL_ENIC
 #define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev)
 #endif
@@ -333,14 +325,6 @@ RTE_PCI_DEV_ID_DECL_IXGBE(PCI_VENDOR_ID_INTEL, IXGBE_DEV_ID_X550EM_X_KR)
 RTE_PCI_DEV_ID_DECL_IXGBE(PCI_VENDOR_ID_INTEL, IXGBE_DEV_ID_82599_BYPASS)
 #endif
 
-/*************** Physical FM10K devices from fm10k_type.h ***************/
-
-#define FM10K_DEV_ID_PF                   0x15A4
-#define FM10K_DEV_ID_SDI_FM10420_QDA2     0x15D0
-
-RTE_PCI_DEV_ID_DECL_FM10K(PCI_VENDOR_ID_INTEL, FM10K_DEV_ID_PF)
-RTE_PCI_DEV_ID_DECL_FM10K(PCI_VENDOR_ID_INTEL, FM10K_DEV_ID_SDI_FM10420_QDA2)
-
 /****************** Virtual IGB devices from e1000_hw.h ******************/
 
 #define E1000_DEV_ID_82576_VF                   0x10CA
@@ -389,12 +373,6 @@ RTE_PCI_DEV_ID_DECL_VIRTIO(PCI_VENDOR_ID_QUMRANET, QUMRANET_DEV_ID_VIRTIO)
 
 RTE_PCI_DEV_ID_DECL_VMXNET3(PCI_VENDOR_ID_VMWARE, VMWARE_DEV_ID_VMXNET3)
 
-/*************** Virtual FM10K devices from fm10k_type.h ***************/
-
-#define FM10K_DEV_ID_VF                   0x15A5
-
-RTE_PCI_DEV_ID_DECL_FM10KVF(PCI_VENDOR_ID_INTEL, FM10K_DEV_ID_VF)
-
 /****************** Cisco VIC devices ******************/
 
 #define PCI_DEVICE_ID_CISCO_VIC_ENET         0x0043  /* ethernet vnic */
@@ -483,6 +461,4 @@ RTE_PCI_DEV_ID_DECL_BNXT(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57314)
 #undef RTE_PCI_DEV_ID_DECL_IXGBEVF
 #undef RTE_PCI_DEV_ID_DECL_VIRTIO
 #undef RTE_PCI_DEV_ID_DECL_VMXNET3
-#undef RTE_PCI_DEV_ID_DECL_FM10K
-#undef RTE_PCI_DEV_ID_DECL_FM10KVF
 #undef RTE_PCI_DEV_ID_DECL_BNXT
Signature · 1 line
1.9.1
#85 lore raw

PATCH v4 5/10 net/virtio: move PCI device ids to the driver

In reply to David Marchand

Reused defines from the driver.
Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff.

---
 drivers/net/virtio/virtio_ethdev.c              |  7 ++-----
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 16 ----------------
 2 files changed, 2 insertions(+), 21 deletions(-)
drivers/net/virtio/virtio_ethdev.c +2 -5
index 8467b3c..850e3ba 100644
@@ -103,11 +103,8 @@ 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[] = {
-
-#define RTE_PCI_DEV_ID_DECL_VIRTIO(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
-
-{ .vendor_id = 0, /* sentinel */ },
+	{ RTE_PCI_DEVICE(VIRTIO_PCI_VENDORID, VIRTIO_PCI_DEVICEID_MIN) },
+	{ .vendor_id = 0, /* sentinel */ },
 };
 
 struct rte_virtio_xstats_name_off {
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -16
index 9e97d7c..1c66784 100644
@@ -73,10 +73,6 @@
 #define RTE_PCI_DEV_ID_DECL_IXGBEVF(vend, dev)
 #endif
 
-#ifndef RTE_PCI_DEV_ID_DECL_VIRTIO
-#define RTE_PCI_DEV_ID_DECL_VIRTIO(vend, dev)
-#endif
-
 #ifndef RTE_PCI_DEV_ID_DECL_VMXNET3
 #define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev)
 #endif
@@ -102,11 +98,6 @@
 #define PCI_VENDOR_ID_INTEL 0x8086
 #endif
 
-#ifndef PCI_VENDOR_ID_QUMRANET
-/** Vendor ID used by virtio devices */
-#define PCI_VENDOR_ID_QUMRANET 0x1AF4
-#endif
-
 #ifndef PCI_VENDOR_ID_VMWARE
 /** Vendor ID used by VMware devices */
 #define PCI_VENDOR_ID_VMWARE 0x15AD
@@ -361,12 +352,6 @@ RTE_PCI_DEV_ID_DECL_IXGBEVF(PCI_VENDOR_ID_INTEL, IXGBE_DEV_ID_X550EM_A_VF_HV)
 RTE_PCI_DEV_ID_DECL_IXGBEVF(PCI_VENDOR_ID_INTEL, IXGBE_DEV_ID_X550EM_X_VF)
 RTE_PCI_DEV_ID_DECL_IXGBEVF(PCI_VENDOR_ID_INTEL, IXGBE_DEV_ID_X550EM_X_VF_HV)
 
-/****************** Virtio devices from virtio.h ******************/
-
-#define QUMRANET_DEV_ID_VIRTIO                  0x1000
-
-RTE_PCI_DEV_ID_DECL_VIRTIO(PCI_VENDOR_ID_QUMRANET, QUMRANET_DEV_ID_VIRTIO)
-
 /****************** VMware VMXNET3 devices ******************/
 
 #define VMWARE_DEV_ID_VMXNET3                   0x07B0
@@ -459,6 +444,5 @@ RTE_PCI_DEV_ID_DECL_BNXT(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57314)
 #undef RTE_PCI_DEV_ID_DECL_IGBVF
 #undef RTE_PCI_DEV_ID_DECL_IXGBE
 #undef RTE_PCI_DEV_ID_DECL_IXGBEVF
-#undef RTE_PCI_DEV_ID_DECL_VIRTIO
 #undef RTE_PCI_DEV_ID_DECL_VMXNET3
 #undef RTE_PCI_DEV_ID_DECL_BNXT
Signature · 1 line
1.9.1
#86 lore raw

PATCH v4 6/10 net/vmxnet3: move PCI device ids to the driver

In reply to David Marchand

Moved vmware device ids macro since the driver had no such information. Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff.

---
 drivers/net/vmxnet3/vmxnet3_ethdev.c            |  9 ++++-----
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 16 ----------------
 2 files changed, 4 insertions(+), 21 deletions(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +4 -5
index 8da4449..5874215 100644
@@ -100,12 +100,11 @@ static void vmxnet3_process_events(struct vmxnet3_hw *);
 /*
  * The set of PCI devices this driver supports
  */
+#define VMWARE_PCI_VENDOR_ID 0x15AD
+#define VMWARE_DEV_ID_VMXNET3 0x07B0
 static const struct rte_pci_id pci_id_vmxnet3_map[] = {
-
-#define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
-
-{ .vendor_id = 0, /* sentinel */ },
+	{ RTE_PCI_DEVICE(VMWARE_PCI_VENDOR_ID, VMWARE_DEV_ID_VMXNET3) },
+	{ .vendor_id = 0, /* sentinel */ },
 };
 
 static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -16
index 1c66784..a4aba6d 100644
@@ -73,10 +73,6 @@
 #define RTE_PCI_DEV_ID_DECL_IXGBEVF(vend, dev)
 #endif
 
-#ifndef RTE_PCI_DEV_ID_DECL_VMXNET3
-#define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev)
-#endif
-
 #ifndef RTE_PCI_DEV_ID_DECL_ENIC
 #define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev)
 #endif
@@ -98,11 +94,6 @@
 #define PCI_VENDOR_ID_INTEL 0x8086
 #endif
 
-#ifndef PCI_VENDOR_ID_VMWARE
-/** Vendor ID used by VMware devices */
-#define PCI_VENDOR_ID_VMWARE 0x15AD
-#endif
-
 #ifndef PCI_VENDOR_ID_CISCO
 /** Vendor ID used by Cisco VIC devices */
 #define PCI_VENDOR_ID_CISCO 0x1137
@@ -352,12 +343,6 @@ RTE_PCI_DEV_ID_DECL_IXGBEVF(PCI_VENDOR_ID_INTEL, IXGBE_DEV_ID_X550EM_A_VF_HV)
 RTE_PCI_DEV_ID_DECL_IXGBEVF(PCI_VENDOR_ID_INTEL, IXGBE_DEV_ID_X550EM_X_VF)
 RTE_PCI_DEV_ID_DECL_IXGBEVF(PCI_VENDOR_ID_INTEL, IXGBE_DEV_ID_X550EM_X_VF_HV)
 
-/****************** VMware VMXNET3 devices ******************/
-
-#define VMWARE_DEV_ID_VMXNET3                   0x07B0
-
-RTE_PCI_DEV_ID_DECL_VMXNET3(PCI_VENDOR_ID_VMWARE, VMWARE_DEV_ID_VMXNET3)
-
 /****************** Cisco VIC devices ******************/
 
 #define PCI_DEVICE_ID_CISCO_VIC_ENET         0x0043  /* ethernet vnic */
@@ -444,5 +429,4 @@ RTE_PCI_DEV_ID_DECL_BNXT(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57314)
 #undef RTE_PCI_DEV_ID_DECL_IGBVF
 #undef RTE_PCI_DEV_ID_DECL_IXGBE
 #undef RTE_PCI_DEV_ID_DECL_IXGBEVF
-#undef RTE_PCI_DEV_ID_DECL_VMXNET3
 #undef RTE_PCI_DEV_ID_DECL_BNXT
Signature · 1 line
1.9.1
#87 lore raw

PATCH v4 7/10 net/enic: move PCI device ids to the driver

In reply to David Marchand

Moved cisco vendor id since the driver had no such information. Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff.

---
 drivers/net/enic/enic_ethdev.c                  | 12 ++++--------
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 17 -----------------
 2 files changed, 4 insertions(+), 25 deletions(-)
drivers/net/enic/enic_ethdev.c +4 -8
index 633e431..3c87b49 100644
@@ -57,15 +57,11 @@
 /*
  * The set of PCI devices this driver supports
  */
+#define CISCO_PCI_VENDOR_ID 0x1137
 static const struct rte_pci_id pci_id_enic_map[] = {
-#define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#ifndef PCI_VENDOR_ID_CISCO
-#define PCI_VENDOR_ID_CISCO	0x1137
-#endif
-#include "rte_pci_dev_ids.h"
-RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET)
-RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET_VF)
-{.vendor_id = 0, /* Sentinal */},
+	{ RTE_PCI_DEVICE(CISCO_PCI_VENDOR_ID, PCI_DEVICE_ID_CISCO_VIC_ENET) },
+	{ RTE_PCI_DEVICE(CISCO_PCI_VENDOR_ID, PCI_DEVICE_ID_CISCO_VIC_ENET_VF) },
+	{.vendor_id = 0, /* sentinel */},
 };
 
 static int
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -17
index a4aba6d..ef85d08 100644
@@ -73,10 +73,6 @@
 #define RTE_PCI_DEV_ID_DECL_IXGBEVF(vend, dev)
 #endif
 
-#ifndef RTE_PCI_DEV_ID_DECL_ENIC
-#define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev)
-#endif
-
 #ifndef RTE_PCI_DEV_ID_DECL_BNX2X
 #define RTE_PCI_DEV_ID_DECL_BNX2X(vend, dev)
 #endif
@@ -94,11 +90,6 @@
 #define PCI_VENDOR_ID_INTEL 0x8086
 #endif
 
-#ifndef PCI_VENDOR_ID_CISCO
-/** Vendor ID used by Cisco VIC devices */
-#define PCI_VENDOR_ID_CISCO 0x1137
-#endif
-
 #ifndef PCI_VENDOR_ID_BROADCOM
 /** Vendor ID used by Broadcom devices */
 #define PCI_VENDOR_ID_BROADCOM 0x14E4
@@ -343,14 +334,6 @@ RTE_PCI_DEV_ID_DECL_IXGBEVF(PCI_VENDOR_ID_INTEL, IXGBE_DEV_ID_X550EM_A_VF_HV)
 RTE_PCI_DEV_ID_DECL_IXGBEVF(PCI_VENDOR_ID_INTEL, IXGBE_DEV_ID_X550EM_X_VF)
 RTE_PCI_DEV_ID_DECL_IXGBEVF(PCI_VENDOR_ID_INTEL, IXGBE_DEV_ID_X550EM_X_VF_HV)
 
-/****************** Cisco VIC devices ******************/
-
-#define PCI_DEVICE_ID_CISCO_VIC_ENET         0x0043  /* ethernet vnic */
-#define PCI_DEVICE_ID_CISCO_VIC_ENET_VF      0x0071  /* enet SRIOV VF */
-
-RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET)
-RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET_VF)
-
 /****************** QLogic devices ******************/
 
 /* Broadcom/QLogic BNX2X */
Signature · 1 line
1.9.1
#88 lore raw

PATCH v4 8/10 net/bnx2x: move PCI device ids to the driver

In reply to David Marchand

Reused defines from the driver and moved broadcom vendor id macro. Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff.

---
 drivers/net/bnx2x/bnx2x.c                       |  3 +-
 drivers/net/bnx2x/bnx2x_ethdev.c                | 21 ++++++++--
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 55 -------------------------
 3 files changed, 18 insertions(+), 61 deletions(-)
drivers/net/bnx2x/bnx2x.c +1 -2
index 10859c1..95fbad8 100644
@@ -22,7 +22,6 @@
 #include "ecore_init_ops.h"
 
 #include "rte_version.h"
-#include "rte_pci_dev_ids.h"
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -9572,7 +9571,7 @@ void bnx2x_load_firmware(struct bnx2x_softc *sc)
 	int f;
 	struct stat st;
 
-	fwname = sc->devinfo.device_id == BNX2X_DEV_ID_57711
+	fwname = sc->devinfo.device_id == CHIP_NUM_57711
 		? FW_NAME_57711 : FW_NAME_57810;
 	f = open(fwname, O_RDONLY);
 	if (f < 0) {
drivers/net/bnx2x/bnx2x_ethdev.c +17 -4
index 84c9662..c8d2bf2 100644
@@ -16,15 +16,28 @@
 /*
  * The set of PCI devices this driver supports
  */
+#define BROADCOM_PCI_VENDOR_ID 0x14E4
 static struct rte_pci_id pci_id_bnx2x_map[] = {
-#define RTE_PCI_DEV_ID_DECL_BNX2X(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+	{ RTE_PCI_DEVICE(BROADCOM_PCI_VENDOR_ID, CHIP_NUM_57800) },
+	{ RTE_PCI_DEVICE(BROADCOM_PCI_VENDOR_ID, CHIP_NUM_57711) },
+	{ RTE_PCI_DEVICE(BROADCOM_PCI_VENDOR_ID, CHIP_NUM_57810) },
+	{ RTE_PCI_DEVICE(BROADCOM_PCI_VENDOR_ID, CHIP_NUM_57811) },
+	{ RTE_PCI_DEVICE(BROADCOM_PCI_VENDOR_ID, CHIP_NUM_57840_OBS) },
+	{ RTE_PCI_DEVICE(BROADCOM_PCI_VENDOR_ID, CHIP_NUM_57840_4_10) },
+	{ RTE_PCI_DEVICE(BROADCOM_PCI_VENDOR_ID, CHIP_NUM_57840_2_20) },
+#ifdef RTE_LIBRTE_BNX2X_MF_SUPPORT
+	{ RTE_PCI_DEVICE(BROADCOM_PCI_VENDOR_ID, CHIP_NUM_57810_MF) },
+	{ RTE_PCI_DEVICE(BROADCOM_PCI_VENDOR_ID, CHIP_NUM_57811_MF) },
+	{ RTE_PCI_DEVICE(BROADCOM_PCI_VENDOR_ID, CHIP_NUM_57840_MF) },
+#endif
 	{ .vendor_id = 0, }
 };
 
 static struct rte_pci_id pci_id_bnx2xvf_map[] = {
-#define RTE_PCI_DEV_ID_DECL_BNX2XVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
+	{ RTE_PCI_DEVICE(BROADCOM_PCI_VENDOR_ID, CHIP_NUM_57800_VF) },
+	{ RTE_PCI_DEVICE(BROADCOM_PCI_VENDOR_ID, CHIP_NUM_57810_VF) },
+	{ RTE_PCI_DEVICE(BROADCOM_PCI_VENDOR_ID, CHIP_NUM_57811_VF) },
+	{ RTE_PCI_DEVICE(BROADCOM_PCI_VENDOR_ID, CHIP_NUM_57840_VF) },
 	{ .vendor_id = 0, }
 };
 
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -55

73 lines not on this page · raw message

Signature · 1 line
1.9.1
#89 lore raw

PATCH v4 9/10 net/bnxt: move PCI device ids to the driver

In reply to David Marchand

Moved defines since the driver had no such information. Used RTE_PCI_DEVICE in place of RTE_PCI_DEV_ID_DECL* stuff.

---
 drivers/net/bnxt/bnxt_ethdev.c                  | 27 +++++++++++++++++---
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 34 -------------------------
 2 files changed, 24 insertions(+), 37 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +24 -3
index 9a2123e..3795fac 100644
@@ -56,10 +56,31 @@
 static const char bnxt_version[] =
 	"Broadcom Cumulus driver " DRV_MODULE_NAME "\n";
 
+#define PCI_VENDOR_ID_BROADCOM 0x14E4
+
+#define BROADCOM_DEV_ID_57301 0x16c8
+#define BROADCOM_DEV_ID_57302 0x16c9
+#define BROADCOM_DEV_ID_57304_PF 0x16ca
+#define BROADCOM_DEV_ID_57304_VF 0x16cb
+#define BROADCOM_DEV_ID_57402 0x16d0
+#define BROADCOM_DEV_ID_57404 0x16d1
+#define BROADCOM_DEV_ID_57406_PF 0x16d2
+#define BROADCOM_DEV_ID_57406_VF 0x16d3
+#define BROADCOM_DEV_ID_57406_MF 0x16d4
+#define BROADCOM_DEV_ID_57314 0x16df
+
 static struct rte_pci_id bnxt_pci_id_map[] = {
-#define RTE_PCI_DEV_ID_DECL_BNXT(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
-	{.device_id = 0},
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57301) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57302) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57304_PF) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57304_VF) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57402) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57404) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_PF) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_VF) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_MF) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57314) },
+	{ .vendor_id = 0, /* sentinel */ },
 };
 
 #define BNXT_ETH_RSS_SUPPORT (	\
lib/librte_eal/common/include/rte_pci_dev_ids.h +0 -34
index fd2eb5d..6ec8ae8 100644
@@ -73,20 +73,11 @@
 #define RTE_PCI_DEV_ID_DECL_IXGBEVF(vend, dev)
 #endif
 
-#ifndef RTE_PCI_DEV_ID_DECL_BNXT
-#define RTE_PCI_DEV_ID_DECL_BNXT(vend, dev)
-#endif
-
 #ifndef PCI_VENDOR_ID_INTEL
 /** Vendor ID used by Intel devices */
 #define PCI_VENDOR_ID_INTEL 0x8086
 #endif
 
-#ifndef PCI_VENDOR_ID_BROADCOM
-/** Vendor ID used by Broadcom devices */
-#define PCI_VENDOR_ID_BROADCOM 0x14E4
-#endif
-
 /******************** Physical IGB devices from e1000_hw.h ********************/
 
 #define E1000_DEV_ID_82576                      0x10C9
@@ -326,30 +317,6 @@ RTE_PCI_DEV_ID_DECL_IXGBEVF(PCI_VENDOR_ID_INTEL, IXGBE_DEV_ID_X550EM_A_VF_HV)
 RTE_PCI_DEV_ID_DECL_IXGBEVF(PCI_VENDOR_ID_INTEL, IXGBE_DEV_ID_X550EM_X_VF)
 RTE_PCI_DEV_ID_DECL_IXGBEVF(PCI_VENDOR_ID_INTEL, IXGBE_DEV_ID_X550EM_X_VF_HV)
 
-/****************** Broadcom bnxt devices ******************/
-
-#define BROADCOM_DEV_ID_57301                  0x16c8
-#define BROADCOM_DEV_ID_57302                  0x16c9
-#define BROADCOM_DEV_ID_57304_PF               0x16ca
-#define BROADCOM_DEV_ID_57304_VF               0x16cb
-#define BROADCOM_DEV_ID_57402                  0x16d0
-#define BROADCOM_DEV_ID_57404                  0x16d1
-#define BROADCOM_DEV_ID_57406_PF               0x16d2
-#define BROADCOM_DEV_ID_57406_VF               0x16d3
-#define BROADCOM_DEV_ID_57406_MF               0x16d4
-#define BROADCOM_DEV_ID_57314                  0x16df
-
-RTE_PCI_DEV_ID_DECL_BNXT(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57301)
-RTE_PCI_DEV_ID_DECL_BNXT(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57302)
-RTE_PCI_DEV_ID_DECL_BNXT(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57304_PF)
-RTE_PCI_DEV_ID_DECL_BNXT(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57304_VF)
-RTE_PCI_DEV_ID_DECL_BNXT(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57402)
-RTE_PCI_DEV_ID_DECL_BNXT(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57404)
-RTE_PCI_DEV_ID_DECL_BNXT(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_PF)
-RTE_PCI_DEV_ID_DECL_BNXT(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_VF)
-RTE_PCI_DEV_ID_DECL_BNXT(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_MF)
-RTE_PCI_DEV_ID_DECL_BNXT(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57314)
-
 /*
  * Undef all RTE_PCI_DEV_ID_DECL_* here.
  */
@@ -357,4 +324,3 @@ RTE_PCI_DEV_ID_DECL_BNXT(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57314)
 #undef RTE_PCI_DEV_ID_DECL_IGBVF
 #undef RTE_PCI_DEV_ID_DECL_IXGBE
 #undef RTE_PCI_DEV_ID_DECL_IXGBEVF
-#undef RTE_PCI_DEV_ID_DECL_BNXT
Signature · 1 line
1.9.1
#90 lore raw

PATCH v4 10/10 net/ena: remove unneeded PCI macro

In reply to David Marchand

I suppose this is a remnant of rte_pci_dev_ids.h, just remove this.

---
 drivers/net/ena/ena_ethdev.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/net/ena/ena_ethdev.c +3 -4
index f1b5e64..ac0803d 100644
@@ -169,10 +169,9 @@ static const struct ena_stats ena_stats_ena_com_strings[] = {
 #define PCI_DEVICE_ID_ENA_LLQ_VF	0xEC21
 
 static struct rte_pci_id pci_id_ena_map[] = {
-#define RTE_PCI_DEV_ID_DECL_ENA(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-	RTE_PCI_DEV_ID_DECL_ENA(PCI_VENDOR_ID_AMAZON, PCI_DEVICE_ID_ENA_VF)
-	RTE_PCI_DEV_ID_DECL_ENA(PCI_VENDOR_ID_AMAZON, PCI_DEVICE_ID_ENA_LLQ_VF)
-	{.device_id = 0},
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_AMAZON, PCI_DEVICE_ID_ENA_VF) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_AMAZON, PCI_DEVICE_ID_ENA_LLQ_VF) },
+	{ .device_id = 0 },
 };
 
 static int ena_device_init(struct ena_com_dev *ena_dev,
Signature · 1 line
1.9.1
#91 lore raw

Re: [PATCH v4 00/10] kill global pci device id list (almost)

In reply to David Marchand

2016-07-11 16:40, David Marchand:

Quoted 7 lines

With the introduction of pmdinfo by Neil, we have almost everything in place to get rid of the pci devices in eal.

We still have some ties with some pmds for functionalities like kni/ethtool or ixgbe bypass api, so the plan has switched to touch all pmds but those igb and ixgbe drivers.

Quoted 7 lines

Since we still need rte_pci_dev_ids.h for those drivers, I just stripped the doxygen parts to stop referencing it in the documentation.

I have validated this patchset by comparing the pmdinfo outputs and just noticed a difference for enic (where the pci ids were registered twice before).
Yet, please maintainers review carefully.

Applied, thanks