[dpdk-dev] [PATCH 00/10] rte_ip_frag: various fixes for lib and examples

2014-06-26 Thread Thomas Monjalon
2014-06-18 15:50, Anatoly Burakov:
> This patchset fixes a few issues found during validation, and also
> does a bunch of renames (so that internally-used data structures aren't
> starting with rte_) and fixes a few typos.
> 
> Anatoly Burakov (10):
>   ip_frag: rename RTE_IP_FRAG_ASSERT to IP_FRAG_ASSERT
>   ip_frag: fix debug macros
>   ip_frag: renaming rte_ip_frag_pkt to ip_frag_pkt
>   ip_frag: fix stats macro, rename rte_ip_frag_tbl_stat structure
>   ip_frag: small fix, replace hardcode with a macro
>   ip_frag: replace memmove with custom copying
>   ip_frag: fix order of arguments to key compare function
>   ip_fragmentation: small fixes
>   ip_reassembly: small fixes
>   rte_ip_frag: API header file fix

Acked-by: Thomas Monjalon 

There were a lot of little things in these commits.
In order to tidy them without waiting another version for rc2,
I've splitted, merged and renamed some commits.

Applied for version 1.7.0.

Thanks
-- 
Thomas


[dpdk-dev] [PATCH] skeleton app: Very simple code for l2fwding

2014-06-26 Thread Vincent JARDIN
> +#ifdef RTE_EXEC_ENV_BAREMETAL
>>+#define MAIN _main
>>+#else
>>+#define MAIN main
>>+#endif
>>+
>>+int MAIN(int argc, char *argv[]);
>>+
>>+#endif /* ifndef_MAIN_H_  */

why keeping the baremetal? It was dropped for a while.

Best regards,
   Vincent


[dpdk-dev] [PATCH] skeleton app: Very simple code for l2fwding

2014-06-26 Thread Bruce Richardson
This is a very simple example app for doing packet forwarding with the
Intel DPDK. It's designed to serve as a start point for people new to
the Intel DPDK and who want to develop a new app.

Therefore it's meant to:
* have as good a performance out-of-the-box as possible, using the
  best-known settings for configuring the PMDs, so that any new apps can
  be based off it.
* be kept as short as possible to make it easy to understand it and get
  started with it.

Signed-off-by: Bruce Richardson 
---
 examples/Makefile|   1 +
 examples/skeleton_app/Makefile   |  57 ++
 examples/skeleton_app/basicfwd.c | 236 +++
 examples/skeleton_app/basicfwd.h |  46 
 4 files changed, 340 insertions(+)
 create mode 100644 examples/skeleton_app/Makefile
 create mode 100644 examples/skeleton_app/basicfwd.c
 create mode 100644 examples/skeleton_app/basicfwd.h

diff --git a/examples/Makefile b/examples/Makefile
index 4353b84..2605d1d 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -60,6 +60,7 @@ DIRS-y += netmap_compat/bridge
 DIRS-$(CONFIG_RTE_LIBRTE_METER) += qos_meter
 DIRS-$(CONFIG_RTE_LIBRTE_SCHED) += qos_sched
 DIRS-y += quota_watermark
+DIRS-y += skeleton_app
 DIRS-y += timer
 DIRS-y += vhost
 DIRS-$(CONFIG_RTE_LIBRTE_XEN_DOM0) += vhost_xen
diff --git a/examples/skeleton_app/Makefile b/examples/skeleton_app/Makefile
new file mode 100644
index 000..244f4ef
--- /dev/null
+++ b/examples/skeleton_app/Makefile
@@ -0,0 +1,57 @@
+#   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.
+
+ifeq ($(RTE_SDK),)
+$(error "Please define RTE_SDK environment variable")
+endif
+
+# Default target, can be overriden by command line or environment
+RTE_TARGET ?= x86_64-default-linuxapp-gcc
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+# binary name
+APP = basicfwd
+
+# all source are stored in SRCS-y
+SRCS-y := basicfwd.c
+
+CFLAGS += $(WERROR_FLAGS)
+
+# 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_main.o += -Wno-return-type
+endif
+
+EXTRA_CFLAGS += -O3 -g -Wfatal-errors
+
+include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/skeleton_app/basicfwd.c b/examples/skeleton_app/basicfwd.c
new file mode 100644
index 000..bf51a9d
--- /dev/null
+++ b/examples/skeleton_app/basicfwd.c
@@ -0,0 +1,236 @@
+/*-
+ *   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 

[dpdk-dev] [PATCH] skeleton app: Very simple code for l2fwding

2014-06-26 Thread Richardson, Bruce
> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Vincent JARDIN
> Sent: Thursday, June 26, 2014 1:57 PM
> To: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] skeleton app: Very simple code for l2fwding
> 
> > +#ifdef RTE_EXEC_ENV_BAREMETAL
> >>+#define MAIN _main
> >>+#else
> >>+#define MAIN main
> >>+#endif
> >>+
> >>+int MAIN(int argc, char *argv[]);
> >>+
> >>+#endif /* ifndef_MAIN_H_  */
> 
> why keeping the baremetal? It was dropped for a while.
> 
Inertia :-)
Almost every other app does it this way so I kept the same styling. A separate 
cleanup commit would be to get rid of all this stuff.


[dpdk-dev] [PATCH] skeleton app: Very simple code for l2fwding

2014-06-26 Thread Neil Horman
On Thu, Jun 26, 2014 at 09:22:40PM +0100, Bruce Richardson wrote:
> This is a very simple example app for doing packet forwarding with the
> Intel DPDK. It's designed to serve as a start point for people new to
> the Intel DPDK and who want to develop a new app.
> 
> Therefore it's meant to:
> * have as good a performance out-of-the-box as possible, using the
>   best-known settings for configuring the PMDs, so that any new apps can
>   be based off it.
> * be kept as short as possible to make it easy to understand it and get
>   started with it.
> 
> Signed-off-by: Bruce Richardson 
Isn't there already an l2fwd example app?
Neil

