[dpdk-dev] ixgbe TX function selection

2016-03-10 Thread Wu, Jingjing
Hi, Zoltan

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Zoltan Kiss
> Sent: Wednesday, March 2, 2016 3:19 AM
> To: dev at dpdk.org
> Subject: [dpdk-dev] ixgbe TX function selection
> 
> Hi,
> 
> I've noticed that ixgbe_set_tx_function() selects the non-SG function
> even if (dev->data->scattered_rx == 1). That seems a bit dangerous, as
> you can turn that on inadvertently when you don't set max_rx_pkt_len and
> buffer size in certain ways. I've learnt it in the hard way, as my
> segmented packets were leaking memory on the TX path, which doesn't
> cries if you send out segmented packets.
> How should this case be treated? Assert on the non-SG TX side for the
> 'next' pointer? Or turning on SG if RX has it? It doesn't seem to be a
> solid way as other interfaces still can have SG turned on.
> 

If you look into the ixgbe_set_tx_function, you will find tx function
selection is decided by the tx_flags on queue configure, which is
passed by rte_eth_txconf. So even you set dev->data->scattered_rx to 1,
if the tx_flags is ETH_TXQ_FLAGS_NOMULTSEGS, ixgbe_xmit_pkts_simple is
still selected as tx function. So, you'd better to set tx_flags=0, and have a 
try.

> Regards,
> 
> Zoltan


[dpdk-dev] [PATCH 1/3] kcp: add kernel control path kernel module

2016-03-10 Thread Vincent JARDIN
Le 10 mars 2016 01:06, "Thomas Monjalon"  a
?crit :
>
> 2016-03-02 23:35, Thomas Monjalon:
> > 2016-03-02 12:21, Thomas Monjalon:
> > > 2016-03-02 11:47, Vincent JARDIN:
> > > > Le 02/03/2016 09:27, Panu Matilainen a ?crit :
> > > > >>> I'd like to see these be merged.
> > > > >>>
> > > > >>> Jay
> > > > >>
> > > > >> The code is really not ready. I am okay with cooperative
development
> > > > >> but the current code needs to go into a staging type tree.
> > > > >> No compatibility, no ABI guarantees, more of an RFC.
> > > > >> Don't want vendors building products with it then screaming when
it
> > > > >> gets rebuilt/reworked/scrapped.
> > > > >>
> > > > >
> > > > > Exactly.
> > > >
> > > > +1 too
> > > >
> > > > We need to build on this innovation while there is a path for kernel
> > > > mainstream. The logic of using a staging is a good one.
> > > >
> > > > Thomas,
> > > >
> > > > can we open a staging folder into the DPDK like it is done into the
kernel?
> > >
> > > It's possible to create a staging directory if everybody agree.
> > > It is important to state in a README file or in the doc/ that
> > > there will be no guarantee (no stable ABI, no validation and can be
dropped)
> > > and that it is a work in progress, a suggestion to discuss with the
kernel
> > > community.
> > >
> > > The kernel modules must clearly target an upstream integration.
> >
> > Actually the examples directory has been used as a staging for ethtool
and
> > lthread. We also have the crypto API which is still experimental.
> > So I think we must decide among these 3 solutions:
> >   - no special directory, just mark and document an experimental
state
> >   - put only kcp/kdp in the staging directory

I do prefer this option.

> >   - put kcp/kdp in staging and move other experimental libs here
>
> Any opinion? Are we targetting upstream work without any DPDK staging?
>
> Please let's make clear the status of these patches.


[dpdk-dev] [PATCH v2 10/10] qede: enable PMD build

2016-03-10 Thread Rasesh Mody
Signed-off-by: Harish Patil 
Signed-off-by: Rasesh Mody 
Signed-off-by: Sony Chacko 
---
 config/common_base|   14 ++
 drivers/net/Makefile  |1 +
 mk/rte.app.mk |2 ++
 scripts/test-build.sh |1 +
 4 files changed, 18 insertions(+)

diff --git a/config/common_base b/config/common_base
index 1af28c8..6b10c65 100644
--- a/config/common_base
+++ b/config/common_base
@@ -285,6 +285,20 @@ CONFIG_RTE_LIBRTE_PMD_BOND=y
 CONFIG_RTE_LIBRTE_BOND_DEBUG_ALB=n
 CONFIG_RTE_LIBRTE_BOND_DEBUG_ALB_L1=n

+# QLogic 25G/40G PMD
+#
+CONFIG_RTE_LIBRTE_QEDE_PMD=y
+CONFIG_RTE_LIBRTE_QEDE_DEBUG_INIT=n
+CONFIG_RTE_LIBRTE_QEDE_DEBUG_INFO=n
+CONFIG_RTE_LIBRTE_QEDE_DEBUG_ECORE=n
+CONFIG_RTE_LIBRTE_QEDE_DEBUG_TX=n
+CONFIG_RTE_LIBRTE_QEDE_DEBUG_RX=n
+CONFIG_RTE_LIBRTE_QEDE_RX_COAL_US=24
+CONFIG_RTE_LIBRTE_QEDE_TX_COAL_US=48
+CONFIG_RTE_LIBRTE_QEDE_TX_SWITCHING=y
+#Provides path/name of the firmware file
+CONFIG_RTE_LIBRTE_QEDE_FW=n
+
 #
 # Compile software PMD backed by AF_PACKET sockets (Linux only)
 #
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 0c3393f..61d3f16 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -51,5 +51,6 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2) += szedata2
 DIRS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += virtio
 DIRS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += vmxnet3
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += xenvirt
+DIRS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede

 include $(RTE_SDK)/mk/rte.subdir.mk
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index daac09f..e350ba4 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -102,6 +102,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_PMD)   += -libverbs
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2)   += -lsze2
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT)+= -lxenstore
 _LDLIBS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD)  += -lgxio
+_LDLIBS-$(CONFIG_RTE_LIBRTE_QEDE_PMD)   += -lz
 # QAT PMD has a dependency on libcrypto (from openssl) for calculating HMAC 
precomputes
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT)+= -lcrypto
 endif # !CONFIG_RTE_BUILD_SHARED_LIBS
@@ -143,6 +144,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD)  += 
-lrte_pmd_mpipe
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING)   += -lrte_pmd_ring
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP)   += -lrte_pmd_pcap
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET)  += -lrte_pmd_af_packet
+_LDLIBS-$(CONFIG_RTE_LIBRTE_QEDE_PMD)   += -lrte_pmd_qede
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL)   += -lrte_pmd_null
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT)+= -lrte_pmd_qat

diff --git a/scripts/test-build.sh b/scripts/test-build.sh
index 5cadc08..8436e41 100755
--- a/scripts/test-build.sh
+++ b/scripts/test-build.sh
@@ -115,6 +115,7 @@ config () #   
test "$DPDK_DEP_ZLIB" != y || \
sed -ri  's,(BNX2X_PMD=)n,\1y,' $1/.config
sed -ri's,(NFP_PMD=)n,\1y,' $1/.config
+   sed -ri  's,(QEDE_PMD=)n,\1y,' $1/.config
test "$DPDK_DEP_PCAP" != y || \
sed -ri   's,(PCAP=)n,\1y,' $1/.config
test -z "$AESNI_MULTI_BUFFER_LIB_PATH" || \
-- 
1.7.10.3



[dpdk-dev] [PATCH v2 09/10] qede: Add DCBX support

2016-03-10 Thread Rasesh Mody
Signed-off-by: Harish Patil 
Signed-off-by: Rasesh Mody 
Signed-off-by: Sony Chacko 
---
 drivers/net/qede/Makefile |1 +
 drivers/net/qede/base/bcm_osal.h  |  100 ++--
 drivers/net/qede/base/ecore.h |2 +
 drivers/net/qede/base/ecore_dcbx.c|  887 +
 drivers/net/qede/base/ecore_dcbx.h|   55 ++
 drivers/net/qede/base/ecore_dcbx_api.h|  160 ++
 drivers/net/qede/base/ecore_dev.c |   27 +
 drivers/net/qede/base/ecore_l2.c  |3 -
 drivers/net/qede/base/ecore_mcp.c |   16 +
 drivers/net/qede/base/ecore_sp_commands.c |4 +
 drivers/net/qede/base/mcp_public.h|  200 +++
 drivers/net/qede/base/nvm_cfg.h   |6 +
 drivers/net/qede/qede_main.c  |6 +-
 drivers/net/qede/qede_rxtx.c  |2 +-
 14 files changed, 1406 insertions(+), 63 deletions(-)
 create mode 100644 drivers/net/qede/base/ecore_dcbx.c
 create mode 100644 drivers/net/qede/base/ecore_dcbx.h
 create mode 100644 drivers/net/qede/base/ecore_dcbx_api.h

diff --git a/drivers/net/qede/Makefile b/drivers/net/qede/Makefile
index 8970921..cb59bbe 100644
--- a/drivers/net/qede/Makefile
+++ b/drivers/net/qede/Makefile
@@ -77,6 +77,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_spq.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_init_ops.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_mcp.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_int.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_dcbx.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/bcm_osal.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_sriov.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_vf.c
diff --git a/drivers/net/qede/base/bcm_osal.h b/drivers/net/qede/base/bcm_osal.h
index 4d81101..26221e5 100644
--- a/drivers/net/qede/base/bcm_osal.h
+++ b/drivers/net/qede/base/bcm_osal.h
@@ -22,6 +22,8 @@
 /* Forward declaration */
 struct ecore_dev;
 struct ecore_hwfn;
+struct ecore_vf_acquire_sw_info;
+struct vf_pf_resc_request;

 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
 #undef __BIG_ENDIAN
