dpdk.git
6 years agoethdev: fix queue start
Qi Zhang [Thu, 22 Mar 2018 12:59:01 +0000 (20:59 +0800)]
ethdev: fix queue start

Device must be started before start any queue.

Fixes: 0748be2cf9a2 ("ethdev: queue start and stop")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
6 years agoethdev: return named opaque type instead of void pointer
Ferruh Yigit [Tue, 20 Mar 2018 16:34:04 +0000 (16:34 +0000)]
ethdev: return named opaque type instead of void pointer

"struct rte_eth_rxtx_callback" is defined as internal data structure and
used as named opaque type.

So the functions that are adding callbacks can return objects in this
type instead of void pointer.

Also const qualifier added to "struct rte_eth_rxtx_callback *" to
protect it better from application modification.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
6 years agonet/avp: conform to new ethdev offload API
Allain Legacy [Mon, 19 Mar 2018 13:48:01 +0000 (08:48 -0500)]
net/avp: conform to new ethdev offload API

This change updates the AVP driver to conform with the new ethdev
offload API.  As per these commits:

    commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")'
    commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")'

Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
6 years agonet/sfc: fix mbuf data alignment calculation
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>
6 years agoethdev: remove unused struct forward declaration
Ferruh Yigit [Fri, 16 Mar 2018 11:14:50 +0000 (11:14 +0000)]
ethdev: remove unused struct forward declaration

Fixes: 331c447ad913 ("ethdev: separate internal structures into own header")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agoethdev: support dynamic logging
Ferruh Yigit [Tue, 13 Mar 2018 11:07:23 +0000 (11:07 +0000)]
ethdev: support dynamic logging

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agonet/dpaa: prefer defines for link speed values
Ferruh Yigit [Fri, 9 Mar 2018 17:59:03 +0000 (17:59 +0000)]
net/dpaa: prefer defines for link speed values

Use existing defines instead of hardcoded vales.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agonet/bnxt: fix LRO disable
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.

Fixes: 0958d8b6435d ("net/bnxt: support LRO")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
6 years agoethdev: fix port id storage
Ferruh Yigit [Fri, 9 Mar 2018 11:27:48 +0000 (11:27 +0000)]
ethdev: fix port id storage

port_id is now 16bits, update function parameter according.

Fixes: 4c270218aa26 ("ethdev: support security APIs")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agonet/sfc: add dynamic log level for MCDI messages
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>
6 years agonet/sfc: remove dedicated init log parameter
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>
6 years agonet/sfc: prepare to merge init logs with main log type
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>
6 years agonet/sfc: support per-port dynamic logging
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>
6 years agonet/sfc: support driver-wide dynamic logging
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>
6 years agoeal: register log type and pick level from args
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>
6 years agonet/mlx5: refuse empty VLAN flow specification
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.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
6 years agonet/mlx5: improve flow error explanation
Nélio Laranjeiro [Tue, 13 Mar 2018 14:17:38 +0000 (15:17 +0100)]
net/mlx5: improve flow error explanation

Fill the error context in conversion function to provide a better reason on
why it cannot be done to the user.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
6 years agonet/mlx5: change tunnel flow priority
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.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
6 years agonet/mlx5: fix link status to use wait to complete
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>
6 years agonet/mlx5: fix link status behavior
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.

and to stop:

 rte_eth_dev_stop(port_id);
 rte_eth_dev_set_link_down(port_id);

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.

[1] https://dpdk.org/browse/dpdk/tree/lib/librte_ether/rte_ethdev_core.h
[2] https://dpdk.org/browse/dpdk/tree/lib/librte_ether/rte_ethdev.h#n1677

Fixes: c7bf62255edf ("net/mlx5: fix handling link status event")
Fixes: e313ef4c2fe8 ("net/mlx5: fix link state on device start")
Cc: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: remove kernel version check
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.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agonet/mlx5: fix ARM build
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.

Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agonet/mlx5: fix existing file removal
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>
6 years agonet/mlx5: use dynamic logging
Nélio Laranjeiro [Tue, 13 Mar 2018 09:23:56 +0000 (10:23 +0100)]
net/mlx5: use dynamic logging

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agonet/mlx5: use port id in PMD log
Nélio Laranjeiro [Tue, 13 Mar 2018 09:23:55 +0000 (10:23 +0100)]
net/mlx5: use port id in PMD log

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agonet/mlx5: standardize on negative errno values
Nélio Laranjeiro [Mon, 5 Mar 2018 12:21:06 +0000 (13:21 +0100)]
net/mlx5: standardize on negative errno values

