[dpdk-dev] [PATCH] examples/ip_pipeline: fix pcap file parsing

2016-04-01 Thread Thomas Monjalon
2016-04-01 10:55, Fan Zhang:
> Fixes: fe5d046 ("examples/ip_pipeline: add pcap file dump")
> 
> This patch fixes the pcap file parsing in ip_pipeline. Originally, the
> parser recognizes the pcap related entries regardless of the RTE_PORT_PCAP
> macro definition status.
> 
> Signed-off-by: Fan Zhang 
> Acked-by: Cristian Dumitrescu 

Applied, thanks


[dpdk-dev] [PATCH 0/3] bug fix and code clean-up

2016-04-01 Thread Thomas Monjalon
2016-04-01 14:41, Fan Zhang:
> This patchset fixes d4b4213 and eb5f411, plus code clean-up of port library.
> 
> Acked-by: Cristian Dumitrescu 
> 
> Fan Zhang (3):
>   port: fix source port parameter check
>   port: fix sink port parameter check
>   port: code clean-up

Applied, thanks


[dpdk-dev] [PATCH] scripts: build with libsso

2016-04-01 Thread Thomas Monjalon
Signed-off-by: Thomas Monjalon 
---
 scripts/test-build.sh | 4 
 1 file changed, 4 insertions(+)

diff --git a/scripts/test-build.sh b/scripts/test-build.sh
index a486244..c37fc99 100755
--- a/scripts/test-build.sh
+++ b/scripts/test-build.sh
@@ -44,6 +44,7 @@ default_path=$PATH
 # - DPDK_DEP_ZLIB (y/[n])
 # - DPDK_MAKE_JOBS (int)
 # - DPDK_NOTIFY (notify-send)
+# - LIBSSO_PATH
 . $(dirname $(readlink -e $0))/load-devel-config.sh

 print_usage () {
@@ -118,6 +119,7 @@ reset_env ()
unset DPDK_DEP_SZE
unset DPDK_DEP_ZLIB
unset AESNI_MULTI_BUFFER_LIB_PATH
+   unset LIBSSO_PATH
unset PQOS_INSTALL_PATH
 }

@@ -157,6 +159,8 @@ config () #   
sed -ri   's,(PMD_AESNI_MB=)n,\1y,' $1/.config
test -z "$AESNI_MULTI_BUFFER_LIB_PATH" || \
sed -ri  's,(PMD_AESNI_GCM=)n,\1y,' $1/.config
+   test -z "$LIBSSO_PATH" || \
+   sed -ri 's,(PMD_SNOW3G=)n,\1y,' $1/.config
test "$DPDK_DEP_SSL" != y || \
sed -ri's,(PMD_QAT=)n,\1y,' $1/.config
sed -ri's,(KNI_VHOST.*=)n,\1y,' $1/.config
-- 
2.7.0



[dpdk-dev] [PATCH v14 0/8] ethdev: 100G and link speed API refactoring

2016-04-01 Thread Thomas Monjalon
2016-04-01 00:12, Marc Sune:
> From: Marc Sune 
> 
> This series of patches adds the following capabilities:
> 
> * speed_capa bitmap in rte_eth_dev_info, which is filled by the PMDs
>   according to the physical device capabilities.
> * refactors link API in ethdev to allow the definition of the advertised
>   link speeds, fix speed (no auto-negociation) or advertise all supported
>   speeds (default).

The few feedbacks look good.
Applied, thanks.


[dpdk-dev] [PATCH v3 1/2] ethdev: add tunnel and port RSS offload types

2016-04-01 Thread Jerin Jacob
On Fri, Apr 01, 2016 at 04:04:13PM +0200, Thomas Monjalon wrote:
> 2016-03-31 02:21, Jerin Jacob:
> > - added VXLAN, GENEVE and NVGRE tunnel flow types
> > - added PORT flow type for accounting physical/virtual
> > port or channel number in flow creation
>
> These API change could be considered for 16.07 if they are motivated
> by any use. Please bring some use cases, thanks.

The use case is to spray the packets to multiple queues using RSS on
Tunnel type packets.

Considering the case if RSS hash does not account inner packet in tunnel
case, the packet always to go a particular queue as mostly likely
outer header remains same in tunnel packets and RSS spread
will not be achieved in tunnel packets case.

This feature is part of the RSS capability of ThunderX
NIC HW. Which, we are planning to upstream on next release.

I thought of pushing the common code changes first.

Jerin

>


[dpdk-dev] [PATCH 1/4] app/test: enhance test_port_ring_writer

2016-04-01 Thread Sanford, Robert
We don't need to change this line, because we never access more than
RTE_PORT_IN_BURST_SIZE_MAX (64) elements in this array:

-   struct rte_mbuf *mbuf[RTE_PORT_IN_BURST_SIZE_MAX];
+   struct rte_mbuf *mbuf[2 * RTE_PORT_IN_BURST_SIZE_MAX];


--
Robert

>Add code to send two 60-packet bursts to a ring port_out.
>This tests a ring writer buffer overflow problem and fix
>(in patch 2/4).
>
>Signed-off-by: Robert Sanford 
>---
> app/test/test_table_ports.c |   27 +--
> 1 files changed, 25 insertions(+), 2 deletions(-)
>
>diff --git a/app/test/test_table_ports.c b/app/test/test_table_ports.c
>index 2532367..0c0ec0a 100644
>--- a/app/test/test_table_ports.c
>+++ b/app/test/test_table_ports.c
>@@ -149,8 +149,8 @@ test_port_ring_writer(void)
> 
>   /* -- Traffic TX -- */
>   int expected_pkts, received_pkts;
>-  struct rte_mbuf *mbuf[RTE_PORT_IN_BURST_SIZE_MAX];
>-  struct rte_mbuf *res_mbuf[RTE_PORT_IN_BURST_SIZE_MAX];
>+  struct rte_mbuf *mbuf[2 * RTE_PORT_IN_BURST_SIZE_MAX];
>+  struct rte_mbuf *res_mbuf[2 * RTE_PORT_IN_BURST_SIZE_MAX];
> 
>   port_ring_writer_params.ring = RING_TX;
>   port_ring_writer_params.tx_burst_sz = RTE_PORT_IN_BURST_SIZE_MAX;
>@@ -216,5 +216,28 @@ test_port_ring_writer(void)
>   for (i = 0; i < RTE_PORT_IN_BURST_SIZE_MAX; i++)
>   rte_pktmbuf_free(res_mbuf[i]);
> 
>+  /* TX Bulk - send two 60-packet bursts */
>+  uint64_t pkt_mask = 0xfff0ULL;
>+
>+  for (i = 0; i < 4; i++)
>+  mbuf[i] = NULL;
>+  for (i = 4; i < 64; i++)
>+  mbuf[i] = rte_pktmbuf_alloc(pool);
>+  rte_port_ring_writer_ops.f_tx_bulk(port, mbuf, pkt_mask);
>+  for (i = 4; i < 64; i++)
>+  mbuf[i] = rte_pktmbuf_alloc(pool);
>+  rte_port_ring_writer_ops.f_tx_bulk(port, mbuf, pkt_mask);
>+  rte_port_ring_writer_ops.f_flush(port);
>+
>+  expected_pkts = 2 * 60;
>+  received_pkts = rte_ring_sc_dequeue_burst(port_ring_writer_params.ring,
>+  (void **)res_mbuf, 2 * RTE_PORT_IN_BURST_SIZE_MAX);
>+
>+  if (received_pkts != expected_pkts)
>+  return -10;
>+
>+  for (i = 0; i < received_pkts; i++)
>+  rte_pktmbuf_free(res_mbuf[i]);
>+
>   return 0;
> }
>-- 
>1.7.1





[dpdk-dev] [PATCH 3/4] port: fix full burst checks in f_tx_bulk ops

2016-04-01 Thread Sanford, Robert
Hi Cristian,

In hindsight, I was overly agressive in proposing the same change
(approach #2, as you call it below) for rte_port_ring and rte_port_sched.
Changing local variable bsz_mask to uint64_t should be sufficient.

Please see additional comments inline below.



On 3/31/16 11:41 AM, "Dumitrescu, Cristian"
 wrote:
>> -Original Message-
>> From: Robert Sanford [mailto:rsanford2 at gmail.com]
>> Sent: Monday, March 28, 2016 9:52 PM
>> To: dev at dpdk.org; Dumitrescu, Cristian 
>> Subject: [PATCH 3/4] port: fix full burst checks in f_tx_bulk ops
>> 
>> For several f_tx_bulk functions in rte_port_{ethdev,ring,sched}.c,
>> it appears that the intent of the bsz_mask logic is to test whether
>> pkts_mask contains a full burst (i.e., the  least
>> significant bits are set).
>> 
>> There are two problems with the bsz_mask code: 1) It truncates
>> by using the wrong size for local variable uint32_t bsz_mask, and
>
>This is indeed a bug: although port->bsz_mask is always defined as
>uint64_t, there are several places where we cache it to a local variable
>which is defined as 32-bit by mistake: uint32_t bsz = p->bsz_mask.
>Thanks, Robert!
>
>> 2) We may pass oversized bursts to the underlying ethdev/ring/sched,
>> e.g., tx_burst_sz=16, bsz_mask=0x8000, and pkts_mask=0x1
>> (17 packets), results in expr==0, and we send a burst larger than
>> desired (and non-power-of-2) to the underlying tx burst interface.
>> 
>
>As stated in another related email, this is done by design, with the key
>assumption being that larger TX burst sizes will always be beneficial. So
>tx_burst_size is, by design, a requirement for the *minimal* value of the
>TX burst size rather than the *exact* value for the burst size.
>As an example, when the TX burst size of 32 is set, then larger burst
>sizes of 33, 34, ..., 40, 41, ..., 48, ..., 64 are welcomed and sent out
>as a single burst rather than breaking in into multiple fixed size
>32-packet bursts. 
>For PMDs, burst size (smaller than 64) is typically much lower than the
>TX ring size (typical value for IXGBE: 512). Same for rte_ring.
>
>So what we are debating here is which of the following two approaches is
>better:
>Approach 1: Consider tx_burst_sz as the minimal burst size, welcome
>larger bursts and send them as a single burst (i.e. do not break them
>into fixed tx_burst_sz bursts). This is the existing approach used
>consistently everywhere in librte_port.
>Approach 2: Consider tx_burst_sz as an exact burst size requirement, any
>larger incoming burst is broken into fixed size bursts of exactly
>tx_burst_sz packets before send. This is the approach suggested by Robert.
>
>I think we should go for the approach that gives the best performance.
>Personally, I think Approach 1 (existing) is doing this, but I would like
>to get more fact-based opinions from the people on this mail list (CC-ing
>a few key folks), especially PMD and ring maintainers. What is your
>experience, guys?


I only advocate approach #2 (for rte_port_ethdev) if we can't be certain
of the semantics of the underlying rte_eth_tx_burst(). e.g., if we attempt
to send 33 packets, and it never enqueues more than 32.

Off topic, general points about PMD APIs:
* From the viewpoint of an API user, having rte_eth_{rx,tx}_burst()
unexpectedly truncate a burst request is an unwelcome surprise, and should
at least be well-documented.
* We previously encountered this problem on the RX-side of IXGBE: We asked
rte_eth_rx_burst() for 64 packets, but it never returned more than 32,
even when there were hundreds "done". This was a little unexpected.

* From a quick look at the latest code, it appears that
ixgbe_xmit_pkts_vec() and ixgbe_recv_pkts_vec() still do this. Yes, these
are the vector versions, but do we need to study the drivers of every
device that we might use, when deciding things such as burst sizes? :)
* One simple enhancement idea: ethdev info-get API could convey related
info, e.g., whether rx/tx APIs truncate bursts, if so, how big, etc.


>
>> We propose to effectively set bsz_mask = (1 << tx_burst_sz) - 1
>> (while avoiding truncation for tx_burst_sz=64), to cache the mask
>> value of a full burst, and then do a simple compare with pkts_mask
>> in each f_tx_bulk.
>> 
>> Signed-off-by: Robert Sanford 
>> ---
>>  lib/librte_port/rte_port_ethdev.c |   15 ---
>>  lib/librte_port/rte_port_ring.c   |   16 
>>  lib/librte_port/rte_port_sched.c  |7 ++-
>>  3 files changed, 10 insertions(+), 28 deletions(-)
>> 
>> diff --git a/lib/librte_port/rte_port_ethdev.c
>> b/lib/librte_port/rte_port_ethdev.c
>> index 1c34602..3fb4947 100644
>> --- a/lib/librte_port/rte_port_ethdev.c
>> +++ b/lib/librte_port/rte_port_ethdev.c
>> @@ -188,7 +188,7 @@ rte_port_ethdev_writer_create(void *params, int
>> socket_id)
>>  port->queue_id = conf->queue_id;
>>  port->tx_burst_sz = conf->tx_burst_sz;
>>  port->tx_buf_count = 0;
>> -port->bsz_mask = 1LLU << (conf->tx_burst_sz - 1);
>> 

[dpdk-dev] [PATCH v3 0/2] Multi-process support in hash library

2016-04-01 Thread Thomas Monjalon
2016-04-01 16:03, Pablo de Lara:
> This patchset fixes the hash library to support multi-process.
> 
> It also replaces several RTE_ARCH_* with RTE_ARCH_X86, for simplicity.
> 
> Changes in v3:
> - Added new #ifdefs, to fix ARMv7 compilation
> - Replaced RTE_ARCH_* for X86 macros
> 
> Changes in v2:
> - Added missing const
> - Added extra info in documentation
> 
> Pablo de Lara (2):
>   hash: use RTE_ARCH_X86 macro for X86 systems
>   hash: fix to support multi process

Applied, thanks


[dpdk-dev] [PATCH 1/4] lpm: allocation of an existing object should fail

2016-04-01 Thread Olivier Matz


On 03/31/2016 09:35 AM, Olivier Matz wrote:
> On 03/30/2016 11:46 PM, Stephen Hemminger wrote:
>> with older memzone model, objects in huge memory area were never freed.
>> That means when application restarts it finds the old LPM and works.
>> With your change it would break such an application.
>>
> 
> Could you be more precise about the use case you are
> describing? Are you talking about a secondary process?
> 
> The API description of lpm and hash says since the first
> release that EEXIST should be returned if a memzone with
> the same name already exists:
> 
>  * @return
>  *   Handle to LPM object on success, NULL otherwise with rte_errno set
>  *   to an appropriate values. Possible rte_errno values include:
>  *- E_RTE_NO_CONFIG - function could not get pointer to rte_config
> structure
>  *- E_RTE_SECONDARY - function was called from a secondary process
> instance
>  *- EINVAL - invalid parameter passed to function
>  *- ENOSPC - the maximum number of memzones has already been allocated
>  *- EEXIST - a memzone with the same name already exists
>  *- ENOMEM - no appropriate memory area found in which to create memzone
>  */
> struct rte_lpm *
> rte_lpm_create(const char *name, int socket_id,
>   const struct rte_lpm_config *config);
> 
>  * @return
>  *   Pointer to hash table structure that is used in future hash table
>  *   operations, or NULL on error, with error code set in rte_errno.
>  *   Possible rte_errno errors include:
>  *- E_RTE_NO_CONFIG - function could not get pointer to rte_config
> structure
>  *- E_RTE_SECONDARY - function was called from a secondary process
> instance
>  *- ENOENT - missing entry
>  *- EINVAL - invalid parameter passed to function
>  *- ENOSPC - the maximum number of memzones has already been allocated
>  *- EEXIST - a memzone with the same name already exists
>  *- ENOMEM - no appropriate memory area found in which to create memzone
>  */
> struct rte_hash *
> rte_hash_create(const struct rte_hash_parameters *params);
> 
> 
> From my point of view, the behavior I'm fixing is more a bug
> fix than an API change. But if required, I can send a deprecation
> notice for 16.04 and have the fix integrated for 16.07.
> 

Stephen, any comment on this please?

The problem is today some unit tests are not passing correctly.


Thanks


[dpdk-dev] [PATCH 2/2] doc: update which PMDs can parse packet type

2016-04-01 Thread Thomas Monjalon
2016-03-26 00:10, Tan, Jianfeng:
> On 3/25/2016 10:21 PM, Bruce Richardson wrote:
> > On Fri, Mar 25, 2016 at 11:15:36AM +0800, Jianfeng Tan wrote:
> >> --- a/doc/guides/nics/overview.rst
> >> +++ b/doc/guides/nics/overview.rst
> >> @@ -124,7 +124,7 @@ Most of these differences are summarized below.
> >>  L4 checksum offload  X   X   X   X
> >>  inner L3 checksumX   X   X
> >>  inner L4 checksumX   X   X
> >> -   packet type parsing  X   X   X
> >> +   packet type parsing  X X X X X X   X X   X 
> >> X X X X X   X
> > This diff does not look right. How come some entries are being removed from 
> > some drivers?
> > Are you sure the line has correct whitespace on it?
> >
> > /Bruce
> 
> Thank you for checking this, actually I forget to rebase on rel_16_04. 
> There's newly added vhost-pmd.
> 
> -   packet type parsing  X X X X X X   X X   X X X X X X   X
> +   packet type parsing  X X X X X X   X X   X X X X X X X   X

Sorry I don't understand what you want to fill.
Please rebase and re-send.


[dpdk-dev] [PATCH v2] doc: update nic overview

2016-04-01 Thread Chen Jing D(Mark)
From: "Chen Jing D(Mark)" 

Add feature support list for fm10k, fm10k-vec, fm10kvf and
fm10kvf-vec.

Signed-off-by: Chen Jing D(Mark) 
---
v2:
 - fix a typo

 doc/guides/nics/overview.rst |   86 +-
 1 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/doc/guides/nics/overview.rst b/doc/guides/nics/overview.rst
index 542479a..b5d1c2c 100644
--- a/doc/guides/nics/overview.rst
+++ b/doc/guides/nics/overview.rst
@@ -74,39 +74,39 @@ Most of these differences are summarized below.

 .. table:: Features availability in networking drivers

-    = = = = = = = = = = = = = = = = = = = = = = = = = = = 
= = = = = =
-   Feature  a b b b c e e e i i i i i i i i i i f f m m m n n p r 
s v v v v x
-f n n o x 1 n n 4 4 4 4 g g x x x x m m l l p f u c i 
z h i i m e
-p x x n g 0 a i 0 0 0 0 b b g g g g 1 1 x x i p l a n 
e o r r x n
-a 2 2 d b 0   c e e e e   v b b b b 0 0 4 5 p   l p g 
d s t t n v
-c x x i e 0   . v v   f e e e e k k e 
a t i i e i
-k   v n   . f f   . v v   .   
t   o o t r
-e   f g   .   .   . f f   .   
a . 3 t
-t v   v   v   v   v   
2 v
-  e   e   e   e   e
 e
-  c   c   c   c   c
 c
-    = = = = = = = = = = = = = = = = = = = = = = = = = = = 
= = = = = =
-   link status  X   X X   
X X
-   link status eventX X
 X
-   queue status event  
 X
-   Rx interrupt X X X X
-   queue start/stop X   X   X X X X   X
+    = = = = = = = = = = = = = = = = = = = = = = = = = = = 
= = = = = = = =
+   Feature  a b b b c e e e i i i i i i i i i i f f f f m m m n n 
p r s v v v v x
+f n n o x 1 n n 4 4 4 4 g g x x x x m m m m l l p f u 
c i z h i i m e
+p x x n g 0 a i 0 0 0 0 b b g g g g 1 1 1 1 x x i p l 
a n e o r r x n
+a 2 2 d b 0   c e e e e   v b b b b 0 0 0 0 4 5 p   l 
p g d s t t n v
+c x x i e 0   . v v   f e e e e k k k k e  
   a t i i e i
+k   v n   . f f   . v v   . v v
   t   o o t r
+e   f g   .   .   . f f   . f f
   a . 3 t
+t v   v   v   v   v   v
   2 v
+  e   e   e   e   e   e
 e
+  c   c   c   c   c   c
 c
+    = = = = = = = = = = = = = = = = = = = = = = = = = = = 
= = = = = = = =
+   link status  X   X X
   X X
+   link status eventX X
 X
+   queue status event  
 X
+   Rx interrupt X X X X X X X X
+   queue start/stop X   X   X X X X X X X X
   X
MTU update   X   X
-   jumbo frame  X   X   X X X X
-   scattered Rx X   X   X X X X   X
+   jumbo frame  X   X   X X X X X X X X
+   scattered Rx X   X   X X X X X X X X
   X
LRO
-   TSO  X   X   X X X X
-   promiscuous mode X   X X X X   X
-   allmulticast modeX   X X X X   X
-   unicast MAC filter   X X X X
-   multicast MAC filter X X X X
-   RSS hash X   X   X X X X
-   RSS key update   X   X X X X
-   RSS reta update  X   X X X X
-   VMDq X X
+   TSO  X   X   X X X X X X X X
+   promiscuous mode X   X X X X X X
   X
