Matan Azrad [Wed, 28 Mar 2018 12:10:30 +0000 (12:10 +0000)]
ethdev: fix port accessing after release
rte_eth_dev_pci_release() function wrongly releases an ethdev port and
then releases internal fields of this port.
This behavior is problematic, because after the release, the port may
be reallocated again by another thread or just be invalid for any
usage.
Move the release operation to the end of the function.
Rasesh Mody [Wed, 28 Mar 2018 00:15:54 +0000 (17:15 -0700)]
net/qede: fix device stop to remove primary MAC
This fix is to remove primary MAC filter during dev stop. Without the
fix device start attempt to add the primary MAC fails. Perform MAC set
remove under IS_PF() check.
Rasesh Mody [Wed, 28 Mar 2018 00:15:53 +0000 (17:15 -0700)]
net/qede: add devargs to disable NPAR Tx switching
Added a run-time argument npar_tx_switching to enable/disable
Tx switching for multi-fucntion devices (NPAR).
Rename vf_txswitch option to vf_tx_switching.
Sample usage to disable Tx switching for NPAR or VF is something like...
Natalie Samsonov [Mon, 26 Mar 2018 14:38:50 +0000 (16:38 +0200)]
net/mrvl: rename PMD as mvpp2
The name "mrvl" for Marvell PMD driver for PPv2 Marvell PPv2
(Packet Processor v2) 1/10 Gbps adapter is too generic and causes
problem for adding new PMD drivers for other Marvell devices.
Changed to "mvpp2" for specific Marvell PPv2 PMD.
This patch doesn't introduce any change except renaming.
Andrew Rybchenko [Wed, 21 Mar 2018 13:51:31 +0000 (13:51 +0000)]
net/sfc: support runtime VI window size
Medford2 uses a configurable VI window size, and requires
updates to register accesses to use a runtime VI window size
rather than the *_STEP register constants used for earlier
controllers.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Yunjian Wang [Wed, 21 Mar 2018 12:28:10 +0000 (20:28 +0800)]
net/ixgbe: fix intr callback unregister by adding retry
The nic's interrupt source has some active callbacks, when
the port hotplug. Add a retry to give more port's a chance
to uninit before returning an error.
Fixes: 2866c5f1b87e ("ixgbe: support port hotplug") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang <wangyunjian@huawei.com> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Tiwei Bie [Tue, 6 Mar 2018 10:43:25 +0000 (18:43 +0800)]
vhost: do not generate signal when sendmsg fails
More precisely, do not generate a SIGPIPE signal if the peer
has closed the connection. Otherwise, it will terminate the
process by default. As a library, we should avoid terminating
the application process when error happens and just need to
return with an error.
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Zhiyong Yang [Wed, 21 Mar 2018 03:03:41 +0000 (11:03 +0800)]
net/virtio: add check for cvq
Add checking for cvq to judge if virtio_ack_link_announce should be called.
The existing code doesn't cause issue, and add the checking just to look
more reasonable.
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Zhiyong Yang [Wed, 21 Mar 2018 03:03:40 +0000 (11:03 +0800)]
net/virtio: fix queues pointer check
It is necessary to add pointer checking because in some case the
code will cause crash. For example, the code goes here before
memory allocation of rxvq is finished.
Fixes: 7365504f77e3 ("net/virtio: support guest announce") Cc: stable@dpdk.org Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Ning Li [Fri, 29 Dec 2017 03:38:42 +0000 (11:38 +0800)]
net/virtio-user: specify MAC of the tap
When using virtio-user with vhost-kernel to exchange
packet with kernel networking stack, application can
set the MAC of the tap interface via parameter.
Signed-off-by: Ning Li <muziding001@163.com> Reviewed-by: Seán Harte <seanbh@gmail.com> Tested-by: Seán Harte <seanbh@gmail.com> Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
Kumar Sanghvi [Sat, 10 Mar 2018 22:48:25 +0000 (04:18 +0530)]
net/cxgbe: update Tx and Rx path for VF
On TX path, add fw_eth_tx_pkt_vm_wr to transmit packets over VF.
Use is_pf4() to correctly calculate the work request size and
offsets within the work request. On RX path, use pktshift to adjust
data offset within the mbuf.
Kumar Sanghvi [Sat, 10 Mar 2018 22:48:22 +0000 (04:18 +0530)]
net/cxgbe: add probe to initialize VF devices
Add probe to initialize VF devices. Separate init/de-init paths
for PF and VF. Do firmware state initialization wrt VF and retrieve
various operational parameters by querying firmware. Finally configure
and initialize ports.
Kumar Sanghvi [Sat, 10 Mar 2018 22:48:20 +0000 (04:18 +0530)]
net/cxgbe: add VF firmware mailbox
Add firmware mailbox communication support for VF. Add is_pf4()
to check if driver is attached to PF4. Use is_pf4() to determine
whether to use PF or VF mailbox communication.
Shahaf Shuler [Mon, 26 Mar 2018 10:12:19 +0000 (13:12 +0300)]
net/mlx5: fix RSS key length query
The RSS key length returned by rte_eth_dev_info_get command was taken
from the
PMD private structure. This structure initialization was done only after
the port configuration.
Considering Mellanox device supports only 40B long RSS key, reporting
the fixed number instead.
Fixes: 29c1d8bb3e79 ("net/mlx5: handle a single RSS hash key for all protocols") Cc: stable@dpdk.org Signed-off-by: Shahaf Shuler <shahafs@mellanox.com> Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Dahir Osman [Wed, 21 Mar 2018 12:47:51 +0000 (13:47 +0100)]
net/mlx5: setup RSS regardless of queue count
In some environments it is desirable to have the NIC perform RSS
normally on the packet regardless of the number of queues configured.
The RSS hash result that is stored in the mbuf can then be used by
the application to make decisions about how to distribute workloads
to threads, secondary processes, or even virtual machines if the
application is a virtual switch. This change to the mlx5 driver
aligns with how other drivers in the Intel family work.
Yunjian Wang [Tue, 20 Mar 2018 07:01:24 +0000 (15:01 +0800)]
net/i40e: fix intr callback unregister by adding retry
The nic's interrupt source has some active callbacks, when
the port hotplug. Add a retry to give more port's a chance
to uninit before returning an error.
Fixes: d42aaf30008b ("i40e: support port hotplug") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang <wangyunjian@huawei.com> Reviewed-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Somnath Kotur [Mon, 26 Mar 2018 03:22:06 +0000 (08:52 +0530)]
net/bnxt: fix flow director with same cmd different queue
When user reissues same flow director cmd with a different queue
update the existing filter to redirect flow to the new desired
queue as destination just like the other filters like 5 tuple and
generic flow.
Roman Zhukov [Sat, 24 Mar 2018 06:42:23 +0000 (06:42 +0000)]
net/sfc: fix type of opaque pointer in perf profile handler
The 'opaque' pointer in handler function is the last argument
of sfc_kvargs_process() function and it is pointer to the adapter
'evq_flags' that has a uint32_t type. So 'value' must be pointer
to uint32_t.
Fixes: c22d3c508e0c ("net/sfc: support parameter to choose performance profile") Cc: stable@dpdk.org Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Andrew Rybchenko [Mon, 19 Mar 2018 07:50:11 +0000 (07:50 +0000)]
net/sfc: fix mbuf data alignment calculation
Unlike ffs() rte_bsf32() counts bit position from 0.
Fixes: 0c7a0c35f24c ("net/sfc: calculate Rx buffer size which may be used") Cc: stable@dpdk.org Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Ajit Khaparde [Wed, 28 Feb 2018 22:12:36 +0000 (14:12 -0800)]
net/bnxt: fix LRO disable
When the vnic_tpa_cfg HWRM command is sent to the FW,
we are not passing the VNIC ID in case of disable.
This can cause the FW to return an error.
Correct VNIC ID needs to be passed for both enable and disable.
Ivan Malov [Wed, 21 Mar 2018 11:28:21 +0000 (11:28 +0000)]
net/sfc: add dynamic log level for MCDI messages
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Ivan Malov [Wed, 21 Mar 2018 11:28:20 +0000 (11:28 +0000)]
net/sfc: remove dedicated init log parameter
The previous patches in the set convert per-port
logging to use NOTICE level and make this level default.
This provides the possibility to remove the dedicated
toggle for init-related messages and merge init logging
with the main log type. In order to keep these logs silent
by default, INFO level should be used.
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Ivan Malov [Wed, 21 Mar 2018 11:28:19 +0000 (11:28 +0000)]
net/sfc: prepare to merge init logs with main log type
Conversion to dynamic logging done in the previous patches
makes it possible to simplify internal controls for init
logging. This patch allows to prepare for such a change.
It makes init-unrelated messages use NOTICE level so that
the following patch will be able to convert init logging
to use INFO level and remain silent by default.
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Ivan Malov [Wed, 21 Mar 2018 11:28:18 +0000 (11:28 +0000)]
net/sfc: support per-port dynamic logging
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Ivan Malov [Wed, 21 Mar 2018 11:28:17 +0000 (11:28 +0000)]
net/sfc: support driver-wide dynamic logging
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Ivan Malov [Wed, 21 Mar 2018 11:28:16 +0000 (11:28 +0000)]
eal: register log type and pick level from args
Dynamic log types are registered on RTE_INIT() step.
This allows one to set log levels by EAL options on
application launch. However, this does not allow to
manage log types if they are created during runtime.
EAL does not store log levels and types passed from
the command line. Thus, they cannot be picked later.
This is an obvious flaw since it would be better to
be able to pick levels for dynamic types registered
for runtime-determined facilities such as NIC ports.
This patch provides a mechanism to store log levels
passed from EAL options and adds an API to register
log types and pick levels from the internal storage.
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andy Moreton <amoreton@solarflare.com> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Nélio Laranjeiro [Tue, 13 Mar 2018 14:17:39 +0000 (15:17 +0100)]
net/mlx5: refuse empty VLAN flow specification
Verbs specification doesn't help to distinguish between packets having an
VLAN and those which do not have, this ends by having flow rule which does
not react as the user expects e.g.
flow create 0 ingress pattern eth / vlan / end action queue index 0 / end
flow create 0 ingress pattern eth / end action queue index 1 / end
are colliding in Verbs definition as in both rule are matching packets with
or without VLAN.
For this reason, the VLAN specification must not be empty, otherwise the
PMD has to refuse it.
Nélio Laranjeiro [Tue, 13 Mar 2018 14:17:36 +0000 (15:17 +0100)]
net/mlx5: change tunnel flow priority
Packet matching inner and outer flow rules are caught by the first one
added in the device as both flows are configured with the same priority.
To avoid such situation, the inner flow can have an higher priority than
the outer ones as their pattern matching will otherwise collide.
Nélio Laranjeiro [Mon, 12 Mar 2018 13:43:19 +0000 (14:43 +0100)]
net/mlx5: fix link status to use wait to complete
Wait to complete is present to let the application get a correct status
when it requires it, it should not be ignored.
Fixes: e313ef4c2fe8 ("net/mlx5: fix link state on device start") Fixes: cb8faed7dde8 ("mlx5: support link status update") Cc: stable@dpdk.org Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Nélio Laranjeiro [Mon, 12 Mar 2018 13:43:18 +0000 (14:43 +0100)]
net/mlx5: fix link status behavior
This behavior is mixed between what should be handled by the application
and what is under PMD responsibility.
According to DPDK API:
- link_update() should only query the link status [1]
- link_set_{up,down}() should only set the link to the according status [1]
- dev_{start,stop}() should enable/disable traffic reception/emission [2]
On this PMD, the link status is retrieved from the net device associated
owned by the Linux Kernel, it does not means that even when this interface
is down, the PMD cannot send/receive traffic from the NIC those two
information are unrelated, until the physical port is active and has a
link, the PMD can receive/send traffic on the wire.
According to DPDK API, calling the rte_eth_dev_start() even when the Linux
interface link is down is then possible and allowed, as the traffic will
flow between the DPDK application and the Physical port.
This also means that a synchronization between the Linux interface and the
DPDK application remains under the DPDK application responsibility.
To handle such synchronization the application should behave as the
following scheme, to start:
rte_eth_get_link(port_id, &link);
if (link.link_status == ETH_DOWN)
rte_eth_dev_set_link_up(port_id);
rte_eth_dev_start(port_id);
Taking in account the possible returned values for each function.
The application should also set the LSC interrupt callbacks to catch and
behave accordingly when the administrator set the Linux device down/up.
The same callbacks are called when the link on the medium falls/raise.
Nélio Laranjeiro [Mon, 12 Mar 2018 13:43:17 +0000 (14:43 +0100)]
net/mlx5: remove kernel version check
Kernel version check was introduced in
commit 3a49ffe38a95 ("net/mlx5: fix link status query")
due to a bug fixed by
commit ef09a7fc7620 ("net/mlx5: fix inconsistent link status query")
This patch restore the previous behavior as described in Linux API.
Yongseok Koh [Wed, 14 Mar 2018 17:51:48 +0000 (10:51 -0700)]
net/mlx5: fix ARM build
rdma-core v16 has a bug. The following compilation error occurs on ARM
hosts.
In file included
from drivers/net/mlx5/mlx5_glue.h:16:0,
from drivers/net/mlx5/mlx5_glue.c:11:
/usr/include/infiniband/mlx5dv.h:144:2: error: unknown type name 'off_t'
off_t uar_mmap_offset;
^
As a temporary fix, sys/types.h is included in PMD. This has been fixed in
rdma-core v17. This can be removed when all the Linux distros are shipped
with rdma-core v17 or back-ported fix. As of now, RedHat 7.5 is known to
have rdma-core v16.
Xueming Li [Fri, 16 Mar 2018 15:22:27 +0000 (23:22 +0800)]
net/mlx5: fix existing file removal
There is no guarantee that the file won't be removed by external
user/application between the stat() and remove() syscalls, remove() will
fail if the file no longer exists.
Fixes: f8b9a3bad467 ("net/mlx5: install a socket to exchange a file descriptor") Cc: stable@dpdk.org Signed-off-by: Xueming Li <xuemingl@mellanox.com> Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
net/mlx5: change non failing function return values
These functions return int although they are not supposed to fail,
resulting in unnecessary checks in their callers.
Some are returning error where is should be a boolean.
Tomasz Duszynski [Thu, 15 Mar 2018 12:12:21 +0000 (13:12 +0100)]
net/mrvl: fix Rx descriptors number
Since filling hardware buffer pool (bpool) is Rx related
constant describing maximum number of rx descriptors
instead of maximum number of Tx descriptors should be used.
Fixes: 0ddc9b815b11 ("net/mrvl: add net PMD skeleton") Cc: stable@dpdk.org Signed-off-by: Marcin Wojtas <mw@semihalf.com> Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Vipin Varghese [Mon, 12 Mar 2018 21:53:52 +0000 (03:23 +0530)]
net/tap: allow user MAC to be passed as args
Allow TAP PMD to pass user desired MAC address as argument.
The argument value is processed as string delimited by ':',
is parsed and converted to HEX MAC address after validation.
Use new rte_eth_linkstatus_get/set helper functions to handle link
status update.
This driver was not doing atomic update of link status information.
And the return value was different than others.
The hardware also does not do autonegotiation (at least on Linux).
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Many drivers are all doing copy/paste of the same code to atomically
update the link status. Reduce duplication, and allow for future
changes by having common function for this.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>