[dpdk-dev] Running 2 process on the same machine

2016-11-07 Thread Wiles, Keith

> On Nov 7, 2016, at 7:28 AM, Keren Hochman  
> wrote:
> 
> Hi,
> I need to run 2 process that uses dpdk on the same machine. One uses dpdk
> drivers, and the other just read from a pcap file.  If I disable hugepages
> in the second process rte_mempool_create fails. What is the correct way to
> handle this?

If you look at the two scripts in Pktgen pktgen-master.sh and pktgen-slave.sh 
these two scripts setup two instances of pktgen on the same machine. Plus you 
can read the README.md file.

http://dpdk.org/browse/apps/pktgen-dpdk/refs/

You have to make sure you have enough memory (huge pages) allocated for both 
instances to run.

Then use ?file-prefix XX to give each instance a different prefix for the huge 
page files in /dev/hugepages if that is the location of the files on your 
system. I would remove any files in that directory to free up the memory.

Use the ?socket-mem to allocate the correct amount of memory for each instances 
this way DPDK does not consume all the pages for a given instance.

Make sure you blacklist the ports you do not want on the first instance using 
-b option and then blacklist the ports from the first instance while allowing 
the other ports to be used on the second one.

That should do it for most cases.

> 
> Thanks, Keren

Regards,
Keith



[dpdk-dev] [dpdk-announce] release candidate 16.11-rc3

2016-11-07 Thread Thomas Monjalon
A new DPDK release candidate is ready for testing:
http://dpdk.org/browse/dpdk/tag/?id=v16.11-rc3

It will be hopefully the last release candidate for 16.11.
As it is not so small, please test it very well in order to
secure the release planned to be out at the end of this week.

Thank you everyone


[dpdk-dev] [PATCH] doc: add limitation for L3fwd-power app

2016-11-07 Thread Thomas Monjalon
> > L3fwd-power app needs vector mode to be disabled in order to work
> > properly. The app used to work previously, because it was using Rx scalar
> > function, but now it uses vector function.
> > 
> > Vector mode needs to be disabled to make the app works, which has been
> > documented in release notes.
> > 
> > Signed-off-by: Pablo de Lara 
> 
> Acked-by: John McNamara 

Applied, thanks


[dpdk-dev] [PATCH v2] doc/guides: add more info about VT-d/iommu settings

2016-11-07 Thread Thomas Monjalon
> > Add more information about VT-d/iommu settings for QAT PMD.
> > Remove limitation indicating QAT driver is not performance tuned.
> > 
> > Signed-off-by: Fiona Trahe 
> Acked-by: Arek Kusztal 

Wrapped lines and applied.


[dpdk-dev] [PATCH] doc: remove Intel reference from multi-process support guide

2016-11-07 Thread Thomas Monjalon
> > multi-process support has been verified on non IA such as ARMv8.
> > 
> > Signed-off-by: Jerin Jacob 
> 
> Acked-by: John McNamara 

Applied, thanks


[dpdk-dev] [PATCH] doc: fix typos

2016-11-07 Thread Thomas Monjalon
> > Fixes typos present in the documentation and code comments.
> > 
> > Signed-off-by: Alain Leon 
> 
> Acked-by: John McNamara 

Applied, thanks


[dpdk-dev] [PATCH v3] examples/ipsec-secgw: fix pointer to local outside scope

2016-11-07 Thread Thomas Monjalon
2016-11-07 17:31, Ferruh Yigit:
> On 11/7/2016 5:25 PM, Fan Zhang wrote:
> > Coverity issue: 137871
> > Fixes: 0d547ed03717 ("examples/ipsec-secgw: support configuration file")
> > 
> > Signed-off-by: Fan Zhang 
> 
> Although checkpatch will complain about long lines, I believe it is
> better not to wrap log messages.
> 
> Acked-by: Ferruh Yigit 

Wrapped after "error: " to avoid too long lines
while being able to grep the rest of the message,
and applied.



[dpdk-dev] [PATCH v2] examples/ipsec-secgw: fix copy into fixed size buffer issue