Set rte_errno systematically as well.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agonet/mlx5: change non failing function return values
Nélio Laranjeiro [Mon, 5 Mar 2018 12:21:05 +0000 (13:21 +0100)]
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.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agonet/mlx5: prefix all functions with mlx5
Nélio Laranjeiro [Mon, 5 Mar 2018 12:21:04 +0000 (13:21 +0100)]
net/mlx5: prefix all functions with mlx5

This change removes the need to distinguish unlocked priv_*() functions
which are therefore renamed using a mlx5_*() prefix for consistency.

At the same time, all functions from mlx5 uses a pointer to the ETH device
instead of the one to the PMD private data.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agonet/mlx5: remove control path locks
Nélio Laranjeiro [Mon, 5 Mar 2018 12:21:03 +0000 (13:21 +0100)]
net/mlx5: remove control path locks

In priv struct only the memory region needs to be protected against
concurrent access between the control plane and the data plane.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agonet/mlx5: remove useless empty lines
Nélio Laranjeiro [Mon, 5 Mar 2018 12:21:02 +0000 (13:21 +0100)]
net/mlx5: remove useless empty lines

Some empty lines have been added in the middle of the code without any
reason.  This commit removes them.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agonet/mlx5: add missing function documentation
Nélio Laranjeiro [Mon, 5 Mar 2018 12:21:01 +0000 (13:21 +0100)]
net/mlx5: add missing function documentation

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agonet/mlx5: normalize function prototypes
Nélio Laranjeiro [Mon, 5 Mar 2018 12:21:00 +0000 (13:21 +0100)]
net/mlx5: normalize function prototypes

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agonet/mlx5: mark parameters with unused attribute
Nélio Laranjeiro [Mon, 5 Mar 2018 12:20:59 +0000 (13:20 +0100)]
net/mlx5: mark parameters with unused attribute

Replaces all (void)foo; by __rte_unused macro except when variables are
under #if statements.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agonet/mlx5: name parameters in function prototypes
Nélio Laranjeiro [Mon, 5 Mar 2018 12:20:58 +0000 (13:20 +0100)]
net/mlx5: name parameters in function prototypes

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agonet/mlx5: fix sriov flag
Nélio Laranjeiro [Mon, 5 Mar 2018 12:20:57 +0000 (13:20 +0100)]
net/mlx5: fix sriov flag

priv_get_num_vfs() was used to help the PMD in prefetching the mbuf in
datapath when the PMD was behaving in VF mode.
This knowledge is no more used.

Fixes: 528a9fbec6de ("net/mlx5: support ConnectX-5 devices")
Cc: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agonet/mrvl: fix Rx descriptors number
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>
6 years agonet/mrvl: fix typo in log message
Tomasz Duszynski [Mon, 19 Mar 2018 12:37:22 +0000 (13:37 +0100)]
net/mrvl: fix typo in log message

Show appropriate log message in case Tx offloads are either
not supported or missing.

Fixes: 7d8f6c20cc7c ("net/mrvl: switch to the new Tx offload API")
Cc: stable@dpdk.org
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
6 years agonet/tap: allow user MAC to be passed as args
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.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Pascal Mazon <pascal.mazon@6wind.com>
6 years agonet/null: support bulk allocation
Mallesh Koujalagi [Thu, 8 Mar 2018 23:40:41 +0000 (15:40 -0800)]
net/null: support bulk allocation

Bulk allocation of multiple mbufs increased more than ~2%  and less
than 8% throughput on single core (1.8 GHz), based on usage for example
1: Testpmd case: Two null devices with copy 8% improvement.
    testpmd -c 0x3 -n 4 --socket-mem 1024,1024
--vdev 'eth_null0,size=64,copy=1' --vdev 'eth_null1,size=64,copy=1'
-- -i -a --coremask=0x2 --txrst=64 --txfreet=64 --txd=256
--rxd=256 --rxfreet=64 --burst=64 --txpt=64 --txq=1 --rxq=1 --numa
2. Ovs switch case: 2% improvement.
$VSCTL add-port ovs-br dpdk1 -- set Interface dpdk1 type=dpdk \
        options:dpdk-devargs=eth_null0,size=64,copy=1
$VSCTL add-port ovs-br dpdk2 -- set Interface dpdk2 type=dpdk \
        options:dpdk-devargs=eth_null1,size=64,copy=1