@@ -270,60 +272,43 @@ typedef struct osal_list_t {

 /* Barriers */

-#define OSAL_MMIOWB(dev) rte_wmb() /* No user space equivalent */
-#define OSAL_BARRIER(dev) rte_compiler_barrier()
-#define OSAL_SMP_RMB(dev) rte_rmb()
-#define OSAL_SMP_WMB(dev) rte_wmb()
-#define OSAL_RMB(dev) rte_rmb()
-#define OSAL_WMB(dev) rte_wmb()
+#define OSAL_MMIOWB(dev)   rte_wmb()
+#define OSAL_BARRIER(dev)  rte_compiler_barrier()
+#define OSAL_SMP_RMB(dev)  rte_rmb()
+#define OSAL_SMP_WMB(dev)  rte_wmb()
+#define OSAL_RMB(dev)  rte_rmb()
+#define OSAL_WMB(dev)  rte_wmb()
 #define OSAL_DMA_SYNC(dev, addr, length, is_post) nothing

-#define OSAL_BITS_PER_BYTE (8)
+#define OSAL_BITS_PER_BYTE (8)
 #define OSAL_BITS_PER_UL   (sizeof(unsigned long)*OSAL_BITS_PER_BYTE)
-#define OSAL_BITS_PER_UL_MASK   (OSAL_BITS_PER_UL - 1)
-
-#define OSAL_BUILD_BUG_ON(cond) nothing
-#define ETH_ALEN ETHER_ADDR_LEN
-
-static inline u32 osal_ffz(unsigned long word)
-{
-   unsigned long first_zero;
-
-   first_zero = __builtin_ffsl(~word);
-   return first_zero ? (first_zero - 1) : OSAL_BITS_PER_UL;
-}
-
-static inline void OSAL_SET_BIT(u32 nr, unsigned long *addr)
-{
-   addr[nr / OSAL_BITS_PER_UL] |= 1UL << (nr & OSAL_BITS_PER_UL_MASK);
-}
-
-static inline void OSAL_CLEAR_BIT(u32 nr, unsigned long *addr)
-{
-   addr[nr / OSAL_BITS_PER_UL] &= ~(1UL << (nr & OSAL_BITS_PER_UL_MASK));
-}
-
-static inline bool OSAL_TEST_BIT(u32 nr, unsigned long *addr)
-{
-   return !!(addr[nr / OSAL_BITS_PER_UL] &
-  (1UL << (nr & OSAL_BITS_PER_UL_MASK)));
-}
-
-static inline u32 OSAL_FIND_FIRST_ZERO_BIT(unsigned long *addr, u32 limit)
-{
-   u32 i;
-   u32 nwords = 0;
-   OSAL_BUILD_BUG_ON(!limit);
-   nwords = (limit - 1) / OSAL_BITS_PER_UL + 1;
-   for (i = 0; i < nwords; i++)
-   if (~(addr[i] != 0))
-   break;
-   return (i == nwords) ? limit : i * OSAL_BITS_PER_UL + osal_ffz(addr[i]);
-}
+#define OSAL_BITS_PER_UL_MASK  (OSAL_BITS_PER_UL - 1)

-/* SR-IOV channel */
+/* Bitops */
+void qede_set_bit(u32, unsigned long *);
+#define OSAL_SET_BIT(bit, bitmap) \
+   qede_set_bit(bit, bitmap)
+
+void qede_clr_bit(u32, unsigned long *);
+#define OSAL_CLEAR_BIT(bit, bitmap) \
+   qede_clr_bit(bit, bitmap)
+
+bool qede_test_bit(u32, unsigned long *);
+#define OSAL_TEST_BIT(bit, bitmap) \
+   qede_test_bit(bit, bitmap)
+
+u32 qede_find_first_zero_bit(unsigned long *, u32);
+#define OSAL_FIND_FIRST_ZERO_BIT(bitmap, length) \
+   qede_find_first_zero_bit(bitmap, length)
+
+#define OSAL_BUILD_BUG_ON(cond)nothing
+#define ETH_ALEN   ETHER_ADDR_LEN

 #define OSAL_LINK_UPDATE(hwfn) nothing
+#define OSAL_DCBX_AEN(hwfn, mib_type) nothing
+
+/* SR-IOV 

[dpdk-dev] [PATCH v2 08/10] qede: Add attention support

2016-03-10 Thread Rasesh Mody
Signed-off-by: Harish Patil 
Signed-off-by: Rasesh Mody 
Signed-off-by: Sony Chacko 
---
 drivers/net/qede/base/ecore_attn_values.h |13287 +
 drivers/net/qede/base/ecore_dev.c |   51 +
 drivers/net/qede/base/ecore_int.c | 1131 +++
 3 files changed, 14469 insertions(+)
 create mode 100644 drivers/net/qede/base/ecore_attn_values.h

diff --git a/drivers/net/qede/base/ecore_attn_values.h 
b/drivers/net/qede/base/ecore_attn_values.h
new file mode 100644
index 000..8bd2ba7
--- /dev/null
+++ b/drivers/net/qede/base/ecore_attn_values.h
@@ -0,0 +1,13287 @@
+/*
+ * Copyright (c) 2016 QLogic Corporation.
+ * All rights reserved.
+ * www.qlogic.com
+ *
+ * See LICENSE.qede_pmd for copyright and licensing details.
+ */
+
+#ifndef __ATTN_VALUES_H__
+#define __ATTN_VALUES_H__
+
+#ifndef __PREVENT_INT_ATTN__
+
+/* HW Attention register */
+struct attn_hw_reg {
+   u16 reg_idx;/* Index of this register in its block */
+   u16 num_of_bits;/* number of valid attention bits */
+   const u16 *bit_attn_idx;/* attention index per valid bit */
+   u32 sts_addr;   /* Address of the STS register */
+   u32 sts_clr_addr;   /* Address of the STS_CLR register */
+   u32 sts_wr_addr;/* Address of the STS_WR register */
+   u32 mask_addr;  /* Address of the MASK register */
+};
+
+/* HW block attention registers */
+struct attn_hw_regs {
+   u16 num_of_int_regs;/* Number of interrupt regs */
+   u16 num_of_prty_regs;   /* Number of parity regs */
+   struct attn_hw_reg **int_regs;  /* interrupt regs */
+   struct attn_hw_reg **prty_regs; /* parity regs */
+};
+
+/* HW block attention registers */
+struct attn_hw_block {
+   const char *name;   /* Block name */
+   const char **int_desc;  /* Array of interrupt attention descriptions */
+   const char **prty_desc; /* Array of parity attention descriptions */
+   struct attn_hw_regs chip_regs[3];   /* attention regs per chip.*/
+};
+
+#ifdef ATTN_DESC
+static const char *grc_int_attn_desc[5] = {
+   "grc_address_error",
+   "grc_timeout_event",
+   "grc_global_reserved_address",
+   "grc_path_isolation_error",
+   "grc_trace_fifo_valid_data",
+};
+#else
+#define grc_int_attn_desc OSAL_NULL
+#endif
+
+static const u16 grc_int0_bb_a0_attn_idx[4] = {
+   0, 1, 2, 3,
+};
+
+static struct attn_hw_reg grc_int0_bb_a0 = {
+   0, 4, grc_int0_bb_a0_attn_idx, 0x50180, 0x5018c, 0x50188, 0x50184
+};
+
+static struct attn_hw_reg *grc_int_bb_a0_regs[1] = {
+   _int0_bb_a0,
+};
+
+static const u16 grc_int0_bb_b0_attn_idx[4] = {
+   0, 1, 2, 3,
+};
+
+static struct attn_hw_reg grc_int0_bb_b0 = {
+   0, 4, grc_int0_bb_b0_attn_idx, 0x50180, 0x5018c, 0x50188, 0x50184
+};
+
+static struct attn_hw_reg *grc_int_bb_b0_regs[1] = {
+   _int0_bb_b0,
+};
+
+static const u16 grc_int0_k2_attn_idx[5] = {
+   0, 1, 2, 3, 4,
+};
+
+static struct attn_hw_reg grc_int0_k2 = {
+   0, 5, grc_int0_k2_attn_idx, 0x50180, 0x5018c, 0x50188, 0x50184
+};
+
+static struct attn_hw_reg *grc_int_k2_regs[1] = {
+   _int0_k2,
+};
+
+#ifdef ATTN_DESC
+static const char *grc_prty_attn_desc[3] = {
+   "grc_mem003_i_mem_prty",
+   "grc_mem002_i_mem_prty",
+   "grc_mem001_i_mem_prty",
+};
+#else
+#define grc_prty_attn_desc OSAL_NULL
+#endif
+
+static const u16 grc_prty1_bb_a0_attn_idx[2] = {
+   1, 2,
+};
+
+static struct attn_hw_reg grc_prty1_bb_a0 = {
+   0, 2, grc_prty1_bb_a0_attn_idx, 0x50200, 0x5020c, 0x50208, 0x50204
+};
+
+static struct attn_hw_reg *grc_prty_bb_a0_regs[1] = {
+   _prty1_bb_a0,
+};
+
+static const u16 grc_prty1_bb_b0_attn_idx[2] = {
+   0, 1,
+};
+
+static struct attn_hw_reg grc_prty1_bb_b0 = {
+   0, 2, grc_prty1_bb_b0_attn_idx, 0x50200, 0x5020c, 0x50208, 0x50204
+};
+
+static struct attn_hw_reg *grc_prty_bb_b0_regs[1] = {
+   _prty1_bb_b0,
+};
+
+static const u16 grc_prty1_k2_attn_idx[2] = {
+   0, 1,
+};
+
+static struct attn_hw_reg grc_prty1_k2 = {
+   0, 2, grc_prty1_k2_attn_idx, 0x50200, 0x5020c, 0x50208, 0x50204
+};
+
+static struct attn_hw_reg *grc_prty_k2_regs[1] = {
+   _prty1_k2,
+};
+
+#ifdef ATTN_DESC
+static const char *miscs_int_attn_desc[14] = {
+   "miscs_address_error",
+   "miscs_generic_sw",
+   "miscs_cnig_interrupt",
+   "miscs_opte_dorq_fifo_err_eng1",
+   "miscs_opte_dorq_fifo_err_eng0",
+   "miscs_opte_dbg_fifo_err_eng1",
+   "miscs_opte_dbg_fifo_err_eng0",
+   "miscs_opte_btb_if1_fifo_err_eng1",
+   "miscs_opte_btb_if1_fifo_err_eng0",
+   "miscs_opte_btb_if0_fifo_err_eng1",
+   "miscs_opte_btb_if0_fifo_err_eng0",
+   "miscs_opte_btb_sop_fifo_err_eng1",
+   "miscs_opte_btb_sop_fifo_err_eng0",
+   "miscs_opte_storm_fifo_err_eng0",
+};
+#else
+#define miscs_int_attn_desc OSAL_NULL
+#endif
+
+static const u16 miscs_int0_bb_a0_attn_idx[2] = {
+   0, 1,
+};
+
+static 

[dpdk-dev] [PATCH v2 07/10] qede: Add SRIOV support

2016-03-10 Thread Rasesh Mody
Signed-off-by: Harish Patil 
Signed-off-by: Rasesh Mody 
Signed-off-by: Sony Chacko 
---
 drivers/net/qede/Makefile  |2 +
 drivers/net/qede/base/bcm_osal.c   |   57 +-
 drivers/net/qede/base/ecore.h  |1 +
 drivers/net/qede/base/ecore_dev.c  |  116 +-
 drivers/net/qede/base/ecore_hw.c   |9 +-
 drivers/net/qede/base/ecore_init_ops.c |4 +
 drivers/net/qede/base/ecore_int.c  |   31 +-
 drivers/net/qede/base/ecore_iov_api.h  |  933 +
 drivers/net/qede/base/ecore_l2.c   |  233 ++-
 drivers/net/qede/base/ecore_l2.h   |   50 +
 drivers/net/qede/base/ecore_mcp.c  |   30 +
 drivers/net/qede/base/ecore_spq.c  |8 +-
 drivers/net/qede/base/ecore_sriov.c| 3422 
 drivers/net/qede/base/ecore_sriov.h|  390 
 drivers/net/qede/base/ecore_vf.c   | 1322 
 drivers/net/qede/base/ecore_vf.h   |  415 
 drivers/net/qede/base/ecore_vf_api.h   |  186 ++
 drivers/net/qede/base/ecore_vfpf_if.h  |  590 ++
 drivers/net/qede/qede_ethdev.c |   20 +-
 drivers/net/qede/qede_ethdev.h |4 +-
 drivers/net/qede/qede_main.c   |  151 +-
 21 files changed, 7863 insertions(+), 111 deletions(-)
 create mode 100644 drivers/net/qede/base/ecore_iov_api.h
 create mode 100644 drivers/net/qede/base/ecore_sriov.c
 create mode 100644 drivers/net/qede/base/ecore_sriov.h
 create mode 100644 drivers/net/qede/base/ecore_vf.c
 create mode 100644 drivers/net/qede/base/ecore_vf.h
 create mode 100644 drivers/net/qede/base/ecore_vf_api.h
 create mode 100644 drivers/net/qede/base/ecore_vfpf_if.h

diff --git a/drivers/net/qede/Makefile b/drivers/net/qede/Makefile
index eb08635..8970921 100644
--- a/drivers/net/qede/Makefile
+++ b/drivers/net/qede/Makefile
@@ -78,6 +78,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_init_ops.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_mcp.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_int.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/bcm_osal.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_sriov.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_vf.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede_ethdev.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede_eth_if.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede_main.c
diff --git a/drivers/net/qede/base/bcm_osal.c b/drivers/net/qede/base/bcm_osal.c
index 00b27ba..e7720c0 100644
--- a/drivers/net/qede/base/bcm_osal.c
+++ b/drivers/net/qede/base/bcm_osal.c
@@ -14,8 +14,9 @@
 #include "bcm_osal.h"
 #include "ecore.h"
 #include "ecore_hw.h"
+#include "ecore_iov_api.h"

-unsigned long log2_align(unsigned long n)
+unsigned long qede_log2_align(unsigned long n)
 {
unsigned long ret = n ? 1 : 0;
unsigned long _n = n >> 1;
@@ -31,7 +32,7 @@ unsigned long log2_align(unsigned long n)
return ret;
 }

-u32 osal_log2(u32 val)
+u32 qede_osal_log2(u32 val)
 {
u32 log = 0;

@@ -41,6 +42,54 @@ u32 osal_log2(u32 val)
return log;
 }

+inline void qede_set_bit(u32 nr, unsigned long *addr)
+{
+   __sync_fetch_and_or(addr, (1UL << nr));
+}
+
+inline void qede_clr_bit(u32 nr, unsigned long *addr)
+{
+   __sync_fetch_and_and(addr, ~(1UL << nr));
+}
+
+inline bool qede_test_bit(u32 nr, unsigned long *addr)
+{
+   bool res;
+
+   rte_mb();
+   res = ((*addr) & (1UL << nr)) != 0;
+   rte_mb();
+   return res;
+}
+
+static inline u32 qede_ffz(unsigned long word)
+{
+   unsigned long first_zero;
+
+   first_zero = __builtin_ffsl(~word);
+   return first_zero ? (first_zero - 1) : OSAL_BITS_PER_UL;
+}
+
+inline u32 qede_find_first_zero_bit(unsigned long *addr, u32 limit)
+{
+   u32 i;
+   u32 nwords = 0;
+   OSAL_BUILD_BUG_ON(!limit);
+   nwords = (limit - 1) / OSAL_BITS_PER_UL + 1;
+   for (i = 0; i < nwords; i++)
+   if (~(addr[i] != 0))
+   break;
+   return (i == nwords) ? limit : i * OSAL_BITS_PER_UL + qede_ffz(addr[i]);
+}
+
+void qede_vf_fill_driver_data(struct ecore_hwfn *hwfn,
+ __rte_unused struct vf_pf_resc_request *resc_req,
+ struct ecore_vf_acquire_sw_info *vf_sw_info)
+{
+   vf_sw_info->os_type = VFPF_ACQUIRE_OS_LINUX_USERSPACE;
+   vf_sw_info->override_fw_version = 1;
+}
+
 void *osal_dma_alloc_coherent(struct ecore_dev *p_dev,
  dma_addr_t *phys, size_t size)
 {
@@ -97,8 +146,8 @@ void *osal_dma_alloc_coherent_aligned(struct ecore_dev 
*p_dev,
return mz->addr;
 }

-u32 qed_unzip_data(struct ecore_hwfn *p_hwfn, u32 input_len,
-  u8 *input_buf, u32 max_size, u8 *unzip_buf)
+u32 qede_unzip_data(struct ecore_hwfn *p_hwfn, u32 input_len,
+   u8 *input_buf, u32 max_size, u8 *unzip_buf)
 {
int rc;

diff --git a/drivers/net/qede/base/ecore.h b/drivers/net/qede/base/ecore.h
index 2cd7a94..942aaee 100644
--- a/drivers/net/qede/base/ecore.h
+++ 

[dpdk-dev] [PATCH v2 06/10] qede: Add L2 support

2016-03-10 Thread Rasesh Mody
Signed-off-by: Harish Patil 
Signed-off-by: Rasesh Mody 
Signed-off-by: Sony Chacko 
---
 drivers/net/qede/Makefile|2 +
 drivers/net/qede/base/ecore_chain.h  |6 +
 drivers/net/qede/base/ecore_l2.c | 1608 ++
 drivers/net/qede/base/ecore_l2.h |  101 +++
 drivers/net/qede/base/ecore_l2_api.h |  401 +
 drivers/net/qede/qede_eth_if.c   |  456 ++
 drivers/net/qede/qede_eth_if.h   |2 +-
 drivers/net/qede/qede_ethdev.c   |   17 +-
 drivers/net/qede/qede_ethdev.h   |1 +
 drivers/net/qede/qede_if.h   |9 +
 drivers/net/qede/qede_main.c |2 +
 drivers/net/qede/qede_rxtx.c |  192 
 12 files changed, 2793 insertions(+), 4 deletions(-)
 create mode 100644 drivers/net/qede/base/ecore_l2.c
 create mode 100644 drivers/net/qede/base/ecore_l2.h
 create mode 100644 drivers/net/qede/base/ecore_l2_api.h
 create mode 100644 drivers/net/qede/qede_eth_if.c

diff --git a/drivers/net/qede/Makefile b/drivers/net/qede/Makefile
index efaefb2..eb08635 100644
--- a/drivers/net/qede/Makefile
+++ b/drivers/net/qede/Makefile
@@ -70,6 +70,7 @@ $(foreach obj, $(ECORE_DRIVER_OBJS), $(eval 
CFLAGS+=$(CFLAGS_ECORE_DRIVER)))
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_dev.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_hw.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_cxt.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_l2.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_sp_commands.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_init_fw_funcs.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_spq.c
@@ -78,6 +79,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_mcp.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_int.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/bcm_osal.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede_ethdev.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede_eth_if.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede_main.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede_rxtx.c

diff --git a/drivers/net/qede/base/ecore_chain.h 
b/drivers/net/qede/base/ecore_chain.h
index c9c21a6..8c8e8b4 100644
--- a/drivers/net/qede/base/ecore_chain.h
+++ b/drivers/net/qede/base/ecore_chain.h
@@ -251,6 +251,12 @@ static OSAL_INLINE u32 ecore_chain_get_page_cnt(struct 
ecore_chain *p_chain)
return p_chain->page_cnt;
 }

+static OSAL_INLINE
+dma_addr_t ecore_chain_get_pbl_phys(struct ecore_chain *p_chain)
+{
+   return p_chain->pbl.p_phys_table;
+}
+
 /**
  * @brief ecore_chain_advance_page -
  *
diff --git a/drivers/net/qede/base/ecore_l2.c b/drivers/net/qede/base/ecore_l2.c
new file mode 100644
index 000..8d713e7
--- /dev/null
+++ b/drivers/net/qede/base/ecore_l2.c
@@ -0,0 +1,1608 @@
+/*
+ * Copyright (c) 2016 QLogic Corporation.
+ * All rights reserved.
+ * www.qlogic.com
+ *
+ * See LICENSE.qede_pmd for copyright and licensing details.
+ */
+
+#include "bcm_osal.h"
+
+#include "ecore.h"
+#include "ecore_status.h"
+#include "ecore_hsi_eth.h"
+#include "ecore_chain.h"
+#include "ecore_spq.h"
+#include "ecore_init_fw_funcs.h"
+#include "ecore_cxt.h"
+#include "ecore_l2.h"
+#include "ecore_sp_commands.h"
+#include "ecore_gtt_reg_addr.h"
+#include "ecore_iro.h"
+#include "reg_addr.h"
+#include "ecore_int.h"
+#include "ecore_hw.h"
+#include "ecore_mcp.h"
+
+#define ECORE_MAX_SGES_NUM 16
+#define CRC32_POLY 0x1edc6f41
+
+enum _ecore_status_t
+ecore_sp_eth_vport_start(struct ecore_hwfn *p_hwfn,
+struct ecore_sp_vport_start_params *p_params)
+{
+   struct vport_start_ramrod_data *p_ramrod = OSAL_NULL;
+   struct ecore_spq_entry *p_ent = OSAL_NULL;
+   enum _ecore_status_t rc = ECORE_NOTIMPL;
+   struct ecore_sp_init_data init_data;
+   u8 abs_vport_id = 0;
+   u16 rx_mode = 0;
+
+   rc = ecore_fw_vport(p_hwfn, p_params->vport_id, _vport_id);
+   if (rc != ECORE_SUCCESS)
+   return rc;
+
+   /* Get SPQ entry */
+   OSAL_MEMSET(_data, 0, sizeof(init_data));
+   init_data.cid = ecore_spq_get_cid(p_hwfn);
+   init_data.opaque_fid = p_params->opaque_fid;
+   init_data.comp_mode = ECORE_SPQ_MODE_EBLOCK;
+
+   rc = ecore_sp_init_request(p_hwfn, _ent,
+  ETH_RAMROD_VPORT_START,
+  PROTOCOLID_ETH, _data);
+   if (rc != ECORE_SUCCESS)
+   return rc;
+
+   p_ramrod = _ent->ramrod.vport_start;
+   p_ramrod->vport_id = abs_vport_id;
+
+   p_ramrod->mtu = OSAL_CPU_TO_LE16(p_params->mtu);
+   p_ramrod->inner_vlan_removal_en = p_params->remove_inner_vlan;
+   p_ramrod->handle_ptp_pkts = p_params->handle_ptp_pkts;
+   p_ramrod->drop_ttl0_en = p_params->drop_ttl0;
+   p_ramrod->untagged = p_params->only_untagged;
+   p_ramrod->zero_placement_offset = p_params->zero_placement_offset;
+
+   SET_FIELD(rx_mode, ETH_VPORT_RX_MODE_UCAST_DROP_ALL, 1);
+   SET_FIELD(rx_mode, 

[dpdk-dev] [PATCH v2 05/10] qede: Add core driver

2016-03-10 Thread Rasesh Mody
Signed-off-by: Harish Patil 
Signed-off-by: Rasesh Mody 
Signed-off-by: Sony Chacko 
---
 drivers/net/qede/Makefile |   90 +++
 drivers/net/qede/qede_eth_if.h|  176 +
 drivers/net/qede/qede_ethdev.c|  957 +++
 drivers/net/qede/qede_ethdev.h|  155 
 drivers/net/qede/qede_if.h|  155 
 drivers/net/qede/qede_logs.h  |   93 +++
 drivers/net/qede/qede_main.c  |  548 ++
 drivers/net/qede/qede_rxtx.c  | 1172 +
 drivers/net/qede/qede_rxtx.h  |  187 +
 drivers/net/qede/rte_pmd_qede_version.map |4 +
 10 files changed, 3537 insertions(+)
 create mode 100644 drivers/net/qede/Makefile
 create mode 100644 drivers/net/qede/qede_eth_if.h
 create mode 100644 drivers/net/qede/qede_ethdev.c
 create mode 100644 drivers/net/qede/qede_ethdev.h
 create mode 100644 drivers/net/qede/qede_if.h
 create mode 100644 drivers/net/qede/qede_logs.h
 create mode 100644 drivers/net/qede/qede_main.c
 create mode 100644 drivers/net/qede/qede_rxtx.c
 create mode 100644 drivers/net/qede/qede_rxtx.h
 create mode 100644 drivers/net/qede/rte_pmd_qede_version.map

diff --git a/drivers/net/qede/Makefile b/drivers/net/qede/Makefile
new file mode 100644
index 000..efaefb2
--- /dev/null
+++ b/drivers/net/qede/Makefile
@@ -0,0 +1,90 @@
+#Copyright (c) 2016 QLogic Corporation.
+#All rights reserved.
+#www.qlogic.com
+#
+#See LICENSE.qede_pmd for copyright and licensing details.
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+#
+# library name
+#
+LIB = librte_pmd_qede.a
+
+CFLAGS += -O3
+CFLAGS += $(WERROR_FLAGS)
+
+EXPORT_MAP := rte_pmd_qede_version.map
+
+LIBABIVER := 1
+
+#
+#OS
+#
+OS_TYPE := $(shell uname -s)
+
+#
+# CFLAGS
+#
+CFLAGS_ECORE_DRIVER = -Wno-unused-parameter
+CFLAGS_ECORE_DRIVER += -Wno-unused-value
+CFLAGS_ECORE_DRIVER += -Wno-sign-compare
+CFLAGS_ECORE_DRIVER += -Wno-missing-prototypes
+CFLAGS_ECORE_DRIVER += -Wno-cast-qual
+CFLAGS_ECORE_DRIVER += -Wno-unused-function
+CFLAGS_ECORE_DRIVER += -Wno-unused-variable
+CFLAGS_ECORE_DRIVER += -Wno-strict-aliasing
+CFLAGS_ECORE_DRIVER += -Wno-missing-prototypes
+CFLAGS_ECORE_DRIVER += -Wno-format-nonliteral
+ifeq ($(OS_TYPE),Linux)
+CFLAGS_ECORE_DRIVER += -Wno-shift-negative-value
+endif
+
+ifneq (,$(filter gcc gcc48,$(CC)))
+CFLAGS_ECORE_DRIVER += -Wno-unused-but-set-variable
+CFLAGS_ECORE_DRIVER += -Wno-missing-declarations
+CFLAGS_ECORE_DRIVER += -Wno-maybe-uninitialized
+CFLAGS_ECORE_DRIVER += -Wno-strict-prototypes
+else ifeq ($(CC), clang)
+CFLAGS_ECORE_DRIVER += -Wno-format-extra-args
+CFLAGS_ECORE_DRIVER += -Wno-visibility
+CFLAGS_ECORE_DRIVER += -Wno-empty-body
+CFLAGS_ECORE_DRIVER += -Wno-invalid-source-encoding
+CFLAGS_ECORE_DRIVER += -Wno-sometimes-uninitialized
+CFLAGS_ECORE_DRIVER += -Wno-pointer-bool-conversion
+else
+#icc flags
+endif
+
+#
+# Add extra flags for base ecore driver files
+# to disable warnings in them
+#
+#
+ECORE_DRIVER_OBJS=$(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c)))
+$(foreach obj, $(ECORE_DRIVER_OBJS), $(eval CFLAGS+=$(CFLAGS_ECORE_DRIVER)))
+
+#
+# all source are stored in SRCS-y
+#
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_dev.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_hw.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_cxt.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_sp_commands.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_init_fw_funcs.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_spq.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_init_ops.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_mcp.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_int.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/bcm_osal.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede_ethdev.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede_main.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede_rxtx.c
+
+# dependent libs:
+DEPDIRS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += lib/librte_eal lib/librte_ether
+DEPDIRS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += lib/librte_mempool lib/librte_mbuf
+DEPDIRS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += lib/librte_net lib/librte_malloc
+
+
+include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/net/qede/qede_eth_if.h b/drivers/net/qede/qede_eth_if.h
new file mode 100644
index 000..47b169d
--- /dev/null
+++ b/drivers/net/qede/qede_eth_if.h
@@ -0,0 +1,176 @@
+/*
+ * Copyright (c) 2016 QLogic Corporation.
+ * All rights reserved.
+ * www.qlogic.com
+ *
+ * See LICENSE.qede_pmd for copyright and licensing details.
+ */
+
+#ifndef _QEDE_ETH_IF_H
+#define _QEDE_ETH_IF_H
+
+#include "qede_if.h"
+
+/*forward decl */
+struct eth_slow_path_rx_cqe;
+
+#define INIT_STRUCT_FIELD(field, value) .field = value
+
+#define QED_ETH_INTERFACE_VERSION   609
+
+enum qed_filter_rx_mode_type {
+   QED_FILTER_RX_MODE_TYPE_REGULAR,
+   QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC,
+   QED_FILTER_RX_MODE_TYPE_PROMISC,
+};
+
+enum 

[dpdk-dev] [PATCH v2 03/10] qede: Add license file

2016-03-10 Thread Rasesh Mody
Signed-off-by: Harish Patil 
Signed-off-by: Rasesh Mody 
Signed-off-by: Sony Chacko 
---
 drivers/net/qede/LICENSE.qede_pmd |   28 
 1 file changed, 28 insertions(+)
 create mode 100644 drivers/net/qede/LICENSE.qede_pmd

diff --git a/drivers/net/qede/LICENSE.qede_pmd 
b/drivers/net/qede/LICENSE.qede_pmd
new file mode 100644
index 000..c7cbdcc
--- /dev/null
+++ b/drivers/net/qede/LICENSE.qede_pmd
@@ -0,0 +1,28 @@
+/*
+ * BSD LICENSE
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of QLogic Corporation nor the name of its contributors
+ *may be used to endorse or promote products derived from this software
+ *without specific prior written consent.
+ *
+ * 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.
+ */
-- 
1.7.10.3



[dpdk-dev] [PATCH v2 02/10] qede: add documentation

2016-03-10 Thread Rasesh Mody
Signed-off-by: Harish Patil 
Signed-off-by: Rasesh Mody 
Signed-off-by: Sony Chacko 
---
 doc/guides/nics/index.rst |1 +
 doc/guides/nics/qede.rst  |  340 +
 2 files changed, 341 insertions(+)
 create mode 100644 doc/guides/nics/qede.rst

diff --git a/doc/guides/nics/index.rst b/doc/guides/nics/index.rst
index 8618114..f092f75 100644
--- a/doc/guides/nics/index.rst
+++ b/doc/guides/nics/index.rst
@@ -50,6 +50,7 @@ Network Interface Controller Drivers
 virtio
 vmxnet3
 pcap_ring
+qede

 **Figures**

diff --git a/doc/guides/nics/qede.rst b/doc/guides/nics/qede.rst
new file mode 100644
index 000..072f4a1
--- /dev/null
+++ b/doc/guides/nics/qede.rst
@@ -0,0 +1,340 @@
+..  BSD LICENSE
+Copyright (c) 2016 QLogic Corporation
+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 QLogic 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.
+
+QEDE Poll Mode Driver
+==
+
+The QEDE poll mode driver library (**librte_pmd_qede**) implements support
+for **QLogic FastLinQ QL4 25G/40G CNA** family of adapters as well
+as their virtual functions (VF) in SR-IOV context. It is supported on
+several standard Linux distros like RHEL7.x and SLES12.x OS.
+It is compile-tested under FreeBSD OS.
+
+More information can be found at `QLogic Corporation's Official Website
+`_.
+
+Supported Features
+--
+
+- Unicast/Multicast filtering
+- Promiscuous mode
+- Allmulti mode
+- Port hardware statistics
+- Jumbo frames (using single buffer)
+- VLAN offload - Filtering and stripping
+- Stateless checksum offloads (IPv4/TCP/UDP)
+- Multiple Rx/Tx queues (queue-pairs)
+- RSS (with default table/key)
+- TSS
+- Multiple MAC address
+- Default pause flow control
+- SR-IOV VF
+
+Non-supported Features
+--
+
+- Scatter-Gather Rx/Tx frames
+- User configurable RETA table/key
+- Unequal number of Rx/Tx queues
+- MTU change (dynamic)
+- SR-IOV PF
+- Tunneling offloads
+- Ungraceful recovery 
+
+Supported QLogic NICs
+-
+
+- QLogic FastLinQ QL4 25G/40G CNAs
+
+Prerequisites
+-
+
+- Requires storm firmware version **8.7.x.** and management
+  firmware version **8.7.x and higher**. Storm firmware may be available
+  under /usr/lib/firmware/qed/ in certain newer Linux
+  distributions (e.g. qed_init_values_zipped-8.7.8.0.bin).
+
+- If the required firmware files are not available then visit
+  `QLogic Driver Download Center `
+
+- This driver relies on external zlib library (-lz) for uncompressing
+  the firmware file.
+
+Performance note
+
+
+- For better performance, it is recommended to use 8K or 16K RX/TX rings
+
+Config File Options
+~~~
+
+The following options can be modified in the ``.config`` file. Please note that
+enabling debugging options may affect system performance.
+
+- ``CONFIG_RTE_LIBRTE_QEDE_PMD`` (default **y**)
+
+  Toggle compilation of QEDE PMD driver.
+
+- ``CONFIG_RTE_LIBRTE_QEDE_DEBUG_INFO`` (default **n**)
+
+  Toggle display of generic debugging messages.
+
+- ``CONFIG_RTE_LIBRTE_QEDE_DEBUG_ECORE`` (default **n**)
+
+  Toggle display of ecore related messages.
+
+- ``CONFIG_RTE_LIBRTE_QEDE_DEBUG_TX`` (default **n**)
+
+  Toggle display of transmit fast path run-time messages.
+
+- ``CONFIG_RTE_LIBRTE_QEDE_DEBUG_RX`` (default **n**)
+
+  Toggle display of receive fast path run-time messages.
+
+- ``CONFIG_RTE_LIBRTE_QEDE_RX_COAL_US`` (default 

[dpdk-dev] [PATCH v2 01/10] qede: add maintainers

2016-03-10 Thread Rasesh Mody
From: Harish Patil 

Signed-off-by: Harish Patil 
Signed-off-by: Rasesh Mody 
Signed-off-by: Sony Chacko 
---
 MAINTAINERS |7 +++
 1 file changed, 7 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 628bc05..1b27467 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -352,6 +352,13 @@ Null PMD
 M: Tetsuya Mukawa 
 F: drivers/net/null/

+QLogic qede PMD
+M: Harish Patil 
+M: Rasesh Mody 
+M: Sony Chacko 
+F: drivers/net/qede/
+F: doc/guides/nics/qede.rst
+
 Intel AES-NI Multi-Buffer
 M: Declan Doherty 
 F: drivers/crypto/aesni_mb/
-- 
1.7.10.3



[dpdk-dev] [PATCH v2 00/10] qede: Add qede PMD

2016-03-10 Thread Rasesh Mody
Submitting v2 patch series for QEDE PMD after incorporating review comments.

Includes:
 - Rename common module as base/ to be consistent with other PMD
 - Split the driver/common module into several patches based on feature by
   feature basis
 - Fix checkpatch warnings based on latest checkpatch.pl and correct checkpatch
   options
 - Move out newly added PCI ids from rte_pci_dev_ids.h and define those within
   the PMD
 - Rename common functions properly to avoid namespace clashes
 - Fix documentation to wrap it under 80 columns

Please Apply.

Thanks!
Rasesh

Harish Patil (1):
  qede: add maintainers

Rasesh Mody (9):
  qede: add documentation
  qede: Add license file
  qede: Add base driver
  qede: Add core driver
  qede: Add L2 support
  qede: Add SRIOV support
  qede: Add attention support
  qede: Add DCBX support
  qede: enable PMD build

 MAINTAINERS |7 +
 config/common_base  |   14 +
 doc/guides/nics/index.rst   |1 +
 doc/guides/nics/qede.rst|  340 +
 drivers/net/Makefile|1 +
 drivers/net/qede/LICENSE.qede_pmd   |   28 +
 drivers/net/qede/Makefile   |   95 +
 drivers/net/qede/base/bcm_osal.c|  178 +
 drivers/net/qede/base/bcm_osal.h|  395 +
 drivers/net/qede/base/common_hsi.h  |  714 ++
 drivers/net/qede/base/ecore.h   |  746 ++
 drivers/net/qede/base/ecore_attn_values.h   |13287 +++
 drivers/net/qede/base/ecore_chain.h |  724 ++
 drivers/net/qede/base/ecore_cxt.c   | 1961 
 drivers/net/qede/base/ecore_cxt.h   |  157 +
 drivers/net/qede/base/ecore_cxt_api.h   |   79 +
 drivers/net/qede/base/ecore_dcbx.c  |  887 ++
 drivers/net/qede/base/ecore_dcbx.h  |   55 +
 drivers/net/qede/base/ecore_dcbx_api.h  |  160 +
 drivers/net/qede/base/ecore_dev.c   | 3578 
 drivers/net/qede/base/ecore_dev_api.h   |  497 +
 drivers/net/qede/base/ecore_gtt_reg_addr.h  |   42 +
 drivers/net/qede/base/ecore_gtt_values.h|   33 +
 drivers/net/qede/base/ecore_hsi_common.h| 1912 
 drivers/net/qede/base/ecore_hsi_eth.h   | 1912 
 drivers/net/qede/base/ecore_hsi_tools.h | 1081 +++
 drivers/net/qede/base/ecore_hw.c|  992 ++
 drivers/net/qede/base/ecore_hw.h|  269 +
 drivers/net/qede/base/ecore_hw_defs.h   |   49 +
 drivers/net/qede/base/ecore_init_fw_funcs.c | 1275 +++
 drivers/net/qede/base/ecore_init_fw_funcs.h |  263 +
 drivers/net/qede/base/ecore_init_ops.c  |  599 ++
 drivers/net/qede/base/ecore_init_ops.h  |  103 +
 drivers/net/qede/base/ecore_int.c   | 2225 +
 drivers/net/qede/base/ecore_int.h   |  234 +
 drivers/net/qede/base/ecore_int_api.h   |  277 +
 drivers/net/qede/base/ecore_iov_api.h   |  933 ++
 drivers/net/qede/base/ecore_iro.h   |  115 +
 drivers/net/qede/base/ecore_iro_values.h|   59 +
 drivers/net/qede/base/ecore_l2.c| 1798 
 drivers/net/qede/base/ecore_l2.h|  151 +
 drivers/net/qede/base/ecore_l2_api.h|  401 +
 drivers/net/qede/base/ecore_mcp.c   | 1928 
 drivers/net/qede/base/ecore_mcp.h   |  304 +
 drivers/net/qede/base/ecore_mcp_api.h   |  611 ++
 drivers/net/qede/base/ecore_proto_if.h  |   28 +
 drivers/net/qede/base/ecore_rt_defs.h   |  446 +
 drivers/net/qede/base/ecore_sp_api.h|   42 +
 drivers/net/qede/base/ecore_sp_commands.c   |  525 ++
 drivers/net/qede/base/ecore_sp_commands.h   |  137 +
 drivers/net/qede/base/ecore_spq.c   |  944 ++
 drivers/net/qede/base/ecore_spq.h   |  284 +
 drivers/net/qede/base/ecore_sriov.c | 3422 +++
 drivers/net/qede/base/ecore_sriov.h |  390 +
 drivers/net/qede/base/ecore_status.h|   30 +
 drivers/net/qede/base/ecore_utils.h |   31 +
 drivers/net/qede/base/ecore_vf.c| 1322 +++
 drivers/net/qede/base/ecore_vf.h|  415 +
 drivers/net/qede/base/ecore_vf_api.h|  186 +
 drivers/net/qede/base/ecore_vfpf_if.h   |  590 ++
 drivers/net/qede/base/eth_common.h  |  526 ++
 drivers/net/qede/base/mcp_public.h  | 1195 +++
 drivers/net/qede/base/nvm_cfg.h |  919 ++
 drivers/net/qede/base/reg_addr.h| 1107 +++
 drivers/net/qede/qede_eth_if.c  |  456 +
 drivers/net/qede/qede_eth_if.h  |  176 +
 drivers/net/qede/qede_ethdev.c  |  986 ++
 drivers/net/qede/qede_ethdev.h  |  156 +
 drivers/net/qede/qede_if.h  |  164 +
 drivers/net/qede/qede_logs.h|   93 +
 drivers/net/qede/qede_main.c|  601 ++
 drivers/net/qede/qede_rxtx.c| 1364 +++
 drivers/net/qede/qede_rxtx.h|  187 +
 drivers/net/qede/rte_pmd_qede_version.map   |4 +
 mk/rte.app.mk   |2 +
 

[dpdk-dev] [PATCH v5 0/2] fm10k: enable FTAG based forwarding

2016-03-10 Thread Wang, Xiao W
Hi,

We reached a consensus on configuring FTAG by devargs method, any other 
suggestion
or concern for this patch?

Best Regards,
Xiao

> -Original Message-
> From: Liu, Yong
> Sent: Tuesday, March 8, 2016 3:58 PM
> To: Wang, Xiao W ; Chen, Jing D
> 
> Cc: dev at dpdk.org
> Subject: RE: [dpdk-dev] [PATCH v5 0/2] fm10k: enable FTAG based forwarding
> 
> Tested-by: Yong Liu 
> 
> - Tested Branch: dpdk-next-net/rel_16_04
> - Tested Commit: 4ac366ba647909c3b71818f9be9db86ba5e871da
> - OS: Fedora20 3.11.10-301.fc20.x86_64
> - GCC: gcc version 4.8.3 20140911
> - CPU: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz
> - NIC: Intel Corporation Device RedrockCanyou [8086:15a4]
> - Default x86_64-native-linuxapp-gcc configuration
> - Prerequisites:
> - Total 1 cases, 1 passed, 0 failed
> 
> - Prerequisites command / instruction:
>   Apply fm_ftag unit test patch.
>   export Port0 and Port1's GLORT ID to environment variables
> export PORT1_GLORT=0x4200
> export PORT0_GLORT=0x4000
> 
> - Case: Ftag forwarding unit test
>   Description: check fm10k nic can forwarding packets based on FTAG
>   Command / instruction:
> Start test application and run fm10k_ftag_autotest
>   test -c f -n 4 -w 83:00.0,enable_ftag=1 -w 85:00.0,enable_ftag=1
>   RTE>>fm10k_ftag_autotest
> Send packet to Port0 and verify packet forwarded to Port1
>   Receive 1 packets on port 0
>   test for FTAG RX passed
>   Send out 1 packets with FTAG on port 0
>   Receive 1 packets on port 1
>   test for FTAG TX passed
>   Test OK
> 
> 
> > -Original Message-
> > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Wang Xiao W
> > Sent: Wednesday, March 02, 2016 7:19 PM
> > To: Chen, Jing D
> > Cc: dev at dpdk.org
> > Subject: [dpdk-dev] [PATCH v5 0/2] fm10k: enable FTAG based forwarding
> >
> > v5:
> > * Used kvargs api to parse the devargs parameter.
> > * Put release note into the driver patch.
> >
> > v4:
> > * Removed the build time config option, used devargs to config FTAG.
> > * Rebased on head of dpdk-next-net/rel_16_04 branch.
> >
> > v3:
> > * Removed "\n" in PMD_INIT_LOG.
> > * Returned "-ENOTSUP" instead of -1 in VF FTAG use case.
> >
> > v2:
> > * Gave an error message for VF FTAG use case.
> > * Added a notice in the doc to emphasize that application should ensure
> >   an appropriate FTAG for every frame in FTAG based forwarding mode.
> >
> > Wang Xiao W (2):
> >   fm10k: enable FTAG based forwarding
> >   doc: add introduction for fm10k FTAG based forwarding
> >
> >  doc/guides/nics/fm10k.rst  | 16 -
> >  doc/guides/rel_notes/release_16_04.rst |  2 ++
> >  drivers/net/fm10k/fm10k.h  |  2 ++
> >  drivers/net/fm10k/fm10k_ethdev.c   | 65
> > +-
> >  drivers/net/fm10k/fm10k_rxtx.c | 15 
> >  drivers/net/fm10k/fm10k_rxtx_vec.c |  3 ++
> >  6 files changed, 101 insertions(+), 2 deletions(-)
> >
> > --
> > 1.9.3



[dpdk-dev] [PATCH v7 11/11] pmd/vmxnet3: add dev_ptype_info_get implementation

2016-03-10 Thread Jianfeng Tan
Signed-off-by: Jianfeng Tan 
Acked-by: Konstantin Ananyev 
Acked-by: Adrien Mazarguil 
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 16 
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c 
b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index c363bf6..ac120a1 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -86,6 +86,7 @@ static void vmxnet3_dev_stats_get(struct rte_eth_dev *dev,
struct rte_eth_stats *stats);
 static void vmxnet3_dev_info_get(struct rte_eth_dev *dev,
struct rte_eth_dev_info *dev_info);
+static const uint32_t *vmxnet3_dev_ptype_info_get(struct rte_eth_dev *dev);
 static int vmxnet3_dev_vlan_filter_set(struct rte_eth_dev *dev,
   uint16_t vid, int on);
 static void vmxnet3_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask);
@@ -118,6 +119,7 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
.link_update  = vmxnet3_dev_link_update,
.stats_get= vmxnet3_dev_stats_get,
.dev_infos_get= vmxnet3_dev_info_get,
+   .dev_ptype_info_get   = vmxnet3_dev_ptype_info_get,
.vlan_filter_set  = vmxnet3_dev_vlan_filter_set,
.vlan_offload_set = vmxnet3_dev_vlan_offload_set,
.rx_queue_setup   = vmxnet3_dev_rx_queue_setup,
@@ -718,6 +720,20 @@ vmxnet3_dev_info_get(__attribute__((unused))struct 
rte_eth_dev *dev, struct rte_
};
 }

+static const uint32_t *
+vmxnet3_dev_ptype_info_get(struct rte_eth_dev *dev)
+{
+   static const uint32_t ptypes[] = {
+   RTE_PTYPE_L3_IPV4_EXT,
+   RTE_PTYPE_L3_IPV4,
+   RTE_PTYPE_UNKNOWN
+   };
+
+   if (dev->rx_pkt_burst == vmxnet3_recv_pkts)
+   return ptypes;
+   return NULL;
+}
+
 /* return 0 means link status changed, -1 means not changed */
 static int
 vmxnet3_dev_link_update(struct rte_eth_dev *dev, __attribute__((unused)) int 
wait_to_complete)
-- 
2.1.4



[dpdk-dev] [PATCH v7 10/11] pmd/nfp: add dev_ptype_info_get implementation

2016-03-10 Thread Jianfeng Tan
Signed-off-by: Jianfeng Tan 
Acked-by: Konstantin Ananyev 
Acked-by: Adrien Mazarguil 
---
 drivers/net/nfp/nfp_net.c | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 9c4f218..ad6eebd 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -1073,6 +1073,24 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct 
rte_eth_dev_info *dev_info)
dev_info->hash_key_size = NFP_NET_CFG_RSS_KEY_SZ;
 }