> ---
>  examples/Makefile|   1 +
>  examples/skeleton_app/Makefile   |  57 ++
>  examples/skeleton_app/basicfwd.c | 236 
> +++
>  examples/skeleton_app/basicfwd.h |  46 
>  4 files changed, 340 insertions(+)
>  create mode 100644 examples/skeleton_app/Makefile
>  create mode 100644 examples/skeleton_app/basicfwd.c
>  create mode 100644 examples/skeleton_app/basicfwd.h
> 
> diff --git a/examples/Makefile b/examples/Makefile
> index 4353b84..2605d1d 100644
> --- a/examples/Makefile
> +++ b/examples/Makefile
> @@ -60,6 +60,7 @@ DIRS-y += netmap_compat/bridge
>  DIRS-$(CONFIG_RTE_LIBRTE_METER) += qos_meter
>  DIRS-$(CONFIG_RTE_LIBRTE_SCHED) += qos_sched
>  DIRS-y += quota_watermark
> +DIRS-y += skeleton_app
>  DIRS-y += timer
>  DIRS-y += vhost
>  DIRS-$(CONFIG_RTE_LIBRTE_XEN_DOM0) += vhost_xen
> diff --git a/examples/skeleton_app/Makefile b/examples/skeleton_app/Makefile
> new file mode 100644
> index 000..244f4ef
> --- /dev/null
> +++ b/examples/skeleton_app/Makefile
> @@ -0,0 +1,57 @@
> +#   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.
> +
> +ifeq ($(RTE_SDK),)
> +$(error "Please define RTE_SDK environment variable")
> +endif
> +
> +# Default target, can be overriden by command line or environment
> +RTE_TARGET ?= x86_64-default-linuxapp-gcc
> +
> +include $(RTE_SDK)/mk/rte.vars.mk
> +
> +# binary name
> +APP = basicfwd
> +
> +# all source are stored in SRCS-y
> +SRCS-y := basicfwd.c
> +
> +CFLAGS += $(WERROR_FLAGS)
> +
> +# 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_main.o += -Wno-return-type
> +endif
> +
> +EXTRA_CFLAGS += -O3 -g -Wfatal-errors
> +
> +include $(RTE_SDK)/mk/rte.extapp.mk
> diff --git a/examples/skeleton_app/basicfwd.c 
> b/examples/skeleton_app/basicfwd.c
> new file mode 100644
> index 000..bf51a9d
> --- /dev/null
> +++ b/examples/skeleton_app/basicfwd.c
> @@ -0,0 +1,236 @@
> +/*-
> + *   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

[dpdk-dev] [PATCH v8 0/6] Link Bonding Library

2014-06-26 Thread De Lara Guarch, Pablo

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Declan Doherty
> Sent: Wednesday, June 25, 2014 9:08 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH v8 0/6] Link Bonding Library
> 
> This patch contains the initial release of the Link Bonding PMD Library
> 
> Supporting bonding modes:
>  0 - Round Robin
>  1 - Active Backup
>  2 - Balance (Supporting 3 transmission polices)
>   layer 2, layer 2+3, layer 3+4
>  3 - Broadcast
> 
> Version 8 of patch set:
> This version splits the bonding library into 3 C files, containing the
> PMD specific code, the argument parsing code, and the public API code
> 
> 
> Patch Set Description:
>  0001 - librte_pmd_bond + makefile changes
>  0002 - librte_ether changes to support unique naming of pmds
>  0003 - librte_eal changes to support bonding device intialization
>  0005 - link bonding unti test suite
>  0005 - testpmd link bonding support changes
>  0006 - doxygen additions
> 
> Declan Doherty (6):
>   Link Bonding Library (lib/librte_pmd_bond)
>   Support for unique interface naming of pmds
>   EAL support for link bonding device initialization
>   Link bonding Unit Tests
>   testpmd link bonding additions
>   Link Bonding Library doxygen additions
> 
>  app/test-pmd/cmdline.c  |  579 
>  app/test-pmd/config.c   |4 +-
>  app/test-pmd/parameters.c   |3 +
>  app/test-pmd/testpmd.c  |   40 +-
>  app/test-pmd/testpmd.h  |2 +
>  app/test/Makefile   |4 +-
>  app/test/commands.c |7 +
>  app/test/packet_burst_generator.c   |  287 ++
>  app/test/packet_burst_generator.h   |   78 +
>  app/test/test.h |1 +
>  app/test/test_link_bonding.c| 3958
> +++
>  app/test/virtual_pmd.c  |  574 
>  app/test/virtual_pmd.h  |   74 +
>  config/common_bsdapp|5 +
>  config/common_linuxapp  |5 +
>  doc/doxy-api-index.md   |1 +
>  doc/doxy-api.conf   |1 +
>  lib/Makefile|1 +
>  lib/librte_eal/bsdapp/eal/eal.c |   10 +-
>  lib/librte_eal/common/eal_common_dev.c  |   58 +-
>  lib/librte_eal/common/eal_common_pci.c  |3 +
>  lib/librte_eal/common/include/eal_private.h |7 -
>  lib/librte_eal/common/include/rte_dev.h |   13 +-
>  lib/librte_eal/linuxapp/eal/eal.c   |   11 +-
>  lib/librte_ether/rte_ethdev.c   |   32 +-
>  lib/librte_ether/rte_ethdev.h   |7 +-
>  lib/librte_pmd_bond/Makefile|   34 +
>  lib/librte_pmd_bond/rte_eth_bond.h  |  255 ++
>  lib/librte_pmd_bond/rte_eth_bond_api.c  |  670 +
>  lib/librte_pmd_bond/rte_eth_bond_pmd.c  | 1228 +
>  lib/librte_pmd_bond/rte_eth_bond_private.h  |  218 ++
>  lib/librte_pmd_bond/rte_eth_bond_vargs.c|  255 ++
>  lib/librte_pmd_pcap/rte_eth_pcap.c  |   22 +-
>  lib/librte_pmd_ring/rte_eth_ring.c  |   32 +-
>  lib/librte_pmd_ring/rte_eth_ring.h  |3 +-
>  lib/librte_pmd_xenvirt/rte_eth_xenvirt.c|2 +-
>  mk/rte.app.mk   |5 +
>  37 files changed, 8418 insertions(+), 71 deletions(-)
>  create mode 100644 app/test/packet_burst_generator.c
>  create mode 100644 app/test/packet_burst_generator.h
>  create mode 100644 app/test/test_link_bonding.c
>  create mode 100644 app/test/virtual_pmd.c
>  create mode 100644 app/test/virtual_pmd.h
>  create mode 100644 lib/librte_pmd_bond/Makefile
>  create mode 100644 lib/librte_pmd_bond/rte_eth_bond.h
>  create mode 100644 lib/librte_pmd_bond/rte_eth_bond_api.c
>  create mode 100644 lib/librte_pmd_bond/rte_eth_bond_pmd.c
>  create mode 100644 lib/librte_pmd_bond/rte_eth_bond_private.h
>  create mode 100644 lib/librte_pmd_bond/rte_eth_bond_vargs.c

Acked-by: Pablo de Lara 



[dpdk-dev] [PATCH 1/3] stringfns: remove rte_snprintf

2014-06-26 Thread Richardson, Bruce
> -Original Message-
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Wednesday, June 25, 2014 1:33 AM
> To: Richardson, Bruce
> Cc: dev at dpdk.org; Stephen Hemminger
> Subject: Re: [dpdk-dev] [PATCH 1/3] stringfns: remove rte_snprintf
> 
> 2014-06-24 17:39, Richardson, Bruce:
> > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Stephen Hemminger
> > > The function rte_snprintf serves no useful purpose. It is the
> > > same as snprintf() for all valid inputs. Just remove it and
> > > replace all uses in current code.
> >
> > NAK to this as is.
> > Approve of replacing all instance of the rte_snprintf function with the
> > standard version in all our code and libraries. However, rather than just
> > removing the function completely, I think we should just flag the function
> > as deprecated initially, and then later on look to remove it completely.
> 
> I agree we should try to use the "deprecated" attribute when possible.
> So application porting effort will be smoother.
> 
> But in this case, there is something different: as Stephen wrote, rte_snprintf
> is useless. It's useless inside the DPDK so it's even more useless for user
> applications.
> As it's really useless, it has no sense to keep it as deprecated.
> Please, let's simply remove it.
> 

The reason to keep it as deprecated is so that those customers who don't want 
to do a huge amount of search-replace immediately can get things working again 
temporarily using -Wno-deprecated. It provides a simple temporary fallback 
cushion, and then we can completely remove the function later. 
So, I'd like to see us remove all our usage of the function internally in 1.7, 
along with marking as deprecated, and then completely remove in 1.8, (i.e. in a 
week's time or so) :-)


[dpdk-dev] [PATCH 5/5] testpmd: change some of testpmd default parameter to well tuned value

2014-06-26 Thread Cunming Liang
We usually use testpmd fwd to demostrate IO forwarding throughput.
For best throughput, it has to assign the special parameter to testpmd.
To makes it easier to run, now set it as defalut value.
Such parameters are MBUF Mempool Cache and RX/TX threshold registers.
MBCACHE: 250
RX threshold registers: pthresh=8 hthresh=8 wthresh=0
TX threshold registers: pthresh=32 hthresh=0 wthresh=0

Signed-off-by: Cunming Liang 
Acked-by: Bruce Richardson 
Acked-by: Yong Liu 
Tested-by: Zhaochen Zhan 
---
 app/test-pmd/testpmd.c | 6 +++---
 app/test-pmd/testpmd.h | 2 ++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 546d429..16fe596 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -174,7 +174,7 @@ uint16_t tx_pkt_seg_lengths[RTE_MAX_SEGS_PER_PKT] = {
 uint8_t  tx_pkt_nb_segs = 1; /**< Number of segments in TXONLY packets */

 uint16_t nb_pkt_per_burst = DEF_PKT_BURST; /**< Number of packets per burst. */
