Commit Graph

5113 Commits

Author SHA1 Message Date
Roman Zhukov
9a733758c0 net/sfc/base: support MARK and FLAG actions in filters
This patch adds support for DPDK rte_flow "MARK" and "FLAG" filter
actions to filters on EF10 family NICs.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:59 +01:00
Roman Zhukov
618869b815 net/sfc/base: get actions MARK and FLAG support
Filter actions MARK and FLAG are supported on Medford2 by DPDK
firmware variant.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:59 +01:00
Andrew Rybchenko
26c4f60823 net/sfc: support flow marks in equal stride super-buffer Rx
Equal stride super-buffer Rx mode allows to mark packets in HW
using filters. Process the data on datapath and advertise
corresponding features to allow flow API support to implement it.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:59 +01:00
Andrew Rybchenko
5a1ae82d7b net/sfc: add Rx descriptor wait timeout
Add device argument to customize Rx descriptor wait timeout which
is supported in DPDK firmware variant only in equal stride super-buffer
Rx mode only.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-04-27 18:00:59 +01:00
Andrew Rybchenko
6e899accd2 net/sfc: support DPDK firmware variant
DPDK firmware variant supports equal stride super-buffer Rx mode which
provides higher packet rate and packet marks but requires dedicated
mempool manager with contiguous object block allocation (e.g. bucket).

Also the firmware supports subvariant without checksumming on Tx which
allows to reach higher packet rates on transmit if checksumming is not
required.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-04-27 18:00:59 +01:00
Andrew Rybchenko
2a97a82b65 net/sfc: check mempool when equal stride super-buffer used
Equal stride super-buffer requires mempool with contiguous object
block allocation mechanism. Bucket mempool is the only which provides it.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
08d23c67ed net/sfc: support callback to check if mempool is supported
The callback is a dummy yet since no Rx datapath provides its own
callback, so all pools are supported.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
390f9b8d82 net/sfc: support equal stride super-buffer Rx mode
HW Rx descriptor represents many contiguous packet buffers which
follow each other. Number of buffers, stride and maximum DMA
length are setup-time configurable per Rx queue based on provided
mempool. The mempool must support contiguous block allocation and
get info API to retrieve number of objects in the block.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
d101da1b9c net/sfc: allow to take mbuf pool into account when sizing
The new argument will be used by the equal stride super-buffer
Rx datapath.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
d3ab4fd9bd net/sfc: allow one Rx queue entry carry many packet buffers
One HW Rx descriptor has many packet buffers in the case of equal
stride super-buffer Rx modes. Each packet buffer is still treated
as separate SW Rx descriptor. rxq_entries is the size of HW Rx ring
whereas nb_rx_desc is the number of SW Rx descriptors.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
7ee7e57c34 net/sfc: conditionally compile support for tunnel packets
Equal stride super-buffer Rx datapath does not support tunnels, code to
parse tunnel packet types and inner checksum offload is not required and
it is important to be able to compile it out on build time to avoid
extra CPU load.

Cutting of tunnels support relies on compiler optimizaitons to
be able to drop extra checks and branches if tun_ptype is always 0.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
c121f00836 net/sfc: move EF10 Rx event parser to shared header
Equal stride super-buffer Rx datapath will use it as well.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
a6539283b5 net/sfc: prepare EF10 Rx event parser to be reused
Equal stride super-buffer Rx mode will be handled by the dedicated
Rx datapath and the mode has almost the same Rx event structure as
single packet Rx mode.

Restructure the code to allow the common parts to be shared.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
a2443fdf8f net/sfc: factor out function to push Rx doorbell
The function may be shared by different Rx datapath implementations.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
9a5d5f1805 net/sfc/base: add equal stride super-buffer prefix layout
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
6f60cc4a78 net/sfc/base: support equal stride super-buffer Rx mode
Equal stride super-buffer Rx mode is supported by DPDK firmware
variant. One Rx descriptor provides many Rx buffers to firmware.
Rx buffers follow each other with specified stride.
Also it supports head of line blocking with timeout to address
drops when no Rx descriptors are available. So it gives extra time
to the driver to provide Rx descriptors before drop.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
6c9577bf24 net/sfc/base: detect equal stride super-buffer support
Equal stride super-buffer Rx mode is supported on Medford2 by
DPDK firmware variant.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
d4f4b8f9d2 net/sfc/base: make RxQ type data an union
The type is an internal interface. Single integer is insufficient
to carry RxQ type-specific information in the case of equal stride
super-buffer Rx mode (packet buffers per bucket, maximum DMA length,
packet stride, head of line block timeout).

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
b8f96929b5 net/sfc/base: update autogenerated MCDI and TLV headers
Equal stride super-buffer is a new name instead of deprecated equal
stride packed stream to avoid confusion with previous packed stream.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:58 +01:00
Stephen Hemminger
99d9d9d4dd net/nfp: use dynamic logging everywhere
Drivers should only log with their assigned logtype, not with the
generic PMD log type.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2018-04-27 18:00:58 +01:00
Stephen Hemminger
17239271d2 net/nfp: add newline in PMD_RX/TX_LOG macros
Be consistent with usage in other drivers.
No need for snowflake drivers.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2018-04-27 18:00:57 +01:00
Stephen Hemminger
c524468ad9 net/nfp: fix double space in init log
Shouldn't pass extra newline.

