[dpdk-dev] [PATCH v2 01/16] Separate igb_uio mapping into a separate file

2014-05-27 Thread Xu, HuilongX
In order to make the code a bit more clean while using multiple
drivers, IGB_UIO mapping has been separated into its own file.

Signed-off-by: Anatoly Burakov 
Test-by: HuilongX Xu mailto:huilongx.xu at intel.com>>
Compile pass
 >>Compile OS: FC20 x86_64
 >>Kernel version: 3.13.6-200
 >>GCC version: 4.8.2
 >>Server: Crownpass

---
lib/librte_eal/linuxapp/eal/Makefile   |1 +
lib/librte_eal/linuxapp/eal/eal_pci.c  |  424 +---
lib/librte_eal/linuxapp/eal/eal_pci_uio.c  |  403 +++
lib/librte_eal/linuxapp/eal/include/eal_pci_init.h |   65 +++
4 files changed, 478 insertions(+), 415 deletions(-)
create mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_uio.c
create mode 100644 lib/librte_eal/linuxapp/eal/include/eal_pci_init.h

diff --git a/lib/librte_eal/linuxapp/eal/Makefile 
b/lib/librte_eal/linuxapp/eal/Makefile
index b00e3ec..527fa2a 100644
--- a/lib/librte_eal/linuxapp/eal/Makefile
+++ b/lib/librte_eal/linuxapp/eal/Makefile
@@ -57,6 +57,7 @@ endif
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_thread.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_log.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_pci.c
+SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_pci_uio.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_debug.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_lcore.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_timer.c
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c 
b/lib/librte_eal/linuxapp/eal/eal_pci.c
index ac2c1fe..cd5b797 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -31,82 +31,31 @@
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-#include 
-#include 
-#include 
#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
#include 
-#include 
-#include 
#include 
-#include 
-#include 
#include 
#include 
-#include 
-#include 
-#include 
-#include 
#include 
-#include 
#include 
-#include 
-#include 
-#include 
-#include 
-#include 
#include 
 #include "rte_pci_dev_ids.h"
#include "eal_filesystem.h"
#include "eal_private.h"
+#include "eal_pci_init.h"
 /**
  * @file
  * PCI probing under linux
  *
  * This code is used to simulate a PCI probe by parsing information in
- * sysfs. Moreover, when a registered driver matches a device, the
- * kernel driver currently using it is unloaded and replaced by
- * igb_uio module, which is a very minimal userland driver for Intel
- * network card, only providing access to PCI BAR to applications, and
- * enabling bus master.
+ * sysfs. When a registered device matches a driver, it is then initialized
+ * with either VFIO or IGB_UIO driver (or doesn't initialize), whichever
+ * driver the device is bound to.
  */
-struct uio_map {
-  void *addr;
-  uint64_t offset;
-  uint64_t size;
-  uint64_t phaddr;
-};
-
-/*
- * For multi-process we need to reproduce all PCI mappings in secondary
- * processes, so save them in a tailq.
- */
-struct uio_resource {
-  TAILQ_ENTRY(uio_resource) next;
-
-  struct rte_pci_addr pci_addr;
-  char path[PATH_MAX];
-  size_t nb_maps;
-  struct uio_map maps[PCI_MAX_RESOURCE];
-};
-
-TAILQ_HEAD(uio_res_list, uio_resource);
-
-static struct uio_res_list *uio_res_list = NULL;
-static int pci_parse_sysfs_value(const char *filename, uint64_t *val);
-
/* unbind kernel driver for this device */
static int
pci_unbind_kernel_driver(struct rte_pci_device *dev)
@@ -147,31 +96,19 @@ error:
}
 /* map a particular resource from a file */