-uint16_t mb_mempool_cache = DEF_PKT_BURST; /**< Size of mbuf mempool cache. */
+uint16_t mb_mempool_cache = DEF_MBUF_CACHE; /**< Size of mbuf mempool cache. */

 /* current configuration is in DCB or not,0 means it is not in DCB mode */
 uint8_t dcb_config = 0;
@@ -204,9 +204,9 @@ uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; /**< Number of 
TX descriptors. */
  */
 #define RX_PTHRESH 8 /**< Default value of RX prefetch threshold register. */
 #define RX_HTHRESH 8 /**< Default value of RX host threshold register. */
-#define RX_WTHRESH 4 /**< Default value of RX write-back threshold register. */
+#define RX_WTHRESH 0 /**< Default value of RX write-back threshold register. */

-#define TX_PTHRESH 36 /**< Default value of TX prefetch threshold register. */
+#define TX_PTHRESH 32 /**< Default value of TX prefetch threshold register. */
 #define TX_HTHRESH 0 /**< Default value of TX host threshold register. */
 #define TX_WTHRESH 0 /**< Default value of TX write-back threshold register. */

diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 7e3beb6..6a9eab8 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -65,6 +65,8 @@ int main(int argc, char **argv);
 #define MAX_PKT_BURST 512
 #define DEF_PKT_BURST 32

+#define DEF_MBUF_CACHE 250
+
 #define CACHE_LINE_SIZE_ROUNDUP(size) \
(CACHE_LINE_SIZE * ((size + CACHE_LINE_SIZE - 1) / CACHE_LINE_SIZE))

-- 
1.8.1.4



[dpdk-dev] [PATCH 4/5] ixgbe: set default burst size 32 in testpmd

