Skip to contentSkip to conversation

enic: add support for enic in nic_uio driver for FreeBSD

PATCH Applied Sujith Sankar 4 participants 4 messages May 7, 2015 – May 11, 2015 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 enic: add support for enic in nic_uio driver for FreeBSD

This patch adds support for enic in the nic_uio driver so that enic could be used on FreeBSD.

---
 lib/librte_eal/bsdapp/nic_uio/nic_uio.c         |  1 +
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 17 +++++++++++++++++
 2 files changed, 18 insertions(+)
lib/librte_eal/bsdapp/nic_uio/nic_uio.c +1 -0
index 5ae8560..e649e32 100644
@@ -113,6 +113,7 @@ struct pci_bdf {
 #define RTE_PCI_DEV_ID_DECL_I40EVF(vend, dev)  {vend, dev},
 #define RTE_PCI_DEV_ID_DECL_VIRTIO(vend, dev)  {vend, dev},
 #define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev) {vend, dev},
+#define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev)    {vend, dev},
 
 const struct device devices[] = {
 #include <rte_pci_dev_ids.h>
lib/librte_eal/common/include/rte_pci_dev_ids.h +17 -0
index 21d2eed..5d1b285 100644
@@ -140,6 +140,10 @@
 #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
+
 #ifndef PCI_VENDOR_ID_INTEL
 /** Vendor ID used by Intel devices */
 #define PCI_VENDOR_ID_INTEL 0x8086
@@ -155,6 +159,11 @@
 #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
+#endif
+
 /******************** Physical EM devices from e1000_hw.h ********************/
 
 #define E1000_DEV_ID_82542                    0x1000
@@ -548,6 +557,14 @@ RTE_PCI_DEV_ID_DECL_VMXNET3(PCI_VENDOR_ID_VMWARE, VMWARE_DEV_ID_VMXNET3)
 
 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 */
+#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)
+
 /*
  * Undef all RTE_PCI_DEV_ID_DECL_* here.
  */
Signature · 1 line
1.9.1

A message that is not in the archive (sent off-list or not yet received): 1430970549-14965-1-git-send-email-ssujith-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org

#2 lore raw
Quoted 3 lines · Sujith Sankar

This patch adds support for enic in the nic_uio driver so that enic could be used on FreeBSD.

Quoted 62 lines
---
 lib/librte_eal/bsdapp/nic_uio/nic_uio.c         |  1 +
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 17 +++++++++++++++++
 2 files changed, 18 insertions(+)
lib/librte_eal/bsdapp/nic_uio/nic_uio.c +1 -0
index 5ae8560..e649e32 100644
@@ -113,6 +113,7 @@ struct pci_bdf {
 #define RTE_PCI_DEV_ID_DECL_I40EVF(vend, dev)  {vend, dev},
 #define RTE_PCI_DEV_ID_DECL_VIRTIO(vend, dev)  {vend, dev},
 #define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev) {vend, dev},
+#define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev)    {vend, dev},
 
 const struct device devices[] = {
 #include <rte_pci_dev_ids.h>
lib/librte_eal/common/include/rte_pci_dev_ids.h +17 -0
index 21d2eed..5d1b285 100644
@@ -140,6 +140,10 @@
 #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
+
 #ifndef PCI_VENDOR_ID_INTEL
 /** Vendor ID used by Intel devices */
 #define PCI_VENDOR_ID_INTEL 0x8086
@@ -155,6 +159,11 @@
 #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
+#endif
+
 /******************** Physical EM devices from e1000_hw.h ********************/
 
 #define E1000_DEV_ID_82542                    0x1000
@@ -548,6 +557,14 @@ RTE_PCI_DEV_ID_DECL_VMXNET3(PCI_VENDOR_ID_VMWARE, VMWARE_DEV_ID_VMXNET3)
 
 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 */
+#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)
+
 /*
  * Undef all RTE_PCI_DEV_ID_DECL_* here.
  */
Signature · 1 line
1.9.1
#3 lore raw
Quoted 9 lines · Bruce Richardson
Quoted 1 line · Sujith Sankar

This patch adds support for enic in the nic_uio driver so that enic

could be used on FreeBSD.

Quoted 2 lines

Well this is not really bsd specific, as people who rely on rte_pci_dev_ids.h header to find devices that must be bound to igb_uio and consort, will also benefit from this fix.
By the way, I am working on removing these device ids from the eal, since the pmds should be the only one that maintain their devices ids list. Will send some patches soon.

Signature · 1 line
David Marchand
#4 lore raw

2015-05-07 12:57, David Marchand:

Quoted 7 lines · Bruce Richardson
Quoted 6 lines · Sujith Sankar
Quoted 1 line

This patch adds support for enic in the nic_uio driver so that enic

could be used on FreeBSD.

Quoted 2 lines
Quoted 7 lines
Quoted 1 line

Well this is not really bsd specific, as people who rely on rte_pci_dev_ids.h header to find devices that must be bound to igb_uio and consort, will also benefit from this fix.
By the way, I am working on removing these device ids from the eal, since the pmds should be the only one that maintain their devices ids list.

Agree

Quoted 3 lines

Will send some patches soon.

Applied, thanks