dpdk.git
6 years agocrypto/ccp: fix resource leak
Ferruh Yigit [Sun, 28 Oct 2018 03:19:27 +0000 (03:19 +0000)]
crypto/ccp: fix resource leak

File *fp, opened but not closed, this patch add fclose(fp)

Fixes: ef4b04f87fa6 ("crypto/ccp: support device init")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Ravi Kumar <ravi1.kumar@amd.com>
6 years agoapp/testpmd: fix memory allocation for DSCP table
Jasvinder Singh [Tue, 6 Nov 2018 10:26:40 +0000 (10:26 +0000)]
app/testpmd: fix memory allocation for DSCP table

The patch fixes the memory allocation for the meter DSCP table.

Fixes: e63b50162aa3 ("app/testpmd: clean metering and policing commands")
Cc: stable@dpdk.org
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoapp/testpmd: fix memory leak for TM object
Jasvinder Singh [Tue, 6 Nov 2018 10:23:06 +0000 (10:23 +0000)]
app/testpmd: fix memory leak for TM object

Fixes memory leak for shared shaper object of the traffic manager.

Fixes: 5b590fbe09b6 ("app/testpmd: add traffic management forwarding mode")
Cc: stable@dpdk.org
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoexamples/ip_pipeline: fix null pointer dereference
Jasvinder Singh [Fri, 9 Nov 2018 16:12:25 +0000 (16:12 +0000)]
examples/ip_pipeline: fix null pointer dereference

Fixes NULL pointer dereference issue raised by Coverity.

Coverity issue: 325728, 325729, 325731, 325738
Fixes: 27b333b23237 ("examples/ip_pipeline: track table rules on add bulk")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agopipeline: fix logically dead code
Fan Zhang [Mon, 5 Nov 2018 12:27:02 +0000 (12:27 +0000)]
pipeline: fix logically dead code

This patches fixes the coverity issue of logically dead code.

Coverity issue: 323523
Fixes: 96303217a606 ("pipeline: add symmetric crypto table action")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
6 years agonet/i40e: add parameter check for RSS flow init
Wei Zhao [Mon, 12 Nov 2018 09:25:24 +0000 (17:25 +0800)]
net/i40e: add parameter check for RSS flow init

There need an parameter check for RSS flow init, or it may cause
core dump if pointer is NULL in memory copy.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/ixgbevf: fix link state
Yanglong Wu [Tue, 13 Nov 2018 06:34:43 +0000 (14:34 +0800)]
net/ixgbevf: fix link state

For ixgbevf kernel driver, link status changes from down to up
will trigger vf kernel driver send IXGBE_VF_RESET message to pf
kernel driver, after this, vf kernel driver will disable and enable
it self. By these series operations, the vf kernel driver report
link up. Besides, all these operations handles in kernel thread.
For DPDK user space driver, it only gets link status changes from
down to up, but miss IXGBE_VF_RESET message sending and reset itself.
If we will add fully implementation of link status change for DPDK
user space driver, we need take much more modification. We have
aligned that for link status changes from down to up we only notify
link is up, users need to reset vf port.

Fixes: dc66e5fd01b9 ("net/ixgbe: improve link state check on VF")
Cc: stable@dpdk.org
Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/mlx5: fix Direct Verbs RSS hash field
Yongseok Koh [Tue, 13 Nov 2018 06:00:16 +0000 (08:00 +0200)]
net/mlx5: fix Direct Verbs RSS hash field

As mlx5_flow_hashfields_adjust() refers to flow->rss, actions must be
translated prior to items like in Verbs. Otherwise, hash fields are not
correctly set.

Fixes: d02cb0691299 ("net/mlx5: add Direct Verbs translate actions")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
6 years agodoc: add mlx5 IPv6 multicast limitation in VM
Dekel Peled [Mon, 12 Nov 2018 11:31:06 +0000 (13:31 +0200)]
doc: add mlx5 IPv6 multicast limitation in VM

This patch adds limitation notice for MLX5 PMD.
IPv6 multicast messages are not received on VM when promiscuous
and allmulticast modes are off, due to netlink restriction.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
6 years agonet/enic: fix size check in Tx prepare handler
Hyong Youb Kim [Tue, 13 Nov 2018 15:38:10 +0000 (07:38 -0800)]
net/enic: fix size check in Tx prepare handler

The current code wrongly assumes that packets are non-TSO and ends up
rejecting large TSO packets. Check non-TSO and TSO max packet sizes
separately.

Fixes: 5a12c387405a ("net/enic: check maximum packet size in Tx prepare handler")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
6 years agonet/sfc/base: fix field order in filter spec struct
Igor Romanov [Tue, 13 Nov 2018 15:02:44 +0000 (15:02 +0000)]
net/sfc/base: fix field order in filter spec struct

Fields in the struct efx_filter_spec_t starting from efs_outer_vid
are hashed for software filter lookup. efs_mark is not a matching
criteria. Exclude efs_mark from hash.

Fixes: 5f78af523912 ("net/sfc: support MARK and FLAG actions in flow API")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agoethdev: eliminate interim variable
Ferruh Yigit [Tue, 13 Nov 2018 11:12:38 +0000 (11:12 +0000)]
ethdev: eliminate interim variable

`local_conf` variable was needed for offload conversions but no more
required. No functional difference, only interim variable eliminated.

Fixes: ab3ce1e0c193 ("ethdev: remove old offload API")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agoethdev: fix device info getting
Wenzhuo Lu [Tue, 13 Nov 2018 11:12:37 +0000 (11:12 +0000)]
ethdev: fix device info getting

The device information cannot be gotten correctly before
the configuration is set. Because on some NICs the
information has dependence on the configuration.

Fixes: 3be82f5cc5e3 ("ethdev: support PMD-tuned Tx/Rx parameters")
Cc: stable@dpdk.org
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agoethdev: fix invalid configuration after failure
Wenzhuo Lu [Tue, 13 Nov 2018 11:12:36 +0000 (11:12 +0000)]
ethdev: fix invalid configuration after failure

The new configuration is stored during the rte_eth_dev_configure() API
but the API may fail. After failure stored configuration will be
invalid since it is not fully applied to the device.

We better roll the configuration back after failure.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/qede: fix Tx tunnel offload support mask
Shahed Shaikh [Mon, 12 Nov 2018 18:19:38 +0000 (18:19 +0000)]
net/qede: fix Tx tunnel offload support mask

Tunneling offloads are represented by multi-bit values. So, feature
wise tunneling offload can only be entirely supported/unsupported
using PKT_TX_TUNNEL_MASK. Its upon PMDs to further isolate which of
the tunneling offload types are supported by respective PMD.
Using subset of bits from PKT_TX_TUNNEL_MASK to indicate supported vs
unsupported offloads can lead to undesired result.

Use PKT_TX_TUNNEL_MASK in QEDE_TX_OFFLOAD_MASK and use independent
value of supported PKT_TX_TUNNEL_* in .tx_pkt_prepare() to mark
supported tunnel offloads.

