Commit Graph

13938 Commits

Author SHA1 Message Date
Stephen Hemminger
3d96644aa3 net/mlx5: fix log initialization
The mlx5 driver had two init functions, but this could
cause log initialization to be done after the
other initialization. Also, the name of the function does
not match convention (cut/paste error?).

Fix by initializing log type first at start of the pmd_init.
This also gets rid of having two constructor functions.

Fixes: a170a30d22 ("net/mlx5: use dynamic logging")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-06-17 10:17:53 +02:00
Xueming Li
a9fc0b0ef0 net/mlx5: fix crash in device probe
This patch initializes counter descriptor struct before invoking Verbs
api to avoid segmentation fault.

Fixes: 9a761de8ea ("net/mlx5: flow counter support")
Cc: stable@dpdk.org

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2018-06-17 10:04:48 +02:00
Adrien Mazarguil
93068a9d5a net/mlx5: fix error message in probe function
Error values passed to strerror() must be positive.

Fixes: 012ad9944d ("net/mlx5: fix probe return value polarity")
Cc: stable@dpdk.org

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-06-17 10:04:48 +02:00
Adrien Mazarguil
c6ce7e34ad net/mlx5: fix missing errno in probe function
Fixes: b43802b4bd ("net/mlx5: support 16 hardware priorities")
Cc: stable@dpdk.org

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-06-17 10:04:48 +02:00
Adrien Mazarguil
8c3c2372ed net/mlx5: fix errno object in probe function
Fixes: a6d83b6a92 ("net/mlx5: standardize on negative errno values")
Cc: stable@dpdk.org

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-06-17 10:04:48 +02:00
Adrien Mazarguil
c93adccc97 net/mlx5: remove limitation on number of instances
This artificial limitation was inherited from the mlx4 code base and has no
purpose other than adding unnecessary noise.