+   allmulticast modeX   X X X X X X
   X
+   unicast MAC filter   X X X X X X
+   multicast MAC filter X X X X X X
+   RSS hash X   X   X X X X X X X X
+   RSS key update   X   X X X X X X X X
+   RSS 

[dpdk-dev] [PATCH] app/test/test_table_acl: fill missing field

2016-04-01 Thread Fan Zhang
This patch fills the missing field of ipv4_5tuple structure in acl table
test.

Signed-off-by: Fan Zhang 
Acked-by: Cristian Dumitrescu 
---
 app/test/test_table_acl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/app/test/test_table_acl.c b/app/test/test_table_acl.c
index b3bfda4..6ab0348 100644
--- a/app/test/test_table_acl.c
+++ b/app/test/test_table_acl.c
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -45,7 +45,9 @@
  **/

 struct ipv4_5tuple {
+   uint8_t  ttl;
uint8_t  proto;
+   uint16_t checksum;
uint32_t ip_src;
uint32_t ip_dst;
uint16_t port_src;
-- 
2.5.0



[dpdk-dev] [PATCH] doc: update nic overview

2016-04-01 Thread Chen Jing D(Mark)
From: "Chen Jing D(Mark)" 

Add feature support list for fm10k, fm10k-vec, fm10kvf and
fm10kvf-vec.

Signed-off-by: Chen Jing D(Mark) 
---
 doc/guides/nics/overview.rst |   86 +-
 1 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/doc/guides/nics/overview.rst b/doc/guides/nics/overview.rst
index 542479a..4f6ad9e 100644
--- a/doc/guides/nics/overview.rst
+++ b/doc/guides/nics/overview.rst
@@ -74,39 +74,39 @@ Most of these differences are summarized below.

 .. table:: Features availability in networking drivers

-    = = = = = = = = = = = = = = = = = = = = = = = = = = = 
= = = = = =
-   Feature  a b b b c e e e i i i i i i i i i i f f m m m n n p r 
s v v v v x
-f n n o x 1 n n 4 4 4 4 g g x x x x m m l l p f u c i 
z h i i m e
-p x x n g 0 a i 0 0 0 0 b b g g g g 1 1 x x i p l a n 
e o r r x n
-a 2 2 d b 0   c e e e e   v b b b b 0 0 4 5 p   l p g 
d s t t n v
-c x x i e 0   . v v   f e e e e k k e 
a t i i e i
-k   v n   . f f   . v v   .   
t   o o t r
-e   f g   .   .   . f f   .   
a . 3 t
-t v   v   v   v   v   
2 v
-  e   e   e   e   e
 e
-  c   c   c   c   c
 c
-    = = = = = = = = = = = = = = = = = = = = = = = = = = = 
= = = = = =
-   link status  X   X X   
X X
-   link status eventX X
 X
-   queue status event  
 X
-   Rx interrupt X X X X
-   queue start/stop X   X   X X X X   X
+    = = = = = = = = = = = = = = = = = = = = = = = = = = = 
= = = = = = = =
+   Feature  a b b b c e e e i i i i i i i i i i f f f f m m m n n 
p r s v v v v x
+f n n o x 1 n n 4 4 4 4 g g x x x x m m m m l l p f u 
c i z h i i m e
+p x x n g 0 a i 0 0 0 0 b b g g g g 1 1 1 1 x x i p l 
a n e o r r x n
+a 2 2 d b 0   c e e e e   v b b b b 0 0 0 0 4 5 p   l 
p g d s t t n v
+c x x i e 0   . v v   f e e e e k k k k e  
   a t i i e i
+k   v n   . f f   . v v   . v .
   t   o o t r
+e   f g   .   .   . f f   . f .
   a . 3 t
+t v   v   v   v   v   v
   2 v
+  e   e   e   e   e   e
 e
+  c   c   c   c   c   c
 c
+    = = = = = = = = = = = = = = = = = = = = = = = = = = = 
= = = = = = = =
+   link status  X   X X
   X X
+   link status eventX X
 X
+   queue status event  
 X
+   Rx interrupt X X X X X X X X
+   queue start/stop X   X   X X X X X X X X
   X
MTU update   X   X
-   jumbo frame  X   X   X X X X
-   scattered Rx X   X   X X X X   X
+   jumbo frame  X   X   X X X X X X X X
+   scattered Rx X   X   X X X X X X X X
   X
LRO
-   TSO  X   X   X X X X
-   promiscuous mode X   X X X X   X
-   allmulticast modeX   X X X X   X
-   unicast MAC filter   X X X X
-   multicast MAC filter X X X X
-   RSS hash X   X   X X X X
-   RSS key update   X   X X X X
-   RSS reta update  X   X X X X
-   VMDq X X
+   TSO  X   X   X X X X X X X X
+   promiscuous mode X   X X X X X X
   X
+   allmulticast modeX   X X X X X X
   X
+   unicast MAC filter   X X X X X X
+   multicast MAC filter X X X X X X
+   RSS hash X   X   X X X X X X X X
+   RSS key update   X   X X X X X X X X
+   RSS reta update   

[dpdk-dev] [PATCH 4/4] port: fix ethdev writer burst too big

2016-04-01 Thread Sanford, Robert
Hi Cristian,

Please see my comments inline.

>
>
>> -Original Message-
>> From: Robert Sanford [mailto:rsanford2 at gmail.com]
>> Sent: Monday, March 28, 2016 9:52 PM
>> To: dev at dpdk.org; Dumitrescu, Cristian 
>> Subject: [PATCH 4/4] port: fix ethdev writer burst too big
>> 
>> For f_tx_bulk functions in rte_port_ethdev.c, we may unintentionally
>> send bursts larger than tx_burst_sz to the underlying ethdev.
>> Some PMDs (e.g., ixgbe) may truncate this request to their maximum
>> burst size, resulting in unnecessary enqueuing failures or ethdev
>> writer retries.
>
>Sending bursts larger than tx_burst_sz is actually intentional. The
>assumption is that NIC performance benefits from larger burst size. So
>the tx_burst_sz is used as a minimal burst size requirement, not as a
>maximal or fixed burst size requirement.
>
>I agree with you that a while ago the vector version of IXGBE driver used
>to work the way you describe it, but I don't think this is the case
>anymore. As an example, if TX burst size is set to 32 and 48 packets are
>transmitted, than the PMD will TX all the 48 packets (internally it can
>work in batches of 4, 8, 32, etc, should not matter) rather than TXing
>just 32 packets out of 48 and user having to either discard or retry with
>the remaining 16 packets. I am CC-ing Steve Liang for confirming this.
>
>Is there any PMD that people can name that currently behaves the
>opposite, i.e. given a burst of 48 pkts for TX, accept 32 pkts and
>discard the other 16?
>
>> 

Yes, I believe that IXGBE *still* truncates. What am I missing? :) My
interpretation of the latest vector TX burst function is that it truncates
bursts longer than txq->tx_rs_thresh. Here are relevant code snippets that
show it lowering the number of packets (nb_pkts) to enqueue (apologies in
advance for the email client mangling the indentation):

---

#define IXGBE_DEFAULT_TX_RSBIT_THRESH 32

static void
ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info
*dev_info)
{
  ...
  dev_info->default_txconf = (struct rte_eth_txconf) {
...
.tx_rs_thresh = IXGBE_DEFAULT_TX_RSBIT_THRESH,
...
  };
  ...
}


uint16_t
ixgbe_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
  uint16_t nb_pkts)
{
  ...
  /* cross rx_thresh boundary is not allowed */
  nb_pkts = RTE_MIN(nb_pkts, txq->tx_rs_thresh);

  if (txq->nb_tx_free < txq->tx_free_thresh)
ixgbe_tx_free_bufs(txq);


  nb_commit = nb_pkts = (uint16_t)RTE_MIN(txq->nb_tx_free, nb_pkts);
  if (unlikely(nb_pkts == 0))
return 0;
  ...
  return nb_pkts;
}

---



>> We propose to fix this by moving the tx buffer flushing logic from
>> *after* the loop that puts all packets into the tx buffer, to *inside*
>> the loop, testing for a full burst when adding each packet.
>> 
>
>The issue I have with this approach is the introduction of a branch that
>has to be tested for each iteration of the loop rather than once for the
>entire loop.
>
>The code branch where you add this is actually the slow(er) code path
>(where local variable expr != 0), which is used for non-contiguous or
>bursts smaller than tx_burst_sz. Is there a particular reason you are
>only interested of enabling this strategy (of using tx_burst_sz as a
>fixed burst size requirement) only on this code path? The reason I am
>asking is the other fast(er) code path (where expr == 0) also uses
>tx_burst_sz as a minimal requirement and therefore it can send burst
>sizes bigger than tx_burst_sz.

The reason we limit the burst size only in the "else" path is that we also
proposed to limit the ethdev tx burst in the "if (expr==0)" path, in patch
3/4.

>
>
>> Signed-off-by: Robert Sanford 
>> ---
>>  lib/librte_port/rte_port_ethdev.c |   20 ++--
>>  1 files changed, 10 insertions(+), 10 deletions(-)
>> 
>> diff --git a/lib/librte_port/rte_port_ethdev.c
>> b/lib/librte_port/rte_port_ethdev.c
>> index 3fb4947..1283338 100644
>> --- a/lib/librte_port/rte_port_ethdev.c
>> +++ b/lib/librte_port/rte_port_ethdev.c
>> @@ -151,7 +151,7 @@ static int rte_port_ethdev_reader_stats_read(void
>> *port,
>>  struct rte_port_ethdev_writer {
>>  struct rte_port_out_stats stats;
>> 
>> -struct rte_mbuf *tx_buf[2 * RTE_PORT_IN_BURST_SIZE_MAX];
>> +struct rte_mbuf *tx_buf[RTE_PORT_IN_BURST_SIZE_MAX];
>>  uint32_t tx_burst_sz;
>>  uint16_t tx_buf_count;
>>  uint64_t bsz_mask;
>> @@ -257,11 +257,11 @@ rte_port_ethdev_writer_tx_bulk(void *port,
>>  p->tx_buf[tx_buf_count++] = pkt;
>> 
>>  RTE_PORT_ETHDEV_WRITER_STATS_PKTS_IN_ADD(p, 1);
>>  pkts_mask &= ~pkt_mask;
>> -}
>> 
>> -p->tx_buf_count = tx_buf_count;
>> -if (tx_buf_count >= p->tx_burst_sz)
>> -send_burst(p);
>> +p->tx_buf_count = tx_buf_count;
>> +if (tx_buf_count >= p->tx_burst_sz)
>> +send_burst(p);
>> +}
>>  }
>
>One observation here: if 

[dpdk-dev] [PATCH] doc: update overview

2016-04-01 Thread Wenzhuo Lu
Update the overview.rst for e1000, igb, ixgbe.

Signed-off-by: Wenzhuo Lu 
---
 doc/guides/nics/overview.rst | 94 ++--
 1 file changed, 47 insertions(+), 47 deletions(-)

diff --git a/doc/guides/nics/overview.rst b/doc/guides/nics/overview.rst
index 542479a..bc5cde5 100644
--- a/doc/guides/nics/overview.rst
+++ b/doc/guides/nics/overview.rst
@@ -86,62 +86,62 @@ Most of these differences are summarized below.
   e   e   e   e   e
 e
   c   c   c   c   c
 c
 = = = = = = = = = = = = = = = = = = = = = = = = = = = 
= = = = = =
-   link status  X   X X   
X X
-   link status eventX X
 X
+   link status  X X X X X   X X X X   
X X
+   link status event  X X X X   X X
 X
queue status event  
 X
-   Rx interrupt X X X X
-   queue start/stop X   X   X X X X   X
-   MTU update   X   X
-   jumbo frame  X   X   X X X X
-   scattered Rx X   X   X X X X   X
-   LRO
-   TSO  X   X   X X X X
-   promiscuous mode X   X X X X   X
-   allmulticast modeX   X X X X   X
-   unicast MAC filter   X X X X
+   Rx interrupt   X   X X X X X X X X X X X
+   queue start/stop X   X   X X X X X X   X
+   MTU update   X X X   X   X X X X
+   jumbo frame  X X X   X X X X X   X X X X
+   scattered Rx X X X   X X X X X X X X X X   X
+   LRO  X X X X
+   TSO  X   X   X X X X X X X X X X
+   promiscuous mode X   X   X X X X X X X X   X
+   allmulticast modeX   X   X X X X X X X X X X   X
+   unicast MAC filter   X   X X X X X X X X X X
multicast MAC filter X X X X
-   RSS hash X   X   X X X X
-   RSS key update   X   X X X X
-   RSS reta update  X   X X X X
-   VMDq X X
-   SR-IOV   X   X X
-   DCB  X X
-   VLAN filter  X X X X
-   ethertype filter X X
-   n-tuple filter
-   SYN filter
-   tunnel filterX X
-   flexible filter
+   RSS hash X   X   X X X X X   X X X X
+   RSS key update   X   X X X X X   X X X X
+   RSS reta update  X   X X X X X   X X X X
+   VMDq X X X   X X
+   SR-IOV   X   X X X   X X
+   DCB  X X X   X X
+   VLAN filterX X X X X X X X X X X
+   ethertype filter X X X   X X
+   n-tuple filter   X   X X
+   SYN filter   X   X X
+   tunnel filterX X X X
+   flexible filter  X
hash filter  X X X X
-   flow directorX X
-   flow control X   X X
-   rate limitation
-   traffic mirroringX X
-   CRC offload  X   X   X   X
-   VLAN offload X   X   X   X
-   QinQ offload X   X
-   L3 checksum offload  X   X   X   X
-   L4 checksum offload  X   X   X   X
-   inner L3 checksumX   X   X
-   inner L4 checksumX   X   X
-   packet type parsing  X   X   X
-   timesync X X
-   basic stats  X   X   X X X X   
X X
-   extended stats   X   X X X X
+   flow directorX X X X
+   flow control X X X X X   X X
+   rate limitation  X X
+   traffic mirroringX X X X
+   CRC offload  X X X   X   X   X X X   X
+   VLAN offload X X X   X   X   X X X   X
+   QinQ offload   X X   X   X X X   X
+   L3 checksum offload  X X X   X   X   X X X   X
+   L4 checksum offload  X X X   X   X   X X X   X
+   inner L3 checksumX   X   X   X   X
+   inner L4 checksumX   X  

[dpdk-dev] [PATCH] ivshmem: avoid infinite loop when concatenating adjacent segments

2016-04-01 Thread Thomas Monjalon
Please Anatoly,
What do you think of this patch?

2015-12-19 23:39, David Verbeiren:
> This patch aligns the logic used to check for the presence of
> adjacent segments in has_adjacent_segments() with the logic used
> in cleanup_segments() when actually deciding to concatenate or
> not a pair of segments.
> 
> This fixes an infinite loop that happened when segments where
> adjacent in their physical or virtual addresses but not in their
> ioremap addresses: has_adjacent_segments() reported the presence
> of adjacent segments while cleanup_segments() was not considering
> them for concatenation, resulting in an infinite loop since the
> result of has_adjacent_segments() is used in the decision to
> continue looping in cleanup_segments().
> 
> Signed-off-by: David Verbeiren 



[dpdk-dev] [PATCH v3 1/2] ethdev: add tunnel and port RSS offload types

2016-04-01 Thread Thomas Monjalon
2016-03-31 02:21, Jerin Jacob:
> - added VXLAN, GENEVE and NVGRE tunnel flow types
> - added PORT flow type for accounting physical/virtual
> port or channel number in flow creation

These API change could be considered for 16.07 if they are motivated
by any use. Please bring some use cases, thanks.



[dpdk-dev] [PATCH v3 2/2] hash: fix to support multi process

2016-04-01 Thread Pablo de Lara
Hash library used a function pointer to choose a different
key compare function, depending on the key size.
As a result, multiple processes could not use the same hash table,
as the function addresses vary from one process to another.

Instead, a jump table is used, so each process has its own
function addresses, accessing this table with an index stored
in the hash table (note that using a custom key compare function
is not supported in multi-process mode).

Fixes: 48a399119619 ("hash: replace with cuckoo hash implementation")

Signed-off-by: Pablo de Lara 
Acked-by: Bruce Richardson 
---
 doc/guides/prog_guide/hash_lib.rst |   8 +++
 doc/guides/rel_notes/release_16_04.rst |   8 +++
 lib/librte_hash/rte_cuckoo_hash.c  | 107 +++--
 3 files changed, 104 insertions(+), 19 deletions(-)

diff --git a/doc/guides/prog_guide/hash_lib.rst 
b/doc/guides/prog_guide/hash_lib.rst
index 8f2cdbf..7944640 100644
--- a/doc/guides/prog_guide/hash_lib.rst
+++ b/doc/guides/prog_guide/hash_lib.rst
@@ -87,6 +87,14 @@ or stored in the hash table itself.
 The example hash tables in the L2/L3 Forwarding sample applications defines 
which port to forward a packet to based on a packet flow identified by the 
five-tuple lookup.
 However, this table could also be used for more sophisticated features and 
provide many other functions and actions that could be performed on the packets 
and flows.

+Multi-process support
+-
+
+The hash library can be used in a multi-process environment, minding that only 
lookups are thread-safe.
+The only function that can only be used in single-process mode is 
rte_hash_set_cmp_func(), which sets up
+a custom compare function, which is assigned to a function pointer (therefore, 
it is not supported in
+multi-process mode).
+
 Implementation Details
 --

diff --git a/doc/guides/rel_notes/release_16_04.rst 
b/doc/guides/rel_notes/release_16_04.rst
index 79d76e1..e6cc34d 100644
--- a/doc/guides/rel_notes/release_16_04.rst
+++ b/doc/guides/rel_notes/release_16_04.rst
@@ -404,6 +404,14 @@ Libraries
   Fix crc32c hash functions to return a valid crc32c value for data lengths
   not multiple of 4 bytes.

+* **hash: Fixed hash library to support multi-process mode.**
+
+  Fix hash library to support multi-process mode, using a jump table,
+  instead of storing a function pointer to the key compare function.
+  Multi-process mode only works with the built-in compare functions,
+  however a custom compare function (not in the jump table) can only
+  be used in single-process mode.
+
 * **librte_port: Fixed segmentation fault for ring and ethdev writer nodrop.**

   Fixed core dump issue on txq and swq when dropless is set to yes.
diff --git a/lib/librte_hash/rte_cuckoo_hash.c 
b/lib/librte_hash/rte_cuckoo_hash.c
index b9b0b65..04e95b7 100644
--- a/lib/librte_hash/rte_cuckoo_hash.c
+++ b/lib/librte_hash/rte_cuckoo_hash.c
@@ -102,6 +102,63 @@ EAL_REGISTER_TAILQ(rte_hash_tailq)

 #define LCORE_CACHE_SIZE   8