2016-11-07 Thread Thomas Monjalon
2016-11-07 15:59, Ferruh Yigit:
> On 11/7/2016 2:21 PM, Fan Zhang wrote:
> > Fixes: 0d547ed0 ("examples/ipsec-secgw: support configuration
> > file")
> > Coverity issue: 137875
> > 
> > Signed-off-by: Fan Zhang 
> 
> Acked-by: Ferruh Yigit 

Applied


[dpdk-dev] [PATCH] ethdev: fix statistics description

2016-11-07 Thread Thomas Monjalon
2016-11-02 10:21, Morten Br?rup:
> > From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> > > 2016-08-26 18:08, Wei Dai:
> > > >  /**
> > > >   * A structure used to retrieve statistics for an Ethernet port.
> > > > + * Not all statistics fields in struct rte_eth_stats are supported
> > > > + * by any type of network interface card (NIC). If any statistics
> > > > + * field is not supported, its value is 0 .
> > > >   */
> > > >  struct rte_eth_stats {
> > >
> > > I'm missing the point of this patch.
> > > Why do you think it is a fix?
> > >
> > > John, any opinion?
> 
> I think the source code comment is an improvement.
[...]

Applied as an improvement (not a fix).


[dpdk-dev] [PATCH] lib/ip_frag: fix IP reassembly not working issue

2016-11-07 Thread Thomas Monjalon
2016-11-06 12:16, Wenzhuo Lu:
> After changing pkt[0] to pkt[], the example IP reassembly is not
> working.
> It's weird because this change is fine. There should be no
> difference between them.
> As a workaround, revert this change.
> 
> Fixes: 347a1e037fd3 (lib: use C99 syntax for zero-size arrays)
> 
> Reported-by: Huilong Xu 
> Signed-off-by: Wenzhuo Lu 

Applied, thanks

Please keep us informed if you understand the issue.


[dpdk-dev] [PATCH] net/vmxnet3: fix mbuf release on reset/stop

2016-11-07 Thread Thomas Monjalon
2016-10-26 10:45, Yong Wang:
> During device reset/stop, vmxnet3 releases all mbufs in tx and
> rx cmd ring.  For rx, we should go over all ring descriptors and
> free using rte_pktmbuf_free_seg() instead of rte_pktmbuf_free()
> as the metadata of the mbuf might not be properly initialized
> (initialization after mempool creation is done in the rx routine)
> and the mbuf should always be a single-segment one when populated.
> For tx, we can use the existing way as mbuf, if any, will be a
> valid one stashed in the eop.
> 
> Fixes: dfaff37fc46d ("vmxnet3: import new vmxnet3 poll mode driver 
> implementation")
> Signed-off-by: Yong Wang 

Applied, thanks


[dpdk-dev] [PATCH] net/qede: fix gcc compiler option checks

2016-11-07 Thread Thomas Monjalon
2016-10-27 23:37, Rasesh Mody:
> From: Rasesh Mody 
> 
> Using GCC_VERSION to check gcc version and decide whether to include
> that compiler option.
> 
> Fixes: ec94dbc57362 ("qede: add base driver")

No need for the above line.
It is fixing the commit below (which fixes above one).

> Fixes: ecc7a5a27ffe ("net/qede/base: fix 32-bit build")
> 
> Signed-off-by: Rasesh Mody 

Applied, thanks


[dpdk-dev] [PATCH] net/qede: fix gcc compiler option checks

2016-11-07 Thread Thomas Monjalon
2016-10-28 22:49, Mody, Rasesh:
> > From: Stephen Hemminger
> > >  ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
> > > -ifeq ($(shell gcc -Wno-unused-but-set-variable -Werror -E - < /dev/null 
> > > > /dev/null 2>&1; echo $$?),0)
> > > +ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1)
> > >  CFLAGS_BASE_DRIVER += -Wno-unused-but-set-variable
> > >  endif
> > >  CFLAGS_BASE_DRIVER += -Wno-missing-declarations
> > > -ifeq ($(shell gcc -Wno-maybe-uninitialized -Werror -E - < /dev/null > 
> > > /dev/null 2>&1; echo $$?),0)
> > > +ifeq ($(shell test $(GCC_VERSION) -ge 46 && echo 1), 1)
> > >  CFLAGS_BASE_DRIVER += -Wno-maybe-uninitialized
> > >  endif
> > 
> > Does this mean that less compiler checking is done or more?
> 
> With higher version of compilers more compiler checking is done, for older 
> compilers less checking is done. As some of the older compiles do not have 
> newly added checking capabilities. Testing with latest compilers ensures we 
> do lot more checking.

It is basically less checking.
It disables some checks if the compiler support them because it would
make compilation failing.

Why would it fail? Because as other base drivers, the code is messy.

> > It seems lots of drivers make the excuse:
> >  "the base driver comes from another group and is known buggy but can't be
> >  fixed"
> > That doesn't reflect well on the quality of the DPDK.

You're right Stephen. It is an excuse which has been accepted in DPDK.
Should we be stricter?


[dpdk-dev] [PATCH v3] net/qede: fix advertising link speed capability

2016-11-07 Thread Thomas Monjalon
2016-10-31 11:35, Rasesh Mody:
> From: Harish Patil 
> 
> Fix to advertise device's link speed capability based on NVM
> port configuration instead of returning driver supported speeds.
> 
> Fixes: 95e67b479506 ("net/qede: add 100G link speed capability")
> 
> Signed-off-by: Harish Patil 
[...]
> + /* Fill up the native advertised speed */
> + switch (params.speed.advertised_speeds) {
> + case NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_10G:
> + adv_speed = 1;
> + break;
> + case NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_25G:
> + adv_speed = 25000;
> + break;
> + case NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_40G:
> + adv_speed = 4;
> + break;
> + case NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_50G:
> + adv_speed = 5;
> + break;
> + case NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_BB_100G:
> + adv_speed = 10;
> + break;
> + default:
> + DP_NOTICE(hwfn, false, "Unknown speed\n");
> + adv_speed = 0;
> + }
> + if_link->adv_speed = adv_speed;

The qede devices support only one speed?
I guess it is wrong but it is a step in right direction so it
will be enough for 16.11.

Applied


[dpdk-dev] [PATCH 1/3 v3] bnxt: use appropriate data type in bnxt_alloc_vnic_attributes

2016-11-07 Thread Thomas Monjalon
2016-11-07 09:12, Ajit Khaparde:
> Prevent the arithmetic in bnxt_alloc_vnic_attributes from causing
> any unintentional havoc because of the usage of a signed variable.
> 
> Coverity: 137874
> 
> Signed-off-by: Ajit Khaparde 

Series applied, thanks

As a regular contributor, please follow the contribution guidelines:
http://dpdk.org/dev#send


[dpdk-dev] [PATCH 0/2] update mlx5 release note and guide

2016-11-07 Thread Thomas Monjalon
> > Nelio Laranjeiro (2):
> >   doc: update mlx5 dependencies
> >   doc: add mlx5 release notes
> 
> Acked-by: Adrien Mazarguil 

Applied with 2/2 v2, thanks


[dpdk-dev] [PATCH] doc: fix mlx5 features overview

2016-11-07 Thread Thomas Monjalon
> > Fixes: 75ef62a94301 ("net/mlx5: fix link speed capability information")
> > Fixes: 188408719888 ("net/mlx5: fix support for newer link speeds")
> > 
> > Signed-off-by: Nelio Laranjeiro 
> 
> Acked-by: John McNamara 

Applied, thanks


[dpdk-dev] [PATCH 0/3] fix Rx checksum offloads

2016-11-07 Thread Thomas Monjalon
2016-11-02 16:57, Adrien Mazarguil:
> On Wed, Nov 02, 2016 at 11:39:36AM +0100, Nelio Laranjeiro wrote:
> > Fill correctly the Mbuf Rx offloads.
> > 
> > Nelio Laranjeiro (3):
> >   net/mlx5: fix Rx checksum macros
> >   net/mlx5: define explicit fields for Rx offloads
> >   net/mlx: fix support for new Rx checksum flags
> > 
> >  drivers/net/mlx4/mlx4.c  | 21 --
> >  drivers/net/mlx5/mlx5_prm.h  | 37 +-
> >  drivers/net/mlx5/mlx5_rxtx.c | 93 
> > 
> >  3 files changed, 87 insertions(+), 64 deletions(-)
> > 
> 
> Thanks. For the series:
> 
> Acked-by: Adrien Mazarguil 

Applied, thanks


[dpdk-dev] how to search this mailing list? is gmane link archive broken?

2016-11-07 Thread Thomas Monjalon
2016-11-07 17:12, Montorsi, Francesco:
> Hi all,
> if this was already raised, sorry for that. 
> I noticed that the gmane archive for this mailing list is not working anymore:
> 
> http://news.gmane.org/gmane.comp.networking.dpdk.devel
> 
> reports "Page not found". Also I noticed that the gmane link on the dpdk.org 
> website has been removed.

Gmane was closed and is coming back.
Look at this page:
http://gmane.org/gmane.comp.networking.dpdk.devel
"Not all of Gmane is back yet - We're working hard to restore everything"

> That was my only way to search through the archives of this mailing list... 
> is there any other way to search them?

For old posts, Google works well enough.

We could also try to upgrade from Mailman 2 to Mailman 3 which provides
a modern interface with a search box and a lot of other cool features.
Fedora is using it:
https://lists.fedoraproject.org/archives/list/devel at 
lists.fedoraproject.org/


[dpdk-dev] how to search this mailing list? is gmane link archive broken?

2016-11-07 Thread Andriy Berestovskyy
Hey,
You can try "site:" Google search operator, i.e. try to google:

site:dpdk.org/ml/archives/dev/ 

Regards,
Andriy


On Mon, Nov 7, 2016 at 6:12 PM, Montorsi, Francesco
 wrote:
> Hi all,
> if this was already raised, sorry for that.
> I noticed that the gmane archive for this mailing list is not working anymore:
>
> http://news.gmane.org/gmane.comp.networking.dpdk.devel
>
> reports "Page not found". Also I noticed that the gmane link on the dpdk.org 
> website has been removed.
> That was my only way to search through the archives of this mailing list... 
> is there any other way to search them?
>
> Thanks,
>
> Francesco Montorsi
>
>
>



-- 
Andriy Berestovskyy


[dpdk-dev] [PATCH] net/mlx5: fix handling of small mbuf sizes

2016-11-07 Thread Thomas Monjalon
2016-10-28 14:19, Adrien Mazarguil:
> On Mon, Oct 24, 2016 at 11:10:59AM +0300, Raslan Darawsheh wrote:
> > When mbufs are smaller than MRU, multi-segment support must be enabled to
> > default set when not in promiscuous or allmulticast modes.
> > 
> > Fixes: 9964b965ad69 ("net/mlx5: re-add Rx scatter support")
> > 
> > Signed-off-by: Raslan Darawsheh 
[...]
> > +   /* If smaller than MRU, multi-segment support must be enabled. */
> > +   if (mb_len < (priv->mtu > dev->data->dev_conf.rxmode.max_rx_pkt_len ?
> > +dev->data->dev_conf.rxmode.max_rx_pkt_len :
> > +priv->mtu
> > +))
> 
> Let's move poor "))" to the end of the previous line.
[...]
> Besides the above comment:
> 
> Acked-by: Adrien Mazarguil 

Fixed and applied, thanks


[dpdk-dev] [PATCH] net/mlx5: fix wrong use of vector instruction

2016-11-07 Thread Thomas Monjalon
2016-11-02 16:56, Adrien Mazarguil:
> On Tue, Nov 01, 2016 at 08:13:27AM +, Elad Persiko wrote:
> > Constraint alignment was not respected in Tx.
> > 
> > Fixes: 1d88ba171942 ("net/mlx5: refactor Tx data path")
> > 
> > Signed-off-by: Elad Persiko 
> 
> Acked-by: Adrien Mazarguil 

"wrong use of vector instruction" is the cause, not the issue.
Reworded: "fix buffer alignment in Tx"

It would have been valuable to describe the consequences.

Applied


[dpdk-dev] [PATCH] doc: update release notes with enic PMD changes

2016-11-07 Thread Thomas Monjalon
> > Signed-off-by: John Daley 
> 
> Acked-by: John McNamara 

Applied with few fixes


[dpdk-dev] [PATCH] net/enic: fix max packet length check

2016-11-07 Thread Thomas Monjalon
2016-11-01 11:08, John Daley:
> When the device was configured with an explicit maximum packet length,
> it would fail if the value was greater than MTU configured in CIMC/UCSM
> (plus L2 header length). It should have been compared against maximum
> allowed by the device.
> 
> Fixes: bb34ffb848a0 ("net/enic: determine max egress packet size and max MTU")
> 
> Signed-off-by: John Daley 

Applied, thanks


[dpdk-dev] [PATCH 0/2] net/ena: check for free descriptors

2016-11-07 Thread Thomas Monjalon
2016-10-29 03:06, Jakub Palider:
> In some configurations there is mismatch between declared and actual
> descriptor count which under heavy load may lead to resource shortage.
> 
> The first patch unifies the way head and tail indexes are handled and
> is crucial for compactness and succeeding patch correctness.
> The second patch runs check for available descriptor count.
> 
> Jakub Palider (2):
>   net/ena: use unmasked head/tail values
>   net/ena: check for free buffers prior to xmit

Applied, thanks


[dpdk-dev] [PATCH v4 2/2] net/i40e: fix VF bonded device link down

2016-11-07 Thread Thomas Monjalon
2016-11-04 17:10, Qiming Yang:
> If VF device is used as slave of a bond device, it will be polled
> periodically through alarm. Interrupt is involved here. And then
> VF will send I40E_VIRTCHNL_OP_GET_LINK_STAT message to
> PF to query the status. The response is handled by interrupt
> callback. Interrupt is involved here again. That's why bond
> device cannot bring up.
> 
> This patch removes I40E_VIRTCHNL_OP_GET_LINK_STAT
> message. Link status in VF driver will be updated when PF driver
> notify it, and VF stores this link status locally. VF driver just
> returns the local status when being required.
> 
> Fixes: 4861cde46116 ("i40e: new poll mode driver")
> 
> Signed-off-by: Qiming Yang 
> Acked-by: Jingjing Wu 

Series applied, thanks and welcome Qiming!


[dpdk-dev] [PATCH RESEND v2] net/i40e: fix floating VEB issue

2016-11-07 Thread Thomas Monjalon
2016-11-04 19:08, Yuanhan Liu:
> From: Beilei Xing 
> 
> Turning off S-TAG identification will impact floating VEB,
> VFs can't communicate with each other.
> This patch fixes this issue by judging whether floating
> VEB is enabled, S-TAG identification will be turned off
> only when floating VEB is disabled.
> 
> Fixes: 4d61120d5ce7 ("net/i40e: fix dropping packets with ethertype 0x88A8")
> 
> Signed-off-by: Beilei Xing 
> Acked-by: Jingjing Wu 

Applied, thanks


[dpdk-dev] [PATCH] net/i40e: fix dcb configure failure

2016-11-07 Thread Thomas Monjalon
> > Removing stopping LLDP in firmware is a workaround for a known errata which
> > can cause Rx hang. But the changing will cause DCB configuration fails. 
> > That is
> > because when LLDP is enabled, the return value of i40e_init_dcb is success. 
> > But
> > following check just considered the case when LLDP agent is disabled.
> > This patch fixes this issue.
> > 
> > Fixes: fcbd40d4327b ("net/i40e: fix Rx hang when disable LLDP")
> > Signed-off-by: Jingjing Wu 
> Acked-by: Beilei Xing

Applied, thanks


[dpdk-dev] [PATCH v3] examples/ipsec-secgw: fix pointer to local outside scope

2016-11-07 Thread Ferruh Yigit
On 11/7/2016 5:25 PM, Fan Zhang wrote:
> Coverity issue: 137871
> Fixes: 0d547ed03717 ("examples/ipsec-secgw: support configuration file")
> 
> Signed-off-by: Fan Zhang 
> ---

Although checkpatch will complain about long lines, I believe it is
better not to wrap log messages.

Acked-by: Ferruh Yigit 



[dpdk-dev] Running 2 process on the same machine

2016-11-07 Thread Keren Hochman
Hi,
I need to run 2 process that uses dpdk on the same machine. One uses dpdk
drivers, and the other just read from a pcap file.  If I disable hugepages
in the second process rte_mempool_create fails. What is the correct way to
handle this?

Thanks, Keren


[dpdk-dev] [PATCH v3] examples/ipsec-secgw: fix pointer to local outside scope

2016-11-07 Thread Fan Zhang
Coverity issue: 137871
Fixes: 0d547ed03717 ("examples/ipsec-secgw: support configuration file")

Signed-off-by: Fan Zhang 
---
 examples/ipsec-secgw/parser.c | 116 +++---
 1 file changed, 52 insertions(+), 64 deletions(-)

diff --git a/examples/ipsec-secgw/parser.c b/examples/ipsec-secgw/parser.c
index 598f435..c5f2508 100644
--- a/examples/ipsec-secgw/parser.c
+++ b/examples/ipsec-secgw/parser.c
@@ -487,8 +487,7 @@ parse_cfg_file(const char *cfg_filename)
struct parse_status status = {0};

if (f == NULL) {
-   rte_panic("Error: invalid file descriptor %s\n",
-   cfg_filename);
+   rte_panic("Error: invalid file descriptor %s\n", cfg_filename);
goto error_exit;
}

@@ -503,86 +502,75 @@ parse_cfg_file(const char *cfg_filename)

do {
char oneline[1024];
-
+   char *pos;
get_s = fgets(oneline, 1024, f);
-   if (get_s) {
-   char *pos;

-   line_num++;
+   if (!get_s)
+   break;

-   if (strlen(oneline) > 1022) {
-   rte_panic("%s:%u: error: the line "
-   "contains more characters the "
-   "parser can handle\n",
-   cfg_filename, line_num);
-   goto error_exit;
-   }
+   line_num++;

-   /* process comment char '#' */
-   if (oneline[0] == '#')
-   continue;
+   if (strlen(oneline) > 1022) {
+   rte_panic("%s:%u: error: the line contains more 
characters the parser can handle\n",
+   cfg_filename, line_num);
+   goto error_exit;
+   }

-   pos = strchr(oneline, '#');
-   if (pos != NULL)
-   *pos = '\0';
-
-   /* process line concatenator '\' */
-   pos = strchr(oneline, 92);
-   if (pos != NULL) {
-   if (pos != oneline+strlen(oneline) - 2) {
-   rte_panic("%s:%u: error: no "
-   "character should exist "
-   "after '\\' symbol\n",
-   cfg_filename, line_num);
-   goto error_exit;
-   }
-
-   *pos = '\0';
-
-   if (strlen(oneline) + strlen(str) > 1022) {
-   rte_panic("%s:%u: error: the "
-   "concatenated line "
-   "contains more characters "
-   "the parser can handle\n",
-   cfg_filename, line_num);
-   goto error_exit;
-   }
-
-   strncpy(str + strlen(str), oneline,
-   strlen(oneline));
+   /* process comment char '#' */
+   if (oneline[0] == '#')
+   continue;

-   continue;
+   pos = strchr(oneline, '#');
+   if (pos != NULL)
+   *pos = '\0';
+
+   /* process line concatenator '\' */
+   pos = strchr(oneline, 92);
+   if (pos != NULL) {
+   if (pos != oneline+strlen(oneline) - 2) {
+   rte_panic("%s:%u: error: no character should 
exist after '\\'\n",
+   cfg_filename, line_num);
+   goto error_exit;
}

-   /* copy the line to str and process */
+   *pos = '\0';
+
if (strlen(oneline) + strlen(str) > 1022) {
-   rte_panic("%s:%u: error: the line "
-   "contains more characters the "
-   "parser can handle\n",
+   rte_panic("%s:%u: error: the concatenated line 
contains more characters the parser can handle\n",
cfg_filename, line_num);
goto error_exit;
}
+
strncpy(str + strlen(str), oneline,
strlen(oneline));

-   str[strlen(str)] = '\n';
-   if 

[dpdk-dev] [PATCH v2 10/10] net/virtio: fix multiple queue enabling

2016-11-07 Thread Yuanhan Liu
On Sat, Nov 05, 2016 at 05:41:05PM +0800, Yuanhan Liu wrote:
> When queue number shrinks to 1 from X, the following code stops us
> sending the multiple queue ctrl message:
> 
> if (nb_queues > 1) {
> if (virtio_set_multiple_queues(dev, nb_queues) != 0)
> return -EINVAL;
> }
> 
> This ends up with still X queues being enabled, which is obviously
> wrong. Fix it by removing the check.
> 
> Fixes: 823ad647950a ("virtio: support multiple queues")
> 
> Signed-off-by: Yuanhan Liu 

This breaks the virtio-user case, where ctrl-queue is not enabled by
defeault.

Here is an update patch would fix this.

--yliu

---
>From 22502943764a99b1398d40f0110f8ce28323323a Mon Sep 17 00:00:00 2001
From: Yuanhan Liu 
Date: Sat, 5 Nov 2016 16:53:27 +0800
Subject: [PATCH v3 10/10] net/virtio: fix multiple queue enabling

When queue number shrinks to 1 from X, the following code stops us
sending the multiple queue ctrl message:

if (nb_queues > 1) {
if (virtio_set_multiple_queues(dev, nb_queues) != 0)
return -EINVAL;
}

This ends up with still X queues being enabled, which is obviously
wrong. Fix it by replacing the check with a multiple queue enabled
or not check.

Fixes: 823ad647950a ("virtio: support multiple queues")

Signed-off-by: Yuanhan Liu 
---
v3: - fix the virtio-user case, which is default with ctrl-queue
  being disabled. Thus virtio_set_multiple_queues fails.
---
 drivers/net/virtio/virtio_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c 
b/drivers/net/virtio/virtio_ethdev.c
index d70bd00..18da98f 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1472,6 +1472,7 @@ virtio_dev_start(struct rte_eth_dev *dev)
uint16_t nb_queues, i;
struct virtnet_rx *rxvq;
struct virtnet_tx *txvq __rte_unused;
+   struct virtio_hw *hw = dev->data->dev_private;

/* check if lsc interrupt feature is enabled */
if (dev->data->dev_conf.intr_conf.lsc) {
@@ -1494,7 +1495,7 @@ virtio_dev_start(struct rte_eth_dev *dev)
 *vhost backend will have no chance to be waked up
 */
nb_queues = RTE_MAX(dev->data->nb_rx_queues, dev->data->nb_tx_queues);
-   if (nb_queues > 1) {
+   if (hw->max_queue_pairs > 1) {
if (virtio_set_multiple_queues(dev, nb_queues) != 0)
return -EINVAL;
}
-- 
1.9.0



[dpdk-dev] rte_ixgbevf_pmd not reporting dropped packets

2016-11-07 Thread Montorsi, Francesco
Hi all,

I'm using DPDK inside the OS of a VM that is SR-IOV-accelerated.
I noticed however that the "rte_ixgbevf_pmd" PMD does not report drops... I am 
sending packets at TX side at 14Mpps; at the RX side I'm using "testpmd" and 
it's reporting 'just' 12Mpps, but zero drops (also through xstats).

Is this a known bug?
I found a message at 
  http://dpdk.org/ml/archives/dev/2016-March/035374.html
reporting a similar issue back in March this year...


Thanks,

Francesco Montorsi



[dpdk-dev] how to search this mailing list? is gmane link archive broken?

2016-11-07 Thread Montorsi, Francesco
Hi all,
if this was already raised, sorry for that. 
I noticed that the gmane archive for this mailing list is not working anymore:

http://news.gmane.org/gmane.comp.networking.dpdk.devel 

reports "Page not found". Also I noticed that the gmane link on the dpdk.org 
website has been removed.
That was my only way to search through the archives of this mailing list... is 
there any other way to search them?

Thanks,

Francesco Montorsi





[dpdk-dev] [PATCH v9] app/testpmd: fix DCB configuration

2016-11-07 Thread Thomas Monjalon
> > Data Centre Bridge (DCB) configuration fails when SRIOV is enabled if nb_rxq
> > or nb_txq are greater than nb_q_per_pool.
> > 
> > The failure occurs during configuration of the ixgbe PMD when it is 
> > started, in
> > the ixgbe_check_mq_mode function.
> > 
> > Fixes: 2a977b891f99 ("app/testpmd: fix DCB configuration")
> > 
> > Signed-off-by: Bernard Iremonger 
> 
> Acked-by: Jingjing Wu 

Applied, thanks


[dpdk-dev] [PATCH v1 1/2] doc: update ixgbe guide

2016-11-07 Thread Thomas Monjalon
> > add information about new ixgbe PMD API.
> > 
> > Signed-off-by: Bernard Iremonger 
> 
> Acked-by: John McNamara 

Applied without patch 2 and squashed with release notes


[dpdk-dev] [PATCH v1 2/2] doc: update poll mode driver guide

2016-11-07 Thread Thomas Monjalon
2016-10-14 17:35, Bernard Iremonger:
> --- a/doc/guides/prog_guide/poll_mode_drv.rst
> +++ b/doc/guides/prog_guide/poll_mode_drv.rst
> @@ -356,3 +356,9 @@ Some additions in the metadata scheme are as follows:
>  An example where queue numbers are used is as follows: ``tx_q7_bytes`` which
>  indicates this statistic applies to queue number 7, and represents the number
>  of transmitted bytes on that queue.
> +
> +Extended ixgbe PMD API
> +~~
> +
> +In DPDK release v16.11 an API for ixgbe specific functions has been added to 
> the ixgbe PMD.
> +The declarations for the API functions are in the header ``rte_pmd_ixgbe.h``.

NACK
I think we should not add driver-specific details in this high-level and
generic doc.



[dpdk-dev] [PATCH] ixgbe: fix wrong VF TX registers

2016-11-07 Thread Thomas Monjalon
2016-11-06 11:55, Wenzhuo Lu:
> The VF TX registers are using PF's addresses by mistake,
> correct them.
> 
> Fixes: 0198848a47f5 ("ixgbe: add access to specific device info")
> 
> Reported-by: Xuekun Hu 
> Signed-off-by: Wenzhuo Lu 

Applied with other similar patches squashed, thanks


[dpdk-dev] [PATCH v2] E1000: fix for forced speed/duplex config

2016-11-07 Thread Thomas Monjalon
> > From the code, it looks like, hw->mac.autoneg, variable is used to switch
> > between calling either autoneg function or forcing speed/duplex function. 
> > But
> > this variable is not modified in eth_em_start/eth_igb_start routines (it is 
> > always
> > set to 1) even while forcing the link speed.
> > 
> > Following discussion thread has some more information on this
> > 
> > http://dpdk.org/ml/archives/dev/2016-October/049272.html
> > 
> > Signed-off-by: Ananda Sathyanarayana 
> Acked-by: Wenzhuo Lu 

Applied, thanks



[dpdk-dev] [PATCH 4/4] net/bonding: fix configuration of LACP slaves

2016-11-07 Thread Kulasek, TomaszX


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Robert Sanford
> Sent: Monday, August 1, 2016 22:43
> To: dev at dpdk.org
> Cc: Doherty, Declan ; De Lara Guarch, Pablo
> ; olivier.matz at 6wind.com
> Subject: [dpdk-dev] [PATCH 4/4] net/bonding: fix configuration of LACP
> slaves
> 
> Problem: When adding a slave or starting a bond device, the bond device
> configures slave devices via function slave_configure().
> However, settings configured in the bond device's rte_eth_conf are not
> propagated to the slaves. For example, VLAN and CRC stripping are not
> working as expected.
> 
> The problem is that we pass the wrong argument when we invoke
> rte_eth_dev_configure(). We pass the slave's currently configured
> rte_eth_conf (as a source arg!), when we should pass a copy of the
> (master) bond device's rte_eth_conf.
> 
> Solution: Make a local copy of the bond device's rte_eth_conf, adjust the
> LSC flag based on the slave, and then pass that rte_eth_conf to
> rte_eth_dev_configure().
> 
> Also, remove code that directly pokes RSS data into the slave's
> rte_eth_conf, as that is also contained in the proper rte_eth_conf that we
> will pass to rte_eth_dev_configure().
> 
> Signed-off-by: Robert Sanford 
> ---
>  drivers/net/bonding/rte_eth_bond_pmd.c |   28 +++
> -
>  1 files changed, 7 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c
> b/drivers/net/bonding/rte_eth_bond_pmd.c
> index b20a272..486582f 100644
> --- a/drivers/net/bonding/rte_eth_bond_pmd.c
> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
> @@ -1302,6 +1302,7 @@ int
>  slave_configure(struct rte_eth_dev *bonded_eth_dev,
>   struct rte_eth_dev *slave_eth_dev)
>  {
> + struct rte_eth_conf slave_eth_conf;
>   struct bond_rx_queue *bd_rx_q;
>   struct bond_tx_queue *bd_tx_q;
> 
> @@ -1313,33 +1314,18 @@ slave_configure(struct rte_eth_dev
> *bonded_eth_dev,
>   /* Stop slave */
>   rte_eth_dev_stop(slave_eth_dev->data->port_id);
> 
> - /* Enable interrupts on slave device if supported */
> - if (slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)
> - slave_eth_dev->data->dev_conf.intr_conf.lsc = 1;
> -
> - /* If RSS is enabled for bonding, try to enable it for slaves  */
> - if (bonded_eth_dev->data->dev_conf.rxmode.mq_mode &
> ETH_MQ_RX_RSS_FLAG) {
> - if (bonded_eth_dev->data-
> >dev_conf.rx_adv_conf.rss_conf.rss_key_len
> - != 0) {
> - slave_eth_dev->data-
> >dev_conf.rx_adv_conf.rss_conf.rss_key_len =
> - bonded_eth_dev->data-
> >dev_conf.rx_adv_conf.rss_conf.rss_key_len;
> - slave_eth_dev->data-
> >dev_conf.rx_adv_conf.rss_conf.rss_key =
> - bonded_eth_dev->data-
> >dev_conf.rx_adv_conf.rss_conf.rss_key;
> - } else {
> - slave_eth_dev->data-
> >dev_conf.rx_adv_conf.rss_conf.rss_key = NULL;
> - }
> + /* Build slave rte_eth_conf, starting from bonded's conf */
> + slave_eth_conf = bonded_eth_dev->data->dev_conf;
> 
> - slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf =
> - bonded_eth_dev->data-
> >dev_conf.rx_adv_conf.rss_conf.rss_hf;
> - slave_eth_dev->data->dev_conf.rxmode.mq_mode =
> - bonded_eth_dev->data->dev_conf.rxmode.mq_mode;
> - }
> + /* Enable interrupts on slave device if supported */
> + slave_eth_conf.intr_conf.lsc =
> + !!(slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC);
> 
>   /* Configure device */
>   errval = rte_eth_dev_configure(slave_eth_dev->data->port_id,
>   bonded_eth_dev->data->nb_rx_queues,
>   bonded_eth_dev->data->nb_tx_queues,
> - &(slave_eth_dev->data->dev_conf));
> + _eth_conf);
>   if (errval != 0) {
>   RTE_BOND_LOG(ERR, "Cannot configure slave device: port %u , err
> (%d)",
>   slave_eth_dev->data->port_id, errval);
> --
> 1.7.1

Reviewed-by: Tomasz Kulasek 


[dpdk-dev] [PATCH 3/4] net/bonding: another fix to LACP mempool size

2016-11-07 Thread Kulasek, TomaszX


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Robert Sanford
> Sent: Monday, August 1, 2016 22:43
> To: dev at dpdk.org
> Cc: Doherty, Declan ; De Lara Guarch, Pablo
> ; olivier.matz at 6wind.com
> Subject: [dpdk-dev] [PATCH 3/4] net/bonding: another fix to LACP mempool
> size
> 
> The following log message may appear after a slave is idle (or nearly
> idle) for a few minutes: "PMD: Failed to allocate LACP packet from pool".
> 
> Problem: All mbufs from a slave's private pool (used exclusively for
> transmitting LACPDUs) have been allocated and are still sitting in the
> device's tx descriptor ring and other cores' mempool caches.
> 
> Solution: Ensure that each slaves' tx (LACPDU) mempool owns more than n-
> tx-queues * (n-tx-descriptors + per-core-mempool-flush-threshold) mbufs.
> 
> Note that the LACP tx machine function is the only code that allocates
> from a slave's private pool. It runs in the context of the interrupt
> thread, and thus it has no mempool cache of its own.
> 
> Signed-off-by: Robert Sanford 
> ---
>  drivers/net/bonding/rte_eth_bond_8023ad.c |   10 +++---
>  1 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c
> b/drivers/net/bonding/rte_eth_bond_8023ad.c
> index 2f7ae70..1207896 100644
> --- a/drivers/net/bonding/rte_eth_bond_8023ad.c
> +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
> @@ -854,6 +854,8 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev
> *bond_dev, uint8_t slave_id)
>   char mem_name[RTE_ETH_NAME_MAX_LEN];
>   int socket_id;
>   unsigned element_size;
> + unsigned cache_size;
> + unsigned cache_flushthresh;
>   uint32_t total_tx_desc;
>   struct bond_tx_queue *bd_tx_q;
>   uint16_t q_id;
> @@ -890,19 +892,21 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev
> *bond_dev, uint8_t slave_id)
> 
>   element_size = sizeof(struct slow_protocol_frame) + sizeof(struct
> rte_mbuf)
>   + RTE_PKTMBUF_HEADROOM;
> + cache_size = RTE_MEMPOOL_CACHE_MAX_SIZE >= 32 ?
> + 32 : RTE_MEMPOOL_CACHE_MAX_SIZE;
> + cache_flushthresh = RTE_MEMPOOL_CALC_CACHE_FLUSHTHRESH(cache_size);
> 
>   /* The size of the mempool should be at least:
>* the sum of the TX descriptors + BOND_MODE_8023AX_SLAVE_TX_PKTS */
>   total_tx_desc = BOND_MODE_8023AX_SLAVE_TX_PKTS;
>   for (q_id = 0; q_id < bond_dev->data->nb_tx_queues; q_id++) {
>   bd_tx_q = (struct bond_tx_queue*)bond_dev->data-
> >tx_queues[q_id];
> - total_tx_desc += bd_tx_q->nb_tx_desc;
> + total_tx_desc += bd_tx_q->nb_tx_desc + cache_flushthresh;
>   }
> 
>   snprintf(mem_name, RTE_DIM(mem_name), "slave_port%u_pool",
> slave_id);
>   port->mbuf_pool = rte_mempool_create(mem_name,
> - total_tx_desc, element_size,
> - RTE_MEMPOOL_CACHE_MAX_SIZE >= 32 ? 32 :
> RTE_MEMPOOL_CACHE_MAX_SIZE,
> + total_tx_desc, element_size, cache_size,
>   sizeof(struct rte_pktmbuf_pool_private), rte_pktmbuf_pool_init,
>   NULL, rte_pktmbuf_init, NULL, socket_id, MEMPOOL_F_NO_SPREAD);
> 
> --
> 1.7.1

Reviewed-by: Tomasz Kulasek 


[dpdk-dev] [PATCH 0/3] vhost: comments and doc update due to vhost-cuse removal

2016-11-07 Thread Thomas Monjalon
2016-11-02 11:14, Yuanhan Liu:
> Here is a small patchset of updating vhost programming and sample guide
> and comments, due to the removal of vhost-cuse.

Applied, thanks


[dpdk-dev] [PATCH] net/bonding: only handle lacp slow packets

2016-11-07 Thread Kulasek, TomaszX


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of linhaifeng
> Sent: Friday, November 4, 2016 04:30
> To: dev at dpdk.org
> Cc: Yigit, Ferruh ; Doherty, Declan
> 
> Subject: [dpdk-dev] [PATCH] net/bonding: only handle lacp slow packets
> 
> From: Linhaifeng 
> 
> We should not drop the slow packets which subtype is not marker or lacp.
> Because slow packets have other subtype like OAM,OSSP,user defined and so
> on.
> 
> Signed-off-by: Linhaifeng 
> ---
>  drivers/net/bonding/rte_eth_bond_pmd.c | 14 +-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c
> b/drivers/net/bonding/rte_eth_bond_pmd.c
> index 09ce7bf..751ff1c 100644
> --- a/drivers/net/bonding/rte_eth_bond_pmd.c
> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
> @@ -122,6 +122,15 @@ bond_ethdev_rx_burst_active_backup(void *queue,
> struct rte_mbuf **bufs,
>   bd_rx_q->queue_id, bufs, nb_pkts);
>  }
> 
> +static inline uint8_t
> +is_lacp_packets(uint16_t ethertype, uint8_t subtype, uint16_t vlan_tci)
> +{
> + const uint16_t ether_type_slow_be =
> rte_be_to_cpu_16(ETHER_TYPE_SLOW);
> +
> + return !vlan_tci && (ethertype == ether_type_slow_be &&
> + (subtype == SLOW_SUBTYPE_MARKER || subtype ==
> SLOW_SUBTYPE_LACP)); }
> +
>  static uint16_t
>  bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs,
>   uint16_t nb_pkts)
> @@ -141,6 +150,7 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct
> rte_mbuf **bufs,
>   uint8_t collecting;  /* current slave collecting status */
>   const uint8_t promisc = internals->promiscuous_en;
>   uint8_t i, j, k;
> + uint8_t subtype;
> 
>   rte_eth_macaddr_get(internals->port_id, _mac);
>   /* Copy slave list to protect against slave up/down changes during
> tx @@ -166,10 +176,12 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct
> rte_mbuf **bufs,
>   rte_prefetch0(rte_pktmbuf_mtod(bufs[j + 3], void
> *));
> 
>   hdr = rte_pktmbuf_mtod(bufs[j], struct ether_hdr *);
> + subtype = ((struct slow_protocol_frame
> +*)hdr)->slow_protocol.subtype;
> +
>   /* Remove packet from array if it is slow packet or 
> slave
> is not
>* in collecting state or bondign interface is not in
> promiscus
>* mode and packet address does not match. */
> - if (unlikely(hdr->ether_type == ether_type_slow_be ||
> + if (unlikely(is_lacp_packets(hdr->ether_type, subtype,
> +bufs[j]->vlan_tci) ||
>   !collecting || (!promisc &&
>   !is_multicast_ether_addr(>d_addr) 
> &&
>   !is_same_ether_addr(_mac, 
> >d_addr {
> --
> 1.8.3.1
> 

Reviewed-by: Tomasz Kulasek 


[dpdk-dev] [PATCH v2] examples/ipsec-secgw: fix copy into fixed size buffer issue

2016-11-07 Thread Ferruh Yigit
On 11/7/2016 2:21 PM, Fan Zhang wrote:
> Fixes: 0d547ed0 ("examples/ipsec-secgw: support configuration
> file")
> Coverity issue: 137875
> 
> Signed-off-by: Fan Zhang 

Acked-by: Ferruh Yigit 



[dpdk-dev] [PATCH v2 00/10] net/virtio: fix queue reconfigure issue

2016-11-07 Thread Thomas Monjalon
2016-11-05 17:40, Yuanhan Liu:
> This patchset fixes few issues related to virtio queue reconfigure:
> increase or shrink the queue number. The major issue and the reason
> behind is described with length details in patch 4 "net/virtio: allocate
> queue at init stage".
> 
> Those bugs can not be fixed by few lines of code, it's because the
> current driver init logic is quite wrong, that I need change quite many
> places to make it right. Meanwhile, I have already done my best to keep 
> the changes being as minimal as possible, so that we could have fewer
> changes to break something else; also, it's would be easier for review.

Applied with a small fix and v3 of last patch, thanks


[dpdk-dev] [PATCH v3 1/3] lib: add information metrics library

2016-11-07 Thread Pattan, Reshma
Hi,

> -Original Message-
> From: Pattan, Reshma
> Sent: Friday, November 4, 2016 4:43 PM
> To: Remy Horton 
> Cc: dev at dpdk.org
> Subject: RE: [dpdk-dev] [PATCH v3 1/3] lib: add information metrics library
> 
> Hi,
> 
> Few comments below.
> 
> > -Original Message-
> > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Remy Horton
> > Sent: Friday, November 4, 2016 3:36 AM
> > To: dev at dpdk.org
> > Subject: [dpdk-dev] [PATCH v3 1/3] lib: add information metrics
> > library
> >
> > This patch adds a new information metric library that allows other
> > modules to register named metrics and update their values. It is
> > intended to be independent of ethdev, rather than mixing ethdev and
> > non-ethdev information in xstats.
> >
> > Signed-off-by: Remy Horton 
> > ---
> > +int
> > +
> > +int
> > +rte_metrics_get_values(int port_id,
> > +   struct rte_stat_value *values,
> > +   uint16_t capacity)
> > +{
> > +   struct rte_metrics_meta_s *entry;
> > +   struct rte_metrics_data_s *stats;
> > +   const struct rte_memzone *memzone;
> > +   uint16_t idx_name;
> > +   int return_value;
> > +
> > +   memzone = rte_memzone_lookup(RTE_METRICS_MEMZONE_NAME);
> > +   /* If not allocated, fail silently */
> > +   if (memzone == NULL)
> > +   return 0;
> > +   stats = memzone->addr;
> > +   rte_spinlock_lock(>lock);
> > +
> > +   if (values != NULL) {
> > +   if (capacity < stats->cnt_stats) {
> > +   rte_spinlock_unlock(>lock);
> > +   return -ERANGE;
> > +   }
> > +   for (idx_name = 0; idx_name < stats->cnt_stats; idx_name++)
> > {
> > +   entry = >metadata[idx_name];
> > +   values[idx_name].key = idx_name;
> > +   values[idx_name].value = entry->value[port_id];
> > +   }
> 
> Here you also  need to include logic to return values for  port independent
> metrics.
> 
> > diff --git a/lib/librte_metrics/rte_metrics.h
> > b/lib/librte_metrics/rte_metrics.h
> > new file mode 100644
> > index 000..6b75404
> > --- /dev/null
> > +++ b/lib/librte_metrics/rte_metrics.h
> > @@ -0,0 +1,204 @@
> > +/**
> > + * Statistic name
> > + */
> > +struct rte_metric_name {
> > +   /** String describing statistic */
> > +   char name[RTE_METRICS_MAX_NAME_LEN]; };
> > +
> > +
> > +/**
> > + * Statistic name.
> > + */
> 
> Need to correct the description to "stats values" or "metric values."
> 
> > +struct rte_stat_value {
> 
> Need to change the name to rte_metric_value.
> 
> > +   /** Numeric identifier of statistic */
> > +   uint16_t key;
> > +   /** Value for statistic */
> > +   uint64_t value;
> > +};
> > +
> > +
> > +/**
> > + * Initialises statistic module. This only has to be explicitly
> > +called
> 
> Typo < Initialises>

To avoid confusion, here I mean to say "Initializes" should be used (i.e. US 
English) .
Also another non-related comment, you may need to add a comment about EMWA
near the mean bit rate calculation code.

> 
> Thanks,
> Reshma


[dpdk-dev] [PATCH v2 04/10] net/virtio: allocate queue at init stage

2016-11-07 Thread Thomas Monjalon
2016-11-05 17:40, Yuanhan Liu:
> -int virtio_dev_queue_setup(struct rte_eth_dev *dev,
> - int queue_type,
> - uint16_t queue_idx,
> - uint16_t vtpci_queue_idx,
> - uint16_t nb_desc,
> - unsigned int socket_id,
> - void **pvq)
> +static int
> +virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx)
>  {

I've fixed an error with debug enabled:
drivers/net/virtio/virtio_ethdev.c:335:57: error:
  ?nb_desc? undeclared (first use in this function)
  PMD_INIT_LOG(DEBUG, "vq_size: %u nb_desc:%u", vq_size, nb_desc);
 ^



[dpdk-dev] [PATCH v2 00/10] net/virtio: fix queue reconfigure issue

2016-11-07 Thread Yao, Lei A
Tested-by: Lei Yao 
- Apply patch to v16.11-rc2
- Compile: Pass
- OS: Ubuntu16.04 4.4.0-45-generic
- GCC: 5.4.0

Most of the basic Virtio related test cases are tested with this patch. No 
function issue found and no obvious performance drop. The following is the pass 
case list:
TC1:? vhost/virtio PVP vector performance ?
TC2:? vhost/virtio PVP normal path performance 
TC3:? vhost/virtio PVP mergeable path performance 
TC7: vhost/virtio-net PVP ipv4 fwd normal path performance
TC8: vhost/virtio-net PVP ipv4 fwd mergeable path performance
TC9: vhost/virtio-net VM2VM iperf with TSO enabled performance
TC11: vhost/virtio-pmd PVP with 2q 2c vector performance
TC12: vhost/virtio-pmd PVP with 2q 1c vector performance
TC16: vhost/virtio1.0 PVP normal performance
TC17: vhost/virtio 1.0 PVP mergeable performance
TC18: vhost/virtio 1.0 PVP vector performance(should be same as normal)
TC19: dpdk vhost + virtio-pmd PVP vector performance
TC20: dpdk vhost + virtio-pmd PVP non-vector performance
TC21: dpdk vhost + virtio-pmd PVP mergeable performance
TC25: Test Vhost/virtio-pmd PVP vector performance with qemu2.5
TC26: Test Vhost/virtio-pmd PVP vector performance with qemu2.6
TC27: Test Vhost/virtio-pmd PVP vector performance with qemu2.7
test vhost-user reconnect with virtio-pmd
test virtio-pmd reconnect with vhost-user 
test vhost-user reconnect with multi virtio-pmd
multi test virtio-pmd reconnect with vhost-user

-Original Message-
From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Yuanhan Liu
Sent: Saturday, November 5, 2016 5:41 PM
To: dev at dpdk.org
Cc: Thomas Monjalon ; Tan, Jianfeng ; Kevin Traynor ; Ilya Maximets 
; Kyle Larose ; Maxime 
Coquelin ; Yuanhan Liu 
Subject: [dpdk-dev] [PATCH v2 00/10] net/virtio: fix queue reconfigure issue

This patchset fixes few issues related to virtio queue reconfigure:
increase or shrink the queue number. The major issue and the reason behind is 
described with length details in patch 4 "net/virtio: allocate queue at init 
stage".

Those bugs can not be fixed by few lines of code, it's because the current 
driver init logic is quite wrong, that I need change quite many places to make 
it right. Meanwhile, I have already done my best to keep the changes being as 
minimal as possible, so that we could have fewer changes to break something 
else; also, it's would be easier for review.

v2: - fix two more minor issues regarding to queue enabling; see patch 9
  and 10.
- refined commit log a bit.

Thanks.

--yliu

---
Yuanhan Liu (10):
  net/virtio: revert fix restart
  net/virtio: simplify queue memzone name
  net/virtio: simplify queue allocation
  net/virtio: allocate queue at init stage
  net/virtio: initiate vring at init stage
  net/virtio: move queue configure code to proper place
  net/virtio: complete init stage at the right place
  net/virtio: remove started field
  net/virtio: fix less queues being enabled issue
  net/virtio: fix multiple queue enabling

 drivers/net/virtio/virtio_ethdev.c | 248 +--  
drivers/net/virtio/virtio_ethdev.h |  16 --
 drivers/net/virtio/virtio_pci.h|   3 +-
 drivers/net/virtio/virtio_rxtx.c   | 291 -
 drivers/net/virtio/virtqueue.h |   7 +
 5 files changed, 237 insertions(+), 328 deletions(-)

--
1.9.0



[dpdk-dev] [PATCH] pci: fix one device probing

2016-11-07 Thread Thomas Monjalon
2016-11-07 14:26, David Marchand:
> On Thu, Aug 4, 2016 at 1:50 PM, Igor Ryzhov  wrote:
> > The rte_eal_pci_probe_one function could return false positive result if
> > no driver is found for the device.
> >
> > Signed-off-by: Igor Ryzhov 
> 
> Acked-by: David Marchand 

Applied, thanks


[dpdk-dev] [PATCH] pci: do not mark device as taken when probe fails

2016-11-07 Thread Thomas Monjalon
2016-11-07 10:03, David Marchand:
> dev->driver should be set only if a driver did take the device.
> 
> Signed-off-by: David Marchand 

Applied, thanks


[dpdk-dev] [PATCH] pci: fix one device probing

2016-11-07 Thread David Marchand
On Thu, Aug 4, 2016 at 1:50 PM, Igor Ryzhov  wrote:
> The rte_eal_pci_probe_one function could return false positive result if
> no driver is found for the device.
>
> Signed-off-by: Igor Ryzhov 
> ---
>  lib/librte_eal/common/eal_common_pci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/librte_eal/common/eal_common_pci.c 
> b/lib/librte_eal/common/eal_common_pci.c
> index 7248c38..bfb6fd2 100644
> --- a/lib/librte_eal/common/eal_common_pci.c
> +++ b/lib/librte_eal/common/eal_common_pci.c
> @@ -344,7 +344,7 @@ rte_eal_pci_probe_one(const struct rte_pci_addr *addr)
> continue;
>
> ret = pci_probe_all_drivers(dev);
> -   if (ret < 0)
> +   if (ret)
> goto err_return;
> return 0;
> }

Acked-by: David Marchand 


-- 
David Marchand


[dpdk-dev] [PATCH v2] examples/ipsec-secgw: fix pointer to local outside scope

2016-11-07 Thread Fan Zhang
Coverity issue: 137871
Fixes: 0d547ed03717 ("examples/ipsec-secgw: support configuration file")

Signed-off-by: Fan Zhang 
---
 examples/ipsec-secgw/parser.c | 120 --
 1 file changed, 58 insertions(+), 62 deletions(-)

diff --git a/examples/ipsec-secgw/parser.c b/examples/ipsec-secgw/parser.c
index ede08d8..f1afdb7 100644
--- a/examples/ipsec-secgw/parser.c
+++ b/examples/ipsec-secgw/parser.c
@@ -503,86 +503,82 @@ parse_cfg_file(const char *cfg_filename)

do {
char oneline[1024];
-
+   char *pos;
get_s = fgets(oneline, 1024, f);
-   if (get_s) {
-   char *pos;

-   line_num++;
+   if (!get_s)
+   break;

-   if (strlen(oneline) > 1022) {
-   rte_panic("%s:%u: error: the line "
-   "contains more characters the "
-   "parser can handle\n",
-   cfg_filename, line_num);
-   goto error_exit;
-   }
+   line_num++;

-   /* process comment char '#' */
-   if (oneline[0] == '#')
-   continue;
+   if (strlen(oneline) > 1022) {
+   rte_panic("%s:%u: error: the line "
+   "contains more characters the "
+   "parser can handle\n",
+   cfg_filename, line_num);
+   goto error_exit;
+   }

-   pos = strchr(oneline, '#');
-   if (pos != NULL)
-   *pos = '\0';
-
-   /* process line concatenator '\' */
-   pos = strchr(oneline, 92);
-   if (pos != NULL) {
-   if (pos != oneline+strlen(oneline) - 2) {
-   rte_panic("%s:%u: error: no "
-   "character should exist "
-   "after '\\' symbol\n",
-   cfg_filename, line_num);
-   goto error_exit;
-   }
-
-   *pos = '\0';
-
-   if (strlen(oneline) + strlen(str) > 1022) {
-   rte_panic("%s:%u: error: the "
-   "concatenated line "
-   "contains more characters "
-   "the parser can handle\n",
-   cfg_filename, line_num);
-   goto error_exit;
-   }
-
-   strncpy(str + strlen(str), oneline,
-   strlen(oneline));
+   /* process comment char '#' */
+   if (oneline[0] == '#')
+   continue;

-   continue;
+   pos = strchr(oneline, '#');
+   if (pos != NULL)
+   *pos = '\0';
+
+   /* process line concatenator '\' */
+   pos = strchr(oneline, 92);
+   if (pos != NULL) {
+   if (pos != oneline+strlen(oneline) - 2) {
+   rte_panic("%s:%u: error: no character "
+   "should exist after '\\'\n",
+   cfg_filename, line_num);
+   goto error_exit;
}

-   /* copy the line to str and process */
+   *pos = '\0';
+
if (strlen(oneline) + strlen(str) > 1022) {
-   rte_panic("%s:%u: error: the line "
-   "contains more characters the "
-   "parser can handle\n",
+   rte_panic("%s:%u: error: the "
+   "concatenated line contains more "
+   "characters the parser can "
+   "handle\n",
cfg_filename, line_num);
goto error_exit;
}
+
strncpy(str + strlen(str), oneline,
strlen(oneline));

-   str[strlen(str)] = '\n';
-   if (cmdline_parse(cl, str) < 0) {
-   rte_panic("%s:%u: error: parsing \"%s\" "
-

[dpdk-dev] [PATCH v2] examples/ipsec-secgw: fix copy into fixed size buffer issue

2016-11-07 Thread Fan Zhang
Fixes: 0d547ed0 ("examples/ipsec-secgw: support configuration
file")
Coverity issue: 137875

Signed-off-by: Fan Zhang 
---
 examples/ipsec-secgw/sa.c | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c
index 9e2c8a9..8c4406c 100644
--- a/examples/ipsec-secgw/sa.c
+++ b/examples/ipsec-secgw/sa.c
@@ -170,15 +170,18 @@ static uint32_t
 parse_key_string(const char *key_str, uint8_t *key)
 {
const char *pt_start = key_str, *pt_end = key_str;
-   char sub_str[3];
uint32_t nb_bytes = 0;

while (pt_end != NULL) {
+   char sub_str[3] = {0};
+
pt_end = strchr(pt_start, ':');

-   if (pt_end == NULL)
-   strncpy(sub_str, pt_start, strlen(pt_start));
-   else {
+   if (pt_end == NULL) {
+   if (strlen(pt_start) > 2)
+   return 0;
+   strncpy(sub_str, pt_start, 2);
+   } else {
if (pt_end - pt_start > 2)
return 0;

-- 
2.5.5



[dpdk-dev] [PATCH v3] net/ring: remove unnecessary NULL check

2016-11-07 Thread Thomas Monjalon
2016-11-02 14:05, Ferruh Yigit:
> On 11/2/2016 1:46 PM, Mauricio Vasquez B wrote:
> > Coverity detected this as an issue because internals->data will never be 
> > NULL,
> > then the check is not necessary.
> > 
> > Fixes: d082c0395bf6 ("ring: fix memory leak when detaching")
> > Coverity issue: 137873
> > 
> > Signed-off-by: Mauricio Vasquez B 
> 
> Acked-by: Ferruh Yigit 

Applied, thanks


[dpdk-dev] [PATCH] doc: fix typos

2016-11-07 Thread Mcnamara, John


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Alain Leon
> Sent: Monday, November 7, 2016 3:20 AM
> To: dev at dpdk.org
> Cc: Alain Leon 
> Subject: [dpdk-dev] [PATCH] doc: fix typos
> 
> Fixes typos present in the documentation and code comments.
> 
> Signed-off-by: Alain Leon 

Acked-by: John McNamara 



[dpdk-dev] [PATCH v4] latencystats: added new library for latency stats

2016-11-07 Thread Reshma Pattan
Library is designed to calculate latency stats and report them to the
application when queried. Library measures minimum, average, maximum
latencies and jitter in nano seconds.
Current implementation supports global latency stats, i.e. per application
stats.

Added new field to mbuf struct to mark the packet arrival time on Rx and
use the timestamp to measure the latency on Tx.

Modified testpmd code to initialize/uninitialize latency stats calulation.
Modified dpdk-procinfo process to display the newly added metrics info.

This pacth is dependent on http://dpdk.org/dev/patchwork/patch/16927/ .

APIs:

Added APIs to initialize and un initialize latency stats
calculation.
Added API to retrieve latency stats names and values.

Functionality:

*Library will register ethdev Rx/Tx callbacks for each active port,
queue combinations.
*Library will register latency stats names with new metrics library.
http://dpdk.org/dev/patchwork/patch/16927/
*Rx packets will be marked with time stamp on each sampling interval.
*On Tx side, packets with time stamp will be considered for calculating
the minimum, maximum, average latencies and jitter.
*Average latency is calculated using exponential weighted moving average
method.
*Minimum and maximum latencies will be low and high latency values observed
so far.
*Jitter calculation is done based on inter packet delay variation.
*Measured stats are reported to the metrics library in a separate pthread.
*Measured stats can be retrieved via get API of the libray (or)
by calling generic get API of the new metrics library.

documents yet to be updated.

Signed-off-by: Reshma Pattan 
---
 MAINTAINERS|   4 +
 app/proc_info/main.c   |  70 
 app/test-pmd/testpmd.c |  10 +
 config/common_base |   5 +
 lib/Makefile   |   1 +
 lib/librte_latencystats/Makefile   |  57 
 lib/librte_latencystats/rte_latencystats.c | 380 +
 lib/librte_latencystats/rte_latencystats.h | 141 
 .../rte_latencystats_version.map   |  10 +
 lib/librte_mbuf/rte_mbuf.h |   3 +
 mk/rte.app.mk  |   2 +
 11 files changed, 683 insertions(+)
 create mode 100644 lib/librte_latencystats/Makefile
 create mode 100644 lib/librte_latencystats/rte_latencystats.c
 create mode 100644 lib/librte_latencystats/rte_latencystats.h
 create mode 100644 lib/librte_latencystats/rte_latencystats_version.map

diff --git a/MAINTAINERS b/MAINTAINERS
index ba12d1b..2567448 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -702,3 +702,7 @@ F: examples/tep_termination/
 F: examples/vmdq/
 F: examples/vmdq_dcb/
 F: doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst
+
+Latency Stats
+M: Reshma Pattan 
+F: lib/librte_latencystats/
diff --git a/app/proc_info/main.c b/app/proc_info/main.c
index 2c56d10..37d5ae4 100644
--- a/app/proc_info/main.c
+++ b/app/proc_info/main.c
@@ -57,6 +57,7 @@
 #include 
 #include 
 #include 
+#include 

 /* Maximum long option length for option parsing. */
 #define MAX_LONG_OPT_SZ 64
@@ -68,6 +69,8 @@ static uint32_t enabled_port_mask;
 static uint32_t enable_stats;
 /**< Enable xstats. */
 static uint32_t enable_xstats;
+/**< Enable metrics. */
+static uint32_t enable_metrics;
 /**< Enable stats reset. */
 static uint32_t reset_stats;
 /**< Enable xstats reset. */
@@ -85,6 +88,8 @@ proc_info_usage(const char *prgname)
"  --stats: to display port statistics, enabled by default\n"
"  --xstats: to display extended port statistics, disabled by "
"default\n"
+   "  --metrics: to display derived metrics of the ports, disabled 
by "
+   "default\n"
"  --stats-reset: to reset port statistics\n"
"  --xstats-reset: to reset port extended statistics\n",
prgname);
@@ -127,6 +132,7 @@ proc_info_parse_args(int argc, char **argv)
{"stats", 0, NULL, 0},
{"stats-reset", 0, NULL, 0},
{"xstats", 0, NULL, 0},
+   {"metrics", 0, NULL, 0},
{"xstats-reset", 0, NULL, 0},
{NULL, 0, 0, 0}
};
@@ -159,6 +165,10 @@ proc_info_parse_args(int argc, char **argv)
else if (!strncmp(long_option[option_index].name, 
"xstats",
MAX_LONG_OPT_SZ))
enable_xstats = 1;
+   else if (!strncmp(long_option[option_index].name,
+   "metrics",
+   MAX_LONG_OPT_SZ))
+   enable_metrics = 1;
/* Reset stats */
if (!strncmp(long_option[option_index].name, 
"stats-reset",
  

[dpdk-dev] [PATCH v3 2/2] mempool: pktmbuf pool default fallback for mempool ops error

2016-11-07 Thread Hemant Agrawal
Hi Olivier,

> -Original Message-
> From: Olivier Matz [mailto:olivier.matz at 6wind.com]
> Sent: Friday, October 14, 2016 5:41 PM
> > On 9/22/2016 6:42 PM, Hemant Agrawal wrote:
> >> Hi Olivier
> >>
> >> On 9/19/2016 7:27 PM, Olivier Matz wrote:
> >>> Hi Hemant,
> >>>
> >>> On 09/16/2016 06:46 PM, Hemant Agrawal wrote:
>  In the rte_pktmbuf_pool_create, if the default external mempool is
>  not available, the implementation can default to "ring_mp_mc",
>  which is an software implementation.
> 
>  Signed-off-by: Hemant Agrawal 
>  ---
>  Changes in V3:
>  * adding warning message to say that falling back to default sw
>  pool
>  ---
>   lib/librte_mbuf/rte_mbuf.c | 8 
>   1 file changed, 8 insertions(+)
> 
>  diff --git a/lib/librte_mbuf/rte_mbuf.c
>  b/lib/librte_mbuf/rte_mbuf.c index 4846b89..8ab0eb1 100644
>  --- a/lib/librte_mbuf/rte_mbuf.c
>  +++ b/lib/librte_mbuf/rte_mbuf.c
>  @@ -176,6 +176,14 @@ rte_pktmbuf_pool_create(const char *name,
>  unsigned n,
> 
>   rte_errno = rte_mempool_set_ops_byname(mp,
>   RTE_MBUF_DEFAULT_MEMPOOL_OPS, NULL);
>  +
>  +/* on error, try falling back to the software based default
>  pool */
>  +if (rte_errno == -EOPNOTSUPP) {
>  +RTE_LOG(WARNING, MBUF, "Default HW Mempool not supported. "
>  +"falling back to sw mempool \"ring_mp_mc\"");
>  +rte_errno = rte_mempool_set_ops_byname(mp, "ring_mp_mc",
>  NULL);
>  +}
>  +
>   if (rte_errno != 0) {
>   RTE_LOG(ERR, MBUF, "error setting mempool handler\n");
>   return NULL;
> 
> >>>
> >>> Without adding a new method ".supported()", the first call to
> >>> rte_mempool_populate() could return the same error ENOTSUP. In this
> >>> case, it is still possible to fallback.
> >>>
> >> It will be bit late.
> >>
> >> On failure, than we have to set the default ops and do a goto before
> >> rte_pktmbuf_pool_init(mp, _priv);
> 
> I still think we can do the job without adding the .supported() method.
> The following code is just an (untested) example:
> 
> struct rte_mempool *
> rte_pktmbuf_pool_create(const char *name, unsigned n,
> unsigned cache_size, uint16_t priv_size, uint16_t data_room_size,
> int socket_id)
> {
> struct rte_mempool *mp;
> struct rte_pktmbuf_pool_private mbp_priv;
> unsigned elt_size;
> int ret;
> const char *ops[] = {
> RTE_MBUF_DEFAULT_MEMPOOL_OPS, "ring_mp_mc", NULL,
> };
> const char **op;
> 
> if (RTE_ALIGN(priv_size, RTE_MBUF_PRIV_ALIGN) != priv_size) {
> RTE_LOG(ERR, MBUF, "mbuf priv_size=%u is not aligned\n",
> priv_size);
> rte_errno = EINVAL;
> return NULL;
> }
> elt_size = sizeof(struct rte_mbuf) + (unsigned)priv_size +
> (unsigned)data_room_size;
> mbp_priv.mbuf_data_room_size = data_room_size;
> mbp_priv.mbuf_priv_size = priv_size;
> 
> for (op = [0]; *op != NULL; op++) {
> mp = rte_mempool_create_empty(name, n, elt_size, cache_size,
> sizeof(struct rte_pktmbuf_pool_private), socket_id, 0);
> if (mp == NULL)
> return NULL;
> 
> ret = rte_mempool_set_ops_byname(mp, *op, NULL);
> if (ret != 0) {
> RTE_LOG(ERR, MBUF, "error setting mempool handler\n");
> rte_mempool_free(mp);
> if (ret == -ENOTSUP)
> continue;
> rte_errno = -ret;
> return NULL;
> }
> rte_pktmbuf_pool_init(mp, _priv);
> 
> ret = rte_mempool_populate_default(mp);
> if (ret < 0) {
> rte_mempool_free(mp);
> if (ret == -ENOTSUP)
> continue;
> rte_errno = -ret;
> return NULL;
> }
> }
> 
> rte_mempool_obj_iter(mp, rte_pktmbuf_init, NULL);
> 
> return mp;
> }
> 
> 
[Hemant]  This look fine to me. Please submit a patch for the same. 

> >>> I've just submitted an RFC, which I think is quite linked:
> >>> http://dpdk.org/ml/archives/dev/2016-September/046974.html
> >>> Assuming a new parameter "mempool_ops" is added to
> >>> rte_pktmbuf_pool_create(), would it make sense to fallback to
> >>> "ring_mp_mc"? What about just returning ENOTSUP? The application
> >>> could do the job and decide which sw fallback to use.
> >>
> >> We ran into this issue when trying to run the standard DPDK examples
> >> (l3fwd) in VM. Do you think, is it practical to add fallback handling
> >> in each of the DPDK examples?
> 
> OK. What is still unclear for me, is how the software is aware of the 
> different
> hardware-assisted handlers. Moreover, we could imagine more software
> handlers, which could be used depending on the use case.
> 
> I think this choice has to be made by the user or the application:
> 
> - the application may want to use a specific (sw or hw) handler: in
>   

[dpdk-dev] [PATCH] pci: do not mark device as taken when probe fails

2016-11-07 Thread David Marchand
dev->driver should be set only if a driver did take the device.

Signed-off-by: David Marchand 
---
 lib/librte_eal/common/eal_common_pci.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eal/common/eal_common_pci.c 
b/lib/librte_eal/common/eal_common_pci.c
index 971ad20..6163b09 100644
--- a/lib/librte_eal/common/eal_common_pci.c
+++ b/lib/librte_eal/common/eal_common_pci.c
@@ -214,7 +214,11 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, 
struct rte_pci_device *d
dev->driver = dr;

/* call the driver probe() function */
-   return dr->probe(dr, dev);
+   ret = dr->probe(dr, dev);
+   if (ret)
+   dev->driver = NULL;
+
+   return ret;
}
/* return positive value if driver doesn't support this device */
return 1;
-- 
2.7.4



[dpdk-dev] [PATCH] pci: Don't call probe callback if driver already loaded.

2016-11-07 Thread David Marchand
Hello Thomas,
On Sun, Nov 6, 2016 at 10:59 PM, Thomas Monjalon
 wrote:

> 2016-10-25 14:50, Ben Walker:
>> If the user asks to probe multiple times, the probe
>> callback should only be called on devices that don't have
>> a driver already loaded.
>>
>> This is useful if a driver is registered after the
>> execution of a program has started and the list of devices
>> needs to be re-scanned.
>>
>> Signed-off-by: Ben Walker 
>
> Applied, thanks

Can you add a follow up patch I will send shortly ?
Thanks.


-- 
David Marchand


[dpdk-dev] [PATCH 1/3 v3] bnxt: use appropriate data type in bnxt_alloc_vnic_attributes

2016-11-07 Thread Ajit Khaparde
Prevent the arithmetic in bnxt_alloc_vnic_attributes from causing
any unintentional havoc because of the usage of a signed variable.

Coverity: 137874

Signed-off-by: Ajit Khaparde 

--
v1: attempt did not seem complete.
v2: simplify the fix by redoing the fix for Coverity 127557
---
 drivers/net/bnxt/bnxt_vnic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
index 205a940..33fdde2 100644
--- a/drivers/net/bnxt/bnxt_vnic.c
+++ b/drivers/net/bnxt/bnxt_vnic.c
@@ -175,7 +175,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
struct rte_pci_device *pdev = bp->pdev;
const struct rte_memzone *mz;
char mz_name[RTE_MEMZONE_NAMESIZE];
-   uint16_t entry_length = RTE_CACHE_LINE_ROUNDUP(
+   uint32_t entry_length = RTE_CACHE_LINE_ROUNDUP(
HW_HASH_INDEX_SIZE * sizeof(*vnic->rss_table) +
HW_HASH_KEY_SIZE);
uint16_t max_vnics;
-- 
1.8.3.1



[dpdk-dev] [PATCH 2/3] bnxt: add a FALLTHROUGH comment in the cascading switch statement

2016-11-07 Thread Ajit Khaparde
The cascading switch statement in bnxt_hwrm.c is missing the FALLTHROUGH
comment. Adding that.

Coverity: 127552

Signed-off-by: Ajit Khaparde 
Acked-by: Ferruh Yigit 
---
 drivers/net/bnxt/bnxt_hwrm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index cf79fc6..07e7124 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -606,6 +606,7 @@ int bnxt_hwrm_ring_alloc(struct bnxt *bp,
switch (ring_type) {
case HWRM_RING_ALLOC_INPUT_RING_TYPE_TX:
req.queue_id = bp->cos_queue[0].id;
+   /* FALLTHROUGH */
case HWRM_RING_ALLOC_INPUT_RING_TYPE_RX:
req.ring_type = ring_type;
req.cmpl_ring_id =
-- 
1.8.3.1



[dpdk-dev] [PATCH 3/3 v2] bnxt: remove support for few PCI IDs

2016-11-07 Thread Ajit Khaparde
Some of the production parts will arrive after the 16.11 release.
Back off support for those devices. We will add these IDs again
at an appropriate time.

Signed-off-by: Ajit Khaparde 
--
v2: Adding Signed-off-by which seems to have fallen off in the previous attempt.
---
 drivers/net/bnxt/bnxt_ethdev.c | 30 --
 1 file changed, 30 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 2a95031..035fe07 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -63,34 +63,19 @@ static const char bnxt_version[] =
 #define BROADCOM_DEV_ID_57302 0x16c9
 #define BROADCOM_DEV_ID_57304_PF 0x16ca
 #define BROADCOM_DEV_ID_57304_VF 0x16cb
-#define BROADCOM_DEV_ID_57417_MF 0x16cc
 #define BROADCOM_DEV_ID_NS2 0x16cd
-#define BROADCOM_DEV_ID_57311 0x16ce
-#define BROADCOM_DEV_ID_57312 0x16cf
 #define BROADCOM_DEV_ID_57402 0x16d0
 #define BROADCOM_DEV_ID_57404 0x16d1
 #define BROADCOM_DEV_ID_57406_PF 0x16d2
 #define BROADCOM_DEV_ID_57406_VF 0x16d3
 #define BROADCOM_DEV_ID_57402_MF 0x16d4
 #define BROADCOM_DEV_ID_57407_RJ45 0x16d5
-#define BROADCOM_DEV_ID_57412 0x16d6
-#define BROADCOM_DEV_ID_57414 0x16d7
-#define BROADCOM_DEV_ID_57416_RJ45 0x16d8
-#define BROADCOM_DEV_ID_57417_RJ45 0x16d9
 #define BROADCOM_DEV_ID_5741X_VF 0x16dc
-#define BROADCOM_DEV_ID_57412_MF 0x16de
-#define BROADCOM_DEV_ID_57314 0x16df
-#define BROADCOM_DEV_ID_57317_RJ45 0x16e0
 #define BROADCOM_DEV_ID_5731X_VF 0x16e1
-#define BROADCOM_DEV_ID_57417_SFP 0x16e2
-#define BROADCOM_DEV_ID_57416_SFP 0x16e3
-#define BROADCOM_DEV_ID_57317_SFP 0x16e4
 #define BROADCOM_DEV_ID_57404_MF 0x16e7
 #define BROADCOM_DEV_ID_57406_MF 0x16e8
 #define BROADCOM_DEV_ID_57407_SFP 0x16e9
 #define BROADCOM_DEV_ID_57407_MF 0x16ea
-#define BROADCOM_DEV_ID_57414_MF 0x16ec
-#define BROADCOM_DEV_ID_57416_MF 0x16ee

 static struct rte_pci_id bnxt_pci_id_map[] = {
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57301) },
@@ -103,28 +88,13 @@ static struct rte_pci_id bnxt_pci_id_map[] = {
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_PF) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_VF) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57402_MF) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57314) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57407_RJ45) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57404_MF) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57406_MF) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57407_SFP) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57407_MF) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57417_MF) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57311) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57312) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57412) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57414) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57416_RJ45) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57417_RJ45) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_5741X_VF) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57412_MF) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57317_RJ45) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_5731X_VF) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57417_SFP) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57416_SFP) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57317_SFP) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57414_MF) },
-   { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57416_MF) },
{ .vendor_id = 0, /* sentinel */ },
 };

-- 
1.8.3.1



[dpdk-dev] [PATCH] maintainers: claim responsability for xen

2016-11-07 Thread Jianfeng Tan
As some users are still using xen as the hypervisor, I suggest to
continue support for xen in DPDK. And from 16.11, I will be the
maintainer of all xen-related files.

Signed-off-by: Jianfeng Tan 
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index ba12d1b..d2fa2db 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -190,6 +190,7 @@ M: Anatoly Burakov 
 F: lib/librte_eal/linuxapp/eal/*vfio*

 Linux Xen
+M: Jianfeng Tan 
 F: lib/librte_eal/linuxapp/xen_dom0/
 F: lib/librte_eal/linuxapp/eal/*xen*
 F: lib/librte_eal/linuxapp/eal/include/exec-env/rte_dom0_common.h
-- 
2.7.4



[dpdk-dev] [PATCH] doc: fix typos

2016-11-07 Thread Alain Leon
Fixes typos present in the documentation and code comments.

Signed-off-by: Alain Leon 
---
 doc/guides/prog_guide/overview.rst | 2 +-
 lib/librte_kni/rte_kni.h   | 2 +-
 lib/librte_mbuf/rte_mbuf.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/guides/prog_guide/overview.rst 
b/doc/guides/prog_guide/overview.rst
index 68cc75c..9986e3c 100644
--- a/doc/guides/prog_guide/overview.rst
+++ b/doc/guides/prog_guide/overview.rst
@@ -157,7 +157,7 @@ The mbuf library provides the facility to create and 
destroy buffers
 that may be used by the DPDK application to store message buffers.
 The message buffers are created at startup time and stored in a mempool, using 
the DPDK mempool library.

-This library provide an API to allocate/free mbufs, manipulate control message 
buffers (ctrlmbuf) which are generic message buffers,
+This library provides an API to allocate/free mbufs, manipulate control 
message buffers (ctrlmbuf) which are generic message buffers,
 and packet buffers (pktmbuf) which are used to carry network packets.

 Network Packet Buffer Management is described in :ref:`Mbuf Library 
`.
diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h
index 5f6f9e4..37deb47 100644
--- a/lib/librte_kni/rte_kni.h
+++ b/lib/librte_kni/rte_kni.h
@@ -42,7 +42,7 @@
  * interfaces that may be used by the RTE application to receive/transmit
  * packets from/to Linux kernel net interfaces.
  *
- * This library provide two APIs to burst receive packets from KNI interfaces,
+ * This library provides two APIs to burst receive packets from KNI interfaces,
  * and burst transmit packets to KNI interfaces.
  */

diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 109e666..ead7c6e 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -44,7 +44,7 @@
  * buffers. The message buffers are stored in a mempool, using the
  * RTE mempool library.
  *
- * This library provide an API to allocate/free packet mbufs, which are
+ * This library provides an API to allocate/free packet mbufs, which are
  * used to carry network packets.
  *
  * To understand the concepts of packet buffers or mbufs, you
-- 
2.7.4



[dpdk-dev] [PATCH] examples/ipsec-secgw: fix buffer not null terminated

2016-11-07 Thread Thomas Monjalon
2016-11-04 14:18, Ferruh Yigit:
> On 11/3/2016 12:12 PM, Fan Zhang wrote:
> > Fixes: 0d547ed03717 ("examples/ipsec-secgw: support configuration file")
> > Coverity issue: 137854
> > 
> > Signed-off-by: Fan Zhang 
> 
> Acked-by: Ferruh Yigit 
> 
> 
> Minor nit, for all coverity fixes, defined commit log format is:
> 
> Coverity issue: x
> Fixes: .
> 
> Basically two lines should be swapped, but I guess this can be fixed
> while applying instead of sending a new version for this.

Applied, thanks


[dpdk-dev] [PATCH] examples/ipsec-secgw: fix buffer not terminated issue

2016-11-07 Thread Thomas Monjalon
2016-11-04 14:16, Ferruh Yigit:
> On 11/3/2016 12:12 PM, Fan Zhang wrote:
> > Fixes: 0d547ed03717 ("examples/ipsec-secgw: support configuration file")
> > Coverity issue: 137855
> > 
> > Signed-off-by: Fan Zhang 
> 
> Acked-by: Ferruh Yigit 

Merged with previous patch and applied


[dpdk-dev] [PATCH] app/test: fix wrong pointer values in crypto perftest

2016-11-07 Thread Thomas Monjalon
> > This commit fixes problem with device hanging because of
> > wrong pointer values in snow3g performance test
> > 
> > Fixes: 97fe6461c7cb ("app/test: add SNOW 3G performance test")
> > 
> > Signed-off-by: Arek Kusztal 
> > ---
> Acked-by: Fiona Trahe 

Applied, thanks


[dpdk-dev] [PATCH] crypto: clarify how crypto operations affect buffers

2016-11-07 Thread Thomas Monjalon
> > Updated comments on API to clarify which parts of mbufs are
> > copied or changed by crypto operations.
> > 
> > Signed-off-by: Fiona Trahe 
> 
> Acked-by: Pablo de Lara 

Applied, thanks