[dpdk-dev] [PATCH v3 02/13] ixgbe: move pci device ids to driver

2016-05-04 Thread David Marchand
On Fri, Apr 29, 2016 at 3:34 AM, Wu, Jingjing  wrote:
> 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.

-- 
David Marchand


[dpdk-dev] [PATCH v3 02/13] ixgbe: move pci device ids to driver

2016-04-29 Thread Wu, 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.

Thanks
Jingjing

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of David Marchand
> Sent: Wednesday, April 20, 2016 8:44 PM
> To: dev at dpdk.org
> Cc: thomas.monjalon at 6wind.com; stephen at networkplumber.org;
> Richardson, Bruce; nhorman at tuxdriver.com; pmatilai at redhat.com;
> christian.ehrhardt at canonical.com; 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.
> 
> Signed-off-by: David Marchand 
> ---
>  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
> 
> diff --git a/app/test-pmd/Makefile b/app/test-pmd/Makefile index
> 72426f3..a8899b8 100644


[dpdk-dev] [PATCH v3 02/13] ixgbe: move pci device ids to driver

2016-04-20 Thread 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.

Signed-off-by: David Marchand 
---
 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

diff --git a/app/test-pmd/Makefile b/app/test-pmd/Makefile
index 72426f3..a8899b8 100644
--- a/app/test-pmd/Makefile
+++ b/app/test-pmd/Makefile
@@ -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
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index c5b9479..45cbcff 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -10586,7 +10586,7 @@ cmd_reconfig_device_queue(portid_t id, uint8_t dev, 
uint8_t queue)
 }

 #ifdef RTE_NIC_BYPASS
-#include 
+#include 
 uint8_t
 bypass_is_supported(portid_t port_id)
 {
diff --git a/app/test/Makefile b/app/test/Makefile
index 8a1f54c..051eb8c 100644
--- a/app/test/Makefile
+++ b/app/test/Makefile
@@ -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
diff --git a/app/test/test_pci.c b/app/test/test_pci.c
index 7215936..cdb79ab 100644
--- a/app/test/test_pci.c
+++ b/app/test/test_pci.c
@@ -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 
+#include 

 { .vendor_id = 0, /* sentinel */ },
 };
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 5103c7c..098918a 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -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 */ },

 };
diff --git a/drivers/net/ixgbe/ixgbe_pci_dev_ids.h 
b/drivers/net/ixgbe/ixgbe_pci_dev_ids.h
new file mode 100644
index 000..467a281
--- /dev/null
+++ b/drivers/net/ixgbe/ixgbe_pci_dev_ids.h
@@ -0,0 +1,213 @@
+/*-
+ * 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