+static const uint32_t *
+nfp_net_ptype_info_get(struct rte_eth_dev *dev)
+{
+   static const uint32_t ptypes[] = {
+   /* refers to nfp_net_set_hash() */
+   RTE_PTYPE_INNER_L3_IPV4,
+   RTE_PTYPE_INNER_L3_IPV6,
+   RTE_PTYPE_INNER_L3_IPV6_EXT,
+   RTE_PTYPE_INNER_L4_MASK,
+   RTE_PTYPE_UNKNOWN
+   };
+
+
+   if (dev->rx_pkt_burst == nfp_net_recv_pkts)
+   return ptypes;
+   return num;
+}
+
 static uint32_t
 nfp_net_rx_queue_count(struct rte_eth_dev *dev, uint16_t queue_idx)
 {
@@ -2292,6 +2310,7 @@ static struct eth_dev_ops nfp_net_eth_dev_ops = {
.stats_get  = nfp_net_stats_get,
.stats_reset= nfp_net_stats_reset,
.dev_infos_get  = nfp_net_infos_get,
+   .dev_ptype_info_get = nfp_net_ptype_info_get,
.mtu_set= nfp_net_dev_mtu_set,
.vlan_offload_set   = nfp_net_vlan_offload_set,
.reta_update= nfp_net_reta_update,
-- 
2.1.4



[dpdk-dev] [PATCH v7 09/11] pmd/mlx5: add dev_ptype_info_get implementation

2016-03-10 Thread Jianfeng Tan
Signed-off-by: Jianfeng Tan 
Acked-by: Konstantin Ananyev 
Acked-by: Adrien Mazarguil 
---
 drivers/net/mlx5/mlx5.c|  1 +
 drivers/net/mlx5/mlx5.h|  1 +
 drivers/net/mlx5/mlx5_ethdev.c | 20 
 drivers/net/mlx5/mlx5_rxtx.c   |  2 ++
 4 files changed, 24 insertions(+)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 821ee0f..e18b1e9 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -153,6 +153,7 @@ static const struct eth_dev_ops mlx5_dev_ops = {
.stats_get = mlx5_stats_get,
.stats_reset = mlx5_stats_reset,
.dev_infos_get = mlx5_dev_infos_get,
+   .dev_ptype_info_get = mlx5_dev_ptype_info_get,
.vlan_filter_set = mlx5_vlan_filter_set,
.rx_queue_setup = mlx5_rx_queue_setup,
.tx_queue_setup = mlx5_tx_queue_setup,
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index b84d31d..196435d 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -156,6 +156,7 @@ int priv_get_mtu(struct priv *, uint16_t *);
 int priv_set_flags(struct priv *, unsigned int, unsigned int);
 int mlx5_dev_configure(struct rte_eth_dev *);
 void mlx5_dev_infos_get(struct rte_eth_dev *, struct rte_eth_dev_info *);
+const uint32_t *mlx5_dev_ptype_info_get(struct rte_eth_dev *dev);
 int mlx5_link_update(struct rte_eth_dev *, int);
 int mlx5_dev_set_mtu(struct rte_eth_dev *, uint16_t);
 int mlx5_dev_get_flow_ctrl(struct rte_eth_dev *, struct rte_eth_fc_conf *);
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 1159fa3..406f8dc 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -526,6 +526,26 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct 
rte_eth_dev_info *info)
priv_unlock(priv);
 }

+const uint32_t *
+mlx5_dev_ptype_info_get(struct rte_eth_dev *dev)
+{
+   static const uint32_t ptypes[] = {
+   /* refers to rxq_cq_to_pkt_type() */
+   RTE_PTYPE_L3_IPV4,
+   RTE_PTYPE_L3_IPV6,
+   RTE_PTYPE_INNER_L3_IPV4,
+   RTE_PTYPE_INNER_L3_IPV6,
+   RTE_PTYPE_UNKNOWN
+
+   };
+
+   if (dev->rx_pkt_burst == mlx5_rx_burst ||
+   dev->rx_pkt_burst == mlx5_rx_burst_sp)
+   return ptypes;
+   return NULL;
+
+}
+
 /**
  * DPDK callback to retrieve physical link information (unlocked version).
  *
diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index fa5e648..79bdf8d 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -603,6 +603,8 @@ stop:
  * @param flags
  *   RX completion flags returned by poll_length_flags().
  *
+ * @note: fix mlx5_dev_ptype_info_get() if any change here.
+ *
  * @return
  *   Packet type for struct rte_mbuf.
  */
-- 
2.1.4



[dpdk-dev] [PATCH v7 08/11] pmd/mlx4: add dev_ptype_info_get implementation

2016-03-10 Thread Jianfeng Tan
Signed-off-by: Jianfeng Tan 
Acked-by: Konstantin Ananyev 
Acked-by: Adrien Mazarguil 
---
 drivers/net/mlx4/mlx4.c | 21 +
 1 file changed, 21 insertions(+)

diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index ee00151..58f4e1a 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -2835,6 +2835,8 @@ rxq_cleanup(struct rxq *rxq)
  * @param flags
  *   RX completion flags returned by poll_length_flags().
  *
+ * @note: fix mlx4_dev_ptype_info_get() if any change here.
+ *
  * @return
  *   Packet type for struct rte_mbuf.
  */
@@ -4267,6 +4269,24 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev, struct 
rte_eth_dev_info *info)
priv_unlock(priv);
 }