Signed-off-by: Mallesh Koujalagi <malleshx.koujalagi@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/null: set different MAC address for each device
Mallesh Koujalagi [Wed, 7 Mar 2018 03:31:54 +0000 (19:31 -0800)]
net/null: set different MAC address for each device

Previously all null devices were getting MAC address "00:00:00:00:00:00"

After attaching two Null device to OVS, seeing "00.00.00.00.00.00" mac
address for both null devices.

Fix this issue, by setting different mac address.

Signed-off-by: Mallesh Koujalagi <malleshx.koujalagi@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/bonding: set MTU on slave configure
Chas Williams [Fri, 23 Feb 2018 04:01:21 +0000 (23:01 -0500)]
net/bonding: set MTU on slave configure

When a slave is configured make sure that the slave's MTU
matches the bonding's idea of the MTU.

Signed-off-by: Chas Williams <chas3@att.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
6 years agonet/enic: use link status helper functions
Stephen Hemminger [Fri, 26 Jan 2018 02:01:51 +0000 (18:01 -0800)]
net/enic: use link status helper functions

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>
6 years agonet/octeontx: use link status helper functions
Stephen Hemminger [Fri, 26 Jan 2018 02:01:50 +0000 (18:01 -0800)]
net/octeontx: use link status helper functions

Use new rte_eth_linkstatus_get/set helper functions to handle link
status update.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/szedata2: use link status helper functions
Stephen Hemminger [Fri, 26 Jan 2018 02:01:49 +0000 (18:01 -0800)]
net/szedata2: use link status helper functions

Yet another driver which was not returing correct value on
link change.

Use new rte_eth_linkstatus_get/set helper functions to handle link
status update.

Since this driver can't be built on x86 could not even
do a compile test.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/thunderx: use link status helper functions
Stephen Hemminger [Fri, 26 Jan 2018 02:01:48 +0000 (18:01 -0800)]
net/thunderx: use link status helper functions

Use new rte_eth_linkstatus_get/set helper functions to handle link
status update.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/liquidio: use link status helper functions
Stephen Hemminger [Fri, 26 Jan 2018 02:01:47 +0000 (18:01 -0800)]
net/liquidio: use link status helper functions

Use new rte_eth_linkstatus_get/set helper functions to handle link
status update.
And cleanup the logic in the the link update routine.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Tested-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/i40e: use link status helper functions
Stephen Hemminger [Fri, 26 Jan 2018 02:01:46 +0000 (18:01 -0800)]
net/i40e: use link status helper functions

Use new rte_eth_linkstatus_get/set helper functions to handle link
status update.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/sfc: use link status helper functions
Stephen Hemminger [Fri, 26 Jan 2018 02:01:45 +0000 (18:01 -0800)]
net/sfc: use link status helper functions

Use new rte_eth_linkstatus_get/set helper functions to handle link
status update.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/ixgbe: use link status helper functions
Stephen Hemminger [Fri, 26 Jan 2018 02:01:44 +0000 (18:01 -0800)]
net/ixgbe: use link status helper functions

Use new rte_eth_linkstatus_get/set helper functions to handle link
status update.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/e1000: use link status helper functions
Stephen Hemminger [Fri, 26 Jan 2018 02:01:43 +0000 (18:01 -0800)]
net/e1000: use link status helper functions

Use new rte_eth_linkstatus_get/set helper functions to handle link
status update.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/nfp: use link status helper functions
Stephen Hemminger [Fri, 26 Jan 2018 02:01:42 +0000 (18:01 -0800)]
net/nfp: use link status helper functions

Use new rte_eth_linkstatus_get/set helper functions to handle link
status update.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/dpaa2: use link status helper functions
Stephen Hemminger [Fri, 26 Jan 2018 02:01:41 +0000 (18:01 -0800)]
net/dpaa2: use link status helper functions

Use new rte_eth_linkstatus_get/set helper functions to handle link
status update.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/vmxnet3: use link status helper functions
Stephen Hemminger [Fri, 26 Jan 2018 02:01:40 +0000 (18:01 -0800)]
net/vmxnet3: use link status helper functions

Use new rte_eth_linkstatus_get/set helper functions to handle link
status update.
Also remove no longer necessary include of rte_atomic.h

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/virtio: use link status helper functions
Stephen Hemminger [Fri, 26 Jan 2018 02:01:39 +0000 (18:01 -0800)]
net/virtio: use link status helper functions

