Pablo de Lara [Tue, 7 Feb 2017 22:49:58 +0000 (22:49 +0000)]
drivers/crypto: fix different auth/cipher keys
When ciphering and authenticating in the same operation
(cipher-then-auth or auth-then-cipher),
the cipher key and authentication key were set with the same
key, in SNOW3G, KASUMI and ZUC PMDs.
They were using the key of the first transform structure,
instead of using the keys of the two different transform
structures.
This is not a big issue, since usually, the same key is
used for ciphering and authentication, but keys may be different.
Fixes: 3aafc423cf4d ("snow3g: add driver for SNOW 3G library") Fixes: 2773c86d061a ("crypto/kasumi: add driver for KASUMI library") Fixes: cf7685d68f00 ("crypto/zuc: add driver for ZUC library") Cc: stable@dpdk.org Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
Kuba Kozak [Tue, 7 Feb 2017 12:20:16 +0000 (13:20 +0100)]
app/crypto-perf: add options parsing check
Added total_ops value validation in parse_total_ops() function.
Coverity issue: 141070 Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application") Signed-off-by: Kuba Kozak <kubax.kozak@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This commit fixes the case where the string buffer may not have
a null terminator if the source string's length is equal to the
buffer size.
Coverity issue: 141069 Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application") Signed-off-by: Aleksander Gajewski <aleksanderx.gajewski@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This patch fixes a segmentation fault in function
rte_cryptodev_devices_get(), due to incorrect driver name path.
It reworks the function to use correct types and clean up
for visibility.
Coverity issue: 141067 Fixes: 38227c0e3ad2 ("cryptodev: retrieve device info") Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Pablo de Lara [Fri, 27 Jan 2017 13:16:08 +0000 (13:16 +0000)]
crypto/aesni_mb: add missing digest length
AESNI MB now supports authentication only operations,
but the array containing all the possible digest lengths
was not updated to reflect the new algorithm NULL_HASH,
causing an "Out-of-bounds access".
Coverity issue: 140977 Fixes: 8772c3f713e2 ("crypto/aesni_mb: add single operation functionality") Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Declan Doherty <declan.doherty@intel.com>
Shahaf Shuler [Thu, 9 Feb 2017 12:29:54 +0000 (14:29 +0200)]
net/mlx5: fix link status query
Trying to query the link status through the new ETHTOOL_GLINKSETTINGS
ioctl available since Linux 4.5 was always failing due to a kernel bug
fixed since version 4.9.
This commit also addresses a common issue where the headers version used
at compile time differs from that of the kernel on the target system, by
always defining missing symbols and moving the kernel version check at run
time.
Fixes: 188408719888 ("net/mlx5: fix support for newer link speeds") CC: stable@dpdk.org Signed-off-by: Shahaf Shuler <shahafs@mellanox.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Jianbo Liu [Thu, 9 Feb 2017 04:05:26 +0000 (12:05 +0800)]
net/ixgbe: fix received packets number for ARM NEON
Vector PMD will check 4 descs in one time, but the statuses are not
consistent because the memory allocated for RX descriptors is cacheable
huagepage.
This patch is to calculate the number of received packets by scann DD bit
sequentially, and stops when meeting the first packet with DD bit unset.
Fixes: b20971b6cca0 ("net/ixgbe: implement vector driver for ARM") Cc: stable@dpdk.org Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
Jianbo Liu [Thu, 9 Feb 2017 04:05:25 +0000 (12:05 +0800)]
net/ixgbe: fix received packets number for ARM
To get better performance, Rx bulk alloc recv function will scan 8 descs
in one time, but the statuses are not consistent on ARM platform because
the memory allocated for Rx descriptors is cacheable hugepages.
This patch is to calculate the number of received packets by scan DD bit
sequentially, and stops when meeting the first packet with DD bit unset.
Fixes: 7431041062b9 ("ixgbe: allow rx bulk alloc") Cc: stable@dpdk.org Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
John Daley [Thu, 9 Feb 2017 00:40:09 +0000 (16:40 -0800)]
net/enic: fix hardcoding of some flow director masks
Hard coded mask values were being used for several of the IPv4 and IPv6
fields. Use the values in the rte_eth_fdir_masks structure provided by the
caller.
Fixes: dfbd6a9cb504 ("net/enic: extend flow director support for 1300 series") Cc: stable@dpdk.org Signed-off-by: John Daley <johndale@cisco.com>
Jingjing Wu [Wed, 8 Feb 2017 05:05:50 +0000 (13:05 +0800)]
net/i40e: fix bitmask of supported Tx flags
PKT_TX_TUNNEL_MASK and PKT_TX_IEEE1588_TMST are missed in bitmask
of all supported packet Tx flags by i40e. It will cause packet preparing
fail when sending tunnel packets with Tx offload.
This patch fixes it.
Yongseok Koh [Thu, 2 Feb 2017 18:43:32 +0000 (10:43 -0800)]
net/mlx5: fix updating total length of multi-packet send
The total length field in descriptor of inlined multi-packet send must be
updated before closing a session. There's possibility of updating it
afterward. This bug might cause one packet out of MLX5_MPW_DSEG_MAX gets
silently dropped by HW and impact performance, especially lossless test.
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>