Fixes: 44346c24b790 ("net/qede: fix VXLAN tunnel Tx offload flag setting")
Cc: stable@dpdk.org
Suggested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
Reviewed-by: Rasesh Mody <rasesh.mody@cavium.com>
6 years agonet/octeontx: fix mbuf corruption with large private sizes
Nitin Saxena [Mon, 12 Nov 2018 17:54:09 +0000 (17:54 +0000)]
net/octeontx: fix mbuf corruption with large private sizes

When the priv_size of the mbuf is > 128 bytes, the mbuf would not be
properly constructed. This would lead to a corrupt mbuf.

This patch fixes the issue by accounting for
rte_pktmbuf_priv_size(pool) and RTE_PKTMBUF_HEADROOM
while configuring first skip register calculation.

Fixes: 197438ee9f18 ("net/octeontx: add Rx queue setup and release ops")
Cc: stable@dpdk.org
Suggested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Signed-off-by: Nitin Saxena <nitin.saxena@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agodrivers/net: set close behaviour flag at probing
Thomas Monjalon [Sun, 11 Nov 2018 22:46:11 +0000 (23:46 +0100)]
drivers/net: set close behaviour flag at probing

The ethdev flag RTE_ETH_DEV_CLOSE_REMOVE is set for drivers
having migrated to the new behaviour of rte_eth_dev_close().

As any other flag, it can be useful to know about its value
as soon as the port is probed.
Unfortunately, it was set inside the close operation,
just before being erased by memset() in rte_eth_dev_release_port().
The flag assignment is moved to the probing stage, so it can
be checked by the application in order to anticipate the behaviour.

Fixes: 42603bbdb58e ("net/mlx5: release port on close")
Fixes: 6c99085d972b ("net/vmxnet3: fix hot-unplug")
Fixes: 4d7877fde2ef ("net/ena: remove resources when port is being closed")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoapp/testpmd: revert setting default RSS
Ophir Munk [Fri, 9 Nov 2018 09:38:10 +0000 (09:38 +0000)]
app/testpmd: revert setting default RSS

This reverts the patch that enables default RSS action by setting
key=NULL and key_len=0.
In current testpmd implementation a key pointer must exist if
key_len!=0. For example, the following flow rule will cause a
segmentation fault:
flow create 0 <pattern> actions rss queues 0 1 end key_len 40 / end

Fixes: a4391f8bae85 ("app/testpmd: set default RSS key as null")
Cc: stable@dpdk.org
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoapp/testpmd: fix L4 length for UDP checksum
Raslan Darawsheh [Sun, 11 Nov 2018 15:31:37 +0000 (15:31 +0000)]
app/testpmd: fix L4 length for UDP checksum

testpmd only sets the L4 len in case of TCP packets.
some PMD's like tap rely on mbuf meta data to calculate csum

This will set the L4 len for UDP packets same as TCP

Fixes: 160c3dc9458c ("app/testpmd: introduce IP parsing functions in csum fwd engine")
CC: stable@dpdk.org
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/qede: fix crash when configure fails
Timothy Redaelli [Fri, 9 Nov 2018 15:45:40 +0000 (16:45 +0100)]
net/qede: fix crash when configure fails

Currently, if configuration fails (for example if a 100G card is used
with an odd number of RX/TX queues) QEDE crashes due to a null pointer
dereference.

This commit fixes it by checking that the pointer is not NULL before
using it.

Fixes: 7105b24f4bb8 ("net/qede: fix memory alloc for multiple port reconfig")
Cc: stable@dpdk.org
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Rasesh Mody <rasesh.mody@cavium.com>
6 years agodoc: add mlx5 Direct Verbs flow engine limitation
Shahaf Shuler [Mon, 12 Nov 2018 05:58:22 +0000 (07:58 +0200)]
doc: add mlx5 Direct Verbs flow engine limitation

Would be good to add also a code which disable the dv_flow_en
the user requested. However such support will need to use new netlink
command to query the switchdev mode from the underlying kernel.

Considering the current 18.11 release is close to RC3, only a
documentation is added.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
6 years agonet/mlx5: remove GRE inner IPv6 matching limitation
Shahaf Shuler [Sun, 11 Nov 2018 11:15:26 +0000 (13:15 +0200)]
net/mlx5: remove GRE inner IPv6 matching limitation

Such limitation seems not to exist on:
 - MLNX_OFED_linux-4.5-0.3.0.0 (Beta)
 - MLNX_OFED_LINUX-4.4-2.0.7.0 (GA)
 - upstream kernel 4.19.0-rc7

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: fix VXLAN device rollback if rule apply fails
Viacheslav Ovsiienko [Sat, 10 Nov 2018 10:01:59 +0000 (10:01 +0000)]
net/mlx5: fix VXLAN device rollback if rule apply fails

If rule contains tunneling action (like VXLAN encapsulation)
the VTEP (Virtual Tunneling EndPoint) device is pre-configured
before applying the rule. If kernel returns an error this
VTEP configuration should be rolled back to the origin state.
The patch adds the missing VTEP configuration restoration.

Fixes: 95a464cecc21 ("net/mlx5: add E-switch VXLAN tunnel devices management")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: fix rule cleanup Netlink command sending
Viacheslav Ovsiienko [Sat, 10 Nov 2018 09:59:26 +0000 (09:59 +0000)]
net/mlx5: fix rule cleanup Netlink command sending

The VXLAN related rule cleanup routine queries and gathers all
existing local IP and neigh rules into buffer list. One buffer
may contain multiple rule deletion commands and is prepared
to send into Netlink as single message. But, if error occurs
for some deletion commands in the buffer, the multiple ACK
message with errors can be send back by the kernel. It breaks
the Netlink communication sequence numbers, because we expect
only one ACK message and it smashes out futher Netlik
communication.

The workaround of this problem is to send rule deletion commands
from buffer in one-by-one fashion and get ACK message for every
command sent. We do not expect too may rules preexist, so there
should not be critical performance degradation at VXLAN outer
interface initialization.

Fixes: f420f03d6772 ("net/mlx5: add E-switch VXLAN rule cleanup routines")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: add Netlink message size check in rule cleanup
Viacheslav Ovsiienko [Sat, 10 Nov 2018 09:59:26 +0000 (09:59 +0000)]
net/mlx5: add Netlink message size check in rule cleanup

This patch is preparation for the following fix, we are going to send
Netlink message from buffer in one-by-one fashion. It is highly
desirable to check multimessage buffer consistency for debug purposes.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: fix buffer allocation check in rule cleanup
Viacheslav Ovsiienko [Sat, 10 Nov 2018 09:59:25 +0000 (09:59 +0000)]
net/mlx5: fix buffer allocation check in rule cleanup

The Netlink message buffer is allocated and there is the typo,
the other pointer is checked instead of returned one. If no
memory is allocated and NULL is returned by allocation routine
the bug causes segmentation fault. The patch fixes typo,
returned pointer is validated.