Use new rte_eth_linkstatus_get/set helper functions to handle link
status update.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoethdev: add link status get/set helper functions
Stephen Hemminger [Fri, 26 Jan 2018 02:01:38 +0000 (18:01 -0800)]
ethdev: add link status get/set helper functions

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>
6 years agoeal: introduce atomic exchange operation
Stephen Hemminger [Fri, 26 Jan 2018 02:01:37 +0000 (18:01 -0800)]
eal: introduce atomic exchange operation

To handle atomic update of link status (64 bit), every driver
was doing its own version using cmpset.
Atomic exchange is a useful primitive in its own right;
therefore make it a EAL routine.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
6 years agonet/mrvl: add Tx queue start/stop
Tomasz Duszynski [Thu, 15 Mar 2018 07:52:04 +0000 (08:52 +0100)]
net/mrvl: add Tx queue start/stop

Add Tx queue start/stop feature.

Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
6 years agonet/mrvl: add Rx flow control
Tomasz Duszynski [Thu, 15 Mar 2018 07:52:03 +0000 (08:52 +0100)]
net/mrvl: add Rx flow control

Add Rx side flow control support.

Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
6 years agonet/mrvl: add extended statistics
Tomasz Duszynski [Thu, 15 Mar 2018 07:52:02 +0000 (08:52 +0100)]
net/mrvl: add extended statistics

Add extended statistics implementation.

Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
6 years agonet/mrvl: support classifier
Tomasz Duszynski [Thu, 15 Mar 2018 07:52:01 +0000 (08:52 +0100)]
net/mrvl: support classifier

Add classifier configuration support via rte_flow api.

Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
6 years agonet/mrvl: document policer/scheduler/rate limiter usage
Tomasz Duszynski [Thu, 15 Mar 2018 07:52:00 +0000 (08:52 +0100)]
net/mrvl: document policer/scheduler/rate limiter usage

Add documentation and example for ingress policer, egress scheduler
and egress rate limiter.

Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
6 years agonet/mrvl: support egress scheduler/rate limiter
Tomasz Duszynski [Thu, 15 Mar 2018 07:51:59 +0000 (08:51 +0100)]
net/mrvl: support egress scheduler/rate limiter

Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
6 years agonet/mrvl: support ingress policer
Tomasz Duszynski [Thu, 15 Mar 2018 07:51:58 +0000 (08:51 +0100)]
net/mrvl: support ingress policer

Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
6 years agonet/mrvl: fix crash when port is closed without starting
Natalie Samsonov [Thu, 15 Mar 2018 07:51:57 +0000 (08:51 +0100)]
net/mrvl: fix crash when port is closed without starting

Fixes: 0ddc9b815b11 ("net/mrvl: add net PMD skeleton")
Cc: stable@dpdk.org
Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
6 years agonet/mrvl: convert license headers to SPDX tags
Tomasz Duszynski [Mon, 12 Mar 2018 07:32:07 +0000 (08:32 +0100)]
net/mrvl: convert license headers to SPDX tags

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agonet/vmxnet3: keep consistent link status
Chas Williams [Wed, 17 Jan 2018 15:04:57 +0000 (10:04 -0500)]
net/vmxnet3: keep consistent link status

Bonding may examine the link properties to ensure that matching interfaces
are bound together.  If the link is going to have fixed properties,
these need to remain consistent regardless of the link_status or the
state of the adapter.

Signed-off-by: Chas Williams <chas3@att.com>
Acked-by: Shrikrishna Khare <skhare@vmware.com>
6 years agonet/vmxnet3: set the queue shared buffer at start
Chas Williams [Wed, 17 Jan 2018 15:04:56 +0000 (10:04 -0500)]
net/vmxnet3: set the queue shared buffer at start

If a reconfiguration happens, queuedesc is reallocated.  Any queues that
are preserved point to the previous queuedesc since the queues are only
configured during queue setup.  Delay configuration of the shared queue
pointers until device start when queuedesc is no longer changing.

Fixes: 8618d19b52b1 ("net/vmxnet3: reallocate shared memzone on re-config")
Cc: stable@dpdk.org
Signed-off-by: Chas Williams <chas3@att.com>
Acked-by: Shrikrishna Khare <skhare@vmware.com>
6 years agonet/mlx: fix rdma-core glue path with EAL plugins
Adrien Mazarguil [Fri, 2 Mar 2018 14:15:17 +0000 (15:15 +0100)]
net/mlx: fix rdma-core glue path with EAL plugins