+static const uint32_t *
+mlx4_dev_ptype_info_get(struct rte_eth_dev *dev)
+{
+   static const uint32_t ptypes[] = {
+   /* refers to rxq_cq_to_pkt_type() */
+   RTE_PTYPE_L3_IPV4,
+   RTE_PTYPE_L3_IPV6,
+   RTE_PTYPE_INNER_L3_IPV4,
+   RTE_PTYPE_INNER_L3_IPV6,
+   RTE_PTYPE_UNKNOWN
+   };
+
+   if (dev->rx_pkt_burst == mlx4_rx_burst ||
+   dev->rx_pkt_burst == mlx4_rx_burst_sp)
+   return ptypes;
+   return NULL;
+}
+
 /**
  * DPDK callback to get device statistics.
  *
@@ -4988,6 +5008,7 @@ static const struct eth_dev_ops mlx4_dev_ops = {
.stats_reset = mlx4_stats_reset,
.queue_stats_mapping_set = NULL,
.dev_infos_get = mlx4_dev_infos_get,
+   .dev_ptypes_info_get = mlx4_dev_ptype_info_get,
.vlan_filter_set = mlx4_vlan_filter_set,
.vlan_tpid_set = NULL,
.vlan_strip_queue_set = NULL,
-- 
2.1.4



[dpdk-dev] [PATCH v7 07/11] pmd/ixgbe: add dev_ptype_info_get implementation

2016-03-10 Thread Jianfeng Tan
Signed-off-by: Jianfeng Tan 
Acked-by: Konstantin Ananyev 
Acked-by: Adrien Mazarguil 
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 38 ++
 drivers/net/ixgbe/ixgbe_ethdev.h |  2 ++
 drivers/net/ixgbe/ixgbe_rxtx.c   |  4 +++-
 3 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 3e6fe86..605d958 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -166,6 +166,7 @@ static int ixgbe_dev_queue_stats_mapping_set(struct 
rte_eth_dev *eth_dev,
 uint8_t is_rx);
 static void ixgbe_dev_info_get(struct rte_eth_dev *dev,
   struct rte_eth_dev_info *dev_info);
+static const uint32_t *ixgbe_dev_ptype_info_get(struct rte_eth_dev *dev);
 static void ixgbevf_dev_info_get(struct rte_eth_dev *dev,
 struct rte_eth_dev_info *dev_info);
 static int ixgbe_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);
@@ -428,6 +429,7 @@ static const struct eth_dev_ops ixgbe_eth_dev_ops = {
.xstats_reset = ixgbe_dev_xstats_reset,
.queue_stats_mapping_set = ixgbe_dev_queue_stats_mapping_set,
.dev_infos_get= ixgbe_dev_info_get,
+   .dev_ptype_info_get   = ixgbe_dev_ptype_info_get,
.mtu_set  = ixgbe_dev_mtu_set,
.vlan_filter_set  = ixgbe_vlan_filter_set,
.vlan_tpid_set= ixgbe_vlan_tpid_set,
@@ -512,6 +514,7 @@ static const struct eth_dev_ops ixgbevf_eth_dev_ops = {
.xstats_reset = ixgbevf_dev_stats_reset,
.dev_close= ixgbevf_dev_close,
.dev_infos_get= ixgbevf_dev_info_get,
+   .dev_ptype_info_get   = ixgbe_dev_ptype_info_get,
.mtu_set  = ixgbevf_dev_set_mtu,
.vlan_filter_set  = ixgbevf_vlan_filter_set,
.vlan_strip_queue_set = ixgbevf_vlan_strip_queue_set,
@@ -2829,6 +2832,41 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, struct 
rte_eth_dev_info *dev_info)
dev_info->flow_type_rss_offloads = IXGBE_RSS_OFFLOAD_ALL;
 }

+static const uint32_t *
+ixgbe_dev_ptype_info_get(struct rte_eth_dev *dev)
+{
+   static const uint32_t ptypes[] = {
+   /* For non-vec functions,
+* refers to ixgbe_rxd_pkt_info_to_pkt_type();
+* for vec functions,
+* refers to _recv_raw_pkts_vec().
+*/
+   RTE_PTYPE_L2_ETHER,
+   RTE_PTYPE_L3_IPV4,
+   RTE_PTYPE_L3_IPV4_EXT,
+   RTE_PTYPE_L3_IPV6,
+   RTE_PTYPE_L3_IPV6_EXT,
+   RTE_PTYPE_L4_SCTP,
+   RTE_PTYPE_L4_TCP,
+   RTE_PTYPE_L4_UDP,
+   RTE_PTYPE_TUNNEL_IP,
+   RTE_PTYPE_INNER_L3_IPV6,
+   RTE_PTYPE_INNER_L3_IPV6_EXT,
+   RTE_PTYPE_INNER_L4_TCP,
+   RTE_PTYPE_INNER_L4_UDP,
+   RTE_PTYPE_UNKNOWN
+   };
+
+   if (dev->rx_pkt_burst == ixgbe_recv_pkts ||
+   dev->rx_pkt_burst == ixgbe_recv_pkts_lro_single_alloc ||
+   dev->rx_pkt_burst == ixgbe_recv_pkts_lro_bulk_alloc ||
+   dev->rx_pkt_burst == ixgbe_recv_pkts_bulk_alloc ||
+   dev->rx_pkt_burst == ixgbe_recv_pkts_vec ||
+   dev->rx_pkt_burst == ixgbe_recv_scattered_pkts_vec)
+   return ptypes;
+   return NULL;
+}
+
 static void
 ixgbevf_dev_info_get(struct rte_eth_dev *dev,
 struct rte_eth_dev_info *dev_info)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h