This patch is a port of commit f2318196c7 ("net/mlx4: remove limitation
on number of instances").

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-06-17 10:04:48 +02:00
Adrien Mazarguil
66f2ac0f8b net/mlx4: fix minor resource leak during init
Temporary IB device context and list are not freed in case of a successful
initialization of the device.

This issue is caused by the two following commits, the first of which
causes initialization to return early, while the second one goes a bit
overboard while switching to negative errno values; an internal variable
(err) is needed to tell success from failure at the end of the function
since rte_errno is not reliable enough.

Fixes: f2318196c7 ("net/mlx4: remove limitation on number of instances")
Fixes: 9d14b27308 ("net/mlx4: standardize on negative errno values")
Cc: stable@dpdk.org

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2018-06-17 10:04:48 +02:00
Haiyue Wang
af87183b82 mbuf: fix typo in IPv6 macro comment
Comment should mention IPv6, not IPv4.

Fixes: f295a00a2b ("mbuf: add definitions of unified packet types")
Cc: stable@dpdk.org

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-06-15 18:03:33 +02:00
Kiran Kumar
fb6eb1e69c net/bonding: fix MAC address reset
Currently when resetting bond mac address, we are getting the
persisted mac address from slave info considering primary port
as index. But we need to compare the port id from slave info
with the primary port to get the primary slave index and get
the persisted mac address. Without this fix, persisted mac addr
will be zero and rte_eth_dev_default_mac_addr_set will fail.

Fixes: a45b288ef2 ("bond: support link status polling")
Cc: stable@dpdk.org

Signed-off-by: Kiran Kumar <kiran.kokkilagadda@caviumnetworks.com>
2018-06-15 16:22:57 +02:00
Maxime Coquelin
63b113afa5 vhost: use SMP memory barrier before kicking guest
vhost_vring_call() used rte_mb(), which translates into
mfence instruction on x86.

This patch changes to use rte_smp_mb(), which changed recently
to translate into a locked ADD instruction for performance
reason.

The measured gain is up to 3% with the testpmd benchmarks.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
2018-06-15 12:27:25 +02:00
Tonghao Zhang
2396806765 vhost: introduce new function helper
Introduce an new common helper to avoid redundancy.

Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-06-15 12:27:25 +02:00
Tiwei Bie
973bd0c1da net/ifc: enable the host notifier support
The necessary vDPA ops have already been implemented
in ifcvf driver. So just need to announce the necessary
protocol features to enable the host notifier support.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-06-15 12:27:20 +02:00
Tiwei Bie
d90cf7d111 vhost: support host notifier
When a vDPA device is attached, vhost user will try to
register host notifiers to QEMU to allow notifications
to be delivered between the driver in the guest and the
vDPA device in the host directly.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-06-15 09:49:39 +02:00
Tonghao Zhang
76b1e4cec7 vhost: refine new device function
Make sure find avalid device id before allocating
virtio_net, if not, return directly. It may avoid
allocating and freeing virtio_net when there is
not valid device id.

Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-06-15 09:49:09 +02:00
Chas Williams
0e677a3534 net/bonding: always update bonding link status
When the first ETH_LINK_UP slave is added to a bonding device, it is
immediately activated.  If these are polling slaves, there will be a
later link state event, when last_link_status doesn't match link_status.
But because this slave is already activated, the bonding device's link
status isn't updated.

To fix this, we always attempt to update the bonding device's link status
in the link state change callback.

Fixes: 46fb436836 ("bond: add mode 4")
Cc: stable@dpdk.org

Signed-off-by: Chas Williams <chas3@att.com>
2018-06-14 19:54:56 +02:00
Adrien Mazarguil
422515b9aa app/testpmd: fix crash when attaching a device
Below commit checks global device information to determine if a port uses
the softnic driver once initialized. Problem is that this information is
not available at this point when a port is initialized interactively
through a "port attach XXX" command, crashing testpmd.

This patch systematically initializes global device information to address
this issue.

Fixes: 5b590fbe09 ("app/testpmd: add traffic management forwarding mode")
Cc: stable@dpdk.org

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2018-06-14 19:27:50 +02:00
Bruce Richardson
5936aa3a39 net/vhost: add to meson build
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-06-14 19:27:50 +02:00
Bruce Richardson
508cfe6be9 net/szedata2: add to meson build
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-06-14 19:27:50 +02:00
Bruce Richardson
6b2a3900e2 net/softnic: add to meson build
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-06-14 19:27:50 +02:00
Bruce Richardson
d9b9ca7e05 net/nfp: add to meson build
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-06-14 19:27:50 +02:00
Bruce Richardson
bad475c03f net/liquidio: add to meson build
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
2018-06-14 19:27:50 +02:00
Bruce Richardson
3479586fe6 net/kni: add to meson build
Since the kni library is an optional library, we need to add a check
here to ensure that the kni wrapper PMD is only built when the main kni
lib is being built.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-06-14 19:27:50 +02:00
Bruce Richardson
3a221aa68f net/failsafe: add to meson build
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-06-14 19:27:50 +02:00
Bruce Richardson
952afd9adf net/ena: add to meson build
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-06-14 19:27:50 +02:00
Bruce Richardson
2898348c48 net/cxgbe: add to meson build
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-06-14 19:27:50 +02:00
Bruce Richardson
870c251cd0 net/bnxt: add to meson build
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-06-14 19:27:50 +02:00
Bruce Richardson
4d61166da4 net/bnx2x: add to meson build
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-06-14 19:27:50 +02:00
Bruce Richardson
ed71204dd0 net/avp: add to meson build
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
2018-06-14 19:27:50 +02:00
Bruce Richardson
9285beee41 net/ark: add to meson build
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-06-14 19:27:50 +02:00
Xiao Wang
50385c1060 net/ifc: add to meson build
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
2018-06-14 19:27:50 +02:00
Xiao Wang
4b614e9504 net/ifc: make driver name consistent
Make the compiler switch name and document name consistent as ``ifc`` to
avoid confusion. Also rename the map file to standard name for meson
build in the process.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2018-06-14 19:27:50 +02:00
Ferruh Yigit
aa1a6d87f1 ethdev: force RSS offload rules again
PMDs should provide supported RSS hash functions via
dev_info.flow_type_rss_offloads variable.

There is a check in ethdev if requested RSS hash function is supported
by PMD or not.
This check has been relaxed in previous release to not return an error
when a non supported has function requested [1], this has been done to
not break the applications.

Adding the error return back.
PMDs need to provide correct list of supported hash functions and
applications need to take care this information before configuring
the RSS otherwise they will get an error from APIs:
rte_eth_dev_rss_hash_update()
rte_eth_dev_configure()

[1] commit af7551e2bf ("ethdev: remove error return on RSS hash check")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-06-14 19:27:50 +02:00
Ferruh Yigit
f52f1a65e4 ethdev: force offloading API rules
The error path was disabled in previous release to let apps to be more
flexible.

But this release they are enabled, applications have to obey offload API
rules otherwise they will get errors from following APIs:
rte_eth_dev_configure
rte_eth_rx_queue_setup
rte_eth_tx_queue_setup

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-06-14 19:27:50 +02:00
Alejandro Lucero
01f65293ce net/nfp: fix field initialization in Tx descriptor
TX descriptor eop_offset field is not initialized and it could
contain garbage. This patch fixes the potential problem setting
EOP as the only subfield. The other subfield, data offset, is
not used by now.

Fixes: b812daadad ("nfp: add Rx and Tx")
Cc: stable@dpdk.org

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2018-06-14 19:27:50 +02:00
Shagun Agrawal
86910379d3 net/cxgbe: implement flow flush operation
Add API to flush all the filters under specified port.

Signed-off-by: Shagun Agrawal <shaguna@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2018-06-14 19:27:50 +02:00
Shagun Agrawal
8d3c12e193 net/cxgbe: implement flow query operation
Add API to query filter hit and byte counts from hardware.

Signed-off-by: Shagun Agrawal <shaguna@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2018-06-14 19:27:50 +02:00
Shagun Agrawal
da23bc9d33 net/cxgbe: implement flow destroy operation
Add API to construct delete filter work request to remove filter
at specified index in LE-TCAM (maskfull) region.

Signed-off-by: Shagun Agrawal <shaguna@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2018-06-14 19:27:50 +02:00
Shagun Agrawal
9eb2c9a480 net/cxgbe: implement flow create operation
Define filter work request API used to construct filter operations
to be communicated with firmware. These requests are sent via
control queue and completions come asynchronously in firmware event
queue.

Implement flow create operation to create filters in LE-TCAM
(maskfull) region at specified index.

Signed-off-by: Shagun Agrawal <shaguna@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2018-06-14 19:27:50 +02:00
Shagun Agrawal
3a3aaabc7c net/cxgbe: add control queue to communicate filter requests
Add control queue to communicate filter creation/deletion requests
with firmware. This API will be used by subsequent patches.

Signed-off-by: Shagun Agrawal <shaguna@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2018-06-14 19:27:50 +02:00
Shagun Agrawal
ee61f5113b net/cxgbe: parse and validate flows
Introduce rte_flow skeleton and implement validate operation.

Parse and convert <item>, <action>, <attributes> into hardware
specification. Perform validation, including basic sanity tests
and underlying device's supported filter capability checks.

Currently add support for:
<item>: IPv4, IPv6, TCP, and UDP.
<action>: Drop, Queue, and Count.

Also add sanity checks to ensure filters are created at specified
index in LE-TCAM region. The index in LE-TCAM region indicates
the filter rule's priority with index 0 having the highest priority.
If no index is specified, filters are created at closest available
free index.

Signed-off-by: Shagun Agrawal <shaguna@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2018-06-14 19:27:50 +02:00
Shagun Agrawal
6f2a064bef net/cxgbe: query firmware for filter resources
Fetch available filter resources from firmware and allocate table for
book-keeping and managing filters in hardware. Also define the hardware
filter specification (ch_filter_specification) used to describe each
filter rule.

Signed-off-by: Shagun Agrawal <shaguna@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2018-06-14 19:27:50 +02:00
Alejandro Lucero
8c7cd2fa4e net/nfp: fix unused header reference
Apart from not being used, this is causing problem when compiling
DPDK with the musl library as reported by bugzilla.

Bugzilla ID: 40
Fixes: c7e9729da6 ("net/nfp: support CPP")
Cc: stable@dpdk.org

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2018-06-14 19:27:50 +02:00
Rafal Kozik
41e59028dd net/ena: set link speed as none
Link speed should is not limited to 10Gb/s and it shouldn't be hardcoded.

They link speed is set to none instead and the applications shouldn't
rely on this value when using ENA PMD.

Fixes: 1173fca25a ("ena: add polling-mode driver")
Cc: stable@dpdk.org

Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
2018-06-14 19:27:50 +02:00
Michal Krawczyk
cacd187606 net/ena: store handle after memory allocation
The pointer received from rte_memzone_reserve from macro
ENA_MEM_ALLOC_COHERENT_NODE was not stored anywhere, and as a result
memory allocated by this macro could not been released.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
2018-06-14 19:27:50 +02:00
Rafal Kozik
7544aee8d0 net/ena: fix GENMASK_ULL macro
When use GENMASK_ULL(63,0) left shift by 64 bits is performed.
Shifting by number greater or equal then word length
is undefined operation and failed on some platforms.

Fixes: 9ba7981ec9 ("ena: add communication layer for DPDK")
Cc: stable@dpdk.org

Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
2018-06-14 19:27:50 +02:00
Rafal Kozik
9f32c7e7e6 net/ena: change memory type
ENA_MEM_ALLOC_NODE not need to use contiguous physical memory.
Also using memset without checking if allocation succeed can cause
segmentation fault.

To avoid both issue use rte_zmalloc_socket.

Fixes: 3d3edc265f ("net/ena: make coherent memory allocation NUMA-aware")
Cc: stable@dpdk.org

Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
2018-06-14 19:27:50 +02:00
Rafal Kozik
46916aa17d net/ena: check pointer before memset
Need to check if memory allocation succeed before using it.
Using memset on NULL pointer cause segfault.

Fixes: 9ba7981ec9 ("ena: add communication layer for DPDK")
Cc: stable@dpdk.org

Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
2018-06-14 19:27:50 +02:00
Rafal Kozik
ba82e010df net/ena: update NUMA node
During initializing Tx queues update Non-Uniform Memory Access
configuration in NIC firmware.

Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
2018-06-14 19:27:50 +02:00
Rafal Kozik
241da076b1 net/ena: adjust error checking and cleaning
Adjust error checking and cleaning to Linux driver:
 * add checking if MTU is to small,
 * fix error messages (mismatched Rx and Tx),
 * return error received from base driver or proper error
   code instead of -1,
 * in case of error release occupied resources,
 * in case of Rx error trigger NIC reset.

Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
2018-06-14 19:27:50 +02:00
Rafal Kozik
3d19e1abb7 net/ena: add (un)likely statements
Add likely and unlikely statements to increase performance.

Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
2018-06-14 19:27:50 +02:00