Fixes: f420f03d6772 ("net/mlx5: add E-switch VXLAN rule cleanup routines")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: fallback quietly if pkg-config is unavailable
Luca Boccassi [Fri, 9 Nov 2018 22:48:07 +0000 (22:48 +0000)]
net/mlx5: fallback quietly if pkg-config is unavailable

Don't fail the build if pkg-config can't be found, instead print the
linker flag as it was doing before the change.

Fixes: b6b87939193a ("net/mlx5: use pkg-config to handle SUSE libmnl")
Cc: stable@dpdk.org
Reported-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
6 years agonet/mlx5: fix flow director add and delete
Dekel Peled [Thu, 8 Nov 2018 21:29:45 +0000 (23:29 +0200)]
net/mlx5: fix flow director add and delete

Fix the flow_fdir_cmp() function, used by flow_fdir_filter_lookup().
This function is used by flow_fdir_filter_add() to check if same rule
exists, and by flow_fdir_filter_delete() to find flow rule to delete.

The function compared actions conf pointers, changed to compare
actions type only.

Fixes: 2720f833d461 ("net/mlx5: add missing flow director delete")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/bonding: fix crash when stopping mode 4 port
Radu Nicolau [Thu, 8 Nov 2018 15:26:42 +0000 (15:26 +0000)]
net/bonding: fix crash when stopping mode 4 port

When stopping a bonded port all slaves are deactivated. Attempting
to deactivate a slave that was never activated will result in a segfault
when mode 4 is used.

Fixes: 7486331308f6 ("net/bonding: stop and deactivate slaves on stop")
Cc: stable@dpdk.org
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Chas Williams <chas3@att.com>
6 years agonet/bnx2x: fix VF link state update
Rasesh Mody [Thu, 8 Nov 2018 21:19:30 +0000 (21:19 +0000)]
net/bnx2x: fix VF link state update

In general the VF driver should not access the chip. For VF link status
update, VF driver should not use HW lock, use bnx2x_link_report_locked()
instead.
Add few prints for releasing previously held HW locks.

Fixes: a9b58b15ed51 ("net/bnx2x: fix to add PHY lock")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
6 years agonet/bnx2x: fix dynamic logging
Rasesh Mody [Thu, 8 Nov 2018 21:19:26 +0000 (21:19 +0000)]
net/bnx2x: fix dynamic logging

Use rte_log() rather than RTE_LOG() for dynamic logging. Rearrange
dynamic log types to the top and configurable log types to bottom.
Remove unused RTE_LIBRTE_BNX2X_DEBUG_TX_FREE

Fixes: ba7eeb035a5f ("net/bnx2x: fix logging to include device name")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
6 years agovhost: remove unneeded null pointer check
Tiwei Bie [Wed, 7 Nov 2018 09:01:02 +0000 (17:01 +0800)]
vhost: remove unneeded null pointer check

The caller will guarantee that msg won't be null. Remove
the unneeded null pointer check which caused a Coverity
warning.

Coverity issue: 323484
Fixes: 8f972312b8f4 ("vhost: support vhost-user")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agonet/virtio: fix unchecked return value
Tiwei Bie [Wed, 7 Nov 2018 09:01:01 +0000 (17:01 +0800)]
net/virtio: fix unchecked return value

Coverity issue: 302861
Fixes: 6ba1f63b5ab0 ("virtio: support specification 1.0")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agovhost/crypto: fix packet copy in chaining mode
Fan Zhang [Tue, 6 Nov 2018 16:22:48 +0000 (16:22 +0000)]
vhost/crypto: fix packet copy in chaining mode

This patch fixes the incorrect packet content copy in the
chaining mode. Originally the content before cipher offset is
overwritten by all zeros. This patch fixes the problem by
making sure the correct write back source and destination
settings during set up.

Fixes: 3bb595ecd682 ("vhost/crypto: add request handler")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agonet/virtio-user: fix typo in error message
Tiwei Bie [Tue, 6 Nov 2018 06:40:22 +0000 (14:40 +0800)]
net/virtio-user: fix typo in error message

The param we are checking is VIRTIO_USER_ARG_PATH, instead
of VIRTIO_USER_ARG_QUEUE_SIZE.

Fixes: ce2eabdd43ec ("net/virtio-user: add virtual device")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
6 years agovhost: fix IOVA access for packed ring
Tiwei Bie [Tue, 6 Nov 2018 06:40:21 +0000 (14:40 +0800)]
vhost: fix IOVA access for packed ring

We should apply for RO access when receiving packets from the
VM and apply for RW access when sending packets to the VM.

Fixes: a922401f35cc ("vhost: add Rx support for packed ring")
Fixes: ae999ce49dcb ("vhost: add Tx support for packed ring")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agonet/thunderx: fix Tx desc corruption in scatter-gather mode
Subrahmanyam Nilla [Fri, 9 Nov 2018 05:50:55 +0000 (05:50 +0000)]
net/thunderx: fix Tx desc corruption in scatter-gather mode

For performance reasons, word1 of send_hdr_s
sub descriptor was not cleared assuming it is always
having default value of zero since it comes from fixed
offsets of SQ buffer.
This is causing issues in case of SG mode because,
the size of send command might change and hence the word1
of send_hdr_s is not always at fixed offsets of the SQ buffer
and hence not having default value of zero.

This fixes the issue by clearing the word1 in case of SG mode
for every packet.

Fixes: 1c421f18e095 ("net/thunderx: add single and multi-segment Tx")
Cc: stable@dpdk.org
Signed-off-by: Subrahmanyam Nilla <snilla@caviumnetworks.com>
Signed-off-by: Nithin Dabilpuram <nithin.dabilpuram@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agonet/cxgbevf: fix illegal memory access when freeing MPS TCAM
Rahul Lakkireddy [Fri, 9 Nov 2018 07:56:28 +0000 (13:26 +0530)]
net/cxgbevf: fix illegal memory access when freeing MPS TCAM

Individual MPS TCAM entries are not allocated as separate entities.
All entries are allocated once as an array. So, fix bug with attempting
to free illegal memory location.

Also add missing MPS TCAM initialization for CXGBEVF.

Fixes: 6fda3f0ddda9 ("net/cxgbe: add API to program hardware MPS table")

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
6 years agonet/cxgbe: fix wrong ingress port value set in filter spec
Rahul Lakkireddy [Fri, 9 Nov 2018 07:56:27 +0000 (13:26 +0530)]
net/cxgbe: fix wrong ingress port value set in filter spec

Set the "value" in the filter spec and not the "mask". Also, remove
duplicate comparison for hardware supported match items already done
earlier.

Fixes: af44a577988b ("net/cxgbe: support to offload flows to HASH region")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
6 years agonet/cxgbe: increase completion wait time for flow operations
Rahul Lakkireddy [Fri, 9 Nov 2018 07:56:26 +0000 (13:26 +0530)]
net/cxgbe: increase completion wait time for flow operations

Under heavy load, flow related operations can take more time to
complete. Increase max completion wait time to 10 seconds. Also
increase max receive budget to read more replies from firmware
in every cycle.

