dpdk.git
7 years agolib: add switch fall-through comments
Bruce Richardson [Thu, 4 May 2017 15:38:18 +0000 (16:38 +0100)]
lib: add switch fall-through comments

With GCC 7 we need to explicitly document when we are falling through from
one switch case to another.

Fixes: af75078fece3 ("first public release")
Fixes: 8bae1da2afe0 ("hash: fallback to software CRC32 implementation")
Fixes: 9ec201f5d6e7 ("mbuf: provide bulk allocation")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agonet/ixgbe: add switch fall-through comments
Bruce Richardson [Thu, 4 May 2017 15:38:16 +0000 (16:38 +0100)]
net/ixgbe: add switch fall-through comments

Add a comment documenting explicitly that we are falling through the case
statements to the next one.

Fixes: f9072f8b90bb ("ixgbe: migrate flow director filtering to new API")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet/bnx2x: add switch fall-through comments
Bruce Richardson [Thu, 4 May 2017 15:38:15 +0000 (16:38 +0100)]
net/bnx2x: add switch fall-through comments

Add in a comment for each switch fall-through indicating that it is
intentional. This will fix compiler warnings with GCC 7.

Fixes: b5bf7719221d ("bnx2x: driver support routines")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agonet/vmxnet3: fix build with gcc 7
Bruce Richardson [Thu, 4 May 2017 15:38:17 +0000 (16:38 +0100)]
net/vmxnet3: fix build with gcc 7

GCC 7 flags a value as uninitialized before used. While it's a false
positive, there is little harm in providing an initial value for the
variable.

Fixes: bb1d14b87fc3 ("vmxnet3: fix link state handling")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agodrivers/net: disable new gcc 7 warnings for base code
Bruce Richardson [Thu, 4 May 2017 15:38:14 +0000 (16:38 +0100)]
drivers/net: disable new gcc 7 warnings for base code

For base code in drivers shared with other projects, disable the new
warnings from gcc 7 about unlabelled fall-through in switch statements.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agomk: adjust gcc flags for new gcc 7 warnings
Bruce Richardson [Thu, 4 May 2017 15:38:13 +0000 (16:38 +0100)]
mk: adjust gcc flags for new gcc 7 warnings

There are two new warnings in GCC 7 that cause problems in the DPDK
compile.

1. GCC now warns if you have a switch fall-through without a suitable
comment indicating that it was intentional. The compiler supports a number
of levels of warning which are triggered depending on the type of message
used, with level 3 being the default. To accept a wider range of possible
fall-through messages, we adjust this down to level 2.

2. GCC also warns about an snprintf where there may be truncation and the
return value is not checked. Given that we often use snprintf in DPDK in
place of strncpy, and in many cases where truncation is not a problem, we
can just disable this particular warning.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agonet/af_packet: prefer snprintf against strncpy
Ferruh Yigit [Thu, 4 May 2017 11:16:59 +0000 (12:16 +0100)]
net/af_packet: prefer snprintf against strncpy

strncpy may left destination buffer not NULL terminated, switched using
snprintf to be sure destination buffer is NULL terminated.

Coverity issue: 1407495
Coverity issue: 1407498
Fixes: cc68ac4847bc ("net/af_packet: support MTU change")
Fixes: 218259590ea4 ("net/af_packet: support promiscuous")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agonet/mlx5: fix crash on deleting flow drop queue
Yongseok Koh [Mon, 1 May 2017 21:05:42 +0000 (14:05 -0700)]
net/mlx5: fix crash on deleting flow drop queue

If mlx5_dev_start() fails, it tries to rollback data structures related to
rte_flow including drop queue. The destruction code doesn't assume the
structures are created but priv_flow_delete_drop_queue() never does sanity
check. This can cause a crash.

Fixes: 028761059aeb ("net/mlx5: use an RSS drop queue")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: fix Tx max inline with TSO
Shahaf Shuler [Wed, 3 May 2017 06:55:35 +0000 (09:55 +0300)]
net/mlx5: fix Tx max inline with TSO

When TSO is enabled, Verbs layer aggregates the TSO
inline size with the txq inline size for the Tx creation,
while the PMD takes the maximum among them.

Fixing it by adjusting the max inline parameter before
passing to to Verbs.

Fixes: 3f13f8c23a7c ("net/mlx5: support hardware TSO")

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/fm10k: fix memory overflow in 32-bit SSE Rx
Qi Zhang [Sun, 30 Apr 2017 05:26:51 +0000 (01:26 -0400)]
net/fm10k: fix memory overflow in 32-bit SSE Rx

Return mbuf points of _recv_raw_pkts_vec are modified out of bound.

Fixes: a6ce64a97520 ("fm10k: introduce vector driver")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
7 years agonet/i40e: fix memory overflow in 32-bit SSE Rx
Qi Zhang [Sun, 30 Apr 2017 05:26:49 +0000 (01:26 -0400)]
net/i40e: fix memory overflow in 32-bit SSE Rx

Return mbuf points of _recv_raw_pkts_vec are modified out of bound.

Fixes: 8e109464c022 ("i40e: allow vector Rx and Tx usage")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
7 years agonet/ixgbe: fix memory overflow in 32-bit SSE Rx
Qi Zhang [Sun, 30 Apr 2017 05:26:50 +0000 (01:26 -0400)]
net/ixgbe: fix memory overflow in 32-bit SSE Rx

Return mbuf points of _recv_raw_pkts_vec are modified out of bound.