2014-06-26 Thread Cunming Liang
The vpmd RX don't accept burst size less than 32.
As vPMD is set =y by default, while default testpmd burst size is 16.
Which will cause RX nothing if not assign burst size correctly.

Signed-off-by: Cunming Liang 
Acked-by: Bruce Richardson 
Acked-by: Yong Liu 
Tested-by: Zhaochen Zhan 
---
 app/test-pmd/testpmd.h| 2 +-
 lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 5839f93..7e3beb6 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -63,7 +63,7 @@ int main(int argc, char **argv);
 #define RTE_MAX_SEGS_PER_PKT 255 /**< pkt.nb_segs is a 8-bit unsigned char. */

 #define MAX_PKT_BURST 512
-#define DEF_PKT_BURST 16
+#define DEF_PKT_BURST 32

 #define CACHE_LINE_SIZE_ROUNDUP(size) \
(CACHE_LINE_SIZE * ((size + CACHE_LINE_SIZE - 1) / CACHE_LINE_SIZE))
diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c 
b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
index 7f05b26..a5c8228 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
@@ -2168,7 +2168,8 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
dev->rx_pkt_burst = ixgbe_recv_pkts_bulk_alloc;
 #ifdef RTE_IXGBE_INC_VECTOR
if (!ixgbe_rx_vec_condition_check(dev)) {
-   PMD_INIT_LOG(INFO, "Vector rx enabled.\n");
+   PMD_INIT_LOG(INFO, "Vector rx enabled, please make "
+"sure RX burst size no less than 32.\n");
ixgbe_rxq_vec_setup(rxq, socket_id);
dev->rx_pkt_burst = ixgbe_recv_pkts_vec;
}
-- 
1.8.1.4



[dpdk-dev] [PATCH 3/5] ixgbe: not 'DISABLE' may make confuse, change RTE_IXGBE_RX_OLFLAGS_DISABLE=n to RTE_IXGBE_RX_OLFLAGS_ENABLE=y

2014-06-26 Thread Cunming Liang
RTE_IXGBE_RX_OLFLAGS_ENABLE gives a hint whick keeping packet type in RX 
ol_flags or not.
By default it is set to update ol_flags in RX mbuf header.
If unset it, will gain addtional performance, but will lose packet type 
information.

Signed-off-by: Cunming Liang 
Acked-by: Bruce Richardson 
Acked-by: Yong Liu 
Tested-by: Zhaochen Zhan 
---
 config/common_linuxapp| 2 +-
 lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/config/common_linuxapp b/config/common_linuxapp
index 5b896c3..b19c4d9 100644
--- a/config/common_linuxapp
+++ b/config/common_linuxapp
@@ -192,7 +192,7 @@ CONFIG_RTE_LIBRTE_IXGBE_PF_DISABLE_STRIP_CRC=n
 CONFIG_RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC=y
 CONFIG_RTE_LIBRTE_IXGBE_ALLOW_UNSUPPORTED_SFP=n
 CONFIG_RTE_IXGBE_INC_VECTOR=y
-CONFIG_RTE_IXGBE_RX_OLFLAGS_DISABLE=n
+CONFIG_RTE_IXGBE_RX_OLFLAGS_ENABLE=y

 #
 # Compile burst-oriented I40E PMD driver
diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c 
b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
index 74d1b36..09e19a3 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
@@ -145,7 +145,7 @@ ixgbe_rxq_rearm(struct igb_rx_queue *rxq)
  * gives improved performance, at the cost of losing the offload info
  * in the received packet
  */
-#ifndef RTE_IXGBE_RX_OLFLAGS_DISABLE
+#ifdef RTE_IXGBE_RX_OLFLAGS_ENABLE

 #define OLFLAGS_MASK ((uint16_t)(PKT_RX_VLAN_PKT | PKT_RX_IPV4_HDR |\
 PKT_RX_IPV4_HDR_EXT | PKT_RX_IPV6_HDR |\
@@ -679,7 +679,7 @@ int ixgbe_rx_vec_condition_check(struct rte_eth_dev *dev)
struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;
struct rte_fdir_conf *fconf = &dev->data->dev_conf.fdir_conf;

-#ifdef RTE_IXGBE_RX_OLFLAGS_DISABLE
+#ifndef RTE_IXGBE_RX_OLFLAGS_ENABLE
/* whithout rx ol_flags, no VP flag report */
if (rxmode->hw_vlan_strip != 0 ||
rxmode->hw_vlan_extend != 0)
-- 
1.8.1.4



[dpdk-dev] [PATCH 2/5] ixgbe: fix vpmd compiling error when RTE_LIBRTE_IEEE1588=y

2014-06-26 Thread Cunming Liang

Signed-off-by: Cunming Liang 
Acked-by: Bruce Richardson 
Acked-by: Yong Liu 
Tested-by: Zhaochen Zhan 
---
 lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c 
b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
index b8721dd..74d1b36 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
@@ -700,6 +700,7 @@ int ixgbe_rx_vec_condition_check(struct rte_eth_dev *dev)

return 0;
 #else
+   RTE_SET_USED(dev);
return -1;
 #endif
 }
-- 
1.8.1.4



[dpdk-dev] [PATCH 1/5] ixgbe: avoid compiler error when RTE_IXGBE_INC_VECTOR=y and RTE_LIBRTE_IXGBE_RX_ALLOC_BULK_ALLOC=n

2014-06-26 Thread Cunming Liang
The vpmd RX routine won't be used if RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC is 
not defined or its condition check fail.
The case RTE_LIBRTE_IXGBE_RX_ALLOC_BULK_ALLOC=n and RTE_IXGBE_INC_VECTOR=y may 
exist
when choose to use standard RX and optimized 
TX(ixgbe_xmit_pkts_vec/ixgbe_xmit_pkts_simple).

Signed-off-by: Cunming Liang 
Acked-by: Bruce Richardson 
Acked-by: Yong Liu 
Tested-by: Zhaochen Zhan 
---
 lib/librte_pmd_ixgbe/ixgbe_rxtx.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.h 