+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+/*
+ * All different options to select a key compare function,
+ * based on the key size and custom function.
+ */
+enum cmp_jump_table_case {
+   KEY_CUSTOM = 0,
+   KEY_16_BYTES,
+   KEY_32_BYTES,
+   KEY_48_BYTES,
+   KEY_64_BYTES,
+   KEY_80_BYTES,
+   KEY_96_BYTES,
+   KEY_112_BYTES,
+   KEY_128_BYTES,
+   KEY_OTHER_BYTES,
+   NUM_KEY_CMP_CASES,
+};
+
+/*
+ * Table storing all different key compare functions
+ * (multi-process supported)
+ */
+const rte_hash_cmp_eq_t cmp_jump_table[NUM_KEY_CMP_CASES] = {
+   NULL,
+   rte_hash_k16_cmp_eq,
+   rte_hash_k32_cmp_eq,
+   rte_hash_k48_cmp_eq,
+   rte_hash_k64_cmp_eq,
+   rte_hash_k80_cmp_eq,
+   rte_hash_k96_cmp_eq,
+   rte_hash_k112_cmp_eq,
+   rte_hash_k128_cmp_eq,
+   memcmp
+};
+#else
+/*
+ * All different options to select a key compare function,
+ * based on the key size and custom function.
+ */
+enum cmp_jump_table_case {
+   KEY_CUSTOM = 0,
+   KEY_OTHER_BYTES,
+   NUM_KEY_CMP_CASES,
+};
+
+/*
+ * Table storing all different key compare functions
+ * (multi-process supported)
+ */
+const rte_hash_cmp_eq_t cmp_jump_table[NUM_KEY_CMP_CASES] = {
+   NULL,
+   memcmp
+};
+
+#endif
+
 struct lcore_cache {
unsigned len; /**< Cache len */
void *objs[LCORE_CACHE_SIZE]; /**< Cache objects */
@@ -115,7 +172,10 @@ struct rte_hash {
uint32_t key_len;   /**< Length of hash key. */
rte_hash_function hash_func;/**< Function used to calculate hash. */
uint32_t hash_func_init_val;/**< Init value used by hash_func. */
-   rte_hash_cmp_eq_t rte_hash_cmp_eq; /**< Function used to compare keys. 
*/
+   rte_hash_cmp_eq_t rte_hash_custom_cmp_eq;
+   /**< Custom function used to compare keys. */
+   enum cmp_jump_table_case cmp_jump_table_idx;
+   /**< 

[dpdk-dev] [PATCH v3 1/2] hash: use RTE_ARCH_X86 macro for X86 systems

2016-04-01 Thread Pablo de Lara
Instead of using RTE_ARCH_X86_64, RTE_ARCH_X86_32
and RTE_ARCH_I686, use directly RTTE_ARCH_X86

Signed-off-by: Pablo de Lara 
---
 lib/librte_hash/rte_cuckoo_hash.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/librte_hash/rte_cuckoo_hash.c 
b/lib/librte_hash/rte_cuckoo_hash.c
index 71b5b76..b9b0b65 100644
--- a/lib/librte_hash/rte_cuckoo_hash.c
+++ b/lib/librte_hash/rte_cuckoo_hash.c
@@ -59,7 +59,7 @@
 #include 

 #include "rte_hash.h"
-#if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686) || 
defined(RTE_ARCH_X86_X32)
+#if defined(RTE_ARCH_X86)
 #include "rte_cmp_x86.h"
 #endif

@@ -287,8 +287,7 @@ rte_hash_create(const struct rte_hash_parameters *params)
  * If x86 architecture is used, select appropriate compare function,
  * which may use x86 instrinsics, otherwise use memcmp
  */
-#if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686) ||\
-defined(RTE_ARCH_X86_X32) || defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
/* Select function to compare keys */
switch (params->key_len) {
case 16:
-- 
2.5.5



[dpdk-dev] [PATCH v3 0/2] Multi-process support in hash library

2016-04-01 Thread Pablo de Lara
This patchset fixes the hash library to support multi-process.

It also replaces several RTE_ARCH_* with RTE_ARCH_X86, for simplicity.

Changes in v3:
- Added new #ifdefs, to fix ARMv7 compilation
- Replaced RTE_ARCH_* for X86 macros

Changes in v2:
- Added missing const
- Added extra info in documentation

Pablo de Lara (2):
  hash: use RTE_ARCH_X86 macro for X86 systems
  hash: fix to support multi process

 doc/guides/prog_guide/hash_lib.rst |   8 +++
 doc/guides/rel_notes/release_16_04.rst |   8 +++
 lib/librte_hash/rte_cuckoo_hash.c  | 112 ++---
 3 files changed, 106 insertions(+), 22 deletions(-)

-- 
2.5.5



[dpdk-dev] [PATCH] ivshmem: avoid infinite loop when concatenating adjacent segments

2016-04-01 Thread Burakov, Anatoly
> > Please Anatoly,
> > What do you think of this patch?
> >
> > 2015-12-19 23:39, David Verbeiren:
> > > This patch aligns the logic used to check for the presence of
> > > adjacent segments in has_adjacent_segments() with the logic used in
> > > cleanup_segments() when actually deciding to concatenate or not a
> > > pair of segments.
> > >
> > > This fixes an infinite loop that happened when segments where
> > > adjacent in their physical or virtual addresses but not in their
> > > ioremap
> > > addresses: has_adjacent_segments() reported the presence of adjacent
> > > segments while cleanup_segments() was not considering them for
> > > concatenation, resulting in an infinite loop since the result of
> > > has_adjacent_segments() is used in the decision to continue looping
> > > in cleanup_segments().
> > >
> > > Signed-off-by: David Verbeiren 
> 
> Yes, looking back on this, it made no sense. Or rather it did make some
> twisted sense, but led to a bug. So,
> 
> Acked-by: Anatoly  Burakov 
> 
> 

Actually, scratch that. I think additional changes are needed. This patch is 
OK, but it is incomplete and introduces a different bug.

If the segments aren't aren't fully adjacent, that would still cause "overlaps" 
to be non-zero since it expects everything to be >= start and < end. If start1 
== start2, that segment is both adjacent and overlapping. So in order to avoid 
throwing errors when not fully adjacent, but not overlapping, segments are 
present, we need to also fix the overlapping() function to report only overlaps 
and not adjacency.

Thanks,
Anatoly


[dpdk-dev] [PATCH 3/3] port: code clean-up

2016-04-01 Thread Thomas Monjalon
2016-04-01 14:41, Fan Zhang:
> --- a/mk/rte.app.mk
> +++ b/mk/rte.app.mk
> @@ -92,9 +92,7 @@ endif
>  ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n)
>  _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST)  += -lfuse
>  endif
> -ifeq ($(CONFIG_RTE_NEXT_ABI),y)
>  _LDLIBS-$(CONFIG_RTE_PORT_PCAP) += -lpcap
> -endif

Why removing NEXT_ABI here?
The pcap port cannot work without it because of 

+#ifdef RTE_NEXT_ABI
+
+   /** The full path of the pcap file to read packets from */
+   char *file_name;
+   /** The number of bytes to be read from each packet in the
+*  pcap file. If this value is 0, the whole packet is read;
+*  if it is bigger than packet size, the generated packets
+*  will contain the whole packet */
+   uint32_t n_bytes_per_pkt;
+
+#endif



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

2016-04-01 Thread Harish Patil
>
>On Thu, 31 Mar 2016 19:15:17 -0700
>Rasesh Mody  wrote:
>
>> Hi Thomas, Bruce,
>> 
>> The v5 series incorporates the following review comments:
>>  - move adapter_info logs under debug
>>  - implement qede_mac_addr_remove()
>>  - remove unused rc variable in qede_dev_configure()
>>  - fix indentation in qede_dev_info_get()
>>  - use c99 style struct init in qede_config_accept_any_vlan()
>>  - check error in qede_config_rx_mode()
>>  - update overview.rst since patch didn't apply
>> 
>> The patches are generated and tested against latest dpdk based off of
>> v16.04-rc2.
>> 
>> These patches are checked using checkpatch.sh with following additional
>> ignore option:
>>options="$options --ignore=BIT_MACRO,CONCATENATED_STRING"
>> 
>> Please apply!
>
>Looks good.
>
>One question, is there any restriction on number of Tx queues, relative
>to number of Rx queues.  Is it possible to have 8 Tx queues but only 2 Rx
>queues?
>I know bnx2x and some other drivers have that kind of restriction.
>
>Acked-by: Stephen Hemminger 
>
At the outset, thanks for all the review comments.
Yes, currently we only support symmetrical number of queue pairs.
So we have a check in place not to allow unequal no. of RX/TX queues (say
RX=2, TX=8).
We have a work item to address that later. There is no FW/HW restriction.

Thanks,
Harish





[dpdk-dev] [PATCH] igb: fix i350 VF RX issue

2016-04-01 Thread Thomas Monjalon
2016-04-01 10:08, Wenzhuo Lu:
> A problem is found on i350 VF. We found TX will happen once
> per 4 packets. If only 1~3 packets are received, they will
> not be forwarded. But the real problem is on RX side. The
> reason is the default RX write-back threshold is changed to
> 4, so every first 3 packets may be hung there.
> 
> This patch checks the RX wthresh when setting up the RX
> queue, and forces it to be 1, so every packet can be handled
> immediately.
> 
> Fixes: 4a41c17dba18 (igb: set default thresholds based on MAC type)
> ---
>  drivers/net/e1000/igb_rxtx.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Missing Signed-off-by


[dpdk-dev] [PATCH] i40e: Remove redundant fdir forward declarations.

2016-04-01 Thread Thomas Monjalon
2016-03-26 04:32, Rami Rosen:
> This patch removes several redundant forward declarations
> in i40e_fdir.c.

I have the feeling that writing some useless forward declarations
is common in some drivers.
So why removing only these ones? Are they the only one in i40e?



[dpdk-dev] [PATCH v2] ivshmem: fix race condition

2016-04-01 Thread Thomas Monjalon
> > The memory zone could be freed just after adding it to the metadata
> > file and just before marking it as not freeable.
> > This patch changes the locking logic in order to prevent it.
> > 
> > Fixes: cd10c42eb5bc ("mem: fix ivshmem freeing")
> > 
> > Signed-off-by: Mauricio Vasquez B
> > 
> 
> Acked-by: Anatoly  Burakov 

Applied, thanks


[dpdk-dev] [PATCH] bonding: fix incorrect loop boundary condition

2016-04-01 Thread Thomas Monjalon
2016-04-01 15:16, Vladyslav Buslov:
> Loop that calculates total number of tx descriptors in slave tx queues should 
> iterate up to nb_tx_queues, not nb_rx_queues.
> 
> Signed-off-by: Vladyslav Buslov 

Fixes: 3ef7955700e7 ("bonding: fix LACP mempool size")

Applied, thanks


[dpdk-dev] [PATCH] bonding: fix incorrect loop boundary condition

2016-04-01 Thread Vladyslav Buslov
Loop that calculates total number of tx descriptors in slave tx queues should 
iterate up to nb_tx_queues, not nb_rx_queues.

Signed-off-by: Vladyslav Buslov 
---
 drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c 
b/drivers/net/bonding/rte_eth_bond_8023ad.c
index 1b7e93a..c4448b7 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -890,7 +890,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev 
*bond_dev, uint8_t slave_id)
/* The size of the mempool should be at least:
 * the sum of the TX descriptors + BOND_MODE_8023AX_SLAVE_TX_PKTS */
total_tx_desc = BOND_MODE_8023AX_SLAVE_TX_PKTS;
-   for (q_id = 0; q_id < bond_dev->data->nb_rx_queues; q_id++) {
+   for (q_id = 0; q_id < bond_dev->data->nb_tx_queues; q_id++) {
bd_tx_q = (struct 
bond_tx_queue*)bond_dev->data->tx_queues[q_id];
total_tx_desc += bd_tx_q->nb_tx_desc;
}
-- 
2.8.0



[dpdk-dev] [PATCH] bonding: fix bond link detect in non-interrupt mode

2016-04-01 Thread Thomas Monjalon
> > From: Nelson Escobar 
> > 
> > Stopping then re-starting a bond interface containing slaves that
> > used polling for link detection caused the bond to think all slave
> > links were down and inactive.
> > 
> > Move the start of the polling for link from slave_add() to
> > bond_ethdev_start() and in bond_ethdev_stop() make sure we clear
> > the last_link_status of the slaves.
> > 
> > Signed-off-by: Nelson Escobar 
> > Signed-off-by: John Daley 
> 
> Acked-by: Declan Doherty 

Applied, thanks


[dpdk-dev] [PATCH] hash: fix memcmp function pointer in multi-process environment

2016-04-01 Thread Thomas Monjalon
2016-03-24 14:00, De Lara Guarch, Pablo:
> Hi,
> 
> I just sent an alternative patch to solve the issue, without requiring 
> #ifdefs.
> Could you take a look at it and check that works for you?

Please Dhananjaya Eadala,
Could you confirm the bug is fixed with this patch:
http://dpdk.org/patch/11822


[dpdk-dev] [PATCH v2] hash: fix to support multi process

2016-04-01 Thread Thomas Monjalon
Hi Pablo,

There is a build issue for arm-armv7a-linuxapp-gcc:
lib/librte_hash/rte_cuckoo_hash.c:129:2: error:
'rte_hash_k16_cmp_eq' undeclared here

The functions rte_hash_k*_cmp_eq are defined only for x86 and ARM64.

Note that RTE_ARCH_X86 could be used instead of
RTE_ARCH_X86_64 || RTE_ARCH_I686 || RTE_ARCH_X86_X32 in librte_hash.


[dpdk-dev] [PATCH 3/3] port: code clean-up

2016-04-01 Thread Zhang, Roy Fan
Hi Thomas,

The reason for removing RTE_NEXT_ABI here is caused by sink port, which 
is not wrapped by RTE_NEXT_ABI macro.
If the user disable RTE_NEXT_ABI but enable RTE_PORT_PCAP, the original 
code will cause the compile error as pcap library is missing.

Regards,
Fan

On 01/04/2016 14:56, Thomas Monjalon wrote:
> 2016-04-01 14:41, Fan Zhang:
>> --- a/mk/rte.app.mk
>> +++ b/mk/rte.app.mk
>> @@ -92,9 +92,7 @@ endif
>>   ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n)
>>   _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST)  += -lfuse
>>   endif
>> -ifeq ($(CONFIG_RTE_NEXT_ABI),y)
>>   _LDLIBS-$(CONFIG_RTE_PORT_PCAP) += -lpcap
>> -endif
> Why removing NEXT_ABI here?
> The pcap port cannot work without it because of
>
> +#ifdef RTE_NEXT_ABI
> +
> + /** The full path of the pcap file to read packets from */
> + char *file_name;
> + /** The number of bytes to be read from each packet in the
> +  *  pcap file. If this value is 0, the whole packet is read;
> +  *  if it is bigger than packet size, the generated packets
> +  *  will contain the whole packet */
> + uint32_t n_bytes_per_pkt;
> +
> +#endif
>



[dpdk-dev] [PATCH 2/4] port: fix ring writer buffer overflow

2016-04-01 Thread Sanford, Robert