Fixes: 7dcb19d78f ("net/nfp: fix Rx interrupt when multiqueue")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2018-04-27 18:00:57 +01:00
Stephen Hemminger
8613520640 net/nfp: add implied new line to log macro
The PMD_INIT_LOG macro always adds a newline, and other drivers version
of PMD_DRV_LOG always adds a newline. Therefore change nfp driver
to be consitent with others.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2018-04-27 18:00:57 +01:00
Stephen Hemminger
a064f88210 net/nfp: use correct logtype for init messages
The NFP driver init messages would come out under PMD not net.pmd.nfp.init.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2018-04-27 18:00:57 +01:00
Declan Doherty
fb8fd96d42 ethdev: add shared counter to flow API
Add rte_flow_action_count action data structure to enable shared
counters across multiple flows on a single port or across multiple
flows on multiple ports within the same switch domain. Also this enables
multiple count actions to be specified in a single flow action.

This patch also modifies the existing rte_flow_query API to take the
rte_flow_action structure as an input parameter instead of the
rte_flow_action_type enumeration to allow querying a specific action
from a flow rule when multiple actions of the same type are specified.

This patch also contains updates for the bonding, failsafe and mlx5 PMDs
and testpmd application which are affected by this API change.

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
2018-04-27 18:00:57 +01:00
Andrew Rybchenko
3cefef5491 net/sfc: do not use RSS context if it is not required
RSS action with only one destination queue and no specific settings
for hash types and key does not require dedicated RSS context and
may be simplified to QUEUE action.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
2018-04-27 18:00:57 +01:00
Ophir Munk
ead63dd318 net/tap: return empty port offload capabilities
Fix internal report on port specific offload capabilities to be 0 (no
capabilities). Before this commit port capabilities were a clone of queue
capabilities, however the current TAP offload capabilities (e.g.
checksum calculation) are per queue and are not specific per port.
This commit fixes an internal validation check for new configured
queue offloads.
The port capability API keeps reporting all queue capabilities as port
capabilities.

Fixes: 95ae196ae1 ("net/tap: use new Rx offloads API")
Fixes: 818fe14a98 ("net/tap: use new Tx offloads API")
Cc: stable@dpdk.org

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
2018-04-27 18:00:57 +01:00
Andrew Rybchenko
c43e0f6904 net/sfc: ignore spec bits not covered by mask
mask is a simple bit-mask applied before interpreting the contents
of spec and last.

Fixes: a9825ccf5b ("net/sfc: support flow API filters")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
2018-04-27 18:00:57 +01:00
Declan Doherty
cf80ba6e20 net/ixgbe: add support for representor ports
Add support for virtual function representor ports to the ixgbe PF
driver. When SR-IOV virtual functions devices are enabled a
corresponding representor port for each VF can be enabled in the
process in which the ixgbe PMD is running within, by specifying the
representor devargs with the list of VF ports that representors
are to be created for.

An example of the devargs which would create VF representor for virtual
functions 0,2,4,5,6 and 7 is:

-w DBDF,representor=[0,2,4-7]

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Signed-off-by: Remy Horton <remy.horton@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-04-27 18:00:57 +01:00
Declan Doherty
e0cb96204b net/i40e: add support for representor ports
Add support for virtual function representor ports to the i40e PF
driver. When SR-IOV virtual functions devices are enabled a
corresponding representor port for each VF can be enabled, in the
process in which the i40e PMD is running, by specifying the
representor devargs with the list of VF ports that representors
are to be created for.

An example of the devargs which would create VF representor for virtual
functions 0,2,4,5,6 and 7 is:

-w DBDF,representor=[0,2,4-7]

and to just specify a single representor on virtual function 3 (switch
port id):

-w DBDF,representor=3

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Signed-off-by: Remy Horton <remy.horton@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-04-27 18:00:57 +01:00
Xueming Li
bd315baecf net/mlx5: allow flow tunnel ID 0 with outer pattern
Tunnel w/o tunnel id pattern could match any non-tunneled packet,
this patch allowed tunnel w/o tunnel id pattern after proper outer spec.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-04-27 18:00:56 +01:00
Xueming Li
05dda761bd net/mlx5: introduce VXLAN-GPE tunnel type
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-04-27 18:00:56 +01:00
Xueming Li
80f2d0ed7f net/mlx5: add hardware flow debug dump
Dump verb flow detail including flow spec type and size for debugging
purpose.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-04-27 18:00:56 +01:00
Xueming Li
d4a405186b net/mlx5: support tunnel RSS level
Tunnel RSS level of flow RSS action offers user a choice to do RSS hash
calculation on inner or outer RSS fields. Testpmd flow command examples:

GRE flow inner RSS:
  flow create 0 ingress pattern eth / ipv4 proto is 47 / gre / end
actions rss queues 1 2 end level 1 / end

GRE tunnel flow outer RSS:
  flow create 0 ingress pattern eth  / ipv4 proto is 47 / gre / end