Glue object files are looked up in RTE_EAL_PMD_PATH by default when set and
should be installed in this directory.

During startup, EAL attempts to load them automatically like other plug-ins
found there. While normally harmless, dlopen() fails when rdma-core is not
installed, EAL interprets this as a fatal error and terminates the
application.

This patch requests glue objects to be installed in a different directory
to prevent their automatic loading by EAL since they are PMD helpers, not
actual DPDK plug-ins.

Fixes: f6242d0655cd ("net/mlx: make rdma-core glue path configurable")
Cc: stable@dpdk.org
Reported-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Tested-by: Timothy Redaelli <tredaelli@redhat.com>
6 years agonet/i40e: fix link update no wait
Fan Zhang [Thu, 8 Mar 2018 12:17:52 +0000 (12:17 +0000)]
net/i40e: fix link update no wait

In i40e_dev_link_update() the driver obtains the link status
info via admin queue command despite of "no_wait" flag. This
requires relatively long time and may be a problem to some
application such as ovs-dpdk.
(https://bugzilla.redhat.com/show_bug.cgi?id=1551761).

This patch aims to fix the problem by using a different
approach of obtaining link status for i40e NIC without waiting.
Instead of getting the link status via admin queue command,
this patch reads the link status registers to accelerate the
procedure.

Fixes: 263333bbb7a9 ("i40e: fix link status timeout")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Signed-off-by: Andrey Chilikin <andrey.chilikin@intel.com>
Reviewed-by: Eelco Chaudron <echaudro@redhat.com>
Tested-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
6 years agovhost: add note about sockets in server mode
Ilya Maximets [Mon, 26 Feb 2018 08:39:00 +0000 (09:39 +0100)]
vhost: add note about sockets in server mode

From time to time, someone sends patches about unlinking existing
sockets when registering a vhost user in server mode.

A recent example:
http://dpdk.org/ml/archives/dev/2018-February/090025.html

This problem has been discussed many times, and it was made clear that
the library should not unlink files given by the application in order
to avoid possible security problems, such as removing random files
used by other programs.

One of the first discussions:
http://dpdk.org/ml/archives/dev/2015-December/030326.html

To avoid such patches in the future, it was decided to add a comment
that explains what is happening and tries to describe the reasoning.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agonet/enic: support meson
Hyong Youb Kim [Thu, 8 Mar 2018 02:47:02 +0000 (18:47 -0800)]
net/enic: support meson

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/enic: avoid strict aliasing warnings
Hyong Youb Kim [Thu, 8 Mar 2018 02:47:01 +0000 (18:47 -0800)]
net/enic: avoid strict aliasing warnings

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
6 years agodoc: describe Rx bytes counter behavior for enic
Hyong Youb Kim [Thu, 8 Mar 2018 02:47:00 +0000 (18:47 -0800)]
doc: describe Rx bytes counter behavior for enic

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
6 years agonet/enic: support Rx queue interrupts
Hyong Youb Kim [Thu, 8 Mar 2018 02:46:59 +0000 (18:46 -0800)]
net/enic: support Rx queue interrupts

Enable rx queue interrupts if the app requests them, and vNIC has
enough interrupt resources. Use interrupt vector 0 for link status and
errors. Use vector 1 for rx queue 0, vector 2 for rx queue 1, and so
on. So, with n rx queues, vNIC needs to have at n + 1 interrupts.

For VIC, enabling and disabling rx queue interrupts are simply
mask/unmask operations. VIC's credit based interrupt moderation is not
used, as the app wants to explicitly control when to enable/disable
interrupts.

This version requires MSI-X (vfio-pci). Sharing one interrupt for link
status and rx queues is possible, but is rather complex and has no
user demands.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
6 years agonet/enic: allocate stats DMA buffer upfront during probe
Hyong Youb Kim [Thu, 8 Mar 2018 02:46:58 +0000 (18:46 -0800)]
net/enic: allocate stats DMA buffer upfront during probe

The driver provides a DMA buffer to the firmware when it requests port
stats. The NIC then fills that buffer with latest stats. Currently,
the driver allocates the DMA buffer the first time it requests stats
and saves it for later use. This can lead to crashes when
primary/secondary processes are involved. For example, the following
sequence crashes the secondary process.

1. Start a primary app that does not call rte_eth_stats_get()
2. dpdk-procinfo -- --stats

dpdk-procinfo crashes while trying to allocate the stats DMA buffer
because the alloc function pointer (vdev.alloc_consistent) is valid
only in the primary process, not in the secondary process.

Overwriting the alloc function pointer in the secondary process is not
an option, as it will simply make the pointer invalid in the primary
process. Instead, allocate the DMA buffer during probe so that only
the primary process does both allocate and free. This allows the
secondary process to dump stats as well.

Fixes: 9913fbb91df0 ("enic/base: common code")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
6 years agonet/enic: add Rx/Tx queue configuration getters
Hyong Youb Kim [Thu, 8 Mar 2018 02:46:57 +0000 (18:46 -0800)]
net/enic: add Rx/Tx queue configuration getters

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
6 years agonet/enic: remove VLAN filter handler
Hyong Youb Kim [Thu, 8 Mar 2018 02:46:56 +0000 (18:46 -0800)]
net/enic: remove VLAN filter handler

VIC does not support VLAN filtering at the moment. The firmware does
accept the filter add/del commands and returns success. But, they are
no-ops. To avoid confusion, remove the filter set handler so the app
sees an error instead of silent failure.

Also during the device configure time, enicpmd_vlan_offload_set would
not print a warning message about unsupported VLAN filtering, because
the caller specifies only ETH_VLAN_STRIP_MASK. This is wrong, as we
should attempt to apply all requested offloads at the configure
time. So, pass all VLAN offload masks, which triggers a warning
message about VLAN filtering, if requested.

Finally, enicpmd_vlan_offload_set should check both mask and
rxmode.offloads, not just mask.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
6 years agonet/enic: heed the requested max Rx packet size
Hyong Youb Kim [Thu, 8 Mar 2018 02:46:55 +0000 (18:46 -0800)]
net/enic: heed the requested max Rx packet size

Currently, enic completely ignores the requested max Rx packet size
(rxmode.max_rx_pkt_len). The desired behavior is that the NIC hardware
drops packets larger than the requested size, even though they are
still smaller than MTU.

Cisco VIC does not have such a feature. But, we can accomplish a
similar (not same) effect by reducing the size of posted receive
buffers. Packets larger than the posted size get truncated, and the
receive handler drops them. This is also how the kernel enic driver
enforces the Rx side MTU.

This workaround works only when scatter mode is *not* used. When
scatter is used, there is currently no way to support
rxmode.max_rx_pkt_len, as the NIC always receives packets up to MTU.

For posterity, add a copious amount of comments regarding the
hardware's drop/receive behavior with respect to max/current MTU.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
6 years agonet/enic: allow to change RSS settings
Hyong Youb Kim [Thu, 8 Mar 2018 02:46:54 +0000 (18:46 -0800)]
net/enic: allow to change RSS settings

Currently, when more than 1 receive queues are configured, the driver
always enables RSS with the driver's own default hash type, key, and
RETA. The user is unable to change any of the RSS settings. Address
this by implementing the ethdev RSS API as follows.

Correctly report the RETA size, key size, and supported hash types
through rte_eth_dev_info.

During dev_configure(), initialize RSS according to the device's
mq_mode and rss_conf. Start with the default RETA, and use the default
key unless a custom key is provided.

Add the RETA and rss_conf query/set handlers to let the user change
RSS settings after the initial configuration. The hardware is able to
change hash type, key, and RETA individually. So, the handlers change
only the affected settings.

Refactor/rename several functions in order to make their intentions
clear. For example, remove all traces of RSS from
enicpmd_vlan_offload_set() as it is confusing.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
6 years agonet/enic: remove extern in function declarations
John Daley [Thu, 8 Mar 2018 02:46:53 +0000 (18:46 -0800)]
net/enic: remove extern in function declarations

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
6 years agonet/sfc: support DROP action in flow API
Roman Zhukov [Tue, 27 Feb 2018 13:11:19 +0000 (13:11 +0000)]
net/sfc: support DROP action in flow API

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: support drop filters on EF10 family NICs
Roman Zhukov [Tue, 27 Feb 2018 13:11:18 +0000 (13:11 +0000)]
net/sfc/base: support drop filters on EF10 family NICs

Add support for filters which drop packets when forming MCDI request
for a filter.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agodoc: add sfc flow API support for tunnels in release notes
Andrew Rybchenko [Tue, 6 Mar 2018 15:24:59 +0000 (15:24 +0000)]
doc: add sfc flow API support for tunnels in release notes

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc: avoid creation of ineffective flow rules
Roman Zhukov [Tue, 6 Mar 2018 15:24:58 +0000 (15:24 +0000)]
net/sfc: avoid creation of ineffective flow rules

Despite being versatile, the hardware support for filtering has a number
of special properties which must be taken into account. Namely, there is
a known set of valid filters which don't take any effect despite being
accepted by the hardware.

The combinations of match flags and field values which can describe the
exceptional filters are as follows:
- ETHER_TYPE or ETHER_TYPE | LOC_MAC with IPv4 or IPv6 EtherType
- ETHER_TYPE | IP_PROTO or ETHER_TYPE | IP_PROTO | LOC_MAC with UDP or
TCP IP protocol value
- The same combinations with OUTER_VID and/or INNER_VID

These exceptional filters can be expressed in terms of RTE flow rules.
If the user creates such a flow rule, no traffic will hit the underlying
filter, and no errors will be reported.

This patch adds a means to prevent such ineffective flow rules from
being created.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
6 years agonet/sfc: multiply of specs with an unknown destination MAC
Roman Zhukov [Tue, 6 Mar 2018 15:24:57 +0000 (15:24 +0000)]
net/sfc: multiply of specs with an unknown destination MAC

To filter all traffic, need to create two hardware filter specifications
with both unknown unicast and unknown multicast destination MAC address
match flags.

In terms of RTE flow API, this would require adding multiple flow rules
with corresponding ETH items. In order to avoid such a complication, the
patch implements a mechanism to auto-complete an underlying filter
representation of a flow rule in order to create additional filter
specifications featuring the missing match flags.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
6 years agonet/sfc: multiply of specs w/o inner frame destination MAC
Roman Zhukov [Tue, 6 Mar 2018 15:24:56 +0000 (15:24 +0000)]
net/sfc: multiply of specs w/o inner frame destination MAC

Knowledge of a network identifier is not sufficient to construct a
workable hardware filter for encapsulated traffic. It's obligatory to
specify one of the match flags associated with inner frame destination
MAC. If the address is unknown, then one needs to specify either unknown
unicast or unknown multicast destination match flag.

In terms of RTE flow API, this would require adding multiple flow rules
with corresponding ETH items besides the tunnel item. In order to avoid
such a complication, the patch implements a mechanism to auto-complete
an underlying filter representation of a flow rule in order to create
additional filter specifications featuring the missing match flags.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
6 years agonet/sfc: multiply of specs with an unknown EtherType
Roman Zhukov [Tue, 6 Mar 2018 15:24:55 +0000 (15:24 +0000)]
net/sfc: multiply of specs with an unknown EtherType

Hardware filter specification for encapsulated traffic must contain
EtherType. In terms of RTE flow API, this would require L3 item to be
used in the flow rule. In the simplest case, if the user needs to filter
encapsulated traffic without knowledge of exact EtherType, they will
have to create multiple variants of the flow rule featuring all possible
L3 items (IPv4, IPv6), respectively. In order to hide the gory details
and avoid such a complication, this patch implements a mechanism to
auto-complete the filter specifications if need be.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
6 years agonet/sfc: add infrastructure to make many filters from flow
Roman Zhukov [Tue, 6 Mar 2018 15:24:54 +0000 (15:24 +0000)]
net/sfc: add infrastructure to make many filters from flow

Not all flow rules can be expressed in one hardware filter, so some flow
rules have to be expressed in terms of multiple hardware filters. This
patch provides a means to produce a filter spec template from the flow
rule which then can be used to produce a set of fully elaborated specs
to be inserted.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
6 years agonet/sfc: support inner frame ETH in flow API filters
Roman Zhukov [Tue, 6 Mar 2018 15:24:53 +0000 (15:24 +0000)]
net/sfc: support inner frame ETH in flow API filters

Support destination MAC address match in inner frames.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
6 years agonet/sfc: support GENEVE in flow API filters
Roman Zhukov [Tue, 6 Mar 2018 15:24:52 +0000 (15:24 +0000)]
net/sfc: support GENEVE in flow API filters

Exact match of virtual network identifier is supported by parser.
IP protocol match are enforced to UDP.
Only Ethernet protocol type is supported.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
6 years agonet/sfc: support NVGRE in flow API filters
Roman Zhukov [Tue, 6 Mar 2018 15:24:51 +0000 (15:24 +0000)]
net/sfc: support NVGRE in flow API filters

Exact match of virtual subnet ID is supported by parser.
IP protocol match are enforced to GRE.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
6 years agonet/sfc: support VXLAN in flow API filters
Roman Zhukov [Tue, 6 Mar 2018 15:24:50 +0000 (15:24 +0000)]
net/sfc: support VXLAN in flow API filters

Exact match of VXLAN network identifier is supported by parser.
IP protocol match are enforced to UDP.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
6 years agonet/sfc/base: distinguish filters for encapsulated packets
Roman Zhukov [Tue, 6 Mar 2018 15:24:49 +0000 (15:24 +0000)]
net/sfc/base: distinguish filters for encapsulated packets

Add filter match flag to distinguish filters applied only to
encapsulated packets.

Match flags set should allow to determine whether a filter
is supported or not. The problem is that if specification
has supported set outer match flags and specified
encapsulation without any inner flags, check says that it
is supported, and filter insertion is performed. However,
there is no filtering of the encapsulated traffic. A new
flag is added to solve this problem and separate the
filters for the encapsulated packets.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Mark Spender <mspender@solarflare.com>
6 years agonet/sfc/base: support VXLAN filter creation
Vijay Srivastava [Tue, 6 Mar 2018 15:24:48 +0000 (15:24 +0000)]
net/sfc/base: support VXLAN filter creation

Signed-off-by: Vijay Srivastava <vijays@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: support VNI/VSID and inner frame local MAC
Roman Zhukov [Tue, 6 Mar 2018 15:24:47 +0000 (15:24 +0000)]
net/sfc/base: support VNI/VSID and inner frame local MAC

This supports VNI/VSID and inner frame local MAC fields to
match in VXLAN, GENEVE, or NVGRE packets.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
6 years agonet/sfc/base: support filters for encapsulated packets
Roman Zhukov [Tue, 6 Mar 2018 15:24:46 +0000 (15:24 +0000)]
net/sfc/base: support filters for encapsulated packets

This adds filters for encapsulated packets to the list
returned by ef10_filter_supported_filters().

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
6 years agonet/cxgbe: rework and use 32-bit port capability
Rahul Lakkireddy [Wed, 28 Feb 2018 18:04:52 +0000 (23:34 +0530)]
net/cxgbe: rework and use 32-bit port capability

The new code uses the new 32-bit Port Capabilities exclusively and
only translates to/from the old 16-bit Port Capabilities at the last
point possible when talking to older Firmware.

For the old versus new Firmware issue, we use the new FW_PARAMS_CMD[PFVF,
CAPS32] command to tell the Firmware that we want Asynchronous Port Status
updates to use the new 32-bit version of the Port Information message.  If
we get an error, we know we're dealing with older Firmware, and if not,
we'll start getting th new 32-bit Port Capability message formats.

Also, refactor t4_handle_fw_rpl() to handle new 32-bit Port Capability
replies from firmware in t4_handle_get_port_info().

Original work by Surendra Mobiya <surendra@chelsio.com>

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
6 years agonet/cxgbe: update link config for 32-bit port capability
Rahul Lakkireddy [Wed, 28 Feb 2018 18:04:51 +0000 (23:34 +0530)]
net/cxgbe: update link config for 32-bit port capability

Update link configuration API to prepare for 32-bit port capability
support. Continue using 16-bit port capability for older firmware.

Original work by Surendra Mobiya <surendra@chelsio.com>

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
6 years agonet/cxgbe: update link Forward Error Correction (FEC)
Kumar Sanghvi [Wed, 28 Feb 2018 18:04:50 +0000 (23:34 +0530)]
net/cxgbe: update link Forward Error Correction (FEC)

Normally, firmware reads various Forward Error Correction parameters
from a Transceiver Module i2c EPROM and uses a couple of IEEE Standards
(802.3bj for 100Gb/s and 802.3by for 25Gb/s) to interpret those
parameters and come up with supported and default FEC settings.
Firmware then sends these FEC parameters to the Host Driver which gives
the Host Administrator an opportunity to change them if necessary in
order to establish a Link with a Switch which may have made a
non-standard FEC decision.

This commit recognizes "auto" as a discrete FEC mode which can be
used to explicitly select the IEEE 802.3 standard based FEC selection.

Original work by Surendra Mobiya <surendra@chelsio.com>

Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
6 years agonet/cxgbe: support getting RSS hash configuration and key
Kumar Sanghvi [Wed, 28 Feb 2018 18:04:49 +0000 (23:34 +0530)]
net/cxgbe: support getting RSS hash configuration and key

Original work by Surendra Mobiya <surendra@chelsio.com>

Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>