Jeff Guo [Tue, 7 Feb 2017 03:52:19 +0000 (11:52 +0800)]
net/i40e: fix ethertype filter on X722
The GL_SWR_PRI_JOIN_MAP registers are effective on filters, changing
the register's default value will fail the ethertype filter.
The GL_SWR_PRI_JOIN_MAP values are different for each NIC, and current
X722 register values are wrong.
Fix X722 ethertype filter by setting registers to X722 default NVM
values.
Fixes: 92fbf2cbdff4 ("i40e: support X722 and its A0 hardware") Cc: stable@dpdk.org Signed-off-by: Jeff Guo <jia.guo@intel.com> Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Jakub Palider [Mon, 6 Feb 2017 11:56:56 +0000 (12:56 +0100)]
net/ena: fix setting host attributes
The hardware may reject adding host_info in case support for
host_info is missing in the list of supported features. On the
other hand the list of supported features may contain support
for the host_info - typical bootstrap problem.
This patch solves it by removing check against support for
host_info attribute and improves error handling by reacting
only to host attribute write failure to the hardware.
Fixes: 99ecfbf845b3 ("ena: import communication layer") Cc: stable@dpdk.org Signed-off-by: Jakub Palider <jpa@semihalf.com>
Keith Wiles [Mon, 6 Feb 2017 19:40:37 +0000 (13:40 -0600)]
net/tap: move link down before close
Fixes: f457b472b1f2 ("net/tap: add link up and down operations") Signed-off-by: Keith Wiles <keith.wiles@intel.com> Acked-by: Pascal Mazon <pascal.mazon@6wind.com>
Wei Zhao [Fri, 3 Feb 2017 08:43:57 +0000 (16:43 +0800)]
net/ixgbe: add TCI mask check for flow director
Add more check on the tci mask of VLAN and VXLAN parser
in fdir filter rule pattern parser. If such check not added,
it maybe cause error in fdir configuration set check.
John Daley [Fri, 3 Feb 2017 01:18:40 +0000 (17:18 -0800)]
net/enic: fix memory leak with oversized Tx packets
If a packet send is attempted with a packet larger than the NIC
is capable of processing (9208) it will be dropped with no
completion descriptor returned or completion index update, which
will lead to an mbuf leak and eventual hang.
Drop and count oversized Tx packets in the Tx burst function and
dereference/free the mbuf without sending it to the NIC.
Since the maximum Rx and Tx packet sizes are different on enic
and are now both being used, make the define ENIC_DEFAULT_MAX_PKT_SIZE
be 2 defines, one for Rx and one for Tx.
Fixes: fefed3d1e62c ("enic: new driver") Cc: stable@dpdk.org Signed-off-by: John Daley <johndale@cisco.com>
For some sizes of packets, the number of bytes copied in the work queue
element could be greater than the available size of the inline. In such
situation it could consume one more work queue element where it should
not.
net/mlx5: fix Tx WQE corruption caused by starvation
Fixes an issue which may occurs with the inline feature activated and a
packet greater than the max_inline requested.
In such situation, more work request elements can be consumed and in the
worst case override some still handled by the NIC, this can result in
sending garbage on the network or putting the work queue in error.
Ivan Malov [Wed, 1 Feb 2017 08:17:11 +0000 (08:17 +0000)]
net/sfc: fix setting empty multicast list
The patch is to fix sfc_set_mc_addr_list() behaviour in order
to make it accept an empty multicast address list thus making
it possible to remove multicast addresses inserted previously
Fixes: 0fa0070e4391 ("net/sfc: support multicast addresses list controls") Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Nélio Laranjeiro [Tue, 31 Jan 2017 16:02:48 +0000 (17:02 +0100)]
net/mlx5: fix flow rule creation if ports are stopped
Adding a flow when the port is stopped ends in an inconsistent situation
where the queue can receive traffic when it should not.
Record new rules and apply them as soon as the port is started.
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>
Jianfeng Tan [Thu, 9 Feb 2017 16:06:46 +0000 (16:06 +0000)]
doc: postpone ABI changes in igb_uio
This ABI changes to remove iomem and ioport mapping in igb_uio. The
purpose of this changes was to fix a bug: when DPDK app crashes,
those devices by igb_uio are not stopped either DPDK PMD driver or
igb_uio driver.
Then it has been pointed out by Stephen Hemminger that it has
backward compatibility issue: cannot run old version DPDK on
modified igb_uio.
However, we still have not figure out a new way to fix this bug
without this change. Let's postpone this deprecation announcement
in case this change cannot be avoided.
Fixes: 3bac1dbc1ed ("doc: announce iomem and ioport removal from igb_uio") Suggested-by: Stephen Hemminger <stephen@networkplumber.org> Suggested-by: Ferruh Yigit <ferruh.yigit@intel.com> Suggested-by: Thomas Monjalon <thomas.monjalon@6wind.com> Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Ferruh Yigit [Tue, 31 Jan 2017 15:01:32 +0000 (15:01 +0000)]
mk: link more libraries without --whole-archive
During app build with static library, some libraries wrapped with
--whole-archive compiler flag.
Wrapped libraries are mainly PMD libraries, this is required because PMD
APIs not called directly but run through callbacks registered via
constructor functions.
Also some set of libraries, depends to the PMD libraries needs this,
because of same reason.
All the libraries used by a plugin (any driver) must be in
--whole-archive to ensure that every symbols will be available for the
plugin.
But other libraries can be out of this flag, and this saves some bytes
in final binary.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
When a secondary process wants access to the VFIO container file
descriptor, the primary process calls vfio_get_container_fd() which
always opens an entirely new file descriptor on /dev/vfio/vfio.
However, once the file descriptor has been passed to the subprocess, it
is effectively duplicated, meaning that the copy of the file descriptor
in the primary process is no longer needed. However, the primary
process does not close the duplicate fd, which results in a resource
leak.
This can be reproduced by starting a primary process with a small
RLIMIT_NOFILE limit configured to use VFIO for at least one device, and
repeatedly launching secondary processes until the file descriptor limit
is exceeded.
Fix the resource leak by closing the local vfio container file
descriptor after passing it to the secondary process.
Jiayu Hu [Tue, 7 Feb 2017 09:40:30 +0000 (17:40 +0800)]
doc: add xstats to virtio features list
Currently, extended statistics has been supported by virtio. But there
are no corresponding document updates. Therefore, this patch is to update
the document for virtio xstats feature.
Fixes: 76d4c652e07d ("virtio: add extended stats") Signed-off-by: Jiayu Hu <jiayu.hu@intel.com> Acked-by: Remy Horton <remy.horton@intel.com> Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Keith Wiles [Sun, 29 Jan 2017 02:12:05 +0000 (20:12 -0600)]
net/tap: fix invalid queue file descriptor
Rx and Tx queues share the common tap file descriptor, but save this
value separately.
Setting up Rx/Tx queue sets up both queues, release_queue close the
tap file but update file descriptor only for that queue.
This makes other queue's file descriptor invalid.
As a workaround, prevent release_queue callback to be called by default.
This is done by separating Rx/Tx setup functions, so that each only
setup its own queue, this prevents rte_eth_rx/tx_queue_setup() calling
release_queue before setup_queue.
Nélio Laranjeiro [Fri, 27 Jan 2017 15:35:19 +0000 (16:35 +0100)]
net/mlx5: fix flow pattern VLAN validation
TCI field is read from the wrong place due to an invalid cast. Moreover
there is no need to limit matching to VID since PCP and DEI bits can be
matched as well.
Ferruh Yigit [Fri, 27 Jan 2017 12:27:19 +0000 (12:27 +0000)]
net/i40e: fix API comments for doxygen
Fixes: a541407fe4bc ("net/i40e: set VF MAC anti-spoofing from PF") Fixes: 4cbc41efcbb2 ("net/i40e: set VF VLAN anti-spoofing from PF") Fixes: c0ec14757c5f ("net/i40e: set VF unicast promiscuous mode from PF") Fixes: ae57070ca8b7 ("net/i40e: set VF multicast promiscuous mode from PF") Fixes: 83bb95e3fefc ("net/i40e: set VF VLAN insertion from PF") Fixes: 61fff9b4c68b ("net/i40e: set VF broadcast mode from PF") Fixes: c33abbc1440e ("net/i40e: set VF VLAN tag from PF") Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
John Daley [Thu, 26 Jan 2017 20:12:12 +0000 (12:12 -0800)]
net/enic: fix MAC address add and remove
The mac_addr_add callback function was simply replacing the primary MAC
address instead of adding new ones and the mac_addr_remove callback would
only remove the primary MAC form the adapter. Fix the functions to add or
remove new address. Allow up to 64 MAC addresses per port.
Fixes: fefed3d1e62c ("enic: new driver") Signed-off-by: John Daley <johndale@cisco.com> Reviewed-by: Nelson Escobar <neescoba@cisco.com>
Yi Zhang [Wed, 14 Dec 2016 18:50:19 +0000 (02:50 +0800)]
net/ixgbevf: fix max packet length
Current ixgbevf driver get max_rx_pktlen = 15872, but in fact PF
supports 15872-byte jumbo frame and VF only supports 9728-byte jumbo
frame. If VF is running DPDK driver and set frame_size > 9728 ,PF
running kernel ixgbe driver will report an error and set VF failed.
This patch fixs DPDK ixgbevf driver to get correct jumbo frame size
of VF.
More datasheet references from Wei Dai:
In 82599 datasheet, there is an annotation in the chapter 1.3 Features
Summary (page 29)
The 82599 supports full-size 15.5 KB (15872-byte) jumbo packets while
in a basic mode of operation. When DCB mode is enabled,
or security engines enabled or virtualization is enabled, the 82599
supports 9.5 KB (9728-byte) jumbo packets.
In x540 datasheet, there is also an annotation in the chapter 1.3
Features Summary (page 13)
The X540 and 82599 support full-size 15.5 KB jumbo packets while in a
basic mode of operation. When DCB mode is enabled,
or security engines enabled, or virtualization is enabled, or OS2BMC is
enabled, then the X540 supports 9.5 KB jumbo packets.
Packets to/from MC longer than 2KB are filtered out.
In x550 datasheet, there is still also an annotation in the chapter 1.4
Feature Summary (page 23)
All the products support full-size 15.5 KB jumbo packets while in a
basic mode of operation. When DCB mode is enabled, or security
engines enabled, or virtualization is enabled, or OS2BMC is enabled,
then only 9.5 KB jumbo packets are supported. Packets to/
from the MC longer than 2 KB are filtered out.
Fixes: 2144f6630fca ("ixgbe: add redirection table size in device info") Cc: stable@dpdk.org Signed-off-by: Yi Zhang <zhang.yi75@zte.com.cn> Acked-by: Wei Dai <wei.dai@intel.com>
Emmanuel Roullit [Tue, 24 Jan 2017 21:15:55 +0000 (22:15 +0100)]
net/bonding: remove useless assignment
Found with clang static analysis:
drivers/net/bonding/rte_eth_bond_pmd.c:903:3:
warning: Value stored to 'num_not_send' is never read
num_not_send += slave_bufs_pkts[RTE_MAX_ETHPORTS] - num_send;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Emmanuel Roullit [Tue, 24 Jan 2017 20:48:57 +0000 (21:48 +0100)]
net/cxgbe/base: initialize variable before reading EEPROM
data value could have been garbage if VPD access timed out for VPD read
request could not been issued.
Found with clang static analysis:
drivers/net/cxgbe/base/t4_hw.c:1577:22:
warning: The left operand of '&' is a garbage value
} while ((stats_reg & 0x1) && --max_poll);
~~~~~~~~~ ^
Jakub Palider [Tue, 24 Jan 2017 14:22:53 +0000 (15:22 +0100)]
net/ena: prepare TSO offload calculation
While ENA can handle checksum calculations in almost all cases,
it cannot do so when DF bit in IPv4 header is not set,
that is DF=0, and TSO is requested. For that situation pseudo
header must be prepared manually.
Wei Dai [Tue, 24 Jan 2017 08:14:20 +0000 (16:14 +0800)]
net/ixgbe: return success when SFP is not present
Ignore the error=IXGBE_ERR_SFP_NOT_PRESENT when SFP is not present.
If it is not ignored, testpmd will fail during the NIC initialization
process.
Ixgbe kernel driver ignores this error and works well. So DPDK
does same thing.
Signed-off-by: Wei Dai <wei.dai@intel.com> Signed-off-by: Helin Zhang <helin.zhang@intel.com> Tested-by: Yuan Peng <yuan.peng@intel.com> Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Rasesh Mody [Tue, 24 Jan 2017 05:38:33 +0000 (21:38 -0800)]
net/bnx2x: fix Rx mode configuration
Check if promisc mode was set when setting allmulti mode and vice-versa.
Introduced BNX2X_RX_MODE_ALLMULTI_PROMISC for the same. If check is
absent the filter configuration gets over written.
Fixes: 540a211084a7 ("bnx2x: driver core") Fixes: 5dbc53d7e5a2 ("net/bnx2x: restrict Rx mask flags sent to the PF") Cc: stable@dpdk.org Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Jingjing Wu [Mon, 23 Jan 2017 09:42:44 +0000 (17:42 +0800)]
net/i40e: fix validation when deleting MAC address
When VF sends request to remove MAC address, PF host will check
if it is a non-zero or unicast address. When VF remove a multicast
address, it will report error.
This patch fixes this issue.
Ivan Malov [Mon, 23 Jan 2017 11:06:15 +0000 (11:06 +0000)]
net/sfc: fix TSO limits imposed to the number of Tx queues
The number of Tx queues requested by the user must not be overridden;
instead, the limits imposed by TSO must be applied to the advertised
maximum
Fixes: fec33d5bb3eb ("net/sfc: support firmware-assisted TSO") Cc: stable@dpdk.org Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andrew Lee <alee@solarflare.com> Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Andrew Rybchenko [Fri, 20 Jan 2017 15:22:56 +0000 (15:22 +0000)]
net/sfc: enable TSO by default
Remove RTE_LIBRTE_SFC_EFX_TSO config option since it is not
required any more:
- unreasonable limit on number of Tx queues when TSO is not
actually required should be solved using per-device parameter
- performance difference with and without TSO compiled in is small
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Andrew Rybchenko [Thu, 19 Jan 2017 11:12:20 +0000 (11:12 +0000)]
net/sfc: do not panic if alarms are not supported
Alarms are not supported on the FreeBSD.
Application must poll link status periodically itself using
rte_eth_link_get_nowait() to avoid management event queue overflow.
Fixes: 2de39f4e1310 ("net/sfc: periodic management EVQ polling using alarm") Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andrew Lee <alee@solarflare.com> Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Yongseok Koh [Wed, 18 Jan 2017 00:51:55 +0000 (16:51 -0800)]
net/mlx5: fix queue wrap-around of multi-packet send
When the WQ is wrapped around, it wrongly checks the condition when
resetting the pointer. It should be compared against the end of the queue,
not the beginning of the queue. And this isn't even needed when the length
of the copying data crosses the boundary.
Fixes: fdcb0f53053b ("net/mlx5: use work queue buffer as a raw buffer") Cc: stable@dpdk.org Signed-off-by: Yongseok Koh <yskoh@mellanox.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
The size of Rx RSS indirection table was limited by 256, but it is not
required anymore for all Mellanox NICs. However, the librte_ether still
limits the size by 512.
Yongseok Koh [Tue, 17 Jan 2017 02:09:40 +0000 (18:09 -0800)]
net/mlx5: add prefetching Rx completion queue
On receiving a compressed session of Rx completion, prefetch every entries
to be invalidated. Also, invalidate consumed completions per every 8
mini-completions, not to wait until the last entry is consumed. This helps
to reduce jitter in rx_burst.
Andrew Rybchenko [Thu, 12 Jan 2017 09:03:23 +0000 (09:03 +0000)]
net/sfc: fix flow control settings on port start
efx_phy_adv_cap_set() sets all advertised phy capabilities including
pause capabilities which are also configured using efx_mac_fcntl_set().
If we set speed and autonegotiation capabilities only, we should
preserve already configured pause capabilities.
Fixes: d23f3a89ab54 ("net/sfc: support link speed and duplex settings") Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andrew Lee <alee@solarflare.com>
Andrew Rybchenko [Thu, 12 Jan 2017 09:03:22 +0000 (09:03 +0000)]
net/sfc: fix link status when port is not started
Fixes: 886f8d8a05bf ("net/sfc: retrieve link info") Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andrew Lee <alee@solarflare.com>
Andrew Rybchenko [Thu, 12 Jan 2017 09:03:21 +0000 (09:03 +0000)]
net/sfc: synchronize link status with HW on start
Fixes: 886f8d8a05bf ("net/sfc: retrieve link info") Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andrew Lee <alee@solarflare.com>
Andrew Rybchenko [Thu, 12 Jan 2017 09:03:20 +0000 (09:03 +0000)]
net/sfc: avoid usage of possibly uninitialized link mode
In fact efx_port_poll() always initializes it, but it isn't
explicitly documented feature of the API. Moreover, the API
annocation suggests that return code should be checked.
Fixes: 886f8d8a05bf ("net/sfc: retrieve link info") Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andrew Lee <alee@solarflare.com>
Yuanhan Liu [Wed, 11 Jan 2017 04:27:12 +0000 (12:27 +0800)]
net/virtio: optimize header reset on any layout
When any layout is used, the header is stored in the head room of mbuf.
mbuf is allocated and filled by user, means there is no gurateen the
header is all zero for non TSO case. Therefore, we have to do the reset
by ourself:
memest(hdr, 0, head_size);
The memset has two impacts on performance:
- memset could not be inlined, which is a bit costly.
- more importantly, it touches the mbuf, which could introduce severe
cache issues as described by former patch.
Similiary, we could do the same trick: reset just when necessary, when
the corresponding field is already 0, which is likely true for a simple
l2 forward case. It could boost the performance up to 20+% in micro
benchmarking.
Cc: stable@dpdk.org Cc: Maxime Coquelin <maxime.coquelin@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Yuanhan Liu [Wed, 11 Jan 2017 04:27:11 +0000 (12:27 +0800)]
net/virtio: fix performance regression due to TSO
TSO is now enabled, but it's not actually being used by default in a
simple L2 forward mode. In such case, we have to zero the virtio net
headers, to inform the vhost backend that no offload is being used:
Such writes could be very costly; it introduces severe cache issues:
The above operations introduce cache write for each packet, which
stalls the read operation from the vhost backend.
The fact that virtio net header is initiated to zero in PMD driver
init stage means that these costly writes are unnecessary and could
be avoided:
if (hdr->csum_start != 0)
hdr->csum_start = 0;
And that's what the macro ASSIGN_UNLESS_EQUAL does. With this, the
performance drop introduced by TSO enabling is recovered: it could
be up to 20% in micro benchmarking.
Fixes: 58169a9c8153 ("net/virtio: support Tx checksum offload") Fixes: 696573046e9e ("net/virtio: support TSO") Cc: stable@dpdk.org Cc: Olivier Matz <olivier.matz@6wind.com> Cc: Maxime Coquelin <maxime.coquelin@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Olivier Matz <olivier.matz@6wind.com>