[dpdk-dev] [PATCH 3/3] examples/ip_pipeline: add sample config file with TAP port usage

2016-08-05 Thread Jasvinder Singh
To illustrate the TAP port usage, the sample configuration file with
passthrough pipeline connected to TAP interface is added.

Signed-off-by: Jasvinder Singh 
Acked-by: Cristian Dumitrescu 
---
 examples/ip_pipeline/config/tap.cfg | 64 +
 1 file changed, 64 insertions(+)
 create mode 100644 examples/ip_pipeline/config/tap.cfg

diff --git a/examples/ip_pipeline/config/tap.cfg 
b/examples/ip_pipeline/config/tap.cfg
new file mode 100644
index 000..ea66038
--- /dev/null
+++ b/examples/ip_pipeline/config/tap.cfg
@@ -0,0 +1,64 @@
+;   BSD LICENSE
+;
+;   Copyright(c) 2016 Intel Corporation. All rights reserved.
+;   All rights reserved.
+;
+;   Redistribution and use in source and binary forms, with or without
+;   modification, are permitted provided that the following conditions
+;   are met:
+;
+; * Redistributions of source code must retain the above copyright
+;   notice, this list of conditions and the following disclaimer.
+; * Redistributions in binary form must reproduce the above copyright
+;   notice, this list of conditions and the following disclaimer in
+;   the documentation and/or other materials provided with the
+;   distribution.
+; * Neither the name of Intel Corporation nor the names of its
+;   contributors may be used to endorse or promote products derived
+;   from this software without specific prior written permission.
+;
+;   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+;   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+;   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+;   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+;   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+;   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+;   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+;   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+;   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+;   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+;   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+; __  __
+;|  |  TAP0  |  |
+; RXQ0.0 --->|  |--->|--+   |
+;|  |  TAP1  |  | br0   |
+; TXQ0.0 <---|  |<---|<-+   |
+;| Pass-through || Linux Kernel |
+;| (P1) || Network Stack|
+;|  |  TAP0  |  |
+; RXQ0.0 --->|  |--->|--+   |
+;|  |  TAP1  |  | br0   |
+; TXQ0.0 <---|  |<---|<-+   |
+;|__||__|
+;
+; Configure Linux kernel bridge between TAP0 and TAP1 interfaces:
+;[Linux]$ ifconfig TAP0 up
+;[Linux]$ ifconfig TAP1 up
+;[Linux]$ brctl addbr "br0"
+;[Linux]$ brctl addif br0 TAP0
+;[Linux]$ brctl addif br0 TAP1
+;[Linux]$ ifconfig br0 up
+
+[EAL]
+log_level = 0
+
+[PIPELINE0]
+type = MASTER
+core = 0
+
+[PIPELINE1]
+type = PASS-THROUGH
+core = 1
+pktq_in = RXQ0.0 TAP1 RXQ1.0 TAP0
+pktq_out = TAP0 TXQ1.0 TAP1 TXQ0.0
-- 
2.5.5



[dpdk-dev] [PATCH 2/3] examples/ip_pipeline: integrate TAP port

2016-08-05 Thread Jasvinder Singh
The TAP port support is added to ip_pipeline app. To parse
configuration file with TAP port entries, parsing function is implemented.
The TAP ports configuration check and initialization routines have been
included in application code.

Signed-off-by: Jasvinder Singh 
Acked-by: Cristian Dumitrescu 
---
 examples/ip_pipeline/app.h | 140 +
 examples/ip_pipeline/config_check.c|  31 +
 examples/ip_pipeline/config_parse.c| 135 
 examples/ip_pipeline/init.c|  62 +
 examples/ip_pipeline/pipeline/pipeline_common_fe.c |   1 +
 examples/ip_pipeline/pipeline_be.h |  13 ++
 6 files changed, 382 insertions(+)

diff --git a/examples/ip_pipeline/app.h b/examples/ip_pipeline/app.h
index 6a6fdd9..c7f4edf 100644
--- a/examples/ip_pipeline/app.h
+++ b/examples/ip_pipeline/app.h
@@ -177,6 +177,16 @@ struct app_pktq_tm_params {
uint32_t burst_write;
 };