-static void *
-pci_map_resource(void *requested_addr, const char *devname, off_t offset,
+void *
+pci_map_resource(void *requested_addr, int fd, off_t offset,
size_t size)
{
-  int fd;
   void *mapaddr;
-  /*
-  * open devname, to mmap it
-  */
-  fd = open(devname, O_RDWR);
-  if (fd < 0) {
-  RTE_LOG(ERR, EAL, "Cannot open %s: %s\n",
-  devname, strerror(errno));
-  goto fail;
-  }
-
   /* Map the PCI memory resource of device */
   mapaddr = mmap(requested_addr, size, PROT_READ | PROT_WRITE,
   MAP_SHARED, fd, offset);
-  close(fd);
   if (mapaddr == MAP_FAILED ||
   (requested_addr != NULL && 
mapaddr != requested_addr)) {
-  RTE_LOG(ERR, EAL, "%s(): cannot mmap(%s(%d), %p, 
0x%lx, 0x%lx):"
-  " %s (%p)\n", __func__, devname, 
fd, requested_addr,
+ RTE_LOG(ERR, EAL, "%s(): cannot mmap(%d, %p, 
0x%lx, 0x%lx):"
+  

[dpdk-dev] [PATCH v2 02/16] Distinguish between legitimate failures and non-fatal errors

2014-05-27 Thread Xu, HuilongX
Currently, EAL does not distinguish between actual failures and
expected initialization errors. E.g. sometimes the driver fails to
initialize because it was not supposed to be initialized in the
first place, such as device not being managed by said driver.

This patch makes EAL fail on actual initialization errors while
still skipping over expected initialization errors.

Signed-off-by: Anatoly Burakov 
Test-by: HuilongX Xu 
Compile pass
 >>Compile OS: FC20 x86_64
 >>Kernel version: 3.13.6-200
 >>GCC version: 4.8.2
 >>Server: Crownpass
---
lib/librte_eal/common/eal_common_pci.c|   16 +---
lib/librte_eal/linuxapp/eal/eal_pci.c |7 ---
lib/librte_eal/linuxapp/eal/eal_pci_uio.c |4 ++--
3 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_pci.c 
b/lib/librte_eal/common/eal_common_pci.c
index 7c23e86..1fb8f2c 100644
--- a/lib/librte_eal/common/eal_common_pci.c
+++ b/lib/librte_eal/common/eal_common_pci.c
@@ -101,8 +101,8 @@ static struct rte_devargs *pci_devargs_lookup(struct 
rte_pci_device *dev)
 /*
  * If vendor/device ID match, call the devinit() function of all
- * registered driver for the given device. Return -1 if no driver is
- * found for this device.
+ * registered driver for the given device. Return -1 if initialization
+ * failed, return 1 if no driver is found for this device.
  * For drivers with the RTE_PCI_DRV_MULTIPLE flag enabled, register
  * the same device multiple times until failure to do so.
  * It is required for non-Intel NIC drivers provided by third-parties such
@@ -118,7 +118,7 @@ pci_probe_all_drivers(struct rte_pci_device *dev)
   rc = rte_eal_pci_probe_one_driver(dr, dev);
   if (rc < 0)
   /* negative value is an error */
-  break;
+ return -1;
   if (rc > 0)
   /* positive value means driver 
not found */
   continue;
@@ -130,7 +130,7 @@ pci_probe_all_drivers(struct rte_pci_device *dev)
   ;
   return 0;
   }
-  return -1;
+ return 1;
}
 /*
@@ -144,6 +144,7 @@ rte_eal_pci_probe(void)
   struct rte_pci_device *dev = NULL;
   struct rte_devargs *devargs;
   int probe_all = 0;
+ int ret = 0;
if (rte_eal_devargs_type_count(RTE_DEVTYPE_WHITELISTED_PCI) == 
0)
   probe_all = 1;
@@ -157,10 +158,11 @@ rte_eal_pci_probe(void)
/* probe all or only whitelisted devices */
   if (probe_all)
-  pci_probe_all_drivers(dev);
+ ret = pci_probe_all_drivers(dev);
   else if (devargs != NULL &&
-  devargs->type == 
RTE_DEVTYPE_WHITELISTED_PCI &&
-  pci_probe_all_drivers(dev) < 0)
+ devargs->type == 
RTE_DEVTYPE_WHITELISTED_PCI)
+ ret = pci_probe_all_drivers(dev);
+ if (ret < 0)
   rte_exit(EXIT_FAILURE, 
"Requested device " PCI_PRI_FMT
" cannot be 
used\n", dev->addr.domain, dev->addr.bus,

dev->addr.devid, dev->addr.function);
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c 
b/lib/librte_eal/linuxapp/eal/eal_pci.c
index cd5b797..de1b0a0 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -400,6 +400,7 @@ int
rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device 
*dev)
{
   struct rte_pci_id *id_table;
+ int ret = 0;
for (id_table = dr->id_table ; id_table->vendor_id != 0; 
id_table++) {
@@ -430,13 +431,13 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, 
struct rte_pci_device *d
   if (dev->devargs != NULL &&
   dev->devargs->type == 
RTE_DEVTYPE_BLACKLISTED_PCI) {
   RTE_LOG(DEBUG, EAL, "  Device is 
blacklisted, not initializing\n");
-  return 0;
+ return 1;
   }
if (dr->drv_flags & RTE_PCI_DRV_NEED_IGB_UIO) {
   /* map resources 

[dpdk-dev] [PATCH v2 03/16] Rename RTE_PCI_DRV_NEED_IGB_UIO to RTE_PCI_DRV_NEED_MAPPING

2014-05-27 Thread Xu, HuilongX
Rename the RTE_PCI_DRV_NEED_IGB_UIO to be more generic,
retain old macro for backwards compatibility. Probably should
be removed in one of the next releases.

Signed-off-by: Anatoly Burakov 
Test-by: HuilongX Xu 
Compile pass
 >>Compile OS: FC20 x86_64
 >>Kernel version: 3.13.6-200
 >>GCC version: 4.8.2
 >>Server: Crownpass
---
app/test/test_pci.c |4 ++--
lib/librte_eal/bsdapp/eal/eal_pci.c |2 +-
lib/librte_eal/common/include/rte_pci.h |6 --
lib/librte_pmd_e1000/em_ethdev.c|2 +-
lib/librte_pmd_e1000/igb_ethdev.c   |4 ++--
lib/librte_pmd_ixgbe/ixgbe_ethdev.c |4 ++--
lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c |2 +-
7 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/app/test/test_pci.c b/app/test/test_pci.c
index 6908d04..fad118e 100644
--- a/app/test/test_pci.c
+++ b/app/test/test_pci.c
@@ -63,7 +63,7 @@ static int my_driver_init(struct rte_pci_driver *dr,
 struct rte_pci_device *dev);
 /*
- * To test cases where RTE_PCI_DRV_NEED_IGB_UIO is set, and isn't set, two
+ * To test cases where RTE_PCI_DRV_NEED_MAPPING is set, and isn't set, two
  * drivers are created (one with IGB devices, the other with IXGBE devices).
  */
@@ -91,7 +91,7 @@ struct rte_pci_driver my_driver = {
   .name = "test_driver",
   .devinit = my_driver_init,
   .id_table = my_driver_id,
-  .drv_flags = RTE_PCI_DRV_NEED_IGB_UIO,
+ .drv_flags = RTE_PCI_DRV_NEED_MAPPING,
};
 struct rte_pci_driver my_driver2 = {
diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c 
b/lib/librte_eal/bsdapp/eal/eal_pci.c
index 94ae461..eddbd2f 100644
--- a/lib/librte_eal/bsdapp/eal/eal_pci.c
+++ b/lib/librte_eal/bsdapp/eal/eal_pci.c
@@ -474,7 +474,7 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, 
struct rte_pci_device *d
   return 0;
   }
-  if (dr->drv_flags & RTE_PCI_DRV_NEED_IGB_UIO) {
+ if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) {
   /* map resources for devices 
that use igb_uio */
   if (pci_uio_map_resource(dev) < 
0)
   return -1;
diff --git a/lib/librte_eal/common/include/rte_pci.h 
b/lib/librte_eal/common/include/rte_pci.h
index c793773..84d7b42 100644
--- a/lib/librte_eal/common/include/rte_pci.h
+++ b/lib/librte_eal/common/include/rte_pci.h
@@ -190,12 +190,14 @@ struct rte_pci_driver {
   uint32_t drv_flags; /**< Flags contolling 
handling of device. */
};
-/** Device needs igb_uio kernel module */
-#define RTE_PCI_DRV_NEED_IGB_UIO 0x0001
+/** Device needs PCI BAR mapping (done with either IGB_UIO or VFIO) */
+#define RTE_PCI_DRV_NEED_MAPPING 0x0001
/** Device driver must be registered several times until failure */
#define RTE_PCI_DRV_MULTIPLE 0x0002
/** Device needs to be unbound even if no module is provided */
#define RTE_PCI_DRV_FORCE_UNBIND 0x0004
+/** Retain the old name for backwards-compatibility */
+#define RTE_PCI_DRV_NEED_IGB_UIO RTE_PCI_DRV_NEED_MAPPING
 /**< Internal use only - Macro used by pci addr parsing functions **/
#define GET_PCIADDR_FIELD(in, fd, lim, dlm)   \
diff --git a/lib/librte_pmd_e1000/em_ethdev.c b/lib/librte_pmd_e1000/em_ethdev.c
index 755e474..f3575d5 100644
--- a/lib/librte_pmd_e1000/em_ethdev.c
+++ b/lib/librte_pmd_e1000/em_ethdev.c
@@ -279,7 +279,7 @@ static struct eth_driver rte_em_pmd = {
   {
   .name = "rte_em_pmd",
   .id_table = pci_id_em_map,
-  .drv_flags = RTE_PCI_DRV_NEED_IGB_UIO,
+ .drv_flags = RTE_PCI_DRV_NEED_MAPPING,
   },
   .eth_dev_init = eth_em_dev_init,
   .dev_private_size = sizeof(struct e1000_adapter),
diff --git a/lib/librte_pmd_e1000/igb_ethdev.c 
b/lib/librte_pmd_e1000/igb_ethdev.c
index c7b3926..b49db52 100644
--- a/lib/librte_pmd_e1000/igb_ethdev.c
+++ b/lib/librte_pmd_e1000/igb_ethdev.c
@@ -600,7 +600,7 @@ static struct eth_driver rte_igb_pmd = {
   {
   .name = "rte_igb_pmd",
   .id_table = pci_id_igb_map,
-  .drv_flags = RTE_PCI_DRV_NEED_IGB_UIO,
+ .drv_flags = RTE_PCI_DRV_NEED_MAPPING,
   },
   .eth_dev_init = eth_igb_dev_init,
   .dev_private_size = sizeof(struct e1000_adapter),
@@ -613,7 +613,7 @@ static struct eth_driver rte_igbvf_pmd = {
   {
   .name = "rte_igbvf_pmd",
   .id_table = pci_id_igbvf_map,
-  .drv_flags = RTE_PCI_DRV_NEED_IGB_

[dpdk-dev] [PATCH v2 04/16] Make igb_uio compilation optional

2014-05-27 Thread Xu, HuilongX
Currently, igb_uio is always compiled. Some Linux distribution may
not want to include igb_uio by default, so we need to make sure that
igb_uio compilation can be optional.

Signed-off-by: Anatoly Burakov mailto:anatoly.burakov at intel.com>>
Test-by: HuilongX Xu mailto:huilongx.xu at intel.com>>
Compile pass
 >>Compile OS: FC20 x86_64
 >>Kernel version: 3.13.6-200
 >>GCC version: 4.8.2
 >>Server: Crownpass
---
config/defconfig_i686-default-linuxapp-gcc   |1 +
config/defconfig_i686-default-linuxapp-icc   |1 +
config/defconfig_x86_64-default-linuxapp-gcc |1 +
config/defconfig_x86_64-default-linuxapp-icc |1 +
lib/librte_eal/linuxapp/Makefile |2 ++
lib/librte_eal/linuxapp/eal/eal_pci.c|2 +-
6 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/config/defconfig_i686-default-linuxapp-gcc 
b/config/defconfig_i686-default-linuxapp-gcc
index 14bd3d1..ea90f12 100644
--- a/config/defconfig_i686-default-linuxapp-gcc
+++ b/config/defconfig_i686-default-linuxapp-gcc
@@ -123,6 +123,7 @@ CONFIG_RTE_LOG_HISTORY=256
CONFIG_RTE_LIBEAL_USE_HPET=n
CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n
CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n
+CONFIG_RTE_EAL_IGB_UIO=y
 #
# Compile Environment Abstraction Layer for linux
diff --git a/config/defconfig_i686-default-linuxapp-icc 
b/config/defconfig_i686-default-linuxapp-icc
index ec3386e..ecfbf28 100644
--- a/config/defconfig_i686-default-linuxapp-icc
+++ b/config/defconfig_i686-default-linuxapp-icc
@@ -123,6 +123,7 @@ CONFIG_RTE_LOG_HISTORY=256
CONFIG_RTE_LIBEAL_USE_HPET=n
CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n
CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n
+CONFIG_RTE_EAL_IGB_UIO=y
 #
# Compile Environment Abstraction Layer for linux
diff --git a/config/defconfig_x86_64-default-linuxapp-gcc 
b/config/defconfig_x86_64-default-linuxapp-gcc
index f11ffbf..fc69b80 100644
--- a/config/defconfig_x86_64-default-linuxapp-gcc
+++ b/config/defconfig_x86_64-default-linuxapp-gcc
@@ -123,6 +123,7 @@ CONFIG_RTE_LOG_HISTORY=256
CONFIG_RTE_LIBEAL_USE_HPET=n
CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n
CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n
+CONFIG_RTE_EAL_IGB_UIO=y
 #
# Compile Environment Abstraction Layer for linux
diff --git a/config/defconfig_x86_64-default-linuxapp-icc 
b/config/defconfig_x86_64-default-linuxapp-icc
index 4eaca4c..4ab45b3 100644
--- a/config/defconfig_x86_64-default-linuxapp-icc
+++ b/config/defconfig_x86_64-default-linuxapp-icc
@@ -123,6 +123,7 @@ CONFIG_RTE_LOG_HISTORY=256
CONFIG_RTE_LIBEAL_USE_HPET=n
CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n
CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n
+CONFIG_RTE_EAL_IGB_UIO=y
 #
# Compile Environment Abstraction Layer for linux
diff --git a/lib/librte_eal/linuxapp/Makefile b/lib/librte_eal/linuxapp/Makefile
index b00e89f..acbf500 100644
--- a/lib/librte_eal/linuxapp/Makefile
+++ b/lib/librte_eal/linuxapp/Makefile
@@ -31,7 +31,9 @@
 include $(RTE_SDK)/mk/rte.vars.mk
+ifeq ($(CONFIG_RTE_EAL_IGB_UIO),y)
DIRS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += igb_uio
+endif
DIRS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal
ifeq ($(CONFIG_RTE_LIBRTE_KNI),y)
DIRS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += kni
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c 
b/lib/librte_eal/linuxapp/eal/eal_pci.c
index de1b0a0..7256406 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -434,7 +434,7 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, 
struct rte_pci_device *d
   return 1;
   }
-  if (dr->drv_flags & RTE_PCI_DRV_NEED_IGB_UIO) {
+ if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) {
   /* map resources for devices 
that use igb_uio */
   if ((ret = 
pci_uio_map_resource(dev)) != 0)
   return ret;
--
1.7.0.7


[dpdk-dev] [PATCH v2 05/16] Moved interrupt type out of igb_uio

2014-05-27 Thread Xu, HuilongX
Moving interrupt type enum out of igb_uio and renaming it to be more
generic. Such a strange header naming and separation is done mostly to
make coming virtio patches easier to port to dpdk.org tree.

Signed-off-by: Anatoly Burakov 
Test-by: HuilongX Xu 
Compile pass
 >>Compile OS: FC20 x86_64
 >>Kernel version: 3.13.6-200
 >>GCC version: 4.8.2
 >>Server: Crownpass
---
lib/librte_eal/common/Makefile |1 +
lib/librte_eal/common/include/rte_pci.h|1 +
.../common/include/rte_pci_dev_feature_defs.h  |   46 ++
.../common/include/rte_pci_dev_features.h  |   40 
lib/librte_eal/linuxapp/igb_uio/igb_uio.c  |   49 ---
5 files changed, 109 insertions(+), 28 deletions(-)
create mode 100644 lib/librte_eal/common/include/rte_pci_dev_feature_defs.h
create mode 100644 lib/librte_eal/common/include/rte_pci_dev_features.h

diff --git a/lib/librte_eal/common/Makefile b/lib/librte_eal/common/Makefile
index 2f99bf4..7daf38c 100644
--- a/lib/librte_eal/common/Makefile
+++ b/lib/librte_eal/common/Makefile
@@ -39,6 +39,7 @@ INC += rte_rwlock.h rte_spinlock.h rte_tailq.h 
rte_interrupts.h rte_alarm.h
INC += rte_string_fns.h rte_cpuflags.h rte_version.h rte_tailq_elem.h
INC += rte_eal_memconfig.h rte_malloc_heap.h
INC += rte_hexdump.h rte_devargs.h rte_vdev.h
+INC += rte_pci_dev_feature_defs.h rte_pci_dev_features.h
 ifeq ($(CONFIG_RTE_INSECURE_FUNCTION_WARNING),y)
INC += rte_warnings.h
diff --git a/lib/librte_eal/common/include/rte_pci.h 
b/lib/librte_eal/common/include/rte_pci.h
index 84d7b42..d364cee 100644
--- a/lib/librte_eal/common/include/rte_pci.h
+++ b/lib/librte_eal/common/include/rte_pci.h
@@ -80,6 +80,7 @@ extern "C" {
#include 
#include 
#include 
+
#include 
 TAILQ_HEAD(pci_device_list, rte_pci_device); /**< PCI devices in D-linked Q. */
diff --git a/lib/librte_eal/common/include/rte_pci_dev_feature_defs.h 
b/lib/librte_eal/common/include/rte_pci_dev_feature_defs.h
new file mode 100644
index 000..82f2c00
--- /dev/null
+++ b/lib/librte_eal/common/include/rte_pci_dev_feature_defs.h
@@ -0,0 +1,46 @@
+/*-
+ *   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.
+ */
+
+#ifndef _RTE_PCI_DEV_DEFS_H_
+#define _RTE_PCI_DEV_DEFS_H_
+
+/* interrupt mode */
+enum rte_intr_mode {
+ RTE_INTR_MODE_NONE = 0,
+ RTE_INTR_MODE_LEGACY,
+ RTE_INTR_MODE_MSI,
+ RTE_INTR_MODE_MSIX,
+ RTE_INTR_MODE_MAX
+};
+
+#endif /* _RTE_PCI_DEV_DEFS_H_ */
diff --git a/lib/librte_eal/common/include/rte_pci_dev_features.h 
b/lib/librte_eal/common/include/rte_pci_dev_features.h
new file mode 100644
index 000..61f271a
--- /dev/null
+++ b/lib/librte_eal/common/include/rte_pci_dev_features.h
@@ -0,0 +1,40 @@
+/*-
+ *   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 condit

[dpdk-dev] [PATCH v2 06/16] Add support for VFIO in Linuxapp targets

2014-05-27 Thread Xu, HuilongX
Make VFIO compilation optional for all configs.



Signed-off-by: Anatoly Burakov http://dpdk.org/ml/listinfo/dev>>

Test-by: HuilongX Xu 

Compile pass

 >>Compile OS: FC20 x86_64

 >>Kernel version: 3.13.6-200

 >>GCC version: 4.8.2

 >>Server: Crownpass

---

 config/defconfig_i686-default-linuxapp-gcc   |1 +

 config/defconfig_i686-default-linuxapp-icc   |1 +

 config/defconfig_x86_64-default-linuxapp-gcc |1 +

 config/defconfig_x86_64-default-linuxapp-icc |1 +

 4 files changed, 4 insertions(+), 0 deletions(-)



diff --git a/config/defconfig_i686-default-linuxapp-gcc 
b/config/defconfig_i686-default-linuxapp-gcc

index ea90f12..5410f57 100644

--- a/config/defconfig_i686-default-linuxapp-gcc

+++ b/config/defconfig_i686-default-linuxapp-gcc

@@ -124,6 +124,7 @@ CONFIG_RTE_LIBEAL_USE_HPET=n

 CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n

 CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n

 CONFIG_RTE_EAL_IGB_UIO=y

+CONFIG_RTE_EAL_VFIO=y



 #

 # Compile Environment Abstraction Layer for linux

diff --git a/config/defconfig_i686-default-linuxapp-icc 
b/config/defconfig_i686-default-linuxapp-icc

index ecfbf28..1cc 100644

--- a/config/defconfig_i686-default-linuxapp-icc

+++ b/config/defconfig_i686-default-linuxapp-icc

@@ -124,6 +124,7 @@ CONFIG_RTE_LIBEAL_USE_HPET=n

 CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n

 CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n

 CONFIG_RTE_EAL_IGB_UIO=y

+CONFIG_RTE_EAL_VFIO=y



 #

 # Compile Environment Abstraction Layer for linux

diff --git a/config/defconfig_x86_64-default-linuxapp-gcc 
b/config/defconfig_x86_64-default-linuxapp-gcc

index fc69b80..5c682a5 100644

--- a/config/defconfig_x86_64-default-linuxapp-gcc

+++ b/config/defconfig_x86_64-default-linuxapp-gcc

@@ -124,6 +124,7 @@ CONFIG_RTE_LIBEAL_USE_HPET=n

 CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n

 CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n

 CONFIG_RTE_EAL_IGB_UIO=y

+CONFIG_RTE_EAL_VFIO=y



 #

 # Compile Environment Abstraction Layer for linux

diff --git a/config/defconfig_x86_64-default-linuxapp-icc 
b/config/defconfig_x86_64-default-linuxapp-icc

index 4ab45b3..b9bb7f6 100644

--- a/config/defconfig_x86_64-default-linuxapp-icc

+++ b/config/defconfig_x86_64-default-linuxapp-icc

@@ -124,6 +124,7 @@ CONFIG_RTE_LIBEAL_USE_HPET=n

 CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n

 CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n

 CONFIG_RTE_EAL_IGB_UIO=y

+CONFIG_RTE_EAL_VFIO=y



 #

 # Compile Environment Abstraction Layer for linux

--

1.7.0.7



[dpdk-dev] [PATCH v2 06/16] Add support for VFIO in Linuxapp targets

2014-05-27 Thread Xu, HuilongX


Make VFIO compilation optional for all configs.



Signed-off-by: Anatoly Burakov http://dpdk.org/ml/listinfo/dev>>

Test-by: HuilongX Xu 

Compile pass

 >>Compile OS: FC20 x86_64

 >>Kernel version: 3.13.6-200

 >>GCC version: 4.8.2

 >>Server: Crownpass

---

 config/defconfig_i686-default-linuxapp-gcc   |1 +

 config/defconfig_i686-default-linuxapp-icc   |1 +

 config/defconfig_x86_64-default-linuxapp-gcc |1 +

 config/defconfig_x86_64-default-linuxapp-icc |1 +

 4 files changed, 4 insertions(+), 0 deletions(-)



diff --git a/config/defconfig_i686-default-linuxapp-gcc 
b/config/defconfig_i686-default-linuxapp-gcc

index ea90f12..5410f57 100644

--- a/config/defconfig_i686-default-linuxapp-gcc

+++ b/config/defconfig_i686-default-linuxapp-gcc

@@ -124,6 +124,7 @@ CONFIG_RTE_LIBEAL_USE_HPET=n

 CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n

 CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n

 CONFIG_RTE_EAL_IGB_UIO=y

+CONFIG_RTE_EAL_VFIO=y



 #

 # Compile Environment Abstraction Layer for linux

diff --git a/config/defconfig_i686-default-linuxapp-icc 
b/config/defconfig_i686-default-linuxapp-icc

index ecfbf28..1cc 100644

--- a/config/defconfig_i686-default-linuxapp-icc

+++ b/config/defconfig_i686-default-linuxapp-icc

@@ -124,6 +124,7 @@ CONFIG_RTE_LIBEAL_USE_HPET=n

 CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n

 CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n

 CONFIG_RTE_EAL_IGB_UIO=y

+CONFIG_RTE_EAL_VFIO=y



 #

 # Compile Environment Abstraction Layer for linux

diff --git a/config/defconfig_x86_64-default-linuxapp-gcc 
b/config/defconfig_x86_64-default-linuxapp-gcc

index fc69b80..5c682a5 100644

--- a/config/defconfig_x86_64-default-linuxapp-gcc

+++ b/config/defconfig_x86_64-default-linuxapp-gcc

@@ -124,6 +124,7 @@ CONFIG_RTE_LIBEAL_USE_HPET=n

 CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n

 CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n

 CONFIG_RTE_EAL_IGB_UIO=y

+CONFIG_RTE_EAL_VFIO=y



 #

 # Compile Environment Abstraction Layer for linux

diff --git a/config/defconfig_x86_64-default-linuxapp-icc 
b/config/defconfig_x86_64-default-linuxapp-icc

index 4ab45b3..b9bb7f6 100644

--- a/config/defconfig_x86_64-default-linuxapp-icc

+++ b/config/defconfig_x86_64-default-linuxapp-icc

@@ -124,6 +124,7 @@ CONFIG_RTE_LIBEAL_USE_HPET=n

 CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n

 CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n

 CONFIG_RTE_EAL_IGB_UIO=y

+CONFIG_RTE_EAL_VFIO=y



 #

 # Compile Environment Abstraction Layer for linux

--

1.7.0.7



[dpdk-dev] [PATCH v2 05/16] Moved interrupt type out of igb_uio

2014-05-27 Thread Xu, HuilongX

Moving interrupt type enum out of igb_uio and renaming it to be more
generic. Such a strange header naming and separation is done mostly to
make coming virtio patches easier to port to dpdk.org tree.

Signed-off-by: Anatoly Burakov 
Test-by: HuilongX Xu 
Compile pass
 >>Compile OS: FC20 x86_64
 >>Kernel version: 3.13.6-200
 >>GCC version: 4.8.2
 >>Server: Crownpass
---
lib/librte_eal/common/Makefile |1 +
lib/librte_eal/common/include/rte_pci.h|1 +
.../common/include/rte_pci_dev_feature_defs.h  |   46 ++
.../common/include/rte_pci_dev_features.h  |   40 
lib/librte_eal/linuxapp/igb_uio/igb_uio.c  |   49 ---
5 files changed, 109 insertions(+), 28 deletions(-)
create mode 100644 lib/librte_eal/common/include/rte_pci_dev_feature_defs.h
create mode 100644 lib/librte_eal/common/include/rte_pci_dev_features.h

diff --git a/lib/librte_eal/common/Makefile b/lib/librte_eal/common/Makefile
index 2f99bf4..7daf38c 100644
--- a/lib/librte_eal/common/Makefile
+++ b/lib/librte_eal/common/Makefile
@@ -39,6 +39,7 @@ INC += rte_rwlock.h rte_spinlock.h rte_tailq.h 
rte_interrupts.h rte_alarm.h
INC += rte_string_fns.h rte_cpuflags.h rte_version.h rte_tailq_elem.h
INC += rte_eal_memconfig.h rte_malloc_heap.h
INC += rte_hexdump.h rte_devargs.h rte_vdev.h
+INC += rte_pci_dev_feature_defs.h rte_pci_dev_features.h

 ifeq ($(CONFIG_RTE_INSECURE_FUNCTION_WARNING),y)
INC += rte_warnings.h
diff --git a/lib/librte_eal/common/include/rte_pci.h 
b/lib/librte_eal/common/include/rte_pci.h
index 84d7b42..d364cee 100644
--- a/lib/librte_eal/common/include/rte_pci.h
+++ b/lib/librte_eal/common/include/rte_pci.h
@@ -80,6 +80,7 @@ extern "C" {
#include 
#include 
#include 
+
#include 

 TAILQ_HEAD(pci_device_list, rte_pci_device); /**< PCI devices in D-linked Q. */
diff --git a/lib/librte_eal/common/include/rte_pci_dev_feature_defs.h 
b/lib/librte_eal/common/include/rte_pci_dev_feature_defs.h
new file mode 100644
index 000..82f2c00
--- /dev/null
+++ b/lib/librte_eal/common/include/rte_pci_dev_feature_defs.h
@@ -0,0 +1,46 @@
+/*-
+ *   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.
+ */
+
+#ifndef _RTE_PCI_DEV_DEFS_H_
+#define _RTE_PCI_DEV_DEFS_H_
+
+/* interrupt mode */
+enum rte_intr_mode {
+ RTE_INTR_MODE_NONE = 0,
+ RTE_INTR_MODE_LEGACY,
+ RTE_INTR_MODE_MSI,
+ RTE_INTR_MODE_MSIX,
+ RTE_INTR_MODE_MAX
+};
+
+#endif /* _RTE_PCI_DEV_DEFS_H_ */
diff --git a/lib/librte_eal/common/include/rte_pci_dev_features.h 
b/lib/librte_eal/common/include/rte_pci_dev_features.h
new file mode 100644
index 000..61f271a
--- /dev/null
+++ b/lib/librte_eal/common/include/rte_pci_dev_features.h
@@ -0,0 +1,40 @@
+/*-
+ *   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 con

[dpdk-dev] [PATCH v2 07/16] Add support for VFIO interrupts, add VFIO header

2014-05-27 Thread Xu, HuilongX
Creating code to handle VFIO interrupts in EAL interrupts, and also
adding a header eal_vfio.h.

This header checks two things:
* checks if CONFIG_RTE_EAL_VFIO was enabled during build time
* checks that kernel version is 3.6+ so that DPDK would still compile
  on older kernels despite VFIO compilation being enabled by default.

This header also defines a VFIO_PRESENT macro, which should be used to
conditionally compile all the VFIO code. This is because having
CONFIG_RTE_EAL_VFIO enabled doesn't guarantee that the VFIO support is
compiled in, because we're still dependent on kernel version.

Signed-off-by: Anatoly Burakov 
Test-by: HuilongX Xu 
Compile pass
 >>Compile OS: FC20 x86_64
 >>Kernel version: 3.13.6-200
 >>GCC version: 4.8.2
 >>Server: Crownpass
---
lib/librte_eal/linuxapp/eal/eal_interrupts.c   |  203 +++-
lib/librte_eal/linuxapp/eal/include/eal_vfio.h |   49 +
.../linuxapp/eal/include/exec-env/rte_interrupts.h |3 +
3 files changed, 250 insertions(+), 5 deletions(-)
create mode 100644 lib/librte_eal/linuxapp/eal/include/eal_vfio.h

diff --git a/lib/librte_eal/linuxapp/eal/eal_interrupts.c 
b/lib/librte_eal/linuxapp/eal/eal_interrupts.c
index 58e1ddf..cb95e2a 100644
--- a/lib/librte_eal/linuxapp/eal/eal_interrupts.c
+++ b/lib/librte_eal/linuxapp/eal/eal_interrupts.c
@@ -36,7 +36,6 @@
#include 
#include 
#include 
-#include 
#include 
#include 
#include 
@@ -44,6 +43,7 @@
#include 
#include 
#include 
+#include 
 #include 
#include 
@@ -66,6 +66,7 @@
#include 
 #include "eal_private.h"
+#include "eal_vfio.h"
 #define EAL_INTR_EPOLL_WAIT_FOREVER (-1)
@@ -87,6 +88,7 @@ union intr_pipefds{
  */
union rte_intr_read_buffer {
   int uio_intr_count;  /* for uio device */
+ uint64_t vfio_intr_count;/* for vfio device */
   uint64_t timerfd_num;/* for timerfd */
   char charbuf[16];/* for others */
};
@@ -119,6 +121,173 @@ static struct rte_intr_source_list intr_sources;
/* interrupt handling thread */
static pthread_t intr_thread;
+/* VFIO interrupts */
+#ifdef VFIO_PRESENT
+
+#define IRQ_SET_BUF_LEN  (sizeof(struct vfio_irq_set) + sizeof(int))
+
+/* enable legacy (INTx) interrupts */
+static int
+vfio_enable_intx(struct rte_intr_handle *intr_handle) {
+ struct vfio_irq_set * irq_set;
+ char irq_set_buf[IRQ_SET_BUF_LEN];
+ int len, ret;
+ int * fd_ptr;
+
+ len = sizeof(irq_set_buf);
+
+ /* enable INTx */
+ irq_set = (struct vfio_irq_set *) irq_set_buf;
+ irq_set->argsz = len;
+ irq_set->count = 1;
+ irq_set->flags = VFIO_IRQ_SET_DATA_EVENTFD | 
VFIO_IRQ_SET_ACTION_TRIGGER;
+ irq_set->index = VFIO_PCI_INTX_IRQ_INDEX;
+ irq_set->start = 0;
+ fd_ptr = (int*) &irq_set->data;
+ *fd_ptr = intr_handle->fd;
+
+ ret = ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, 
irq_set);
+
+ if (ret) {
+ RTE_LOG(ERR, EAL, "Error enabling INTx interrupts 
for fd %d\n",
+   
  intr_handle->fd);
+ return -1;
+ }
+
+ /* unmask INTx after enabling */
+ memset(irq_set, 0, len);
+ len = sizeof(struct vfio_irq_set);
+ irq_set->argsz = len;
+ irq_set->count = 1;
+ irq_set->flags = VFIO_IRQ_SET_DATA_NONE | 
VFIO_IRQ_SET_ACTION_UNMASK;
+ irq_set->index = VFIO_PCI_INTX_IRQ_INDEX;
+ irq_set->start = 0;
+
+ ret = ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, 
irq_set);
+
+ if (ret) {
+ RTE_LOG(ERR, EAL, "Error unmasking INTx 
interrupts for fd %d\n",
+   
  intr_handle->fd);
+ return -1;
+ }
+ return 0;
+}
+
+/* disable legacy (INTx) interrupts */
+static int
+vfio_disable_intx(struct rte_intr_handle *intr_handle) {
+ struct vfio_irq_set * irq_set;
+ char irq_set_buf[IRQ_SET_BUF_LEN];
+ int len, ret;
+
+ len = sizeof(struct vfio_irq_set);
+
+ /* mask interrupts before disabling */
+ irq_set = (struct vfio_irq_set *) irq_set_buf;
+ irq_set->argsz = len;
+ irq_set->count = 1;
+ irq_set->flags = VFIO_IRQ_SET_DATA_NONE | 
VFIO_IRQ_SET_ACTION_UNMASK;
+ irq_set->index = VFIO_PCI_INTX_IRQ_INDEX;
+ irq_set->start = 0;
+
+ ret = ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, 
irq_set);
+
+ if (ret) {
+ RTE_LOG(ERR, EAL, "Error unmasking INTx 
interrupts for fd %d\n",
+ 

[dpdk-dev] [PATCH v2 08/16] Add support for mapping devices through VFIO.

2014-05-27 Thread Xu, HuilongX
VFIO is kernel 3.6+ only, and so is only compiled when DPDK config
option CONFIG_RTE_EAL_VFIO is enabled, and kernel 3.6 or higher is
detected, thus preventing compile failures on older kernels if VFIO is
enabled in config (and it is, by default).

Since VFIO cannot be used to map the same device twice, secondary
processes receive the device/group fd's by means of communicating over a
local socket. Only group and container fd's should be sent, as device
fd's can be obtained via ioctl() calls' on the group fd.

For multiprocess, VFIO distinguishes between existing but unused groups
(e.g. grups that aren't bound to VFIO driver) and non-existing groups in
order to know if the secondary process requests a valid group, or if
secondary process requests something that doesn't exist.

Signed-off-by: Anatoly Burakov 

Test-by: HuilongX Xu mailto:huilongx.xu at intel.com>>



Compile pass

 >>Compile OS: FC20 x86_64

 >>Kernel version: 3.13.6-200

 >>GCC version: 4.8.2

 >>Server: Crownpass

---
lib/librte_eal/linuxapp/eal/Makefile   |5 +-
lib/librte_eal/linuxapp/eal/eal.c  |1 +
lib/librte_eal/linuxapp/eal/eal_pci_vfio.c |  719 
lib/librte_eal/linuxapp/eal/eal_pci_vfio_socket.c  |  367 ++
.../linuxapp/eal/include/eal_internal_cfg.h|3 +
lib/librte_eal/linuxapp/eal/include/eal_pci_init.h |   55 ++
lib/librte_eal/linuxapp/eal/include/eal_vfio.h |6 +
7 files changed, 1155 insertions(+), 1 deletions(-)
create mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
create mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_vfio_socket.c

diff --git a/lib/librte_eal/linuxapp/eal/Makefile 
b/lib/librte_eal/linuxapp/eal/Makefile
index 527fa2a..3a39cca 100644
--- a/lib/librte_eal/linuxapp/eal/Makefile
+++ b/lib/librte_eal/linuxapp/eal/Makefile
@@ -58,6 +58,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_thread.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_log.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_pci.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_pci_uio.c
+SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_pci_vfio.c
+SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_pci_vfio_socket.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_debug.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_lcore.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_timer.c
@@ -88,12 +90,13 @@ CFLAGS_eal_common_log.o := -D_GNU_SOURCE
CFLAGS_eal_hugepage_info.o := -D_GNU_SOURCE
CFLAGS_eal_pci.o := -D_GNU_SOURCE
CFLAGS_eal_common_whitelist.o := -D_GNU_SOURCE
+CFLAGS_eal_pci_vfio.o := -D_GNU_SOURCE
 # workaround for a gcc bug with noreturn attribute
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
CFLAGS_eal_thread.o += -Wno-return-type
-CFLAGS_eal_hpet.o += -Wno-return-type
+CFLAGS_eal_pci_vfio_socket.o += -Wno-return-type
endif
 INC := rte_per_lcore.h rte_lcore.h rte_interrupts.h rte_kni_common.h 
rte_dom0_common.h
diff --git a/lib/librte_eal/linuxapp/eal/eal.c 
b/lib/librte_eal/linuxapp/eal/eal.c
index de182e1..01bfd6c 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -650,6 +650,7 @@ eal_parse_args(int argc, char **argv)
   internal_config.force_sockets = 0;
   internal_config.syslog_facility = LOG_DAEMON;
   internal_config.xen_dom0_support = 0;
+ internal_config.vfio_intr_mode = RTE_INTR_MODE_MSIX;
#ifdef RTE_LIBEAL_USE_HPET
   internal_config.no_hpet = 0;
#else
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c 
b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
new file mode 100644
index 000..0a6f95c
--- /dev/null
+++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
@@ -0,0 +1,719 @@
+/*-
+ *   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 DIRE

[dpdk-dev] [PATCH v2 09/16] Enable VFIO device binding

2014-05-27 Thread Xu, HuilongX
Add support for binding VFIO devices if RTE_PCI_DRV_NEED_IGB_UIO
is set for this driver. Try VFIO first, if not mapped then try
IGB_UIO too.

Signed-off-by: Anatoly Burakov 



Test-by: HuilongX Xu huilongx.xu at intel.com

Compile pass



 >>Compile OS: FC20 x86_64



 >>Kernel version: 3.13.6-200



 >>GCC version: 4.8.2



 >>Server: Crownpass

---
lib/librte_eal/linuxapp/eal/eal_pci.c |   55 -
1 files changed, 54 insertions(+), 1 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c 
b/lib/librte_eal/linuxapp/eal/eal_pci.c
index 7256406..953abe6 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -401,6 +401,7 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, 
struct rte_pci_device *d
{
   struct rte_pci_id *id_table;
   int ret = 0;
+ int mapped = 0;
for (id_table = dr->id_table ; id_table->vendor_id != 0; 
id_table++) {
@@ -435,8 +436,17 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, 
struct rte_pci_device *d
   }
if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) {
+ /* try mapping the NIC resources 
using VFIO if it exists */
+#ifdef VFIO_PRESENT
+ if (vfio_cfg.vfio_enabled) {
+ if ((ret = 
pci_vfio_map_resource(dev)) == 0)
+ 
mapped = 1;
+ else if (ret < 0)
+ 
return ret;
+ }
+#endif
   /* map resources for devices 
that use igb_uio */
-  if ((ret = 
pci_uio_map_resource(dev)) != 0)
+ if (!mapped && (ret = 
pci_uio_map_resource(dev)) != 0)
   return ret;
   } else if (dr->drv_flags & 
RTE_PCI_DRV_FORCE_UNBIND &&
  rte_eal_process_type() == 
RTE_PROC_PRIMARY) {
@@ -471,5 +481,48 @@ rte_eal_pci_init(void)
   RTE_LOG(ERR, EAL, "%s(): Cannot scan PCI bus\n", 
__func__);
   return -1;
   }
+#ifdef VFIO_PRESENT
+ memset(&vfio_cfg, 0, sizeof(vfio_cfg));
+
+ /* initialize group list */
+ int i, ret;
+
+ for (i = 0; i < VFIO_MAX_GROUPS; i++) {
+ vfio_cfg.vfio_groups[i].fd = -1;
+ vfio_cfg.vfio_groups[i].group_no = -1;
+ }
+ vfio_cfg.vfio_container_fd = -1;
+
+ /* check if we have VFIO driver enabled */
+ if (access(VFIO_DIR, F_OK) == 0) {
+ static int socket_fd;
+
+ vfio_cfg.vfio_enabled = 1;
+
+ /* if we are primary process, create a thread to 
communicate with
+ * secondary processes. the thread will use a 
socket to wait for
+ * requests from secondary process to send open 
file descriptors,
+ * because VFIO does not allow multiple open 
descriptors on a group or
+ * VFIO container.
+ */
+ if (internal_config.process_type == 
RTE_PROC_PRIMARY) {
+ /* set up local socket */
+ if ((socket_fd = 
pci_vfio_socket_setup()) < 0) {
+ RTE_LOG(ERR, EAL, 
"Failed to set up local socket!\n");
+ return -1;
+ }
+ ret = 
pthread_create(&socket_thread, NULL,
+ 
pci_vfio_socket_thread, (void*) &socket_fd);
+ if (ret) {
+ RTE_LOG(ERR, EAL,
+ 
"Failed to create thread for communication with secondary "
+ 
"processes!\n");
+ return -1;
+ }
+ }
+ }
+ else
+ RTE_LOG(INFO, EAL, "VFIO dri

[dpdk-dev] [PATCH v2 10/16] Added support for selecting VFIO interrupt type from EAL command-line

2014-05-27 Thread Xu, HuilongX
Anatoly Burakov anatoly.burakov at intel.com
Mon May 19 17:51:43 CEST 2014
Previous message: [dpdk-dev] [PATCH v2 09/16] Enable VFIO device binding
Next message: [dpdk-dev] [PATCH v2 10/16] Added support for selecting VFIO 
interrupt type from EAL command-line
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Unlike igb_uio, VFIO interrupt type is not set by kernel module
parameters but is set up via ioctl() calls at runtime. This warrants
a new EAL command-line parameter. It will have no effect if VFIO is
not compiled, but will set VFIO interrupt type to either "legacy" or
"msix" if VFIO support is compiled. Note that VFIO initialization will
fail if the interrupt type selected is not supported by the system.

Signed-off-by: Anatoly Burakov 

Test-by: HuilongX Xu huilongx.xu at intel.com

Compile pass

 >>Compile OS: FC20 x86_64

 >>Kernel version: 3.13.6-200

 >>GCC version: 4.8.2

 >>Server: Crownpass
---
lib/librte_eal/linuxapp/eal/eal.c |   32 
1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal.c 
b/lib/librte_eal/linuxapp/eal/eal.c
index 01bfd6c..bae1078 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -99,6 +99,7 @@
#define OPT_BASE_VIRTADDR   "base-virtaddr"
#define OPT_XEN_DOM0"xen-dom0"
#define OPT_CREATE_UIO_DEV "create-uio-dev"
+#define OPT_VFIO_INTR"vfio-intr"
 #define RTE_EAL_BLACKLIST_SIZE  0x100
@@ -361,6 +362,7 @@ eal_usage(const char *prgname)
  "  --"OPT_VMWARE_TSC_MAP": use VMware TSC map instead of "
  "native RDTSC\n"
  "  --"OPT_BASE_VIRTADDR": specify base virtual address\n"
+"  --"OPT_VFIO_INTR": specify desired interrupt mode for 
VFIO (intx|msix)\n"
  "  --"OPT_CREATE_UIO_DEV": create /dev/uioX (usually done 
by hotplug)\n"
  "\nEAL options for DEBUG use only:\n"
  "  --"OPT_NO_HUGE"  : use malloc instead of hugetlbfs\n"
@@ -579,6 +581,27 @@ eal_parse_base_virtaddr(const char *arg)
   return 0;
}
+static int
+eal_parse_vfio_intr(const char *mode)
+{
+ unsigned i;
+ static struct {
+ const char *name;
+ enum rte_intr_mode value;
+ } map[] = {
+ { "legacy", RTE_INTR_MODE_LEGACY },
+ { "msix", RTE_INTR_MODE_MSIX },
+ };
+
+ for (i = 0; i < RTE_DIM(map); i++) {
+ if (!strcmp(mode, map[i].name)) {
+ internal_config.vfio_intr_mode = 
map[i].value;
+ return 0;
+ }
+ }
+ return -1;
+}
+
static inline size_t
eal_get_hugepage_mem_size(void)
{
@@ -633,6 +656,7 @@ eal_parse_args(int argc, char **argv)
   {OPT_PCI_BLACKLIST, 1, 0, 0},
   {OPT_VDEV, 1, 0, 0},
   {OPT_SYSLOG, 1, NULL, 0},
+ {OPT_VFIO_INTR, 1, NULL, 0},
   {OPT_BASE_VIRTADDR, 1, 0, 0},
   {OPT_XEN_DOM0, 0, 0, 0},
   {OPT_CREATE_UIO_DEV, 1, NULL, 0},
@@ -828,6 +852,14 @@ eal_parse_args(int argc, char **argv)
   
return -1;
   }
   }
+ else if 
(!strcmp(lgopts[option_index].name, OPT_VFIO_INTR)) {
+ if 
(eal_parse_vfio_intr(optarg) < 0) {
+ 
RTE_LOG(ERR, EAL, "invalid parameters for --"
+   
  OPT_VFIO_INTR "\n");
+ 
eal_usage(prgname);
+ 
return -1;
+ }
+ }
   else if 
(!strcmp(lgopts[option_index].name, OPT_CREATE_UIO_DEV)) {
   
internal_config.create_uio_dev = 1;
   }
--
1.7.0.7


[dpdk-dev] [PATCH v2 11/16] Make --no-huge use mmap instead of malloc

2014-05-27 Thread Xu, HuilongX
This makes it possible to run DPDK without hugepage memory when VFIO

is used, as VFIO uses virtual addresses to set up DMA mappings.



Signed-off-by: Anatoly Burakov http://dpdk.org/ml/listinfo/dev>>

Test-by: HuilongX Xu huilongx.xu at intel.com



Compile pass

 >>Compile OS: FC20 x86_64

 >>Kernel version: 3.13.6-200

 >>GCC version: 4.8.2

 >>Server: Crownpass

---

 lib/librte_eal/linuxapp/eal/eal_memory.c |8 +++-

 1 files changed, 7 insertions(+), 1 deletions(-)



diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c 
b/lib/librte_eal/linuxapp/eal/eal_memory.c

index 5a10a80..3fc0d28 100644

--- a/lib/librte_eal/linuxapp/eal/eal_memory.c

+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c

@@ -1031,7 +1031,13 @@ rte_eal_hugepage_init(void)



/* hugetlbfs can be disabled */

if (internal_config.no_hugetlbfs) {

-  addr = malloc(internal_config.memory);

+  addr = mmap(NULL, internal_config.memory, PROT_READ | PROT_WRITE,

+  MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);

+  if (addr == MAP_FAILED) {

+  RTE_LOG(ERR, EAL, "%s: mmap() failed: %s\n", __func__,

+ strerror(errno));

+  return -1;

+  }

   mcfg->memseg[0].phys_addr = (phys_addr_t)(uintptr_t)addr;

   mcfg->memseg[0].addr = addr;

   mcfg->memseg[0].len = internal_config.memory;

--

1.7.0.7



[dpdk-dev] [PATCH v2 12/16] Adding unit tests for VFIO EAL command-line parameter

2014-05-27 Thread Xu, HuilongX
Adding unit tests for VFIO interrupt type command-line parameter.
We don't know if VFIO is compiled (eal_vfio.h header is internal
to Linuxapp EAL), so we check this flag regardless.

Signed-off-by: Anatoly Burakov http://dpdk.org/ml/listinfo/dev>>

Test-by: HuilongX Xu 

Compile pass

 >>Compile OS: FC20 x86_64

 >>Kernel version: 3.13.6-200

 >>GCC version: 4.8.2

 >>Server: Crownpass

---
app/test/test_eal_flags.c |   24 
1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
index 195a1f5..081b47f 100644
--- a/app/test/test_eal_flags.c
+++ b/app/test/test_eal_flags.c
@@ -768,6 +768,18 @@ test_misc_flags(void)
   const char *argv11[] = {prgname, "--file-prefix=virtaddr",
   "-c", "1", "-n", "2", 
"--base-virtaddr=0x12345678"};
+ /* try running with --vfio-intr INTx flag */
+ const char *argv12[] = {prgname, "--file-prefix=intr",
+ "-c", "1", "-n", "2", 
"--vfio-intr=legacy"};
+
+ /* try running with --vfio-intr MSI-X flag */
+ const char *argv13[] = {prgname, "--file-prefix=intr",
+ "-c", "1", "-n", "2", 
"--vfio-intr=msix"};
+
+ /* try running with --vfio-intr invalid flag */
+ const char *argv14[] = {prgname, "--file-prefix=intr",
+ "-c", "1", "-n", "2", 
"--vfio-intr=invalid"};
+
if (launch_proc(argv0) == 0) {
   printf("Error - process ran ok with invalid 
flag\n");
@@ -820,6 +832,18 @@ test_misc_flags(void)
   printf("Error - process did not run ok with 
--base-virtaddr parameter\n");
   return -1;
   }
+ if (launch_proc(argv12) != 0) {
+ printf("Error - process did not run ok with 
--vfio-intr INTx parameter\n");
+ return -1;
+ }
+ if (launch_proc(argv13) != 0) {
+ printf("Error - process did not run ok with 
--vfio-intr MSI-X parameter\n");
+ return -1;
+ }
+ if (launch_proc(argv14) == 0) {
+ printf("Error - process run ok with --vfio-intr 
invalid parameter\n");
+ return -1;
+ }
   return 0;
}
#endif
--
1.7.0.7



[dpdk-dev] [PATCH v2 12/16] Adding unit tests for VFIO EAL command-line parameter

2014-05-27 Thread Xu, HuilongX

Adding unit tests for VFIO interrupt type command-line parameter.
We don't know if VFIO is compiled (eal_vfio.h header is internal
to Linuxapp EAL), so we check this flag regardless.

Signed-off-by: Anatoly Burakov http://dpdk.org/ml/listinfo/dev>>

Test-by: HuilongX Xu 

Compile pass

 >>Compile OS: FC20 x86_64

 >>Kernel version: 3.13.6-200

 >>GCC version: 4.8.2

 >>Server: Crownpass

---
app/test/test_eal_flags.c |   24 
1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
index 195a1f5..081b47f 100644
--- a/app/test/test_eal_flags.c
+++ b/app/test/test_eal_flags.c
@@ -768,6 +768,18 @@ test_misc_flags(void)
   const char *argv11[] = {prgname, "--file-prefix=virtaddr",
   "-c", "1", "-n", "2", 
"--base-virtaddr=0x12345678"};
+ /* try running with --vfio-intr INTx flag */
+ const char *argv12[] = {prgname, "--file-prefix=intr",
+ "-c", "1", "-n", "2", 
"--vfio-intr=legacy"};
+
+ /* try running with --vfio-intr MSI-X flag */
+ const char *argv13[] = {prgname, "--file-prefix=intr",
+ "-c", "1", "-n", "2", 
"--vfio-intr=msix"};
+
+ /* try running with --vfio-intr invalid flag */
+ const char *argv14[] = {prgname, "--file-prefix=intr",
+ "-c", "1", "-n", "2", 
"--vfio-intr=invalid"};
+
if (launch_proc(argv0) == 0) {
   printf("Error - process ran ok with invalid 
flag\n");
@@ -820,6 +832,18 @@ test_misc_flags(void)
   printf("Error - process did not run ok with 
--base-virtaddr parameter\n");
   return -1;
   }
+ if (launch_proc(argv12) != 0) {
+ printf("Error - process did not run ok with 
--vfio-intr INTx parameter\n");
+ return -1;
+ }
+ if (launch_proc(argv13) != 0) {
+ printf("Error - process did not run ok with 
--vfio-intr MSI-X parameter\n");
+ return -1;
+ }
+ if (launch_proc(argv14) == 0) {
+ printf("Error - process run ok with --vfio-intr 
invalid parameter\n");
+ return -1;
+ }
   return 0;
}
#endif
--
1.7.0.7



[dpdk-dev] [PATCH v2 13/16] Removed PCI ID table from igb_uio

2014-05-27 Thread Xu, HuilongX
Note that since igb_uio no longer has a PCI ID list, it can now be
bound to any device, not just those explicitly supported by DPDK. In
other words, it now behaves similar to PCI stub, VFIO and other generic
PCI drivers.

Therefore to bind a new device to igb_uio, the user will now have to
first write its PCI ID to "new_id" file inside the igb_uio driver
directory, and only then write the PCI ID to "bind". This will be
reflected in later changes to PCI binding script as well.

Signed-off-by: Anatoly Burakov 

Test-by: HuilongX Xu 



Compile pass

 >>Compile OS: FC20 x86_64

 >>Kernel version: 3.13.6-200

 >>GCC version: 4.8.2

 >>Server: Crownpass
---
lib/librte_eal/linuxapp/igb_uio/igb_uio.c |   21 +
1 files changed, 1 insertions(+), 20 deletions(-)

diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c 
b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
index 043c0f6..d30c94a 100644
--- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
+++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
@@ -65,25 +65,6 @@ struct rte_uio_pci_dev {
static char *intr_mode = NULL;
static enum rte_intr_mode igbuio_intr_mode_preferred = RTE_INTR_MODE_MSIX;
-/* PCI device id table */
-static struct pci_device_id igbuio_pci_ids[] = {
-#define RTE_PCI_DEV_ID_DECL_EM(vend, dev) {PCI_DEVICE(vend, dev)},
-#define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) {PCI_DEVICE(vend, dev)},
-#define RTE_PCI_DEV_ID_DECL_IGBVF(vend, dev) {PCI_DEVICE(vend, dev)},
-#define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) {PCI_DEVICE(vend, dev)},
-#define RTE_PCI_DEV_ID_DECL_IXGBEVF(vend, dev) {PCI_DEVICE(vend, dev)},
-#ifdef RTE_LIBRTE_VIRTIO_PMD
-#define RTE_PCI_DEV_ID_DECL_VIRTIO(vend, dev) {PCI_DEVICE(vend, dev)},
-#endif
-#ifdef RTE_LIBRTE_VMXNET3_PMD
-#define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev) {PCI_DEVICE(vend, dev)},
-#endif
-#include 
-{ 0, },
-};
-
-MODULE_DEVICE_TABLE(pci, igbuio_pci_ids);
-
static inline struct rte_uio_pci_dev *
igbuio_get_uio_pci_dev(struct uio_info *info)
{
@@ -620,7 +601,7 @@ igbuio_config_intr_mode(char *intr_str)
 static struct pci_driver igbuio_pci_driver = {
   .name = "igb_uio",
-  .id_table = igbuio_pci_ids,
+ .id_table = NULL,
   .probe = igbuio_pci_probe,
   .remove = igbuio_pci_remove,
};
--
1.7.0.7


[dpdk-dev] [PATCH v2 14/16] Renamed igb_uio_bind to dpdk_nic_bind

2014-05-27 Thread Xu, HuilongX
Renaming the igb_uio_bind script to dpdk_nic_bind to have a generic

name since we're now supporting two drivers.



Signed-off-by: Anatoly Burakov http://dpdk.org/ml/listinfo/dev>>

Test-by: HuilongX Xu 



Compile pass

 >>Compile OS: FC20 x86_64

 >>Kernel version: 3.13.6-200

 >>GCC version: 4.8.2

 >>Server: Crownpass

---

 tools/{igb_uio_bind.py => dpdk_nic_bind.py} |0

 1 files changed, 0 insertions(+), 0 deletions(-)

 rename tools/{igb_uio_bind.py => dpdk_nic_bind.py} (100%)



diff --git a/tools/igb_uio_bind.py b/tools/dpdk_nic_bind.py

similarity index 100%

rename from tools/igb_uio_bind.py

rename to tools/dpdk_nic_bind.py

--

1.7.0.7



[dpdk-dev] [PATCH v2 15/16] Added support for VFIO drivers in dpdk_nic_bind.py

2014-05-27 Thread Xu, HuilongX
Since igb_uio no longer has a PCI ID list, the script will no
longer distinguish between supported and unsupported NICs.

There's a weird behaviour of sysfs when a new device ID is added to
new_id. Subsequent writing to "bind" will result in IOError on
closing the file. This error is harmless but it triggers the
exception anyway, so in order to work around that, we check if the
device was actually bound to the driver before raising an error.

Signed-off-by: Anatoly Burakov 

Test-by: HuilongX Xu 

Compile pass

 >>Compile OS: FC20 x86_64

 >>Kernel version: 3.13.6-200

 >>GCC version: 4.8.2

 >>Server: Crownpass

---
tools/dpdk_nic_bind.py |  163 ++--
1 files changed, 89 insertions(+), 74 deletions(-)

diff --git a/tools/dpdk_nic_bind.py b/tools/dpdk_nic_bind.py
index 824aa2b..06fb28a 100755
--- a/tools/dpdk_nic_bind.py
+++ b/tools/dpdk_nic_bind.py
@@ -42,8 +42,8 @@ ETHERNET_CLASS = "0200"
# global dict ethernet devices present. Dictionary indexed by PCI address.
# Each device within this is itself a dictionary of device properties
devices = {}
-# list of vendor:device pairs (again stored as dictionary) supported by igb_uio
-module_dev_ids = []
+# list of supported DPDK drivers
+dpdk_drivers = [ "igb_uio", "vfio-pci" ]
 def usage():
 '''Print usage information for the program'''
@@ -147,64 +147,70 @@ def find_module(mod):
 return path
 def check_modules():
-'''Checks that the needed modules (igb_uio) is loaded, and then
-determine from the .ko file, what its supported device ids are'''
-global module_dev_ids
+'''Checks that the needed modules (igb_uio or vfio_pci) are loaded'''
+global dpdk_drivers

 fd = file("/proc/modules")
 loaded_mods = fd.readlines()
 fd.close()
-mod = "igb_uio"
+
+# list of supported modules
+mods =  [{"Name" : driver, "Found" : False} for driver in dpdk_drivers]

 # first check if module is loaded
-found = False
 for line in loaded_mods:
-if line.startswith(mod):
-found = True
-break
-if not found:
-print "Error - module %s not loaded" %mod
-sys.exit(1)
-
-# now find the .ko and get list of supported vendor/dev-ids
-modpath = find_module(mod)
-if modpath is None:
-print "Cannot find module file %s" % (mod + ".ko")
+for mod in mods:
+if line.startswith(mod["Name"]):
+mod["Found"] = True
+# special case for vfio_pci (module is named vfio-pci,
+# but its .ko is named vfio_pci)
+elif line.replace("_", "-").startswith(mod["Name"]):
+mod["Found"] = True
+
+# check if we have at least one loaded module
+if True not in [mod["Found"] for mod in mods]:
+print "Error - no supported modules are loaded"
 sys.exit(1)
-depmod_output = check_output(["depmod", "-n", modpath]).splitlines()
-for line in depmod_output:
-if not line.startswith("alias"):
-continue
-if not line.endswith(mod):
-continue
-lineparts = line.split()
-if not(lineparts[1].startswith("pci:")):
-continue;
-else:
-lineparts[1] = lineparts[1][4:]
-vendor = lineparts[1][:9]
-device = lineparts[1][9:18]
-if vendor.startswith("v") and device.startswith("d"):
-module_dev_ids.append({"Vendor": int(vendor[1:],16),
-   "Device": int(device[1:],16)})
-
-def is_supported_device(dev_id):
-'''return true if device is supported by igb_uio, false otherwise'''
-for dev in module_dev_ids:
-if (dev["Vendor"] == devices[dev_id]["Vendor"] and
-dev["Device"] == devices[dev_id]["Device"]):
-return True
-return False
+
+# change DPDK driver list to only contain drivers that are loaded
+dpdk_drivers = [mod["Name"] for mod in mods if mod["Found"]]
+
 def has_driver(dev_id):
 '''return true if a device is assigned to a driver. False otherwise'''
 return "Driver_str" in devices[dev_id]
+def get_pci_device_details(dev_id):
+'''This function gets additional details for a PCI device'''
+device = {}
+
+extra_info = check_output(["lspci", "-vmmks", dev_id]).splitlines()
+
+# parse lspci details
+for line in extra_info:
+if len(line) == 0:
+continue
+name, value = line.split("\t", 1)
+name = name.strip(":") + "_str"
+device[name] = value
+# check for a unix interface name
+sys_path = "/sys/bus/pci/devices/%s/net/" % dev_id
+if exists(sys_path):
+device["Interface"] = ",".join(os.listdir(sys_path))
+else:
+device["Interface"] = ""
+# check if a port is used for ssh connection
+device["Ssh_if"] = False
+device["Active"] = ""
+
+return device
+
def get_nic_details():
 '''This function populates the "devices" dictionar

[dpdk-dev] [PATCH v2 16/16] Adding support for VFIO to setup.sh

2014-05-27 Thread Xu, HuilongX
Support for loading/unloading VFIO drivers, binding/unbinding
devices to/from VFIO, also setting up correct userspace permissions.

Signed-off-by: Anatoly Burakov 
Test-by: HuilongX Xu huilongx.xu at intel.com
Based-commit: 356cb732d5381140f42ef8b55492339579854986
Compile patch: pass
Function test(include setup.sh test): pass
 >>Compile OS: FC20 X86_64
 >>Kernel version: 3.13.6-200.
 >>GCC version: 4.8.2
 >>CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
 >>NIC: Niantic 82599
---
tools/setup.sh |  168 
1 files changed, 145 insertions(+), 23 deletions(-)

diff --git a/tools/setup.sh b/tools/setup.sh
index 39be8fc..2ffa55a 100755
--- a/tools/setup.sh
+++ b/tools/setup.sh
@@ -187,6 +187,52 @@ load_igb_uio_module()
}
 #
+# Unloads VFIO modules.
+#
+remove_vfio_module()
+{
+ echo "Unloading any existing VFIO module"
+ /sbin/lsmod | grep -s vfio > /dev/null
+ if [ $? -eq 0 ] ; then
+ sudo /sbin/rmmod vfio-pci
+ sudo /sbin/rmmod vfio_iommu_type1
+ sudo /sbin/rmmod vfio
+ fi
+}
+
+#
+# Loads new vfio-pci (and vfio module if needed).
+#
+load_vfio_module()
+{
+ remove_vfio_module
+
+ echo "Loading VFIO module"
+ /sbin/lsmod | grep -s vfio_pci > /dev/null
+ if [ $? -ne 0 ] ; then
+ if [ -f /lib/modules/$(uname 
-r)/kernel/drivers/vfio/pci/vfio-pci.ko ] ; then
+ sudo /sbin/modprobe vfio-pci
+ fi
+ fi
+
+ # make sure regular users can read /dev/vfio
+ echo "chmod /dev/vfio"
+ sudo /usr/bin/chmod a+x /dev/vfio
+ if [ $? -ne 0 ] ; then
+ echo "FAIL"
+ quit
+ fi
+ echo "OK"
+
+ # check if /dev/vfio/vfio exists - that way we
+ # know we either loaded the module, or it was
+ # compiled into the kernel
+ if [ ! -e /dev/vfio/vfio ] ; then
+ echo "## ERROR: VFIO not found!"
+ fi
+}
+
+#
# Unloads the rte_kni.ko module.
#
remove_kni_module()
@@ -223,6 +269,53 @@ load_kni_module()
}
 #
+# Sets appropriate permissions on /dev/vfio/* files
+#
+set_vfio_permissions()
+{
+ # make sure regular users can read /dev/vfio
+ echo "chmod /dev/vfio"
+ sudo /usr/bin/chmod a+x /dev/vfio
+ if [ $? -ne 0 ] ; then
+ echo "FAIL"
+ quit
+ fi
+ echo "OK"
+
+ # make sure regular user can access everything inside /dev/vfio
+ echo "chmod /dev/vfio/*"
+ sudo /usr/bin/chmod 0666 /dev/vfio/*
+ if [ $? -ne 0 ] ; then
+ echo "FAIL"
+ quit
+ fi
+ echo "OK"
+
+ # since permissions are only to be set when running as
+ # regular user, we only check ulimit here
+ #
+ # warn if regular user is only allowed
+ # to memlock <64M of memory
+ MEMLOCK_AMNT=`ulimit -l`
+
+ if [ "$MEMLOCK_AMNT" != "unlimited" ] ; then
+ MEMLOCK_MB=`expr $MEMLOCK_AMNT / 1024`
+ echo ""
+ echo "Current user memlock limit: ${MEMLOCK_MB} 
MB"
+ echo ""
+ echo "This is the maximum amount of memory you 
will be"
+ echo "able to use with DPDK and VFIO if run as 
current user."
+ echo "To change this, please adjust limits.conf 
memlock limit for current user."
+
+ if [ $MEMLOCK_AMNT -lt 65536 ] ; then
+ echo ""
+ echo "## WARNING: memlock limit 
is less than 64MB"
+ echo "## DPDK with VFIO may not 
be able to initialize if run as current user."
+ fi
+ fi
+}
+
+#
# Removes all reserved hugepages.
#
clear_huge_pages()
@@ -324,13 +417,13 @@ grep_meminfo()
}
 #
-# Calls igb_uio_bind.py --status to show the NIC and what they
+# Calls dpdk_nic_bind.py --status to show the NIC and what they
# are all bound to, in terms of drivers.
#
show_nics()
{
   if  /sbin/lsmod  | grep -q igb_uio ; then
-  ${RTE_SDK}/tools/igb_uio_bind.py --status
+ ${RTE_SDK}/tools/dpdk_nic_bind.py --status
   else
echo "# Please load the 'igb_uio' kernel module 
before querying or "
   echo "# adj

[dpdk-dev] [PATCH v2 4/5] i40e: set crc stripping in rx queue configuration

2014-09-29 Thread Xu, HuilongX
Tested-by: HuilongX xu 

This patch has been verified on FC20 with eagle fountain:4*10G fortville, 
spirit falls 1*40G fortville and 2*40G fortville.
The VF is greater by SRIOV, and testpmd should be run on host to support  VF 
work on VM.

CRC stripping function works well in the testpmd app in VM and host.

Test environment information detail information as the following:
HOST environment:
CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
OS: Linux 3.11.10-301.fc20.x86_64
GCC: 4.8.3
NIC: Eagle Fountain:4*10G fortville, Spirit Falls 1*40G fortville and 2*40G 
fortville.

VM environment generated by KVM:
CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
OS: Linux 3.11.10-301.fc20.x86_64
GCC: 4.8.2
NIC: VF generated through SRIOV   

-Original Message-
From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Helin Zhang
Sent: Sunday, September 14, 2014 10:48 PM
To: dev at dpdk.org
Subject: [dpdk-dev] [PATCH v2 4/5] i40e: set crc stripping in rx queue 
configuration

It enables/disables the crc stripping in the rx queue contexts,
according to the extra configuration carried from VF.

v2 changes:
* Put setting the crc stripping into a single patch.

Signed-off-by: Helin Zhang 
Reviewed-by: Jingjing Wu 
Reviewed-by: Jing Chen 
---
 lib/librte_pmd_i40e/i40e_pf.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/librte_pmd_i40e/i40e_pf.c b/lib/librte_pmd_i40e/i40e_pf.c
index bc9bfcb..2910fd5 100644
--- a/lib/librte_pmd_i40e/i40e_pf.c
+++ b/lib/librte_pmd_i40e/i40e_pf.c
@@ -357,7 +357,10 @@ i40e_pf_host_hmc_config_rxq(struct i40e_hw *hw,
rx_ctx.tphdata_ena = 1;
rx_ctx.tphhead_ena = 1;
rx_ctx.lrxqthresh = 2;
-   rx_ctx.crcstrip = 1;
+   if (qpei) /* For DPDK PF host */
+   rx_ctx.crcstrip = qpei->crcstrip ? 1 : 0;
+   else /* For Linux PF host */
+   rx_ctx.crcstrip = 1;
rx_ctx.l2tsel = 1;
rx_ctx.prefena = 1;

-- 
1.8.1.4



[dpdk-dev] [PATCH 00/15] i40e base driver update

2014-09-29 Thread Xu, HuilongX
Tested-by: HuilongX xu 

This patch has been verified on FC20 with Eagle Fountain: 4*10G , Spirit Falls: 
1*40G fortvill and 2*40G fortvill.
The i40e base driver update patch works well on FC20 with basic function and 
performance.

The test environment detail information as the following:
HOST environment:
CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
OS: Linux 3.11.10-301.fc20.x86_64
GCC: 4.8.3
NIC: Eagle Fountain: 4*10G , Spirit Falls: 1*40G fortvill and 2*40G fortvill.

-Original Message-
From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Helin Zhang
Sent: Tuesday, September 09, 2014 3:21 PM
To: dev at dpdk.org
Subject: [dpdk-dev] [PATCH 00/15] i40e base driver udpate

Here is the update of i40e base driver. Also it involves a few
relevant necessary code changes in i40e PMD.

Helin Zhang (15):
  i40e: make the indentation more consistent in share code
  i40e: support nvmupdate by default
  i40e: remove useless code which was written for Solaris
  i40e: remove test code for 'ethtool'
  i40e: force a shifted '1' to be 'unsigned'
  i40e: remove useless code for pre-boot support
  i40e: Get rid of sparse warnings, and remove unreachable code
  i40e: remove code which is for software validation only
  i40e: remove code for TPH (TLP Processing Hints)
  i40e: support of 10G base T
  i40e: expose debug_write_register request
  i40e: workaround of get_firmware_version, and enhancements
  i40e: Use get_link_status to report FC settings
  i40e: fix and enhancement in arq_event_info struct
  i40e: support redefined struct of 'i40e_arq_event_info'

 lib/librte_pmd_i40e/i40e/i40e_adminq.c |   55 +-
 lib/librte_pmd_i40e/i40e/i40e_adminq.h |5 +-
 lib/librte_pmd_i40e/i40e/i40e_adminq_cmd.h | 2132 ++--
 lib/librte_pmd_i40e/i40e/i40e_common.c |  173 +--
 lib/librte_pmd_i40e/i40e/i40e_dcb.c|  625 
 lib/librte_pmd_i40e/i40e/i40e_dcb.h|  103 --
 lib/librte_pmd_i40e/i40e/i40e_diag.c   |   10 -
 lib/librte_pmd_i40e/i40e/i40e_hmc.h|5 +-
 lib/librte_pmd_i40e/i40e/i40e_lan_hmc.c|  227 +--
 lib/librte_pmd_i40e/i40e/i40e_lan_hmc.h|   14 -
 lib/librte_pmd_i40e/i40e/i40e_nvm.c|  120 +-
 lib/librte_pmd_i40e/i40e/i40e_prototype.h  |   19 +-
 lib/librte_pmd_i40e/i40e/i40e_type.h   |   49 +-
 lib/librte_pmd_i40e/i40e_ethdev.c  |8 +-
 lib/librte_pmd_i40e/i40e_ethdev_vf.c   |   10 +-
 15 files changed, 1242 insertions(+), 2313 deletions(-)

-- 
1.8.1.4



[dpdk-dev] [PATCH] i40evf: fix of supporting jumbo frame

2015-04-23 Thread Xu, HuilongX
Tested-by:huilong xu 

 - Tested Commit: 0095bb6dd77a6b4570af27320187e63bf37500c6
 - OS: FC20 3.11.10-301.fc20.x86_64
 - GCC: gcc version 4.8.3 20140911 (Red Hat 4.8.3-7) (GCC)
 - CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
 - NIC: Ethernet controller [0200]: Intel Corporation Ethernet Controller XL710 
for 40GbE QSFP+ [8086:1584]

 - Default x86_64-native-linuxapp-gcc configuration
 - Total 6 cases, 6 passed, 0 failed

   1vf/1pf test environment set up:
1.build and install dpdk driver, bind igb_uio to PF
2.create 1vf in host
  echo 1 > ./devices/pci:80/:80:00.0/:83:00.0/max_vfs
echo 1 > ./devices/pci:80/:80:02.0/:85:00.0/max_vfs
3. dettach VF nic
  virsh nodedev-dettach pci__83_02_0
  virsh nodedev-dettach pci__85_02_0
4. run testpmd in host
   ./testpmd -c f -n 4 -- -i --max-pkt-len=9000

5. start vm
   taskset -c 6-10 qemu-system-x86_64 \
   -enable-kvm -m 8192  -smp 2 -cpu host -name dpdk15-vm2 \
   -drive file=/home/image/vdisk02-sriov-fc20.img \
   -net tap,script=/etc/qemu-ifup \
   -device pci-assign,bus=pci.0,addr=0xb,host=83:02.0 \
   -device pci-assign,bus=pci.0,addr=0xc,host=85:02.0 \
   -mem-path /dev/hugepages -mem-prealloc \
   -vnc :12 -daemonize
6. in VM build and install dpdk driver ,bind igb_uio to VF
7. run testpmd in VM
   ./testpmd -c f -n 4 -- -i --max-pkt-len=9000 --txqflags=0
8. exec cmd line in vm
set fwd mac
start
 - Case 1:  send package dst mac is VF MAC, pkt size 9000, ixia can received 
package and size is 9000,this case passed
 - Case 2:  send package dst mac is VF MAC, pkt size 9001, ixia can't received 
package, this case passed

 - Case 3:  send package dst mac is VF MAC, pkt size 8999, ixia can received 
package and size is 8999,this case passed

  2vf/1pf test environment set up:
1.build and install dpdk driver, bind igb_uio to PF
2.create 1vf in host
  echo 2 > ./devices/pci:80/:80:02.0/:83:00.0/max_vfs
3. dettach VF nic
  virsh nodedev-dettach pci__83_02_0
  virsh nodedev-dettach pci__83_02_1
4. run testpmd in host
   ./testpmd -c f -n 4 -- -i --max-pkt-len=9000
5. start vm
   taskset -c 6-10 qemu-system-x86_64 \
   -enable-kvm -m 8192  -smp 2 -cpu host -name dpdk15-vm2 \
   -drive file=/home/image/vdisk02-sriov-fc20.img \
   -net tap,script=/etc/qemu-ifup \
   -device pci-assign,bus=pci.0,addr=0xb,host=83:02.0 \
   -device pci-assign,bus=pci.0,addr=0xb,host=83:02.1 \
   -mem-path /dev/hugepages -mem-prealloc \
   -vnc :12 -daemonize
6. in VM build and install dpdk driver ,bind igb_uio to VF
7. run testpmd in VM
   ./testpmd -c f -n 4 -- -i --max-pkt-len=9000 --txqflags=0
8. exec cmd line in vm
set fwd mac
start
- Case 1:  send package dst mac is VF MAC, pkt size 9000, ixia can received 
package and size is 9000,this case passed
 - Case 2:  send package dst mac is VF MAC, pkt size 9001, ixia can't received 
package,this case passed

 - Case 3:  send package dst mac is VF MAC, pkt size 8999, ixia can received 
package and size is 8999,this case passed
-Original Message-
From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Helin Zhang
Sent: Wednesday, April 22, 2015 3:19 PM
To: dev at dpdk.org
Subject: [dpdk-dev] [PATCH] i40evf: fix of supporting jumbo frame

It wouldn't check the configured maximum packet length, and then
the scattered receiving function wouldn't be selected at all even
if it wants to receive a jumbo frame. The fix is to select the
correct RX function according to the configurations.

Signed-off-by: Helin Zhang 
---
 lib/librte_pmd_i40e/i40e_ethdev.h|2 +
 lib/librte_pmd_i40e/i40e_ethdev_vf.c |   64 ++---
 lib/librte_pmd_i40e/i40e_rxtx.c  |1 -
 3 files changed, 60 insertions(+), 7 deletions(-)

diff --git a/lib/librte_pmd_i40e/i40e_ethdev.h 
b/lib/librte_pmd_i40e/i40e_ethdev.h
index b9bed5a..7ecd249 100644
--- a/lib/librte_pmd_i40e/i40e_ethdev.h
+++ b/lib/librte_pmd_i40e/i40e_ethdev.h
@@ -36,6 +36,8 @@

 #include 

+#define I40E_VLAN_TAG_SIZE4
+
 #define I40E_AQ_LEN   32
 #define I40E_AQ_BUF_SZ4096
 /* Number of queues per TC should be one of 1, 2, 4, 8, 16, 32, 64 */
diff --git a/lib/librte_pmd_i40e/i40e_ethdev_vf.c 
b/lib/librte_pmd_i40e/i40e_ethdev_vf.c
index 4581c5b..718387f 100644
--- a/lib/librte_pmd_i40e/i40e_ethdev_vf.c
+++ b/lib/librte_pmd_i40e/i40e_ethdev_vf.c
@@ -1419,23 +1419,75 @@ i40evf_vlan_filter_set(struct rte_eth_dev *dev, 
uint16_t vlan_id, int on)
 }

 static int
+i40evf_rxq_init(struct rte_eth_dev *dev, struct i40e_rx_queue *rxq)
+{
+   struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_

[dpdk-dev] [PATCH v2] i40e: fix for ieee15888 with rte_next_abi

2015-08-03 Thread Xu, HuilongX
Tested-by:huilong xu 
Os: dpdk-fedora20 3.11.10-301.fc20.x86_64
Gcc: 4.8.3 20140911 (Red Hat 4.8.3-7)
NIC: fortville_spirit_single
Package:dpdk.org newest code(commit 921353134fe01606411d3508f3ca798f0a38da73) + 
patch
Test case :ieee 1588 disable and ieee 1588 enable all passed.
Test steps:
1. enable ieee1588 compile switch
sed -i -e 's/IEEE1588=n$/IEEE1588=y/' config/common_linuxapp
2. compile and install dpdk driver
3. bind dpdk driver and set 2048*2M hugepage
4. start testpmd 
 ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x6 -n 4  -- -i  --txqflags=0
5. exec testpmd cmdline
a) set fwd ieee1588
b) start
6. send ieee 1588 package by scapy to testpmd port 0, and used scapy get 
package testpmd port1
   sendp([Ether(dst="68:05:ca:27:d5:8e",type=0x88f7)/"\x00\x02"], iface="p4p2")
7.  exec test pmd
Stop
8. check testpmd print
   a) "IEEE1588 PTP V2 SYNC" strings in testpmd print
   b) check tx time > rx time
10.check testpmd fwd a ieee1588 package 
   SCAPY Result:
00:00:00:00:00:00 > 68:05:ca:27:d5:8e (0x88f7) / Raw[PEXPECT]
> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of John McNamara
> Sent: Friday, July 31, 2015 7:39 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH v2] i40e: fix for ieee15888 with rte_next_abi
> 
> Fixes issue where ieee15888 timestamping doesn't work for the i40e
> pmd when RTE_ABI_NEXT is enabled.
> 
> Also refactors repeated ieee15888 flag checking and setting
> code into a function.
> 
> Reported-by: Huilong Xu 
> Signed-off-by: John McNamara 
> ---
> 
> v2: Fix for "unused function" warning with clang >= 3.4. Warning:
> 
> i40e_rxtx.c:183:1: error: unused function 'i40e_get_iee15888_flags'
>[-Werror,-Wunused-function]
> 
> v1: Initial version
> 
>  drivers/net/i40e/i40e_rxtx.c | 54 ---
> -
>  1 file changed, 29 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
> index 891a221..473fc0e 100644
> --- a/drivers/net/i40e/i40e_rxtx.c
> +++ b/drivers/net/i40e/i40e_rxtx.c
> @@ -176,6 +176,32 @@ i40e_rxd_error_to_pkt_flags(uint64_t qword)
>   return flags;
>  }
> 
> +/* Function to check and set the ieee1588 timesync index and get the
> + * appropriate flags.
> + */
> +#ifdef RTE_LIBRTE_IEEE1588
> +static inline uint64_t
> +i40e_get_iee15888_flags(struct rte_mbuf *mb, uint64_t qword)
> +{
> + uint64_t pkt_flags = 0;
> + uint16_t tsyn = (qword & (I40E_RXD_QW1_STATUS_TSYNVALID_MASK
> +   | I40E_RXD_QW1_STATUS_TSYNINDX_MASK))
> + >> I40E_RX_DESC_STATUS_TSYNINDX_SHIFT;
> +
> +#ifdef RTE_NEXT_ABI
> + if ((mb->packet_type & RTE_PTYPE_L2_MASK)
> + == RTE_PTYPE_L2_ETHER_TIMESYNC)
> + pkt_flags = PKT_RX_IEEE1588_PTP;
> +#endif
> + if (tsyn & 0x04) {
> + pkt_flags |= PKT_RX_IEEE1588_TMST;
> + mb->timesync = tsyn & 0x03;
> + }
> +
> + return pkt_flags;
> +}
> +#endif
> +
>  #ifdef RTE_NEXT_ABI
>  /* For each value it means, datasheet of hardware can tell more details
> */
>  static inline uint32_t
> @@ -1285,15 +1311,7 @@ i40e_rx_scan_hw_ring(struct i40e_rx_queue *rxq)
>   pkt_flags |= i40e_rxd_build_fdir(&rxdp[j], mb);
> 
>  #ifdef RTE_LIBRTE_IEEE1588
> - uint16_t tsyn = (qword1
> -  & (I40E_RXD_QW1_STATUS_TSYNVALID_MASK
> -| I40E_RXD_QW1_STATUS_TSYNINDX_MASK))
> -  >> I40E_RX_DESC_STATUS_TSYNINDX_SHIFT;
> -
> - if (tsyn & 0x04)
> - pkt_flags |= PKT_RX_IEEE1588_TMST;
> -
> - mb->timesync = tsyn & 0x03;
> + pkt_flags |= i40e_get_iee15888_flags(mb, qword1);
>  #endif
>   mb->ol_flags |= pkt_flags;
> 
> @@ -1547,14 +1565,7 @@ i40e_recv_pkts(void *rx_queue, struct rte_mbuf
> **rx_pkts, uint16_t nb_pkts)
>   pkt_flags |= i40e_rxd_build_fdir(&rxd, rxm);
> 
>  #ifdef RTE_LIBRTE_IEEE1588
> - uint16_t tsyn = (qword1 & (I40E_RXD_QW1_STATUS_TSYNVALID_MASK
> - | I40E_RXD_QW1_STATUS_TSYNINDX_MASK))
> - >> I40E_RX_DESC_STATUS_TSYNINDX_SHIFT;
> -
> - if (tsyn & 0x04)
> - pkt_flags |= PKT_RX_IEEE1588_TMST;
> -
> - rxm->timesync = tsyn & 0x03;
> + pkt_flags |= i40e_get_iee15888_flags(rxm, qword1);
>  #endif
>   rxm->ol_flags |= pkt_flags;
> 
> @@ -1723,14 +1734,7 @@ i40e_recv_scattered_pkts(void *rx_queue,
>   pkt_flags |= i40e_rxd_build_fdir(&rxd, rxm);
> 
>  #ifdef RTE_LIBRTE_IEEE1588
> - uint16_t tsyn = (qword1 & (I40E_RXD_QW1_STATUS_TSYNVALID_MASK
> - | I40E_RXD_QW1_STATUS_TSYNINDX_MASK))
> -

[dpdk-dev] [PATCH v2 0/2] Increase number of next hops for LPM IPv4

2016-02-26 Thread Xu, HuilongX
Tested-by: huilong xu 
Run two unit case, are all passed.
Test environment:
OS: Linux ub12 3.13.0-32-generic #57~precise1-Ubuntu SMP Tue Jul 15 03:51:20 
UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Gcc: gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
Package: dpdk.org next branch + patch
NIC: 09:00.0 Ethernet controller [0200]: Intel Corporation 82599EB 10-Gigabit 
SFI/SFP+ Network Connection [8086:10fb] (rev 01)
Target: x86_64-native-linuxapp-gcc

Test steps:
1. compile dpdk
   make install -j T=x86_64-native-linuxapp-gcc
2.install and bind dpdk
   modprobe uio
   insmod ./x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
3.set hugepage
   mkdir -p /mnt/huge
   mount -t hugetlbfs nodev /mnt/huge
   echo 4096  >/sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
4. run test app
   ./x86_64-native-linuxapp-gcc/app/test -c f -n 4 -- -i
5. exec unit case
   lpm_autotest
   table_autotest

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Michal Kobylinski
> Sent: Friday, January 29, 2016 8:13 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH v2 0/2] Increase number of next hops for LPM
> IPv4
> 
> This patchset extend next_hop field from 8-bits to 24-bits in LPM library
> for IPv4.
> 
> As next_hop field is increased now the maximum number of tbl8s is 2^24.
> A new rte_lpm_config structure is used so LPM library will allocate
> exactly the amount of memory which is necessary to hold application?s
> rules.
> 
> Changed structures in LPM library:
> rte_lpm_tbl24_entry and rte_lpm_tbl8_entry to one structure
> rte_lpm_tbl_entry.
> 
> Added versioning symbols to functions and updated
> library and applications that have a dependency on LPM library.
> 
> Michal Kobylinski (2):
>   lpm: extend ip4 next_hop and add config structure
>   examples: update to use new lpm lib for ip4
> 
>  app/test/test_func_reentrancy.c |9 +-
>  app/test/test_lpm.c |  274 --
>  app/test/test_mp_secondary.c|7 +-
>  app/test/test_table_combined.c  |1 +
>  app/test/test_table_tables.c|2 +
>  doc/guides/rel_notes/release_2_3.rst|4 +
>  examples/ip_fragmentation/main.c|   23 +-
>  examples/ip_reassembly/main.c   |   22 +-
>  examples/l3fwd-power/main.c |   12 +-
>  examples/l3fwd-vf/main.c|   12 +-
>  examples/l3fwd/main.c   |   51 +-
>  examples/load_balancer/init.c   |8 +-
>  examples/load_balancer/runtime.c|2 +-
>  examples/performance-thread/l3fwd-thread/main.c |   10 +-
>  lib/librte_lpm/Makefile |2 +-
>  lib/librte_lpm/rte_lpm.c| 1157
> ---
>  lib/librte_lpm/rte_lpm.h|  232 +++--
>  lib/librte_lpm/rte_lpm_version.map  |   49 +-
>  lib/librte_table/rte_table.h|1 +
>  lib/librte_table/rte_table_lpm.c|   30 +-
>  lib/librte_table/rte_table_lpm.h|4 +
>  21 files changed, 1546 insertions(+), 366 deletions(-)
> 
> --
> 1.9.1



[dpdk-dev] [PATCH v3 0/6] new ntuple filter replaces 2tuple and 5tuple filters

2015-02-13 Thread Xu, HuilongX
Tested-by:huilong xu 

- Tested Commit: 2250cc5a191906c914221ff4f0da7b5d699b4175
 - OS: Fedora20  3.11.10-301.fc20.x86_64
 - GCC: gcc version 4.8.3 20140911 (Red Hat 4.8.3-7) (GCC)
 - CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
 - NIC: Intel Corporation 82599EB 10-Gigabit Network Connection [8086:10fb]
Intel Corporation I350 Gigabit Network Connection [8086:1521]
Intel Corporation 82580 Gigabit Network Connection [8086:150e]

 - Default x86_64-native-linuxapp-gcc configuration
 - Total 2 cases, 2 passed, 0 failed

 - Case: five_tuple_filter
   Description: Check specified tcp package receive by specified queue. Test 
NIC 82599EB
   Command / instruction:
Start testpmd 
testpmd -c  -n 4 -- -i --disable-rss --rxq=4 --txq=4 
--portmask=0x3 --nb-cores=8 --nb-ports=2

set queue map:
set stat_qmap rx 0 0 0
set stat_qmap rx 1 0 0
set stat_qmap rx 0 1 1
set stat_qmap rx 1 1 1
set stat_qmap rx 0 2 2
set stat_qmap rx 1 2 2
set stat_qmap rx 0 3 3
set stat_qmap rx 1 3 3
   set vlan offload:
 vlan set strip off 0
 vlan set strip off 1
 vlan set filter off 0
 vlan set filter off 1
   set flush rx on:
 set flush_rx on
start testpmd:
 start
 add five tuple filter:
 5tuple_filter 0 add dst_ip 2.2.2.5 src_ip 2.2.2.4 dst_port 1 
src_port 1 protocol 0x06 mask 0x1f tcp_flags 0x0 priority 3 queue 3 
Send packets with tcp inner L4 data,dstip 2.2.2.5, scrip 
2.2.2.4,dstport 1, srcport 1, protocol 0x06
   test result:
testpmd can receive the package by port 0 queue 3
   remove five tuple filter:
  5tuple _filter 0 del dst_ip 2.2.2.5 src_ip 2.2.2.4 dst_port 1 
src_port 1 protocol 0x06 mask 0x1f tcp_flags 0x0 priority 3 queue 3 

  Send packets with tcp inner L4 data,dstip 2.2.2.5, scrip 2.2.2.4,dstport 
1, srcport 1, protocol 0x06
   test result:
testpmd can receive the package by port 0 queue 0 

- Case: twotuple_filter
   Description: Check specified udp package receive by specified queue. Test 
NIC i350 and 82580
   Command / instruction:
Start testpmd 
testpmd -c  -n 4 -- -i --disable-rss --rxq=4 --txq=4 
--portmask=0x3 --nb-cores=8 --nb-ports=2

set queue map:
set stat_qmap rx 0 0 0
set stat_qmap rx 1 0 0
set stat_qmap rx 0 1 1
set stat_qmap rx 1 1 1
set stat_qmap rx 0 2 2
set stat_qmap rx 1 2 2
set stat_qmap rx 0 3 3
set stat_qmap rx 1 3 3
   set vlan offload:
 vlan set strip off 0
 vlan set strip off 1
 vlan set filter off 0
 vlan set filter off 1
   set flush rx on:
 set flush_rx on
start testpmd:
 start
 add two tuple filter:
 2tuple_filter 0 add dst_port 64 protocol 0x11 mask 1 tcp_flags 0 
priority 3 queue 1 
Send packets with udp inner L4 data,dstport 64,  protocol 0x11
   test result:
testpmd can receive the package by port 0 queue 1
   remove five tuple filter:
  5tuple 2tuple_filter 0 del dst_port 64 protocol 0x11 mask 1 
tcp_flags 0 priority 3 queue 1  

  Send packets with tcp inner L4 data, dstport 64 ,protocol 0x11
   test result:
testpmd can receive the package by port 0 queue 0

-Original Message-
From: Wu, Jingjing 
Sent: Tuesday, February 10, 2015 12:48 PM
To: dev at dpdk.org
Cc: Wu, Jingjing; De Lara Guarch, Pablo; Cao, Min; Xu, HuilongX
Subject: [PATCH v3 0/6] new ntuple filter replaces 2tuple and 5tuple filters

v2 changes:
  - remove the code which is already applied in patch "Integrate ethertype
filter in igb/ixgbe driver to new API".
  - modify commands' description in doc testpmd_funcs.rst.

v3 change:
  - remove the UINT32_BIT definition in ixgbe driver

The patch set uses new filter_ctrl API to replace old 2tuple and 5tuple filter 
APIs.
It defines ntuple filter to combine 2tuple and 5tuple types. 
It uses new functions and structure to replace old ones in igb/ixgbe driver,
new commands to replace old ones in testpmd, and removes the old APIs.
It removes the filter's index parameters from user interface, only the
filter's key and assigned queue are visible to user.

Jingjing Wu (6):
  ethdev: define ntuple filter type and its structure
  ixgbe: ntuple filter functions replace old ones for 5tuple filter
  e1000: ntuple filter functions replace old ones for 2tuple and 5tuple
filter
  testpmd: new commands for ntuple filter
  ethdev: remove old APIs and structures of 5tuple and 2tuple filters
  doc: commands changed in testpmd_funcs for 2tuple amd 5tuple filter

[dpdk-dev] [PATCH] i40e: remove ALLOW_LB flag on SRIOV vsi

2015-03-25 Thread Xu, HuilongX
Tested-by:huilong xu 

 - Tested Commit: 0095bb6dd77a6b4570af27320187e63bf37500c6
 - OS: FC20 3.11.10-301.fc20.x86_64
 - GCC: gcc version 4.8.3 20140911 (Red Hat 4.8.3-7) (GCC)
 - CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
 - NIC: Ethernet controller [0200]: Intel Corporation Ethernet Controller XL710 
for 40GbE QSFP+ [8086:1584]

 - Default x86_64-native-linuxapp-gcc configuration
 - Total 6 cases, 6 passed, 0 failed

   1vf/1pf test environment set up:
1.build and install dpdk driver, bind igb_uio to PF
2.create 1vf in host
  echo 1 > ./devices/pci:80/:80:02.0/:83:00.0/max_vfs
3. dettach VF nic
  virsh nodedev-dettach pci__83_02_0
4. run testpmd in host
   ./testpmd -c f -n 4 -- -i --txqflags
5. exec cmd in testpmd
   a) vlan set strip off all
   b) rx_vlan add 1 0
6. start vm
   taskset -c 6-10 qemu-system-x86_64 \
   -enable-kvm -m 8192  -smp 2 -cpu host -name dpdk15-vm2 \
   -drive file=/home/image/vdisk02-sriov-fc20.img \
   -net tap,script=/etc/qemu-ifup \
   -device pci-assign,bus=pci.0,addr=0xb,host=83:02.0 \
   -mem-path /dev/hugepages -mem-prealloc \
   -vnc :12 -daemonize
7. in VM build and install dpdk driver ,bind igb_uio to VF
8. run testpmd in VM
   ./testpmd -c f -n 4 -- -i --txqflags
9. exec cmd lin in vm
set promisc all off
vlan set strip off all
rx_vlan add 1 0
set fwd io
start
 - Case 1:  send package dst mac is VF MAC, not include VLAN 
VF can received package and fwd , ixia can received package, this 
cas passed
 - Case 2:  send package dst mac isn't VF mac,not include VLAN
VF can received package and fwd , ixia can received package, this 
cas passed
 - Case 3:  send package dst mac is VF mac and include VLAN ID 1
VF can received package and fwd , ixia can received package and 
include VLAN ID 1, this cas passed

  2vf/1pf test environment set up:
1.build and install dpdk driver, bind igb_uio to PF
2.create 1vf in host
  echo 2 > ./devices/pci:80/:80:02.0/:83:00.0/max_vfs
3. dettach VF nic
  virsh nodedev-dettach pci__83_02_0
  virsh nodedev-dettach pci__83_02_1
4. run testpmd in host
   ./testpmd -c f -n 4 -- -i --txqflags
5. exec cmd in testpmd
   a) vlan set strip off all
   b) rx_vlan add 1 0
6. start vm
   taskset -c 6-10 qemu-system-x86_64 \
   -enable-kvm -m 8192  -smp 2 -cpu host -name dpdk15-vm2 \
   -drive file=/home/image/vdisk02-sriov-fc20.img \
   -net tap,script=/etc/qemu-ifup \
   -device pci-assign,bus=pci.0,addr=0xb,host=83:02.0 \
   -device pci-assign,bus=pci.0,addr=0xb,host=83:02.1 \
   -mem-path /dev/hugepages -mem-prealloc \
   -vnc :12 -daemonize
7. in VM build and install dpdk driver ,bind igb_uio to VF
8. run testpmd in VM
   ./testpmd -c f -n 4 -- -i --txqflags
9. exec cmd lin in vm
set promisc all off
vlan set strip off all
rx_vlan add 1 0
set fwd io
start
 - Case 1:  send package dst mac is VF MAC, not include VLAN 
VF can received package and fwd , ixia can received package, this 
cas passed
 - Case 2:  send package dst mac isn't VF mac,not include VLAN
VF can received package and fwd , ixia can received package, this 
cas passed
 - Case 3:  send package dst mac is VF mac and include VLAN ID 1
VF can received package and fwd , ixia can received package and 
include VLAN ID 1, this cas passed

-Original Message-
From: Wu, Jingjing 
Sent: Friday, March 20, 2015 3:32 PM
To: dev at dpdk.org
Cc: Wu, Jingjing; Xu, HuilongX; Zhang, Helin
Subject: [PATCH] i40e: remove ALLOW_LB flag on SRIOV vsi

Disable VEB switching by removing ALLOW_LB on SRIOV vsi.

If the source mac address of packet sent from VF is not listed in the
VEB's mac table, the VEB will switch the packet back to the VF.
It's a hardware issue. Enabling ALLOW_LB flag will block VF functions.

Signed-off-by: Jingjing Wu 
---
 lib/librte_pmd_i40e/i40e_ethdev.c | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c 
b/lib/librte_pmd_i40e/i40e_ethdev.c
index cf6685e..28ea5dc 100644
--- a/lib/librte_pmd_i40e/i40e_ethdev.c
+++ b/lib/librte_pmd_i40e/i40e_ethdev.c
@@ -3059,11 +3059,15 @@ i40e_vsi_setup(struct i40e_pf *pf,
ctxt.connection_type = 0x1;
ctxt.flags = I40E_AQ_VSI_TYPE_VF;

-   /* Configure switch ID */
-   ctxt.info.valid_sections |=
-   rte_cpu_to_le_16(I40E_AQ_VSI_PROP_SWITCH_VALID);
-

[dpdk-dev] [PATCH v6 00/13] mbuf: enhancements of mbuf clones

2015-05-07 Thread Xu, HuilongX
Hi Olivier,
Today I find a compile error, when I test ip fragment on dpdk.org. would you 
check this?  thanks a lot.
My dpdk.org commit: a6d71fa7146cc04320c2485d6dde44c1d888d652
The compile error as below:
CC main.o
/root/dpdk/examples/ip_fragmentation/main.c: In function 'init_mem':
/root/dpdk/examples/ip_fragmentation/main.c:748:8: error: 'MBUF_DATA_SIZE' 
undeclared (first use in this function)
 0, MBUF_DATA_SIZE, socket);
^
/root/dpdk/examples/ip_fragmentation/main.c:748:8: note: each undeclared 
identifier is reported only once for each function it appears in


Best regards

huilong

-Original Message-
From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Zoltan Kiss
Sent: Friday, April 24, 2015 6:39 PM
To: Ananyev, Konstantin; Olivier Matz; dev at dpdk.org
Subject: Re: [dpdk-dev] [PATCH v6 00/13] mbuf: enhancements of mbuf clones

Hi,

On 22/04/15 12:59, Ananyev, Konstantin wrote:
>
>
>> -Original Message-
>> From: Olivier Matz [mailto:olivier.matz at 6wind.com]
>> Sent: Wednesday, April 22, 2015 10:57 AM
>> To: dev at dpdk.org
>> Cc: Ananyev, Konstantin; zoltan.kiss at linaro.org; Richardson, Bruce; 
>> nhorman at tuxdriver.com; olivier.matz at 6wind.com
>> Subject: [PATCH v6 00/13] mbuf: enhancements of mbuf clones
>>
>> The first objective of this series is to fix the support of indirect
>> mbufs when the application reserves a private area in mbufs. It also
>> removes the limitation that rte_pktmbuf_clone() is only allowed on
>> direct (non-cloned) mbufs. The series also contains some enhancements
>> and fixes in the mbuf area that makes the implementation of the
>> last patches easier.
>>
>
> Acked-by: Konstantin Ananyev 

When does this series get merged?

Regards,

Zoltan


[dpdk-dev] [PATCH 00/52] update i40e base driver

2015-09-16 Thread Xu, HuilongX
Test-by: huilong xu 
Test environment
os: FC20 3.11.10-301.fc20.x86_64
gcc: gcc version 4.8.3 20140911 (Red Hat 4.8.3-7) (GCC)
package:dpdk.org newest code + i40e share code patch
NIC: Intel Corporation Ethernet Controller XL710 for 40GbE QSFP+ [8086:1584] 
(rev 01)
Target: x86_64-native-linuxapp-gcc
Case list: all Fortville function case on dts.org
Test result:
Total:101
Passed:84
Failed:1
N/A:16

Failed case: qinq strip
But when removed patch, this case failed also.

Thanks a  lot 

> -Original Message-
> From: Wu, Jingjing
> Sent: Sunday, September 06, 2015 3:11 PM
> To: dev at dpdk.org
> Cc: Wu, Jingjing; Lu, Wenzhuo; Xu, HuilongX; Zhang, Helin
> Subject: [PATCH 00/52] update i40e base driver
> 
> Here is the update of i40e base driver.
> Main update:
>  - support New X722 Device (FortPark)
>  - extend virtual channel interface
>  - support CEE DCBX
>  - support promiscuous on VLAN
>  - support Tx Scheduling related AQ functions
>  - support RSS AQ related functions
>  - code clean up
> 
> Jingjing Wu (52):
>   i40e/base: split device ids into a separate file
>   i40e/base: Add new device id for 20Gb and Fort pond device.
>   i40e/base: add error status value decoding
>   i40e/base: Replace sprintf with i40e_debug
>   i40e/base: Merge Fortville SW 4 admin Q command header
>   i40e/base: Add module_types and update_link_info
>   i40e/base: grab the AQ spinlocks before clearing registers
>   i40e/base: add handling of writeback descriptor
>   i40e/base: Add info to nvm info struct for OEM version data
>   i40e/base: add wait states to NVM state machine
>   i40e/base: add commands to nvmupdate utility
>   i40e/base: Add promiscuous on VLAN support
>   i40e/base: Add a workaround to drop all flow control frames
>   i40e/base: Add Debug Dump Internal Data AQ command
>   i40e/base: OEM Post Update AQ command implementation
>   i40e/base: add VF capabilities to virtual channel interface
>   i40e/base: create new BIT and BIT_ULL macros
>   i40e/base: Add parsing for CEE DCBX TLVs
>   i40e/base: Prepare the local LLDP MIB in IEEE TLV Format
>   i40e/base: Refactor PHY structure and add phy_capabilities enum
>   i40e/base: Store CEE DCBX cfg from firmware and Cache the CEE TLV
> status
>   i40e/base: Add some more stats for FD SB and ATR status
>   i40e/base: Update Flex-10 related device/function capabilities
>   i40e/base: Wrap the register definitions for PF and VF driver
>   i40e/base: fix up type clash in i40e_aq_rc_to_posix conversion
>   i40e/base: Add new link status defines
>   i40e/base: fixup padding issue in get_cee_dcb_cfg_v1_resp
>   i40e/base: Add Tx Scheduling related AQ commands
>   i40e/base: Additional checks for CEE APP priority validity
>   i40e/base: Add support for pre-allocated pages for pd
>   i40e/base: clean up unneeded gotos
>   i40e/base: Handle admin Q timeout when releasing NVM
>   i40e/base: Add definition of GLINT_CTL register
>   i40e/base: Add virtchnl op for additional solaris config
>   i40e/base: drop func from debug print
>   i40e/base: add new X722 device
>   i40e/base: Add AQ functions to handle RSS Key and LUT programming
>   i40e/base: add proxy config admin q functions
>   i40e/base: add wol config admin queue functions
>   i40e/base: add WR_CSR_PROT wol/proxy capability parsing
>   i40e/base: FortPark has additional PCTYPES supported for RSS
>   i40e/base: FortPark changes to Rx and Tx descriptor for Outer UDP
> checksum offloads
>   i40e/base: use INLINE macro for better cross-platform code management
>   i40e/base: ESS Support
>   i40e/base: print FCoE capability reported by the device function
>   i40e/base: remove useless assignments
>   i40e/base: Increase pf reset max loop limit
>   i40e/base: Add FortPark specific registers
>   i40e/base: Allow for per-device FW API version
>   i40e/base: Add ATR command bit definition for FortPark
>   i40e/base: Explicitly assign enum index for VSI type
>   eal/common: add new i40e device id
> 
>  drivers/net/i40e/base/i40e_adminq.c |  139 +-
>  drivers/net/i40e/base/i40e_adminq.h |   12 +-
>  drivers/net/i40e/base/i40e_adminq_cmd.h |  211 ++-
>  drivers/net/i40e/base/i40e_common.c |  916 ++-
>  drivers/net/i40e/base/i40e_dcb.c|  625 +++-
>  drivers/net/i40e/base/i40e_dcb.h|   50 +-
>  drivers/net/i40e/base/i40e_devids.h |   70 +
>  drivers/net/i40e/base/i40e_diag.c   |   11 +-
>  drivers/net/i40e/base/i40e_hmc.c|   67 +-
>  drivers/net/i40e/base/i40e_hmc.h|   10 +-
>  drivers/net/i40e/base/i40e_lan_hmc.c|   29 +-
>  drivers/net/i40e/base/i40e_nvm.c|  324 +++-
>  drivers/net/i40e/base/i4

[dpdk-dev] mutli process C/S model example init failed on xen dom0 with dpdk-16.07 rc2 package

2016-07-12 Thread Xu, HuilongX
Hi all,
I run mutli procee C/S model example failed on xen dom0. Does anyone give me 
some suggest how to debug it?
Thanks a lot

test environment:
  OS&kernel: 3.17.4-301.fc21.x86_64
Gcc version: gcc version 4.9.2 20141101 (Red Hat 4.9.2-1) (GCC)
Package :dpdk.16.07-rc1.tar.gz
Target: x86_64-native-linuxapp-gcc
Compile switch: enable CONFIG_RTE_LIBRTE_XEN_DOM0
Xen version:4.4.1
Test cmdline and result:
/examples/multi_process/client_server_mp/mp_server/mp_server/x86_64-native-linuxapp-gcc/mp_server
 -c f -n 4 --xen-dom0 -- -p 0x3 -n 2
EAL: Detected 72 lcore(s)
EAL: Probing VFIO support...
PMD: bnxt_rte_pmd_init() called for (null)
EAL: PCI device :01:00.0 on NUMA socket 0
EAL: probe driver: 8086:1521 rte_igb_pmd
EAL: PCI device :01:00.1 on NUMA socket 0
EAL: probe driver: 8086:1521 rte_igb_pmd
EAL: PCI device :04:00.0 on NUMA socket 0
EAL: probe driver: 8086:10fb rte_ixgbe_pmd
EAL: PCI device :04:00.1 on NUMA socket 0
EAL: probe driver: 8086:10fb rte_ixgbe_pmd
Creating mbuf pool 'MProc_pktmbuf_pool' [6144 mbufs] ...
Port 0 init ... Segmentation fault (core dumped)


[dpdk-dev] about memzone name size issue

2016-06-01 Thread Xu, HuilongX
Hi ,
I will tester-by this patch, thanks  a lot.

> -Original Message-
> From: Iremonger, Bernard
> Sent: Tuesday, May 31, 2016 9:59 PM
> To: Wiles, Keith; Xu, HuilongX; dev at dpdk.org
> Subject: RE: [dpdk-dev] about memzone name size issue
> 
> Hi Huilong,
> 
> > -Original Message-
> > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Wiles, Keith
> > Sent: Tuesday, May 31, 2016 2:18 PM
> > To: Xu, HuilongX ; dev at dpdk.org
> > Subject: Re: [dpdk-dev] about memzone name size issue
> >
> > >Hi all,
> > >I find a issue on link_bonding unit test case.
> > >
> > >When I run model6 test case, will generate core dump error.
> > >I debug it, find the error code in function:
> > >rte_mempool_create_empty(const char *name, unsigned n, unsigned
> > elt_size,
> > >unsigned cache_size, unsigned private_data_size,
> > >int socket_id, unsigned flags) {
> > >  ...
> > >ret = snprintf(mz_name, sizeof(mz_name),
> > RTE_MEMPOOL_MZ_FORMAT, name);
> > >if (ret < 0 || ret >= (int)sizeof(mz_name)) {
> > >rte_errno = ENAMETOOLONG;
> > >goto exit_unlock;
> > >}
> > >   .
> > >}
> > >The memzone name size only 32 bytes, but the mz_name in link_bonding
> is
> > bigger 32 bytes. Could we set memzone name size to 64 bytes ?
> > >Thanks  a lot
> >
> > Having a name of 32 bytes is pretty big IMO, what would be a better
> reason
> > for changing a internal structure as it will take two releases to make
> that
> > change?
> > How big is the name string you are passing into the routine?
> > >
> >
> >
> The following patches were submitted last Friday to fix this issue with
> the link bonding tests.
> 
> http://dpdk.org/dev/patchwork/patch/13052/
> http://dpdk.org/dev/patchwork/patch/13053/
> 
> Regards,
> 
> Bernard.
> 



[dpdk-dev] [PATCH] app/test: fix bond device name too long

2016-06-01 Thread Xu, HuilongX
Tester-by: huilong xu
Test case: link_bonging_autotest
Package:dpdk.org master branch newest commit + this patch
Test cmdline: ./x86_64-native-linuxapp-gcc/app/test -c  -n 1
  Exec link_bonging_autotest cmdl
Test environment:
OS&kernel: dpdk-rhel72 3.10.0-327.el7.x86_64
Gcc: gcc version 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)
Hugepage: 4096*2M

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Michal Jastrzebski
> Sent: Friday, May 27, 2016 11:21 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH] app/test: fix bond device name too long
> 
> Bond device name was too long (grather than 32 signs) that
> cause mempool allocation to fail.
> 
> Fixes: 92073ef961ee ("bond: unit tests")
> 
> Signed-off-by: Michal Jastrzebski 
> ---
>  app/test/test_link_bonding.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c
> index 7cbc289..eeb1395 100644
> --- a/app/test/test_link_bonding.c
> +++ b/app/test/test_link_bonding.c
> @@ -83,7 +83,7 @@
>  #define MAX_PKT_BURST(512)
>  #define DEF_PKT_BURST(16)
> 
> -#define BONDED_DEV_NAME  ("unit_test_bonded_device")
> +#define BONDED_DEV_NAME  ("unit_test_bond_dev")
> 
>  #define INVALID_SOCKET_ID(-1)
>  #define INVALID_PORT_ID  (-1)
> --
> 1.7.9.5



[dpdk-dev] [PATCH] app/test: fix bond device name too long

2016-06-01 Thread Xu, HuilongX
Test case: link_bonging_autotest 
Package:dpdk.org master branch newest commit + this patch 
Test cmdline: ./x86_64-native-linuxapp-gcc/app/test -c  -n 1
  Exec link_bonging_autotest cmdl Test environment:
OS&kernel: dpdk-rhel72 3.10.0-327.el7.x86_64
Gcc: gcc version 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)
Hugepage: 4096*2M

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Michal Jastrzebski
> Sent: Friday, May 27, 2016 11:21 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH] app/test: fix bond device name too long
> 
> Bond device name was too long (grather than 32 signs) that
> cause mempool allocation to fail.
> 
> Fixes: 92073ef961ee ("bond: unit tests")
> 
> Signed-off-by: Michal Jastrzebski 
  Tested-by: huilong xu 
> ---
>  app/test/test_link_bonding.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c
> index 7cbc289..eeb1395 100644
> --- a/app/test/test_link_bonding.c
> +++ b/app/test/test_link_bonding.c
> @@ -83,7 +83,7 @@
>  #define MAX_PKT_BURST(512)
>  #define DEF_PKT_BURST(16)
> 
> -#define BONDED_DEV_NAME  ("unit_test_bonded_device")
> +#define BONDED_DEV_NAME  ("unit_test_bond_dev")
> 
>  #define INVALID_SOCKET_ID(-1)
>  #define INVALID_PORT_ID  (-1)
> --
> 1.7.9.5



[dpdk-dev] [PATCH] mk:fix second compile error

2016-08-11 Thread Xu, HuilongX
Hi Thomas,
Could you give me some comments about this patch.
Thanks a lot
> -Original Message-
> From: Xu, HuilongX
> Sent: Tuesday, August 09, 2016 2:02 PM
> To: dev at dpdk.org
> Cc: Xu, HuilongX
> Subject: [dpdk-dev][PATCH] mk:fix second compile error
> 
> when compile different targets on a same environment.
> The second compile will failed, because test_resource obj file
> can't auto clearn by makfile.
> 
> Signed-off-by: xu,huilong 
> ---
>  mk/rte.app.mk | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/mk/rte.app.mk b/mk/rte.app.mk
> index eb28e11..d23e8b9 100644
> --- a/mk/rte.app.mk
> +++ b/mk/rte.app.mk
> @@ -263,7 +263,8 @@ $(RTE_OUTPUT)/app/$(APP).map: $(APP)
>  #
>  .PHONY: clean
>  clean: _postclean
> - $(Q)rm -f $(_BUILD_TARGETS) $(_INSTALL_TARGETS) $(_CLEAN_TARGETS)
> + $(Q)rm -f $(_BUILD_TARGETS) $(_INSTALL_TARGETS) $(_CLEAN_TARGETS)
> \
> + test_resource.res test_resource_c.o test_resource_c.res.o
> 
>  .PHONY: doclean
>  doclean:
> --
> 1.9.3



[dpdk-dev] [PATCH] mk:fix second compile error

2016-08-19 Thread Xu, HuilongX
Hi Brue,
Thanks a lot for your comments. I  will send V2 patch.

> -Original Message-
> From: Richardson, Bruce
> Sent: Tuesday, August 09, 2016 4:27 PM
> To: Xu, HuilongX
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] mk:fix second compile error
> 
> On Tue, Aug 09, 2016 at 02:01:58PM +0800, xu,huilong wrote:
> > when compile different targets on a same environment.
> > The second compile will failed, because test_resource obj file
> > can't auto clearn by makfile.
> >
> > Signed-off-by: xu,huilong 
> > ---
> >  mk/rte.app.mk | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/mk/rte.app.mk b/mk/rte.app.mk
> > index eb28e11..d23e8b9 100644
> > --- a/mk/rte.app.mk
> > +++ b/mk/rte.app.mk
> > @@ -263,7 +263,8 @@ $(RTE_OUTPUT)/app/$(APP).map: $(APP)
> >  #
> >  .PHONY: clean
> >  clean: _postclean
> > -   $(Q)rm -f $(_BUILD_TARGETS) $(_INSTALL_TARGETS) $(_CLEAN_TARGETS)
> > +   $(Q)rm -f $(_BUILD_TARGETS) $(_INSTALL_TARGETS) $(_CLEAN_TARGETS)
> \
> > +   test_resource.res test_resource_c.o test_resource_c.res.o
> >
> This fix looks very specific to the test application, and specific files
> in
> that application. Can it be made more generic so that it will work if we
> add
> other resource files to the test app without us having to modify the
> top-level
> application makefile.
> 
> Regards,
> /Bruce


[dpdk-dev] [PATCH] ixgbe: fix x550 VF tx issue

2016-02-05 Thread Xu, HuilongX
Test-by: huilong xu 
Summary:
   Test four case, and all case passed. 
Test environment:
  Host: 
 os: 4.2.3-300.fc23.x86_64
 NIC: 03:00.0 Ethernet controller [0200]: Intel Corporation Ethernet 
Connection X552/X557-AT 10GBASE-T [8086:15ad]
 NIC kernel driver: ixgbe 4.2.5
  Guest:
 OS: 3.11.10-301.fc20.x86_64
 Gcc: 4.8.2 20131017 (Red Hat 4.8.2-1) (GCC)
 Package: dpdk.org newest commit(commit 
b86af7b1b57ebe02ebf5298415172d51f1f81e8b) +PATCH
 Target: x86_64-native-linuxapp-gcc
Case list:
Config VM
==
1. get the pci device id of DUT, for example,

lspci -nn|grep -i eth

04:00.0 Ethernet controller [0200]: Intel Corporation Device [8086:15ad] (rev 
01) 
04:00.1 Ethernet controller [0200]: Intel Corporation Device [8086:15ad] (rev 
01) 

2. create 2 VFs from 2 PFs,

echo 1 > /sys/bus/pci/devices/\:04\:00.0/sriov_numvfs
echo 1 > /sys/bus/pci/devices/\:04\:00.1/sriov_numvfs
lspci -nn|grep -i eth

04:00.0 Ethernet controller [0200]: Intel Corporation Device [8086:15ad] (rev 
01) 
04:00.1 Ethernet controller [0200]: Intel Corporation Device [8086:15ad] (rev 
01)
04:10.0 Ethernet controller [0200]: Intel Corporation Device [8086:15a8]
04:10.1 Ethernet controller [0200]: Intel Corporation Device [8086:15a8]

3. detach VFs from the host, bind them to pci-stub driver,

/sbin/modprobe pci-stub

using `lspci -nn|grep -i ethernet` got VF device id, for example "8086 1565",

echo "8086 15a8" > /sys/bus/pci/drivers/pci-stub/new_id
echo :04:10.0 > /sys/bus/pci/devices/:04:10.0/driver/unbind
echo :04:10.1 > /sys/bus/pci/drivers/pci-stub/bind

echo "8086 15a8" > /sys/bus/pci/drivers/pci-stub/new_id
echo :04:10.0 > /sys/bus/pci/devices/:04:10.0/driver/unbind
echo :04:10.0 > /sys/bus/pci/drivers/pci-stub/bind

or using the following more easy way,

virsh nodedev-detach pci__04_10_0; 
virsh nodedev-detach pci__04_10_1;


4. passthrough VFs 04:10.0 & 04:10.1 to vm0, and start vm0,

/usr/bin/qemu-system-x86_64  -name vm0 -enable-kvm \
-cpu host -smp 4 -m 2048 -drive file=/home/image/sriov-fc20-1.img -vnc :1 \
-device pci-assign,host=04:10.0,id=pt_0 \
-device pci-assign,host=04:10.1,id=pt_1


Test Case 1: enable_mdd_dpdk_disable
==
1. config vm
2. login vm0, got VFs pci device id in vm0, assume they are 00:06.0 & 00:07.0, 
bind them to igb_uio driver,
and then start testpmd, set it in mac forward mode,

./tools/dpdk_nic_bind.py --bind=igb_uio 00:06.0 00:07.0
./x86_64-native-linuxapp-gcc/app/testpmd -c 0x0f -n 4 -w 00:06.0 -w 00:07.0 -- 
-i --portmask=0x3 --txqflags=0x1000

testpmd> set fwd mac
testpmd> start

3. get mac address of one VF and use it as dest mac, using scapy to send 2000 
random packets from tester,
verify the packets can't be received by one VF, and on host can find "ixgbe 
:04:00.0: Malicious event on VF 0 tx:10 rx:0"

Test Case 2: enable_mdd_dpdk_enable
==
1. config vm
2. login vm0, got VFs pci device id in vm0, assume they are 00:06.0 & 00:07.0, 
bind them to igb_uio driver,
and then start testpmd, set it in mac forward mode,

./tools/dpdk_nic_bind.py --bind=igb_uio 00:06.0 00:07.0
./x86_64-native-linuxapp-gcc/app/testpmd -c 0x0f -n 4 -w 00:06.0 -w 00:07.0 -- 
-i --portmask=0x3 --txqflags=0x0

testpmd> set fwd mac
testpmd> start

3. get mac address of one VF and use it as dest mac, using scapy to send 2000 
random packets from tester,
verify the packets can be received by one VF, and on host can't find "ixgbe 
:04:00.0: Malicious event on VF 0 tx:10 rx:0"

Test Case 3: disable_mdd_dpdk_disable
==
1. disable mdd in kernel
rmmod ixgbe
insmod MDD=0,0
2. config vm
3. login vm0, got VFs pci device id in vm0, assume they are 00:06.0 & 00:07.0, 
bind them to igb_uio driver,
and then start testpmd, set it in mac forward mode,

./tools/dpdk_nic_bind.py --bind=igb_uio 00:06.0 00:07.0
./x86_64-native-linuxapp-gcc/app/testpmd -c 0x0f -n 4 -w 00:06.0 -w 00:07.0 -- 
-i --portmask=0x3 --txqflags=0x1000

testpmd> set fwd mac
testpmd> start

4. get mac address of one VF and use it as dest mac, using scapy to send 2000 
random packets from tester,
verify the packets can be received by one VF, and on host can't find "ixgbe 
:04:00.0: Malicious event on VF 0 tx:10 rx:0"

Test Case 4: disable_mdd_dpdk_enable
==
1. disable mdd in kernel
rmmod ixgbe
insmod MDD=0,0
2. config vm
3. login vm0, got VFs pci device id in vm0, assume they are 00:06.0 & 00:07.0, 
bind them to igb_uio driver,
and then start testpmd, set it in mac forward mode,

./tools/dpdk_nic_bind.py --bind=igb_uio 00:06.0 00:07.0
./x86_64-native-linuxapp-gcc/app/testpmd -c 0x0f -n 4 -w 00:06.0 -w 00:07.0 -- 
-i --portmask=0x3 --txqflags=0x0

testpmd> set fwd mac
testpmd> start

4. get mac address of one VF and use it as dest mac, using scapy to send 2000 
random p

[dpdk-dev] about memzone name size issue

2016-05-31 Thread Xu, HuilongX
Hi all,
I find a issue on link_bonding unit test case.

When I run model6 test case, will generate core dump error.
I debug it, find the error code in function:
rte_mempool_create_empty(const char *name, unsigned n, unsigned elt_size,
unsigned cache_size, unsigned private_data_size,
int socket_id, unsigned flags)
{
  ...
ret = snprintf(mz_name, sizeof(mz_name), RTE_MEMPOOL_MZ_FORMAT, 
name);
if (ret < 0 || ret >= (int)sizeof(mz_name)) {
rte_errno = ENAMETOOLONG;
goto exit_unlock;
}
   .
}
The memzone name size only 32 bytes, but the mz_name in link_bonding is bigger 
32 bytes. Could we set memzone name size to 64 bytes ?
Thanks  a lot


[dpdk-dev] [PATCH 0/8] Dynamic RSS Configuration for Bonding

2015-06-12 Thread Xu, HuilongX
Tested-by: huilong xu 
- Tested Commit: 1a1109404e702d3ad1ccc1033df55c59bec1f89a + PATCH
- OS: Linux dpdk-fedora20 3.11.10-301.fc20.x86_64
- GCC: gcc version 4.8.3 20140624 (Red Hat 4.8.3-1) (GCC)
- CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
- NIC: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection 
[8086:10fb]
- NIC: Intel Corporation Ethernet Controller XL710 for 40GbE QSFP+ [8086:1583]
- Default x86_64-native-linuxapp-gcc configuration
- Total 4 cases, 2 passed, 2 failed. Niantic NIC case all passed, but Fortville 
NIC case all failed.


   First case:
   This is a unit test case, not need NIC
   1. build dpdk driver and insmod driver
   2. set 1024*2M hugepage
   3. compile test app in app/test
   4. run test
   ./test -c f -n 4 
   5. exec dynamic rss confif unit test
  link_bonding_rssconf_autotest
   6. print "test ok"
   7. this case passed
Second case:
   This is a function test case, used Fortville NIC(8086:1583)
1. build dpdk driver and insmod driver
2. bind dpdk driver to Fortville nic
3. set 1024*2M hugepage
4. run test pmd
  ./x86_64-native-linuxapp-gcc/app/testpmd -c 0xff -n 4  -- -i 
--txqflags=0x2 --mbcache=128 --burst=32 --txfreet=32 --rxfreet=64 --rxq=4 
--txq=4
5. exec testpmd cmd
   a) create bonded device 0 0
   b) add bonding slave 0 3
   c) add bonding slave 1 3
   d) port start 3
port can start, and link stats is down, so this case failed.
 Thirdly case:
   This is a function test case, used Fortville NIC(8086:1583)
1. build dpdk driver and insmod driver
2. bind dpdk driver to Fortville nic
3. set 1024*2M hugepage
4. run test pmd
  ./x86_64-native-linuxapp-gcc/app/testpmd -c 0xff -n 4  -- -i 
--txqflags=0x2 --mbcache=128 --burst=32 --txfreet=32 --rxfreet=64 --rxq=4 
--txq=4
5. exec testpmd cmd
   a) create bonded device 0 0
   b) add bonding slave 0 3
   c) add bonding slave 1 3
   d) port config all rss ip
   e) show port 3 rss-hash
  printf: 
  RSS functions:
  ipv4-frag ipv4-other ipv6-frag ipv6-other
   f) show port 0 rss-hash
  printf:
 RSS disabled
  Slave rss not enable, so this case failed
   Fourthly case:
  This is a function test case, used Niantic NIC(8086:10fb)
  1. build dpdk driver and insmod driver
  2. bind dpdk driver to Fortville nic
  3. set 1024*2M hugepage
  4. run test pmd
  ./x86_64-native-linuxapp-gcc/app/testpmd -c 0xff -n 4  -- -i 
--txqflags=0x2 --mbcache=128 --burst=32 --txfreet=32 --rxfreet=64 --rxq=4 
--txq=4
  5. exec testpmd cmd
a) create bonded device 0 0
b) add bonding slave 0 3
c) add bonding slave 1 3
d) port start 3
e) port stop all
f) set verbose 8
g) set fwd rxonly
h) set stat_qmap 3 0 0
i) set stat_qmap 3 1 1 
j) set stat_qmap 3 1 1
k) set stat_qmap 3 1 1
l) port config all rss ip
m) port start all
n)start
   6. send 50 ip packages to salve 0 by ixia, the package config as 
below
  a) dst mac: bond device (port 3) mac address.
  b) src mac: 00:00:00:12:34:56
  c) package type:0800
  e) dst ip: 192.168.1.1 
  f) src ip: from 192.168.1.2 to 192.168.1.51, one package, 
this ip add 1
7. stop 
Port 3 queue 0 received 9 packages
Port 3 queue 1 received 9 packages
Port 3 queue 2 received 16 packages
Port 3 queue 3 received 16 packages
8. send 50 ip packages to slave 1 by ixia, the package config 
as same
9. stop and check port 3 received packages again
   Form slave 0 and slave 1 the rss are some, the test passed

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Tomasz Kulasek
> Sent: Wednesday, June 03, 2015 6:59 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH 0/8] Dynamic RSS Configuration for Bonding
> 
> OVERVIEW
> 
> 1) Setting .rxmode.mq_mode for bonding device to ETH_MQ_RX_RSS makes
> bonding
> device fully RSS-capable, so all slaves are synchronized with its
> configuration.
> This mode is intended to provide RSS configuration as known from "dynamic
> RSS
> configuration for one port" and made slaves transparent 

[dpdk-dev] [PATCH v2 0/4] extend flow director to support L2_paylod type

2015-06-26 Thread Xu, HuilongX
Tested-by:huilong,xu 
Os: 3.11.10-301.fc20.x86_64
Gcc: gcc version 4.8.3 20140911 (Red Hat 4.8.3-7) (GCC)
Package: d2c08067240baf27f2447bf4981b9ab58ce74d35 + l2payload patch
NIC: Intel Corporation Ethernet Controller XL710 for 40GbE QSFP+ [8086:1583]
Test case Summary: 1 case passed
Test sets:
1. build dpdk with x86_64 gcc target 
2. set hugpage and bind igb_uio to Fortville nic 
3. ./testpmd -c  -n 4 -- -I --portmask=0x3 --disable-rss --rxq=2 --txq=2 
--nbcores=8 --pkt-filter-mode=perfect
4. exec testpmd cmdline
a) set verbose 1
b) set fwd rxonly
c) flow_director_filter 0 add flow l2_payload ether 0x0806 flexbytes () fwd 
queue 1 fd 1
d) start
5. send a arp package to port 0
6. testpmd print port 0 queue 1 received a pachage


> -Original Message-
> From: Wu, Jingjing
> Sent: Tuesday, June 16, 2015 11:44 AM
> To: dev at dpdk.org
> Cc: Wu, Jingjing; Zhang, Helin; Xu, HuilongX
> Subject: [PATCH v2 0/4] extend flow director to support L2_paylod type
> 
> This patch set extends flow director to support L2_paylod type in i40e
> driver.
> 
> v2 change:
>  - remove the flow director VF filtering from this patch to avoid breaking
> ABI.
> 
> Jingjing Wu (4):
>   ethdev: add struct rte_eth_l2_flow to support l2_payload flow type
>   i40e: extend flow diretcor to support l2_payload flow type
>   testpmd: extend commands
>   doc: extend commands in testpmd
> 
>  app/test-pmd/cmdline.c  | 48
> +++--
>  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  5 ++-
>  drivers/net/i40e/i40e_fdir.c| 24 +--
>  lib/librte_ether/rte_eth_ctrl.h |  8 +
>  4 files changed, 78 insertions(+), 7 deletions(-)
> 
> --
> 1.9.3