Fixes: 9eb2c9a48072 ("net/cxgbe: implement flow create operation")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
6 years agonet/cxgbe: fix check for redefined match items
Rahul Lakkireddy [Fri, 9 Nov 2018 07:56:25 +0000 (13:26 +0530)]
net/cxgbe: fix check for redefined match items

Fix issue where ethertype is set to 0x800 for IPv4 by ether match
item and IPv4 match item also inherently sets ethertype to 0x800.

Current logic returns error when IPv4 match item is parsed. So, fix
by only bailing if the redefined match items have different values.

Fixes: ee61f5113b17 ("net/cxgbe: parse and validate flows")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
6 years agonet/cxgbe: check Rx config before doing VLAN strip offload
Rahul Lakkireddy [Fri, 9 Nov 2018 07:56:24 +0000 (13:26 +0530)]
net/cxgbe: check Rx config before doing VLAN strip offload

Fixes: 436125e64174 ("net/cxgbe: update to Rx/Tx offload API")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
6 years agonet/cxgbevf: add PCI uninitialization for VF
Rahul Lakkireddy [Fri, 9 Nov 2018 07:56:23 +0000 (13:26 +0530)]
net/cxgbevf: add PCI uninitialization for VF

Fixes: 2195df6d11bd ("net/cxgbe: rework ethdev device allocation")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
6 years agonet/ixgbe: stop link setup alarm handler before start
Ilya Maximets [Thu, 8 Nov 2018 10:24:01 +0000 (13:24 +0300)]
net/ixgbe: stop link setup alarm handler before start

We should stop alarm handler before resetting the HW to
avoid concurrent device reconfiguration.

Fixes: 0408f47ba4d6 ("net/ixgbe: fix busy polling while fiber link update")
CC: stable@dpdk.org
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/mlx5: fix build on PPC64
Thomas Monjalon [Wed, 7 Nov 2018 16:00:28 +0000 (17:00 +0100)]
net/mlx5: fix build on PPC64

The AltiVec header file breaks boolean type:

error: incompatible types when initializing type
'__vector _bool int' {aka '_vector(4) __bool int'} using type 'int'

If __APPLE_ALTIVEC__ is defined, then bool type is redefined
and conflicts with stdbool.h.

There is no good solution to fix it for the whole project without
breaking something else, so a workaround is inserted in mlx5 PMD.
This workaround is not compatible with C++ but there is no C++ in DPDK.

Suggested-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Suggested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: David Wilder <dwilder@us.ibm.com>
Acked-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
6 years agonet/e1000/base: fix uninitialized variable
Yunjian Wang [Tue, 6 Nov 2018 07:57:01 +0000 (15:57 +0800)]
net/e1000/base: fix uninitialized variable

This patch fixes the variable 'phy_word' may be used uninitialized.

Fixes: 5b6439cf03a4 ("e1000/base: support different EEARBC for i210")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/tap: fix probe for multiq or flowq failure
Vipin Varghese [Wed, 7 Nov 2018 13:58:17 +0000 (19:28 +0530)]
net/tap: fix probe for multiq or flowq failure

In scenarios for multiq or flowq setup failure
`rte_eth_dev_probing_finish()` has to be invoked for successful device
registration.

Fixes: fbe90cdd776c ("ethdev: add probing finish function")
Cc: stable@dpdk.org
Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
6 years agoapp/testpmd: fix Rx offload search
Wei Zhao [Wed, 7 Nov 2018 06:14:29 +0000 (14:14 +0800)]
app/testpmd: fix Rx offload search

There is an error in function search_rx_offload(),
it will break when get unexpected return value from function
rte_eth_dev_rx_offload_name(), but rte_eth_dev_rx_offload_name()
will return some unexpected value indeed.

Fixes: c73a9071877a ("app/testpmd: add commands to test new offload API")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
6 years agoexamples/flow_filtering: fix capability setting
Ori Kam [Tue, 6 Nov 2018 06:32:20 +0000 (06:32 +0000)]
examples/flow_filtering: fix capability setting

The tx offloads should be compared to tx capability

Fixes: c82f2f8b4b3a ("examples/flow_filtering: filter out unsupported offloads")
Cc: stable@dpdk.org
Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
6 years agonet/mlx5: fix L4 protocol validation
Yongseok Koh [Tue, 6 Nov 2018 08:14:18 +0000 (08:14 +0000)]
net/mlx5: fix L4 protocol validation

- Currently, no device supports partial mask for protocol in IP header.
- As there could be multiple IP items, next_protocol variable in flow
  validation has to be reset for inner layer. Otherwise, inner TCP/UDP
  will see protocol number of outer IP header.
- Remove redundant protocol checking for MPLS, which is done in
  mlx5_flow_validate_item_mpls().

Fixes: 3d69434113d1 ("net/mlx5: add Direct Verbs validation function")
Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated function")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
6 years agonet/mlx5: fix device flow reference
Yongseok Koh [Tue, 6 Nov 2018 07:42:49 +0000 (07:42 +0000)]
net/mlx5: fix device flow reference

dev_flow->verbs is mistakenly used instead of dev_flow->dv. A sanity
check is added for debugging purpose.

Fixes: fc2c498ccb94 ("net/mlx5: add Direct Verbs translate items")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
6 years agonet/tap: fix file descriptor check
Stephen Hemminger [Tue, 6 Nov 2018 19:30:05 +0000 (11:30 -0800)]
net/tap: fix file descriptor check

Static analysis tools don't like the fact that fd could be zero
in the error path. This won't happen in real world because
stdin would have to be closed, then other error occurring.

Coverity issue: 14079
Fixes: 02f96a0a82d1 ("net/tap: add TUN/TAP device PMD")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Keith Wiles <keith.wiles@intel.com>
6 years agonet/tap: fix file descriptor leak on error
Stephen Hemminger [Tue, 6 Nov 2018 19:30:04 +0000 (11:30 -0800)]
net/tap: fix file descriptor leak on error

If netlink socket setup fails the file descriptor was leaked.

Coverity issue: 257040
Fixes: 7c25284e30c2 ("net/tap: add netlink back-end for flow API")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Keith Wiles <keith.wiles@intel.com>
6 years agobus/vmbus: fix directory handle leak on error
Stephen Hemminger [Tue, 6 Nov 2018 19:30:03 +0000 (11:30 -0800)]
bus/vmbus: fix directory handle leak on error

If sysfs directory was incorrectly formatted then the vmbus
setup code would leak a directory handle in the error path.

Coverity issue: 302848
Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
6 years agomk: allow renaming of build directories
Bruce Richardson [Mon, 12 Nov 2018 12:26:15 +0000 (12:26 +0000)]
mk: allow renaming of build directories