index d26771a..b07d3da 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.h
+++ b/drivers/net/ixgbe/ixgbe_ethdev.h
@@ -379,6 +379,8 @@ void ixgbevf_dev_rxtx_start(struct rte_eth_dev *dev);
 uint16_t ixgbe_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
uint16_t nb_pkts);

+uint16_t ixgbe_recv_pkts_bulk_alloc(void *rx_queue, struct rte_mbuf **rx_pkts,
+   uint16_t nb_pkts);
 uint16_t ixgbe_recv_pkts_lro_single_alloc(void *rx_queue,
struct rte_mbuf **rx_pkts, uint16_t nb_pkts);
 uint16_t ixgbe_recv_pkts_lro_bulk_alloc(void *rx_queue,
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 54278ce..5ade610 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -899,6 +899,8 @@ end_of_tx:
 #define IXGBE_PACKET_TYPE_MAX   0X80
 #define IXGBE_PACKET_TYPE_MASK  0X7F
 #define IXGBE_PACKET_TYPE_SHIFT 0X04
+
+/* @note: fix ixgbe_dev_ptype_info_get() if any change here. */
 static inline uint32_t
 ixgbe_rxd_pkt_info_to_pkt_type(uint16_t pkt_info)
 {
@@ -1247,7 +1249,7 @@ rx_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 }

 /* split requests into chunks of size RTE_PMD_IXGBE_RX_MAX_BURST */
-static uint16_t
+uint16_t
 ixgbe_recv_pkts_bulk_alloc(void *rx_queue, struct 

[dpdk-dev] [PATCH v7 06/11] pmd/i40e: add dev_ptype_info_get implementation

2016-03-10 Thread Jianfeng Tan
Signed-off-by: Jianfeng Tan 
Acked-by: Konstantin Ananyev 
Acked-by: Adrien Mazarguil 
---
 drivers/net/i40e/i40e_ethdev.c|  1 +
 drivers/net/i40e/i40e_ethdev_vf.c |  1 +
 drivers/net/i40e/i40e_rxtx.c  | 46 ++-
 drivers/net/i40e/i40e_rxtx.h  |  1 +
 4 files changed, 48 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7e68c61..67db2dd 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -450,6 +450,7 @@ static const struct eth_dev_ops i40e_eth_dev_ops = {
.xstats_reset = i40e_dev_stats_reset,
.queue_stats_mapping_set  = i40e_dev_queue_stats_mapping_set,
.dev_infos_get= i40e_dev_info_get,
+   .dev_ptype_info_get   = i40e_dev_ptype_info_get,
.vlan_filter_set  = i40e_vlan_filter_set,
.vlan_tpid_set= i40e_vlan_tpid_set,
.vlan_offload_set = i40e_vlan_offload_set,
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c 
b/drivers/net/i40e/i40e_ethdev_vf.c
index 13c5b3d..afd436e 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -196,6 +196,7 @@ static const struct eth_dev_ops i40evf_eth_dev_ops = {
.xstats_reset = i40evf_dev_xstats_reset,
.dev_close= i40evf_dev_close,
.dev_infos_get= i40evf_dev_info_get,
+   .dev_ptype_info_get   = i40e_dev_ptype_info_get,
.vlan_filter_set  = i40evf_vlan_filter_set,
.vlan_offload_set = i40evf_vlan_offload_set,
.vlan_pvid_set= i40evf_vlan_pvid_set,
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 8931b8e..c5bd83a 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -188,7 +188,10 @@ i40e_get_iee15888_flags(struct rte_mbuf *mb, uint64_t 
qword)
 }
 #endif

-/* For each value it means, datasheet of hardware can tell more details */
+/* For each value it means, datasheet of hardware can tell more details
+ *
+ * @note: fix i40e_dev_ptype_info_get() if any change here.
+ */
 static inline uint32_t
 i40e_rxd_pkt_type_mapping(uint8_t ptype)
 {
@@ -2087,6 +2090,47 @@ i40e_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t 
tx_queue_id)
return 0;
 }

+const uint32_t *
+i40e_dev_ptype_info_get(struct rte_eth_dev *dev)
+{
+   static const uint32_t ptypes[] = {
+   /* refers to i40e_rxd_pkt_type_mapping() */
+   RTE_PTYPE_L2_ETHER,
+   RTE_PTYPE_L2_ETHER_TIMESYNC,
+   RTE_PTYPE_L2_ETHER_LLDP,
+   RTE_PTYPE_L2_ETHER_ARP,
+   RTE_PTYPE_L3_IPV4_EXT_UNKNOWN,
+   RTE_PTYPE_L3_IPV6_EXT_UNKNOWN,
+   RTE_PTYPE_L4_FRAG,
+   RTE_PTYPE_L4_ICMP,
+   RTE_PTYPE_L4_NONFRAG,
+   RTE_PTYPE_L4_SCTP,
+   RTE_PTYPE_L4_TCP,
+   RTE_PTYPE_L4_UDP,
+   RTE_PTYPE_TUNNEL_GRENAT,
+   RTE_PTYPE_TUNNEL_IP,
+   RTE_PTYPE_INNER_L2_ETHER,
+   RTE_PTYPE_INNER_L2_ETHER_VLAN,
+   RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN,
+   RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN,
+   RTE_PTYPE_INNER_L4_FRAG,
+   RTE_PTYPE_INNER_L4_ICMP,
+   RTE_PTYPE_INNER_L4_NONFRAG,
+   RTE_PTYPE_INNER_L4_SCTP,
+   RTE_PTYPE_INNER_L4_TCP,
+   RTE_PTYPE_INNER_L4_UDP,
+   RTE_PTYPE_UNKNOWN
+   };
+
+   if (dev->rx_pkt_burst == i40e_recv_pkts ||
+#ifdef RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC
+   dev->rx_pkt_burst == i40e_recv_pkts_bulk_alloc ||
+#endif
+   dev->rx_pkt_burst == i40e_recv_scattered_pkts)
+   return ptypes;
+   return NULL;
+}
+
 int
 i40e_dev_rx_queue_setup(struct rte_eth_dev *dev,
uint16_t queue_idx,
diff --git a/drivers/net/i40e/i40e_rxtx.h b/drivers/net/i40e/i40e_rxtx.h
index 5c2f5c2..3a59d81 100644
--- a/drivers/net/i40e/i40e_rxtx.h
+++ b/drivers/net/i40e/i40e_rxtx.h
@@ -200,6 +200,7 @@ int i40e_dev_rx_queue_start(struct rte_eth_dev *dev, 
uint16_t rx_queue_id);
 int i40e_dev_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 int i40e_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id);
 int i40e_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id);
+const uint32_t *i40e_dev_ptype_info_get(struct rte_eth_dev *dev);
 int i40e_dev_rx_queue_setup(struct rte_eth_dev *dev,
uint16_t queue_idx,
uint16_t nb_desc,
-- 
2.1.4



[dpdk-dev] [PATCH v7 05/11] pmd/fm10k: add dev_ptype_info_get implementation

2016-03-10 Thread Jianfeng Tan
Signed-off-by: Jianfeng Tan 
Acked-by: Konstantin Ananyev 
Acked-by: Adrien Mazarguil 
---
 drivers/net/fm10k/fm10k_ethdev.c   | 50 ++
 drivers/net/fm10k/fm10k_rxtx.c |  3 +++
 drivers/net/fm10k/fm10k_rxtx_vec.c |  3 +++
 3 files changed, 56 insertions(+)

diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 421266b..429cbdd 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -1335,6 +1335,55 @@ fm10k_dev_infos_get(struct rte_eth_dev *dev,
};
 }

+#ifdef RTE_LIBRTE_FM10K_RX_OLFLAGS_ENABLE
+static const uint32_t *
+fm10k_dev_ptype_info_get(struct rte_eth_dev *dev)
+{
+   if (dev->rx_pkt_burst == fm10k_recv_pkts ||
+   dev->rx_pkt_burst == fm10k_recv_scattered_pkts) {
+   static uint32_t ptypes[] = {
+   /* refers to rx_desc_to_ol_flags() */
+   RTE_PTYPE_L2_ETHER,
+   RTE_PTYPE_L3_IPV4,
+   RTE_PTYPE_L3_IPV4_EXT,
+   RTE_PTYPE_L3_IPV6,
+   RTE_PTYPE_L3_IPV6_EXT,
+   RTE_PTYPE_L4_TCP,
+   RTE_PTYPE_L4_UDP,
+   RTE_PTYPE_UNKNOWN
+   };
+
+   return ptypes;
+   } else if (dev->rx_pkt_burst == fm10k_recv_pkts_vec ||
+  dev->rx_pkt_burst == fm10k_recv_scattered_pkts_vec) {
+   static uint32_t ptypes_vec[] = {
+   /* refers to fm10k_desc_to_pktype_v() */
+   RTE_PTYPE_L3_IPV4,
+   RTE_PTYPE_L3_IPV4_EXT,
+   RTE_PTYPE_L3_IPV6,
+   RTE_PTYPE_L3_IPV6_EXT,
+   RTE_PTYPE_L4_TCP,
+   RTE_PTYPE_L4_UDP,
+   RTE_PTYPE_TUNNEL_GENEVE,
+   RTE_PTYPE_TUNNEL_NVGRE,
+   RTE_PTYPE_TUNNEL_VXLAN,
+   RTE_PTYPE_TUNNEL_GRE,
+   RTE_PTYPE_UNKNOWN
+   };
+
+   return ptypes_vec;
+   }
+
+   return NULL;
+}
+#else
+static const uint32_t *
+fm10k_dev_ptype_info_get(struct rte_eth_dev *dev __rte_unused)
+{
+   return NULL;
+}
+#endif
+
 static int
 fm10k_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
 {
@@ -2423,6 +2472,7 @@ static const struct eth_dev_ops fm10k_eth_dev_ops = {
.xstats_reset   = fm10k_stats_reset,
.link_update= fm10k_link_update,
.dev_infos_get  = fm10k_dev_infos_get,
+   .dev_ptype_info_get = fm10k_dev_ptype_info_get,
.vlan_filter_set= fm10k_vlan_filter_set,
.vlan_offload_set   = fm10k_vlan_offload_set,
.mac_addr_add   = fm10k_macaddr_add,
diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c
index e958865..cbe0111 100644
--- a/drivers/net/fm10k/fm10k_rxtx.c
+++ b/drivers/net/fm10k/fm10k_rxtx.c
@@ -65,6 +65,9 @@ static inline void dump_rxd(union fm10k_rx_desc *rxd)
 }
 #endif

+/* @note: When this function is changed, make corresponding change to
+ * fm10k_dev_ptype_info_get()
+ */
 static inline void
 rx_desc_to_ol_flags(struct rte_mbuf *m, const union fm10k_rx_desc *d)
 {
diff --git a/drivers/net/fm10k/fm10k_rxtx_vec.c 
b/drivers/net/fm10k/fm10k_rxtx_vec.c
index 2a57eef..f347641 100644
--- a/drivers/net/fm10k/fm10k_rxtx_vec.c
+++ b/drivers/net/fm10k/fm10k_rxtx_vec.c
@@ -109,6 +109,9 @@ fm10k_desc_to_olflags_v(__m128i descs[4], struct rte_mbuf 
**rx_pkts)
rx_pkts[3]->ol_flags = vol.e[3];
 }

+/* @note: When this function is changed, make corresponding change to
+ * fm10k_dev_ptype_info_get().
+ */
 static inline void
 fm10k_desc_to_pktype_v(__m128i descs[4], struct rte_mbuf **rx_pkts)
 {
-- 
2.1.4



[dpdk-dev] [PATCH v7 04/11] pmd/enic: add dev_ptype_info_get implementation

2016-03-10 Thread Jianfeng Tan
Signed-off-by: Jianfeng Tan 
Acked-by: Konstantin Ananyev 
Acked-by: Adrien Mazarguil 
---
 drivers/net/enic/enic_ethdev.c | 17 +
 1 file changed, 17 insertions(+)

diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index 2a88043..fbeab6f 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -54,6 +54,9 @@
 #define ENICPMD_FUNC_TRACE() (void)0
 #endif

+static uint16_t enicpmd_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
+ uint16_t nb_pkts);
+
 /*
  * The set of PCI devices this driver supports
  */
@@ -431,6 +434,19 @@ static void enicpmd_dev_info_get(struct rte_eth_dev 
*eth_dev,
DEV_TX_OFFLOAD_TCP_CKSUM;
 }

+static const uint32_t *enicpmd_dev_ptype_info_get(struct rte_eth_dev *dev)
+{
+   static const uint32_t ptypes[] = {
+   RTE_PTYPE_L3_IPV4,
+   RTE_PTYPE_L3_IPV6,
+   RTE_PTYPE_UNKNOWN
+   };
+
+   if (dev->rx_pkt_burst == enicpmd_recv_pkts)
+   return ptypes;
+   return NULL;
+}
+
 static void enicpmd_dev_promiscuous_enable(struct rte_eth_dev *eth_dev)
 {
struct enic *enic = pmd_priv(eth_dev);
@@ -566,6 +582,7 @@ static const struct eth_dev_ops enicpmd_eth_dev_ops = {
.stats_reset  = enicpmd_dev_stats_reset,
.queue_stats_mapping_set = NULL,
.dev_infos_get= enicpmd_dev_info_get,
+   .dev_ptype_info_get   = enicpmd_dev_ptype_info_get,
.mtu_set  = NULL,
.vlan_filter_set  = enicpmd_vlan_filter_set,
.vlan_tpid_set= NULL,
-- 
2.1.4



[dpdk-dev] [PATCH v7 03/11] pmd/e1000: add dev_ptype_info_get implementation

2016-03-10 Thread Jianfeng Tan
Signed-off-by: Jianfeng Tan 
Acked-by: Konstantin Ananyev 
Acked-by: Adrien Mazarguil 
---
 drivers/net/e1000/igb_ethdev.c | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 4ed5e95..b3a3ee6 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -103,6 +103,7 @@ static void eth_igb_stats_reset(struct rte_eth_dev *dev);
 static void eth_igb_xstats_reset(struct rte_eth_dev *dev);
 static void eth_igb_infos_get(struct rte_eth_dev *dev,
  struct rte_eth_dev_info *dev_info);
+static const uint32_t *eth_igb_ptype_info_get(struct rte_eth_dev *dev);
 static void eth_igbvf_infos_get(struct rte_eth_dev *dev,
struct rte_eth_dev_info *dev_info);
 static int  eth_igb_flow_ctrl_get(struct rte_eth_dev *dev,
@@ -319,6 +320,7 @@ static const struct eth_dev_ops eth_igb_ops = {
.stats_reset  = eth_igb_stats_reset,
.xstats_reset = eth_igb_xstats_reset,
.dev_infos_get= eth_igb_infos_get,
+   .dev_ptype_info_get   = eth_igb_ptype_info_get,
.mtu_set  = eth_igb_mtu_set,
.vlan_filter_set  = eth_igb_vlan_filter_set,
.vlan_tpid_set= eth_igb_vlan_tpid_set,
@@ -376,6 +378,7 @@ static const struct eth_dev_ops igbvf_eth_dev_ops = {
.xstats_reset = eth_igbvf_stats_reset,
.vlan_filter_set  = igbvf_vlan_filter_set,
.dev_infos_get= eth_igbvf_infos_get,
+   .dev_ptype_info_get   = eth_igb_ptype_info_get,
.rx_queue_setup   = eth_igb_rx_queue_setup,
.rx_queue_release = eth_igb_rx_queue_release,
.tx_queue_setup   = eth_igb_tx_queue_setup,
@@ -1910,6 +1913,33 @@ eth_igb_infos_get(struct rte_eth_dev *dev, struct 
rte_eth_dev_info *dev_info)
dev_info->tx_desc_lim = tx_desc_lim;
 }

+static const uint32_t *
+eth_igb_ptype_info_get(struct rte_eth_dev *dev)
+{
+   static const uint32_t ptypes[] = {
+   /* refers to igb_rxd_pkt_info_to_pkt_type() */
+   RTE_PTYPE_L2_ETHER,
+   RTE_PTYPE_L3_IPV4,
+   RTE_PTYPE_L3_IPV4_EXT,
+   RTE_PTYPE_L3_IPV6,
+   RTE_PTYPE_L3_IPV6_EXT,
+   RTE_PTYPE_L4_TCP,
+   RTE_PTYPE_L4_UDP,
+   RTE_PTYPE_L4_SCTP,
+   RTE_PTYPE_TUNNEL_IP,
+   RTE_PTYPE_INNER_L3_IPV6,
+   RTE_PTYPE_INNER_L3_IPV6_EXT,
+   RTE_PTYPE_INNER_L4_TCP,
+   RTE_PTYPE_INNER_L4_UDP,
+   RTE_PTYPE_UNKNOWN
+   };
+
+   if (dev->rx_pkt_burst == eth_igb_recv_pkts ||
+   dev->rx_pkt_burst == eth_igb_recv_scattered_pkts)
+   return ptypes;
+   return NULL;
+}
+
 static void
 eth_igbvf_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 {
-- 
2.1.4



[dpdk-dev] [PATCH v7 02/11] pmd/cxgbe: add dev_ptype_info_get implementation

2016-03-10 Thread Jianfeng Tan
Signed-off-by: Jianfeng Tan 
Acked-by: Konstantin Ananyev 
Acked-by: Adrien Mazarguil 
---
 drivers/net/cxgbe/cxgbe_ethdev.c | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 97ef152..33bd815 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -767,6 +767,19 @@ static int cxgbe_flow_ctrl_set(struct rte_eth_dev *eth_dev,
 >link_cfg);
 }

+static const uint32_t *cxgbe_dev_ptype_info_get(struct rte_eth_dev *eth_dev)
+{
+   static const uint32_t ptypes[] = {
+   RTE_PTYPE_L3_IPV4,
+   RTE_PTYPE_L3_IPV6,
+   RTE_PTYPE_UNKNOWN
+   };
+
+   if (eth_dev->rx_pkt_burst == cxgbe_recv_pkts)
+   return ptypes;
+   return NULL;
+}
+
 static struct eth_dev_ops cxgbe_eth_dev_ops = {
.dev_start  = cxgbe_dev_start,
.dev_stop   = cxgbe_dev_stop,
@@ -777,6 +790,7 @@ static struct eth_dev_ops cxgbe_eth_dev_ops = {
.allmulticast_disable   = cxgbe_dev_allmulticast_disable,
.dev_configure  = cxgbe_dev_configure,
.dev_infos_get  = cxgbe_dev_info_get,
+   .dev_ptype_info_get = cxgbe_dev_ptype_info_get,
.link_update= cxgbe_dev_link_update,
.mtu_set= cxgbe_dev_mtu_set,
.tx_queue_setup = cxgbe_dev_tx_queue_setup,
-- 
2.1.4



[dpdk-dev] [PATCH v7 01/11] ethdev: add API to query packet type filling info

2016-03-10 Thread Jianfeng Tan
Add a new API rte_eth_dev_get_ptype_info to query whether/what packet
type can be filled by given already started device or its pmd rx burst
function has already been decided).

Signed-off-by: Jianfeng Tan 
Acked-by: Konstantin Ananyev 
Acked-by: Adrien Mazarguil 
---
 doc/guides/rel_notes/release_16_04.rst |  3 +++
 lib/librte_ether/rte_ethdev.c  | 26 ++
 lib/librte_ether/rte_ethdev.h  | 27 +++
 lib/librte_ether/rte_ether_version.map |  8 
 4 files changed, 64 insertions(+)

diff --git a/doc/guides/rel_notes/release_16_04.rst 
b/doc/guides/rel_notes/release_16_04.rst
index aa9eabc..376ece5 100644
--- a/doc/guides/rel_notes/release_16_04.rst
+++ b/doc/guides/rel_notes/release_16_04.rst
@@ -162,6 +162,9 @@ This section should contain API changes. Sample format:
   handlers are updated: the pipeline parameter is added,
   the packets mask parameter has been either removed or made input-only.

+* A new API ``rte_eth_dev_get_ptype_info`` is added to query what packet types
+  can be filled by given already started device.
+

 ABI Changes
 ---
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 5c2b416..d828dcf 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -1576,6 +1576,32 @@ rte_eth_dev_info_get(uint8_t port_id, struct 
rte_eth_dev_info *dev_info)
dev_info->driver_name = dev->data->drv_name;
 }

+int
+rte_eth_dev_get_ptype_info(uint8_t port_id, uint32_t ptype_mask,
+  uint32_t *ptypes, int num)
+{
+   int i, j;
+   struct rte_eth_dev *dev;
+   const uint32_t *all_ptypes;
+
+   RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+   dev = _eth_devices[port_id];
+   RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_ptype_info_get, -ENOTSUP);
+   all_ptypes = (*dev->dev_ops->dev_ptype_info_get)(dev);
+
+   if (!all_ptypes)
+   return 0;
+
+   for (i = 0, j = 0; all_ptypes[i] != RTE_PTYPE_UNKNOWN; ++i)
+   if (all_ptypes[i] & ptype_mask) {
+   if (j < num)
+   ptypes[j] = all_ptypes[i];
+   j++;
+   }
+
+   return j;
+}
+
 void
 rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr)
 {
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index d53e362..e0d2232 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1021,6 +1021,9 @@ typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev 
*dev,
struct rte_eth_dev_info *dev_info);
 /**< @internal Get specific informations of an Ethernet device. */

+typedef const uint32_t *(*eth_dev_ptype_info_get_t)(struct rte_eth_dev *dev);
+/**< @internal Get ptype info of an Ethernet device. */
+
 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
uint16_t queue_id);
 /**< @internal Start rx and tx of a queue of an Ethernet device. */
@@ -1347,6 +1350,7 @@ struct eth_dev_ops {
eth_queue_stats_mapping_set_t queue_stats_mapping_set;
/**< Configure per queue stat counter mapping. */
eth_dev_infos_get_tdev_infos_get; /**< Get device info. */
+   eth_dev_ptype_info_get_t   dev_ptype_info_get; /** Get ptype info */
mtu_set_t  mtu_set; /**< Set MTU. */
vlan_filter_set_t  vlan_filter_set;  /**< Filter VLAN Setup. */
vlan_tpid_set_tvlan_tpid_set;  /**< Outer VLAN TPID 
Setup. */
@@ -2268,6 +2272,29 @@ void rte_eth_macaddr_get(uint8_t port_id, struct 
ether_addr *mac_addr);
 void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info);

 /**
+ * Retrieve the packet type information of an Ethernet device.
+ *
+ * @note
+ *   Better to invoke this API after the device is already started or rx burst
+ *   function is decided, to obtain concise ptype information.
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param ptype_mask
+ *   A hint of what kind of packet type which the caller is interested in.
+ * @param ptypes
+ *   An array pointer to store adequent packet types, allocated by caller.
+ * @param num
+ *  Size of the array pointed by param ptypes.
+ * @return
+ *   - (>0) Number of ptypes supported. If it exceeds param num, exceeding
+ *  packet types will not be filled in the given array.
+ *   - (0 or -ENOTSUP) if PMD does not fill the specified ptype.
+ *   - (-ENODEV) if *port_id* invalid.
+ */
+int rte_eth_dev_get_ptype_info(uint8_t port_id, uint32_t ptype_mask,
+  uint32_t *ptypes, int num);
+
+/**
  * Retrieve the MTU of an Ethernet device.
  *
  * @param port_id
diff --git a/lib/librte_ether/rte_ether_version.map 
b/lib/librte_ether/rte_ether_version.map
index d8db24d..a12784c 100644
--- a/lib/librte_ether/rte_ether_version.map
+++ 

[dpdk-dev] [PATCH v7 00/11] Add API to get packet type info

2016-03-10 Thread Jianfeng Tan
To achieve this, a new function pointer, dev_ptype_info_get, is added
into struct eth_dev_ops. For those devices who do not implement it, it
means it does not provide any ptype info.

v7:
  - 2.2 -> 16.04
  - Add note: this API better invoked after device is already started.
  - Update release_16_04.rst for newly added API.

v6:
  - Remove extern in function declaration.
  - Update rte_ether_version.map.

v5:
  - Exclude l3fwd change from this series, as a separated one.
  - Fix malposition of mlx4 code in mlx5 commit introduced in v4.

v4:
  - Change how to use this API: to previously agreement reached in mail.

v3:
  - Change how to use this API: api to allocate mem for storing ptype
array; and caller to free the mem.
  - Change how to return back ptypes from PMDs: return a pointer to
corresponding static const array of supported ptypes, terminated
by RTE_PTYPE_UNKNOWN.
  - Fix l3fwd parse_packet_type() when EXACT_MATCH is enabled.
  - Fix l3fwd memory leak when calling the API.

v2:
  - Move ptype_mask filter function from each PMDs into ether layer.
  - Add ixgbe vPMD's ptype info.
  - Fix code style issues.

Signed-off-by: Jianfeng Tan 
Acked-by: Konstantin Ananyev 
Acked-by: Adrien Mazarguil 

Jianfeng Tan (11):
  ethdev: add API to query packet type filling info
  pmd/cxgbe: add dev_ptype_info_get implementation
  pmd/e1000: add dev_ptype_info_get implementation
  pmd/enic: add dev_ptype_info_get implementation
  pmd/fm10k: add dev_ptype_info_get implementation
  pmd/i40e: add dev_ptype_info_get implementation
  pmd/ixgbe: add dev_ptype_info_get implementation
  pmd/mlx4: add dev_ptype_info_get implementation
  pmd/mlx5: add dev_ptype_info_get implementation
  pmd/nfp: add dev_ptype_info_get implementation
  pmd/vmxnet3: add dev_ptype_info_get implementation

 doc/guides/rel_notes/release_16_04.rst |  3 ++
 drivers/net/cxgbe/cxgbe_ethdev.c   | 14 ++
 drivers/net/e1000/igb_ethdev.c | 30 
 drivers/net/enic/enic_ethdev.c | 17 
 drivers/net/fm10k/fm10k_ethdev.c   | 50 ++
 drivers/net/fm10k/fm10k_rxtx.c |  3 ++
 drivers/net/fm10k/fm10k_rxtx_vec.c |  3 ++
 drivers/net/i40e/i40e_ethdev.c |  1 +
 drivers/net/i40e/i40e_ethdev_vf.c  |  1 +
 drivers/net/i40e/i40e_rxtx.c   | 46 ++-
 drivers/net/i40e/i40e_rxtx.h   |  1 +
 drivers/net/ixgbe/ixgbe_ethdev.c   | 38 ++
 drivers/net/ixgbe/ixgbe_ethdev.h   |  2 ++
 drivers/net/ixgbe/ixgbe_rxtx.c |  4 ++-
 drivers/net/mlx4/mlx4.c| 21 ++
 drivers/net/mlx5/mlx5.c|  1 +
 drivers/net/mlx5/mlx5.h|  1 +
 drivers/net/mlx5/mlx5_ethdev.c | 20 ++
 drivers/net/mlx5/mlx5_rxtx.c   |  2 ++
 drivers/net/nfp/nfp_net.c  | 19 +
 drivers/net/vmxnet3/vmxnet3_ethdev.c   | 16 +++
 lib/librte_ether/rte_ethdev.c  | 26 ++
 lib/librte_ether/rte_ethdev.h  | 27 ++
 lib/librte_ether/rte_ether_version.map |  8 ++
 24 files changed, 352 insertions(+), 2 deletions(-)

-- 
2.1.4



[dpdk-dev] [PATCH] eal: add option --avail-cores to detect lcores

2016-03-10 Thread Tan, Jianfeng
Hi Konstantin,

On 3/9/2016 11:17 PM, Ananyev, Konstantin wrote:
> Hi Jianfeng,
>
>> -Original Message-
>> From: Tan, Jianfeng
>> Sent: Wednesday, March 09, 2016 2:56 PM
>> To: Ananyev, Konstantin; Panu Matilainen; dev at dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH] eal: add option --avail-cores to detect 
>> lcores
>>
>> Hi Konstantin,
>>
>> On 3/9/2016 10:44 PM, Ananyev, Konstantin wrote:
 -Original Message-
 From: Tan, Jianfeng
 Sent: Wednesday, March 09, 2016 2:17 PM
 To: Ananyev, Konstantin; Panu Matilainen; dev at dpdk.org
 Subject: Re: [dpdk-dev] [PATCH] eal: add option --avail-cores to detect 
 lcores



 On 3/9/2016 10:01 PM, Ananyev, Konstantin wrote:
>> -Original Message-
>> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Tan, Jianfeng
>> Sent: Wednesday, March 09, 2016 1:53 PM
>> To: Panu Matilainen; dev at dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH] eal: add option --avail-cores to detect 
>> lcores
>>
>>
>>
>> On 3/9/2016 9:05 PM, Panu Matilainen wrote:
>>> On 03/08/2016 07:38 PM, Tan, Jianfeng wrote:
 Hi Panu,

 On 3/8/2016 4:54 PM, Panu Matilainen wrote:
> On 03/04/2016 12:05 PM, Jianfeng Tan wrote:
>> This patch adds option, --avail-cores, to use lcores which are
>> available
>> by calling pthread_getaffinity_np() to narrow down detected cores
>> before
>> parsing coremask (-c), corelist (-l), and coremap (--lcores).
>>
>> Test example:
>> $ taskset 0xc ./examples/helloworld/build/helloworld \
>>--avail-cores -m 1024
>>
>> Signed-off-by: Jianfeng Tan 
>> Acked-by: Neil Horman 
> Hmm, to me this sounds like something that should be done always so
> there's no need for an option. Or if there's a chance it might do the
> wrong thing in some rare circumstance then perhaps there should be a
> disabler option instead?
 Thanks for comments.

 Yes, there's a use case that we cannot handle.

 If we make it as default, DPDK applications may fail to start, when 
 user
 specifies a core in isolcpus and its parent process (say bash) has a
 cpuset affinity that excludes isolcpus. Originally, DPDK applications
 just blindly do pthread_setaffinity_np() and it always succeeds because
 it always has root privilege to change any cpu affinity.

 Now, if we do the checking in rte_eal_cpu_init(), those lcores will be
 flagged as undetected (in my older implementation) and leads to 
 failure.
 To make it correct, we would always add "taskset mask" (or other ways)
 before DPDK application cmd lines.

 How do you think?
>>> I still think it sounds like something that should be done by default
>>> and maybe be overridable with some flag, rather than the other way
>>> around. Another alternative might be detecting the cores always but if
>>> running as root, override but with a warning.
>> For your second solution, only root can setaffinity to isolcpus?
>> Your first solution seems like a promising way for me.
>>
>>> But I dont know, just wondering. To look at it from another angle: why
>>> would somebody use this new --avail-cores option and in what
>>> situation, if things "just work" otherwise anyway?
>> For DPDK applications, the most common case to initialize DPDK is like
>> this: "$dpdk-app [options for DPDK] -- [options for app]", so users need
>> to specify which cores to run and how much hugepages are used. Suppose
>> we need this dpdk-app to run in a container, users already give those
>> information when they build up the cgroup for it to run inside, this
>> option or this patch is to make DPDK more smart to discover how much
>> resource will be used. Make sense?
> But then, all we need might be just a script that would extract this 
> information from the system
> and form a proper cmdline parameter for DPDK?
 Yes, a script will work. Or to construct (argc, argv) to call
 rte_eal_init() in the application. But as Neil Horman once suggested, a
 simple pthread_getaffinity_np() will get all things done. So if it worth
 a patch here?
>>> Don't know...
>>> Personally I would prefer not to put extra logic inside EAL.
>>> For me - there are too many different options already.
>> Then how about make it default in rte_eal_cpu_init()? And it is already
>> known it will bring trouble to those use isolcpus users, they need to
>> add "taskset [mask]" before starting a DPDK app.
> As I said - provide a script?

Yes. But what I want to say is this script is hard to be right, if there 
are different kinds of limitations. (Barely happen though :-) )

> Same might be for amount of hugepage memory 

[dpdk-dev] [PATCH v5 2/2] librte_pipeline: add new API functions for pipeline action handlers

2016-03-10 Thread Thomas Monjalon
2016-03-08 18:07, Jasvinder Singh:
> Two new pipeline API functions have been added to the library. The packet
> hijack API function can be called by any input/output port or table action
> handler to remove selected packets from the burst of packets read from one
> of the pipeline input ports and then either send these packets out through
> any pipeline output port or drop them.
> 
> Another packet drop API function can be used by the pipeline action
> handlers (port in/out, table) to drop the packets selected using packet
> mask. This function updates the drop statistics counters correctly.
> 
> Signed-off-by: Jasvinder Singh 
> Acked-by: Cristian Dumitrescu 

Series applied, thanks


[dpdk-dev] [PATCH 1/3] kcp: add kernel control path kernel module

2016-03-10 Thread Thomas Monjalon
2016-03-02 23:35, Thomas Monjalon:
> 2016-03-02 12:21, Thomas Monjalon:
> > 2016-03-02 11:47, Vincent JARDIN:
> > > Le 02/03/2016 09:27, Panu Matilainen a ?crit :
> > > >>> I'd like to see these be merged.
> > > >>>
> > > >>> Jay
> > > >>
> > > >> The code is really not ready. I am okay with cooperative development
> > > >> but the current code needs to go into a staging type tree.
> > > >> No compatibility, no ABI guarantees, more of an RFC.
> > > >> Don't want vendors building products with it then screaming when it
> > > >> gets rebuilt/reworked/scrapped.
> > > >>
> > > >
> > > > Exactly.
> > > 
> > > +1 too
> > > 
> > > We need to build on this innovation while there is a path for kernel 
> > > mainstream. The logic of using a staging is a good one.
> > > 
> > > Thomas,
> > > 
> > > can we open a staging folder into the DPDK like it is done into the 
> > > kernel?
> > 
> > It's possible to create a staging directory if everybody agree.
> > It is important to state in a README file or in the doc/ that
> > there will be no guarantee (no stable ABI, no validation and can be dropped)
> > and that it is a work in progress, a suggestion to discuss with the kernel
> > community.
> > 
> > The kernel modules must clearly target an upstream integration.
> 
> Actually the examples directory has been used as a staging for ethtool and
> lthread. We also have the crypto API which is still experimental.
> So I think we must decide among these 3 solutions:
>   - no special directory, just mark and document an experimental state
>   - put only kcp/kdp in the staging directory
>   - put kcp/kdp in staging and move other experimental libs here

Any opinion? Are we targetting upstream work without any DPDK staging?

Please let's make clear the status of these patches.


[dpdk-dev] [PATCH 0/3] ethdev: add helper functions to get eth_dev and dev private data

2016-03-10 Thread Thomas Monjalon
2016-02-17 14:20, Ferruh Yigit:
> This is to provide abstraction and reduce global variable access.
> 
> Global variable rte_eth_devices kept exported to not break ABI.
> 
> Bonding driver not selected on purpose, just it seems it is using 
> rte_eth_devices heavily.
> 
> There are a few more usage in drivers but they left as it is because they
> are in fast path code.

What is the benefit of these functions if you do not plan to remove the
global variables later?

Anyway this discussion targets the release 16.07.


[dpdk-dev] [PATCH v6 2/5] lib/librte_ether: support l2 tunnel operations

2016-03-10 Thread Lu, Wenzhuo
Hi Thomas,


> -Original Message-
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Wednesday, March 9, 2016 5:28 PM
> To: Lu, Wenzhuo
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v6 2/5] lib/librte_ether: support l2 tunnel
> operations
> 
> 2016-03-09 01:15, Lu, Wenzhuo:
> > From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> > > 2016-03-08 14:53, Wenzhuo Lu:
> > > > +/**
> > > > + * l2 tunnel type.
> > > > + */
> > > > +enum rte_eth_l2_tunnel_type {
> > > > +   RTE_L2_TUNNEL_TYPE_NONE = 0,
> > > > +   RTE_L2_TUNNEL_TYPE_E_TAG,
> > > > +   RTE_L2_TUNNEL_TYPE_MAX,
> > > > +};
> > >
> > > We already have rte_eth_tunnel_type.
> > Seems the tunnels in rte_eth_tunnel_type are all L3 packets. So, I want to 
> > add
> a new type for e-tag, s-tag... as they're l2 packets.
> > Do you suggest to merge it into rte_eth_tunnel_type?
> 
> Maybe you can keep the L2 prefix and add it in the same enum.
> It depends wether the rest of the API is specific to L2 or not.
OK, I'll keep the L2 prefix and merge it to the enum rte_eth_tunnel_type.

> 
> > > Why this struct is in rte_eth_ctrl.h and not used with 
> > > rte_eth_dev_filter_ctrl?
> > Just want to put it together with rte_eth_tunnel_type :)
> 
> > > Why are we still adding some filtering functions after having the
> > > assertion that the new filtering API in lib/librte_ether/rte_eth_ctrl.h 
> > > was
> generic enough?
> > > The filtering API v2 was a total failure.
> > > Are we going to add new functions each time a new bit of a header
> > > must be parsed by an offloaded filtering?
> > > Are we going to add new functions for each new filter of a NIC?
> >
> > Sorry, my bad. I'll try to use the existing filter API. Thanks.
> 
> OK, using the filtering API v2 is better.
> But I'm not confident it is a good API.
> If you have any concern, please discuss them. Because we need to discuss how
> to make a really generic API which fits with any filtering (flow steering) 
> offload
> of any vendor while being descriptive enough and easy to use.
It's OK for me to use rte_eth_dev_filter_ctrl :)


[dpdk-dev] [PATCH v7 0/5] support E-tag offloading and forwarding on X550

2016-03-10 Thread Lu, Wenzhuo
Hi Thomas,


> -Original Message-
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Wednesday, March 9, 2016 6:07 PM
> To: Lu, Wenzhuo
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v7 0/5] support E-tag offloading and forwarding
> on X550
> 
> 2016-03-09 15:44, Wenzhuo Lu:
> > v7:
> > - Squash the l2 tunnel filter ops to filter ctrl ops.
> 
> No you have not.
> Please check rte_eth_dev_filter_ctrl()
Do you mean these two should be replaced too? But they're not filter. So, have 
to say I'm confused.
rte_eth_dev_l2_tunnel_eth_type_conf;
rte_eth_dev_l2_tunnel_offload_set;

I've replaced rte_eth_dev_l2_tunnel_filter_add and 
rte_eth_dev_l2_tunnel_filter_del with rte_eth_dev_filter_ctrl.


[dpdk-dev] [PATCH v8 1/5] lib/librte_ether: change function name of tunnel port config

2016-03-10 Thread Lu, Wenzhuo
Hi Thomas,


> -Original Message-
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Wednesday, March 9, 2016 5:49 PM
> To: Lu, Wenzhuo
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v8 1/5] lib/librte_ether: change function name
> of tunnel port config
> 
> 2016-03-09 11:35, Wenzhuo Lu:
> > +   uint16_t udp_port; /**< UDP port used for the tunnel. */
> > +   uint8_t prot_type; /**< Tunnel type. */
> 
> Is 42 a valid tunnel type?
> Please reference where to find the constants.
> Think as a user who won't read your datasheet.
OK. Let me add more. Honestly, I want to change " uint8_t prot_type " to " enum 
rte_eth_tunnel_type  prot_type". But seems it's a ABI change, so I don't do 
that. 