+struct app_pktq_tap_params {
+   char *name;
+   uint32_t parsed;
+   uint32_t burst_read;
+   uint32_t burst_write;
+   uint32_t dropless;
+   uint64_t n_retries;
+   uint32_t mempool_id; /* Position in the app->mempool_params */
+};
+
 struct app_pktq_source_params {
char *name;
uint32_t parsed;
@@ -204,6 +214,7 @@ enum app_pktq_in_type {
APP_PKTQ_IN_HWQ,
APP_PKTQ_IN_SWQ,
APP_PKTQ_IN_TM,
+   APP_PKTQ_IN_TAP,
APP_PKTQ_IN_KNI,
APP_PKTQ_IN_SOURCE,
 };
@@ -217,6 +228,7 @@ enum app_pktq_out_type {
APP_PKTQ_OUT_HWQ,
APP_PKTQ_OUT_SWQ,
APP_PKTQ_OUT_TM,
+   APP_PKTQ_OUT_TAP,
APP_PKTQ_OUT_KNI,
APP_PKTQ_OUT_SINK,
 };
@@ -441,6 +453,10 @@ struct app_eal_params {

 #define APP_MAX_PKTQ_TM  APP_MAX_LINKS

+#ifndef APP_MAX_PKTQ_TAP
+#define APP_MAX_PKTQ_TAP APP_MAX_LINKS
+#endif
+
 #define APP_MAX_PKTQ_KNI APP_MAX_LINKS

 #ifndef APP_MAX_PKTQ_SOURCE
@@ -494,6 +510,7 @@ struct app_params {
struct app_pktq_hwq_out_params hwq_out_params[APP_MAX_HWQ_OUT];
struct app_pktq_swq_params swq_params[APP_MAX_PKTQ_SWQ];
struct app_pktq_tm_params tm_params[APP_MAX_PKTQ_TM];
+   struct app_pktq_tap_params tap_params[APP_MAX_PKTQ_TAP];
struct app_pktq_kni_params kni_params[APP_MAX_PKTQ_KNI];
struct app_pktq_source_params source_params[APP_MAX_PKTQ_SOURCE];
struct app_pktq_sink_params sink_params[APP_MAX_PKTQ_SINK];
@@ -506,6 +523,7 @@ struct app_params {
uint32_t n_pktq_hwq_out;
uint32_t n_pktq_swq;
uint32_t n_pktq_tm;
+   uint32_t n_pktq_tap;
uint32_t n_pktq_kni;
uint32_t n_pktq_source;
uint32_t n_pktq_sink;
@@ -520,6 +538,7 @@ struct app_params {
struct app_link_data link_data[APP_MAX_LINKS];
struct rte_ring *swq[APP_MAX_PKTQ_SWQ];
struct rte_sched_port *tm[APP_MAX_PKTQ_TM];
+   int tap[APP_MAX_PKTQ_TAP];
 #ifdef RTE_LIBRTE_KNI
struct rte_kni *kni[APP_MAX_PKTQ_KNI];
 #endif /* RTE_LIBRTE_KNI */
@@ -786,6 +805,66 @@ app_tm_get_reader(struct app_params *app,
 }

 static inline uint32_t
+app_tap_get_readers(struct app_params *app, struct app_pktq_tap_params *tap)
+{
+   uint32_t pos = tap - app->tap_params;
+   uint32_t n_pipelines = RTE_MIN(app->n_pipelines,
+   RTE_DIM(app->pipeline_params));
+   uint32_t n_readers = 0, i;
+
+   for (i = 0; i < n_pipelines; i++) {
+   struct app_pipeline_params *p = >pipeline_params[i];
+   uint32_t n_pktq_in = RTE_MIN(p->n_pktq_in, RTE_DIM(p->pktq_in));
+   uint32_t j;
+
+   for (j = 0; j < n_pktq_in; j++) {
+   struct app_pktq_in_params *pktq = >pktq_in[j];
+
+   if ((pktq->type == APP_PKTQ_IN_TAP) &&
+   (pktq->id == pos))
+   n_readers++;
+   }
+   }
+
+   return n_readers;
+}
+
+static inline struct app_pipeline_params *
+app_tap_get_reader(struct app_params *app,
+   struct app_pktq_tap_params *tap,
+   uint32_t *pktq_in_id)
+{
+   struct app_pipeline_params *reader = NULL;
+   uint32_t pos = tap - app->tap_params;
+   uint32_t n_pipelines = RTE_MIN(app->n_pipelines,
+   RTE_DIM(app->pipeline_params));
+   uint32_t n_readers = 0, id = 0, i;
+
+   for (i = 0; i < n_pipelines; i++) {
+   struct app_pipeline_params *p = >pipeline_params[i];
+   uint32_t n_pktq_in = RTE_MIN(p->n_pktq_in, RTE_DIM(p->pktq_in));
+   uint32_t j;
+
+   for (j = 0; j < n_pktq_in; j++) {
+   struct app_pktq_in_params *pktq = >pktq_in[j];
+
+   if ((pktq->type == APP_PKTQ_IN_TAP) &&
+   (pktq->id == pos)) {
+   n_readers++;
+

[dpdk-dev] [PATCH 1/3] lib/librte_port: enable file descriptor port support

2016-08-05 Thread Jasvinder Singh
This patch adds File Descriptor(FD) port type (e.g. TAP port) to the
packet framework library that allows interface with the kernel network
stack. The FD port APIs are defined that allow port creation, writing
and reading packet from the kernel interface.

Signed-off-by: Jasvinder Singh 
Acked-by: Cristian Dumitrescu 
---
 lib/librte_port/Makefile |   2 +
 lib/librte_port/rte_port_fd.c| 548 +++
 lib/librte_port/rte_port_fd.h| 103 +++
 lib/librte_port/rte_port_version.map |   9 +
 4 files changed, 662 insertions(+)
 create mode 100644 lib/librte_port/rte_port_fd.c
 create mode 100644 lib/librte_port/rte_port_fd.h

diff --git a/lib/librte_port/Makefile b/lib/librte_port/Makefile
index 3d84a0e..44fa735 100644
--- a/lib/librte_port/Makefile
+++ b/lib/librte_port/Makefile
@@ -56,6 +56,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PORT) += rte_port_frag.c
 SRCS-$(CONFIG_RTE_LIBRTE_PORT) += rte_port_ras.c
 endif
 SRCS-$(CONFIG_RTE_LIBRTE_PORT) += rte_port_sched.c
+SRCS-$(CONFIG_RTE_LIBRTE_PORT) += rte_port_fd.c
 ifeq ($(CONFIG_RTE_LIBRTE_KNI),y)
 SRCS-$(CONFIG_RTE_LIBRTE_PORT) += rte_port_kni.c
 endif
@@ -70,6 +71,7 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_PORT)-include += rte_port_frag.h
 SYMLINK-$(CONFIG_RTE_LIBRTE_PORT)-include += rte_port_ras.h
 endif
 SYMLINK-$(CONFIG_RTE_LIBRTE_PORT)-include += rte_port_sched.h
+SYMLINK-$(CONFIG_RTE_LIBRTE_PORT)-include += rte_port_fd.h
 ifeq ($(CONFIG_RTE_LIBRTE_KNI),y)
 SYMLINK-$(CONFIG_RTE_LIBRTE_PORT)-include += rte_port_kni.h
 endif
diff --git a/lib/librte_port/rte_port_fd.c b/lib/librte_port/rte_port_fd.c
new file mode 100644
index 000..c75b602
--- /dev/null
+++ b/lib/librte_port/rte_port_fd.c
@@ -0,0 +1,548 @@
+/*-
+ *   BSD LICENSE
+ *
+ *   Copyright(c) 2016 Intel Corporation. All rights reserved.
+ *   All rights reserved.
+ *
+ *   Redistribution and use in source and binary forms, with or without
+ *   modification, are permitted provided that the following conditions
+ *   are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in
+ *   the documentation and/or other materials provided with the
+ *   distribution.
+ * * Neither the name of Intel Corporation nor the names of its
+ *   contributors may be used to endorse or promote products derived
+ *   from this software without specific prior written permission.
+ *
+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include "rte_port_fd.h"
+
+/*
+ * Port FD Reader
+ */
+#ifdef RTE_PORT_STATS_COLLECT
+
+#define RTE_PORT_FD_READER_STATS_PKTS_IN_ADD(port, val) \
+   port->stats.n_pkts_in += val
+#define RTE_PORT_FD_READER_STATS_PKTS_DROP_ADD(port, val) \
+   port->stats.n_pkts_drop += val
+
+#else
+
+#define RTE_PORT_FD_READER_STATS_PKTS_IN_ADD(port, val)
+#define RTE_PORT_FD_READER_STATS_PKTS_DROP_ADD(port, val)
+
+#endif
+
+struct rte_port_fd_reader {
+   struct rte_port_in_stats stats;
+   int fd;
+   uint32_t mtu;
+   struct rte_mempool *mempool;
+};
+
+static void *
+rte_port_fd_reader_create(void *params, int socket_id)
+{
+   struct rte_port_fd_reader_params *conf =
+   (struct rte_port_fd_reader_params *) params;
+   struct rte_port_fd_reader *port;
+
+   /* Check input parameters */
+   if (conf == NULL) {
+   RTE_LOG(ERR, PORT, "%s: params is NULL\n", __func__);
+   return NULL;
+   }
+   if (conf->fd < 0) {
+   RTE_LOG(ERR, PORT, "%s: Invalid file descriptor\n", __func__);
+   return NULL;
+   }
+   if (conf->mtu == 0) {
+   RTE_LOG(ERR, PORT, "%s: Invalid MTU\n", __func__);
+   return NULL;
+   }
+   if (conf->mempool == NULL) {
+   RTE_LOG(ERR, PORT, "%s: Invalid mempool\n", __func__);
+   return NULL;
+   }
+
+   /* Memory allocation */
+   port = rte_zmalloc_socket("PORT", 

[dpdk-dev] [PATCH v2] app/testpmd: fix RSS-hash-key size

2016-08-05 Thread Mohammad Abdul Awal
RSS hash-key-size is retrieved from device configuration instead of
using a fixed size of 40 bytes.

Fixes: f79959ea1504 ("app/testpmd: allow to configure RSS hash key")

Signed-off-by: Mohammad Abdul Awal 
---
v2:
* Used macro instead of hard-coded value.
* Some nits as per comments.

 app/test-pmd/cmdline.c | 27 ---
 app/test-pmd/config.c  | 18 +++---
 app/test-pmd/testpmd.h |  6 ++
 3 files changed, 41 insertions(+), 10 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index f90befc..a631c43 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1608,7 +1608,6 @@ struct cmd_config_rss_hash_key {
cmdline_fixed_string_t key;
 };

-#define RSS_HASH_KEY_LENGTH 40
 static uint8_t
 hexa_digit_to_value(char hexa_digit)
 {
@@ -1644,16 +1643,29 @@ cmd_config_rss_hash_key_parsed(void *parsed_result,
uint8_t xdgt0;
uint8_t xdgt1;
int i;
+   struct rte_eth_dev_info dev_info;
+   uint8_t hash_key_size;
+   uint32_t key_len;

+   memset(_info, 0, sizeof(dev_info));
+   rte_eth_dev_info_get(res->port_id, _info);
+   if (dev_info.hash_key_size > 0 &&
+   dev_info.hash_key_size <= sizeof(hash_key))
+   hash_key_size = dev_info.hash_key_size;
+   else {
+   printf("dev_info did not provide a valid hash key size\n");
+   return;
+   }
/* Check the length of the RSS hash key */
-   if (strlen(res->key) != (RSS_HASH_KEY_LENGTH * 2)) {
+   key_len = strlen(res->key);
+   if (key_len != (hash_key_size * 2)) {
printf("key length: %d invalid - key must be a string of %d"
-  "hexa-decimal numbers\n", (int) strlen(res->key),
-  RSS_HASH_KEY_LENGTH * 2);
+  " hexa-decimal numbers\n",
+  (int) key_len, hash_key_size * 2);
return;
}
/* Translate RSS hash key into binary representation */
-   for (i = 0; i < RSS_HASH_KEY_LENGTH; i++) {
+   for (i = 0; i < hash_key_size; i++) {
xdgt0 = parse_and_check_key_hexa_digit(res->key, (i * 2));
if (xdgt0 == 0xFF)
return;
@@ -1663,7 +1675,7 @@ cmd_config_rss_hash_key_parsed(void *parsed_result,
hash_key[i] = (uint8_t) ((xdgt0 * 16) + xdgt1);
}
port_rss_hash_key_update(res->port_id, res->rss_type, hash_key,
-RSS_HASH_KEY_LENGTH);
+   hash_key_size);
 }

 cmdline_parse_token_string_t cmd_config_rss_hash_key_port =
@@ -1692,7 +1704,8 @@ cmdline_parse_inst_t cmd_config_rss_hash_key = {
"port config X rss-hash-key ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|"
"ipv4-sctp|ipv4-other|ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|"
"ipv6-sctp|ipv6-other|l2-payload|"
-   "ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex 80 hexa digits\n",
+   "ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex "
+   "\n",
.tokens = {
(void *)_config_rss_hash_key_port,
(void *)_config_rss_hash_key_config,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index bfcbff9..44ba91e 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1012,14 +1012,26 @@ void
 port_rss_hash_conf_show(portid_t port_id, char rss_info[], int show_rss_key)
 {
struct rte_eth_rss_conf rss_conf;
-   uint8_t rss_key[10 * 4] = "";
+   uint8_t rss_key[RSS_HASH_KEY_LENGTH];
uint64_t rss_hf;
uint8_t i;
int diag;
+   struct rte_eth_dev_info dev_info;
+   uint8_t hash_key_size;

if (port_id_is_invalid(port_id, ENABLED_WARN))
return;

+   memset(_info, 0, sizeof(dev_info));
+   rte_eth_dev_info_get(port_id, _info);
+   if (dev_info.hash_key_size > 0 &&
+   dev_info.hash_key_size <= sizeof(rss_key))
+   hash_key_size = dev_info.hash_key_size;
+   else {
+   printf("dev_info did not provide a valid hash key size\n");
+   return;
+   }
+
rss_conf.rss_hf = 0;
for (i = 0; i < RTE_DIM(rss_type_table); i++) {
if (!strcmp(rss_info, rss_type_table[i].str))
@@ -1028,7 +1040,7 @@ port_rss_hash_conf_show(portid_t port_id, char 
rss_info[], int show_rss_key)

/* Get RSS hash key if asked to display it */
rss_conf.rss_key = (show_rss_key) ? rss_key : NULL;
-   rss_conf.rss_key_len = sizeof(rss_key);
+   rss_conf.rss_key_len = hash_key_size;
diag = rte_eth_dev_rss_hash_conf_get(port_id, _conf);
if (diag != 0) {
switch (diag) {
@@ -1058,7 +1070,7 @@ port_rss_hash_conf_show(portid_t port_id, char 
rss_info[], int show_rss_key)
if (!show_rss_key)
return;
printf("RSS key:\n");
-   for (i = 0; i < sizeof(rss_key); i++)
+   for 

[dpdk-dev] DPDK support for on system bus connected embedded MAC

2016-08-05 Thread Venkat Karthik K
Hello,

I am planning to develop Poll Mode Driver for new embedded MAC which is
connected on system bus .I am looking into available poll mode drivers
support for different Network cards  in DPDK 16.07 package but all of them
are connected and managed by PCI bus.

Is there DPDK support for embedded Ethernet/MAC  which is connected  on
system bus , please point me support which will help a lot for my
development .


Thanks,
 Karthik


[dpdk-dev] [RFC 0/4] Use Google Test as DPDK unit test framework

2016-08-05 Thread Remy Horton

On 05/08/2016 13:59, Neil Horman wrote:
> On Fri, Aug 05, 2016 at 10:11:56AM +0100, Remy Horton wrote:
[..]
>> Cmocka's mocking relies on Gnu ld's --wrap feature, which has problems if
>> the function being mocked is defined in the same compilation unit that it is
>> used. Pity really as otherwise it looked quite good to me.
>>
> Can't you use ld's --undefined option to get the correct behavior?  I thought
> that was specifically what it was there for.

Not sure - I'll try playing around with it when I next have some spare 
time.. :)

The C-Mock extension (https://github.com/hjagodzinski/C-Mock) for GMock 
uses some dynamic linker trickery which I'm guessing is probably not C++ 
specific, and I quite like that approach as it avoids the need to 
pre-specify in makefiles which functions are to be mocked.

..Remy


[dpdk-dev] [PATCH 7/7] netdev-dpdk: add support for Jumbo Frames

2016-08-05 Thread Mark Kavanagh
Add support for Jumbo Frames to DPDK-enabled port types,
using single-segment-mbufs.

Using this approach, the amount of memory allocated to each mbuf
to store frame data is increased to a value greater than 1518B
(typical Ethernet maximum frame length). The increased space
available in the mbuf means that an entire Jumbo Frame of a specific
size can be carried in a single mbuf, as opposed to partitioning
it across multiple mbuf segments.

The amount of space allocated to each mbuf to hold frame data is
defined dynamically by the user with ovs-vsctl, via the 'mtu_request'
parameter.

Signed-off-by: Mark Kavanagh 
[diproiettod at vmware.com rebased]
Signed-off-by: Daniele Di Proietto 
---

Previous: http://openvswitch.org/pipermail/dev/2016-July/076845.html

v2->v1:
- rebase to HEAD of master
- fall back to previous 'good' MTU if reconfigure fails
- introduce new field 'last_mtu' in struct netdev-dpdk to facilitate
  fall-back
- rename 'mtu_request' to 'requested_mtu' in struct netdev_dpdk
- remove rebasing artifact in INSTALL.DPDK-Advanced.md
- remove superflous variable in dpdk_mp_configure
- fix minor coding style infraction

 INSTALL.DPDK-ADVANCED.md |  58 -
 INSTALL.DPDK.md  |   1 -
 NEWS |   1 +
 lib/netdev-dpdk.c| 165 ---
 4 files changed, 197 insertions(+), 28 deletions(-)

diff --git a/INSTALL.DPDK-ADVANCED.md b/INSTALL.DPDK-ADVANCED.md
index 0ab43d4..5e758ce 100755
--- a/INSTALL.DPDK-ADVANCED.md
+++ b/INSTALL.DPDK-ADVANCED.md
@@ -1,5 +1,5 @@
 OVS DPDK ADVANCED INSTALL GUIDE
-=
+===

 ## Contents

@@ -12,7 +12,8 @@ OVS DPDK ADVANCED INSTALL GUIDE
 7. [QOS](#qos)
 8. [Rate Limiting](#rl)
 9. [Flow Control](#fc)
-10. [Vsperf](#vsperf)
+10. [Jumbo Frames](#jumbo)
+11. [Vsperf](#vsperf)

 ##  1. Overview

@@ -862,7 +863,58 @@ respective parameter. To disable the flow control at tx 
side,

 `ovs-vsctl set Interface dpdk0 options:tx-flow-ctrl=false`

-##  10. Vsperf
+##  10. Jumbo Frames
+
+By default, DPDK ports are configured with standard Ethernet MTU (1500B). To
+enable Jumbo Frames support for a DPDK port, change the Interface's 
`mtu_request`
+attribute to a sufficiently large value.
+
+e.g. Add a DPDK Phy port with MTU of 9000:
+
+`ovs-vsctl add-port br0 dpdk0 -- set Interface dpdk0 type=dpdk -- set 
Interface dpdk0 mtu_request=9000`
+
+e.g. Change the MTU of an existing port to 6200:
+
+`ovs-vsctl set Interface dpdk0 mtu_request=6200`
+
+When Jumbo Frames are enabled, the size of a DPDK port's mbuf segments are
+increased, such that a full Jumbo Frame of a specific size may be accommodated
+within a single mbuf segment.
+
+Jumbo frame support has been validated against 9728B frames (largest frame size
+supported by Fortville NIC), using the DPDK `i40e` driver, but larger frames
+(particularly in use cases involving East-West traffic only), and other DPDK 
NIC
+drivers may be supported.
+
+### 9.1 vHost Ports and Jumbo Frames
+
+Some additional configuration is needed to take advantage of jumbo frames with
+vhost ports:
+
+1. `mergeable buffers` must be enabled for vHost ports, as demonstrated in
+the QEMU command line snippet below:
+
+```
+'-netdev type=vhost-user,id=mynet1,chardev=char0,vhostforce \'
+'-device 
virtio-net-pci,mac=00:00:00:00:00:01,netdev=mynet1,mrg_rxbuf=on'
+```
+
+2. Where virtio devices are bound to the Linux kernel driver in a guest
+   environment (i.e. interfaces are not bound to an in-guest DPDK driver),
+   the MTU of those logical network interfaces must also be increased to a
+   sufficiently large value. This avoids segmentation of Jumbo Frames
+   received in the guest. Note that 'MTU' refers to the length of the IP
+   packet only, and not that of the entire frame.
+
+   To calculate the exact MTU of a standard IPv4 frame, subtract the L2
+   header and CRC lengths (i.e. 18B) from the max supported frame size.
+   So, to set the MTU for a 9018B Jumbo Frame:
+
+   ```
+   ifconfig eth1 mtu 9000
+   ```
+
+##  11. Vsperf

 Vsperf project goal is to develop vSwitch test framework that can be used to
 validate the suitability of different vSwitch implementations in a Telco 
deployment
diff --git a/INSTALL.DPDK.md b/INSTALL.DPDK.md
index 253d022..a810ac8 100644
--- a/INSTALL.DPDK.md
+++ b/INSTALL.DPDK.md
@@ -590,7 +590,6 @@ can be found in [Vhost Walkthrough].

 ##  6. Limitations

-  - Supports MTU size 1500, MTU setting for DPDK netdevs will be in future OVS 
release.
   - Currently DPDK ports does not use HW offload functionality.
   - Network Interface Firmware requirements:
 Each release of DPDK is validated against a specific firmware version for
diff --git a/NEWS b/NEWS
index ce10982..53c816b 100644
--- a/NEWS
+++ b/NEWS
@@ -69,6 +69,7 @@ Post-v2.5.0
  * Basic connection tracking 

[dpdk-dev] [PATCH 6/7] netdev: Make netdev_set_mtu() netdev parameter non-const.

2016-08-05 Thread Mark Kavanagh
From: Daniele Di Proietto 

Every provider silently drops the const attribute when converting the
parameter to the appropriate subclass.  Might as well drop the const
attribute from the parameter, since this is a "set" function.

Signed-off-by: Daniele Di Proietto 
---
v2->v1: add missing 'Signed-off-by' field in commit message.

 lib/netdev-dummy.c| 2 +-
 lib/netdev-linux.c| 2 +-
 lib/netdev-provider.h | 2 +-
 lib/netdev.c  | 2 +-
 lib/netdev.h  | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c
index c8f82b7..dec1a8e 100644
--- a/lib/netdev-dummy.c
+++ b/lib/netdev-dummy.c
@@ -1150,7 +1150,7 @@ netdev_dummy_get_mtu(const struct netdev *netdev, int 
*mtup)
 }

 static int
-netdev_dummy_set_mtu(const struct netdev *netdev, int mtu)
+netdev_dummy_set_mtu(struct netdev *netdev, int mtu)
 {
 struct netdev_dummy *dev = netdev_dummy_cast(netdev);

diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index 1b5f7c1..20b5cc7 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -1382,7 +1382,7 @@ netdev_linux_get_mtu(const struct netdev *netdev_, int 
*mtup)
  * networking ioctl interface.
  */
 static int
-netdev_linux_set_mtu(const struct netdev *netdev_, int mtu)
+netdev_linux_set_mtu(struct netdev *netdev_, int mtu)
 {
 struct netdev_linux *netdev = netdev_linux_cast(netdev_);
 struct ifreq ifr;
diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h
index 5bcfeba..cd04ae9 100644
--- a/lib/netdev-provider.h
+++ b/lib/netdev-provider.h
@@ -389,7 +389,7 @@ struct netdev_class {
  * If 'netdev' does not have an MTU (e.g. as some tunnels do not), then
  * this function should return EOPNOTSUPP.  This function may be set to
  * null if it would always return EOPNOTSUPP. */
-int (*set_mtu)(const struct netdev *netdev, int mtu);
+int (*set_mtu)(struct netdev *netdev, int mtu);

 /* Returns the ifindex of 'netdev', if successful, as a positive number.
  * On failure, returns a negative errno value.
diff --git a/lib/netdev.c b/lib/netdev.c
index 589d37c..5cf8bbb 100644
--- a/lib/netdev.c
+++ b/lib/netdev.c
@@ -869,7 +869,7 @@ netdev_get_mtu(const struct netdev *netdev, int *mtup)
  * MTU (as e.g. some tunnels do not).  On other failure, returns a positive
  * errno value. */
 int
-netdev_set_mtu(const struct netdev *netdev, int mtu)
+netdev_set_mtu(struct netdev *netdev, int mtu)
 {
 const struct netdev_class *class = netdev->netdev_class;
 int error;
diff --git a/lib/netdev.h b/lib/netdev.h
index dc7ede8..d8ec627 100644
--- a/lib/netdev.h
+++ b/lib/netdev.h
@@ -132,7 +132,7 @@ const char *netdev_get_name(const struct netdev *);
 const char *netdev_get_type(const struct netdev *);
 const char *netdev_get_type_from_name(const char *);
 int netdev_get_mtu(const struct netdev *, int *mtup);
-int netdev_set_mtu(const struct netdev *, int mtu);
+int netdev_set_mtu(struct netdev *, int mtu);
 int netdev_get_ifindex(const struct netdev *);
 int netdev_set_tx_multiq(struct netdev *, unsigned int n_txq);

-- 
1.9.3



[dpdk-dev] [PATCH 5/7] tests: Add a new MTU test.

2016-08-05 Thread Mark Kavanagh
From: Daniele Di Proietto 

Also, netdev-dummy needs to call netdev_change_seq_changed() in
set_mtu().

Signed-off-by: Daniele Di Proietto 
---
 lib/netdev-dummy.c|  5 -
 tests/ofproto-dpif.at | 30 ++
 2 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c
index 92af15f..c8f82b7 100644
--- a/lib/netdev-dummy.c
+++ b/lib/netdev-dummy.c
@@ -1155,7 +1155,10 @@ netdev_dummy_set_mtu(const struct netdev *netdev, int 
mtu)
 struct netdev_dummy *dev = netdev_dummy_cast(netdev);

 ovs_mutex_lock(>mutex);
-dev->mtu = mtu;
+if (dev->mtu != mtu) {
+dev->mtu = mtu;
+netdev_change_seq_changed(netdev);
+}
 ovs_mutex_unlock(>mutex);

 return 0;
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index a46fc81..3638063 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -8859,3 +8859,33 @@ n_packets=0

 OVS_VSWITCHD_STOP
 AT_CLEANUP
+
+AT_SETUP([ofproto - set mtu])
+OVS_VSWITCHD_START
+
+add_of_ports br0 1
+
+# Check that initial MTU is 1500 for 'br0' and 'p1'.
+AT_CHECK([ovs-vsctl get Interface br0 mtu], [0], [dnl
+1500
+])
+AT_CHECK([ovs-vsctl get Interface p1 mtu], [0], [dnl
+1500
+])
+
+# Request new MTU for 'p1'
+AT_CHECK([ovs-vsctl set Interface p1 mtu_request=1600])
+
+# Check that the new MTU is applied
+AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface p1 mtu=1600])
+# The internal port 'br0' should have the same MTU value as p1, becase it's
+# the new bridge minimum.
+AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1600])
+
+AT_CHECK([ovs-vsctl del-port br0 p1])
+
+# When 'p1' is deleted, the internal port should return to the default MTU
+AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1500])
+
+OVS_VSWITCHD_STOP
+AT_CLEANUP
-- 
1.9.3



[dpdk-dev] [PATCH 4/7] netdev-dummy: Add dummy-internal class.

2016-08-05 Thread Mark Kavanagh
From: Daniele Di Proietto 

"internal" netdevs are treated specially in OVS (e.g. for MTU), but
the dummy datapath remaps both "system" and "internal" devices to the
same "dummy" netdev class, so there's no way to discern those in tests.

This commit adds a new "dummy-internal" netdev type, which will be used
by the dummy datapath for internal ports, so that other parts of the
code can understand which ports are internal just by looking at the
netdev object.

The alternative solution, using the original interface type ("internal")
instead of the translated netdev type ("dummy"), is harder to implement,
because in so many places only the netdev object is available.

Signed-off-by: Daniele Di Proietto 
---
 lib/dpif-netdev.c |  2 +-
 lib/netdev-dummy.c| 14 --
 tests/bridge.at   |  6 +++---
 tests/dpctl.at| 12 ++--
 tests/mpls-xlate.at   |  4 ++--
 tests/netdev-type.at  |  2 +-
 tests/ofproto-dpif.at | 18 +-
 tests/ovs-vswitchd.at |  6 +++---
 tests/pmd.at  |  8 
 tests/tunnel-push-pop-ipv6.at |  4 ++--
 tests/tunnel-push-pop.at  |  4 ++--
 tests/tunnel.at   | 28 ++--
 12 files changed, 59 insertions(+), 49 deletions(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index e39362e..6f2e07d 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -888,7 +888,7 @@ static const char *
 dpif_netdev_port_open_type(const struct dpif_class *class, const char *type)
 {
 return strcmp(type, "internal") ? type
-  : dpif_netdev_class_is_dummy(class) ? "dummy"
+  : dpif_netdev_class_is_dummy(class) ? "dummy-internal"
   : "tap";
 }

diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c
index 2a6aa56..92af15f 100644
--- a/lib/netdev-dummy.c
+++ b/lib/netdev-dummy.c
@@ -622,12 +622,15 @@ dummy_netdev_get_conn_state(struct dummy_packet_conn 
*conn)
 }

 static void
-netdev_dummy_run(const struct netdev_class *netdev_class OVS_UNUSED)
+netdev_dummy_run(const struct netdev_class *netdev_class)
 {
 struct netdev_dummy *dev;

 ovs_mutex_lock(_list_mutex);
 LIST_FOR_EACH (dev, list_node, _list) {
+if (netdev_get_class(>up) != netdev_class) {
+continue;
+}
 ovs_mutex_lock(>mutex);
 dummy_packet_conn_run(dev);
 ovs_mutex_unlock(>mutex);
@@ -636,12 +639,15 @@ netdev_dummy_run(const struct netdev_class *netdev_class 
OVS_UNUSED)
 }

 static void
-netdev_dummy_wait(const struct netdev_class *netdev_class OVS_UNUSED)
+netdev_dummy_wait(const struct netdev_class *netdev_class)
 {
 struct netdev_dummy *dev;

 ovs_mutex_lock(_list_mutex);
 LIST_FOR_EACH (dev, list_node, _list) {
+if (netdev_get_class(>up) != netdev_class) {
+continue;
+}
 ovs_mutex_lock(>mutex);
 dummy_packet_conn_wait(>conn);
 ovs_mutex_unlock(>mutex);
@@ -1380,6 +1386,9 @@ netdev_dummy_update_flags(struct netdev *netdev_,
 static const struct netdev_class dummy_class =
 NETDEV_DUMMY_CLASS("dummy", false, NULL);

+static const struct netdev_class dummy_internal_class =
+NETDEV_DUMMY_CLASS("dummy-internal", false, NULL);
+
 static const struct netdev_class dummy_pmd_class =
 NETDEV_DUMMY_CLASS("dummy-pmd", true,
netdev_dummy_reconfigure);
@@ -1751,6 +1760,7 @@ netdev_dummy_register(enum dummy_level level)
 netdev_dummy_override("system");
 }
 netdev_register_provider(_class);
+netdev_register_provider(_internal_class);
 netdev_register_provider(_pmd_class);

 netdev_vport_tunnel_register();
diff --git a/tests/bridge.at b/tests/bridge.at
index 37c55ba..3dbabe5 100644
--- a/tests/bridge.at
+++ b/tests/bridge.at
@@ -12,7 +12,7 @@ add_of_ports br0 1 2
 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
 dummy at ovs-dummy: hit:0 missed:0
br0:
-   br0 65534/100: (dummy)
+   br0 65534/100: (dummy-internal)
p1 1/1: (dummy)
p2 2/2: (dummy)
 ])
@@ -23,7 +23,7 @@ AT_CHECK([ovs-appctl dpctl/del-if dummy at ovs-dummy p1])
 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
 dummy at ovs-dummy: hit:0 missed:0
br0:
-   br0 65534/100: (dummy)
+   br0 65534/100: (dummy-internal)
p2 2/2: (dummy)
 ])

@@ -32,7 +32,7 @@ AT_CHECK([ovs-vsctl del-port p2])
 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
 dummy at ovs-dummy: hit:0 missed:0
br0:
-   br0 65534/100: (dummy)
+   br0 65534/100: (dummy-internal)
p1 1/1: (dummy)
 ])
 OVS_APP_EXIT_AND_WAIT([ovs-vswitchd])
diff --git a/tests/dpctl.at b/tests/dpctl.at
index b6d5dd6..8c761c8 100644
--- a/tests/dpctl.at
+++ b/tests/dpctl.at
@@ -23,14 +23,14 @@ AT_CHECK([ovs-appctl dpctl/show dummy at br0], [0], [dnl
 dummy at br0:
lookups: hit:0 missed:0 lost:0
 

[dpdk-dev] [PATCH 3/7] netdev: Pass 'netdev_class' to ->run() and ->wait().

2016-08-05 Thread Mark Kavanagh
From: Daniele Di Proietto 

This will allow run() and wait() methods to be shared between different
classes and still perform class-specific work.

Signed-off-by: Daniele Di Proietto 
---
 lib/netdev-bsd.c  |  6 +++---
 lib/netdev-dummy.c|  4 ++--
 lib/netdev-linux.c|  6 +++---
 lib/netdev-provider.h | 14 ++
 lib/netdev-vport.c|  4 ++--
 lib/netdev.c  |  4 ++--
 6 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/lib/netdev-bsd.c b/lib/netdev-bsd.c
index 2bba0ed..75a330b 100644
--- a/lib/netdev-bsd.c
+++ b/lib/netdev-bsd.c
@@ -146,7 +146,7 @@ static void ifr_set_flags(struct ifreq *, int flags);
 static int af_link_ioctl(unsigned long command, const void *arg);
 #endif

-static void netdev_bsd_run(void);
+static void netdev_bsd_run(const struct netdev_class *);
 static int netdev_bsd_get_mtu(const struct netdev *netdev_, int *mtup);

 static bool
@@ -180,7 +180,7 @@ netdev_get_kernel_name(const struct netdev *netdev)
  * interface status changes, and eventually calls all the user callbacks.
  */
 static void
-netdev_bsd_run(void)
+netdev_bsd_run(const struct netdev_class *netdev_class OVS_UNUSED)
 {
 rtbsd_notifier_run();
 }
@@ -190,7 +190,7 @@ netdev_bsd_run(void)
  * be called.
  */
 static void
-netdev_bsd_wait(void)
+netdev_bsd_wait(const struct netdev_class *netdev_class OVS_UNUSED)
 {
 rtbsd_notifier_wait();
 }
diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c
index a950409..2a6aa56 100644
--- a/lib/netdev-dummy.c
+++ b/lib/netdev-dummy.c
@@ -622,7 +622,7 @@ dummy_netdev_get_conn_state(struct dummy_packet_conn *conn)
 }

 static void
-netdev_dummy_run(void)
+netdev_dummy_run(const struct netdev_class *netdev_class OVS_UNUSED)
 {
 struct netdev_dummy *dev;

@@ -636,7 +636,7 @@ netdev_dummy_run(void)
 }

 static void
-netdev_dummy_wait(void)
+netdev_dummy_wait(const struct netdev_class *netdev_class OVS_UNUSED)
 {
 struct netdev_dummy *dev;

diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index fa37bcf..1b5f7c1 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -526,7 +526,7 @@ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 
20);
  * changes in the device miimon status, so we can use atomic_count. */
 static atomic_count miimon_cnt = ATOMIC_COUNT_INIT(0);

-static void netdev_linux_run(void);
+static void netdev_linux_run(const struct netdev_class *);

 static int netdev_linux_do_ethtool(const char *name, struct ethtool_cmd *,
int cmd, const char *cmd_name);
@@ -623,7 +623,7 @@ netdev_linux_miimon_enabled(void)
 }

 static void
-netdev_linux_run(void)
+netdev_linux_run(const struct netdev_class *netdev_class OVS_UNUSED)
 {
 struct nl_sock *sock;
 int error;
@@ -697,7 +697,7 @@ netdev_linux_run(void)
 }

 static void
-netdev_linux_wait(void)
+netdev_linux_wait(const struct netdev_class *netdev_class OVS_UNUSED)
 {
 struct nl_sock *sock;

diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h
index ae390cb..5bcfeba 100644
--- a/lib/netdev-provider.h
+++ b/lib/netdev-provider.h
@@ -236,15 +236,21 @@ struct netdev_class {
 int (*init)(void);

 /* Performs periodic work needed by netdevs of this class.  May be null if
- * no periodic work is necessary. */
-void (*run)(void);
+ * no periodic work is necessary.
+ *
+ * 'netdev_class' points to the class.  It is useful in case the same
+ * function is used to implement different classes. */
+void (*run)(const struct netdev_class *netdev_class);

 /* Arranges for poll_block() to wake up if the "run" member function needs
  * to be called.  Implementations are additionally required to wake
  * whenever something changes in any of its netdevs which would cause their
  * ->change_seq() function to change its result.  May be null if nothing is
- * needed here. */
-void (*wait)(void);
+ * needed here.
+ *
+ * 'netdev_class' points to the class.  It is useful in case the same
+ * function is used to implement different classes. */
+void (*wait)(const struct netdev_class *netdev_class);

 /* ##  ## */
 /* ## netdev Functions ## */
diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c
index 87a30f8..7eabd2c 100644
--- a/lib/netdev-vport.c
+++ b/lib/netdev-vport.c
@@ -321,7 +321,7 @@ netdev_vport_update_flags(struct netdev *netdev OVS_UNUSED,
 }

 static void
-netdev_vport_run(void)
+netdev_vport_run(const struct netdev_class *netdev_class OVS_UNUSED)
 {
 uint64_t seq;

@@ -334,7 +334,7 @@ netdev_vport_run(void)
 }

 static void
-netdev_vport_wait(void)
+netdev_vport_wait(const struct netdev_class *netdev_class OVS_UNUSED)
 {
 uint64_t seq;

diff --git a/lib/netdev.c b/lib/netdev.c
index 75bf1cb..589d37c 100644
--- a/lib/netdev.c
+++ b/lib/netdev.c
@@ -160,7 +160,7 @@ netdev_run(void)
 struct netdev_registered_class *rc;
 CMAP_FOR_EACH (rc, cmap_node, _classes) {
 if (rc->class->run) {

[dpdk-dev] [PATCH 2/7] vswitchd: Introduce 'mtu_request' column in Interface.

2016-08-05 Thread Mark Kavanagh
From: Daniele Di Proietto 

The 'mtu_request' column can be used to set the MTU of a specific
interface.

This column is useful because it will allow changing the MTU of DPDK
devices (implemented in a future commit), which are not accessible
outside the ovs-vswitchd process, but it can be used for kernel
interfaces as well.

The current implementation of set_mtu() in netdev-dpdk is removed
because it's broken.  It will be reintroduced by a subsequent commit on
this series.

Signed-off-by: Daniele Di Proietto 
---
 NEWS   |  2 ++
 lib/netdev-dpdk.c  | 53 +-
 vswitchd/bridge.c  |  9 
 vswitchd/vswitch.ovsschema | 10 +++--
 vswitchd/vswitch.xml   | 52 +
 5 files changed, 58 insertions(+), 68 deletions(-)

diff --git a/NEWS b/NEWS
index c2ed71d..ce10982 100644
--- a/NEWS
+++ b/NEWS
@@ -101,6 +101,8 @@ Post-v2.5.0
- ovs-pki: Changed message digest algorithm from SHA-1 to SHA-512 because
  SHA-1 is no longer secure and some operating systems have started to
  disable it in OpenSSL.
+   - Add 'mtu_request' column to the Interface table. It can be used to
+ configure the MTU of non-internal ports.


 v2.5.0 - 26 Feb 2016
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index f37ec1c..60db568 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -1639,57 +1639,6 @@ netdev_dpdk_get_mtu(const struct netdev *netdev, int 
*mtup)
 }

 static int
-netdev_dpdk_set_mtu(const struct netdev *netdev, int mtu)
-{
-struct netdev_dpdk *dev = netdev_dpdk_cast(netdev);
-int old_mtu, err, dpdk_mtu;
-struct dpdk_mp *old_mp;
-struct dpdk_mp *mp;
-uint32_t buf_size;
-
-ovs_mutex_lock(_mutex);
-ovs_mutex_lock(>mutex);
-if (dev->mtu == mtu) {
-err = 0;
-goto out;
-}
-
-buf_size = dpdk_buf_size(mtu);
-dpdk_mtu = FRAME_LEN_TO_MTU(buf_size);
-
-mp = dpdk_mp_get(dev->socket_id, dpdk_mtu);
-if (!mp) {
-err = ENOMEM;
-goto out;
-}
-
-rte_eth_dev_stop(dev->port_id);
-
-old_mtu = dev->mtu;
-old_mp = dev->dpdk_mp;
-dev->dpdk_mp = mp;
-dev->mtu = mtu;
-dev->max_packet_len = MTU_TO_FRAME_LEN(dev->mtu);
-
-err = dpdk_eth_dev_init(dev);
-if (err) {
-dpdk_mp_put(mp);
-dev->mtu = old_mtu;
-dev->dpdk_mp = old_mp;
-dev->max_packet_len = MTU_TO_FRAME_LEN(dev->mtu);
-dpdk_eth_dev_init(dev);
-goto out;
-}
-
-dpdk_mp_put(old_mp);
-netdev_change_seq_changed(netdev);
-out:
-ovs_mutex_unlock(>mutex);
-ovs_mutex_unlock(_mutex);
-return err;
-}
-
-static int
 netdev_dpdk_get_carrier(const struct netdev *netdev, bool *carrier);

 static int
@@ -2964,7 +2913,7 @@ netdev_dpdk_vhost_cuse_reconfigure(struct netdev *netdev)
 netdev_dpdk_set_etheraddr,\
 netdev_dpdk_get_etheraddr,\
 netdev_dpdk_get_mtu,  \
-netdev_dpdk_set_mtu,  \
+NULL,   /* set_mtu */ \
 netdev_dpdk_get_ifindex,  \
 GET_CARRIER,  \
 netdev_dpdk_get_carrier_resets,   \
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index ddf1fe5..397be70 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -775,6 +775,15 @@ bridge_delete_or_reconfigure_ports(struct bridge *br)
 goto delete;
 }

+if (iface->cfg->n_mtu_request == 1
+&& strcmp(iface->type,
+  ofproto_port_open_type(br->type, "internal"))) {
+/* Try to set the MTU to the requested value.  This is not done
+ * for internal interfaces, since their MTU is decided by the
+ * ofproto module, based on other ports in the bridge. */
+netdev_set_mtu(iface->netdev, *iface->cfg->mtu_request);
+}
+
 /* If the requested OpenFlow port for 'iface' changed, and it's not
  * already the correct port, then we might want to temporarily delete
  * this interface, so we can add it back again with the new OpenFlow
diff --git a/vswitchd/vswitch.ovsschema b/vswitchd/vswitch.ovsschema
index 32fdf28..8966803 100644
--- a/vswitchd/vswitch.ovsschema
+++ b/vswitchd/vswitch.ovsschema
@@ -1,6 +1,6 @@
 {"name": "Open_vSwitch",
- "version": "7.13.0",
- "cksum": "889248633 22774",
+ "version": "7.14.0",
+ "cksum": "3974332717 22936",
  "tables": {
"Open_vSwitch": {
  "columns": {
@@ -321,6 +321,12 @@
"mtu": {
  "type": {"key": "integer", "min": 0, "max": 1},
  "ephemeral": true},
+   "mtu_request": {
+ "type": {
+   "key": {"type": "integer",
+   "minInteger": 1},
+   "min": 0,
+   "max": 

[dpdk-dev] [PATCH 1/7] ofproto: Consider datapath_type when looking for internal ports.

2016-08-05 Thread Mark Kavanagh
From: Daniele Di Proietto 

Interfaces with type "internal" end up having a netdev with type "tap"
in the dpif-netdev datapath, so a strcmp will fail to match internal
interfaces.

We can translate the types with ofproto_port_open_type() before calling
strcmp to fix this.

This fixes a minor issue where internal interfaces are considered
non-internal in the userspace datapath for the purpose of adjusting the
MTU.

Signed-off-by: Daniele Di Proietto 
---
 ofproto/ofproto.c | 16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 8e59c69..088f91a 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -220,7 +220,8 @@ static void learned_cookies_flush(struct ofproto *, struct 
ovs_list *dead_cookie
 /* ofport. */
 static void ofport_destroy__(struct ofport *) OVS_EXCLUDED(ofproto_mutex);
 static void ofport_destroy(struct ofport *, bool del);
-static inline bool ofport_is_internal(const struct ofport *);
+static inline bool ofport_is_internal(const struct ofproto *,
+  const struct ofport *);

 static int update_port(struct ofproto *, const char *devname);
 static int init_ports(struct ofproto *);
@@ -2465,7 +2466,7 @@ static void
 ofport_remove(struct ofport *ofport)
 {
 struct ofproto *p = ofport->ofproto;
-bool is_internal = ofport_is_internal(ofport);
+bool is_internal = ofport_is_internal(p, ofport);

 connmgr_send_port_status(ofport->ofproto->connmgr, NULL, >pp,
  OFPPR_DELETE);
@@ -2751,9 +2752,10 @@ init_ports(struct ofproto *p)
 }

 static inline bool
-ofport_is_internal(const struct ofport *port)
+ofport_is_internal(const struct ofproto *p, const struct ofport *port)
 {
-return !strcmp(netdev_get_type(port->netdev), "internal");
+return !strcmp(netdev_get_type(port->netdev),
+   ofproto_port_open_type(p->type, "internal"));
 }

 /* Find the minimum MTU of all non-datapath devices attached to 'p'.
@@ -2770,7 +2772,7 @@ find_min_mtu(struct ofproto *p)

 /* Skip any internal ports, since that's what we're trying to
  * set. */
-if (ofport_is_internal(ofport)) {
+if (ofport_is_internal(p, ofport)) {
 continue;
 }

@@ -2797,7 +2799,7 @@ update_mtu(struct ofproto *p, struct ofport *port)
 port->mtu = 0;
 return;
 }
-if (ofport_is_internal(port)) {
+if (ofport_is_internal(p, port)) {
 if (dev_mtu > p->min_mtu) {
if (!netdev_set_mtu(port->netdev, p->min_mtu)) {
dev_mtu = p->min_mtu;
@@ -2827,7 +2829,7 @@ update_mtu_ofproto(struct ofproto *p)
 HMAP_FOR_EACH (ofport, hmap_node, >ports) {
 struct netdev *netdev = ofport->netdev;

-if (ofport_is_internal(ofport)) {
+if (ofport_is_internal(p, ofport)) {
 if (!netdev_set_mtu(netdev, p->min_mtu)) {
 ofport->mtu = p->min_mtu;
 }
-- 
1.9.3



[dpdk-dev] [PATCH 3/3] eal: remove rte_pci_dev_ids.h

2016-08-05 Thread Ferruh Yigit
All PCI device ids moved to drivers, it is safe to delete
rte_pci_dev_ids.h

Signed-off-by: Ferruh Yigit 
---
 doc/guides/prog_guide/dev_kit_build_system.rst  | 28 +--
 lib/librte_eal/common/Makefile  |  2 +-
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 63 -
 3 files changed, 15 insertions(+), 78 deletions(-)
 delete mode 100644 lib/librte_eal/common/include/rte_pci_dev_ids.h

diff --git a/doc/guides/prog_guide/dev_kit_build_system.rst 
b/doc/guides/prog_guide/dev_kit_build_system.rst
index fa2411f..e657e5f 100644
--- a/doc/guides/prog_guide/dev_kit_build_system.rst
+++ b/doc/guides/prog_guide/dev_kit_build_system.rst
@@ -93,20 +93,20 @@ Each build directory contains include files, libraries, and 
applications:
 cmdline_cirbuf.h   rte_cycles.h rte_memory.h
 cmdline.h  rte_debug.h  rte_mempool.h
 cmdline_parse_etheraddr.h  rte_eal.hrte_memzone.h
-cmdline_parse.hrte_errno.h  rte_pci_dev_ids.h
-cmdline_parse_ipaddr.h rte_ethdev.h rte_pci.h
-cmdline_parse_num.hrte_ether.h  rte_per_lcore.h
-cmdline_parse_portlist.h   rte_fbk_hash.h   rte_prefetch.h
-cmdline_parse_string.h rte_hash_crc.h   rte_random.h
-cmdline_rdline.h   rte_hash.h   rte_ring.h
-cmdline_socket.h   rte_interrupts.h rte_rwlock.h
-cmdline_vt100.hrte_ip.h rte_sctp.h
-exec-env   rte_jhash.h  rte_spinlock.h
-rte_alarm.hrte_launch.h rte_string_fns.h
-rte_atomic.h   rte_lcore.h  rte_tailq.h
-rte_branch_prediction.hrte_log.hrte_tcp.h
-rte_byteorder.hrte_lpm.hrte_timer.h
-rte_common.h   rte_malloc.h rte_udp.h
+cmdline_parse.hrte_errno.h  rte_pci.h
+cmdline_parse_ipaddr.h rte_ethdev.h rte_per_lcore.h
+cmdline_parse_num.hrte_ether.h  rte_prefetch.h
+cmdline_parse_portlist.h   rte_fbk_hash.h   rte_random.h
+cmdline_parse_string.h rte_hash_crc.h   rte_ring.h
+cmdline_rdline.h   rte_hash.h   rte_rwlock.h
+cmdline_socket.h   rte_interrupts.h rte_sctp.h
+cmdline_vt100.hrte_ip.h rte_spinlock.h
+exec-env   rte_jhash.h  rte_string_fns.h
+rte_alarm.hrte_launch.h rte_tailq.h
+rte_atomic.h   rte_lcore.h  rte_tcp.h
+rte_branch_prediction.hrte_log.hrte_timer.h
+rte_byteorder.hrte_lpm.hrte_udp.h
+rte_common.h   rte_malloc.h
 rte_config.h   rte_mbuf.h


diff --git a/lib/librte_eal/common/Makefile b/lib/librte_eal/common/Makefile
index f5ea0ee..bb9810d 100644
--- a/lib/librte_eal/common/Makefile
+++ b/lib/librte_eal/common/Makefile
@@ -34,7 +34,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 INC := rte_branch_prediction.h rte_common.h
 INC += rte_debug.h rte_eal.h rte_errno.h rte_launch.h rte_lcore.h
 INC += rte_log.h rte_memory.h rte_memzone.h rte_pci.h
-INC += rte_pci_dev_ids.h rte_per_lcore.h rte_random.h
+INC += rte_per_lcore.h rte_random.h
 INC += rte_tailq.h rte_interrupts.h rte_alarm.h
 INC += rte_string_fns.h rte_version.h
 INC += rte_eal_memconfig.h rte_malloc_heap.h
diff --git a/lib/librte_eal/common/include/rte_pci_dev_ids.h 
b/lib/librte_eal/common/include/rte_pci_dev_ids.h
deleted file mode 100644
index 1aae6f7..000
--- a/lib/librte_eal/common/include/rte_pci_dev_ids.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*-
- * This file is provided under a dual BSD/GPLv2 license.  When using or
- *   redistributing this file, you may do so under either license.
- *
- *   GPL LICENSE SUMMARY
- *
- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
- *
- *   This program is free software; you can redistribute it and/or modify
- *   it under the terms of version 2 of the GNU General Public License as
- *   published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful, but
- *   WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *   General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *   The full GNU General Public License is included in this distribution
- *   in the file called LICENSE.GPL.
- *
- *   Contact Information:
- *   Intel Corporation
- *
- *   BSD LICENSE
- *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
- *   All rights reserved.
- *
- *   Redistribution and use in source and binary 

[dpdk-dev] [PATCH 2/3] net/igb: move PCI device ids to the driver

2016-08-05 Thread Ferruh Yigit
PCI device ids moved from common header into igb driver itself.

KNI starts using pci_device_id from kni/ethtool/igb driver, this is only
for KNI ethtool support, KNI data path is not effected.

Signed-off-by: Ferruh Yigit 
---
 drivers/net/e1000/igb_ethdev.c |  55 +--
 lib/librte_eal/common/include/rte_pci_dev_ids.h| 107 -
 lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c |   2 +-
 lib/librte_eal/linuxapp/kni/kni_misc.c |  20 +---
 4 files changed, 50 insertions(+), 134 deletions(-)

diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index fbf4d09..4e9e6a3 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -306,22 +306,57 @@ static enum e1000_fc_mode igb_fc_setting = e1000_fc_full;
  * The set of PCI devices this driver supports
  */
 static const struct rte_pci_id pci_id_igb_map[] = {
-
-#define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
-
-{0},
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82576) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82576_FIBER) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82576_SERDES) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82576_QUAD_COPPER) 
},
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, 
E1000_DEV_ID_82576_QUAD_COPPER_ET2) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82576_NS) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82576_NS_SERDES) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82576_SERDES_QUAD) 
},
+
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82575EB_COPPER) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, 
E1000_DEV_ID_82575EB_FIBER_SERDES) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, 
E1000_DEV_ID_82575GB_QUAD_COPPER) },
+
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82580_COPPER) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82580_FIBER) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82580_SERDES) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82580_SGMII) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82580_COPPER_DUAL) 
},
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82580_QUAD_FIBER) 
},
+
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I350_COPPER) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I350_FIBER) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I350_SERDES) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I350_SGMII) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I350_DA4) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I210_COPPER) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I210_COPPER_OEM1) 
},
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I210_COPPER_IT) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I210_FIBER) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I210_SERDES) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I210_SGMII) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I211_COPPER) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, 
E1000_DEV_ID_I354_BACKPLANE_1GBPS) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I354_SGMII) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, 
E1000_DEV_ID_I354_BACKPLANE_2_5GBPS) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_DH89XXCC_SGMII) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_DH89XXCC_SERDES) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, 
E1000_DEV_ID_DH89XXCC_BACKPLANE) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_DH89XXCC_SFP) },
+   { .vendor_id = 0, /* sentinel */ },
 };

 /*
  * The set of PCI devices this driver supports (for 82576 VF)
  */
 static const struct rte_pci_id pci_id_igbvf_map[] = {
-
-#define RTE_PCI_DEV_ID_DECL_IGBVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
-
-{0},
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82576_VF) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_82576_VF_HV) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I350_VF) },
+   { RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I350_VF_HV) },
+   { .vendor_id = 0, /* sentinel */ },
 };

 static const struct rte_eth_desc_lim rx_desc_lim = {
diff --git a/lib/librte_eal/common/include/rte_pci_dev_ids.h 
b/lib/librte_eal/common/include/rte_pci_dev_ids.h
index 1f9d372..1aae6f7 100644
--- a/lib/librte_eal/common/include/rte_pci_dev_ids.h
+++ b/lib/librte_eal/common/include/rte_pci_dev_ids.h
@@ -57,114 +57,7 @@
  *
  */

-#ifndef RTE_PCI_DEV_ID_DECL_IGB
-#define RTE_PCI_DEV_ID_DECL_IGB(vend, dev)
-#endif
-
-#ifndef 

[dpdk-dev] [PATCH 1/3] net/ixgbe: move PCI device ids to the driver

2016-08-05 Thread Ferruh Yigit
PCI device ids moved from common header into ixgbe driver itself.

KNI starts using pci_device_id from kni/ethtool/ixgbe driver, this is
only for KNI ethtool support, KNI data path is not effected.

Signed-off-by: Ferruh Yigit 
---
 drivers/net/ixgbe/ixgbe_ethdev.c|  79 ++--
 lib/librte_eal/common/include/rte_pci_dev_ids.h | 156 
 lib/librte_eal/linuxapp/kni/kni_misc.c  |  17 ++-
 3 files changed, 76 insertions(+), 176 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index d478a15..fb618ef 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -429,23 +429,80 @@ static int ixgbe_dev_udp_tunnel_port_del(struct 
rte_eth_dev *dev,
  * The set of PCI devices this driver supports
  */
 static const struct rte_pci_id pci_id_ixgbe_map[] = {
-
-#define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
-#include "rte_pci_dev_ids.h"
-
-{ .vendor_id = 0, /* sentinel */ },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_BX) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AF_DUAL_PORT) 
},
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, 
IXGBE_DEV_ID_82598AF_SINGLE_PORT) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AT) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AT2) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_SFP_LOM) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_CX4) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, 
IXGBE_DEV_ID_82598_CX4_DUAL_PORT) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, 
IXGBE_DEV_ID_82598_DA_DUAL_PORT) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, 
IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_XF_LR) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_KX4) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_KX4_MEZZ) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_KR) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, 
IXGBE_DEV_ID_82599_COMBO_BACKPLANE) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, 
IXGBE_SUBDEV_ID_82599_KX4_KR_MEZZ) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_CX4) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_SUBDEV_ID_82599_SFP) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_SUBDEV_ID_82599_RNDC) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_SUBDEV_ID_82599_560FLR) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_SUBDEV_ID_82599_ECNA_DP) 
},
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, 
IXGBE_DEV_ID_82599_BACKPLANE_FCOE) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_FCOE) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_EM) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_SF2) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_SF_QP) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_QSFP_SF_QP) 
},
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599EN_SFP) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_XAUI_LOM) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_T3_LOM) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_LS) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T1) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_SFP) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_10G_T) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_1G_T) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550T) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550T1) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_KR) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_KR_L) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SFP_N) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SGMII) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SGMII_L) 
},
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_10G_T) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_QSFP) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_QSFP_N) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SFP) },
+   { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_1G_T) },
+   { 

[dpdk-dev] [PATCH 0/3] remove rte_pci_dev_ids.h

2016-08-05 Thread Ferruh Yigit
This patchset moves remaining PCI device ids for ixgbe and igb drivers,
updates KNI code which uses these ids to use pci_device_ids from kni/ethtool
drivers,
and finally removes the rte_pci_dev_ids.h and updates document refers it.

Ferruh Yigit (3):
  net/ixgbe: move PCI device ids to the driver
  net/igb: move PCI device ids to the driver
  eal: remove rte_pci_dev_ids.h

 doc/guides/prog_guide/dev_kit_build_system.rst |  28 +-
 drivers/net/e1000/igb_ethdev.c |  55 +++-
 drivers/net/ixgbe/ixgbe_ethdev.c   |  79 -
 lib/librte_eal/common/Makefile |   2 +-
 lib/librte_eal/common/include/rte_pci_dev_ids.h| 326 -
 lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c |   2 +-
 lib/librte_eal/linuxapp/kni/kni_misc.c |  33 +--
 7 files changed, 139 insertions(+), 386 deletions(-)
 delete mode 100644 lib/librte_eal/common/include/rte_pci_dev_ids.h

-- 
2.7.4



[dpdk-dev] [PATCH 1/7] ofproto: Consider datapath_type when looking for internal ports.

2016-08-05 Thread Kavanagh, Mark B
Please disregard this patchset - it was sent erroneously to the incorrect 
mailing list.

I've already removed the related patches from Patchwork.

Cheers,
Mark 

>-Original Message-
>From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Mark Kavanagh
>Sent: Friday, August 5, 2016 3:30 PM
>To: dev at dpdk.org; diproiettod at vmware.com
>Cc: i.maximets at samsung.com
>Subject: [dpdk-dev] [PATCH 1/7] ofproto: Consider datapath_type when looking 
>for internal
>ports.
>
>From: Daniele Di Proietto 
>
>Interfaces with type "internal" end up having a netdev with type "tap"
>in the dpif-netdev datapath, so a strcmp will fail to match internal
>interfaces.
>
>We can translate the types with ofproto_port_open_type() before calling
>strcmp to fix this.
>
>This fixes a minor issue where internal interfaces are considered
>non-internal in the userspace datapath for the purpose of adjusting the
>MTU.
>
>Signed-off-by: Daniele Di Proietto 
>---
> ofproto/ofproto.c | 16 +---
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
>diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
>index 8e59c69..088f91a 100644
>--- a/ofproto/ofproto.c
>+++ b/ofproto/ofproto.c
>@@ -220,7 +220,8 @@ static void learned_cookies_flush(struct ofproto *, struct 
>ovs_list
>*dead_cookie
> /* ofport. */
> static void ofport_destroy__(struct ofport *) OVS_EXCLUDED(ofproto_mutex);
> static void ofport_destroy(struct ofport *, bool del);
>-static inline bool ofport_is_internal(const struct ofport *);
>+static inline bool ofport_is_internal(const struct ofproto *,
>+  const struct ofport *);
>
> static int update_port(struct ofproto *, const char *devname);
> static int init_ports(struct ofproto *);
>@@ -2465,7 +2466,7 @@ static void
> ofport_remove(struct ofport *ofport)
> {
> struct ofproto *p = ofport->ofproto;
>-bool is_internal = ofport_is_internal(ofport);
>+bool is_internal = ofport_is_internal(p, ofport);
>
> connmgr_send_port_status(ofport->ofproto->connmgr, NULL, >pp,
>  OFPPR_DELETE);
>@@ -2751,9 +2752,10 @@ init_ports(struct ofproto *p)
> }
>
> static inline bool
>-ofport_is_internal(const struct ofport *port)
>+ofport_is_internal(const struct ofproto *p, const struct ofport *port)
> {
>-return !strcmp(netdev_get_type(port->netdev), "internal");
>+return !strcmp(netdev_get_type(port->netdev),
>+   ofproto_port_open_type(p->type, "internal"));
> }
>
> /* Find the minimum MTU of all non-datapath devices attached to 'p'.
>@@ -2770,7 +2772,7 @@ find_min_mtu(struct ofproto *p)
>
> /* Skip any internal ports, since that's what we're trying to
>  * set. */
>-if (ofport_is_internal(ofport)) {
>+if (ofport_is_internal(p, ofport)) {
> continue;
> }
>
>@@ -2797,7 +2799,7 @@ update_mtu(struct ofproto *p, struct ofport *port)
> port->mtu = 0;
> return;
> }
>-if (ofport_is_internal(port)) {
>+if (ofport_is_internal(p, port)) {
> if (dev_mtu > p->min_mtu) {
>if (!netdev_set_mtu(port->netdev, p->min_mtu)) {
>dev_mtu = p->min_mtu;
>@@ -2827,7 +2829,7 @@ update_mtu_ofproto(struct ofproto *p)
> HMAP_FOR_EACH (ofport, hmap_node, >ports) {
> struct netdev *netdev = ofport->netdev;
>
>-if (ofport_is_internal(ofport)) {
>+if (ofport_is_internal(p, ofport)) {
> if (!netdev_set_mtu(netdev, p->min_mtu)) {
> ofport->mtu = p->min_mtu;
> }
>--
>1.9.3



[dpdk-dev] [PATCH v3] i40e: enable i40e pmd on ARM platform

2016-08-05 Thread Jianbo Liu
And add read memory barrier to avoid status inconsistency
between two RX descriptors readings.

Signed-off-by: Jianbo Liu 
---
 config/defconfig_arm64-armv8a-linuxapp-gcc | 2 +-
 doc/guides/nics/features/i40e.ini  | 1 +
 drivers/net/i40e/i40e_rxtx.c   | 2 ++
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/config/defconfig_arm64-armv8a-linuxapp-gcc 
b/config/defconfig_arm64-armv8a-linuxapp-gcc
index 1a17126..08f282b 100644
--- a/config/defconfig_arm64-armv8a-linuxapp-gcc
+++ b/config/defconfig_arm64-armv8a-linuxapp-gcc
@@ -46,6 +46,6 @@ CONFIG_RTE_EAL_IGB_UIO=n

 CONFIG_RTE_LIBRTE_IVSHMEM=n
 CONFIG_RTE_LIBRTE_FM10K_PMD=n
-CONFIG_RTE_LIBRTE_I40E_PMD=n
+CONFIG_RTE_LIBRTE_I40E_INC_VECTOR=n

 CONFIG_RTE_SCHED_VECTOR=n
diff --git a/doc/guides/nics/features/i40e.ini 
b/doc/guides/nics/features/i40e.ini
index fb3fb60..0d143bc 100644
--- a/doc/guides/nics/features/i40e.ini
+++ b/doc/guides/nics/features/i40e.ini
@@ -45,3 +45,4 @@ Linux UIO= Y
 Linux VFIO   = Y
 x86-32   = Y
 x86-64   = Y
+ARMv8= Y
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 554d167..57825fb 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -994,6 +994,8 @@ i40e_rx_scan_hw_ring(struct i40e_rx_queue *rxq)
I40E_RXD_QW1_STATUS_SHIFT;
}

+   rte_smp_rmb();
+
/* Compute how many status bits were set */
for (j = 0, nb_dd = 0; j < I40E_LOOK_AHEAD; j++)
nb_dd += s[j] & (1 << I40E_RX_DESC_STATUS_DD_SHIFT);
-- 
2.4.11



[dpdk-dev] [RFC] vhost: Add indirect descriptors support to the TX path

2016-08-05 Thread Maxime Coquelin


On 08/03/2016 04:03 PM, Yuanhan Liu wrote:
> On Tue, Jul 12, 2016 at 04:32:12PM +0200, Maxime Coquelin wrote:
>> Indirect descriptors are usually supported by virtio-net devices,
>> allowing to dispatch a large number of large requests.
>>
>> When the virtio device sends a packet using indirect descriptors,
>> only one slot is used in the ring, even for large packets.
>>
>> Signed-off-by: Maxime Coquelin 
>> ---
>> I have a two questions regarding the implementation of this feature:
>>
>> 1. Should I add a check to ensure the indirect feature is supported
>> (i.e. the negociation succeeded) when having an indirect desc?
>>
>> 2. Should I check in copy_desc_to_mbuf() that we don't have a nested
>> indirect descriptor?
>>
>> Both these sanity checks are recommended from the virtio spec, but
>> since it is to be done in the hot path, it may introduce some
>> performance penalties.
>>
>> Note that the first check is not done in the Kernel vhost driver, whereas
>> the second one is.
>
> I think we could firstly follow the Linux kernel implementation.
OK, I can do that in the v2.
>
>> +if (vq->desc[desc_indexes[i]].flags & VRING_DESC_F_INDIRECT) {
>> +desc = (struct vring_desc *)gpa_to_vva(dev,
>> +vq->desc[desc_indexes[i]].addr);
>> +rte_prefetch0(desc);
>> +size = vq->desc[desc_indexes[i]].len / sizeof(*desc);
>> +idx = 0;
>> +} else {
>> +desc = vq->desc;
>> +size = vq->size;
>> +idx = desc_indexes[i];
>
> Why not fetching the desc here and feeding it to copy_desc_to_mbuf(),
> instead of using "desc" and "idx" combination and fetching it inside
> that function?
Because the desc we pass to copy_desc_to_mbuf() is the descriptor that 
will be used as the base later to get the next descriptors.

In case of indirect descriptors, the first descriptor of the chain is 
always the first element of the descriptors array, which is not the case 
for direct descriptors.

>
> Overall, this patch looks good to me. As stated in IRC, It'd be great
> if you could offer some performance data.
Sure.
I lacked time this week, and next week will be likely the same.
But I agree we need the perf data before it gets merged.

> Thanks for the work, and apologize for the late review!
Not a problem, you review is appreciated.

Thanks,
Maxime


[dpdk-dev] [RFC 0/4] Use Google Test as DPDK unit test framework

2016-08-05 Thread Yerden Zhumabekov

On 03.08.2016 15:57, Doherty, Declan wrote:
> Some of the things I've come across include:
> No standard output format to integrated with continuous regression systems
> No ability to specify specific unit tests or groups of tests to run from the 
> command line
> No standard set of test assertions used across the test suites.
> No standard setup and teardown functions across test suites, state from 
> previous test
> suite can break current
> Requirement to use a python script to orchestrate test runs.
> No support for mocking functionality.
>
> I know that none of the above couldn't be fixed in our current test 
> application, but I would
> question if it is effort worthwhile when we take an off the shelf framework, 
> which does all
> those things and a whole lot more, which has been test and used in a huge 
> variety of
> projects.
>
> I certainly willing to look at other frameworks both C and C++ but I yet to 
> find a C framework
> which come close to the usability and flexibility of the popular C++ ones.

We use cmocka.org for tests. Written in C. It has support for:
* mocking;
* setup/teardown;
* asserts;
* test groups.

Output is nicely formatted.


[dpdk-dev] rte_eth_dev_attach returns 0, although device is not attached

2016-08-05 Thread Bruce Richardson
On Thu, Aug 04, 2016 at 04:47:25PM +0100, Ferruh Yigit wrote:
> On 8/4/2016 3:54 PM, Igor Ryzhov wrote:
> > 
> >> 4 ???. 2016 ?., ? 16:21, Ferruh Yigit  >> > ???(?):
> >>
> >> On 8/4/2016 12:51 PM, Igor Ryzhov wrote:
> >>> Hello Ferruh,
> >>>
>  4 ???. 2016 ?., ? 14:33, Ferruh Yigit   > ???(?):
> 
>  Hi Igor,
> 
>  On 8/3/2016 5:58 PM, Igor Ryzhov wrote:
> > Hello.
> >
> > Function rte_eth_dev_attach can return false positive result.
> > It happens because rte_eal_pci_probe_one returns zero if no driver
> > is found for the device:
> > ret = pci_probe_all_drivers(dev);
> > if (ret < 0)
> > goto err_return;
> > return 0;
> > (pci_probe_all_drivers returns 1 in that case)
> >
> > For example, it can be easily reproduced by trying to attach virtio
> > device, managed by kernel driver.
> 
>  You are right, and I did able to reproduce this issue with virtio as you
>  suggest.
> 
>  But I wonder why rte_eth_dev_get_port_by_addr() is not catching this.
>  Perhaps a dev->attached check needs to be added into this function.
> >>
> >> With a second check, rte_eth_dev_get_port_by_addr() catches it if the
> >> driver is missing.
> >>
> >> But for virtio case, problem is not missing driver.
> >> Problem is eth_virtio_dev_init() is returning a positive value on fail.
> >>
> >> Call stack is:
> >> rte_eal_pci_probe_one
> >>pci_probe_all_drivers
> >>rte_eal_pci_probe_one_driver
> >>rte_eth_dev_init
> >>   eth_virtio_dev_init
> >>
> >> So rte_eal_pci_probe_one_driver() also returns positive value, as no
> >> driver found, and rte_eth_dev_get_port_by_addr() returns a valid
> >> port_id, since rte_eth_dev_init() allocated an eth_dev.
> >>
> >> Briefly, this can be fixed in virtio pmd, instead of eal pci.
> >>
> 
> >
> > I think it should be:
> > ret = pci_probe_all_drivers(dev);
> > if (ret)
> > goto err_return;
> > return 0;
> 
>  Your proposal looks good to me. Will you send a patch?
> >>>
> >>
> >> Original code silently ignores the if driver is missing for that dev,
> >> although it is still questionable, I think we can keep this as it is.
> >>
> >>> Patch sent.
> >>
> >> Sorry for this, but can you please test with following modification in
> >> virtio:
> >> index 07d6449..c74 100644
> >> --- a/drivers/net/virtio/virtio_ethdev.c
> >> +++ b/drivers/net/virtio/virtio_ethdev.c
> >> @@ -1156,7 +1156,7 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev)
> >>if (pci_dev) {
> >>ret = vtpci_init(pci_dev, hw, _flags);
> >>if (ret)
> >> -   return ret;
> >> +   return -1;
> >>}
> >>
> >>/* Reset the device although not necessary at startup */
> > 
> > I think it's not a good change, because it will break the idea of this
> > patch - http://dpdk.org/browse/dpdk/commit/?id=ac5e1d83
> 
> Yes, breaks this one, I wasn't aware of this patch. But in this patch,
> commit log says: "return 1 to tell the upper layer we
> don't take over this device.", I am not sure upper layer designed for this.
> 
> > 
> > Also, with your patch the application will not start, because
> > rte_eal_pci_probe will fail:
> > 
> > if (ret < 0)
> > rte_exit(EXIT_FAILURE, "Requested device " PCI_PRI_FMT
> >  " cannot be used\n", dev->addr.domain, dev->addr.bus,
> >  dev->addr.devid, dev->addr.function);
> 
> Yes it fails, and this looks like intended behavior. This failure is
> correct according code.
> 
> > 
> > And now I think that maybe we should change the way rte_eal_pci_probe works.
> > I think we shouldn't stop the application if just one of PCI devices is
> > not probed successfully.
> 
> Agreed. Overall rte_exit() usage already discussed a few times.
> 
> I think best option is:
> - don't exit app if rte_eal_pci_probe() fails, only print an error.

Whether or not the pci probe exits the app or not, I think it should signal
a serious error if the probe fails and a device was explicitly whitelisted on
the commandline. Given the user explicitly requested the device, a failure to
use is probably a problem which requires the user to fix before running the
app.

/Bruce



[dpdk-dev] [PATCH] app/testpmd: fix DCB config issue on ixgbe

2016-08-05 Thread Wenzhuo Lu
An issue is found that DCB cannot be configured on ixgbe
NICs. It's said the TX queue number is not right.
On ixgbe the max TX queue number is not fixed, it depends
on the multi-queue mode.

This patch adds the device configuration before getting
info in the DCB configuration process. So the right info
can be got depending on the configuration.

Fixes: 96c0450dff86 (ixgbe: fix dropping packets from unsupported Tx queues)
Signed-off-by: Wenzhuo Lu 
---
 app/test-pmd/testpmd.c | 39 +--
 1 file changed, 21 insertions(+), 18 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 1428974..ba41bea 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1962,17 +1962,30 @@ init_port_dcb_config(portid_t pid,
 uint8_t pfc_en)
 {
struct rte_eth_conf port_conf;
-   struct rte_eth_dev_info dev_info;
struct rte_port *rte_port;
int retval;
uint16_t i;

-   rte_eth_dev_info_get(pid, _info);
+   rte_port = [pid];
+
+   memset(_conf, 0, sizeof(struct rte_eth_conf));
+   /* Enter DCB configuration status */
+   dcb_config = 1;
+
+   /*set configuration of DCB in vt mode and DCB in non-vt mode*/
+   retval = get_eth_dcb_conf(_conf, dcb_mode, num_tcs, pfc_en);
+   if (retval < 0)
+   return retval;
+   port_conf.rxmode.hw_vlan_filter = 1;
+
+   (void)rte_eth_dev_configure(pid, 0, 0, _conf);
+   rte_eth_dev_info_get(pid, _port->dev_info);

/* If dev_info.vmdq_pool_base is greater than 0,
 * the queue id of vmdq pools is started after pf queues.
 */
-   if (dcb_mode == DCB_VT_ENABLED && dev_info.vmdq_pool_base > 0) {
+   if (dcb_mode == DCB_VT_ENABLED &&
+   rte_port->dev_info.vmdq_pool_base > 0) {
printf("VMDQ_DCB multi-queue mode is nonsensical"
" for port %d.", pid);
return -1;
@@ -1982,13 +1995,13 @@ init_port_dcb_config(portid_t pid,
 * and has the same number of rxq and txq in dcb mode
 */
if (dcb_mode == DCB_VT_ENABLED) {
-   nb_rxq = dev_info.max_rx_queues;
-   nb_txq = dev_info.max_tx_queues;
+   nb_rxq = rte_port->dev_info.max_rx_queues;
+   nb_txq = rte_port->dev_info.max_tx_queues;
} else {
/*if vt is disabled, use all pf queues */
-   if (dev_info.vmdq_pool_base == 0) {
-   nb_rxq = dev_info.max_rx_queues;
-   nb_txq = dev_info.max_tx_queues;
+   if (rte_port->dev_info.vmdq_pool_base == 0) {
+   nb_rxq = rte_port->dev_info.max_rx_queues;
+   nb_txq = rte_port->dev_info.max_tx_queues;
} else {
nb_rxq = (queueid_t)num_tcs;
nb_txq = (queueid_t)num_tcs;
@@ -1997,16 +2010,6 @@ init_port_dcb_config(portid_t pid,
}
rx_free_thresh = 64;

-   memset(_conf, 0, sizeof(struct rte_eth_conf));
-   /* Enter DCB configuration status */
-   dcb_config = 1;
-
-   /*set configuration of DCB in vt mode and DCB in non-vt mode*/
-   retval = get_eth_dcb_conf(_conf, dcb_mode, num_tcs, pfc_en);
-   if (retval < 0)
-   return retval;
-
-   rte_port = [pid];
memcpy(_port->dev_conf, _conf, sizeof(struct rte_eth_conf));

rxtx_port_config(rte_port);
-- 
1.9.3



[dpdk-dev] [PATCH 3/3] net/virtio_user: fix dev not freed after init error

2016-08-05 Thread Jianfeng Tan
Currently, when virtio_user device fails to be started (e.g., vhost
unix socket does not exit), the init function does not return struct
rte_eth_dev (and some other structs) back to ether layer. And what's
more, it does not report the error to upper layer.

The fix is to free those structs and report error when failing to
start virtio_user devices.

Fixes: ce2eabdd43ec ("net/virtio-user: add virtual device")

Signed-off-by: Jianfeng Tan 
---
 drivers/net/virtio/virtio_user_ethdev.c | 23 +++
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/drivers/net/virtio/virtio_user_ethdev.c 
b/drivers/net/virtio/virtio_user_ethdev.c
index daef09b..62ccb0b 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -313,6 +313,17 @@ virtio_user_eth_dev_alloc(const char *name)
return eth_dev;
 }

+static void
+virtio_user_eth_dev_free(struct rte_eth_dev *eth_dev)
+{
+   struct rte_eth_dev_data *data = eth_dev->data;
+   struct virtio_hw *hw = data->dev_private;
+
+   rte_free(hw->virtio_user_dev);
+   rte_free(hw);
+   rte_eth_dev_release_port(eth_dev);
+}
+
 /* Dev initialization routine. Invoked once for each virtio vdev at
  * EAL init time, see rte_eal_dev_init().
  * Returns 0 on success.
@@ -328,7 +339,7 @@ virtio_user_pmd_devinit(const char *name, const char 
*params)
uint64_t queue_size = VIRTIO_USER_DEF_Q_SZ;
char *path = NULL;
char *mac_addr = NULL;
-   int ret = -1;
+   int result = -1, ret;

if (!params || params[0] == '\0') {
PMD_INIT_LOG(ERR, "arg %s is mandatory for virtio_user",
@@ -411,15 +422,19 @@ virtio_user_pmd_devinit(const char *name, const char 
*params)

hw = eth_dev->data->dev_private;
if (virtio_user_dev_init(hw->virtio_user_dev, path, queues, cq,
-queue_size, mac_addr) < 0)
+queue_size, mac_addr) < 0) {
+   PMD_INIT_LOG(ERR, "virtio_user_dev_init fails");
+   virtio_user_eth_dev_free(eth_dev);
goto end;
+   }

/* previously called by rte_eal_pci_probe() for physical dev */
if (eth_virtio_dev_init(eth_dev) < 0) {
PMD_INIT_LOG(ERR, "eth_virtio_dev_init fails");
+   virtio_user_eth_dev_free(eth_dev);
goto end;
}
-   ret = 0;
+   result = 0;

 end:
if (kvlist)
@@ -428,7 +443,7 @@ end:
free(path);
if (mac_addr)
free(mac_addr);
-   return ret;
+   return result;
 }

 /** Called by rte_eth_dev_detach() */
-- 
2.7.4



[dpdk-dev] [PATCH 2/3] net/virtio_user: fix wrong sequence of messages

2016-08-05 Thread Jianfeng Tan
When virtio_user is used with VPP's native vhost user, it cannot
send/receive any packets.

The root cause is that vpp-vhost-user translates the message
VHOST_USER_SET_FEATURES as puting this device into init state,
aka, zero all related structures. However, previous code
puts this message at last in the whole initialization process,
which leads to all previous information are zeroed.

To fix this issue, we rearrange the sequence of those messages.
  - step 0, send VHOST_USER_SET_VRING_CALL so that vhost allocates
virtqueue structures;
  - step 1, send VHOST_USER_SET_FEATURES to confirm the features;
  - step 2, send VHOST_USER_SET_MEM_TABLE to share mem regions;
  - step 3, send VHOST_USER_SET_VRING_NUM, VHOST_USER_SET_VRING_BASE,
VHOST_USER_SET_VRING_ADDR, VHOST_USER_SET_VRING_KICK for each
queue;
  - ...

Fixes: 37a7eb2ae816 ("net/virtio-user: add device emulation layer")

Reported-by: Zhihong Wang 
Signed-off-by: Jianfeng Tan 
---
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 120 ++-
 1 file changed, 72 insertions(+), 48 deletions(-)

diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c 
b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 2c4e999..afdf721 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -45,20 +45,14 @@
 #include "../virtio_ethdev.h"

 static int
-virtio_user_kick_queue(struct virtio_user_dev *dev, uint32_t queue_sel)
+virtio_user_create_queue(struct virtio_user_dev *dev, uint32_t queue_sel)
 {
-   int callfd, kickfd;
+   /* Of all per virtqueue MSGs, make sure VHOST_SET_VRING_CALL come
+* firstly because vhost depends on this msg to allocate virtqueue
+* pair.
+*/
+   int callfd;
struct vhost_vring_file file;
-   struct vhost_vring_state state;
-   struct vring *vring = >vrings[queue_sel];
-   struct vhost_vring_addr addr = {
-   .index = queue_sel,
-   .desc_user_addr = (uint64_t)(uintptr_t)vring->desc,
-   .avail_user_addr = (uint64_t)(uintptr_t)vring->avail,
-   .used_user_addr = (uint64_t)(uintptr_t)vring->used,
-   .log_guest_addr = 0,
-   .flags = 0, /* disable log */
-   };

/* May use invalid flag, but some backend leverages kickfd and callfd as
 * criteria to judge if dev is alive. so finally we use real event_fd.
@@ -68,22 +62,30 @@ virtio_user_kick_queue(struct virtio_user_dev *dev, 
uint32_t queue_sel)
PMD_DRV_LOG(ERR, "callfd error, %s\n", strerror(errno));
return -1;
}
-   kickfd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);
-   if (kickfd < 0) {
-   close(callfd);
-   PMD_DRV_LOG(ERR, "kickfd error, %s\n", strerror(errno));
-   return -1;
-   }
-
-   /* Of all per virtqueue MSGs, make sure VHOST_SET_VRING_CALL come
-* firstly because vhost depends on this msg to allocate virtqueue
-* pair.
-*/
file.index = queue_sel;
file.fd = callfd;
vhost_user_sock(dev->vhostfd, VHOST_USER_SET_VRING_CALL, );
dev->callfds[queue_sel] = callfd;

+   return 0;
+}
+
+static int
+virtio_user_kick_queue(struct virtio_user_dev *dev, uint32_t queue_sel)
+{
+   int kickfd;
+   struct vhost_vring_file file;
+   struct vhost_vring_state state;
+   struct vring *vring = >vrings[queue_sel];
+   struct vhost_vring_addr addr = {
+   .index = queue_sel,
+   .desc_user_addr = (uint64_t)(uintptr_t)vring->desc,
+   .avail_user_addr = (uint64_t)(uintptr_t)vring->avail,
+   .used_user_addr = (uint64_t)(uintptr_t)vring->used,
+   .log_guest_addr = 0,
+   .flags = 0, /* disable log */
+   };
+
state.index = queue_sel;
state.num = vring->num;
vhost_user_sock(dev->vhostfd, VHOST_USER_SET_VRING_NUM, );
@@ -97,6 +99,12 @@ virtio_user_kick_queue(struct virtio_user_dev *dev, uint32_t 
queue_sel)
 * lastly because vhost depends on this msg to judge if
 * virtio is ready.
 */
+   kickfd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);
+   if (kickfd < 0) {
+   PMD_DRV_LOG(ERR, "kickfd error, %s\n", strerror(errno));
+   return -1;
+   }
+   file.index = queue_sel;
file.fd = kickfd;
vhost_user_sock(dev->vhostfd, VHOST_USER_SET_VRING_KICK, );
dev->kickfds[queue_sel] = kickfd;
@@ -104,44 +112,43 @@ virtio_user_kick_queue(struct virtio_user_dev *dev, 
uint32_t queue_sel)
return 0;
 }

-int
-virtio_user_start_device(struct virtio_user_dev *dev)
+static int
+virtio_user_queue_setup(struct virtio_user_dev *dev,
+   int (*fn)(struct virtio_user_dev *, uint32_t))
 {
-   uint64_t features;
uint32_t i, queue_sel;
-   int ret;
-
-   /* construct memory region inside each 

[dpdk-dev] [PATCH 1/3] net/virtio_user: fix queue pair not enabled

2016-08-05 Thread Jianfeng Tan
When virtio_user is used with OVS-DPDK (with mq disabled), it cannot
receive any packets.

It's because when vhost provides VHOST_USER_GET_PROTOCOL_FEATURES,
all queue pairs are initialized in the disabled state. Quote
QEMU/docs/specs/vhost-user.txt:
If VHOST_USER_F_PROTOCOL_FEATURES has not been negotiated, the
ring is initialized in an enabled state.
If VHOST_USER_F_PROTOCOL_FEATURES has been negotiated, the ring
is initialized in a disabled state.

In OVS-DPDK, all queue pairs are in the disabled state by default.
When used with QEMU, QEMU will set it as enabled in the process of
initialization. So the fix here is to include similar logic in
virtio_user.

Fixes: 37a7eb2ae816 ("net/virtio-user: add device emulation layer")

Reported-by: Ning Li 
Signed-off-by: Jianfeng Tan 
---
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c 
b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 376c9cf..2c4e999 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -131,6 +131,13 @@ virtio_user_start_device(struct virtio_user_dev *dev)
}
}

+   /* As this feature is negotiated from the vhost, all queues are
+* initialized in the disabled state. For non-mq case, we enable
+* the 1st queue pair by default.
+*/
+   if (dev->features & (1ull << VHOST_USER_GET_PROTOCOL_FEATURES))
+   vhost_user_enable_queue_pair(dev->vhostfd, 0, 1);
+
/* After setup all virtqueues, we need to set_features so that these
 * features can be set into each virtqueue in vhost side. And before
 * that, make sure VHOST_USER_F_PROTOCOL_FEATURES is added if mq is
-- 
2.7.4



[dpdk-dev] [PATCH 0/3] fix virtio_user issues

2016-08-05 Thread Jianfeng Tan
Patch 1: fix issue when using virtio_user with OVS-DPDK.
Patch 2: fix issue when using virtio_user with VPP.
Patch 3: fix issue when failing to start virtio_user devices.

Signed-off-by: Jianfeng Tan 

Jianfeng Tan (3):
  net/virtio_user: fix queue pair not enabled
  net/virtio_user: fix wrong sequence of messages
  net/virtio_user: fix dev not freed after init error

 drivers/net/virtio/virtio_user/virtio_user_dev.c | 115 ++-
 drivers/net/virtio/virtio_user_ethdev.c  |  23 -
 2 files changed, 92 insertions(+), 46 deletions(-)

-- 
2.7.4



[dpdk-dev] [PATCH] net/fm10k: fix MAC address remnant in switch

2016-08-05 Thread Xiao Wang
When testpmd quits with two ports, the second port's MAC address
remains in the MAC table of switch manager.

There should be some time for HW to quiesce when closing a port,
otherwise the subsequent port close won't be handled correctly.

This patch adds some delay after turning off a logic port, just as
what the kernel driver does.

Fixes: 8b5c9ec20b7b ("support VMDQ in MAC/VLAN filter")

Reported-by: Xueqin Lin 
Signed-off-by: Xiao Wang 
---
 drivers/net/fm10k/fm10k_ethdev.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 01f4a72..89d99d4 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -52,6 +52,8 @@
 #define MAX_QUERY_SWITCH_STATE_TIMES 10
 /* Wait interval to get switch status */
 #define WAIT_SWITCH_MSG_US10
+/* A period of quiescence for switch */
+#define FM10K_SWITCH_QUIESCE_US 1
 /* Number of chars per uint32 type */
 #define CHARS_PER_UINT32 (sizeof(uint32_t))
 #define BIT_MASK_PER_UINT32 ((1 << CHARS_PER_UINT32) - 1)
@@ -1233,6 +1235,9 @@ fm10k_dev_close(struct rte_eth_dev *dev)
MAX_LPORT_NUM, false);
fm10k_mbx_unlock(hw);

+   /* allow 10ms for device to quiesce */
+   rte_delay_us(FM10K_SWITCH_QUIESCE_US);
+
/* Stop mailbox service first */
fm10k_close_mbx_service(hw);
fm10k_dev_stop(dev);
-- 
1.9.3



[dpdk-dev] [RFC 0/4] Use Google Test as DPDK unit test framework

2016-08-05 Thread Remy Horton

On 05/08/2016 08:41, Yerden Zhumabekov wrote:
[..]
> We use cmocka.org for tests. Written in C. It has support for:
> * mocking;
> * setup/teardown;
> * asserts;
> * test groups.
>
> Output is nicely formatted.

Cmocka's mocking relies on Gnu ld's --wrap feature, which has problems 
if the function being mocked is defined in the same compilation unit 
that it is used. Pity really as otherwise it looked quite good to me.

..Remy


[dpdk-dev] test: failed to clone dpdk source in windows

2016-08-05 Thread linhaifeng
hi,thomas

Could you change the name of file in directory 
app/test/test_pci_sysfs/bus/pci/devices/ ?
I think somebody like us also cann't access internet in liunux.Windows not 
support file name
include ':'.

thanks
linhaifeng



[dpdk-dev] test: failed to clone dpdk source in windows

2016-08-05 Thread Thomas Monjalon
2016-08-05 09:44, Thomas Monjalon:
> 2016-08-05 10:09, linhaifeng:
> > hi,thomas
> > 
> > Could you change the name of file in directory 
> > app/test/test_pci_sysfs/bus/pci/devices/ ?
> > I think somebody like us also cann't access internet in liunux.Windows not 
> > support file name
> > include ':'.
> 
> Not sure to understand the use case.
> This is a fake sysfs, we cannot change the names.

In other words, Windows is not supported, neither for runtime
nor for development.
For information, which filesystem do not support ':'?

If someone wants to add this support, the fake sysfs could have slightly
different names and rightly renamed during compilation.


[dpdk-dev] test: failed to clone dpdk source in windows

2016-08-05 Thread Thomas Monjalon
2016-08-05 10:09, linhaifeng:
> hi,thomas
> 
> Could you change the name of file in directory 
> app/test/test_pci_sysfs/bus/pci/devices/ ?
> I think somebody like us also cann't access internet in liunux.Windows not 
> support file name
> include ':'.

Not sure to understand the use case.
This is a fake sysfs, we cannot change the names.


[dpdk-dev] [RFC 0/4] Use Google Test as DPDK unit test framework

2016-08-05 Thread Thomas Monjalon
2016-08-04 19:55, Wiles, Keith:
> 
> > On Aug 4, 2016, at 2:47 PM, Jim Murphy  wrote:
> > 
> > Hi,
> > 
> > We are looking at using our existing test environment for our DPDK
> > applications that will run on our build servers. Hughpages therefore is an
> > issue. What is involved in running DPDK without huge pages?
> 
> Command line option  ?no-huge should work. Note two dashs in front.

Most of drivers still require hugepages.
A big rework would be needed to make them work without hugepages.


[dpdk-dev] [PATCH 2/3] net/virtio_user: fix wrong sequence of messages

2016-08-05 Thread Stephen Hemminger
On Fri,  5 Aug 2016 11:36:42 +
Jianfeng Tan  wrote:

> When virtio_user is used with VPP's native vhost user, it cannot
> send/receive any packets.
> 
> The root cause is that vpp-vhost-user translates the message
> VHOST_USER_SET_FEATURES as puting this device into init state,
> aka, zero all related structures. However, previous code
> puts this message at last in the whole initialization process,
> which leads to all previous information are zeroed.

Not sure what correct behavior is here.  It could be that VPP native
vhost user is broken.  What does QEMU/KVM vhost do in this case?
I would take that as the authoritative source for semantics.

> To fix this issue, we rearrange the sequence of those messages.
>   - step 0, send VHOST_USER_SET_VRING_CALL so that vhost allocates
> virtqueue structures;
>   - step 1, send VHOST_USER_SET_FEATURES to confirm the features;
>   - step 2, send VHOST_USER_SET_MEM_TABLE to share mem regions;
>   - step 3, send VHOST_USER_SET_VRING_NUM, VHOST_USER_SET_VRING_BASE,
> VHOST_USER_SET_VRING_ADDR, VHOST_USER_SET_VRING_KICK for each
> queue;
>   - ...
> 
> Fixes: 37a7eb2ae816 ("net/virtio-user: add device emulation layer")



[dpdk-dev] [PATCH 3/3] net/virtio_user: fix dev not freed after init error

2016-08-05 Thread Stephen Hemminger
On Fri,  5 Aug 2016 11:36:43 +
Jianfeng Tan  wrote:

> diff --git a/drivers/net/virtio/virtio_user_ethdev.c 
> b/drivers/net/virtio/virtio_user_ethdev.c
> index daef09b..62ccb0b 100644
> --- a/drivers/net/virtio/virtio_user_ethdev.c
> +++ b/drivers/net/virtio/virtio_user_ethdev.c
> @@ -313,6 +313,17 @@ virtio_user_eth_dev_alloc(const char *name)
>   return eth_dev;
>  }
>  
> +static void
> +virtio_user_eth_dev_free(struct rte_eth_dev *eth_dev)
> +{
> + struct rte_eth_dev_data *data = eth_dev->data;
> + struct virtio_hw *hw = data->dev_private;
> +
> + rte_free(hw->virtio_user_dev);
> + rte_free(hw);
> + rte_eth_dev_release_port(eth_dev);
> +}
> +
>  /* Dev initialization routine. Invoked once for each virtio vdev at
>   * EAL init time, see rte_eal_dev_init().
>   * Returns 0 on success.
> @@ -328,7 +339,7 @@ virtio_user_pmd_devinit(const char *name, const char 
> *params)
>   uint64_t queue_size = VIRTIO_USER_DEF_Q_SZ;
>   char *path = NULL;
>   char *mac_addr = NULL;
> - int ret = -1;
> + int result = -1, ret;

It is not clear why two return value variables are needed?
>  
>   if (!params || params[0] == '\0') {
>   PMD_INIT_LOG(ERR, "arg %s is mandatory for virtio_user",
> @@ -411,15 +422,19 @@ virtio_user_pmd_devinit(const char *name, const char 
> *params)
>  
>   hw = eth_dev->data->dev_private;
>   if (virtio_user_dev_init(hw->virtio_user_dev, path, queues, cq,
> -  queue_size, mac_addr) < 0)
> +  queue_size, mac_addr) < 0) {
> + PMD_INIT_LOG(ERR, "virtio_user_dev_init fails");
> + virtio_user_eth_dev_free(eth_dev);
>   goto end;
> + }
>  
>   /* previously called by rte_eal_pci_probe() for physical dev */
>   if (eth_virtio_dev_init(eth_dev) < 0) {
>   PMD_INIT_LOG(ERR, "eth_virtio_dev_init fails");
> + virtio_user_eth_dev_free(eth_dev);
>   goto end;
>   }
> - ret = 0;
> + result = 0;
>  
>  end:
>   if (kvlist)
> @@ -428,7 +443,7 @@ end:
>   free(path);
>   if (mac_addr)
>   free(mac_addr);

Unrelated, but this code could eliminate those if () tests.

> - return ret;
> + return result;
>  }


[dpdk-dev] [RFC 0/4] Use Google Test as DPDK unit test framework

2016-08-05 Thread Neil Horman
On Fri, Aug 05, 2016 at 10:11:56AM +0100, Remy Horton wrote:
> 
> On 05/08/2016 08:41, Yerden Zhumabekov wrote:
> [..]
> > We use cmocka.org for tests. Written in C. It has support for:
> > * mocking;
> > * setup/teardown;
> > * asserts;
> > * test groups.
> > 
> > Output is nicely formatted.
> 
> Cmocka's mocking relies on Gnu ld's --wrap feature, which has problems if
> the function being mocked is defined in the same compilation unit that it is
> used. Pity really as otherwise it looked quite good to me.
> 
Can't you use ld's --undefined option to get the correct behavior?  I thought
that was specifically what it was there for.

Neil

> ..Remy
> 


[dpdk-dev] [PATCH] net/fm10k: fix MAC address remnant in switch

2016-08-05 Thread Chen, Jing D
Hi,

> -Original Message-
> From: Wang, Xiao W
> Sent: Friday, August 05, 2016 11:18 AM
> To: Chen, Jing D ; Lin, Xueqin  intel.com>
> Cc: dev at dpdk.org; Wang, Xiao W 
> Subject: [PATCH] net/fm10k: fix MAC address remnant in switch
> 
> When testpmd quits with two ports, the second port's MAC address
> remains in the MAC table of switch manager.
> 
> There should be some time for HW to quiesce when closing a port,
> otherwise the subsequent port close won't be handled correctly.
> 
> This patch adds some delay after turning off a logic port, just as
> what the kernel driver does.
> 
> Fixes: 8b5c9ec20b7b ("support VMDQ in MAC/VLAN filter")
> 
> Reported-by: Xueqin Lin 
> Signed-off-by: Xiao Wang 
Acked-by : Jing Chen 



[dpdk-dev] Mbuf leak issue with IXGBE in vector mod

2016-08-05 Thread Lu, Wenzhuo
Hi Ori,

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Ori Zakin
> Sent: Thursday, August 4, 2016 11:38 PM
> To: Zhang, Helin; Ananyev, Konstantin; dev at dpdk.org
> Subject: [dpdk-dev] Mbuf leak issue with IXGBE in vector mod
> 
> Hi,
> 
> 
>   1.  When calling rte_eth_dev_stop mbuf pool is depleted.
> There appears to be a race condition that occurs when RTE_IXGBE_INC_VECTOR
> is defined:
> ixgbe_reset_rx_queue(struct ixgbe_adapter *adapter, struct ixgbe_rx_queue
> *rxq) { ??.
> 
> #ifdef RTE_IXGBE_INC_VECTOR
> rxq->rxrearm_start = 0;
> sleep here appears to solve
> rxq->rxrearm_nb = 0;
> #endif
> 
> 
> Behaviour also described here:
> http://dpdk.org/ml/archives/users/2016-April/000488.html
> 
> 
>   2.  Steps to recreate issue:
>  *   rte_mempool_free_count
>  *   rte_eth_dev_stop
>  *   rte_mempool_free_count - should see a spike in allocated mbufs from
> mempool.
Have you stopped the rx/tx before do this stop/start? I think we'll hit this 
memory leak problem if the traffic is not stopped. There's an assumption that 
it?s APP's responsibility to stop rx/tx before operating the ports as we know 
dpdk is lockless.

> 
>   3.  2 workarounds that appear to work:
>  *   Set CONFIG_RTE_IXGBE_INC_VECTOR=n.
>  *   Add sleep in ixgbe_reset_rx_queue
> 
> 
> Regards.
> Ori Zakin