actions rss queues 1 2 end level 0 / end

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-04-27 18:00:56 +01:00
Xueming Li
8486125353 net/mlx5: split flow RSS handling logic
This patch split out flow RSS hash field handling logic to dedicate
function.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-04-27 18:00:56 +01:00
Xueming Li
6ba07449ed net/mlx5: cleanup tunnel checksum offloads
Once tunnel packet type(RTE_PTYPE_TUNNEL_xxx) identified,
PKT_RX_IP_CKSUM_XXX and PKT_RX_L4_CKSUM_XXX represent checksum result of
inner headers, outer L3 and L4 header checksum are always valid as soon
as tunnel identified. If no tunnel identified, PKT_RX_IP_CKSUM_XXX and
PKT_RX_L4_CKSUM_XXX represent checksum result of outer L3 and L4
headers.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-04-27 18:00:56 +01:00
Xueming Li
3cc08bc6dd net/mlx5: support Rx tunnel type identification
This patch introduced tunnel type identification based on flow rules.
If flows of multiple tunnel types built on same queue, no tunnel type
will be returned. User application could use bits in flow mark as tunnel
type identifier.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-04-27 18:00:56 +01:00
Xueming Li
78a54648ff net/mlx5: support L3 VXLAN flow
This patch support L3 VXLAN, no inner L2 header comparing to standard
VXLAN protocol. L3 VXLAN using specific overlay UDP destination port to
discriminate against standard VXLAN, device parameter and FW has to be
configured to support it:
  sudo mlxconfig -d <device> -y s IP_OVER_VXLAN_EN=1
  sudo mlxconfig -d <device> -y s IP_OVER_VXLAN_PORT=<port>

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-04-27 18:00:56 +01:00
Xueming Li
96c6c65a10 net/mlx5: support GRE tunnel flow
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-04-27 18:00:56 +01:00
Xueming Li
b43802b4bd net/mlx5: support 16 hardware priorities
This patch supports new 16 Verbs flow priorities by trying to create a
simple flow of priority 15. If 16 priorities not available, fallback to
traditional 8 priorities.

Verb priority mapping:
			8 priorities	>=16 priorities
Control flow:		4-7		8-15
User normal flow:	1-3		4-7
User tunnel flow:	0-2		0-3

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-04-27 18:00:56 +01:00
Ivan Malov
01764b20c2 net/sfc: convert to the advanced EFX RSS interface
The current code has the following drawbacks:
 - It is assumed that TCP 4-tuple hash is
   always supported, which is untrue in
   the case of packed stream FW variant.
 - The driver is unaware of UDP hash support
   available with latest firmware.

In order to cope with the mentioned issues, this
patch implements the new approach to handle hash
settings using the advanced EFX RSS interface.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:55 +01:00
Ivan Malov
d1482e21f0 net/sfc: factor out RSS fields from adapter info
RSS handling will need more sophisticated fields
in the adapter context storage in future patches.
This patch groups existing fields in a dedicated
structure and updates the rest of the code.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:55 +01:00
Ivan Malov
5e23c24988 net/sfc: remove conditional compilation for RSS
RSS is one of the most valuable features in the
driver, and one would hardly need to disable it
at build time. This patch withdraws unnecessary
conditionals for RSS snippets.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:55 +01:00
Ivan Malov
7803554a9e net/sfc: process RSS settings on Rx configure step
One may submit advanced RSS settings as part of
rte_eth_conf to customise RSS configuration from
the very beginning. Currently the driver does not
check that piece of settings and proceeds with
default choices for RSS hash functions and RSS key.

This patch implements the required processing.

Fixes: 4ec1fc3ba8 ("net/sfc: add basic stubs for RSS support on driver attach")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:55 +01:00
Ivan Malov
3c97590830 net/sfc/base: honour packed stream RSS restriction
Packed stream firmware variant on EF10 adapters has a
number of properties which must be taken into account:

 - Only one exclusive RSS context is available per port.
 - Only IP addresses can contribute to the hash value.

Huntington and Medford have one more limitation which
is important for the drivers capable of packed stream:

 - Hash algorithm is non-standard (i.e. non-Toeplitz).
   This implies XORing together source + destination
   IP addresses (or last four bytes in the case of IPv6)
   and using the result as the input to a Toeplitz hash.

This patch provides a number of improvements in order
to treat the mentioned limitations in the common code.

If the firmware variant is packed stream, the list of
supported hash tuples will include less variants, and
the maximum number of RSS contexts will be set to one.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:55 +01:00
Ivan Malov
7a1ab3f8db net/sfc/base: support more RSS hash configurations
Modern firmwares on EF10 adapters have support for
more traffic classes eligible for hash computation.
Also, it has become possible to adjust hashing per
individual class and select distinct packet fields
which will be able to contribute to the hash value.

This patch adds support for the mentioned features.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:55 +01:00
Ivan Malov
613cbe75ae net/sfc/base: add a new means to control RSS hash
Currently, libefx has no support for additional RSS modes
available with later controllers. In order to support this,
libefx should be able to list available hash configurations.

This patch provides basic infrastructure for the new interface.
The client drivers will be able to query the list of supported
hash configurations for a particular hash algorithm. Also, it
will be possible to configure hashing by means of new definitions.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:55 +01:00
Andrew Rybchenko
eff7d1d2dc net/sfc/base: cope with clang warning on negative shift
clang 4.0.1-6 on Ubuntu generates false positive warning that shift
is negative.  It is done regardless of the fact that the branch is
not taken because of previous check.

