[dpdk-dev] enicpmd: build changes for FreeBSD

Message ID 1430903460-5480-1-git-send-email-ssujith@cisco.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Sujith Sankar May 6, 2015, 9:11 a.m. UTC
This patch adds the changes required to build enic for FreeBSD

Signed-off-by: Sujith Sankar <ssujith@cisco.com>
---
 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(+)
  

Comments

Bruce Richardson May 6, 2015, 3:49 p.m. UTC | #1
On Wed, May 06, 2015 at 02:41:00PM +0530, Sujith Sankar wrote:
> This patch adds the changes required to build enic for FreeBSD
> 

Hi,

I see no issues with this patch, but I suggest the description for it should
be changed. There is no actual build problem or error with the enic (at least
not that I can see), it builds fine with gcc and clang currently. This patch
instead adds support for the enic to the nic_uio driver so the enic can be
"used", not just "built" on FreeBSD. Correct?

Other than that description reworking:

Acked-by: Bruce Richardson <bruce.richardson@intel.com>

> Signed-off-by: Sujith Sankar <ssujith@cisco.com>
> ---
>  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(+)
> 
> diff --git a/lib/librte_eal/bsdapp/nic_uio/nic_uio.c b/lib/librte_eal/bsdapp/nic_uio/nic_uio.c
> index 5ae8560..e649e32 100644
> --- a/lib/librte_eal/bsdapp/nic_uio/nic_uio.c
> +++ b/lib/librte_eal/bsdapp/nic_uio/nic_uio.c
> @@ -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>
> diff --git a/lib/librte_eal/common/include/rte_pci_dev_ids.h b/lib/librte_eal/common/include/rte_pci_dev_ids.h
> index 21d2eed..5d1b285 100644
> --- a/lib/librte_eal/common/include/rte_pci_dev_ids.h
> +++ b/lib/librte_eal/common/include/rte_pci_dev_ids.h
> @@ -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.
>   */
> -- 
> 1.9.1
>
  
Sujith Sankar May 7, 2015, 3:43 a.m. UTC | #2
On 06/05/15 9:19 pm, "Bruce Richardson" <bruce.richardson@intel.com> wrote:

>On Wed, May 06, 2015 at 02:41:00PM +0530, Sujith Sankar wrote:
>> This patch adds the changes required to build enic for FreeBSD
>> 
>
>Hi,
>
>I see no issues with this patch, but I suggest the description for it
>should
>be changed. There is no actual build problem or error with the enic (at
>least
>not that I can see), it builds fine with gcc and clang currently. This
>patch
>instead adds support for the enic to the nic_uio driver so the enic can be
>"used", not just "built" on FreeBSD. Correct?

Bruce, I fully agree with you.
I shall change the description and re-submit the patch.

Thanks !
-Sujith

>
>Other than that description reworking:
>
>Acked-by: Bruce Richardson <bruce.richardson@intel.com>
>
>> Signed-off-by: Sujith Sankar <ssujith@cisco.com>
>> ---
>>  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(+)
>> 
>> diff --git a/lib/librte_eal/bsdapp/nic_uio/nic_uio.c
>>b/lib/librte_eal/bsdapp/nic_uio/nic_uio.c
>> index 5ae8560..e649e32 100644
>> --- a/lib/librte_eal/bsdapp/nic_uio/nic_uio.c
>> +++ b/lib/librte_eal/bsdapp/nic_uio/nic_uio.c
>> @@ -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>
>> diff --git a/lib/librte_eal/common/include/rte_pci_dev_ids.h
>>b/lib/librte_eal/common/include/rte_pci_dev_ids.h
>> index 21d2eed..5d1b285 100644
>> --- a/lib/librte_eal/common/include/rte_pci_dev_ids.h
>> +++ b/lib/librte_eal/common/include/rte_pci_dev_ids.h
>> @@ -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.
>>   */
>> -- 
>> 1.9.1
>>
  

Patch

diff --git a/lib/librte_eal/bsdapp/nic_uio/nic_uio.c b/lib/librte_eal/bsdapp/nic_uio/nic_uio.c
index 5ae8560..e649e32 100644
--- a/lib/librte_eal/bsdapp/nic_uio/nic_uio.c
+++ b/lib/librte_eal/bsdapp/nic_uio/nic_uio.c
@@ -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>
diff --git a/lib/librte_eal/common/include/rte_pci_dev_ids.h b/lib/librte_eal/common/include/rte_pci_dev_ids.h
index 21d2eed..5d1b285 100644
--- a/lib/librte_eal/common/include/rte_pci_dev_ids.h
+++ b/lib/librte_eal/common/include/rte_pci_dev_ids.h
@@ -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.
  */