>
>
>> -Original Message-
>> From: Robert Sanford [mailto:rsanford2 at gmail.com]
>> Sent: Monday, March 28, 2016 9:52 PM
>> To: dev at dpdk.org; Dumitrescu, Cristian 
>> Subject: [PATCH 2/4] port: fix ring writer buffer overflow
>> 
>> Ring writer tx_bulk functions may write past the end of tx_buf[].
>> Solution is to double the size of tx_buf[].
>> 
>> Signed-off-by: Robert Sanford 
>> ---
>>  lib/librte_port/rte_port_ring.c |4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>> 
>> diff --git a/lib/librte_port/rte_port_ring.c
>>b/lib/librte_port/rte_port_ring.c
>> index b847fea..765ecc5 100644
>> --- a/lib/librte_port/rte_port_ring.c
>> +++ b/lib/librte_port/rte_port_ring.c
>> @@ -179,7 +179,7 @@ rte_port_ring_reader_stats_read(void *port,
>>  struct rte_port_ring_writer {
>>  struct rte_port_out_stats stats;
>> 
>> -struct rte_mbuf *tx_buf[RTE_PORT_IN_BURST_SIZE_MAX];
>> +struct rte_mbuf *tx_buf[2 * RTE_PORT_IN_BURST_SIZE_MAX];
>>  struct rte_ring *ring;
>>  uint32_t tx_burst_sz;
>>  uint32_t tx_buf_count;
>> @@ -447,7 +447,7 @@ rte_port_ring_writer_stats_read(void *port,
>>  struct rte_port_ring_writer_nodrop {
>>  struct rte_port_out_stats stats;
>> 
>> -struct rte_mbuf *tx_buf[RTE_PORT_IN_BURST_SIZE_MAX];
>> +struct rte_mbuf *tx_buf[2 * RTE_PORT_IN_BURST_SIZE_MAX];
>>  struct rte_ring *ring;
>>  uint32_t tx_burst_sz;
>>  uint32_t tx_buf_count;
>> --
>> 1.7.1
>
>Hi Robert,
>
>How is the buffer overflow taking place?
>
>After looking long and hard, I spotted that buffer overflow can
>potentially take place when the following conditions are met:
>1. The input packet burst does not meet the conditions of (a) being
>contiguous (first n bits set in pkts_mask, all the other bits cleared)
>and (b) containing a full burst, i.e. at least tx_burst_sz packets (n >=
>tx_burst_size). This is the slow(er) code path taken when local variable
>expr != 0.
>2. There are some packets already in the buffer.
>3. The number of packets in the incoming burst (i.e. popcount(pkts_mask))
>plus the number of packets already in the buffer exceeds the buffer size
>(RTE_PORT_IN_BURST_SIZE_MAX, i.e. 64).
>
>Is this the buffer overflow scenario that you detected?
>
>Thanks,
>Cristian
>

Hi Cristian,

Thanks for looking at the patches.
Yes, the buffer overflow occurs in the scenario you described. The
additional testing steps in patch 1/4 expose the overflow. The first time
that I run the table_autotest, it fails. The second time, the process
crashes.

--
Robert



[dpdk-dev] [PATCH v2] hash: fix typo in Doxygen comment

2016-04-01 Thread Thomas Monjalon
2016-03-29 18:38, Pablo de Lara:
> rte_hash_set_cmp_func() had an incorrect Doxygen comment
> for one of its parameters.
> 
> Fixes: 95da2f8e9c61 ("hash: customize compare function")
> 
> Signed-off-by: Pablo de Lara 

Applied, thanks


[dpdk-dev] [PATCH] ivshmem: avoid infinite loop when concatenating adjacent segments

2016-04-01 Thread Burakov, Anatoly
> Please Anatoly,
> What do you think of this patch?
> 
> 2015-12-19 23:39, David Verbeiren:
> > This patch aligns the logic used to check for the presence of adjacent
> > segments in has_adjacent_segments() with the logic used in
> > cleanup_segments() when actually deciding to concatenate or not a pair
> > of segments.
> >
> > This fixes an infinite loop that happened when segments where adjacent
> > in their physical or virtual addresses but not in their ioremap
> > addresses: has_adjacent_segments() reported the presence of adjacent
> > segments while cleanup_segments() was not considering them for
> > concatenation, resulting in an infinite loop since the result of
> > has_adjacent_segments() is used in the decision to continue looping in
> > cleanup_segments().
> >
> > Signed-off-by: David Verbeiren 

Yes, looking back on this, it made no sense. Or rather it did make some twisted 
sense, but led to a bug. So,

Acked-by: Anatoly  Burakov 





[dpdk-dev] [PATCH 3/3] port: code clean-up

2016-04-01 Thread Fan Zhang
This patch clean-up the code in librte_port. The clean-up includes the
following:

* Clearer error message display.
* Remove unnecessary RTE_NEXT_ABI macro warping.
* Remove __rte_unused attribute

Signed-off-by: Fan Zhang 
Acked-by: Cristian Dumitrescu 
---
 lib/librte_port/Makefile   |   5 --
 lib/librte_port/rte_port_source_sink.c | 102 +++--
 mk/rte.app.mk  |   2 -
 3 files changed, 33 insertions(+), 76 deletions(-)

diff --git a/lib/librte_port/Makefile b/lib/librte_port/Makefile
index 0b31c04..2c0ccbe 100644
--- a/lib/librte_port/Makefile
+++ b/lib/librte_port/Makefile
@@ -35,15 +35,10 @@ include $(RTE_SDK)/mk/rte.vars.mk
 # library name
 #
 LIB = librte_port.a
-
-ifeq ($(CONFIG_RTE_NEXT_ABI),y)
-
 ifeq ($(CONFIG_RTE_PORT_PCAP),y)
 LDLIBS += -lpcap
 endif

-endif
-
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)

diff --git a/lib/librte_port/rte_port_source_sink.c 
b/lib/librte_port/rte_port_source_sink.c
index ca40a59..056c975 100644
--- a/lib/librte_port/rte_port_source_sink.c
+++ b/lib/librte_port/rte_port_source_sink.c
@@ -36,7 +36,6 @@
 #include 
 #include 
 #include 
-
 #include 

 #ifdef RTE_NEXT_ABI
@@ -286,15 +285,12 @@ rte_port_source_free(void *port)
if (p == NULL)
return 0;

-#ifdef RTE_NEXT_ABI
-
if (p->pkt_len)
rte_free(p->pkt_len);
if (p->pkts)
rte_free(p->pkts);
if (p->pkt_buff)
rte_free(p->pkt_buff);
-#endif

rte_free(p);

@@ -315,8 +311,6 @@ rte_port_source_rx(void *port, struct rte_mbuf **pkts, 
uint32_t n_pkts)
rte_pktmbuf_reset(pkts[i]);
}

-#ifdef RTE_NEXT_ABI
-
if (p->pkt_buff != NULL) {
for (i = 0; i < n_pkts; i++) {
uint8_t *pkt_data = rte_pktmbuf_mtod(pkts[i],
@@ -333,8 +327,6 @@ rte_port_source_rx(void *port, struct rte_mbuf **pkts, 
uint32_t n_pkts)
}
}

-#endif
-
RTE_PORT_SOURCE_STATS_PKTS_IN_ADD(p, n_pkts);

return n_pkts;
@@ -419,21 +411,12 @@ pcap_sink_open(struct rte_port_sink *port,
return 0;
 }

-uint8_t jumbo_pkt_buf[ETHER_MAX_JUMBO_FRAME_LEN];
-
-/**
- * Dump a packet to PCAP dumper
- *
- * @param p
- *   Handle to sink port
- * @param mbuf
- *   Handle to mbuf structure holding the packet
- */
 static void
-pcap_sink_dump_pkt(struct rte_port_sink *port, struct rte_mbuf *mbuf)
+pcap_sink_write_pkt(struct rte_port_sink *port, struct rte_mbuf *mbuf)
 {
uint8_t *pcap_dumper = (uint8_t *)(port->dumper);
struct pcap_pkthdr pcap_hdr;
+   uint8_t jumbo_pkt_buf[ETHER_MAX_JUMBO_FRAME_LEN];
uint8_t *pkt;

/* Maximum num packets already reached */
@@ -481,37 +464,23 @@ pcap_sink_dump_pkt(struct rte_port_sink *port, struct 
rte_mbuf *mbuf)

 }

-/**
- * Flush pcap dumper
- *
- * @param dumper
- *   Handle to pcap dumper
- */
+#define PCAP_SINK_OPEN(port, file_name, max_n_pkts)\
+   pcap_sink_open(port, file_name, max_n_pkts)

-static void
-pcap_sink_flush_pkt(void *dumper)
-{
-   pcap_dumper_t *pcap_dumper = (pcap_dumper_t *)dumper;
+#define PCAP_SINK_WRITE_PKT(port, mbuf)\
+   pcap_sink_write_pkt(port, mbuf)

-   pcap_dump_flush(pcap_dumper);
-}
+#define PCAP_SINK_FLUSH_PKT(dumper)\
+do {   \
+   if (dumper) \
+   pcap_dump_flush((pcap_dumper_t *)dumper);   \
+} while (0)

-/**
- * Close a PCAP dumper handle
- *
- * @param dumper
- *   Handle to pcap dumper
- */
-static void
-pcap_sink_close(void *dumper)
-{
-   pcap_dumper_t *pcap_dumper = (pcap_dumper_t *)dumper;
-
-   pcap_dump_close(pcap_dumper);
-}
-
-#define PCAP_SINK_OPEN(port, file_name, max_n_pkts)\
-   pcap_sink_open(port, file_name, max_n_pkts)
+#define PCAP_SINK_CLOSE(dumper)\
+do {   \
+   if (dumper) \
+   pcap_dump_close((pcap_dumper_t *)dumper);   \
+} while (0)

 #else

@@ -528,15 +497,11 @@ pcap_sink_close(void *dumper)
_ret;   \
 })

-static void
-pcap_sink_dump_pkt(__rte_unused struct rte_port_sink *port,
-   __rte_unused struct rte_mbuf *mbuf) {}
+#define PCAP_SINK_WRITE_PKT(port, mbuf) {}

-static void
-pcap_sink_flush_pkt(__rte_unused void *dumper) {}
+#define PCAP_SINK_FLUSH_PKT(dumper)

-static void
-pcap_sink_close(__rte_unused void *dumper) {}
+#define PCAP_SINK_CLOSE(dumper)

 #endif

@@ -573,11 +538,11 @@ rte_port_sink_create(void *params, int socket_id)
 static int
 rte_port_sink_tx(void *port, struct rte_mbuf *pkt)
 {
-   __rte_unused struct rte_port_sink *p = (struct rte_port_sink *) port;
+   struct rte_port_sink *p = 

[dpdk-dev] [PATCH 2/3] port: fix sink port parameter check

2016-04-01 Thread Fan Zhang
Fixes: eb5f411 ("port: add pcap file dump")

This patch fixes sink port parameter checking logic. Originally, if user
set field "file_name" with meaning value but leave PCAP support feature
disabled, the program simply ignores this field without notifying the
user.

Signed-off-by: Fan Zhang 
Acked-by: Cristian Dumitrescu 
---
 lib/librte_port/rte_port_source_sink.c | 100 ++---
 1 file changed, 43 insertions(+), 57 deletions(-)

diff --git a/lib/librte_port/rte_port_source_sink.c 
b/lib/librte_port/rte_port_source_sink.c
index 5c24cea..ca40a59 100644
--- a/lib/librte_port/rte_port_source_sink.c
+++ b/lib/librte_port/rte_port_source_sink.c
@@ -385,47 +385,37 @@ struct rte_port_sink {

 #ifdef RTE_PORT_PCAP

-/**
- * Open PCAP file for dumping packets to the file later
- *
- * @param port
- *   Handle to sink port
- * @param p
- *   Sink port parameter
- * @return
- *   0 on SUCCESS
- *   error code otherwise
- */
 static int
 pcap_sink_open(struct rte_port_sink *port,
-   __rte_unused struct rte_port_sink_params *p)
+   const char *file_name,
+   uint32_t max_n_pkts)
 {
pcap_t *tx_pcap;
pcap_dumper_t *pcap_dumper;

-   if (p->file_name == NULL) {
-   port->dumper = NULL;
-   port->max_pkts = 0;
-   port->pkt_index = 0;
-   port->dump_finish = 0;
-   return 0;
-   }
-
/** Open a dead pcap handler for opening dumper file */
tx_pcap = pcap_open_dead(DLT_EN10MB, 65535);
-   if (tx_pcap == NULL)
-   return -ENOENT;
+   if (tx_pcap == NULL) {
+   RTE_LOG(ERR, PORT, "Cannot open pcap dead handler\n");
+   return -1;
+   }

/* The dumper is created using the previous pcap_t reference */
-   pcap_dumper = pcap_dump_open(tx_pcap, p->file_name);
-   if (pcap_dumper == NULL)
-   return -ENOENT;
+   pcap_dumper = pcap_dump_open(tx_pcap, file_name);
+   if (pcap_dumper == NULL) {
+   RTE_LOG(ERR, PORT, "Failed to open pcap file "
+   "\"%s\" for writing\n", file_name);
+   return -1;
+   }

port->dumper = pcap_dumper;
-   port->max_pkts = p->max_n_pkts;
+   port->max_pkts = max_n_pkts;
port->pkt_index = 0;
port->dump_finish = 0;

+   RTE_LOG(INFO, PORT, "Ready to dump packets to file \"%s\"\n",
+   file_name);
+
return 0;
 }

@@ -520,19 +510,23 @@ pcap_sink_close(void *dumper)
pcap_dump_close(pcap_dumper);
 }

-#else
+#define PCAP_SINK_OPEN(port, file_name, max_n_pkts)\
+   pcap_sink_open(port, file_name, max_n_pkts)

-static int
-pcap_sink_open(struct rte_port_sink *port,
-   __rte_unused struct rte_port_sink_params *p)
-{
-   port->dumper = NULL;
-   port->max_pkts = 0;
-   port->pkt_index = 0;
-   port->dump_finish = 0;
+#else

-   return -ENOTSUP;
-}
+#define PCAP_SINK_OPEN(port, file_name, max_n_pkts)\
+({ \
+   int _ret = 0;   \
+   \
+   if (file_name) {\
+   RTE_LOG(ERR, PORT, "Sink port field "   \
+   "\"file_name\" is not NULL.\n");\
+   _ret = -1;  \
+   }   \
+   \
+   _ret;   \
+})

 static void
 pcap_sink_dump_pkt(__rte_unused struct rte_port_sink *port,
@@ -547,11 +541,10 @@ pcap_sink_close(__rte_unused void *dumper) {}
 #endif

 static void *
-rte_port_sink_create(__rte_unused void *params, int socket_id)
+rte_port_sink_create(void *params, int socket_id)
 {
struct rte_port_sink *port;
struct rte_port_sink_params *p = params;
-   int status;

/* Memory allocation */
port = rte_zmalloc_socket("PORT", sizeof(*port),
@@ -561,24 +554,17 @@ rte_port_sink_create(__rte_unused void *params, int 
socket_id)
return NULL;
}

-   /* Try to open PCAP file for dumping, if possible */
-   status = pcap_sink_open(port, p);
-   if (status == 0) {
-   if (port->dumper != NULL)
-   RTE_LOG(INFO, PORT, "Ready to dump packets "
-   "to file %s\n", p->file_name);
-
-   } else if (status != -ENOTSUP) {
-   if (status == -ENOENT)
-   RTE_LOG(ERR, PORT, "%s: Failed to open pcap file "
-   "%s for writing\n", __func__,
-   p->file_name);
-   else
-   RTE_LOG(ERR, PORT, "%s: Failed to enable pcap "
-  

[dpdk-dev] [PATCH 0/3] bug fix and code clean-up

2016-04-01 Thread Fan Zhang
This patchset fixes d4b4213 and eb5f411, plus code clean-up of port library.

Acked-by: Cristian Dumitrescu 

Fan Zhang (3):
  port: fix source port parameter check
  port: fix sink port parameter check
  port: code clean-up

 lib/librte_port/Makefile   |   5 -
 lib/librte_port/rte_port_source_sink.c | 322 +
 mk/rte.app.mk  |   2 -
 3 files changed, 122 insertions(+), 207 deletions(-)

-- 
2.5.0



[dpdk-dev] [PATCH] bonding: fix bond link detect in non-interrupt mode

2016-04-01 Thread Declan Doherty
On 26/03/16 00:44, John Daley wrote:
> From: Nelson Escobar 
>
> Stopping then re-starting a bond interface containing slaves that
> used polling for link detection caused the bond to think all slave
> links were down and inactive.
>
> Move the start of the polling for link from slave_add() to
> bond_ethdev_start() and in bond_ethdev_stop() make sure we clear
> the last_link_status of the slaves.
>
> Signed-off-by: Nelson Escobar 
> Signed-off-by: John Daley 
> ---

Acked-by: Declan Doherty 



[dpdk-dev] [PATCH] gcc compiler option -Og warnings fix

2016-04-01 Thread Keith Wiles
The new compiler option -Og causes a few warning on variables
being used before being set warnings. The new option allows better
debugging then -O0 without losing a lot of performance. This option
does not include -g debug symbol option.

Signed-off-by: Keith Wiles 
---
 lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 2 +-
 lib/librte_lpm/rte_lpm6.c | 1 +
 lib/librte_vhost/vhost_rxtx.c | 4 ++--
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c 
b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
index 068694d..89709f8 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
@@ -152,7 +152,7 @@ pci_get_uio_dev(struct rte_pci_device *dev, char *dstbuf,
   unsigned int buflen, int create)
 {
struct rte_pci_addr *loc = >addr;
-   unsigned int uio_num;
+   unsigned int uio_num = 0;
struct dirent *e;
DIR *dir;
char dirname[PATH_MAX];
diff --git a/lib/librte_lpm/rte_lpm6.c b/lib/librte_lpm/rte_lpm6.c
index 4c44cd7..36565da 100644
--- a/lib/librte_lpm/rte_lpm6.c
+++ b/lib/librte_lpm/rte_lpm6.c
@@ -381,6 +381,7 @@ add_step(struct rte_lpm6 *lpm, struct rte_lpm6_tbl_entry 
*tbl,
int8_t bitshift;
uint8_t bits_covered;

+   *tbl_next = NULL;
/*
 * Calculate index to the table based on the number and position
 * of the bytes being inspected in this step.
diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c
index 750821a..acf3632 100644
--- a/lib/librte_vhost/vhost_rxtx.c
+++ b/lib/librte_vhost/vhost_rxtx.c
@@ -295,7 +295,7 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id,
for (i = 0; i < count; i++) {
uint16_t desc_idx = desc_indexes[i];
uint16_t used_idx = (res_start_idx + i) & (vq->size - 1);
-   uint32_t copied;
+   uint32_t copied = 0;
int err;

err = copy_mbuf_to_desc(dev, vq, pkts[i], desc_idx, );
@@ -531,7 +531,7 @@ virtio_dev_merge_rx(struct virtio_net *dev, uint16_t 
queue_id,
 {
struct vhost_virtqueue *vq;
uint32_t pkt_idx = 0, nr_used = 0;
-   uint16_t start, end;
+   uint16_t start = 0, end = 0;

LOG_DEBUG(VHOST_DATA, "(%"PRIu64") virtio_dev_merge_rx()\n",
dev->device_fh);
-- 
2.5.0



[dpdk-dev] [PATCH v2] hash: fix to support multi process

2016-04-01 Thread De Lara Guarch, Pablo
Hi Thomas,

> -Original Message-
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Friday, April 01, 2016 2:07 PM
> To: De Lara Guarch, Pablo
> Cc: dev at dpdk.org; Richardson, Bruce
> Subject: Re: [dpdk-dev] [PATCH v2] hash: fix to support multi process
> 
> Hi Pablo,
> 
> There is a build issue for arm-armv7a-linuxapp-gcc:
>   lib/librte_hash/rte_cuckoo_hash.c:129:2: error:
>   'rte_hash_k16_cmp_eq' undeclared here
> 
> The functions rte_hash_k*_cmp_eq are defined only for x86 and ARM64.
> 
> Note that RTE_ARCH_X86 could be used instead of
> RTE_ARCH_X86_64 || RTE_ARCH_I686 || RTE_ARCH_X86_X32 in librte_hash.

Good catch. I will submit a v3 shortly.

Thanks also for the suggestion,
Pablo


[dpdk-dev] [PATCH 3/3] port: code clean-up

2016-04-01 Thread Zhang, Roy Fan
Hi Thomas,

The reason for removing RTE_NEXT_ABI here is caused by sink port, which is not 
wrapped by RTE_NEXT_ABI macro.
If the user disable RTE_NEXT_ABI but enable RTE_PORT_PCAP, the original code 
will cause the compile error as pcap library is missing.

Regards,
Fan

-Original Message-
From: Thomas Monjalon [mailto:thomas.monja...@6wind.com] 
Sent: Friday, April 1, 2016 2:56 PM
To: Zhang, Roy Fan 
Cc: dev at dpdk.org
Subject: Re: [dpdk-dev] [PATCH 3/3] port: code clean-up

2016-04-01 14:41, Fan Zhang:
> --- a/mk/rte.app.mk
> +++ b/mk/rte.app.mk
> @@ -92,9 +92,7 @@ endif
>  ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n)
>  _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST)  += -lfuse
>  endif
> -ifeq ($(CONFIG_RTE_NEXT_ABI),y)
>  _LDLIBS-$(CONFIG_RTE_PORT_PCAP) += -lpcap
> -endif

Why removing NEXT_ABI here?
The pcap port cannot work without it because of 

+#ifdef RTE_NEXT_ABI
+
+   /** The full path of the pcap file to read packets from */
+   char *file_name;
+   /** The number of bytes to be read from each packet in the
+*  pcap file. If this value is 0, the whole packet is read;
+*  if it is bigger than packet size, the generated packets
+*  will contain the whole packet */
+   uint32_t n_bytes_per_pkt;
+
+#endif



[dpdk-dev] [PATCH v1 1/1] cmdline: add any multi string mode to token string

2016-04-01 Thread Piotr Azarewicz
While parsing token string there may be several modes:
- fixed single string
- multi-choice single string
- any single string

This patch add one more mode - any multi string.

Signed-off-by: Piotr Azarewicz 
---
 app/test/test_cmdline_string.c|9 ---
 lib/librte_cmdline/cmdline_parse.c|8 ++
 lib/librte_cmdline/cmdline_parse.h|3 +++
 lib/librte_cmdline/cmdline_parse_string.c |   41 -
 lib/librte_cmdline/cmdline_parse_string.h |2 ++
 5 files changed, 48 insertions(+), 15 deletions(-)

diff --git a/app/test/test_cmdline_string.c b/app/test/test_cmdline_string.c
index 915a7d7..96f0e20 100644
--- a/app/test/test_cmdline_string.c
+++ b/app/test/test_cmdline_string.c
@@ -97,6 +97,11 @@ struct string_parse_str string_parse_strs[] = {
{"two with\rgarbage\tcharacters\n",
"one#two with\rgarbage\tcharacters\n#three",
"two with\rgarbage\tcharacters\n"},
+   {"one two", "one", "one"}, /* fixed string */
+   {"one two", TOKEN_STRING_MULTI, "one two"}, /* multi string */
+   {"one two", NULL, "one"}, /* any string */
+   {"one two #three", TOKEN_STRING_MULTI, "one two "},
+   /* multi string with comment */
 };


@@ -124,7 +129,6 @@ struct string_invalid_str string_invalid_strs[] = {
 "toolong!!!toolong!!!toolong!!!toolong!!!toolong!!!toolong!!!"
 "toolong!!!toolong!!!toolong!!!toolong!!!toolong!!!toolong!!!"
 "toolong!!!" },
-{"invalid", ""},
 {"", "invalid"}
 };

@@ -350,8 +354,7 @@ test_parse_string_valid(void)
string_parse_strs[i].str, help_str);
return -1;
}
-   if (strncmp(buf, string_parse_strs[i].result,
-   sizeof(string_parse_strs[i].result) - 1) != 0) {
+   if (strcmp(buf, string_parse_strs[i].result) != 0) {
printf("Error: result mismatch!\n");
return -1;
}
diff --git a/lib/librte_cmdline/cmdline_parse.c 
b/lib/librte_cmdline/cmdline_parse.c
index 24a6ed6..b496067 100644
--- a/lib/librte_cmdline/cmdline_parse.c
+++ b/lib/librte_cmdline/cmdline_parse.c
@@ -118,6 +118,14 @@ cmdline_isendoftoken(char c)
return 0;
 }

+int
+cmdline_isendofcommand(char c)
+{
+   if (!c || iscomment(c) || isendofline(c))
+   return 1;
+   return 0;
+}
+
 static unsigned int
 nb_common_chars(const char * s1, const char * s2)
 {
diff --git a/lib/librte_cmdline/cmdline_parse.h 
b/lib/librte_cmdline/cmdline_parse.h
index 4b25c45..4ac05d6 100644
--- a/lib/librte_cmdline/cmdline_parse.h
+++ b/lib/librte_cmdline/cmdline_parse.h
@@ -184,6 +184,9 @@ int cmdline_complete(struct cmdline *cl, const char *buf, 
int *state,
  * isendofline(c)) */
 int cmdline_isendoftoken(char c);

+/* return true if(!c || iscomment(c) || isendofline(c)) */
+int cmdline_isendofcommand(char c);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/librte_cmdline/cmdline_parse_string.c 
b/lib/librte_cmdline/cmdline_parse_string.c
index 45883b3..274c9a3 100644
--- a/lib/librte_cmdline/cmdline_parse_string.c
+++ b/lib/librte_cmdline/cmdline_parse_string.c
@@ -76,9 +76,10 @@ struct cmdline_token_ops cmdline_token_string_ops = {
.get_help = cmdline_get_help_string,
 };

-#define MULTISTRING_HELP "Mul-choice STRING"
-#define ANYSTRING_HELP   "Any STRING"
-#define FIXEDSTRING_HELP "Fixed STRING"
+#define CHOICESTRING_HELP "Mul-choice STRING"
+#define ANYSTRING_HELP"Any STRING"
+#define ANYSTRINGS_HELP   "Any STRINGS"
+#define FIXEDSTRING_HELP  "Fixed STRING"

 static unsigned int
 get_token_len(const char *s)
@@ -123,8 +124,8 @@ cmdline_parse_string(cmdline_parse_token_hdr_t *tk, const 
char *buf, void *res,

sd = >string_data;

-   /* fixed string */
-   if (sd->str) {
+   /* fixed string (known single token) */
+   if ((sd->str != NULL) && (strcmp(sd->str, TOKEN_STRING_MULTI) != 0)) {
str = sd->str;
do {
token_len = get_token_len(str);
@@ -148,7 +149,18 @@ cmdline_parse_string(cmdline_parse_token_hdr_t *tk, const 
char *buf, void *res,
if (!str)
return -1;
}
-   /* unspecified string */
+   /* multi string */
+   else if (sd->str != NULL) {
+   token_len = 0;
+   while (!cmdline_isendofcommand(buf[token_len]) &&
+ token_len < (ressize - 1))
+   token_len++;
+
+   /* return if token too long */
+   if (token_len >= (ressize - 1))
+   return -1;
+   }
+   /* unspecified string (unknown single token) */
else {
token_len = 0;

[dpdk-dev] [PATCH v2] ivshmem: fix race condition

2016-04-01 Thread Mauricio Vasquez B
The memory zone could be freed just after adding it to the metadata
file and just before marking it as not freeable.
This patch changes the locking logic in order to prevent it.

Fixes: cd10c42eb5bc ("mem: fix ivshmem freeing")

Signed-off-by: Mauricio Vasquez B 
---
 lib/librte_ivshmem/rte_ivshmem.c | 22 +-
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/lib/librte_ivshmem/rte_ivshmem.c b/lib/librte_ivshmem/rte_ivshmem.c
index 8fc4b57..013c3eb 100644
--- a/lib/librte_ivshmem/rte_ivshmem.c
+++ b/lib/librte_ivshmem/rte_ivshmem.c
@@ -471,10 +471,21 @@ add_memzone_to_metadata(const struct rte_memzone * mz,
struct ivshmem_config * config)
 {
struct rte_ivshmem_metadata_entry * entry;
-   unsigned i;
+   unsigned i, idx;
+   struct rte_mem_config *mcfg;
+
+   if(mz->len == 0) {
+   RTE_LOG(ERR, EAL, "Trying to add an empty memzone\n");
+   return -1;
+   }

rte_spinlock_lock(>sl);

+   mcfg = rte_eal_get_configuration()->mem_config;
+
+   /* it prevents the memzone being freed while we add it to the metadata 
*/
+   rte_rwlock_write_lock(>mlock);
+
/* find free slot in this config */
for (i = 0; i < RTE_DIM(config->metadata->entry); i++) {
entry = >metadata->entry[i];
@@ -504,13 +515,6 @@ add_memzone_to_metadata(const struct rte_memzone * mz,
config->metadata->name);
goto fail;
}
-#ifdef RTE_LIBRTE_IVSHMEM
-   struct rte_mem_config *mcfg;
-   unsigned int idx;
-
-   mcfg = rte_eal_get_configuration()->mem_config;
-
-   rte_rwlock_write_lock(>mlock);

idx = ((uintptr_t)mz - (uintptr_t)mcfg->memzone);
idx = idx / sizeof(struct rte_memzone);
@@ -519,10 +523,10 @@ add_memzone_to_metadata(const struct rte_memzone * mz,
mcfg->memzone[idx].ioremap_addr = mz->phys_addr;

rte_rwlock_write_unlock(>mlock);
-#endif
rte_spinlock_unlock(>sl);
return 0;
 fail:
+   rte_rwlock_write_unlock(>mlock);
rte_spinlock_unlock(>sl);
return -1;
 }
-- 
1.9.1



[dpdk-dev] [PATCH] ivshmem: fix race condition

2016-04-01 Thread Mauricio Vásquez
Hi Anatoly,

On Fri, Apr 1, 2016 at 11:01 AM, Burakov, Anatoly  wrote:

> Hi Mauricio,
>
> > The memory zone could be freed just after adding it to the metadata
> > file and just before marking it as not freeable.
> > This patch changes the locking logic in order to prevent it.
>
> Just a nit: if the stated purpose of the patch is to prevent the memzone
> free
> before adding it to metadata, then it probably should check if the memzone
> wasn't freed before we got the lock (or if it's a valid memzone in the
> first place).
> Probably just checking if the virtual address of the memzone isn't 0 would
> be
> enough. Otherwise looks fine to me.
>
>
The purpose of this patch is to avoid a memzone be freed after it has been
added to the metadata but
before it is marked as not freeable. (that small time interval where it is
possible).

Avoid adding an already freed memzone is another case, I will send a v2
that addresses it.
I used the length of the memzone to check whether the memzone is valid or
not.


> Thanks,
> Anatoly
>

Mauricio Vasquez,


[dpdk-dev] [PATCH v2 0/2] Fix parameters and prefetch function on IBM POWER8

2016-04-01 Thread Thomas Monjalon
2016-03-30 23:39, Chao Zhu:
> This patch set fixes CPU/memory parameters and correct wrong prefetch 
> settings for IBM POWER8.
> Changes in v2:
> 1. Move the parameter configuration to POWER specific configuration file
> 2. Remove the memeory channel number constraint instead of adding additional 
> configuration flag.
> 
> Chao Zhu (2):
>   Fix CPU and memory parameters on IBM POWER8
>   Fix prefetch instruction on IBM POWER8

Applied, thanks


[dpdk-dev] [PATCH] igb: fix i350 VF RX issue

2016-04-01 Thread Ananyev, Konstantin


> -Original Message-
> From: Lu, Wenzhuo
> Sent: Friday, April 01, 2016 3:09 AM
> To: dev at dpdk.org
> Cc: Ananyev, Konstantin
> Subject: [PATCH] igb: fix i350 VF RX issue
> 
> A problem is found on i350 VF. We found TX will happen once
> per 4 packets. If only 1~3 packets are received, they will
> not be forwarded. But the real problem is on RX side. The
> reason is the default RX write-back threshold is changed to
> 4, so every first 3 packets may be hung there.
> 
> This patch checks the RX wthresh when setting up the RX
> queue, and forces it to be 1, so every packet can be handled
> immediately.
> 
> Fixes: 4a41c17dba18 (igb: set default thresholds based on MAC type)
> ---
>  drivers/net/e1000/igb_rxtx.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
> index 529dba4..4a987e3 100644
> --- a/drivers/net/e1000/igb_rxtx.c
> +++ b/drivers/net/e1000/igb_rxtx.c
> @@ -1466,7 +1466,8 @@ eth_igb_rx_queue_setup(struct rte_eth_dev *dev,
>   rxq->pthresh = rx_conf->rx_thresh.pthresh;
>   rxq->hthresh = rx_conf->rx_thresh.hthresh;
>   rxq->wthresh = rx_conf->rx_thresh.wthresh;
> - if (rxq->wthresh > 0 && hw->mac.type == e1000_82576)
> + if (rxq->wthresh > 0 &&
> + (hw->mac.type == e1000_82576 || hw->mac.type == e1000_vfadapt_i350))
>   rxq->wthresh = 1;
>   rxq->drop_en = rx_conf->rx_drop_en;
>   rxq->rx_free_thresh = rx_conf->rx_free_thresh;
> --

 Acked-by: Konstantin Ananyev 

> 1.9.3



[dpdk-dev] [PATCH] port: fix source and sink port

2016-04-01 Thread Thomas Monjalon
The title don't talk about pcap. Is it touching only pcap?

2016-04-01 10:55, Fan Zhang:
> Fixes: eb5f411 ("port: add pcap file dump")
> 
> This patch fixes pcap supporting logic. The fix includes:

What was the issue?

> * Adding logic to detect illegal parameter.
> * Clearer error message display.
> * Remove unnecessary RTE_NEXT_ABI macro warping.
> * Code clean-up

Maybe these changes can be split?



[dpdk-dev] [PATCH] doc: update the snow3g library information

2016-04-01 Thread Pablo de Lara
A new process to request the libsso library required by the SNOW3G PMD
has been put in place, through a website, replacing the previous email method.
This commit updates the SNOW3G documentation, to reflect this change.

Since the library does not support newer gcc versions, the documentation
also contains a patch to make the library work with gcc > 5.0.

Signed-off-by: Pablo de Lara 
---
 doc/guides/cryptodevs/snow3g.rst | 41 
 1 file changed, 33 insertions(+), 8 deletions(-)

diff --git a/doc/guides/cryptodevs/snow3g.rst b/doc/guides/cryptodevs/snow3g.rst
index b4c53dc..7e38d20 100644
--- a/doc/guides/cryptodevs/snow3g.rst
+++ b/doc/guides/cryptodevs/snow3g.rst
@@ -57,15 +57,40 @@ Limitations
 Installation
 

-To build DPDK with the SNOW3G_PMD the user is required to get
-the export controlled libsso library, sending a request to
-`DPDKUser_software_access at intel.com`, and compile it
-on their user system before building DPDK:
+To build DPDK with the SNOW3G_PMD the user is required to download
+the export controlled ``libsso`` library, by requesting it from
+``_,
+and compiling it on their system before building DPDK::

-.. code-block:: console
+   make -f Makefile_snow3g

-   make -f Makefile_snow3g
+**Note**: If using a gcc version higher than 5.0, and compilation fails, apply 
the following patch:

-The environmental variable LIBSSO_PATH must be exported with the path
+.. code-block:: diff
+
+   /libsso/src/snow3g/sso_snow3g.c
+
+   static inline void ClockFSM_4(sso_snow3gKeyState4_t *pCtx, __m128i *data)
+   {
+   __m128i F, R;
+   -uint32_t K, L;
+   +uint32_t K;
+   +/* Declare unused if SNOW3G_WSM/SNB are defined */
+   +uint32_t L __attribute__ ((unused)) = 0;
+
+F = _mm_add_epi32(pCtx->LFSR_X[15], pCtx->FSM_X[0]);
+R = _mm_xor_si128(pCtx->LFSR_X[5], pCtx->FSM_X[2]);
+
+   /libsso/include/sso_snow3g_internal.h
+
+   -inline void ClockFSM_1(sso_snow3gKeyState1_t *pCtx, uint32_t *data);
+   -inline void ClockLFSR_1(sso_snow3gKeyState1_t *pCtx);
+   -inline void sso_snow3gStateInitialize_1(sso_snow3gKeyState1_t * pCtx, 
sso_snow3g_key_schedule_t *pKeySched, uint8_t *pIV);
+   +void ClockFSM_1(sso_snow3gKeyState1_t *pCtx, uint32_t *data);
+   +void ClockLFSR_1(sso_snow3gKeyState1_t *pCtx);
+   +void sso_snow3gStateInitialize_1(sso_snow3gKeyState1_t * pCtx, 
sso_snow3g_key_schedule_t *pKeySched, uint8_t *pIV);
+
+
+The environmental variable ``LIBSSO_PATH`` must be exported with the path
 where you extracted and built the libsso library and finally set
-CONFIG_RTE_LIBRTE_PMD_SNOW3G=y in config/common_base.
+``CONFIG_RTE_LIBRTE_PMD_SNOW3G=y`` in ``config/common_base``.
-- 
2.5.5



[dpdk-dev] [PATCH v2] ivshmem: fix race condition

2016-04-01 Thread Burakov, Anatoly
> The memory zone could be freed just after adding it to the metadata
> file and just before marking it as not freeable.
> This patch changes the locking logic in order to prevent it.
> 
> Fixes: cd10c42eb5bc ("mem: fix ivshmem freeing")
> 
> Signed-off-by: Mauricio Vasquez B
> 
> ---
>  lib/librte_ivshmem/rte_ivshmem.c | 22 +-
>  1 file changed, 13 insertions(+), 9 deletions(-)
> 
> diff --git a/lib/librte_ivshmem/rte_ivshmem.c
> b/lib/librte_ivshmem/rte_ivshmem.c
> index 8fc4b57..013c3eb 100644
> --- a/lib/librte_ivshmem/rte_ivshmem.c
> +++ b/lib/librte_ivshmem/rte_ivshmem.c
> @@ -471,10 +471,21 @@ add_memzone_to_metadata(const struct
> rte_memzone * mz,
>   struct ivshmem_config * config)
>  {
>   struct rte_ivshmem_metadata_entry * entry;
> - unsigned i;
> + unsigned i, idx;
> + struct rte_mem_config *mcfg;
> +
> + if(mz->len == 0) {
> + RTE_LOG(ERR, EAL, "Trying to add an empty memzone\n");
> + return -1;
> + }
> 
>   rte_spinlock_lock(>sl);
> 
> + mcfg = rte_eal_get_configuration()->mem_config;
> +
> + /* it prevents the memzone being freed while we add it to the
> metadata */
> + rte_rwlock_write_lock(>mlock);
> +
>   /* find free slot in this config */
>   for (i = 0; i < RTE_DIM(config->metadata->entry); i++) {
>   entry = >metadata->entry[i];
> @@ -504,13 +515,6 @@ add_memzone_to_metadata(const struct
> rte_memzone * mz,
>   config->metadata->name);
>   goto fail;
>   }
> -#ifdef RTE_LIBRTE_IVSHMEM
> - struct rte_mem_config *mcfg;
> - unsigned int idx;
> -
> - mcfg = rte_eal_get_configuration()->mem_config;
> -
> - rte_rwlock_write_lock(>mlock);
> 
>   idx = ((uintptr_t)mz - (uintptr_t)mcfg->memzone);
>   idx = idx / sizeof(struct rte_memzone);
> @@ -519,10 +523,10 @@ add_memzone_to_metadata(const struct
> rte_memzone * mz,
>   mcfg->memzone[idx].ioremap_addr = mz->phys_addr;
> 
>   rte_rwlock_write_unlock(>mlock);
> -#endif
>   rte_spinlock_unlock(>sl);
>   return 0;
>  fail:
> + rte_rwlock_write_unlock(>mlock);
>   rte_spinlock_unlock(>sl);
>   return -1;
>  }
> --
> 1.9.1

Acked-by: Anatoly  Burakov 


[dpdk-dev] [PATCH] examples/ip_pipeline: fix pcap file parsing

2016-04-01 Thread Fan Zhang
Fixes: fe5d046 ("examples/ip_pipeline: add pcap file dump")

This patch fixes the pcap file parsing in ip_pipeline. Originally, the
parser recognizes the pcap related entries regardless of the RTE_PORT_PCAP
macro definition status.

Signed-off-by: Fan Zhang 
Acked-by: Cristian Dumitrescu 
---
 examples/ip_pipeline/config_parse.c | 90 ++---
 1 file changed, 74 insertions(+), 16 deletions(-)

diff --git a/examples/ip_pipeline/config_parse.c 
b/examples/ip_pipeline/config_parse.c
index 152889d..e83f1d6 100644
--- a/examples/ip_pipeline/config_parse.c
+++ b/examples/ip_pipeline/config_parse.c
@@ -989,11 +989,6 @@ parse_pipeline_pcap_source(struct app_params *app,
if (p->n_pktq_in == 0)
return -EINVAL;

-   for (i = 0; i < p->n_pktq_in; i++) {
-   if (p->pktq_in[i].type != APP_PKTQ_IN_SOURCE)
-   return -EINVAL;
-   }
-
i = 0;
while (*next != '\0') {
uint32_t id;
@@ -1068,11 +1063,6 @@ parse_pipeline_pcap_sink(struct app_params *app,
if (p->n_pktq_out == 0)
return -EINVAL;

-   for (i = 0; i < p->n_pktq_out; i++) {
-   if (p->pktq_out[i].type != APP_PKTQ_OUT_SINK)
-   return -EINVAL;
-   }
-
i = 0;
while (*next != '\0') {
uint32_t id;
@@ -1478,7 +1468,13 @@ parse_pipeline(struct app_params *app,
}

if (strcmp(ent->name, "pcap_file_rd") == 0) {
-   int status = parse_pipeline_pcap_source(app,
+   int status;
+
+#ifndef RTE_PORT_PCAP
+   PARSE_ERROR_INVALID(0, section_name, ent->name);
+#endif
+
+   status = parse_pipeline_pcap_source(app,
param, ent->value, NULL);

PARSE_ERROR((status == 0), section_name,
@@ -1487,7 +1483,13 @@ parse_pipeline(struct app_params *app,
}

if (strcmp(ent->name, "pcap_bytes_rd_per_pkt") == 0) {
-   int status = parse_pipeline_pcap_source(app,
+   int status;
+
+#ifndef RTE_PORT_PCAP
+   PARSE_ERROR_INVALID(0, section_name, ent->name);
+#endif
+
+   status = parse_pipeline_pcap_source(app,
param, NULL, ent->value);

PARSE_ERROR((status == 0), section_name,
@@ -1496,7 +1498,13 @@ parse_pipeline(struct app_params *app,
}

if (strcmp(ent->name, "pcap_file_wr") == 0) {
-   int status = parse_pipeline_pcap_sink(app, param,
+   int status;
+
+#ifndef RTE_PORT_PCAP
+   PARSE_ERROR_INVALID(0, section_name, ent->name);
+#endif
+
+   status = parse_pipeline_pcap_sink(app, param,
ent->value, NULL);

PARSE_ERROR((status == 0), section_name,
@@ -1505,7 +1513,13 @@ parse_pipeline(struct app_params *app,
}

if (strcmp(ent->name, "pcap_n_pkt_wr") == 0) {
-   int status = parse_pipeline_pcap_sink(app, param,
+   int status;
+
+#ifndef RTE_PORT_PCAP
+   PARSE_ERROR_INVALID(0, section_name, ent->name);
+#endif
+
+   status = parse_pipeline_pcap_sink(app, param,
NULL, ent->value);

PARSE_ERROR((status == 0), section_name,
@@ -2163,6 +2177,8 @@ parse_source(struct app_params *app,
struct rte_cfgfile_entry *entries;
int n_entries, i;
ssize_t param_idx;
+   uint32_t pcap_file_present = 0;
+   uint32_t pcap_size_present = 0;

n_entries = rte_cfgfile_section_num_entries(cfg, section_name);
PARSE_ERROR_SECTION_NO_ENTRIES((n_entries > 0), section_name);
@@ -2205,18 +2221,31 @@ parse_source(struct app_params *app,
}

if (strcmp(ent->name, "pcap_file_rd")) {
+   PARSE_ERROR_DUPLICATE((pcap_file_present == 0),
+   section_name, ent->name);
+
param->file_name = strdup(ent->value);

PARSE_ERROR_MALLOC(param->file_name != NULL);
+   pcap_file_present = 1;
+
continue;
}

if (strcmp(ent->name, "pcap_bytes_rd_per_pkt") == 0) {
-   int status = parser_read_uint32(
+   int status;
+
+   PARSE_ERROR_DUPLICATE((pcap_size_present == 0),
+   section_name, ent->name);
+
+   status = parser_read_uint32(
>n_bytes_per_pkt, ent->value);

PARSE_ERROR((status == 0), section_name,
ent->name);
+  

[dpdk-dev] [PATCH] port: fix source and sink port

2016-04-01 Thread Fan Zhang
Fixes: eb5f411 ("port: add pcap file dump")

This patch fixes pcap supporting logic. The fix includes:

* Adding logic to detect illegal parameter.
* Clearer error message display.
* Remove unnecessary RTE_NEXT_ABI macro warping.
* Code clean-up

Signed-off-by: Fan Zhang 
Acked-by: Cristian Dumitrescu 
---
 lib/librte_port/Makefile   |   4 -
 lib/librte_port/rte_port_source_sink.c | 322 +
 mk/rte.app.mk  |   2 -
 3 files changed, 122 insertions(+), 206 deletions(-)

diff --git a/lib/librte_port/Makefile b/lib/librte_port/Makefile
index 0b31c04..061226a 100644
--- a/lib/librte_port/Makefile
+++ b/lib/librte_port/Makefile
@@ -36,14 +36,10 @@ include $(RTE_SDK)/mk/rte.vars.mk
 #
 LIB = librte_port.a

-ifeq ($(CONFIG_RTE_NEXT_ABI),y)
-
 ifeq ($(CONFIG_RTE_PORT_PCAP),y)
 LDLIBS += -lpcap
 endif

-endif
-
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)

diff --git a/lib/librte_port/rte_port_source_sink.c 
b/lib/librte_port/rte_port_source_sink.c
index 05620d6..056c975 100644
--- a/lib/librte_port/rte_port_source_sink.c
+++ b/lib/librte_port/rte_port_source_sink.c
@@ -36,11 +36,10 @@
 #include 
 #include 
 #include 
+#include 

 #ifdef RTE_NEXT_ABI

-#include 
-
 #ifdef RTE_PORT_PCAP
 #include 
 #include 
@@ -74,39 +73,24 @@ struct rte_port_source {

struct rte_mempool *mempool;

-#ifdef RTE_NEXT_ABI
-   /* PCAP buffers and indexes */
+   /* PCAP buffers and indices */
uint8_t **pkts;
uint8_t *pkt_buff;
uint32_t *pkt_len;
uint32_t n_pkts;
uint32_t pkt_index;
-#endif
 };

 #ifdef RTE_NEXT_ABI

 #ifdef RTE_PORT_PCAP

-/**
- * Load PCAP file, allocate and copy packets in the file to memory
- *
- * @param p
- *   Parameters for source port
- * @param port
- *   Handle to source port
- * @param socket_id
- *   Socket id where the memory is created
- * @return
- *   0 on SUCCESS
- *   error code otherwise
- */
 static int
-pcap_source_load(struct rte_port_source_params *p,
-   struct rte_port_source *port,
+pcap_source_load(struct rte_port_source *port,
+   const char *file_name,
+   uint32_t n_bytes_per_pkt,
int socket_id)
 {
-   uint32_t status = 0;
uint32_t n_pkts = 0;
uint32_t i;
uint32_t *pkt_len_aligns = NULL;
@@ -121,18 +105,16 @@ pcap_source_load(struct rte_port_source_params *p,
(rte_pktmbuf_data_room_size(port->mempool) -
RTE_PKTMBUF_HEADROOM);

-   if (p->file_name == NULL)
-   return 0;
-
-   if (p->n_bytes_per_pkt == 0)
+   if (n_bytes_per_pkt == 0)
max_len = pktmbuf_maxlen;
else
-   max_len = RTE_MIN(p->n_bytes_per_pkt, pktmbuf_maxlen);
+   max_len = RTE_MIN(n_bytes_per_pkt, pktmbuf_maxlen);

/* first time open, get packet number */
-   pcap_handle = pcap_open_offline(p->file_name, pcap_errbuf);
+   pcap_handle = pcap_open_offline(file_name, pcap_errbuf);
if (pcap_handle == NULL) {
-   status = -ENOENT;
+   RTE_LOG(ERR, PORT, "Failed to open pcap file "
+   "'%s' for reading\n", file_name);
goto error_exit;
}

@@ -144,28 +126,29 @@ pcap_source_load(struct rte_port_source_params *p,
port->pkt_len = rte_zmalloc_socket("PCAP",
(sizeof(*port->pkt_len) * n_pkts), 0, socket_id);
if (port->pkt_len == NULL) {
-   status = -ENOMEM;
+   RTE_LOG(ERR, PORT, "No enough memory\n");
goto error_exit;
}

pkt_len_aligns = rte_malloc("PCAP",
(sizeof(*pkt_len_aligns) * n_pkts), 0);
if (pkt_len_aligns == NULL) {
-   status = -ENOMEM;
+   RTE_LOG(ERR, PORT, "No enough memory\n");
goto error_exit;
}

port->pkts = rte_zmalloc_socket("PCAP",
(sizeof(*port->pkts) * n_pkts), 0, socket_id);
if (port->pkts == NULL) {
-   status = -ENOMEM;
+   RTE_LOG(ERR, PORT, "No enough memory\n");
goto error_exit;
}

/* open 2nd time, get pkt_len */
-   pcap_handle = pcap_open_offline(p->file_name, pcap_errbuf);
+   pcap_handle = pcap_open_offline(file_name, pcap_errbuf);
if (pcap_handle == NULL) {
-   status = -ENOENT;
+   RTE_LOG(ERR, PORT, "Failed to open pcap file "
+   "'%s' for reading\n", file_name);
goto error_exit;
}

@@ -183,16 +166,17 @@ pcap_source_load(struct rte_port_source_params *p,
buff = rte_zmalloc_socket("PCAP",
total_buff_len, 0, socket_id);
if (buff == NULL) {
-   status = -ENOMEM;
+   RTE_LOG(ERR, PORT, "No enough memory\n");
goto error_exit;
}

port->pkt_buff = buff;

/* open file one last time to 

[dpdk-dev] [PATCH] i40evf: fix link info update

2016-04-01 Thread Thomas Monjalon
Hi Jingjing,

Please rebase on top of Marc's patches.

2016-04-01 09:36, Jingjing Wu:
> +* **i40e: Fixed link info of VF

a blank line is missing

> +  Previously, the VF's link speed kept as 10G and status always was up. It 
> did not
> +  change even the physical link's status changed. Now this issue is fixed to 
> make
> +  VF's link info consistent with physical link.

[...]
> + new_link.link_speed = ETH_LINK_SPEED_100;
> + break;
> + case I40E_LINK_SPEED_1GB:
> + new_link.link_speed = ETH_LINK_SPEED_1000;

These speeds have new names after Marc's rework.

> + new_link.link_status = vf->link_up ? 1 : 0;

Please use new constants for link up and down.



[dpdk-dev] Question about cd10c42eb5bc ("mem: fix ivshmem freeing")

2016-04-01 Thread Mauricio Vásquez
Sure: http://dpdk.org/ml/archives/dev/2016-April/036884.html,

On Wed, Mar 30, 2016 at 2:10 PM, Burakov, Anatoly  wrote:

> Hi Mauricio,
>
>
>
> Good points. Would you be willing to prepare a patch to fix these issues?
>
>
>
> Thanks,
>
> Anatoly
>
>
>
> *From:* Mauricio V?squez [mailto:mauricio.vasquezbernal at studenti.polito.it]
>
> *Sent:* Wednesday, March 30, 2016 10:13 AM
> *To:* Burakov, Anatoly 
> *Cc:* dev at dpdk.org; Gonzalez Monroy, Sergio <
> sergio.gonzalez.monroy at intel.com>; Richardson, Bruce <
> bruce.richardson at intel.com>
> *Subject:* Re: Question about cd10c42eb5bc ("mem: fix ivshmem freeing")
>
>
>
> Hi Anatoly,
>
> Thank you very much, I did not take into account that detail.
>
> I have two additional concerns about it:
>
> 1. I think it is possible to have a race condition. The memzone is marked
> as not freeable after it has been added to the ivshmem device, then it is
> possible to free the memzone just after it has been  added to the metadata
> but before it is marked as not freeable.
>
> Shouldn't the memzone be marked before adding the memzone to the ivshmem
> device?
>
>
>
> 2. Are the #ifdefs necessary?, we already are in  a file that will only
> compiled when ivshmem is enabled.
>
> Thanks,
>
> Mauricio Vasquez,
>
>
>
>
>
> On Wed, Mar 30, 2016 at 10:29 AM, Burakov, Anatoly <
> anatoly.burakov at intel.com> wrote:
>
> Hi Mauricio,
>
>
>
> You?re not missing anything. It would be done this way, if the memzone
> parameter wasn?t const. But it is const, so we have to find the memzone in
> config to edit it.
>
>
>
> Thanks,
>
> Anatoly
>
>
>
> *From:* Mauricio V?squez [mailto:mauricio.vasquezbernal at studenti.polito.it]
>
> *Sent:* Wednesday, March 30, 2016 9:22 AM
> *To:* dev at dpdk.org
> *Cc:* Gonzalez Monroy, Sergio ;
> Richardson, Bruce ; Burakov, Anatoly <
> anatoly.burakov at intel.com>
> *Subject:* Question about cd10c42eb5bc ("mem: fix ivshmem freeing")
>
>
>
> Dear All,
>
> I was looking at that patch, I can understand its functionality but not
> its implementation..
>
> Why to calculate idx?, Just doing "mz->ioremap_addr = mz->phys_addr" would
> not be sufficient? After all, the goal is to mark the memzone as used by
> ivshmem to forbid  freeing it.
>
> Please corrected if I am missing something.
>
> Thank you,
>
> Mauricio Vasquez,
>
>
>


[dpdk-dev] [PATCH v2 3/4] bnx2x: Enhance stats get routine

2016-04-01 Thread Thomas Monjalon
2016-03-31 17:15, Rasesh Mody:
> Enhance the stats_get() routine to display drop counters under the
> control of a debug flag.

Why printing the stats in stats_get?
These stats should be returned in xstats.



[dpdk-dev] [PATCH] ivshmem: fix race condition

2016-04-01 Thread Mauricio Vasquez B
The memory zone could be freed just after adding it to the metadata
file and just before marking it as not freeable.
This patch changes the locking logic in order to prevent it.

Fixes: cd10c42eb5bc ("mem: fix ivshmem freeing")

Signed-off-by: Mauricio Vasquez B 
---
 lib/librte_ivshmem/rte_ivshmem.c | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/lib/librte_ivshmem/rte_ivshmem.c b/lib/librte_ivshmem/rte_ivshmem.c
index 8fc4b57..ed2c276 100644
--- a/lib/librte_ivshmem/rte_ivshmem.c
+++ b/lib/librte_ivshmem/rte_ivshmem.c
@@ -471,10 +471,16 @@ add_memzone_to_metadata(const struct rte_memzone * mz,
struct ivshmem_config * config)
 {
struct rte_ivshmem_metadata_entry * entry;
-   unsigned i;
+   unsigned i, idx;
+   struct rte_mem_config *mcfg;

rte_spinlock_lock(>sl);

+   mcfg = rte_eal_get_configuration()->mem_config;
+
+   /* it prevents the memzone being freed while we add it to the metadata 
*/
+   rte_rwlock_write_lock(>mlock);
+
/* find free slot in this config */
for (i = 0; i < RTE_DIM(config->metadata->entry); i++) {
entry = >metadata->entry[i];
@@ -504,13 +510,6 @@ add_memzone_to_metadata(const struct rte_memzone * mz,
config->metadata->name);
goto fail;
}
-#ifdef RTE_LIBRTE_IVSHMEM
-   struct rte_mem_config *mcfg;
-   unsigned int idx;
-
-   mcfg = rte_eal_get_configuration()->mem_config;
-
-   rte_rwlock_write_lock(>mlock);

idx = ((uintptr_t)mz - (uintptr_t)mcfg->memzone);
idx = idx / sizeof(struct rte_memzone);
@@ -519,10 +518,10 @@ add_memzone_to_metadata(const struct rte_memzone * mz,
mcfg->memzone[idx].ioremap_addr = mz->phys_addr;

rte_rwlock_write_unlock(>mlock);
-#endif
rte_spinlock_unlock(>sl);
return 0;
 fail:
+   rte_rwlock_write_unlock(>mlock);
rte_spinlock_unlock(>sl);
return -1;
 }
-- 
1.9.1



[dpdk-dev] [PATCH] igb: fix i350 VF RX issue

2016-04-01 Thread Wenzhuo Lu
A problem is found on i350 VF. We found TX will happen once
per 4 packets. If only 1~3 packets are received, they will
not be forwarded. But the real problem is on RX side. The
reason is the default RX write-back threshold is changed to
4, so every first 3 packets may be hung there.

This patch checks the RX wthresh when setting up the RX
queue, and forces it to be 1, so every packet can be handled
immediately.

Fixes: 4a41c17dba18 (igb: set default thresholds based on MAC type)
---
 drivers/net/e1000/igb_rxtx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index 529dba4..4a987e3 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -1466,7 +1466,8 @@ eth_igb_rx_queue_setup(struct rte_eth_dev *dev,
rxq->pthresh = rx_conf->rx_thresh.pthresh;
rxq->hthresh = rx_conf->rx_thresh.hthresh;
rxq->wthresh = rx_conf->rx_thresh.wthresh;
-   if (rxq->wthresh > 0 && hw->mac.type == e1000_82576)
+   if (rxq->wthresh > 0 &&
+   (hw->mac.type == e1000_82576 || hw->mac.type == e1000_vfadapt_i350))
rxq->wthresh = 1;
rxq->drop_en = rx_conf->rx_drop_en;
rxq->rx_free_thresh = rx_conf->rx_free_thresh;
-- 
1.9.3



[dpdk-dev] [PATCH v13 6/8] ethdev: redesign link speed config

2016-04-01 Thread Xing, Beilei
> -Original Message-
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Thursday, March 31, 2016 8:29 PM
> To: Xing, Beilei 
> Cc: dev at dpdk.org; Marc ; Xu, Qian Q
> ; Ananyev, Konstantin  intel.com>;
> Lu, Wenzhuo ; Richardson, Bruce
> ; Glynn, Michael J  intel.com>
> Subject: Re: [dpdk-dev] [PATCH v13 6/8] ethdev: redesign link speed config
> 
> 2016-03-31 00:57, Xing, Beilei:
> > I?ve verified v13 + the modification, and it works.
> 
> Please, what have you tested? Which drivers? Which configurations?
> 
> It is important to test several uses of rte_eth_conf.link_speeds:
> - ETH_LINK_SPEED_AUTONEG (all speeds)
> - ETH_LINK_SPEED_FIXED (only one speed)
> - a subset of speeds to advertise and negotiate

I tested basic tx/rx on ixgbe and autoneg only on ixgbe.
I'll comment in another mail later, sorry for inconvenience.


[dpdk-dev] [PATCH] i40evf: fix link info update

2016-04-01 Thread Jingjing Wu
The issue is the VF's link speed kept as 10G and status always was up.
It did not change even the physical link's status changed.
This patch fixes this issue to make VF's link info consistent with
physical link.

Fixes: 4861cde46116 (i40e: new poll mode driver)
Signed-off-by: Jingjing Wu 
---
 doc/guides/rel_notes/release_16_04.rst |  5 +
 drivers/net/i40e/i40e_ethdev.h |  1 +
 drivers/net/i40e/i40e_ethdev_vf.c  | 33 +
 3 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/doc/guides/rel_notes/release_16_04.rst 
b/doc/guides/rel_notes/release_16_04.rst
index 79d76e1..b44a02f 100644
--- a/doc/guides/rel_notes/release_16_04.rst
+++ b/doc/guides/rel_notes/release_16_04.rst
@@ -366,6 +366,11 @@ Drivers
   info for l3fwd to work well. Now there is an option for l3fwd to analysis
   packet type softly, so enable vector driver by default.

+* **i40e: Fixed link info of VF
+  Previously, the VF's link speed kept as 10G and status always was up. It did 
not
+  change even the physical link's status changed. Now this issue is fixed to 
make
+  VF's link info consistent with physical link.
+
 * **mlx5: Fixed possible crash during initialization.**

   A crash could occur when failing to allocate private device context.
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index ce945fe..cfd2399 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -502,6 +502,7 @@ struct i40e_vf {
/* Event from pf */
bool dev_closed;
bool link_up;
+   enum i40e_aq_link_speed link_speed;
bool vf_reset;
volatile uint32_t pend_cmd; /* pending command not finished yet */
uint32_t cmd_retval; /* return value of the cmd response from PF */
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c 
b/drivers/net/i40e/i40e_ethdev_vf.c
index a13d9cc..71af0f7 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -258,6 +258,8 @@ i40evf_read_pfmsg(struct rte_eth_dev *dev, struct 
i40evf_arq_msg_info *data)
case I40E_VIRTCHNL_EVENT_LINK_CHANGE:
vf->link_up =
vpe->event_data.link_event.link_status;
+   vf->link_speed =
+   vpe->event_data.link_event.link_speed;
vf->pend_msg |= PFMSG_LINK_CHANGE;
PMD_DRV_LOG(INFO, "Link status update:%s",
vf->link_up ? "up" : "down");
@@ -1310,6 +1312,7 @@ i40evf_handle_pf_event(__rte_unused struct rte_eth_dev 
*dev,
 {
struct i40e_virtchnl_pf_event *pf_msg =
(struct i40e_virtchnl_pf_event *)msg;
+   struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);

switch (pf_msg->event) {
case I40E_VIRTCHNL_EVENT_RESET_IMPENDING:
@@ -1318,6 +1321,8 @@ i40evf_handle_pf_event(__rte_unused struct rte_eth_dev 
*dev,
break;
case I40E_VIRTCHNL_EVENT_LINK_CHANGE:
PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_LINK_CHANGE event\n");
+   vf->link_up = pf_msg->event_data.link_event.link_status;
+   vf->link_speed = pf_msg->event_data.link_event.link_speed;
break;
case I40E_VIRTCHNL_EVENT_PF_DRIVER_CLOSE:
PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_PF_DRIVER_CLOSE event\n");
@@ -2124,10 +2129,30 @@ i40evf_dev_link_update(struct rte_eth_dev *dev,
if (vf->version_major == I40E_DPDK_VERSION_MAJOR)
i40evf_get_link_status(dev, _link);
else {
-   /* Always assume it's up, for Linux driver PF host */
-   new_link.link_duplex = ETH_LINK_AUTONEG_DUPLEX;
-   new_link.link_speed  = ETH_LINK_SPEED_1;
-   new_link.link_status = 1;
+   /* Linux driver PF host */
+   switch (vf->link_speed) {
+   case I40E_LINK_SPEED_100MB:
+   new_link.link_speed = ETH_LINK_SPEED_100;
+   break;
+   case I40E_LINK_SPEED_1GB:
+   new_link.link_speed = ETH_LINK_SPEED_1000;
+   break;
+   case I40E_LINK_SPEED_10GB:
+   new_link.link_speed = ETH_LINK_SPEED_10G;
+   break;
+   case I40E_LINK_SPEED_20GB:
+   new_link.link_speed = ETH_LINK_SPEED_20G;
+   break;
+   case I40E_LINK_SPEED_40GB:
+   new_link.link_speed = ETH_LINK_SPEED_40G;
+   break;
+   default:
+   new_link.link_speed = ETH_LINK_SPEED_100;
+   break;
+   }
+   /* full duplex only */
+   new_link.link_duplex = ETH_LINK_FULL_DUPLEX;
+   new_link.link_status = vf->link_up ? 1 : 0;
}

[dpdk-dev] [PATCH v2 0/7] Various fixes to compile with gcc6

2016-04-01 Thread Panu Matilainen
On 03/31/2016 06:02 PM, Thomas Monjalon wrote:
> 2016-03-22 17:37, Aaron Conole:
>> This series brings a number of code cleanups to allow building using gcc6,
>> with various legitimate warnings being fixed.
>>
>> Some of these fixes are to the drivers area, making this series a bit
>> atypical. However, the fixes identified in patches 2 and 3 are actual
>> bugs and should be fixed.
>>
>> The first patch from the original series has been dropped. It is no
>> longer needed, after commit 5ecdeba601d1 ("lpm: merge tbl24 and tbl8
>> structures").
>>
>>
>> Aaron Conole (7):
>>app/test/test: Fix missing brackets
>>drivers/net/e1000: Fix missing brackets
>>drivers/net/e1000: Fix missing lsc interrupt check brackets
>>drivers/net/ixgbe: Fix vlan filter missing brackets
>>drivers/net/e1000/igb: Signed left shift operator
>>drivers/net/ixgbe: Signed left shift operator
>>drivers/net/ixgbe: Fix uninitialized warning
>
> Applied with v3 of patch 2, thanks
>

...and so we finally have a warning-free build with gcc 6.

Thanks,

- Panu -


[dpdk-dev] [PATCH] ivshmem: fix race condition

2016-04-01 Thread Burakov, Anatoly
Hi Mauricio,

> The memory zone could be freed just after adding it to the metadata
> file and just before marking it as not freeable.
> This patch changes the locking logic in order to prevent it.

Just a nit: if the stated purpose of the patch is to prevent the memzone free
before adding it to metadata, then it probably should check if the memzone
wasn't freed before we got the lock (or if it's a valid memzone in the first 
place).
Probably just checking if the virtual address of the memzone isn't 0 would be
enough. Otherwise looks fine to me.

Thanks,
Anatoly


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

2016-04-01 Thread Stephen Hemminger
On Thu, 31 Mar 2016 19:15:17 -0700
Rasesh Mody  wrote:

> Hi Thomas, Bruce,
> 
> The v5 series incorporates the following review comments:
>  - move adapter_info logs under debug
>  - implement qede_mac_addr_remove()
>  - remove unused rc variable in qede_dev_configure()
>  - fix indentation in qede_dev_info_get()
>  - use c99 style struct init in qede_config_accept_any_vlan()
>  - check error in qede_config_rx_mode()
>  - update overview.rst since patch didn't apply
> 
> The patches are generated and tested against latest dpdk based off of
> v16.04-rc2.
> 
> These patches are checked using checkpatch.sh with following additional
> ignore option:
>options="$options --ignore=BIT_MACRO,CONCATENATED_STRING"
> 
> Please apply!

Looks good.

One question, is there any restriction on number of Tx queues, relative
to number of Rx queues.  Is it possible to have 8 Tx queues but only 2 Rx 
queues?
I know bnx2x and some other drivers have that kind of restriction.

Acked-by: Stephen Hemminger 


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

2016-04-01 Thread Stephen Hemminger
On Thu, 31 Mar 2016 19:15:22 -0700
Rasesh Mody  wrote:

> +struct qed_filter_mcast_params {
> + enum qed_filter_xcast_params_type type;
> + uint8_t num;
> + unsigned char mac[64][ETHER_ADDR_LEN];
> +};

Would prefer a #define constant for the maximum number of multicast
addresses rather than magic number of 64.


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

2016-04-01 Thread Stephen Hemminger
On Thu, 31 Mar 2016 19:15:22 -0700
Rasesh Mody  wrote:

> +struct qed_filter_ucast_params {
> + enum qed_filter_xcast_params_type type;
> + uint8_t vlan_valid;
> + uint16_t vlan;
> + uint8_t mac_valid;
> + unsigned char mac[ETHER_ADDR_LEN];
> +} __attribute__ ((__packed__));

Why packed? Why not just rearrange elements to eliminate the padding holes?


[dpdk-dev] [PATCH] bonding: fix bond link detect in non-interrupt mode

2016-04-01 Thread Doherty, Declan
> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of John Daley
> Sent: Saturday, March 26, 2016 12:45 AM
> To: dev at dpdk.org
> Cc: Nelson Escobar ; John Daley 
> Subject: [dpdk-dev] [PATCH] bonding: fix bond link detect in non-interrupt 
> mode
> 
> From: Nelson Escobar 
> 
> Stopping then re-starting a bond interface containing slaves that
> used polling for link detection caused the bond to think all slave
> links were down and inactive.
> 
> Move the start of the polling for link from slave_add() to
> bond_ethdev_start() and in bond_ethdev_stop() make sure we clear
> the last_link_status of the slaves.
> 
> Signed-off-by: Nelson Escobar 
> Signed-off-by: John Daley 
> ---
.
> --
> 2.7.0

Acked-by: Declan Doherty 


[dpdk-dev] [PATCH] igb: change default RX wthresh back

2016-04-01 Thread Lu, Wenzhuo
Hi Konstantin,

> -Original Message-
> From: Ananyev, Konstantin
> Sent: Thursday, March 31, 2016 3:30 PM
> To: Lu, Wenzhuo; dev at dpdk.org
> Cc: Lu, Wenzhuo
> Subject: RE: [dpdk-dev] [PATCH] igb: change default RX wthresh back
> 
> 
> Hi Wenzhuo,
> >
> > A problem is found on i350 VF. TX will happen once per 4 packets. If
> > only 1~3 packets are received, they will not be forwarded.
> >
> > The reason is the default RX write-back threshold is changed to 4.
> > This patch changes the value back to 0, so every packet can be handled
> > immediately.
> >
> > Fixes: 4a41c17dba18 (igb: set default thresholds based on MAC type)
> > Signed-off-by: Wenzhuo Lu 
> > ---
> >  drivers/net/e1000/igb_ethdev.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/e1000/igb_ethdev.c
> > b/drivers/net/e1000/igb_ethdev.c index bd0ae26..34120ae 100644
> > --- a/drivers/net/e1000/igb_ethdev.c
> > +++ b/drivers/net/e1000/igb_ethdev.c
> > @@ -64,7 +64,7 @@
> >
> >  #define IGB_DEFAULT_RX_PTHRESH  ((hw->mac.type == e1000_i354) ? 12 :
> 8)
> >  #define IGB_DEFAULT_RX_HTHRESH  8
> > -#define IGB_DEFAULT_RX_WTHRESH  ((hw->mac.type == e1000_82576) ?
> 1 : 4)
> > +#define IGB_DEFAULT_RX_WTHRESH  0
> 
> But that still doesn't prevent user from setting wthresh to whatever he likes
> inside rx_queue_setup(), so the problem persists right?
> As a side notice, it seems really bad practice to use implicit variables 
> inside
> macro definition.
> Konstantin
Yes, you're right. It doesn't prevent the user from changing the value to 
trigger the problem.
I'll withdraw this patch and create another one for this problem. Thanks.

> 
> >
> >  #define IGB_DEFAULT_TX_PTHRESH  ((hw->mac.type == e1000_i354) ? 20 :
> 8)
> >  #define IGB_DEFAULT_TX_HTHRESH  1
> > --
> > 1.9.3



[dpdk-dev] [PATCH 2/3] bnx2x: Tx performance improvement fixes

2016-04-01 Thread Rasesh Mody
Hi Thaomas,

> From: Bruce Richardson [mailto:bruce.richardson at intel.com]
> Sent: Tuesday, March 22, 2016 7:30 AM
> 
> On Thu, Mar 10, 2016 at 05:47:56PM -0800, Rasesh Mody wrote:
> > Signed-off-by: Harish Patil 
> > Signed-off-by: Rasesh Mody 
> > ---
> >  drivers/net/bnx2x/bnx2x.c|  207 +--
> ---
> >  drivers/net/bnx2x/bnx2x.h|4 +-
> >  drivers/net/bnx2x/bnx2x_ethdev.c |   53 ++
> >  drivers/net/bnx2x/bnx2x_rxtx.c   |   47 +
> >  4 files changed, 173 insertions(+), 138 deletions(-)
> >
> This patch needs a commit message with a description of changes and how
> they help with performance.
> 
> If there are multiple changes being made to improve the performance, or
> add in extra TX features, they would be better split into separate patches,
> with one unique change per patch. If any of the changes are bug-fixes as
> opposed to performance improvements (since the word "fixes" appears in
> the title here), they should each be in a separate patch, with a message
> describing the fix and including a "fixes" line in the message as described
> here:
> http://dpdk.org/doc/guides/contributing/patches.html#commit-messages-
> body
> 
> Thanks,
> /Bruce

The feedback is addressed and v2 patches have been submitted. Pls. apply to 
rel_16_04.

Thanks!
Rasesh


[dpdk-dev] [PATCH v14 8/8] ethdev: add 100G link speed

2016-04-01 Thread Marc Sune
From: Thomas Monjalon 

The link speed configuration is now done with bitmaps so 100G speed
requires only a new bit flag.
The actual link speed is a number so its size must be increased from
16-bit to 32-bit.

Signed-off-by: Marc Sune 
Signed-off-by: Thomas Monjalon 
Tested-by: Nelio Laranjeiro 
Tested-by: Matej Vido 
---
 app/test-pmd/cmdline.c  | 12 +++-
 doc/guides/nics/szedata2.rst|  6 --
 doc/guides/rel_notes/release_16_04.rst  |  5 +
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  2 +-
 drivers/net/ena/ena_ethdev.c|  3 ++-
 drivers/net/fm10k/fm10k_ethdev.c|  2 +-
 drivers/net/mlx5/mlx5_ethdev.c  |  3 ++-
 drivers/net/nfp/nfp_net.c   |  2 +-
 drivers/net/szedata2/rte_eth_szedata2.c |  9 ++---
 lib/librte_ether/rte_ethdev.c   |  2 ++
 lib/librte_ether/rte_ethdev.h   |  4 +++-
 11 files changed, 26 insertions(+), 24 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 741cac3..c5b9479 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -549,7 +549,7 @@ static void cmd_help_long_parsed(void *parsed_result,
"Detach physical or virtual dev by port_id\n\n"

"port config (port_id|all)"
-   " speed (10|100|1000|1|4|auto)"
+   " speed (10|100|1000|1|4|10|auto)"
" duplex (half|full|auto)\n"
"Set speed and duplex for all ports or port_id\n\n"

@@ -1022,6 +1022,8 @@ parse_and_check_speed_duplex(char *speedstr, char 
*duplexstr, uint32_t *speed)
*speed = ETH_LINK_SPEED_10G;
} else if (!strcmp(speedstr, "4")) {
*speed = ETH_LINK_SPEED_40G;
+   } else if (!strcmp(speedstr, "10")) {
+   *speed = ETH_LINK_SPEED_100G;
} else if (!strcmp(speedstr, "auto")) {
*speed = ETH_LINK_SPEED_AUTONEG;
} else {
@@ -1069,7 +1071,7 @@ cmdline_parse_token_string_t cmd_config_speed_all_item1 =
TOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, item1, "speed");
 cmdline_parse_token_string_t cmd_config_speed_all_value1 =
TOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, value1,
-   "10#100#1000#1#4#auto");
+   
"10#100#1000#1#4#10#auto");
 cmdline_parse_token_string_t cmd_config_speed_all_item2 =
TOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, item2, "duplex");
 cmdline_parse_token_string_t cmd_config_speed_all_value2 =
@@ -1079,7 +1081,7 @@ cmdline_parse_token_string_t cmd_config_speed_all_value2 =
 cmdline_parse_inst_t cmd_config_speed_all = {
.f = cmd_config_speed_all_parsed,
.data = NULL,
-   .help_str = "port config all speed 10|100|1000|1|4|auto duplex "
+   .help_str = "port config all speed 10|100|1000|1|4|10|auto 
duplex "
"half|full|auto",
.tokens = {
(void *)_config_speed_all_port,
@@ -1143,7 +1145,7 @@ cmdline_parse_token_string_t 
cmd_config_speed_specific_item1 =
"speed");
 cmdline_parse_token_string_t cmd_config_speed_specific_value1 =
TOKEN_STRING_INITIALIZER(struct cmd_config_speed_specific, value1,
-   "10#100#1000#1#4#auto");
+   
"10#100#1000#1#4#10#auto");
 cmdline_parse_token_string_t cmd_config_speed_specific_item2 =
TOKEN_STRING_INITIALIZER(struct cmd_config_speed_specific, item2,
"duplex");
@@ -1154,7 +1156,7 @@ cmdline_parse_token_string_t 
cmd_config_speed_specific_value2 =
 cmdline_parse_inst_t cmd_config_speed_specific = {
.f = cmd_config_speed_specific_parsed,
.data = NULL,
-   .help_str = "port config X speed 10|100|1000|1|4|auto duplex "
+   .help_str = "port config X speed 10|100|1000|1|4|10|auto 
duplex "
"half|full|auto",
.tokens = {
(void *)_config_speed_specific_port,
diff --git a/doc/guides/nics/szedata2.rst b/doc/guides/nics/szedata2.rst
index 77c15b3..741b400 100644
--- a/doc/guides/nics/szedata2.rst
+++ b/doc/guides/nics/szedata2.rst
@@ -148,9 +148,3 @@ Example output:
  TX threshold registers: pthresh=0 hthresh=0 wthresh=0
  TX RS bit threshold=0 - TXQ flags=0x0
testpmd>
-
-.. note::
-
-   Link speed API currently supports speeds up to 40 Gbps.
-   Therefore there is used 10G constant for 100 Gbps cards until the link 

[dpdk-dev] [PATCH v14 7/8] ethdev: convert speed number to bitmap flag

2016-04-01 Thread Marc Sune
It is a helper for the bitmap configuration.

Signed-off-by: Marc Sune 
Signed-off-by: Thomas Monjalon 
---
 lib/librte_ether/rte_ethdev.c  | 31 +++
 lib/librte_ether/rte_ethdev.h  | 13 +
 lib/librte_ether/rte_ether_version.map |  1 +
 3 files changed, 45 insertions(+)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 76a30fd..695b475 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -866,6 +866,37 @@ rte_eth_dev_tx_queue_config(struct rte_eth_dev *dev, 
uint16_t nb_queues)
return 0;
 }

+uint32_t
+rte_eth_speed_bitflag(uint32_t speed, int duplex)
+{
+   switch (speed) {
+   case ETH_SPEED_NUM_10M:
+   return duplex ? ETH_LINK_SPEED_10M : ETH_LINK_SPEED_10M_HD;
+   case ETH_SPEED_NUM_100M:
+   return duplex ? ETH_LINK_SPEED_100M : ETH_LINK_SPEED_100M_HD;
+   case ETH_SPEED_NUM_1G:
+   return ETH_LINK_SPEED_1G;
+   case ETH_SPEED_NUM_2_5G:
+   return ETH_LINK_SPEED_2_5G;
+   case ETH_SPEED_NUM_5G:
+   return ETH_LINK_SPEED_5G;
+   case ETH_SPEED_NUM_10G:
+   return ETH_LINK_SPEED_10G;
+   case ETH_SPEED_NUM_20G:
+   return ETH_LINK_SPEED_20G;
+   case ETH_SPEED_NUM_25G:
+   return ETH_LINK_SPEED_25G;
+   case ETH_SPEED_NUM_40G:
+   return ETH_LINK_SPEED_40G;
+   case ETH_SPEED_NUM_50G:
+   return ETH_LINK_SPEED_50G;
+   case ETH_SPEED_NUM_56G:
+   return ETH_LINK_SPEED_56G;
+   default:
+   return 0;
+   }
+}
+
 int
 rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
  const struct rte_eth_conf *dev_conf)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index b88300d..1342b3a 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1878,6 +1878,19 @@ struct eth_driver {
 void rte_eth_driver_register(struct eth_driver *eth_drv);

 /**
+ * Convert a numerical speed in Mbps to a bitmap flag that can be used in
+ * the bitmap link_speeds of the struct rte_eth_conf
+ *
+ * @param speed
+ *   Numerical speed value in Mbps
+ * @param duplex
+ *   ETH_LINK_[HALF/FULL]_DUPLEX (only for 10/100M speeds)
+ * @return
+ *   0 if the speed cannot be mapped
+ */
+uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex);
+
+/**
  * Configure an Ethernet device.
  * This function must be invoked first before any other function in the
  * Ethernet API. This function can also be re-invoked when a device is in the
diff --git a/lib/librte_ether/rte_ether_version.map 
b/lib/librte_ether/rte_ether_version.map
index b1f4475..214ecc7 100644
--- a/lib/librte_ether/rte_ether_version.map
+++ b/lib/librte_ether/rte_ether_version.map
@@ -125,6 +125,7 @@ DPDK_16.04 {
rte_eth_dev_set_vlan_ether_type;
rte_eth_dev_udp_tunnel_port_add;
rte_eth_dev_udp_tunnel_port_delete;
+   rte_eth_speed_bitflag;
rte_eth_tx_buffer_count_callback;
rte_eth_tx_buffer_drop_callback;
rte_eth_tx_buffer_init;
-- 
2.1.4



[dpdk-dev] [PATCH v14 6/8] ethdev: redesign link speed config

2016-04-01 Thread Marc Sune
This patch redesigns the API to set the link speed/s configuration
of an ethernet port. Specifically:

- it allows to define a set of advertised speeds for
  auto-negociation.
- it allows to disable link auto-negociation (single fixed speed).
- default: auto-negociate all supported speeds.

A flag autoneg in struct rte_eth_link indicates if link speed was a
result of auto-negociation or was fixed by configuration.

Signed-off-by: Marc Sune 
Tested-by: Nelio Laranjeiro 
Signed-off-by: Thomas Monjalon 
---
 app/test-pmd/cmdline.c|  26 
 doc/guides/rel_notes/deprecation.rst  |   3 -
 doc/guides/rel_notes/release_16_04.rst|   9 +++
 drivers/net/af_packet/rte_eth_af_packet.c |   1 +
 drivers/net/bnx2x/bnx2x_ethdev.c  |   4 +-
 drivers/net/bonding/rte_eth_bond_8023ad.c |   2 +-
 drivers/net/e1000/em_ethdev.c | 103 +++---
 drivers/net/e1000/igb_ethdev.c|  95 ++-
 drivers/net/i40e/i40e_ethdev.c|  48 +++---
 drivers/net/i40e/i40e_ethdev_vf.c |   7 +-
 drivers/net/ixgbe/ixgbe_ethdev.c  |  53 ---
 drivers/net/mlx4/mlx4.c   |   2 +
 drivers/net/mlx5/mlx5_ethdev.c|   2 +
 drivers/net/mpipe/mpipe_tilegx.c  |   2 +
 drivers/net/null/rte_eth_null.c   |   1 +
 drivers/net/pcap/rte_eth_pcap.c   |   1 +
 drivers/net/ring/rte_eth_ring.c   |   1 +
 drivers/net/szedata2/rte_eth_szedata2.c   |   2 +
 drivers/net/vmxnet3/vmxnet3_ethdev.c  |   1 +
 drivers/net/xenvirt/rte_eth_xenvirt.c |   1 +
 examples/ip_pipeline/config_parse.c   |   3 +-
 lib/librte_ether/rte_ethdev.h |  31 +
 22 files changed, 213 insertions(+), 185 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 815b53b..741cac3 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -989,7 +989,7 @@ struct cmd_config_speed_all {
 };

 static int
-parse_and_check_speed_duplex(char *speedstr, char *duplexstr, uint16_t *speed)
+parse_and_check_speed_duplex(char *speedstr, char *duplexstr, uint32_t *speed)
 {

int duplex;
@@ -1006,20 +1006,22 @@ parse_and_check_speed_duplex(char *speedstr, char 
*duplexstr, uint16_t *speed)
}

if (!strcmp(speedstr, "10")) {
-   *speed = ETH_SPEED_NUM_10M;
+   *speed = (duplex == ETH_LINK_HALF_DUPLEX) ?
+   ETH_LINK_SPEED_10M_HD : ETH_LINK_SPEED_10M;
} else if (!strcmp(speedstr, "100")) {
-   *speed = ETH_SPEED_NUM_100M;
+   *speed = (duplex == ETH_LINK_HALF_DUPLEX) ?
+   ETH_LINK_SPEED_100M_HD : ETH_LINK_SPEED_100M;
} else {
if (duplex != ETH_LINK_FULL_DUPLEX) {
printf("Invalid speed/duplex parameters\n");
return -1;
}
if (!strcmp(speedstr, "1000")) {
-   *speed = ETH_SPEED_NUM_1G;
+   *speed = ETH_LINK_SPEED_1G;
} else if (!strcmp(speedstr, "1")) {
-   *speed = ETH_SPEED_NUM_10G;
+   *speed = ETH_LINK_SPEED_10G;
} else if (!strcmp(speedstr, "4")) {
-   *speed = ETH_SPEED_NUM_40G;
+   *speed = ETH_LINK_SPEED_40G;
} else if (!strcmp(speedstr, "auto")) {
*speed = ETH_LINK_SPEED_AUTONEG;
} else {
@@ -1037,8 +1039,7 @@ cmd_config_speed_all_parsed(void *parsed_result,
__attribute__((unused)) void *data)
 {
struct cmd_config_speed_all *res = parsed_result;
-   uint16_t link_speed = ETH_LINK_SPEED_AUTONEG;
-   uint16_t link_duplex = 0;
+   uint32_t link_speed;
portid_t pid;

if (!all_ports_stopped()) {
@@ -1051,8 +1052,7 @@ cmd_config_speed_all_parsed(void *parsed_result,
return;

FOREACH_PORT(pid, ports) {
-   ports[pid].dev_conf.link_speed = link_speed;
-   ports[pid].dev_conf.link_duplex = link_duplex;
+   ports[pid].dev_conf.link_speeds = link_speed;
}

cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1);
@@ -1110,8 +1110,7 @@ cmd_config_speed_specific_parsed(void *parsed_result,
__attribute__((unused)) void *data)
 {
struct cmd_config_speed_specific *res = parsed_result;
-   uint16_t link_speed = ETH_LINK_SPEED_AUTONEG;
-   uint16_t link_duplex = 0;
+   uint32_t link_speed;

if (!all_ports_stopped()) {
printf("Please stop all ports first\n");
@@ -1125,8 +1124,7 @@ cmd_config_speed_specific_parsed(void *parsed_result,
_speed) < 0)
return;

-   ports[res->id].dev_conf.link_speed = link_speed;
-   ports[res->id].dev_conf.link_duplex = link_duplex;
+   

[dpdk-dev] [PATCH v14 4/8] ethdev: rename link speed constants

2016-04-01 Thread Marc Sune
The speed numbers ETH_LINK_SPEED_ are renamed ETH_SPEED_NUM_.
The prefix ETH_LINK_SPEED_ is kept for AUTONEG and will be used
for bit flags in next patch.

Signed-off-by: Marc Sune 
---
 app/test-pmd/cmdline.c| 10 +-
 app/test/virtual_pmd.c|  2 +-
 drivers/net/af_packet/rte_eth_af_packet.c |  2 +-
 drivers/net/bonding/rte_eth_bond_8023ad.c | 12 ++--
 drivers/net/cxgbe/base/t4_hw.c|  8 
 drivers/net/e1000/em_ethdev.c |  8 
 drivers/net/e1000/igb_ethdev.c|  8 
 drivers/net/ena/ena_ethdev.c  |  2 +-
 drivers/net/i40e/i40e_ethdev.c| 30 +++---
 drivers/net/i40e/i40e_ethdev_vf.c |  2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c  | 22 +++---
 drivers/net/mpipe/mpipe_tilegx.c  |  4 ++--
 drivers/net/nfp/nfp_net.c |  2 +-
 drivers/net/null/rte_eth_null.c   |  2 +-
 drivers/net/pcap/rte_eth_pcap.c   |  2 +-
 drivers/net/ring/rte_eth_ring.c   |  2 +-
 drivers/net/szedata2/rte_eth_szedata2.c   |  8 
 drivers/net/vmxnet3/vmxnet3_ethdev.c  |  2 +-
 drivers/net/xenvirt/rte_eth_xenvirt.c |  2 +-
 lib/librte_ether/rte_ethdev.h | 29 ++---
 20 files changed, 83 insertions(+), 76 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index eb7bbb4..815b53b 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1006,20 +1006,20 @@ parse_and_check_speed_duplex(char *speedstr, char 
*duplexstr, uint16_t *speed)
}

if (!strcmp(speedstr, "10")) {
-   *speed = ETH_LINK_SPEED_10;
+   *speed = ETH_SPEED_NUM_10M;
} else if (!strcmp(speedstr, "100")) {
-   *speed = ETH_LINK_SPEED_100;
+   *speed = ETH_SPEED_NUM_100M;
} else {
if (duplex != ETH_LINK_FULL_DUPLEX) {
printf("Invalid speed/duplex parameters\n");
return -1;
}
if (!strcmp(speedstr, "1000")) {
-   *speed = ETH_LINK_SPEED_1000;
+   *speed = ETH_SPEED_NUM_1G;
} else if (!strcmp(speedstr, "1")) {
-   *speed = ETH_LINK_SPEED_10G;
+   *speed = ETH_SPEED_NUM_10G;
} else if (!strcmp(speedstr, "4")) {
-   *speed = ETH_LINK_SPEED_40G;
+   *speed = ETH_SPEED_NUM_40G;
} else if (!strcmp(speedstr, "auto")) {
*speed = ETH_LINK_SPEED_AUTONEG;
} else {
diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c
index b1d40d7..b4bd2f2 100644
--- a/app/test/virtual_pmd.c
+++ b/app/test/virtual_pmd.c
@@ -604,7 +604,7 @@ virtual_ethdev_create(const char *name, struct ether_addr 
*mac_addr,
TAILQ_INIT(&(eth_dev->link_intr_cbs));

eth_dev->data->dev_link.link_status = ETH_LINK_DOWN;
-   eth_dev->data->dev_link.link_speed = ETH_LINK_SPEED_1;
+   eth_dev->data->dev_link.link_speed = ETH_SPEED_NUM_10G;
eth_dev->data->dev_link.link_duplex = ETH_LINK_FULL_DUPLEX;

eth_dev->data->mac_addrs = rte_zmalloc(name, ETHER_ADDR_LEN, 0);
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c 
b/drivers/net/af_packet/rte_eth_af_packet.c
index dee7b59..641f849 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -116,7 +116,7 @@ static const char *valid_arguments[] = {
 static const char *drivername = "AF_PACKET PMD";

 static struct rte_eth_link pmd_link = {
-   .link_speed = 1,
+   .link_speed = ETH_SPEED_NUM_10G,
.link_duplex = ETH_LINK_FULL_DUPLEX,
.link_status = ETH_LINK_DOWN,
 };
diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c 
b/drivers/net/bonding/rte_eth_bond_8023ad.c
index 1b7e93a..ac8306f 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -711,22 +711,22 @@ link_speed_key(uint16_t speed) {
case ETH_LINK_SPEED_AUTONEG:
key_speed = 0x00;
break;
-   case ETH_LINK_SPEED_10:
+   case ETH_SPEED_NUM_10M:
key_speed = BOND_LINK_SPEED_KEY_10M;
break;
-   case ETH_LINK_SPEED_100:
+   case ETH_SPEED_NUM_100M:
key_speed = BOND_LINK_SPEED_KEY_100M;
break;
-   case ETH_LINK_SPEED_1000:
+   case ETH_SPEED_NUM_1G:
key_speed = BOND_LINK_SPEED_KEY_1000M;
break;
-   case ETH_LINK_SPEED_10G:
+   case ETH_SPEED_NUM_10G:
key_speed = BOND_LINK_SPEED_KEY_10G;
break;
-   case ETH_LINK_SPEED_20G:
+   case ETH_SPEED_NUM_20G:
key_speed = BOND_LINK_SPEED_KEY_20G;
break;
-   case ETH_LINK_SPEED_40G:
+   

[dpdk-dev] [PATCH v14 3/8] app/testpmd: move speed and duplex parsing in a function

2016-04-01 Thread Marc Sune
The code for checking and parsing speed/duplex was duplicated.
The new function is also checking the speed/duplex combination.

Signed-off-by: Marc Sune 
---
 app/test-pmd/cmdline.c | 99 --
 1 file changed, 47 insertions(+), 52 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 93203f4..eb7bbb4 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -988,6 +988,49 @@ struct cmd_config_speed_all {
cmdline_fixed_string_t value2;
 };

+static int
+parse_and_check_speed_duplex(char *speedstr, char *duplexstr, uint16_t *speed)
+{
+
+   int duplex;
+
+   if (!strcmp(duplexstr, "half")) {
+   duplex = ETH_LINK_HALF_DUPLEX;
+   } else if (!strcmp(duplexstr, "full")) {
+   duplex = ETH_LINK_FULL_DUPLEX;
+   } else if (!strcmp(duplexstr, "auto")) {
+   duplex = ETH_LINK_FULL_DUPLEX;
+   } else {
+   printf("Unknown duplex parameter\n");
+   return -1;
+   }
+
+   if (!strcmp(speedstr, "10")) {
+   *speed = ETH_LINK_SPEED_10;
+   } else if (!strcmp(speedstr, "100")) {
+   *speed = ETH_LINK_SPEED_100;
+   } else {
+   if (duplex != ETH_LINK_FULL_DUPLEX) {
+   printf("Invalid speed/duplex parameters\n");
+   return -1;
+   }
+   if (!strcmp(speedstr, "1000")) {
+   *speed = ETH_LINK_SPEED_1000;
+   } else if (!strcmp(speedstr, "1")) {
+   *speed = ETH_LINK_SPEED_10G;
+   } else if (!strcmp(speedstr, "4")) {
+   *speed = ETH_LINK_SPEED_40G;
+   } else if (!strcmp(speedstr, "auto")) {
+   *speed = ETH_LINK_SPEED_AUTONEG;
+   } else {
+   printf("Unknown speed parameter\n");
+   return -1;
+   }
+   }
+
+   return 0;
+}
+
 static void
 cmd_config_speed_all_parsed(void *parsed_result,
__attribute__((unused)) struct cmdline *cl,
@@ -1003,33 +1046,9 @@ cmd_config_speed_all_parsed(void *parsed_result,
return;
}

-   if (!strcmp(res->value1, "10"))
-   link_speed = ETH_LINK_SPEED_10;
-   else if (!strcmp(res->value1, "100"))
-   link_speed = ETH_LINK_SPEED_100;
-   else if (!strcmp(res->value1, "1000"))
-   link_speed = ETH_LINK_SPEED_1000;
-   else if (!strcmp(res->value1, "1"))
-   link_speed = ETH_LINK_SPEED_10G;
-   else if (!strcmp(res->value1, "4"))
-   link_speed = ETH_LINK_SPEED_40G;
-   else if (!strcmp(res->value1, "auto"))
-   link_speed = ETH_LINK_SPEED_AUTONEG;
-   else {
-   printf("Unknown parameter\n");
+   if (parse_and_check_speed_duplex(res->value1, res->value2,
+   _speed) < 0)
return;
-   }
-
-   if (!strcmp(res->value2, "half"))
-   link_duplex = ETH_LINK_HALF_DUPLEX;
-   else if (!strcmp(res->value2, "full"))
-   link_duplex = ETH_LINK_FULL_DUPLEX;
-   else if (!strcmp(res->value2, "auto"))
-   link_duplex = ETH_LINK_AUTONEG_DUPLEX;
-   else {
-   printf("Unknown parameter\n");
-   return;
-   }

FOREACH_PORT(pid, ports) {
ports[pid].dev_conf.link_speed = link_speed;
@@ -1102,33 +1121,9 @@ cmd_config_speed_specific_parsed(void *parsed_result,
if (port_id_is_invalid(res->id, ENABLED_WARN))
return;

-   if (!strcmp(res->value1, "10"))
-   link_speed = ETH_LINK_SPEED_10;
-   else if (!strcmp(res->value1, "100"))
-   link_speed = ETH_LINK_SPEED_100;
-   else if (!strcmp(res->value1, "1000"))
-   link_speed = ETH_LINK_SPEED_1000;
-   else if (!strcmp(res->value1, "1"))
-   link_speed = ETH_LINK_SPEED_1;
-   else if (!strcmp(res->value1, "4"))
-   link_speed = ETH_LINK_SPEED_40G;
-   else if (!strcmp(res->value1, "auto"))
-   link_speed = ETH_LINK_SPEED_AUTONEG;
-   else {
-   printf("Unknown parameter\n");
-   return;
-   }
-
-   if (!strcmp(res->value2, "half"))
-   link_duplex = ETH_LINK_HALF_DUPLEX;
-   else if (!strcmp(res->value2, "full"))
-   link_duplex = ETH_LINK_FULL_DUPLEX;
-   else if (!strcmp(res->value2, "auto"))
-   link_duplex = ETH_LINK_AUTONEG_DUPLEX;
-   else {
-   printf("Unknown parameter\n");
+   if (parse_and_check_speed_duplex(res->value1, res->value2,
+   _speed) < 0)
return;
-   }

ports[res->id].dev_conf.link_speed = link_speed;
ports[res->id].dev_conf.link_duplex = link_duplex;
-- 
2.1.4



[dpdk-dev] [PATCH v14 2/8] ethdev: use constants for link duplex

2016-04-01 Thread Marc Sune
Some duplex values are replaced from 0 to half-duplex when link is down.

Some drivers are still using their own constants for duplex modes.

Signed-off-by: Marc Sune 
---
 drivers/net/e1000/em_ethdev.c  | 2 +-
 drivers/net/e1000/igb_ethdev.c | 2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c   | 2 +-
 drivers/net/virtio/virtio_ethdev.c | 2 +-
 drivers/net/virtio/virtio_ethdev.h | 2 --
 lib/librte_ether/rte_ethdev.h  | 2 +-
 6 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 9c50674..b78ac04 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -1108,7 +1108,7 @@ eth_em_link_update(struct rte_eth_dev *dev, int 
wait_to_complete)
link.link_status = ETH_LINK_UP;
} else if (!link_check && (link.link_status == ETH_LINK_UP)) {
link.link_speed = 0;
-   link.link_duplex = 0;
+   link.link_duplex = ETH_LINK_HALF_DUPLEX;
link.link_status = ETH_LINK_DOWN;
}
rte_em_dev_atomic_write_link_status(dev, );
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 045fc63..4dfa7e3 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -2062,7 +2062,7 @@ eth_igb_link_update(struct rte_eth_dev *dev, int 
wait_to_complete)
link.link_status = ETH_LINK_UP;
} else if (!link_check) {
link.link_speed = 0;
-   link.link_duplex = 0;
+   link.link_duplex = ETH_LINK_HALF_DUPLEX;
link.link_status = ETH_LINK_DOWN;
}
rte_igb_dev_atomic_write_link_status(dev, );
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 8bcd0d8..5721882 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -3066,7 +3066,7 @@ ixgbe_dev_link_update(struct rte_eth_dev *dev, int 
wait_to_complete)

link.link_status = ETH_LINK_DOWN;
link.link_speed = 0;
-   link.link_duplex = 0;
+   link.link_duplex = ETH_LINK_HALF_DUPLEX;
memset(, 0, sizeof(old));
rte_ixgbe_dev_atomic_read_link_status(dev, );

diff --git a/drivers/net/virtio/virtio_ethdev.c 
b/drivers/net/virtio/virtio_ethdev.c
index 3ebc221..63a368a 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1401,7 +1401,7 @@ virtio_dev_link_update(struct rte_eth_dev *dev, 
__rte_unused int wait_to_complet
memset(, 0, sizeof(link));
virtio_dev_atomic_read_link_status(dev, );
old = link;
-   link.link_duplex = FULL_DUPLEX;
+   link.link_duplex = ETH_LINK_FULL_DUPLEX;
link.link_speed  = SPEED_10G;

if (vtpci_with_feature(hw, VIRTIO_NET_F_STATUS)) {
diff --git a/drivers/net/virtio/virtio_ethdev.h 
b/drivers/net/virtio/virtio_ethdev.h
index fed9571..66423a0 100644
--- a/drivers/net/virtio/virtio_ethdev.h
+++ b/drivers/net/virtio/virtio_ethdev.h
@@ -42,8 +42,6 @@
 #define SPEED_100  100
 #define SPEED_1000 1000
 #define SPEED_10G  1
-#define HALF_DUPLEX1
-#define FULL_DUPLEX2

 #ifndef PAGE_SIZE
 #define PAGE_SIZE 4096
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index c5a215a..2d13f92 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -246,7 +246,7 @@ struct rte_eth_stats {
  */
 struct rte_eth_link {
uint16_t link_speed;  /**< ETH_LINK_SPEED_[10, 100, 1000, 1] */
-   uint16_t link_duplex; /**< ETH_LINK_[HALF_DUPLEX, FULL_DUPLEX] */
+   uint16_t link_duplex; /**< ETH_LINK_[HALF/FULL]_DUPLEX */
uint8_t  link_status : 1; /**< ETH_LINK_[DOWN/UP] */
 }__attribute__((aligned(8))); /**< aligned for atomic64 read/write */

-- 
2.1.4



[dpdk-dev] [PATCH v14 1/8] ethdev: use constants for link state

2016-04-01 Thread Marc Sune
From: Thomas Monjalon 

Define and use ETH_LINK_UP and ETH_LINK_DOWN where appropriate.

Signed-off-by: Marc Sune 
Signed-off-by: Thomas Monjalon 
---
 app/test-pipeline/init.c |  2 +-
 app/test-pmd/testpmd.c   |  2 +-
 app/test/test_pmd_perf.c |  2 +-
 app/test/virtual_pmd.c   |  6 +++---
 drivers/net/af_packet/rte_eth_af_packet.c|  6 +++---
 drivers/net/bnx2x/bnx2x_ethdev.c |  2 +-
 drivers/net/bnx2x/elink.c|  2 +-
 drivers/net/bonding/rte_eth_bond_api.c   |  4 ++--
 drivers/net/bonding/rte_eth_bond_pmd.c   | 12 ++--
 drivers/net/e1000/em_ethdev.c|  8 
 drivers/net/e1000/igb_ethdev.c   |  4 ++--
 drivers/net/fm10k/fm10k_ethdev.c |  2 +-
 drivers/net/i40e/i40e_ethdev_vf.c|  2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c |  4 ++--
 drivers/net/mpipe/mpipe_tilegx.c | 12 ++--
 drivers/net/nfp/nfp_net.c|  2 +-
 drivers/net/null/rte_eth_null.c  |  6 +++---
 drivers/net/pcap/rte_eth_pcap.c  |  6 +++---
 drivers/net/ring/rte_eth_ring.c  | 10 +-
 drivers/net/szedata2/rte_eth_szedata2.c  |  2 +-
 drivers/net/vhost/rte_eth_vhost.c|  6 +++---
 drivers/net/virtio/virtio_ethdev.c   |  6 +++---
 drivers/net/vmxnet3/vmxnet3_ethdev.c |  2 +-
 drivers/net/xenvirt/rte_eth_xenvirt.c|  6 +++---
 examples/exception_path/main.c   |  2 +-
 examples/ip_fragmentation/main.c |  2 +-
 examples/ip_pipeline/init.c  |  2 +-
 examples/ip_reassembly/main.c|  2 +-
 examples/ipsec-secgw/ipsec-secgw.c   |  2 +-
 examples/ipv4_multicast/main.c   |  2 +-
 examples/kni/main.c  |  2 +-
 examples/l2fwd-crypto/main.c |  2 +-
 examples/l2fwd-ivshmem/host/host.c   |  2 +-
 examples/l2fwd-jobstats/main.c   |  2 +-
 examples/l2fwd-keepalive/main.c  |  2 +-
 examples/l2fwd/main.c|  2 +-
 examples/l3fwd-acl/main.c|  2 +-
 examples/l3fwd-power/main.c  |  2 +-
 examples/l3fwd/main.c|  2 +-
 examples/link_status_interrupt/main.c|  2 +-
 examples/load_balancer/init.c|  2 +-
 examples/multi_process/client_server_mp/mp_server/init.c |  2 +-
 examples/multi_process/l2fwd_fork/main.c |  2 +-
 examples/multi_process/symmetric_mp/main.c   |  2 +-
 examples/performance-thread/l3fwd-thread/main.c  |  2 +-
 lib/librte_ether/rte_ethdev.h|  5 -
 46 files changed, 83 insertions(+), 80 deletions(-)

diff --git a/app/test-pipeline/init.c b/app/test-pipeline/init.c
index db2196b..aef082f 100644
--- a/app/test-pipeline/init.c
+++ b/app/test-pipeline/init.c
@@ -205,7 +205,7 @@ app_ports_check_link(void)
link.link_speed / 1000,
link.link_status ? "UP" : "DOWN");

-   if (link.link_status == 0)
+   if (link.link_status == ETH_LINK_DOWN)
all_ports_up = 0;
}

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 8605e62..1398c6c 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1641,7 +1641,7 @@ check_all_ports_link_status(uint32_t port_mask)
continue;
}
/* clear all_ports_up flag if any link down */
-   if (link.link_status == 0) {
+   if (link.link_status == ETH_LINK_DOWN) {
all_ports_up = 0;
break;
}
diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c
index 48e16c9..59803f7 100644
--- a/app/test/test_pmd_perf.c
+++ b/app/test/test_pmd_perf.c
@@ -192,7 +192,7 @@ check_all_ports_link_status(uint8_t port_num, uint32_t 
port_mask)
continue;
}
/* clear all_ports_up flag if any link down */
-   if (link.link_status == 0) {
+   if (link.link_status == ETH_LINK_DOWN) {
all_ports_up = 0;
break;

[dpdk-dev] [PATCH v14 0/8] ethdev: 100G and link speed API refactoring

2016-04-01 Thread Marc Sune
From: Marc Sune 

This series of patches adds the following capabilities:

* speed_capa bitmap in rte_eth_dev_info, which is filled by the PMDs
  according to the physical device capabilities.
* refactors link API in ethdev to allow the definition of the advertised
  link speeds, fix speed (no auto-negociation) or advertise all supported
  speeds (default).

v14:
- Rebase to master HEAD
- Add ETH_LINK_FIXED / ETH_LINK_AUTONEG MACROs in rte_ethdev.h
- Fix NFP speed capability (50G -> 40G)
- Fix ixgbe full AUTONEG

v13:
- Fix startup regression; revert flip of ETH_LINK_SPEED_FIXED and
  ETH_LINK_SPEED_AUTONEG values. ETH_LINK_SPEED_AUTONEG is now 0.
- Fix incorrect duplex link reporting for e1000.
- Do not allow more than one speed in the bitmap when
  ETH_LINK_SPEED_FIXED is used for e1000.

v12:
- rebase on 16.04-rc2
- fix mlx capabilities
- update ENA driver

v11:
- rebase on 16.04-rc1
- replace on more link status value in e1000 driver
- merge szedata2 patches
- remove szedata2 temporary comments in code and doc

v10:
- rebase
- rework release notes
- rearrange patch splitting
- fix doxygen comments
- fix typos
- removed log format of link.link_speed as %d (keep %u)
- complete ETH_LINK_[DOWN/UP] replacement from 0/1
- change ETH_LINK_SPEED_AUTONEG to 1
- replace ETH_LINK_SPEED_NEG by ETH_LINK_SPEED_AUTONEG (1)
- replace ETH_LINK_SPEED_NO_AUTONEG by ETH_LINK_SPEED_FIXED (0)
- rework rte_eth_speed_to_bm_flag to rte_eth_speed_bitflag
- complete 100G support in testpmd

v9: rebased to current HEAD. Reverted numeric speed to 32 bit in struct
rte_eth_link (no atomic link get > 64bit). Fixed mlx5 driver compilation
and link speeds. Moved documentation to release_16_04.rst and fixed several
issues. Upgrade NIC notes with speed capabilities.

v8: Rebased to current HEAD. Modified em driver impl. to not touch base files.
Merged patch 5 into 3 (map file). Changed numeric speed to a 64 bit value.
Filled-in speed capabilities for drivers bnx2x, cxgbe, mlx5 and nfp in
addition to the ones of previous patch sets.

v7: Rebased to current HEAD. Moved documentation to v2.3. Still needs testing
from PMD maintainers.

v6: Move link_duplex to be part of bitfield. Fixed i40 autoneg flag link
update code. Added rte_eth_speed_to_bm_flag() to .map file. Fixed other
spelling issues. Rebased to current HEAD.

v5: revert to v2 speed capabilities patch. Fixed MLX4 speed capabilities
(thanks N. Laranjeiro). Refactored link speed API to allow setting
advertised speeds (3/4). Added NO_AUTONEG option to explicitely disable
auto-negociation. Updated 2.2 rel. notes (4/4). Rebased to current HEAD.

v4: fixed errata in the documentation of field speeds of rte_eth_conf, and
commit 1/2 message. rebased to v2.1.0. v3 was incorrectly based on
~2.1.0-rc1.

v3: rebase to v2.1. unified ETH_LINK_SPEED and ETH_SPEED_CAP into ETH_SPEED.
Converted field speed in struct rte_eth_conf to speed, to allow a bitmap
for defining the announced speeds, as suggested M. Brorup. Fixed spelling
issues.

v2: rebase, converted speed_capa into 32 bits bitmap, fixed alignment
(checkpatch).
*** BLURB HERE ***

Marc Sune (6):
  ethdev: use constants for link duplex
  app/testpmd: move speed and duplex parsing in a function
  ethdev: rename link speed constants
  ethdev: add speed capabilities
  ethdev: redesign link speed config
  ethdev: convert speed number to bitmap flag

Thomas Monjalon (2):
  ethdev: use constants for link state
  ethdev: add 100G link speed

 app/test-pipeline/init.c   |   2 +-
 app/test-pmd/cmdline.c | 125 ++---
 app/test-pmd/testpmd.c |   2 +-
 app/test/test_pmd_perf.c   |   2 +-
 app/test/virtual_pmd.c |   8 +-
 doc/guides/nics/overview.rst   |   1 +
 doc/guides/nics/szedata2.rst   |   6 -
 doc/guides/rel_notes/deprecation.rst   |   3 -
 doc/guides/rel_notes/release_16_04.rst |  22 
 doc/guides/testpmd_app_ug/testpmd_funcs.rst|   2 +-
 drivers/net/af_packet/rte_eth_af_packet.c  |   9 +-
 drivers/net/bnx2x/bnx2x_ethdev.c   |   7 +-
 drivers/net/bnx2x/elink.c  |   2 +-
 drivers/net/bonding/rte_eth_bond_8023ad.c  |  14 +--
 drivers/net/bonding/rte_eth_bond_api.c |   4 +-
 drivers/net/bonding/rte_eth_bond_pmd.c |  12 +-
 drivers/net/cxgbe/base/t4_hw.c |   8 +-
 drivers/net/cxgbe/cxgbe_ethdev.c   |   1 +
 drivers/net/e1000/em_ethdev.c  | 117 +--
 drivers/net/e1000/igb_ethdev.c | 105 +
 drivers/net/ena/ena_ethdev.c   |  12 +-