The warning is generate in EFX_INSERT_NATIVE32 used by
EFX_INSERT_FIELD_NATIVE32. All similar cases are fixed as well.

It is undesirable to suppress the warning completely.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:55 +01:00
Adrien Mazarguil
39b8dda700 ethdev: fix behavior of VF/PF in flow API
Contrary to all other pattern items, these are inconsistently documented as
affecting traffic instead of simply matching its origin, without provision
for the latter.

This commit clarifies documentation and updates PMDs since the original
behavior now has to be explicitly requested using the new transfer
attribute.

It breaks ABI compatibility for the following public functions:

- rte_flow_create()
- rte_flow_validate()

Impacted PMDs are bnxt and i40e, for which the VF pattern item is now only
supported when a transfer attribute is also present.

Fixes: b1a4b4cbc0 ("ethdev: introduce generic flow API")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2018-04-27 18:00:54 +01:00
Adrien Mazarguil
76e9a55b5b ethdev: add transfer attribute to flow API
This new attribute enables applications to create flow rules that do not
simply match traffic whose origin is specified in the pattern (e.g. some
non-default physical port or VF), but actively affect it by applying the
flow rule at the lowest possible level in the underlying device.

It breaks ABI compatibility for the following public functions:

- rte_flow_copy()
- rte_flow_create()
- rte_flow_validate()

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2018-04-27 18:00:54 +01:00
Adrien Mazarguil
e58638c324 ethdev: fix TPID handling in flow API
TPID handling in rte_flow VLAN and E_TAG pattern item definitions is not
consistent with the normal stacking order of pattern items, which is
confusing to applications.

Problem is that when followed by one of these layers, the EtherType field
of the preceding layer keeps its "inner" definition, and the "outer" TPID
is provided by the subsequent layer, the reverse of how a packet looks like
on the wire:

 Wire:     [ ETH TPID = A | VLAN EtherType = B | B DATA ]
 rte_flow: [ ETH EtherType = B | VLAN TPID = A | B DATA ]

Worse, when QinQ is involved, the stacking order of VLAN layers is
unspecified. It is unclear whether it should be reversed (innermost to
outermost) as well given TPID applies to the previous layer:

 Wire:       [ ETH TPID = A | VLAN TPID = B | VLAN EtherType = C | C DATA ]
 rte_flow 1: [ ETH EtherType = C | VLAN TPID = B | VLAN TPID = A | C DATA ]
 rte_flow 2: [ ETH EtherType = C | VLAN TPID = A | VLAN TPID = B | C DATA ]

While specifying EtherType/TPID is hopefully rarely necessary, the stacking
order in case of QinQ and the lack of documentation remain an issue.

This patch replaces TPID in the VLAN pattern item with an inner
EtherType/TPID as is usually done everywhere else (e.g. struct vlan_hdr),
clarifies documentation and updates all relevant code.

It breaks ABI compatibility for the following public functions:

- rte_flow_copy()
- rte_flow_create()
- rte_flow_query()
- rte_flow_validate()

Summary of changes for PMDs that implement ETH, VLAN or E_TAG pattern
items:

- bnxt: EtherType matching is supported with and without VLAN, but TPID
  matching is not and triggers an error.

- e1000: EtherType matching is only supported with the ETHERTYPE filter,
  which does not support VLAN matching, therefore no impact.

- enic: same as bnxt.

- i40e: same as bnxt with existing FDIR limitations on allowed EtherType
  values. The remaining filter types (VXLAN, NVGRE, QINQ) do not support
  EtherType matching.

- ixgbe: same as e1000, with additional minor change to rely on the new
  E-Tag macro definition.

- mlx4: EtherType/TPID matching is not supported, no impact.

- mlx5: same as bnxt.

- mvpp2: same as bnxt.

- sfc: same as bnxt.

- tap: same as bnxt.

Fixes: b1a4b4cbc0 ("ethdev: introduce generic flow API")
Fixes: 99e7003831 ("net/ixgbe: parse L2 tunnel filter")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:54 +01:00
Adrien Mazarguil
18aee2861a ethdev: add encap level to RSS flow API action
RSS hash types (ETH_RSS_* macros defined in rte_ethdev.h) describe the
protocol header fields of a packet that must be taken into account while
computing RSS.

When facing encapsulated (e.g. tunneled) packets, there is an ambiguity as
to whether these should apply to inner or outer packets. Applications need
the ability to tell exactly "where" RSS must be performed.

This is addressed by adding encapsulation level information to the RSS flow
action. Its default value is 0 and stands for the usual unspecified
behavior. Other values provide a specific encapsulation level.