When building using make, the Makefile in the build directory contained
the name of the build directory to be passed as an "O=" parameter to
the DPDK SDK makefiles. Unfortunately, this meant that the compilation
would always fail if the build directory was renamed. To remove this
limitation, we can use $(CURDIR) instead of the directory name.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agoeal/x86: move header to standard BSD license
Bruce Richardson [Thu, 21 Dec 2017 16:53:35 +0000 (16:53 +0000)]
eal/x86: move header to standard BSD license

This updates the license on the rte_rtm.h file to be the standard
BSD-3-Clause license used for the rest of DPDK, thus bringing the file in
compliance with the DPDK licensing policy.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agotest/hash: improve output for r/w test
Bruce Richardson [Mon, 12 Nov 2018 10:47:19 +0000 (10:47 +0000)]
test/hash: improve output for r/w test

The hash read-write autotest generates a lot of text, which is very dense
on the screen. Even the summary at the end is hard to follow as everything
is very compact. We can improve readability by highlighting the starts of
the various sections, and by indenting the values within subsections.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agoeal/x86: reduce contention when retrying TSX
Bruce Richardson [Mon, 12 Nov 2018 10:47:18 +0000 (10:47 +0000)]
eal/x86: reduce contention when retrying TSX

When TSX transactions abort, it is generally worth retrying a number of
times before falling back to the traditional locking path, as the
parallelism benefits from TSX can be worth it when a transaction does
succeed. For cases with multiple threads and high contention rates, it
can be useful to have increasing delays between retry attempts, so as to
avoid having the same threads repeatedly collided.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agohash: fix TSX aborts with newer gcc
Yipeng Wang [Mon, 12 Nov 2018 10:47:16 +0000 (10:47 +0000)]
hash: fix TSX aborts with newer gcc

gcc 7 and 8 with O3 will generate vzeroupper from rte_memcpy
into TSX region which may abort the TSX transaction.

This fix changes rte_memcpy to memcpy which will not insert
extra vzeroupper into the library.

Fixes: f2e3001b53ec ("hash: support read/write concurrency")
Cc: stable@dpdk.org
Signed-off-by: Yipeng Wang <yipeng1.wang@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agoipc: remove panic in async request
Anatoly Burakov [Tue, 13 Nov 2018 18:03:52 +0000 (18:03 +0000)]
ipc: remove panic in async request

EAL should not crash when setting alarm fails. Also, remove the
profanity in error message.

Fixes: daf9bfca717e ("ipc: remove thread for async requests")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agotest/bpf: use hton for endianness
Malvika Gupta [Fri, 2 Nov 2018 19:08:08 +0000 (14:08 -0500)]
test/bpf: use hton for endianness

Convert host machine endianness to networking endianness for
comparison of incoming packets with BPF filter

Suggested-by: Brian Brooks <brian.brooks@arm.com>
Signed-off-by: Malvika Gupta <malvika.gupta@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
6 years agotest/bpf: add immediate load
Konstantin Ananyev [Thu, 8 Nov 2018 12:36:44 +0000 (12:36 +0000)]
test/bpf: add immediate load

New test-case to cover (BPF_LD | BPF_IMM | EBPF_DW) instruction.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
6 years agobpf: fix x86 JIT for immediate loads
Konstantin Ananyev [Thu, 8 Nov 2018 12:36:43 +0000 (12:36 +0000)]
bpf: fix x86 JIT for immediate loads

x86 jit can generate invalid code for (BPF_LD | BPF_IMM | EBPF_DW)
instructions, when immediate value is bigger then INT32_MAX.

Fixes: cc752e43e079 ("bpf: add JIT compilation for x86_64 ISA")
Cc: stable@dpdk.org
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
6 years agopci: fix parsing of address without function number
Thomas Monjalon [Sun, 11 Nov 2018 23:58:56 +0000 (00:58 +0100)]
pci: fix parsing of address without function number

If the last part of the PCI address (function number) is missing,
the parsing was successful, assuming function 0.
The call to strtoul is not returning an error in such a case,
so an explicit check is inserted before.

This bug has always been there in older parsing macros:
- GET_PCIADDR_FIELD
- GET_BLACKLIST_FIELD

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Reported-by: Wisam Jaddo <wisamm@mellanox.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agohash: separate lock-free and r/w lock lookup
Honnappa Nagarahalli [Sat, 10 Nov 2018 18:55:34 +0000 (12:55 -0600)]
hash: separate lock-free and r/w lock lookup

The lock-free algorithm has caused significant lookup
performance regression for certain use cases. The
regression is attributed to the use of non-relaxed
memory orderings. 2 versions of the lookup functions
are created. One that uses the RW lock and the one that
is lock-free. This restores the performance regression
caused for use cases that used RW lock version of the
lookup function.

Fixes: e605a1d36 ("hash: add lock-free r/w concurrency")

Suggested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Tested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agoring/c11: relax ordering for load and store of the head
Gavin Hu [Fri, 9 Nov 2018 11:42:47 +0000 (19:42 +0800)]
ring/c11: relax ordering for load and store of the head

When calling __atomic_compare_exchange_n, use relaxed ordering for the
success case, as multiple producers/consumers do not release updates to
each other so no need for acquire or release ordering.

Because the thread fence in place, ordering for the first iteration can
be relaxed.

Run the ring perf test on the following testbed:
HW: ThunderX2 B0 CPU CN9975 v2.0, 2 sockets, 28core,4 threads/core,2.5GHz
OS: Ubuntu 16.04.5 LTS, Kernel: 4.15.0-36-generic
DPDK: 18.08, Configuration: arm64-armv8a-linuxapp-gcc
gcc: 8.1.0
$sudo ./test/test/test -l 16-19,44-47,72-75,100-103 -n 4 \
--socket-mem=1024 -- -i

Without the patch:
*** Testing using two physical cores ***
SP/SC bulk enq/dequeue (size: 8): 5.75
MP/MC bulk enq/dequeue (size: 8): 10.18
SP/SC bulk enq/dequeue (size: 32): 1.80
MP/MC bulk enq/dequeue (size: 32): 2.34

With the patch:
*** Testing using two physical cores ***
SP/SC bulk enq/dequeue (size: 8): 5.59
MP/MC bulk enq/dequeue (size: 8): 10.54
SP/SC bulk enq/dequeue (size: 32): 1.73
MP/MC bulk enq/dequeue (size: 32): 2.38

No significant improvement, nor regression was seen, as the optimisation
is not at the critical path.

Fixes: 39368ebfc6 ("ring: introduce C11 memory model barrier option")
Cc: stable@dpdk.org
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
6 years agoring/c11: keep deterministic order allowing retry to work
Gavin Hu [Fri, 9 Nov 2018 11:42:46 +0000 (19:42 +0800)]
ring/c11: keep deterministic order allowing retry to work

Use case scenario:
1) Thread 1 is enqueuing. It reads prod.head and gets stalled for some
   reasons (running out of cpu time, preempted,...)
2) Thread 2 is enqueuing. It succeeds in enqueuing and moves prod.head
   forward.
3) Thread 3 is dequeuing. It succeeds in dequeuing and moves the cons.tail
   beyond the prod.head read by thread 1.