> 
> [...]
> >   /**
> > - * Add UDP tunneling port of an Ethernet device for filtering a
> > specific
> > - * tunneling packet by UDP port number.
> > + * Add UDP tunneling port for a specific type of tunnel.
> > + * The packets with this UDP port will be parsed as this type of tunnel.
> 
> We progress.
> What will be parsed? What will be the action? checksum? decapsulation?
Let me explain more.

> 
> [...]
> >  int
> > +rte_eth_dev_udp_tunnel_port_add(uint8_t port_id,
> > +   struct rte_eth_udp_tunnel
> > +*tunnel_udp);
> > +/* Below is deprecated. Replaced by rte_eth_dev_udp_tunnel_port_add.
> > +*/ int
> >  rte_eth_dev_udp_tunnel_add(uint8_t port_id,
> >struct rte_eth_udp_tunnel *tunnel_udp);
> 
> Better. Please make a doxygen comment with @see.
> We still need a __rte_deprecated attribute on the function.
Let me try to find some reference.

> 
> > --- a/lib/librte_ether/rte_ether_version.map
> > +++ b/lib/librte_ether/rte_ether_version.map
> > @@ -117,3 +117,10 @@ DPDK_2.2 {
> >
> > local: *;
> >  };
> > +
> > +DPDK_2.3 {
> > +   global:
> > +
> > +   rte_eth_dev_udp_tunnel_port_add;
> > +   rte_eth_dev_udp_tunnel_port_delete;
> > +}DPDK_2.2;
> 
> Please rename 2.3 to 16.04.
Will correct it. Thanks.
> 



[dpdk-dev] [PATCH v5 0/6] fix the issue that DPDK takes over virtio device blindly

2016-03-10 Thread Thomas Monjalon
> Huawei Xie (6):
>   eal: make the comment more accurate
>   eal: set kdrv to RTE_KDRV_NONE if kernel driver isn't managing the device.
>   eal: use new RTE_ARCH_X86 macro for x86 arch

I've completed this patch to use RTE_ARCH_X86 in EAL.

>   eal: simple code rework
>   eal: map IO port only when kernel driver isn't managing the device
>   virtio: return 1 to tell the upper layer we don't take over this device

Applied, thanks


[dpdk-dev] [PATCH v5 3/6] eal: use new RTE_ARCH_X86 for x86 arch

2016-03-10 Thread Thomas Monjalon
>  lib/librte_eal/linuxapp/eal/eal_pci.c | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)

There are other occurences to fix in EAL.


<    1   2   3