b/lib/librte_pmd_ixgbe/ixgbe_rxtx.h
index 26de64b..64c0695 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.h
+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.h
@@ -40,6 +40,8 @@
 #ifdef RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC
 #define RTE_PMD_IXGBE_RX_MAX_BURST 32
 #define RTE_IXGBE_DESCS_PER_LOOP   4
+#elif defined(RTE_IXGBE_INC_VECTOR)
+#define RTE_IXGBE_DESCS_PER_LOOP   4
 #else
 #define RTE_IXGBE_DESCS_PER_LOOP   1
 #endif
-- 
1.8.1.4



[dpdk-dev] [PATCH 0/5] ixgbe: vPMD compiling issue and testpmd default value change

2014-06-26 Thread Cunming Liang
This patch is used to fix several issue found in R1.7 RC1.
1. There's compiling error when change some defalut config in common_linuxapp.
   They are
   RTE_LIBRTE_IXGBE_RX_ALLOC_BULK_ALLOC=n
   RTE_LIBRTE_IEEE1588=y
2. Renaming RTE_IXGBE_RX_OLFLAGS_DISABLE to RTE_IXGBE_RX_OLFLAGS_ENABLE
   This avoid making user confused by defalut setting 'not DISABLE'.
3. Set testpmd defalut burst size to 32
   As vPMD RX only accept no less than 32, this avoid testpmd automation pass.
4. Change testpmd mbuf cache and rx/tx threshold defalut value.
   It makes easier to get better performance with vPMD.


*** BLURB HERE ***

Cunming Liang (5):
  ixgbe: avoid compiler error when RTE_IXGBE_INC_VECTOR=y and
RTE_LIBRTE_IXGBE_RX_ALLOC_BULK_ALLOC=n
  ixgbe: fix vpmd compiling error when RTE_LIBRTE_IEEE1588=y
  ixgbe: not 'DISABLE' may make confuse, change
RTE_IXGBE_RX_OLFLAGS_DISABLE=n to RTE_IXGBE_RX_OLFLAGS_ENABLE=y
  ixgbe: set default burst size 32 in testpmd
  testpmd: change some of testpmd default parameter to well tuned value

 app/test-pmd/testpmd.c| 6 +++---
 app/test-pmd/testpmd.h| 4 +++-
 config/common_linuxapp| 2 +-
 lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 3 ++-
 lib/librte_pmd_ixgbe/ixgbe_rxtx.h | 2 ++
 lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c | 5 +++--
 6 files changed, 14 insertions(+), 8 deletions(-)

-- 
1.8.1.4



[dpdk-dev] [PATCH v3 0/2] malloc: fix malloc and free linear complexity