4) Thread 1 is re-scheduled. It reads cons.tail.

cpu1(producer)      cpu2(producer)          cpu3(consumer)
load r->prod.head
    ^               load r->prod.head
    |               load r->cons.tail
    |               store r->prod.head(+n)
  stalled           <-- enqueue ----->
    |               store r->prod.tail(+n)
    |                                        load r->cons.head
    |                                        load r->prod.tail
    |                                        store r->cons.head(+n)
    |                                        <...dequeue.....>
    v                                        store r->cons.tail(+n)
load r->cons.tail

For thread 1, the __atomic_compare_exchange_n detects the outdated
prod.head and retry the flow with the new one. This retry flow works ok on
strong ordering platform(eg:x86). But for weak ordering platforms(arm,
ppc), loading cons.tail and prod.head might be re-ordered, prod.head is new
but cons.tail becomes too old, the retry flow, based on the detection of
outdated head, does not trigger as expected, thus the outdate cons.tail
causes wrong free_entries.

Similarly, for dequeuing, outdated prod.tail leads to wrong avail_entries.

The fix is to keep the deterministic order of two loads allowing the retry
to work.

Run the ring perf test on the following testbed:
HW: ThunderX2 B0 CPU CN9975 v2.0, 2 sockets, 28core, 4 threads/core, 2.5GHz
OS: Ubuntu 16.04.5 LTS, Kernel: 4.15.0-36-generic
DPDK: 18.08, Configuration: arm64-armv8a-linuxapp-gcc
gcc: 8.1.0
$sudo ./test/test/test -l 16-19,44-47,72-75,100-103 -n 4 \
--socket-mem=1024 -- -i

Without the patch:
*** Testing using two physical cores ***
SP/SC bulk enq/dequeue (size: 8): 5.64
MP/MC bulk enq/dequeue (size: 8): 9.58
SP/SC bulk enq/dequeue (size: 32): 1.98
MP/MC bulk enq/dequeue (size: 32): 2.30

With the patch:
*** Testing using two physical cores ***
SP/SC bulk enq/dequeue (size: 8): 5.75
MP/MC bulk enq/dequeue (size: 8): 10.18
SP/SC bulk enq/dequeue (size: 32): 1.80
MP/MC bulk enq/dequeue (size: 32): 2.34

The results showed the thread fence degrade the performance slightly, but
it is required for correctness.

Fixes: 39368ebfc6 ("ring: introduce C11 memory model barrier option")
Cc: stable@dpdk.org
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
6 years agoeal: fix build
Jerin Jacob [Wed, 7 Nov 2018 06:59:06 +0000 (06:59 +0000)]
eal: fix build

Some toolchain has fls() definition in string.h as argument type int,
which is conflicting uint32_t argument type.

/export/dpdk.org/lib/librte_eal/common/rte_reciprocal.c:47:19:
error: conflicting types for ‘fls’
 static inline int fls(uint32_t x)
                  ^~~

/opt/marvell-tools-201/aarch64-marvell-elf/include/strings.h:59:6:
note: previous declaration of ‘fls’ was here
 int  fls(int) __pure2;

FreeBSD string.h also has fls() with argument as int type.
https://www.freebsd.org/cgi/man.cgi?query=fls&sektion=3

Fixing the conflict by using rte version of fls.

Fixes: ffe3ec811ef5 ("sched: introduce reciprocal divide")
Fixes: faf2b25c9f80 ("fm10k: support VMDQ in multi-queue configuration")
Cc: stable@dpdk.org
Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agoeal: introduce rte version of fls
Jerin Jacob [Wed, 7 Nov 2018 06:59:03 +0000 (06:59 +0000)]
eal: introduce rte version of fls

The function returns the last (most-significant) bit set.
Added unit testcase to verify rte_fls_u32().

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agotest: fix build
Ferruh Yigit [Tue, 6 Nov 2018 14:35:01 +0000 (14:35 +0000)]
test: fix build