Contrary to the change announced by commit 676b605182 ("doc: announce
ethdev API change for RSS configuration"), this patch does not affect
struct rte_eth_rss_conf but struct rte_flow_action_rss as the former is not
used anymore by the RSS flow action. ABI impact is therefore limited to
rte_flow.

This breaks ABI compatibility for the following public functions:

- rte_flow_copy()
- rte_flow_create()
- rte_flow_query()
- rte_flow_validate()

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:54 +01:00
Adrien Mazarguil
929e331934 ethdev: add hash function to RSS flow API action
By definition, RSS involves some kind of hash algorithm, usually Toeplitz.

Until now it could not be modified on a flow rule basis and PMDs had to
always assume RTE_ETH_HASH_FUNCTION_DEFAULT, which remains the default
behavior when unspecified (0).

This breaks ABI compatibility for the following public functions:

- rte_flow_copy()
- rte_flow_create()
- rte_flow_query()
- rte_flow_validate()

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:54 +01:00
Adrien Mazarguil
ac8d22de23 ethdev: flatten RSS configuration in flow API
Since its inception, the rte_flow RSS action has been relying in part on
external struct rte_eth_rss_conf for compatibility with the legacy RSS API.
This structure lacks parameters such as the hash algorithm to use, and more
recently, a method to tell which layer RSS should be performed on [1].

Given struct rte_eth_rss_conf will never be flexible enough to represent a
complete RSS configuration (e.g. RETA table), this patch supersedes it by
extending the rte_flow RSS action directly.

A subsequent patch will add a field to use a non-default RSS hash
algorithm. To that end, a field named "types" replaces the field formerly
known as "rss_hf" and standing for "RSS hash functions" as it was
confusing. Actual RSS hash function types are defined by enum
rte_eth_hash_function.

This patch updates all PMDs and example applications accordingly.

It breaks ABI compatibility for the following public functions:

- rte_flow_copy()
- rte_flow_create()
- rte_flow_query()
- rte_flow_validate()

[1] commit 676b605182 ("doc: announce ethdev API change for RSS
    configuration")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:53 +01:00
Adrien Mazarguil
19b3bc47c6 ethdev: fix C99 flexible arrays from flow API
This patch replaces C99-style flexible arrays in struct rte_flow_action_rss
and struct rte_flow_item_raw with standard pointers to the same data.

They proved difficult to use in the field (e.g. no possibility of static
initialization) and unsuitable for C++ applications.

Affected PMDs and examples are updated accordingly.

This breaks ABI compatibility for the following public functions:

- rte_flow_copy()
- rte_flow_create()
- rte_flow_query()
- rte_flow_validate()

Fixes: b1a4b4cbc0 ("ethdev: introduce generic flow API")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-04-27 18:00:53 +01:00
Adrien Mazarguil
cc17feb904 ethdev: alter behavior of flow API actions
This patch makes the following changes to flow rule actions:

- List order now matters, they are redefined as performed first to last
  instead of "all simultaneously".

- Repeated actions are now supported (e.g. specifying QUEUE multiple times
  now duplicates traffic among them). Previously only the last action of
  any given kind was taken into account.

- No more distinction between terminating/non-terminating/meta actions.
  Flow rules themselves are now defined as always terminating unless a
  PASSTHRU action is specified.

These changes alter the behavior of flow rules in corner cases in order to
prepare the flow API for actions that modify traffic contents or properties
(e.g. encapsulation, compression) and for which order matter when combined.

Previously one would have to do so through multiple flow rules by combining
PASSTRHU with priority levels, however this proved overly complex to
implement at the PMD level, hence this simpler approach.

This breaks ABI compatibility for the following public functions:

- rte_flow_create()
- rte_flow_validate()

PMDs with rte_flow support are modified accordingly:

- bnxt: no change, implementation already forbids multiple actions and does
  not support PASSTHRU.

- e1000: no change, same as bnxt.

- enic: modified to forbid redundant actions, no support for default drop.

- failsafe: no change needed.

- i40e: no change, implementation already forbids multiple actions.

- ixgbe: same as i40e.

- mlx4: modified to forbid multiple fate-deciding actions and drop when
  unspecified.

- mlx5: same as mlx4, with other redundant actions also forbidden.

- sfc: same as mlx4.

- tap: implementation already complies with the new behavior except for
  the default pass-through modified as a default drop.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:53 +01:00
Zijie Pan
98e60c0d43 net/i40e: add module EEPROM callbacks for i40e
Add new callbacks for eth_dev_ops of i40e to get the information
and data of plugin module eeprom.

Signed-off-by: Zijie Pan <zijie.pan@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2018-04-27 18:00:53 +01:00
Zijie Pan
40ff8b305a net/e1000: add module EEPROM callbacks for e1000
Add new callbacks for eth_dev_ops of e1000 to get the information and
data of plugin module EEPROM.

Signed-off-by: Zijie Pan <zijie.pan@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2018-04-27 18:00:53 +01:00
Zijie Pan
b74d0cd43e net/ixgbe: add module EEPROM callbacks for ixgbe
Add new callbacks for eth_dev_ops of ixgbe to get the information
and data of plugin module eeprom.

Signed-off-by: Zijie Pan <zijie.pan@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2018-04-27 18:00:53 +01:00
Thomas Monjalon
fa47405cc1 ethdev: remove experimental flag of ports enumeration
The basic operations for ports enumeration should not be
considered as experimental in DPDK 18.05.

The iterator RTE_ETH_FOREACH_DEV was introduced in DPDK 17.05.
It uses the function the rte_eth_find_next_owned_by() to get
only ownerless ports. Its API can be considered stable.
So the flag experimental is removed from rte_eth_find_next_owned_by().

The flag experimental is removed from rte_eth_dev_count_avail()
which is the new name of the old function rte_eth_dev_count().

The flag experimental is set to rte_eth_dev_count_total()
in the .c file for consistency with the declaration in the .h file.

A lot of internal applications are fixed to not allow experimental API.

Fixes: 8728ccf376 ("fix ethdev ports enumeration")
Fixes: d9a42a69fe ("ethdev: deprecate port count function")
Fixes: e70e26861e ("net/mvpp2: fix build")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: David Marchand <david.marchand@6wind.com>
2018-04-27 18:00:24 +01:00
Xueming Li
3d140329ca net/mlx5: allow max 192B TSO inline header length
Change max inline header length to 192B to allow IPv6 VXLAN TSO headers
and header with options that more than 128B.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-04-27 17:34:43 +01:00
Xueming Li
5f8ba81c42 net/mlx5: support generic tunnel offloading
This commit adds support for generic tunnel TSO and checksum offload.
PMD will compute the inner/outer headers offset according to the
mbuf fields. Hardware will do calculation based on offsets and types.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-04-27 17:34:43 +01:00
Xueming Li
593f472c40 net/mlx5: separate TSO function in Tx data path
Separate TSO function to make logic of mlx5_tx_burst clear.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-04-27 17:34:43 +01:00
Nélio Laranjeiro
e0586a8d1e net/mlx5: implement multicast add list devop
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-04-27 17:34:43 +01:00
Nélio Laranjeiro
18c01b98b5 net/mlx5: split MAC address add/remove code
Move some code in DPDK callbacks to add/remove MAC addresses to internal
function.  This modification will be necessary to handle implement the
devop set_mc_addr_list.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-04-27 17:34:43 +01:00
Nélio Laranjeiro
fa80b3c9ed net/mlx5: add more checks on MAC addresses
Verify MAC address before further process.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-04-27 17:34:43 +01:00
Ferruh Yigit
18869f97f1 drivers/net: fix link autoneg value for virtual PMDs
These drivers never attempt link speed negotiation. Change link_autoneg
value to ETH_LINK_FIXED to be more accurate and consistent between PMDs.

Fixes: 1e3a958f40 ("ethdev: fix link autonegotiation value")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-04-27 17:34:43 +01:00
Sunil Kumar Kori
175fe7d9eb net/dpaa2: fix the ethdev offload checks
Fixes: 0ebce6129b ("net/dpaa2: support new ethdev offload APIs")

Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-04-27 17:34:42 +01:00
Sunil Kumar Kori
c58362184a net/dpaa: fix the ethdev offload checks
Fixes: 16e2c27f4f ("net/dpaa: support new ethdev offload APIs")

Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
2018-04-27 17:34:42 +01:00
Ferruh Yigit
6db80eb7c9 net/tap: fix icc build
build error:
.../dpdk/drivers/net/tap/rte_eth_tap.c(598):
error #279: controlling expression is constant
	RTE_ASSERT(!"unsupported request type: must not happen");

Although RTE_ASSERT helps debugging this issue when assert enabled,
constant expression in assert means this path can be taken during
runtime and there is no protection against it when assert is disabled.

Adding error log and error return back, replacing RTE_ASSERT.

Fixes: 7748a4b441 ("net/tap: add debug messages")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2018-04-27 17:34:42 +01:00
Matan Azrad
49dad9028e net/bonding: support flow API
Ethernet devices which are grouped by bonding PMD, aka slaves, are
sharing the same queues and RSS configurations and their Rx burst
functions must be managed by the bonding PMD according to the bonding
architecture.

So, it makes sense to configure the same flow rules for all the bond
slaves to allow consistency in packet flow management.

Add rte flow support to the bonding PMD to manage all flow
configuration to the bonded slaves.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2018-04-27 17:34:42 +01:00
Qi Zhang
a3c83a2527 net/i40e: enable runtime queue setup
Expose the runtime queue configuration capability and enhance
i40e_dev_[rx|tx]_queue_setup to handle the situation when
device already started.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-04-27 17:34:42 +01:00
Alejandro Lucero
0c0e46c36b net/nfp: fix mbufs releasing when stop or close
PMDs have the responsibility of releasing mbufs sent through xmit burst
function. NFP PMD attaches those sent mbufs to the TX ring structure,
and it is at the next time a specific ring descriptor is going to be
used when the previous linked mbuf, already transmitted at that point,
is released. Those mbufs belonging to a chained mbuf got its own link
to a ring descriptor, and they are released independently of the mbuf
head of that chain.

The problem is how those mbufs are released when the PMD is stopped or
closed. Instead of releasing those mbufs as the xmit functions does,
this is independently of being in a mbuf chain, the code calls
rte_pktmbuf_free which will release not just the mbuf head in that
chain but all the chained mbufs. The loop will try to release those
mbufs which have already been released again when chained mbufs exist.

This patch fixes the problem using rte_pktmbuf_free_seg instead.

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

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2018-04-27 17:34:42 +01:00
Matan Azrad
4205da3a47 net/vdev_netvsc: prefer netvsc devices in scan
There is an option to run a non-netvsc device as a netvsc device only
when the "force" parameter is set to 1 in the EAL command line.
Consequently, more than one device may be found to be matching the
"mac" parameter specifying the device.

Prefer netvsc devices to be scanned before any non-netvsc device, even
when the "force" parameter is set.

Cc: stable@dpdk.org

Signed-off-by: Matan Azrad <matan@mellanox.com>
2018-04-27 17:34:42 +01:00
Matan Azrad
118d2f8096 net/vdev_netvsc: add check for specifying by 1 way
There are now 2 ways to specify a netvsc device by the EAL command
line - either by the interface name or by the MAC address.

The user should not specify a netvsc device using more than 1 way,
Thus, if a device is specified in more than 1 way, the driver stops
to probe it.

Validate it in the driver initialization.

Cc: stable@dpdk.org

Signed-off-by: Matan Azrad <matan@mellanox.com>
2018-04-27 17:34:42 +01:00
Matan Azrad
0b39cc820a net/vdev_netvsc: remove specified devices IP check
If the netvsc driver starts in blacklist mode, it does not
automatically probe IP associated netvsc devices. Therefore, the only
way to probe them is to specify them by the EAL command line, using the
"force" parameter to skip the IP check in the driver.

>From now on, the user does not need to add the "force" parameter if he
specifies an IP associated netvsc device by the EAL command line, and the
responsibility of the IP check is now in the user's hands.

However, in the absence of any specification, the driver still skips IP
associated netvsc devices.

Cc: stable@dpdk.org

Signed-off-by: Matan Azrad <matan@mellanox.com>
2018-04-27 17:34:42 +01:00
Ophir Munk
519fb2858e net/vdev_netvsc: shorten devices names
Prior to this commit the vdev_netvsc PMD was creating tap and failsafe
devices with long names, such as "net_tap_net_vdev_netvsc0" or
"net_failsafe_net_vdev_netvsc0".
This commits creates tap and failsafe devices with short names such as
"net_tap_netvsc0" or "net_failsafe_netvsc0".

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2018-04-27 17:34:42 +01:00
Ophir Munk
7eae645a3b net/failsafe: add TCP TSO default Tx capability
Add DEV_TX_OFFLOAD_TCP_TSO to failsafe Tx offload default capabilities.
The net result of failsafe Tx capabilities is the logical AND of Tx
capabilities among all failsafe sub_devices and failsafe own default
capabilities.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2018-04-27 17:34:41 +01:00
Yangchao Zhou
58c18bc114 net/bnx2x: reserve enough headroom for mbuf prepend
When allocating a new mbuf for Rx, the value of m->data_off should be
reset to its default value (RTE_PKTMBUF_HEADROOM), instead of reusing
the previous undefined value, which could cause the packet to have a
too small or too high headroom.

Signed-off-by: Yangchao Zhou <zhouyates@gmail.com>
Acked-by: Harish Patil <harish.patil@cavium.com>
2018-04-27 17:34:41 +01:00
Didier Pallard
d863f19efa net/vmxnet3: skip empty segments in transmission
Packets containing empty segments are dropped by hypervisor, prevent
this case by skipping empty segments in transmission.
Also drop empty mbufs to be sure that at least one segment is transmitted
for each mbuf.

Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Acked-by: Yong Wang <yongwang@vmware.com>
2018-04-27 17:34:41 +01:00
Didier Pallard
595d08d105 net/vmxnet3: ignore empty segments in reception
When several TCP fragments are contained in a packet that is only one mbuf
segment long, vmxnet3 receives an empty segment following first one, that
contains offload information. In current version, this segment is
propagated as is to upper application.
Remove those empty segments directly when receiving buffers, they may
generate unneeded extra processing in the upper application.

Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Acked-by: Yong Wang <yongwang@vmware.com>
2018-04-27 17:34:41 +01:00
Didier Pallard
ae2705b80d net/vmxnet3: guess MSS if not provided in LRO mode
Not so old variants of vmxnet3 do not provide MSS value along with
LRO packet. When this case happens, try to guess MSS value with
information at hand.

Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Acked-by: Yong Wang <yongwang@vmware.com>
2018-04-27 17:34:41 +01:00
Didier Pallard
73c1f32c96 net/vmxnet3: complete Rx offloads support
Add support for IPv6, LRO and properly set packet type in all
supported cases.

Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Acked-by: Yong Wang <yongwang@vmware.com>
2018-04-27 17:34:41 +01:00
Didier Pallard
d08e3c90d4 net/vmxnet3: fix Rx offload information in multiseg packets
In case we are working on a multisegment buffer, most bit are set
in last segment of the buffer. Correctly look at those bits in eop part
of the rx_offload function.

Fixes: 2fdd835f99 ("vmxnet3: support jumbo frames")
Cc: stable@dpdk.org

Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Acked-by: Yong Wang <yongwang@vmware.com>
2018-04-27 17:34:41 +01:00
Didier Pallard
5e5ac26f95 net/vmxnet3: gather offload data on first and last segment
Offloads are split between first and last segment of a packet.
Call a single vmxnet3_rx_offload function that will contain all
offload operations. This patch does not introduce any code modification.

Pass a vmxnet3_hw as parameter to the function, it is not presently
used in this patch, but will be later used for TSO offloads.

Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Acked-by: Yong Wang <yongwang@vmware.com>
2018-04-27 17:34:41 +01:00
Didier Pallard
0fbb05bbe3 net/vmxnet3: return unknown IPv4 extension len ptype
Rather than parsing IP header to get proper ptype to return, just return
RTE_PTYPE_L3_IPV4_EXT_UNKNOWN, that tells application that we have an IP
packet with unknown header length.

Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Acked-by: Yong Wang <yongwang@vmware.com>
2018-04-27 17:34:41 +01:00
Nélio Laranjeiro
3c0db1ab51 net/mlx5: fix flow director mask
During the transition to resurrect flow director on top of rte_flow, mask
handling was removed by mistake.

Fixes: 4c3e9bcdd5 ("net/mlx5: support flow director")
Cc: stable@dpdk.org

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2018-04-27 17:34:41 +01:00
Nélio Laranjeiro
ca42b8a8b7 net/mlx5: split L3/L4 in flow director
This will help to bring back the mask handler which was removed when this
feature was rewritten on top of rte_flow.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2018-04-27 17:34:40 +01:00
Xueming Li
2323cc3c2e net/mlx5: fix invalid flow item check
This patch fixed invalid flow item check.

Fixes: a6d83b6a92 ("net/mlx5: standardize on negative errno values")

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-04-27 17:34:00 +01:00
Yongseok Koh
96525b9e19 net/mlx4: fix alignment of memory region
The memory region is [start, end), so if the memseg of 'end' isn't
allocated yet, the returned memseg will have zero entries and this will
make 'end' zero (nil).

Fixes: c2fe582322 ("net/mlx4: use virt2memseg instead of iteration")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2018-04-27 15:54:56 +01:00
Yongseok Koh
a2ceae5940 net/mlx5: fix alignment of memory region
The memory region is [start, end), so if the memseg of 'end' isn't
allocated yet, the returned memseg will have zero entries and this will
make 'end' zero (nil).

Fixes: 718e35999c ("net/mlx5: use virt2memseg instead of iteration")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-04-27 15:54:56 +01:00
Ajit Khaparde
c4fed4ff4f net/bnxt: fix mbuf data offset initialization
Initialize mbuf->data_off to RTE_PKTMBUF_HEADROOM after allocation.
Without this, it might be possible that the DMA address provided
to the HW may not be in sync to what is indicated to the application
in bnxt_rx_pkt.

Fixes: 2eb53b134a ("net/bnxt: add initial Rx code")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-04-27 15:54:56 +01:00
Ajit Khaparde
1b533790f4 net/bnxt: avoid invalid vnic id in set L2 Rx mask
In some cases bnxt_hwrm_cfa_l2_set_rx_mask is being called before
VNICs are allocated. The FW returns an error in such cases.
Move bnxt_init_nic to bnxt_dev_init such that the ids are initialized
to an invalid id.
Prevent sending the command to the FW only with a valid vnic id.

Fixes: 244bc98b0d ("net/bnxt: set L2 Rx mask")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-04-27 15:54:56 +01:00
Ajit Khaparde
e3d8f1e6a6 net/bnxt: cache address of doorbell to subsequent access
While creating TX, Rx, CQ rings use cached DB address instead of
getting it from the PCI memory resource.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-04-27 15:54:56 +01:00
Chas Williams
3a14b29bff net/vmxnet3: keep link state consistent
The vmxnet3 never attempts link speed negotiation.  As a virtual device
the link speed is vague at best.  However, it is important for certain
applications, like bonding, to see a consistent link_status.  802.3ad
requires that only links of the same cost (link speed) be enslaved.
Keeping the link status consistent in vmxnet3 avoids races with bonding
enslavement.

Fixes: 1e3a958f40 ("ethdev: fix link autonegotiation value")
Cc: stable@dpdk.org

Signed-off-by: Chas Williams <chas3@att.com>
Acked-by: Yong Wang <yongwang@vmware.com>
2018-04-27 15:54:56 +01:00
Ferruh Yigit
3fef0822ec drivers/net: update link status
Update link status related feature document items and minor updates in
some link status related functions.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2018-04-27 15:54:56 +01:00
Junjie Chen
8ccb7d6726 net/vhost: update license to SPDX format
Update license to SPDX, also add Intel license.

Signed-off-by: Junjie Chen <junjie.j.chen@intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Takanari Hayama <taki@igel.co.jp>
2018-04-27 15:54:56 +01:00
Shraddha Joshi
b7f6077374 net/vmxnet3: increase Rx data ring descriptor size
Vmxnet3 driver supports receive data ring viz. a set of small sized
buffers that are always mapped by the emulation. If a packet fits into
the receive data ring buffer, the emulation delivers the packet via the
receive data ring.

Increasing the receive data ring descriptor size from 128 to 256
showed performance gains as high as 5% for packets smaller than 256.

Signed-off-by: Shraddha Joshi <jshraddha@vmware.com>
Acked-by: Jin Heo <heoj@vmware.com>
Acked-by: Guolin Yang <gyang@vmware.com>
Acked-by: Boon Ang <bang@vmware.com>
Acked-by: Yong Wang <yongwang@vmware.com>
2018-04-27 15:54:56 +01:00
Rasesh Mody
84785018d0 net/bnx2x: make init and driver logtype names consistent
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
2018-04-27 15:54:56 +01:00
Rasesh Mody
66ba596aa6 net/bnx2x: fix for PCI FLR after ungraceful exit
This patch provides a fix for PCI function level reset after an
ungraceful exit from an application. The fix is to enable internal
target read as part of device attach before getting device information
from device config space, device itself and shared memory. In addition
to that, add a 200ms delay for the recovery flow to complete.

Fixes: 540a211084 ("bnx2x: driver core")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
2018-04-27 15:54:56 +01:00