Fixes: c95584dc2b18 ("ixgbe: new vectorized functions for Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
7 years agonet/i40e: consider QinQ when setting MTU
Wenzhuo Lu [Tue, 2 May 2017 01:51:58 +0000 (09:51 +0800)]
net/i40e: consider QinQ when setting MTU

When counting max packet length from MTU, count
VLAN tag length twice for QinQ packets.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e: add LLDP check for ethertype filter
Beilei Xing [Thu, 27 Apr 2017 11:02:18 +0000 (19:02 +0800)]
net/i40e: add LLDP check for ethertype filter

LLDP rule is not supported in ethertype filter.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/ixgbe: fix setting MTU on stopped device
Jia Yu [Fri, 28 Apr 2017 06:11:31 +0000 (23:11 -0700)]
net/ixgbe: fix setting MTU on stopped device

There exists case that software sets mtu (i.e jumbo frame) of
ixgbe device when it's stopped. Before the fix, scattered_rx
is cleared during device stop, and setting jumbo frame mtu
after device stop will always fail as scattered_rx is 0.

Signed-off-by: Jia Yu <jyu@vmware.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet/ixgbe: fix VF Rx mode for allmulticast disabled
Wei Dai [Thu, 4 May 2017 09:54:40 +0000 (17:54 +0800)]
net/ixgbe: fix VF Rx mode for allmulticast disabled

Some customers find that 82599 NIC DPDK VF PMD can't receive any
broadcast packets when it is bound to igb_uio in the first time
to run a DPDK application like testpmd. But when the application
is quited and run again, the DPDK VF PMD can receive broadcast
packets again. The associated PF is run by kernel driver when
the VF is driven by DPDK PMD.

Fixes: 260e2e22e26f ("net/ixgbe/base: move multicast mode update")
Fixes: 72dec9e37a84 ("ixgbe: support multicast promiscuous mode on VF")
Cc: stable@dpdk.org
Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet/ixgbe: fix default MAC setting
Wenzhuo Lu [Tue, 2 May 2017 08:34:59 +0000 (16:34 +0800)]
net/ixgbe: fix default MAC setting

Pool 0 is not PF, it's VF 0. So the MAC is set for VF 0
but not PF.
The code introduced a weird issue. In the scenario PF + VF,
when only starting PF, the default PF MAC address is working.
But after starting a VF, the default PF MAC address becomes
the VF's address.

Use the pool which is not occupied by VFs for PF to fix it.

Fixes: 8164fe82846b ("ixgbe: add default mac address modifier")
Cc: stable@dpdk.org
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet/igb: fix VF MAC address setting
Qiming Yang [Wed, 3 May 2017 05:52:47 +0000 (13:52 +0800)]
net/igb: fix VF MAC address setting

We find that VF receive address register is not set
if MAC address is assigned by PF. This patch fixes it.

Fixes: d82170d27918 ("igb: add VF support")
Cc: stable@dpdk.org
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet/igb: fix VF MAC address setting
Qiming Yang [Wed, 3 May 2017 05:51:32 +0000 (13:51 +0800)]
net/igb: fix VF MAC address setting

VF default MAC address be added in PF Mac address list
instead of VF MAC address list, makes VF can't receive
packets. This patch fixes this issue.

Fixes: be2d648a2dd3 ("igb: add PF support")
Cc: stable@dpdk.org
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agoethdev: fix adding invalid MAC address
Wei Dai [Fri, 5 May 2017 00:40:00 +0000 (08:40 +0800)]
ethdev: fix adding invalid MAC address

Some customers find adding MAC addr to VF sometimes can fail,
but it is still stored in dev->data->mac_addrs[ ]. So this
can lead to some errors that assumes the non-zero entry in
dev->data->mac_addrs[ ] is valid.
Following acknowledgements are from specific NIC PMD
maintainer for their managing part.

This patch changes the ethdev internal API, it should not be
backported to a stable/LTS release so far.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet: fix stripped VLAN flag for offload emulation
Michał Mirosław [Thu, 4 May 2017 22:36:13 +0000 (00:36 +0200)]
net: fix stripped VLAN flag for offload emulation

Apply the new flag PKT_RX_VLAN_STRIPPED to the software emulation case
(currently only for virtio and af_packet).

Fixes: b37b528d957c ("mbuf: add new Rx flags for stripped VLAN")
Cc: stable@dpdk.org
Signed-off-by: Michał Mirosław <michal.miroslaw@atendesoftware.pl>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
7 years agokni: fix crash caused by freeing mempool
Ferruh Yigit [Wed, 3 May 2017 16:10:37 +0000 (17:10 +0100)]
kni: fix crash caused by freeing mempool

To clean alloc_q, which has physical addresses of the mbufs, kni lib
free the pkt_mempool, but this leads a crash in kni unit test.

KNI library shouldn't free the pkt_mempool.

Implementation updated to find the mbufs in the alloc_q and return them
back to mempool.

Fixes: 8eba5ebd1811 ("kni: fix possible memory leak")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agokni: fix ethtool build with kernel 4.11
Ferruh Yigit [Wed, 3 May 2017 16:00:16 +0000 (17:00 +0100)]
kni: fix ethtool build with kernel 4.11

build error:
.../lib/librte_eal/linuxapp/kni/igb_main.c:1034:10:
error: implicit declaration of function ‘pci_enable_msix’
    err = pci_enable_msix(pdev,
              ^~~~~~~~~~~~~~~

This build error observed when CONFIG_RTE_KNI_KMOD_ETHTOOL config option
enabled.

Following Linux commit removes the pci_enable_msix()
Linux: 4244de1c64de ("PCI: remove pci_enable_msix")

Switch to pci_enable_msix_range() for kernel > 4.8 since current Linux
igb driver uses this function.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
7 years agoeal: optimize TSC routines when HPET is disabled
Jerin Jacob [Tue, 2 May 2017 05:19:51 +0000 (10:49 +0530)]
eal: optimize TSC routines when HPET is disabled

Since DPDK has only two timer sources,
Avoid &eal_timer_source memory read and followed
by the switch case statement when
RTE_LIBEAL_USE_HPET is not defined.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agoconfig: make backtrace optional
Wei Dai [Mon, 13 Mar 2017 08:59:27 +0000 (16:59 +0800)]
config: make backtrace optional

When building DPDK with musl, there is need not to disable
backtrace to remove some references to execinfo.h which is
not supported by musl now.
This also applies to some other libc implementation which
doesn't support backtrace() and backtrace_symbols().

musl is an implementation of the userspace portion
of the standard library functionality described in
the ISO C and POSIX standards, plus common extensions.
Got more details about musl from http://www.musl-libc.org .

Signed-off-by: Wei Dai <wei.dai@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
7 years agoexamples/performance-thread: remove useless include
Wei Dai [Mon, 13 Mar 2017 08:59:26 +0000 (16:59 +0800)]
examples/performance-thread: remove useless include

There is no function to refer any part of execinfo.h, so remove the
reference to it.
And there is no this file in musl. So need to remove it to support musl.

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agovdev: remove eal prefix
Thomas Monjalon [Thu, 4 May 2017 16:01:19 +0000 (18:01 +0200)]
vdev: remove eal prefix

The VDEV code will move to the bus drivers directory.
Rename functions from rte_eal_vdev_ to rte_vdev_
to prepare the move of the driver out of EAL.

The prefix rte_eal_vdrv_ is also renamed to rte_vdev_.
It was used for registration of vdev drivers.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
7 years agopci: remove eal prefix
Thomas Monjalon [Thu, 4 May 2017 14:48:59 +0000 (16:48 +0200)]
pci: remove eal prefix

The PCI code will move to the bus drivers directory.
Rename functions from rte_eal_pci_ to rte_pci_
to prepare the move of the driver out of EAL.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
7 years agoeal: remove forward declaration of generic driver
Thomas Monjalon [Thu, 4 May 2017 15:44:38 +0000 (17:44 +0200)]
eal: remove forward declaration of generic driver

We can just move rte_driver definition before rte_device
(which depends on rte_driver).

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
7 years agoeal: remove generic driver and device lists
Thomas Monjalon [Mon, 1 May 2017 23:05:32 +0000 (01:05 +0200)]
eal: remove generic driver and device lists

These lists were unused and useless because they are maintained per bus:
struct rte_driver_list dev_driver_list
struct rte_device_list dev_device_list

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
7 years agoversion: 17.05-rc3
Thomas Monjalon [Mon, 1 May 2017 23:11:14 +0000 (01:11 +0200)]
version: 17.05-rc3

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
7 years agousertools: fix CPU layout with python 3
Thomas Monjalon [Sun, 30 Apr 2017 14:11:40 +0000 (16:11 +0200)]
usertools: fix CPU layout with python 3

These differences in Python 3 were causing errors:
- xrange is replaced by range
- dict values are a view (instead of list)
- has_key is removed

Fixes: deb87e6777c0 ("usertools: use sysfs for CPU layout")
Fixes: 63985c5f104e ("usertools: fix CPU layout for more than 2 threads")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
7 years agousertools: remove devbind module search corner cases
Mark Asselstine [Mon, 1 May 2017 19:09:09 +0000 (15:09 -0400)]
usertools: remove devbind module search corner cases

The existing code used to search for module files via modinfo has
several corner cases which can result in it failing where it should be
successful.

The call to lower() would cause results returned by 'modinfo' to be
forced to lowercase, results which were subsequently passed to
exists() which is case sensitive. This was most likely done to capture
all variants of failure strings modinfo might return
(ie. ERROR/Error/error/...)  without thought negative effect to the
later call to exists(). For many this is a nonissue but if the module
path included non-lowercase alpha characters, something which is
easily possible with a non-lowercase kernel-extraversion string, this
would cause an issue.

We could move the call to lower() to the check for "error" but this
still leaves possible corner cases, for modules or module paths with
'error' in them.

Instead we will prevent modinfo's stderr from being used as a "good
value" for path, meaning we either get a valid path from modinfo, or
nothing at all. This removes all corner cases.

Ultimately these preliminary checks are unnecessary as exists() will
only return True if it is passed a valid path, passing it modinfo's
stderr would fail. In keeping with the original code, however, we do
some preliminary checks, but we are now free of corner cases.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
7 years agonet/ixgbe: support xstats by ID
Kuba Kozak [Thu, 27 Apr 2017 14:42:40 +0000 (16:42 +0200)]
net/ixgbe: support xstats by ID

To achieve functionality of retrieving only specific statistics
given by application there are two new functions added:
ixgbe_dev_xstats_get_by_ids() which retrieve
values of statistics specified by ids array
and ixgbe_dev_xstats_get_names_by_ids() which retrieve
names of statistics specified by ids array.

Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
7 years agonet/igb: support xstats by ID
Kuba Kozak [Thu, 27 Apr 2017 14:42:39 +0000 (16:42 +0200)]
net/igb: support xstats by ID

To achieve functionality of retrieving only specific statistics
given by application there are two new functions added:
eth_igb_xstats_get_by_id() which retrieve
values of statistics specified by ids array
and eth_igb_xstats_get_names_by_id() which retrieve
names of statistics specified by ids array.

Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
7 years agoapp/proc-info: support xstats by ID and by name
Kuba Kozak [Thu, 27 Apr 2017 14:42:38 +0000 (16:42 +0200)]
app/proc-info: support xstats by ID and by name

There are new arguments --xstats-ids and --xstats-name
in proc_info command line to retrieve statistics given by ids
and by name.
E.g. --xstats-ids="1,3,5,7,8"
E.g. --xstats-name rx_errors

Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
7 years agoethdev: get xstats ID by name
Kuba Kozak [Thu, 27 Apr 2017 14:42:37 +0000 (16:42 +0200)]
ethdev: get xstats ID by name

Introduced new function: rte_eth_xstats_get_id_by_name
to retrieve xstats ids by its names.

Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
7 years agoethdev: retrieve xstats by ID
Kuba Kozak [Thu, 27 Apr 2017 14:42:36 +0000 (16:42 +0200)]
ethdev: retrieve xstats by ID

Extended xstats API in ethdev library to allow grouping of stats
logically so they can be retrieved per logical grouping  managed
by the application.
Added new functions rte_eth_xstats_get_names_by_id and
rte_eth_xstats_get_by_id using additional arguments (in compare
to rte_eth_xstats_get_names and rte_eth_xstats_get) - array of ids
and array of values.

doc: add description for modified xstats API
Documentation change for new extended statistics API functions.
The old API only allows retrieval of *all* of the NIC statistics
at once. Given this requires a MMIO read PCI transaction per statistic
it is an inefficient way of retrieving just a few key statistics.
Often a monitoring agent only has an interest in a few key statistics,
and the old API forces wasting CPU time and PCIe bandwidth in retrieving
*all* statistics; even those that the application didn't explicitly
show an interest in.
The new, more flexible API allow retrieval of statistics per ID.
If a PMD wishes, it can be implemented to read just the required
NIC registers. As a result, the monitoring application no longer wastes
PCIe bandwidth and CPU time.

Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
7 years agoethdev: revert xstats by ID
Kuba Kozak [Thu, 27 Apr 2017 14:42:35 +0000 (16:42 +0200)]
ethdev: revert xstats by ID

Revert patches to provide clear view for
upcoming changes. Reverted patches are listed below:
commit ea85e7d711b6 ("ethdev: retrieve xstats by ID")
commit a954495245c4 ("ethdev: get xstats ID by name")
commit 1223608adb9b ("app/proc-info: support xstats by ID")
commit 25e38f09af9c ("net/e1000: support xstats by ID")
commit 923419333f5a ("net/ixgbe: support xstats by ID")

Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
7 years agodoc: revise sample testpmd flow commands
Bernard Iremonger [Tue, 18 Apr 2017 14:20:46 +0000 (15:20 +0100)]
doc: revise sample testpmd flow commands

Stop port before enabling QinQ.
Add commands to set inner and outer TPID's and start port.
Remove TPID's from flow validate and and flow create commands.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agonet/ark: fix kvargs memory leak
Ferruh Yigit [Fri, 28 Apr 2017 07:43:11 +0000 (08:43 +0100)]
net/ark: fix kvargs memory leak

Coverity issue: 1428042
Fixes: 1131cbf0fb2b ("net/ark: stub PMD for Atomic Rules Arkville")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: John Miller <john.miller@atomicrules.com>
7 years agonet/tap: fix support for large Rx queues
Pascal Mazon [Thu, 27 Apr 2017 13:51:42 +0000 (15:51 +0200)]
net/tap: fix support for large Rx queues

Rx queues configured with more than 1023 descriptors cause readv() calls to
fail due to more iovec entries than permitted by the kernel. As a result,
no packets can be received.

Quietly limit internal Rx queue size to the maximum number of iovec entries
to fix this issue.

Fixes: 0781f5762cfe ("net/tap: support segmented mbufs")

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
7 years agonet/thunderx: fix deadlock in Rx path
Jerin Jacob [Mon, 1 May 2017 18:41:55 +0000 (00:11 +0530)]
net/thunderx: fix deadlock in Rx path

RBDR buffers are refilled when SW consumes the buffers from CQ.
This creates deadlock case when CQ buffers exhausted due to lack
of RBDR buffers. Fix is to refill the RBDR when rx_free_thresh
meet, irrespective of the number of CQ buffers consumed.

Fixes: e2d7fc9f0a24 ("net/thunderx: add single and multi-segment Rx")
Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agoexamples/ethtool: fix link with ixgbe shared lib
Markos Chandras [Thu, 16 Feb 2017 16:17:31 +0000 (16:17 +0000)]
examples/ethtool: fix link with ixgbe shared lib

When RTE_DEVEL_BUILD is unset, -rpath is unset.
So the ethtool app cannot link with ixgbe shared library
which is required by ethtool lib:

warning: librte_pmd_ixgbe.so.1, needed by
examples/ethtool/lib/x86_64-native-linuxapp-gcc/lib/librte_ethtool.so,
not found (try using -rpath or -rpath-link)

It is fixed by adding the library in the application link.

The library link is also improved to specify that this explicit link
to ixgbe is needed only in the shared lib mode.

Fixes: 077d223e25c3 ("examples/ethtool: use ixgbe public function")

Signed-off-by: Markos Chandras <mchandras@suse.de>
Acked-by: Remy Horton <remy.horton@intel.com>
Acked-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
7 years agoexamples/load_balancer: fix Tx flush
Andriy Berestovskyy [Thu, 27 Apr 2017 09:27:54 +0000 (11:27 +0200)]
examples/load_balancer: fix Tx flush

Port ID is not an index from 0 to n_nic_ports, but rather a value
of nic_ports array.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
7 years agoexamples/l3fwd-power: fix Rx descriptor size
Pablo de Lara [Wed, 26 Apr 2017 11:29:52 +0000 (12:29 +0100)]
examples/l3fwd-power: fix Rx descriptor size

L3fwd power app monitors the RX queues to see if the polling frequency
should be adjusted (the busier the queue, the higher the frequency).
The app uses several thresholds in the ring to determine the frequency,
being 96 the highest one, when frequency should be highest.

The problem is that the difference between this value and the ring size
is not big enough (128 - 96 = 32 descriptors), which means that
if the descriptors are not replenished quick enough, queue might
not be busy, but the app would think that it is, because 96th descriptor
is set.

Therefore, by increasing this gap (increasing the RX ring size),
we make sure that this false measurement will not happen.

Fixes: b451aa39db31 ("examples/l3fwd-power: use DD bit rather than RX queue count")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
7 years agoexamples/l3fwd-power: fix handling no Rx queue
Jingjing Wu [Fri, 28 Apr 2017 10:47:44 +0000 (18:47 +0800)]
examples/l3fwd-power: fix handling no Rx queue

If the number of rx queues is zero, it is meaningless to enable
rx interrupt. This patch fixes it.

Fixes: aee3bc79cc34 ("examples/l3fwd-power: enable one-shot Rx interrupt and polling switch")
Cc: stable@dpdk.org
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agoexamples/l2fwd-keepalive: clean up shared mem on exit
Remy Horton [Thu, 27 Apr 2017 12:37:06 +0000 (13:37 +0100)]
examples/l2fwd-keepalive: clean up shared mem on exit

This patch adds the unlinking/unmapping of shared host memory
on termination of l2fwd-keepalive. Previously it was only
cleaned on re-running of the example application.

Fixes: e64833f2273a ("examples/l2fwd-keepalive: add sample application")

Signed-off-by: Remy Horton <remy.horton@intel.com>
Tested-by: Roman Korynkevych <romanx.korynkevych@intel.com>
7 years agoexamples/l2fwd-keepalive: add graceful exit
Remy Horton [Thu, 27 Apr 2017 12:37:05 +0000 (13:37 +0100)]
examples/l2fwd-keepalive: add graceful exit

The l2fwd-keepalive example has infinite processing loops and as a
result the only way to exit it is via SIGINT/SIGTERM (e.g. Control-C).
The resulting shutdown is unclean, which is fixed by adding a signal
handler that causes the processing loops to break.

Fixes: e64833f2273a ("examples/l2fwd-keepalive: add sample application")

Signed-off-by: Remy Horton <remy.horton@intel.com>
Tested-by: Roman Korynkevych <romanx.korynkevych@intel.com>
7 years agoexamples/multi_process: fix timer update
Zhiyong Yang [Thu, 23 Feb 2017 02:00:58 +0000 (10:00 +0800)]
examples/multi_process: fix timer update

To miss updating the variable prev_tsc in function l2fwd_main_loop()
The patch fixes it.

Fixes: e2366e74e029 ("examples: use buffered Tx")
Cc: stable@dpdk.org
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
7 years agoexamples/performance-thread: fix build on FreeBSD 10.0
Bruce Richardson [Fri, 28 Apr 2017 10:18:15 +0000 (11:18 +0100)]
examples/performance-thread: fix build on FreeBSD 10.0

While later releases in the FreeBSD 10 series have a CPU_COUNT macro
defined, FreeBSD 10.0 and 10.1 do not have this macro. Therefore we provide
a basic fallback implementation of the macro for platforms where it is not
defined.

Fixes: 433ba6228f9a ("examples/performance-thread: add pthread_shim app")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agoapp/testpmd: load commands from file at runtime
Allain Legacy [Fri, 31 Mar 2017 19:13:20 +0000 (15:13 -0400)]
app/testpmd: load commands from file at runtime

Adds support to testpmd to load a set of cmdline CLI commands at runtime.
This can be helpful when needing to cut-n-paste many commands where
cut-n-paste may not be practical.

   testpmd> load /home/ubuntu/somefile.txt

Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agoapp/testpmd: load commands from file at startup
Allain Legacy [Fri, 31 Mar 2017 19:13:19 +0000 (15:13 -0400)]
app/testpmd: load commands from file at startup

Adds support to testpmd to load a set of cmdline CLI commands at startup.
This can be helpful when needing to cut-n-paste many commands each time
testpmd is restarted.  This option will work in both interactive and
non-interactive modes.

   ./testpmd -n4 -c3 ... -- --cmdline-file=/home/ubuntu/somefile.txt

Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agoapp/testpmd: add --bitrate-stats option
Remy Horton [Fri, 28 Apr 2017 11:00:13 +0000 (12:00 +0100)]
app/testpmd: add --bitrate-stats option

Bit-rate collation should only be done by one core. This patch adds
an option to select which core performs the bit-rate calculation,
which is also disabled by default.

Fixes: 7e4441c8efb9 ("app/testpmd: add bitrate statistics calculation")

Signed-off-by: Remy Horton <remy.horton@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agoapp/testpmd: fix exit without freeing resources
Jiayu Hu [Fri, 28 Apr 2017 01:32:50 +0000 (09:32 +0800)]
app/testpmd: fix exit without freeing resources

When testpmd exits, it frees the acquired resources (e.g. stop ports).
However, when we terminate it by Ctrl-d, testpmd exits directly without
releasing the resources. In this patch, we fix this exit issue.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
7 years agoapp/testpmd: fix number of mbufs in pool
Olivier Matz [Mon, 24 Apr 2017 12:33:58 +0000 (14:33 +0200)]
app/testpmd: fix number of mbufs in pool

The number of mbufs in pools is not consistent depending on the
options passed by the user and the number of ports, especially
in numa mode, when the number of mbuf is specified by the user.

When the user specifies the number of mbuf (per pool), it should
overrides the default value.

- before the patch

./build/app/testpmd -- -i
  <mbuf_pool_socket_0>: n=331456, size=2176, socket=0
  <mbuf_pool_socket_1>: n=331456, size=2176, socket=1

./build/app/testpmd -- --total-num-mbufs=8000 -i
  <mbuf_pool_socket_0>: n=256000, size=2176, socket=0
  <mbuf_pool_socket_1>: n=256000, size=2176, socket=1
  # BAD, should be n=8000 for each socket

./build/app/testpmd -- --no-numa -i
  <mbuf_pool_socket_0>: n=331456, size=2176, socket=0

./build/app/testpmd -- --no-numa --total-num-mbufs=8000 -i
  <mbuf_pool_socket_0>: n=8000, size=2176, socket=0

./build/app/testpmd --vdev=eth_null0 --vdev=eth_null1 -- -i
  <mbuf_pool_socket_0>: n=331456, size=2176, socket=0
  <mbuf_pool_socket_1>: n=331456, size=2176, socket=1

./build/app/testpmd --vdev=eth_null0 --vdev=eth_null1 -- \
     --total-num-mbufs=8000 -i
  <mbuf_pool_socket_0>: n=128000, size=2176, socket=0
  <mbuf_pool_socket_1>: n=128000, size=2176, socket=1
  # BAD, should be n=8000 for each socket

./build/app/testpmd --vdev=eth_null0 --vdev=eth_null1 -- --no-numa -i
  <mbuf_pool_socket_0>: n=331456, size=2176, socket=0

./build/app/testpmd --vdev=eth_null0 --vdev=eth_null1 -- --no-numa \
     --total-num-mbufs=8000 -i
  <mbuf_pool_socket_0>: n=8000, size=2176, socket=0

- after the patch

./build/app/testpmd -- -i
  <mbuf_pool_socket_0>: n=331456, size=2176, socket=0
  <mbuf_pool_socket_1>: n=331456, size=2176, socket=1

./build/app/testpmd -- --total-num-mbufs=8000 -i
  <mbuf_pool_socket_0>: n=8000, size=2176, socket=0
  <mbuf_pool_socket_1>: n=8000, size=2176, socket=1

./build/app/testpmd -- --no-numa -i
  <mbuf_pool_socket_0>: n=331456, size=2176, socket=0

./build/app/testpmd -- --no-numa --total-num-mbufs=8000 -i
  <mbuf_pool_socket_0>: n=8000, size=2176, socket=0

./build/app/testpmd --vdev=eth_null0 --vdev=eth_null1 -- -i
  <mbuf_pool_socket_0>: n=331456, size=2176, socket=0
  <mbuf_pool_socket_1>: n=331456, size=2176, socket=1

./build/app/testpmd --vdev=eth_null0 --vdev=eth_null1 -- \
     --total-num-mbufs=8000 -i
  <mbuf_pool_socket_0>: n=8000, size=2176, socket=0
  <mbuf_pool_socket_1>: n=8000, size=2176, socket=1

./build/app/testpmd --vdev=eth_null0 --vdev=eth_null1 -- --no-numa -i
  <mbuf_pool_socket_0>: n=331456, size=2176, socket=0

./build/app/testpmd --vdev=eth_null0 --vdev=eth_null1 -- --no-numa \
     --total-num-mbufs=8000 -i
  <mbuf_pool_socket_0>: n=8000, size=2176, socket=0

Fixes: b6ea6408fbc7 ("ethdev: store numa_node per device")
Cc: stable@dpdk.org
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agoapp/testpmd: fix crash at mbuf pool creation
Olivier Matz [Mon, 24 Apr 2017 12:33:57 +0000 (14:33 +0200)]
app/testpmd: fix crash at mbuf pool creation

Since
commit 999b2ee0fe45 ("app/testpmd: enable NUMA support by default"),
testpmd is started with numa enabled by default. This highlights a
floating point exception when started with --total-num-mbufs without any
port (division by 0). This bug was already triggered before this commit
if the --no-numa option was given.

This commit adds a check of the nb_ports value before doing the
division. By looking at this code, it appears that the creation of the
mbuf pool is not consistent for the number of mbufs depending on the
configuration. This is fixed in the next commit.

Fixes: b6ea6408fbc7 ("ethdev: store numa_node per device")
Cc: stable@dpdk.org
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agocryptodev: fix API digest length comments
Fiona Trahe [Tue, 25 Apr 2017 16:56:31 +0000 (17:56 +0100)]
cryptodev: fix API digest length comments

Fix misleading comments clarifying setting of digest length.

Fixes: d11b0f30df88 ("cryptodev: introduce API and framework for crypto devices")
Cc: stable@dpdk.org
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
7 years agocrypto/qat: fix dequeue statistics
Gage Eads [Thu, 27 Apr 2017 15:31:17 +0000 (10:31 -0500)]
crypto/qat: fix dequeue statistics

The QAT device's dequeued_count and dequeue_err_count stats were
incorrectly assigned the enqueued_count and enqueue_err_count values,
respectively.

Fixes: 1703e94ac5ce ("qat: add driver for QuickAssist devices")
Cc: stable@dpdk.org
Signed-off-by: Gage Eads <gage.eads@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agoexamples/l2fwd-crypto: fix packets array index
Pablo de Lara [Tue, 25 Apr 2017 15:32:36 +0000 (16:32 +0100)]
examples/l2fwd-crypto: fix packets array index

Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriented")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agodoc: add limitation of AAD size to QAT guide
Arek Kusztal [Tue, 25 Apr 2017 14:39:36 +0000 (15:39 +0100)]
doc: add limitation of AAD size to QAT guide

Add limitation of additional authenticated data (AAD) in
Intel QuickAssist Technology driver rst file

Fixes: 1703e94ac5ce ("qat: add driver for QuickAssist devices")
Cc: stable@dpdk.org
Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocryptodev: fix API AAD comments
Arek Kusztal [Tue, 25 Apr 2017 14:33:51 +0000 (15:33 +0100)]
cryptodev: fix API AAD comments

Fix comments concerning aad sizes in Cryptodev API.
Cc: stable@dpdk.org
Fixes: d11b0f30df88 ("cryptodev: introduce API and framework for crypto devices")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocrypto/openssl: fix AES-GCM capability
Pablo de Lara [Wed, 26 Apr 2017 13:33:03 +0000 (14:33 +0100)]
crypto/openssl: fix AES-GCM capability

Crypto OpenSSL PMD supports 16, 24 and 32 byte keys,
for AES GCM.

Fixes: d61f70b4c918 ("crypto/libcrypto: add driver for OpenSSL library")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agocrypto/qat: fix AAD capabilities for AES-GCM
Arek Kusztal [Tue, 25 Apr 2017 14:41:14 +0000 (15:41 +0100)]
crypto/qat: fix AAD capabilities for AES-GCM

Fix aad capabilities for AES-GCM authtentication, aad is changed
from range 8-12 to 0-240

Fixes: 1703e94ac5ce ("qat: add driver for QuickAssist devices")
Cc: stable@dpdk.org
Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocrypto/openssl: fix AAD capabilities for AES-GCM
Arek Kusztal [Tue, 25 Apr 2017 14:40:48 +0000 (15:40 +0100)]
crypto/openssl: fix AAD capabilities for AES-GCM

Fix aad capabilities for AES-GCM authtentication, aad is changed from
range 8-12 to 0-65535

Fixes: 8a9867a635c0 ("crypto/openssl: rename libcrypto to openssl")
Cc: stable@dpdk.org
Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agonet/virtio: fix crash when closing twice
Huanle Han [Mon, 20 Feb 2017 14:04:46 +0000 (22:04 +0800)]
net/virtio: fix crash when closing twice

This commit fixs segment fault when rte_eth_dev_close() is called on
a virtio dev more than once.  Assigning zero after free to avoids
freed memory to be accessed again.

Fixes: 69c80d4ef89b ("net/virtio: allocate queue at init stage")
Cc: stable@dpdk.org
Signed-off-by: Huanle Han <hanxueluo@gmail.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agonet/virtio-user: fix device type check
Jianfeng Tan [Fri, 21 Apr 2017 02:28:09 +0000 (02:28 +0000)]
net/virtio-user: fix device type check

Segfault happens when using virtio-user after commit 7f0a669e7b04
("ethdev: add allocation helper for virtual drivers").

It's due to we use ethdev->device to recognize physical devices,
but after above commit, this field is also filled for virtual
devices. Then we obtain the wrong pci_dev pointer and accessing
its field when copying pci info results in segfault.

To fix it, we use hw->virtio_user_dev to differentiate physical
devices from virtual devices.

Fixes: 6a7c0dfcdf40 ("net/virtio: do not depend on PCI device of ethdev")

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agonet/virtio: fix link status always down
Jianfeng Tan [Thu, 27 Apr 2017 07:35:39 +0000 (07:35 +0000)]
net/virtio: fix link status always down

The virtio port link status will always be DOWN:

The commit aa9f06061765 ("net/virtio: fix link status always being up")
introduces a flag to help checking the status. If this flag is not set,
status will be always down. However, in dev start, this flag is set
after link status update, then we miss the chance to change the status
to UP in dev start.

To fix this bug, we simply move the link status update after the flag
setting so that the status can be correctly updated.

Fixes: aa9f06061765 ("net/virtio: fix link status always being up")
Cc: stable@dpdk.org
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agonet/virtio: remove redundant MSI-X detection
Jianfeng Tan [Thu, 27 Apr 2017 07:35:38 +0000 (07:35 +0000)]
net/virtio: remove redundant MSI-X detection

As we already change to use capability list to detect MSI-X, remove
the redundant MSI-X detection in legacy devices.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agonet/virtio: fix LSC setting
Jianfeng Tan [Thu, 27 Apr 2017 07:35:37 +0000 (07:35 +0000)]
net/virtio: fix LSC setting

LSC flag is set in several places, but only the last one takes effect;
so we remove the redundant ones and just keep the last one.

This also fixes the bug that dev_flags being overwritten by
rte_eth_copy_pci_info(), which resets it to 0 unconditionally.

Cc: stable@dpdk.org
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agonet/virtio: fix MSI-X for modern devices
Jianfeng Tan [Thu, 27 Apr 2017 07:35:36 +0000 (07:35 +0000)]
net/virtio: fix MSI-X for modern devices

The field, use_msix, in struct virtio_hw is not updated for modern
device, and is always zero. And now we depend on the status feature
and MSI-X to report LSC support (which is also not a correct
behavior). As a result, LSC is always disabled for modern devices.

To fix this, we just recognize MSI-X capability when going through
capability list, and update the info in virtio.

Fixes: 6ba1f63b5ab0 ("virtio: support specification 1.0")
Cc: stable@dpdk.org
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agovhost: workaround MQ fails to startup
Zhiyong Yang [Thu, 27 Apr 2017 09:41:23 +0000 (17:41 +0800)]
vhost: workaround MQ fails to startup

vhost since dpdk17.02 + qemu2.7 and above will cause failures of
new connection when negotiating to set MQ. (one queue pair works
well).

Because there exist some bugs in qemu code when introducing
VHOST_USER_PROTOCOL_F_REPLY_ACK to qemu. when dealing with the vhost
message VHOST_USER_SET_MEM_TABLE for the second time, qemu indeed
doesn't send the messge (The message needs to be sent only once)but
still will be waiting for dpdk's reply ack, then, qemu is always
freezing. DPDK code indeed works in the right way.

The feature VHOST_USER_PROTOCOL_F_REPLY_ACK has to be disabled
by default at the dpdk side in order to avoid the feature support of
DPDK + qemu at the same time. if doing like that, MQ can works well.

Cc: stable@dpdk.org
Reported-by: Ciara Loftus <ciara.loftus@intel.com>
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Tested-by: Ciara Loftus <ciara.loftus@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agonet/avp: fix interrupt migration check
Ferruh Yigit [Fri, 28 Apr 2017 06:49:03 +0000 (07:49 +0100)]
net/avp: fix interrupt migration check

Bitwise OR within if statement is always true, fix bitwise operator.

Coverity issue: 1423906
Fixes: 82e140b84995 ("net/avp: handle interrupt migration")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
7 years agonet/ixgbe: fix ntuple filter for SCTP
Wei Zhao [Fri, 28 Apr 2017 03:40:18 +0000 (11:40 +0800)]
net/ixgbe: fix ntuple filter for SCTP

Add the support of RTE_FLOW_ITEM_TYPE_SCTP type packet for
ixgbe ntuple filter.

Fixes: 672be56d76a ("net/ixgbe: parse n-tuple filter")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet/ixgbe: ensure link status is updated
Laurent Hardy [Thu, 27 Apr 2017 15:03:42 +0000 (17:03 +0200)]
net/ixgbe: ensure link status is updated

In case of fiber and link speed set to 1Gb at peer side (with autoneg
or with defined speed), link status could be not properly updated at
time cable is plugged-in.
Indeed if cable was not plugged when device has been configured and
started then link status will not be updated properly with new speed
as no link setup will be triggered.

To avoid this issue, IXGBE_FLAG_NEED_LINK_CONFIG is set to try a link
setup each time link_update() is triggered and current link status is
down. When cable is plugged-in, link setup will be performed via
ixgbe_setup_link().

Signed-off-by: Laurent Hardy <laurent.hardy@6wind.com>
Acked-by: Wei Dai <wei.dai@intel.com>
7 years agonet/bonding: fix updating slave link status
Wei Wang [Tue, 25 Apr 2017 06:30:49 +0000 (14:30 +0800)]
net/bonding: fix updating slave link status

We need to update dev->data->dev_link before handling LSC event.
Otherwise it will still have the initial value after the startup of
the program before interrupt callback was executed.

Fixes: 414b202343ce ("bonding: fix initial link status of slave")
Cc: stable@dpdk.org
Signed-off-by: Wei Wang <lnykww@gmail.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
7 years agodoc: fix enic guide syntax
John Daley [Thu, 27 Apr 2017 00:52:42 +0000 (17:52 -0700)]
doc: fix enic guide syntax

Fixes: 211f9a9ce2f0 ("enic: add guide")
Cc: stable@dpdk.org
Signed-off-by: John Daley <johndale@cisco.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agodoc: add SR-IOV configurations to enic guide
John Daley [Thu, 27 Apr 2017 00:52:10 +0000 (17:52 -0700)]
doc: add SR-IOV configurations to enic guide

Document SR-IOV passthrough setup and limitations for enic PMD.

Signed-off-by: John Daley <johndale@cisco.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agonet/ixgbe: fix type check for flow type
Wei Zhao [Thu, 27 Apr 2017 06:34:06 +0000 (14:34 +0800)]
net/ixgbe: fix type check for flow type

The type check for flow_type should be IXGBE_ATR_FLOW_TYPE_IPV4
in special card not RTE_ETH_FLOW_NONFRAG_IPV4_OTHER.

Fixes: dc0c16105d2 ("ixgbe: fix X550 flow director check")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet/ixgbe: remove useless item type check
Wei Zhao [Thu, 27 Apr 2017 06:34:05 +0000 (14:34 +0800)]
net/ixgbe: remove useless item type check

Remove a useless item type check for fdir flow rule.

Fixes: 11777435c72 ("net/ixgbe: parse flow director filter")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet/nfp: fix releasing muti-segment mbufs
Alejandro Lucero [Wed, 26 Apr 2017 10:27:07 +0000 (11:27 +0100)]
net/nfp: fix releasing muti-segment mbufs

If segments are used, just mbufs previously linked to head descriptor
of a mbuf chain are released. Other Tx descriptor are used for the
mbuf chain but they keep their linked mbufs without releasing them.

It is not a fatal issue because sooner or later those descriptors will
be head descriptors or just used for a single mbuf packet, then those
linked mbufs will be released.

However, this leads to apps needing bigger mbufs pools and some
confusion about memory requirements. Indeed, because larger pools, some
performance impact could also be expected due to cache misses.

With this patch all Tx descriptors will release linked mbufs inside the
xmit function, and rte_pktmbuf_seg_free is used instead of
rte_pktmbuf_free.

Fixes: 142854c62134 ("nfp: fix freeing multi-mbuf packets")
Cc: stable@dpdk.org
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/bnxt: add new device ids
Ajit Khaparde [Wed, 26 Apr 2017 19:20:02 +0000 (14:20 -0500)]
net/bnxt: add new device ids

Add support for new device ids.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agodoc: update mlx release notes
Shahaf Shuler [Tue, 25 Apr 2017 11:49:58 +0000 (14:49 +0300)]
doc: update mlx release notes

Update release notes for 17.05.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
7 years agonet/i40e: fix mbuf alloc failed counter
Matt Peters [Tue, 25 Apr 2017 12:28:45 +0000 (08:28 -0400)]
net/i40e: fix mbuf alloc failed counter

When an mbuf alloc fails during the mempool get operation for the
i40e bulk alloc receive function, the rx_mbuf_alloc_failed counter
is not incremented to record the error.

This fix ensures consistency with the other i40e receive procedures and
other net drivers.

Signed-off-by: Matt Peters <matt.peters@windriver.com>
Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
7 years agonet/qede: fix CFLAGS for base files
Rasesh Mody [Tue, 25 Apr 2017 07:28:46 +0000 (00:28 -0700)]
net/qede: fix CFLAGS for base files

Changes included in this fix
 - limit CFLAGS to base files
 - fix to remove/mark unused members
 - add checks for debug config option
 - make qede_set_mtu() and qede_udp_dst_port_del() static and others
   non-static as appropriate
 - move local APIs qede_vlan_offload_set() and qede_rx_cqe_to_pkt_type()
 - initialize variables as required

Fixes: ec94dbc57362 ("qede: add base driver")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: fix find zero bit macro
Rasesh Mody [Tue, 25 Apr 2017 07:28:45 +0000 (00:28 -0700)]
net/qede/base: fix find zero bit macro

Use appropriate operator for if condition

Coverity issue: 1379399
Coverity issue: 1379404
Fixes: ec94dbc57362 ("qede: add base driver")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: fix macro ecore MFW set field
Rasesh Mody [Tue, 25 Apr 2017 07:28:44 +0000 (00:28 -0700)]
net/qede/base: fix macro ecore MFW set field

Fix ECORE_MFW_SET_FIELD macro

Coverity issue: 1423907
Coverity issue: 1423908
Fixes: 0b6bf70d7ee3 ("net/qede/base: support previous driver unload")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: fix code flow and remove unused code
Rasesh Mody [Tue, 25 Apr 2017 07:28:43 +0000 (00:28 -0700)]
net/qede/base: fix code flow and remove unused code

Remove unused code to address coverity issues and
address a code flow issue.

Coverity issue: 1379468
Coverity issue: 1379521
Coverity issue: 1379522
Coverity issue: 1379523
Coverity issue: 1423918
Fixes: 86a2265e59d7 ("qede: add SRIOV support")
Fixes: ec94dbc57362 ("qede: add base driver")
Fixes: 2ea6f76aff40 ("qede: add core driver")
Fixes: 29540be7efce ("net/qede: support LRO/TSO offloads")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede: fix FW version string for VF
Rasesh Mody [Tue, 25 Apr 2017 07:28:42 +0000 (00:28 -0700)]
net/qede: fix FW version string for VF

In SRIOV testing, print adapter info shows firmware version used by PF,
this patch provides fix to populate correct firmware version used by VF.

Fixes: 86a2265e59d7 ("qede: add SRIOV support")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede: remove IPv4/IPv6 as valid ntuple flows
Harish Patil [Tue, 25 Apr 2017 07:28:41 +0000 (00:28 -0700)]
net/qede: remove IPv4/IPv6 as valid ntuple flows

Firmware supports ntuple configuration which is always based on 4-tuples.
So remove RTE_ETH_FLOW_FRAG_IPV4 and RTE_ETH_FLOW_FRAG_IPV6 as valid flows.
Also merge the two switch statements into one.

Fixes: 622075356e8f ("net/qede: support ntuple and flow director filter")

Signed-off-by: Harish Patil <harish.patil@cavium.com>
7 years agonet/qede: use new stripped VLAN mbuf flags
Harish Patil [Tue, 25 Apr 2017 07:28:40 +0000 (00:28 -0700)]
net/qede: use new stripped VLAN mbuf flags

Use new mbuf flags PKT_RX_VLAN_STRIPPED and PKT_RX_QINQ_STRIPPED
introduced by the patch:
commit b37b528d957c ("mbuf: add new Rx flags for stripped VLAN")

Signed-off-by: Harish Patil <harish.patil@cavium.com>
7 years agonet/qede: fix possible uninitialized pointer
Harish Patil [Tue, 25 Apr 2017 07:28:39 +0000 (00:28 -0700)]
net/qede: fix possible uninitialized pointer

This defect is a functional issue where the RX CQE pointer remains
uninitialized in the LRO code path which can cause null pointer exception
while accessing VLAN or RSS hash value from CQE.

Coverity issue: 143474
Fixes: 29540be7efce ("net/qede: support LRO/TSO offloads")

Signed-off-by: Harish Patil <harish.patil@cavium.com>
7 years agonet/qede: fix LRO handling
Harish Patil [Tue, 25 Apr 2017 07:28:38 +0000 (00:28 -0700)]
net/qede: fix LRO handling

- Add a common routine to handle ETH_RX_CQE_TYPE_TPA_CONT and
ETH_RX_CQE_TYPE_TPA_END.
- Remove enum qede_agg_state since there is no need to maintain
aggregation state.
- Modify the segment chaining logic by tracking head and tail
TPA segments of each aggregation.
- Add more debug and comments.
- Mark the packet as PKT_RX_LRO.

Fixes: 29540be7efce ("net/qede: support LRO/TSO offloads")

Signed-off-by: Harish Patil <harish.patil@cavium.com>
7 years agonet/qede: fix fastpath rings reset phase
Harish Patil [Tue, 25 Apr 2017 07:28:37 +0000 (00:28 -0700)]
net/qede: fix fastpath rings reset phase

Perform reset of the fastpath RX/TX rings after stopping device port and
not while starting the ports.

Fixes: cfe28a988565 ("net/qede: support unequal number of Rx/Tx queues")
Cc: stable@dpdk.org
Signed-off-by: Harish Patil <harish.patil@cavium.com>
7 years agonet/qede: fix default MAC address handling
Harish Patil [Tue, 25 Apr 2017 07:28:36 +0000 (00:28 -0700)]
net/qede: fix default MAC address handling

- In qede_mac_addr_set(), in order to configure default MAC address we
first delete the existing MAC address before trying to add new one. During
init time, there is no MAC filter to begin with, so trying to remove a
non-existing MAC address causes a firmware exception. This can be prevented
by internally calling qede_mac_addr_add() which has the checks in place to
delete a MAC address only if it was added before.

- Remove setting of the default MAC address from within
qede_dev_configure() since rte_eth_dev_start() calls mac_addr_set() anyway.

Fixes: 2ea6f76aff40 ("qede: add core driver")
Cc: stable@dpdk.org
Signed-off-by: Harish Patil <harish.patil@cavium.com>
7 years agonet/mlx5: fix IPv6 flow pattern item
Nélio Laranjeiro [Tue, 25 Apr 2017 08:27:52 +0000 (10:27 +0200)]
net/mlx5: fix IPv6 flow pattern item

Only masked bits must be set in Verbs specification for a rule to be valid.

Fixes: 2097d0d1e2cc ("net/mlx5: support basic flow items and actions")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/i40e: fix array bounds
Jingjing Wu [Tue, 25 Apr 2017 05:01:01 +0000 (13:01 +0800)]
net/i40e: fix array bounds

Fix array bounds when set default ptype mapping.

Fixes: 62e94f7f66fb ("net/i40e: configure packet type mapping")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e: fix setup when bulk is disabled
Beilei Xing [Thu, 20 Apr 2017 08:51:36 +0000 (16:51 +0800)]
net/i40e: fix setup when bulk is disabled

Testpmd failed to start when CONFIG_RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC
is disabled, the root cause is the length of sw_ring and queue are
incorrect with the above configuration.

Fixes: 0be295312966 ("net/i40e: fix compile error")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
7 years agonet/sfc: fix LSC interrupt support for UIO cases
Andrew Rybchenko [Fri, 21 Apr 2017 12:16:42 +0000 (13:16 +0100)]
net/sfc: fix LSC interrupt support for UIO cases

Recently link status change interrupt was enabled by default in testpmd,
it has opened the driver bug with not working LSC interrupt if either
igb_uio or uio_pci_generic kernel driver is used.

Fixes: 06bc197796e2 ("net/sfc: interrupts support sufficient for event queue init")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
7 years agonet/sfc: correct estimation of max DMA descriptors required
Andrew Rybchenko [Fri, 21 Apr 2017 11:02:33 +0000 (12:02 +0100)]
net/sfc: correct estimation of max DMA descriptors required

Previous too pessimistic estimation made completely impossible to send
packets with many segments (more than 100 with minimum Tx ring size).

Fixes: 8b00f426eb66 ("net/sfc: implement EF10 native Tx datapath")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>