2014-06-26 Thread Thomas Monjalon
> From: Robert Sanford
> > Comments on previous versions of this patch:
> > http://dpdk.org/ml/archives/dev/2014-May/002297.html
> > http://dpdk.org/ml/archives/dev/2014-June/003518.html
> > 
> > Additional changes from original to v3:
> > * Reduce the minimum-sized block that we put on a free list when
> > 
> >   splitting a larger block, from 192 to 64. Although memory is
> >   plentiful, why waste 64 and 128-byte (plus overhead) blocks?
> > 
> > -#define MIN_DATA_SIZE (CACHE_LINE_SIZE * 2)
> > +#define MIN_DATA_SIZE (CACHE_LINE_SIZE)
> > 
> > -   if (old_elem_size <= MALLOC_ELEM_OVERHEAD + MIN_DATA_SIZE){
> > +   if (old_elem_size < MALLOC_ELEM_OVERHEAD + MIN_DATA_SIZE){
> > 
> > -   if (elem->size - new_size > MIN_DATA_SIZE +
> > MALLOC_ELEM_OVERHEAD){
> > +   if (elem->size - new_size >= MIN_DATA_SIZE +
> > MALLOC_ELEM_OVERHEAD){
> > 
> > Changes from v2 to v3:
> > * Change the size ranges of the five free lists per heap. The first
> > 
> >   list will effectively contain blocks of size [64,256].
> 
> Acked-by: Pablo de Lara 

Applied for version 1.7.0.

Thanks for this brave rework.
-- 
Thomas


[dpdk-dev] [PATCH 0/5] ixgbe: vPMD compiling issue and testpmd default value change

2014-06-26 Thread Thomas Monjalon
2014-06-26 14:53, Cunming Liang:
> This patch is used to fix several issue found in R1.7 RC1.
> 1. There's compiling error when change some defalut config in
> common_linuxapp. They are
>RTE_LIBRTE_IXGBE_RX_ALLOC_BULK_ALLOC=n
>RTE_LIBRTE_IEEE1588=y
> 2. Renaming RTE_IXGBE_RX_OLFLAGS_DISABLE to RTE_IXGBE_RX_OLFLAGS_ENABLE
>This avoid making user confused by defalut setting 'not DISABLE'.
> 3. Set testpmd defalut burst size to 32
>As vPMD RX only accept no less than 32, this avoid testpmd automation
> pass.
> 4. Change testpmd mbuf cache and rx/tx threshold defalut value.
>It makes easier to get better performance with vPMD.
> 
> Cunming Liang (5):
>   ixgbe: avoid compiler error when RTE_IXGBE_INC_VECTOR=y and
> RTE_LIBRTE_IXGBE_RX_ALLOC_BULK_ALLOC=n
>   ixgbe: fix vpmd compiling error when RTE_LIBRTE_IEEE1588=y
>   ixgbe: not 'DISABLE' may make confuse, change
> RTE_IXGBE_RX_OLFLAGS_DISABLE=n to RTE_IXGBE_RX_OLFLAGS_ENABLE=y
>   ixgbe: set default burst size 32 in testpmd
>   testpmd: change some of testpmd default parameter to well tuned value

Applied for version 1.7.0.

Just a note about commit titles for next times:
As explained on the website (http://dpdk.org/dev#send),
"The title will be clearly visible in the git repository and in the email 
archives. So it is important to make it short and clear for quick reading and 
searches."

You may have a look at how I've reworded these titles:
http://dpdk.org/browse/dpdk/log
It's not the most important thing in the patches, so it's just a reminder for 
contributors reading this email.

Thanks
-- 
Thomas


[dpdk-dev] [PATCH] ixgbe: Alternative fix for 82599 Bypass NIC, getting incorrect media type

2014-06-26 Thread Thomas Monjalon
> > This was previosly solved in commit
> > 60a70d4e042350ca0f9200334b341063438be89b, but this alternative fix solves
> > the same issue, but without modifying the ixgbe shared code.
> > 
> > Signed-off-by: Pablo de Lara 
> 
> Acked-by: Konstantin Ananyev 

Applied for version 1.7.0.

Thanks
-- 
Thomas


[dpdk-dev] [PATCH] i40e: fix shared code compile warning

2014-06-26 Thread Thomas Monjalon
2014-06-24 14:43, Ananyev, Konstantin:
> Yes, it is much nicer to fix it in i40e_lan_hmc.c.
> But I don't really want us to open that door.
> So my vote would be to initial Mark's patch: add '-Wno-error' in the
> Makefile.

2014-06-24 15:25, Zhang, Helin:
> We should not modify code in shared code, if we do not want to maintain
> those huge code base. I think Mark's patch good for now, we can report that
> issue to shared code maintainers, and try to get them to fix it later.

2014-06-25 05:36, Chen, Jing D:
> my committed patch to ignore the warning on that file and continue the
> compile .  By doing so, the logic is right and  didn't change code's
> behavior.  We also needn't maintain it.  Even in bad case we find bugs
> hidden behind the '--CFLAGS_i40e_lan_hmc.0' warning in future, we can fix
> it after bug occurred. That's simple.

Applied for version 1.7.0.

Thanks
-- 
Thomas


[dpdk-dev] [PATCH 0/3] previous patches about "shared code"/"base drivers"

2014-06-26 Thread Thomas Monjalon
2014-06-25 16:07, Richardson, Bruce:
> > Thomas Monjalon (1):
> >   i40e: explicit shared code naming as base driver
> > Chen Jing D(Mark) (1):
> >   i40e/base: ignore warning
> > Pablo de Lara (1):
> >   ixgbe: rework fix of media type for bypass device
> 
> Acked-by: Bruce Richardson 

I've done same kind of minor modifications to e1000 and ixgbe:
http://dpdk.org/browse/dpdk/commit/?id=2c8e687c549f08522ee

All 3 patches are applied for version 1.7.0.

Thanks
-- 
Thomas


[dpdk-dev] [PATCH 1/3] stringfns: remove rte_snprintf

2014-06-26 Thread Aaron Campbell
On Jun 26, 2014, at 12:09 PM, Richardson, Bruce  
wrote:

>> I agree we should try to use the "deprecated" attribute when possible.
>> So application porting effort will be smoother.
>> 
>> But in this case, there is something different: as Stephen wrote, 
>> rte_snprintf
>> is useless. It's useless inside the DPDK so it's even more useless for user
>> applications.
>> As it's really useless, it has no sense to keep it as deprecated.
>> Please, let's simply remove it.
>> 
> 
> The reason to keep it as deprecated is so that those customers who don't want 
> to do a huge amount of search-replace immediately can get things working 
> again temporarily using -Wno-deprecated. It provides a simple temporary 
> fallback cushion, and then we can completely remove the function later. 
> So, I'd like to see us remove all our usage of the function internally in 
> 1.7, along with marking as deprecated, and then completely remove in 1.8, 
> (i.e. in a week's time or so) :-)

As a DPDK user, I?d vote to kill it now.  I doubt it is widely used in any 
external applications.  Such usage would be mostly from copy/pasting the sample 
code, is my guess.

-Aaron


[dpdk-dev] [PATCH] kni: compatibility with RHEL 7

2014-06-26 Thread Hiroshi Shimamoto
Hi,

> Subject: RE: [dpdk-dev] [PATCH] kni: compatibility with RHEL 7
> 
> Hi Hiroshi,
> 
>   Helin submitted one patch to fix compilation error in the redhat 6.4 and 
> 6.5.
>   Patch title is [dpdk-dev] [PATCH] kni: fix compile errors on Oracle 
> Linux6.4 and RHEL6.5
>   With this patch, we don't meet this compilation error in latest RHEL 7.0
>   Can you download latest DPDK code, and try to compile with this patch in 
> RHEL 7.0 again?

okay, I will try the latest code.

thanks,
Hiroshi

> 
> Thanks
> Waterman
> 
> 
> >-Original Message-
> >From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> >Sent: Wednesday, June 25, 2014 6:05 PM
> >To: Cao, Waterman
> >Cc: dev at dpdk.org; Hiroshi Shimamoto; Hayato Momma
> >Subject: Re: [dpdk-dev] [PATCH] kni: compatibility with RHEL 7
> >
> >Hi Waterman,
> >
> >2014-06-12 09:35, Hiroshi Shimamoto:
> >> 2014-06-12 09:18, Cao, Waterman:
> >> >   Can you give details about Linux Kernel version and complier version?
> >> >   Because we tried to build code in the Redhat 7.0 before, but we don't
> >> >   meet this issue. Please see information as the following:
> >> >   Linux kernel 3.10.0-54.0.1.el7.x86_64
> >> >   RHEL70BETA_64  GCC 4.8.2  ICC: 14.0.0
> >>
> >> Yes,
> >>
> >> Linux REHEL7RC-1 3.10.0-121.el7.x86_64 #1 SMP Tue Apr 8 10:48:19 EDT
> >> 2014
> >> x86_64 x86_64 x86_64 GNU/Linux gcc version 4.8.2 20140120 (Red Hat
> >> 4.8.2-16) (GCC)
> >>
> >> I got the below error;
> >> /path/to/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h:3851:1: error:
> >> conflicting types for ?skb_set_hash? skb_set_hash(struct sk_buff *skb,
> >> __u32 hash, __always_unused int type)
> >>
> >> /usr/src/kernels/3.10.0-121.el7.x86_64/include/linux/skbuff.h:762:1: note:
> >> previous definition of ?skb_set_hash? was here skb_set_hash(struct
> >> sk_buff *skb, __u32 hash, enum pkt_hash_types type)
> >
> >Could you confirm this fix is needed and acknowledge it?
> >Thanks
> >
> >
> >> > -Original Message-
> >> >
> >> > >From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Hiroshi
> >> > >Shimamoto
> >> > >Sent: Thursday, June 12, 2014 4:10 PM
> >> > >To: dev at dpdk.org
> >> > >Cc: Hayato Momma
> >> > >Subject: [dpdk-dev] [PATCH] kni: compatibility with RHEL 7
> >> > >
> >> > >From: Hiroshi Shimamoto 
> >> > >
> >> > >Compilation in RHEL7 is failed. This fixes the build issue.
> >> > >
> >> > >RHEL7 has skb_set_hash, the kernel version is 3.10 though.
> >> > >Don't define skb_set_hash for RHEL7.
> >> > >
> >> > >Signed-off-by: Hiroshi Shimamoto 
> >> > >Reviewed-by: Hayato Momma 
> >> > >---
> >> > >
> >> > > lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 5 +
> >> > > 1 file changed, 5 insertions(+)
> >> > >
> >> > >diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
> >> > >b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h index
> >> > >4c27d5d..b4de6e2 100644
> >> > >--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
> >> > >+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
> >> > >@@ -3843,6 +3843,9 @@ static inline struct sk_buff
> >> > >*__kc__vlan_hwaccel_put_tag(struct sk_buff *skb,  #endif /* >=
> >> > >3.10.0>
> >> > */
> >> >
> >> > > #if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0) )
> >> > >
> >> > >+
> >> > >+#if (!(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >=
> >> > >+RHEL_RELEASE_VERSION(7,0)))
> >> > >+
> >> > >
> >> > > #ifdef NETIF_F_RXHASH
> >> > > #define PKT_HASH_TYPE_L3 0
> >> > > static inline void
> >> > >
> >> > >@@ -3851,6 +3854,8 @@ skb_set_hash(struct sk_buff *skb, __u32 hash,
> >> > >__always_unused int type)> >
> >> > >skb->rxhash = hash;
> >> > >
> >> > > }
> >> > > #endif /* NETIF_F_RXHASH */
> >> > >
> >> > >+#endif /* < RHEL7 */
> >> > >+
> >> > >
> >> > > #endif /* < 3.14.0 */
> >> > >
> >> > > #endif /* _KCOMPAT_H_ */
> >> > >
> >> > >--
> >> > >1.9.1
> >
> >
> >--
> >Thomas


[dpdk-dev] [PATCH] kni: compatibility with RHEL 7

2014-06-26 Thread Cao, Waterman
Hi Hiroshi,

  Helin submitted one patch to fix compilation error in the redhat 6.4 and 6.5.
  Patch title is [dpdk-dev] [PATCH] kni: fix compile errors on Oracle Linux6.4 
and RHEL6.5
  With this patch, we don't meet this compilation error in latest RHEL 7.0 
  Can you download latest DPDK code, and try to compile with this patch in RHEL 
7.0 again?

Thanks
Waterman 


>-Original Message-
>From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com] 
>Sent: Wednesday, June 25, 2014 6:05 PM
>To: Cao, Waterman
>Cc: dev at dpdk.org; Hiroshi Shimamoto; Hayato Momma
>Subject: Re: [dpdk-dev] [PATCH] kni: compatibility with RHEL 7
>
>Hi Waterman,
>
>2014-06-12 09:35, Hiroshi Shimamoto:
>> 2014-06-12 09:18, Cao, Waterman:
>> >   Can you give details about Linux Kernel version and complier version?
>> >   Because we tried to build code in the Redhat 7.0 before, but we don't
>> >   meet this issue. Please see information as the following:
>> >   Linux kernel 3.10.0-54.0.1.el7.x86_64
>> >   RHEL70BETA_64GCC 4.8.2  ICC: 14.0.0
>> 
>> Yes,
>> 
>> Linux REHEL7RC-1 3.10.0-121.el7.x86_64 #1 SMP Tue Apr 8 10:48:19 EDT 
>> 2014
>> x86_64 x86_64 x86_64 GNU/Linux gcc version 4.8.2 20140120 (Red Hat
>> 4.8.2-16) (GCC)
>> 
>> I got the below error;
>> /path/to/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h:3851:1: error:
>> conflicting types for ?skb_set_hash? skb_set_hash(struct sk_buff *skb,
>> __u32 hash, __always_unused int type)
>> 
>> /usr/src/kernels/3.10.0-121.el7.x86_64/include/linux/skbuff.h:762:1: note:
>> previous definition of ?skb_set_hash? was here skb_set_hash(struct 
>> sk_buff *skb, __u32 hash, enum pkt_hash_types type)
>
>Could you confirm this fix is needed and acknowledge it?
>Thanks
>
>
>> > -Original Message-
>> > 
>> > >From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Hiroshi 
>> > >Shimamoto
>> > >Sent: Thursday, June 12, 2014 4:10 PM
>> > >To: dev at dpdk.org
>> > >Cc: Hayato Momma
>> > >Subject: [dpdk-dev] [PATCH] kni: compatibility with RHEL 7
>> > >
>> > >From: Hiroshi Shimamoto 
>> > >
>> > >Compilation in RHEL7 is failed. This fixes the build issue.
>> > >
>> > >RHEL7 has skb_set_hash, the kernel version is 3.10 though.
>> > >Don't define skb_set_hash for RHEL7.
>> > >
>> > >Signed-off-by: Hiroshi Shimamoto 
>> > >Reviewed-by: Hayato Momma 
>> > >---
>> > >
>> > > lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 5 +
>> > > 1 file changed, 5 insertions(+)
>> > >
>> > >diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
>> > >b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h index
>> > >4c27d5d..b4de6e2 100644
>> > >--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
>> > >+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
>> > >@@ -3843,6 +3843,9 @@ static inline struct sk_buff 
>> > >*__kc__vlan_hwaccel_put_tag(struct sk_buff *skb,  #endif /* >= 
>> > >3.10.0>
>> > */
>> > 
>> > > #if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0) )
>> > >
>> > >+
>> > >+#if (!(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >=
>> > >+RHEL_RELEASE_VERSION(7,0)))
>> > >+
>> > >
>> > > #ifdef NETIF_F_RXHASH
>> > > #define PKT_HASH_TYPE_L3 0
>> > > static inline void
>> > >
>> > >@@ -3851,6 +3854,8 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, 
>> > >__always_unused int type)> >
>> > >  skb->rxhash = hash;
>> > > 
>> > > }
>> > > #endif /* NETIF_F_RXHASH */
>> > >
>> > >+#endif /* < RHEL7 */
>> > >+
>> > >
>> > > #endif /* < 3.14.0 */
>> > > 
>> > > #endif /* _KCOMPAT_H_ */
>> > >
>> > >--
>> > >1.9.1
>
>
>--
>Thomas