With "make -C test/" command getting following warnings:
 awk: cmd. line:1: fatal: cannot open file `/cmdline_test/cmdline_test/'
      for reading (No such file or directory)
 awk: cmd. line:1: fatal: cannot open file
      `/test-pipeline/test-pipeline/' for reading (No such file or
      directory)
 awk: cmd. line:1: fatal: cannot open file `/test-acl/test-acl/'
      for reading (No such file or directory)

This is because unexpected/invalid MAPFILE param passed to
check-experimental-syms.sh

There is no easy way to unify MAPFILE for different build options,
instead add an input verification to script, and silently ignore wrong
values.

Fixes: a6ec31597a0b ("mk: add experimental tag check")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
6 years agotelemetry: fix shared link with make
Kevin Laatz [Wed, 7 Nov 2018 18:10:18 +0000 (18:10 +0000)]
telemetry: fix shared link with make

Currently, telemetry is not working for shared builds in make.

The --as-needed flag is preventing telemetry from being linked as there are
no direct API calls from the app to telemetry. This is causing the
--telemetry option to not be recognized by EAL.
Telemetry registers it's EAL option using the RTE_INIT constructor. Since
EAL's option parsing is done before the plugins init, the --telemetry
option isn't registered at the time of parsing, and as a result, the
--telemetry option is not being recognized.

This patch fixes this issue by explicitly linking telemetry to the
application by setting the "--no-as-needed" flag for the library in
mk/rte.app.mk.

Fixes: 8877ac688b52 ("telemetry: introduce infrastructure")

Reported-by: Yanjie Xu <yanjie.xu@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoeal/x86: remove unused memcpy file
Thomas Monjalon [Fri, 9 Nov 2018 13:42:54 +0000 (14:42 +0100)]
eal/x86: remove unused memcpy file

The use of rte_memcpy_ptr was removed in revert below,
but it was missing removing the file arch/x86/rte_memcpy.c.

Fixes: d35cc1fe6a7a ("eal/x86: revert select optimized memcpy at run-time")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agodevargs: do not replace already inserted device
Thomas Monjalon [Wed, 7 Nov 2018 22:56:45 +0000 (23:56 +0100)]
devargs: do not replace already inserted device

The devargs of a device can be replaced by a newly allocated one
when trying to probe again the same device (multi-process or
multi-ports scenarios). This is breaking some pointer references.

It can be avoided by copying the new content, freeing the new devargs,
and returning the already inserted pointer.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: Qi Zhang <qi.z.zhang@intel.com>
Tested-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
6 years agoexamples/fips_validation: fix uninitialized access
Marko Kovacevic [Wed, 7 Nov 2018 12:00:06 +0000 (12:00 +0000)]
examples/fips_validation: fix uninitialized access

Fixing a bug raised in coverity using uninitialized value.

Coverity issue: 325881
Fixes: 527cbf3d5ee3 ("examples/fips_validation: support TDES parsing")

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
6 years agomem: fix DMA mask width sanity check
Alejandro Lucero [Wed, 7 Nov 2018 09:44:56 +0000 (09:44 +0000)]
mem: fix DMA mask width sanity check

Current code has different max DMA mask width values for 32 and 64
bits systems. IOMMU hardware could report a higher supported width
than current MAX_DMA_MASK_BITS when RTE_ARCH_64 is not defined. This
is actually true with a 32 bits kernel running in a 64 bits server
with IOMMU hardware. This could also be a problem with embedded systems
using an IOMMU designed for 64 bits in a 32 bits system.

This patch leaves a single max DMA mask width which will make sure the
mask width is within the range for 64 bits variables used for DMA mask.
This also will avoid wrong values because any value higher than
64 bits is likely wrong.

Fixes: 223b7f1d5ef6 ("mem: add function for checking memseg IOVA")

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agomem: fix use after free in legacy mem init
Anatoly Burakov [Tue, 6 Nov 2018 14:13:29 +0000 (14:13 +0000)]
mem: fix use after free in legacy mem init

Adding an additional failure path in DMA mask check has exposed an
issue where `hugepage` pointer may point to memory that has already
been unmapped, but pointer value is still not NULL, so failure
handler will attempt to unmap it second time if DMA mask check
fails. Fix it by setting `hugepage` pointer to NULL once it is no
longer needed.

Coverity issue: 325730
Fixes: 165c89b84538 ("mem: use DMA mask check for legacy memory")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agoexamples/fips_validation: fix unitialized variables
Marko Kovacevic [Tue, 6 Nov 2018 10:28:34 +0000 (10:28 +0000)]
examples/fips_validation: fix unitialized variables

Fixed compilation issue with variable which may
be used uninitialized.

Fixes: 527cbf3d5ee3 ("examples/fips_validation: support TDES parsing")

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
6 years agoversion: 18.11-rc2
Thomas Monjalon [Tue, 6 Nov 2018 02:27:49 +0000 (03:27 +0100)]
version: 18.11-rc2

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
6 years agotest/hash: fix build
Dharmik Thakkar [Fri, 26 Oct 2018 21:43:03 +0000 (16:43 -0500)]
test/hash: fix build

Enable print_key_info() function compilation always.

Compilation error message:
'test_hash.c: In function ‘print_key_info’:
test_hash.c:90:15: error: cast discards ‘const’ qualifier from pointer
target type [-Werror=cast-qual]
  uint8_t *p = (uint8_t *)key;
               ^
cc1: all warnings being treated as errors'

Fixes: af75078fece36 ("first public release")
Cc: stable@dpdk.org
Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
6 years agotest/hash: reduce time for multiwriter test
Naga Suresh Somarowthu [Fri, 2 Nov 2018 12:01:06 +0000 (12:01 +0000)]
test/hash: reduce time for multiwriter test

Reduced test duration for hash_multiwriter_autotest.
Number of entries and total insertions are reduced
such that the duration is less than 10 seconds.

Signed-off-by: Naga Suresh Somarowthu <naga.sureshx.somarowthu@intel.com>
Acked-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
6 years agotest: reduce time for function reentrancy test
Naga Suresh Somarowthu [Wed, 10 Oct 2018 13:15:12 +0000 (14:15 +0100)]
test: reduce time for function reentrancy test

Reduced test duration for func_reentrancy_autotest.
Reduced MAX_LPM_ITER_TIMES, introduced new macro
MAX_ITER_ONCE to reduce the unique key check and
altered the macro MAX_ITER_TIMES to MAX_ITER_MULTI.
Combined for loops thereby reduced snprintf calls
and repeated iterations.
Such that the duration is less than 10 seconds.

Signed-off-by: Naga Suresh Somarowthu <naga.sureshx.somarowthu@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
6 years agotest: allow taking extra arguments from environment
Bruce Richardson [Fri, 12 Oct 2018 15:34:04 +0000 (16:34 +0100)]
test: allow taking extra arguments from environment

When running unit tests automatically, either via script, from meson,
or otherwise, the same set of options may be used for each run, for
example to set a standard coremask to be used for all tests.

To facilitate this, this patch adds support for the test binary taking
additional EAL parameters from the environment and appending them to the
argc/argv list passed to eal init. This allows parameter modification
without having to edit test scripts etc.

There are now two environment variables which can be used for running
tests:
 * DPDK_TEST - (added previously) passes the test name to be run
               automatically rather than running the app interactively.
               Used by "meson test" when running tests individually or
               as part of a suite.

 * DPDK_TEST_PARAMS - new parameter to specify the commandline arguments
               to use with the test binary. For example to run a test,
               or tests, on only 16 lcores, and to skip pci scan we can
               set this to "-l 0-15 --no-pci".

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Luca Boccassi <bluca@debian.org>
6 years agoexamples/flow_filtering: remove VLAN item
Ori Kam [Mon, 5 Nov 2018 09:35:28 +0000 (09:35 +0000)]
examples/flow_filtering: remove VLAN item

Since the VLAN is not in use and some PMD can't support vlan = 0
this item was removed.

Fixes: 4a3ef59a10c8 ("examples/flow_filtering: add simple demo of flow API")
Cc: stable@dpdk.org
Signed-off-by: Ori Kam <orika@mellanox.com>
6 years agoexamples/flow_filtering: filter out unsupported offloads
Ori Kam [Mon, 5 Nov 2018 09:35:27 +0000 (09:35 +0000)]
examples/flow_filtering: filter out unsupported offloads

Some of the requested offloads are not supported by all devices.

This patch fixes this issue by setting only the supported offloads.

Fixes: feca6c428a5e ("examples/flow_filtering: add Tx queues setup process")
Cc: stable@dpdk.org
Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
6 years agobus/pci: fix config r/w access
Fan Zhang [Thu, 1 Nov 2018 12:10:09 +0000 (12:10 +0000)]
bus/pci: fix config r/w access

The recent change to rte_pci_read/write_config() missed
uio_pci_generic case.

Fixes: 630deed612ca ("bus/pci: compare kernel driver instead of interrupt handler")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
6 years agoip_frag: use key length for key comparison
Konstantin Ananyev [Mon, 5 Nov 2018 12:18:58 +0000 (12:18 +0000)]
ip_frag: use key length for key comparison

Right now reassembly code relies on src_dst[] being all zeroes to
determine is it  free/occupied entry in the fragments table.
This is suboptimal and error prone - user can crash DPDK ip_reassembly
app by something like the following scapy script:
x=Ether(src=...,dst=...)/IP(dst='0.0.0.0',src='0.0.0.0',id=0)/('X'*1000)
frags=fragment(x, fragsize=500)
sendp(frags, iface=...)
To overcome that issue and reduce overhead of
'key invalidate'  and 'key is empty' operations -
add key_len into keys comparision procedure.

Fixes: 4f1a8f633862 ("ip_frag: add IPv6 reassembly")
Cc: stable@dpdk.org
Reported-by: Ryan E Hall <ryan.e.hall@intel.com>
Reported-by: Alexander V Gutkin <alexander.v.gutkin@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
6 years agoip_frag: check fragment length of incoming packet
Konstantin Ananyev [Mon, 5 Nov 2018 12:18:57 +0000 (12:18 +0000)]
ip_frag: check fragment length of incoming packet

Under some conditions ill-formed fragments might cause
reassembly code to corrupt mbufs and/or crash.
Let say the following fragments sequence:
<ofs=0,len=100, flags=MF>
<ofs=96,len=100, flags=MF>
<ofs=200,len=0,flags=MF>
<ofs=200,len=100,flags=0>
can trigger the problem.
To overcome such situation, added check that fragment length
of incoming value is greater than zero.

Fixes: 601e279df074 ("ip_frag: move fragmentation/reassembly headers into a library")
Fixes: 4f1a8f633862 ("ip_frag: add IPv6 reassembly")
Cc: stable@dpdk.org
Reported-by: Ryan E Hall <ryan.e.hall@intel.com>
Reported-by: Alexander V Gutkin <alexander.v.gutkin@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
6 years agovhost: fix possible out of bound access
Ferruh Yigit [Sun, 28 Oct 2018 01:08:46 +0000 (01:08 +0000)]
vhost: fix possible out of bound access

Fixes: d7280c9fffcb ("vhost: support selective datapath")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agoservice: fix possible null access
Ferruh Yigit [Sun, 28 Oct 2018 01:08:45 +0000 (01:08 +0000)]
service: fix possible null access

Fixes: 21698354c832 ("service: introduce service cores concept")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
6 years agolib: fix shifting 32-bit signed variable 31 times
Ferruh Yigit [Sun, 28 Oct 2018 01:08:44 +0000 (01:08 +0000)]
lib: fix shifting 32-bit signed variable 31 times

Fix cppcheck warning by marking variable as unsigned.

Fixes: dc276b5780c2 ("acl: new library")
Fixes: 986ff526fb84 ("net: add CRC computation API")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoethdev: remove experimental tag for iterator API
Thomas Monjalon [Thu, 1 Nov 2018 14:46:33 +0000 (15:46 +0100)]
ethdev: remove experimental tag for iterator API

After removing the function rte_eth_dev_attach(),
there are two replacement solutions possible:
one using probe event notification, and one using a new iterator.
So the application can get the new probed ports either asynchronously
or synchronously.

The iterator API is new in DPDK 18.11 so they got the experimental
tag by policy. It causes an issue for strict applications which do
not use experimental functions, and want to use the synchronous method.

The replacement for removed API should not be experimental.
That's why the experimental status of the ethdev iterator is removed.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Tested-by: Kevin Traynor <ktraynor@redhat.com>
6 years agoeal: remove experimental tag for probe/remove
Thomas Monjalon [Thu, 1 Nov 2018 14:46:32 +0000 (15:46 +0100)]
eal: remove experimental tag for probe/remove

The functions rte_dev_probe() and rte_dev_remove() are new
in DPDK 18.11 so they got the experimental tag by policy.
However they are too much basic functions for being skipped
by strict applications which do not use experimental functions.

The alternative is to use rte_eal_hotplug_add() and
rte_eal_hotplug_remove(), but their API requires the application
to parse the devargs string in order to provide bus name,
device name and driver arguments.

The new function rte_dev_probe() is really simpler to use and
more flexible by accepting any devargs string.
Let's encourage applications to use it.

The old functions rte_eal_hotplug_* may be deprecated later.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Tested-by: Kevin Traynor <ktraynor@redhat.com>
6 years agomalloc: fix invalid argument handling
Anatoly Burakov [Mon, 5 Nov 2018 17:26:56 +0000 (17:26 +0000)]
malloc: fix invalid argument handling

When adding memory to an external heap, do not go to unlock failure
handler because the memory hotplug lock hasn't been taken out yet.

Fixes: 7d75c31014f7 ("malloc: allow adding memory to named heaps")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agonet/netvsc: fix VF link update
Stephen Hemminger [Mon, 5 Nov 2018 18:51:15 +0000 (10:51 -0800)]
net/netvsc: fix VF link update

The netvsc device calls VF (if present) to update the link status
with the wrong device. This leads to errors in mlx5 device when it
can't find the ifindex.

Fixes: dc7680e8597c ("net/netvsc: support integrated VF")

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
6 years agonet/bnxt: fix uninitialized variable access
Ferruh Yigit [Sun, 28 Oct 2018 04:35:42 +0000 (04:35 +0000)]
net/bnxt: fix uninitialized variable access

ag_cons is used uninitialized, it is used when DEBUG enabled, remove
debug code.

Fixes: 0958d8b6435d ("net/bnxt: support LRO")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
6 years agonet/i40e: fix Rx instability with vector mode
Beilei Xing [Mon, 5 Nov 2018 03:18:12 +0000 (11:18 +0800)]
net/i40e: fix Rx instability with vector mode

Previously, there is instability during vector Rx if descriptor
number is not power of 2, e.g. process hang and some Rx packets
are unexpectedly empty. That's because vector Rx mode assumes Rx
descriptor number is power of 2 when doing bit mask.
This patch allows vector mode only when the number of Rx descriptor
is power of 2.

Fixes: 8e109464c022 ("i40e: allow vector Rx and Tx usage")
Fixes: a3c83a2527e1 ("net/i40e: enable runtime queue setup")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
6 years agonet/avf/base: fix shifting 32-bit signed variable 31 times
Ferruh Yigit [Sun, 28 Oct 2018 03:51:33 +0000 (03:51 +0000)]
net/avf/base: fix shifting 32-bit signed variable 31 times

Fixes: e5b2a9e957e7 ("net/avf/base: add base code for avf PMD")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
6 years agonet/mlx5: support Rx queue count API
Tom Barbette [Sat, 27 Oct 2018 15:10:55 +0000 (17:10 +0200)]
net/mlx5: support Rx queue count API

This patch adds support for the rx_queue_count API in mlx5 driver

Signed-off-by: Tom Barbette <barbette@kth.se>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
6 years agoapp/testpmd: set default RSS key as null
Ophir Munk [Sat, 3 Nov 2018 15:54:45 +0000 (15:54 +0000)]
app/testpmd: set default RSS key as null

When creating an RSS rule without specifying a key (see [1]) it is
expected that the device will use the default key.
A NULL key is used to indicate to a PMD it should use
its default key, however testpmd assigns a non-NULL dummy key
(see [2]) instead.
This does not enable testing any PMD behavior when the RSS key is not
specified. This commit fixes this limitation by setting key to NULL.

[1]
RSS rule example without specifying a key:
flow create 0 ingress <pattern> / end actions rss queues 0 1 end / end
[2]
Testpmd default key assignment:
.key= "testpmd's default RSS hash key, "
"override it for better balancing"

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agodoc: clarify testpmd guide for flow API
Dekel Peled [Sun, 4 Nov 2018 10:15:45 +0000 (12:15 +0200)]
doc: clarify testpmd guide for flow API

The description of prefix for mask creation was misunderstood.
I updated the description, so it is clearly understood which
mask will be created by a certain prefix.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>