[dpdk-dev] [PATCH] eal: fix invalid memory read as reported by valgrind

2014-06-26 Thread Aaron Campbell
==29880== Invalid read of size 1
==29880==at 0x56FF9A5: cpu_socket_id (eal_lcore.c:101)
==29880==by 0x56FFAE9: rte_eal_cpu_init (eal_lcore.c:168)
==29880==by 0x56F944A: rte_eal_init (eal.c:975)

The problem is that endptr points to memory allocated underneath the DIR
handle, which has already been freed.  So move the closedir() call lower.

Signed-off-by: Aaron Campbell 
---
 lib/librte_eal/linuxapp/eal/eal_lcore.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_lcore.c 
b/lib/librte_eal/linuxapp/eal/eal_lcore.c
index cc9b900..fd11142 100644
--- a/lib/librte_eal/linuxapp/eal/eal_lcore.c
+++ b/lib/librte_eal/linuxapp/eal/eal_lcore.c
@@ -77,7 +77,7 @@ cpu_socket_id(unsigned lcore_id)
const char node_prefix[] = "node";
const size_t prefix_len = sizeof(node_prefix) - 1;
char path[PATH_MAX];
-   DIR *d;
+   DIR *d = NULL;
unsigned long id = 0;
struct dirent *e;
char *endptr = NULL;
@@ -97,7 +97,6 @@ cpu_socket_id(unsigned lcore_id)
break;
}
}
-   closedir(d);
if (endptr == NULL || *endptr!='\0' || endptr == e->d_name+prefix_len) {
RTE_LOG(WARNING, EAL, "Cannot read numa node link "
"for lcore %u - using physical package id 
instead\n",
@@ -110,9 +109,12 @@ cpu_socket_id(unsigned lcore_id)
if (eal_parse_sysfs_value(path, &id) != 0)
goto err;
}
+   closedir(d);
return (unsigned)id;

 err:
+   if (d)
+   closedir(d);
RTE_LOG(ERR, EAL, "Error getting NUMA socket information from %s "
"for lcore %u - assuming NUMA socket 0\n", SYS_CPU_DIR, 
lcore_id);
return 0;
-- 
1.8.3.2



[dpdk-dev] [PATCH] dpdk_nic_bind: allow status query without igb_uio

2014-06-26 Thread Bruce Richardson
From: Bruce richardson 

Allow the nic bind/unbind script to print out its status messages even
if the igb_uio driver is not loaded. For binding and unbinding NICs, the
behaviour is the same, and the igb_uio driver still needs to be loaded.

Signed-off-by: Bruce richardson 
---
 tools/dpdk_nic_bind.py | 25 -
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/tools/dpdk_nic_bind.py b/tools/dpdk_nic_bind.py
index 42e845f..da01e01 100755
--- a/tools/dpdk_nic_bind.py
+++ b/tools/dpdk_nic_bind.py
@@ -45,6 +45,12 @@ devices = {}
 # list of supported DPDK drivers
 dpdk_drivers = [ "igb_uio", "vfio-pci" ]

+# command-line arg flags
+b_flag = None
+status_flag = False
+force_flag = False
+args = []
+
 def usage():
 '''Print usage information for the program'''
 argv0 = basename(sys.argv[0])
@@ -168,7 +174,7 @@ def check_modules():
 mod["Found"] = True

 # check if we have at least one loaded module
-if True not in [mod["Found"] for mod in mods]:
+if True not in [mod["Found"] for mod in mods] and b_flag is not None:
 print "Error - no supported modules are loaded"
 sys.exit(1)

@@ -438,9 +444,10 @@ def show_status():
 def parse_args():
 '''Parses the command-line arguments given by the user and takes the
 appropriate action for each'''
-b_flag = None
-status_flag = False
-force_flag = False
+global b_flag
+global status_flag
+global force_flag
+global args
 if len(sys.argv) <= 1:
 usage()
 sys.exit(0)
@@ -471,6 +478,13 @@ def parse_args():
 else:
 b_flag = arg

+def do_arg_actions():
+'''do the actual action requested by the user'''
+global b_flag
+global status_flag
+global force_flag
+global args
+
 if b_flag is None and not status_flag:
 print "Error: No action specified for devices. Please give a -b or -u 
option"
 print "Run '%s --usage' for further information" % sys.argv[0]
@@ -492,9 +506,10 @@ def parse_args():

 def main():
 '''program main function'''
+parse_args()
 check_modules()
 get_nic_details()
-parse_args()
+do_arg_actions()

 if __name__ == "__main__":
 main()
-- 
1.9.3