dpdk.git
7 years agonet/mlx4: group flow API handlers in common file
Adrien Mazarguil [Fri, 1 Sep 2017 08:07:01 +0000 (10:07 +0200)]
net/mlx4: group flow API handlers in common file

Only the common filter control operation callback needs to be exposed.

No impact on functionality.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: separate Rx configuration functions
Adrien Mazarguil [Fri, 1 Sep 2017 08:07:00 +0000 (10:07 +0200)]
net/mlx4: separate Rx configuration functions

Private functions are now prefixed with "mlx4_" to prevent them from
conflicting with their mlx5 PMD counterparts at link time.

No impact on functionality.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: separate Tx configuration functions
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:59 +0000 (10:06 +0200)]
net/mlx4: separate Tx configuration functions

Private functions are now prefixed with "mlx4_" to prevent them from
conflicting with their mlx5 PMD counterparts at link time.

No impact on functionality.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: separate device control functions
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:58 +0000 (10:06 +0200)]
net/mlx4: separate device control functions

Private functions are now prefixed with "mlx4_" to prevent them from
conflicting with their mlx5 PMD counterparts at link time.

No impact on functionality.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: separate Rx/Tx functions
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:57 +0000 (10:06 +0200)]
net/mlx4: separate Rx/Tx functions

This commit groups all data plane functions (Rx/Tx) into a separate file
and adjusts header files accordingly.

Private functions are now prefixed with "mlx4_" to prevent them from
conflicting with their mlx5 PMD counterparts at link time.

No impact on functionality.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: separate Rx/Tx definitions
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:56 +0000 (10:06 +0200)]
net/mlx4: separate Rx/Tx definitions

Except for a minor documentation update on internal structure definitions
to make them more Doxygen-friendly, there is no impact on functionality.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: separate interrupt handling
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:55 +0000 (10:06 +0200)]
net/mlx4: separate interrupt handling

Private functions are now prefixed with "mlx4_" to prevent them from
conflicting with their mlx5 PMD counterparts at link time.

No impact on functionality.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: compact interrupt functions
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:54 +0000 (10:06 +0200)]
net/mlx4: compact interrupt functions

Link status (LSC) and removal (RMV) interrupts share a common handler and
are toggled simultaneously from common install/uninstall functions.

Four additional wrapper functions (two for each interrupt type) are
currently necessary because the PMD maintains an internal configuration
state for interrupts (priv->intr_conf).

This complexity can be avoided entirely since the PMD does not disable
interrupts configuration parameters in case of error anymore.

With this commit, only two functions are necessary to toggle interrupts
(including Rx) during start/stop cycles.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: clean up interrupt functions prototypes
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:53 +0000 (10:06 +0200)]
net/mlx4: clean up interrupt functions prototypes

The naming scheme for these functions is overly verbose and not accurate
enough, with too many "handler" functions that are difficult to
differentiate (e.g. mlx4_dev_link_status_handler(),
mlx4_dev_interrupt_handler() and priv_dev_status_handler()).

This commit renames them and removes the unnecessary dev argument which can
be retrieved through the private structure where needed. Documentation is
updated accordingly.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: refactor interrupt FD settings
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:52 +0000 (10:06 +0200)]
net/mlx4: refactor interrupt FD settings

File descriptors used for interrupts processing must be made non-blocking.

Doing so as soon as they are opened instead of waiting until they are
needed is more efficient as it avoids performing redundant system calls and
run through their associated error-handling code later on.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: rename alarm field
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:51 +0000 (10:06 +0200)]
net/mlx4: rename alarm field

Make clear this field is related to interrupt handling.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: use a single interrupt handle
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:50 +0000 (10:06 +0200)]
net/mlx4: use a single interrupt handle

The reason one interrupt handle is currently used for RMV/LSC events and
another one for Rx traffic is because these come from distinct file
descriptors.

This can be simplified however as Rx interrupt file descriptors are stored
elsewhere and are registered separately.

Modifying the interrupt handle type to RTE_INTR_HANDLE_UNKNOWN has never
been necessary as disabling interrupts is actually done by unregistering
the associated callback (RMV/LSC) or emptying the EFD array (Rx). Instead,
make clear that the base handle file descriptor is invalid by setting it to
-1 when disabled.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: separate debugging macros
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:49 +0000 (10:06 +0200)]
net/mlx4: separate debugging macros

The new definitions also rely on the existing DPDK logging subsystem
instead of using fprintf() directly.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: use standard macro to get array size
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:48 +0000 (10:06 +0200)]
net/mlx4: use standard macro to get array size

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: remove mbuf macro definitions
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:47 +0000 (10:06 +0200)]
net/mlx4: remove mbuf macro definitions

These were originally used for compatibility between DPDK releases when
this PMD was built out of tree.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: remove unnecessary wrapper functions
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:46 +0000 (10:06 +0200)]
net/mlx4: remove unnecessary wrapper functions

Wrapper functions whose main purpose was to take a lock on the private
structure are no longer needed since this lock does not exist anymore.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: remove control path locks
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:45 +0000 (10:06 +0200)]
net/mlx4: remove control path locks

Concurrent use of various control path functions (e.g. configuring a queue
and destroying it simultaneously) may lead to undefined behavior.

PMD are not supposed to protect themselves from misbehaving applications,
and mlx4 is one of the few with internal locks on most control path
operations. This adds unnecessary complexity.

Leave this role to wrapper functions in ethdev.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: clean up coding style inconsistencies
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:44 +0000 (10:06 +0200)]
net/mlx4: clean up coding style inconsistencies

This addresses badly formatted comments and needless empty lines before
refactoring functions into different files.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: standardize on negative errno values
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:43 +0000 (10:06 +0200)]
net/mlx4: standardize on negative errno values

Due to its reliance on system calls, the mlx4 PMD uses positive errno
values internally and negative ones at the ethdev API border. Although most
internal functions are documented, this mixed design is unusual and prone
to mistakes (e.g. flow API implementation uses negative values
exclusively).

Standardize on negative errno values and rely on rte_errno instead of
errno in all functions.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: simplify link update function
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:42 +0000 (10:06 +0200)]
net/mlx4: simplify link update function

Returning a different value when the current link status differs from the
previous one was probably useful at some point in the past but is now
meaningless; this value is ignored both internally (mlx4 PMD) and
externally (ethdev wrapper).

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: simplify Rx buffer handling
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:41 +0000 (10:06 +0200)]
net/mlx4: simplify Rx buffer handling

Thanks to the fact the PMD temporarily uses a slower interface for Rx,
removing the WR ID hack to instead store mbuf pointers directly makes the
code simpler at no extra cost.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: revert fast verbs interface for Rx
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:40 +0000 (10:06 +0200)]
net/mlx4: revert fast verbs interface for Rx

This reverts commit acac55f164128fc76da8d93cae1e8c1e560e99f6.

"Fast Verbs" is a nonstandard experimental interface that must be reverted
for compatibility reasons. Its replacement is slower but temporary,
performance will be restored by a subsequent commit through an enhanced
data path implementation. This one focuses on maintaining basic
functionality in the meantime.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: revert fast verbs interface for Tx
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:39 +0000 (10:06 +0200)]
net/mlx4: revert fast verbs interface for Tx

This reverts commit 9980f81dc2623291b89cf1c281a6a9f116fd2394.

"Fast Verbs" is a nonstandard experimental interface that must be reverted
for compatibility reasons. Its replacement is slower but temporary,
performance will be restored by a subsequent commit through an enhanced
data path implementation. This one focuses on maintaining basic
functionality in the meantime.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: revert multicast echo prevention
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:38 +0000 (10:06 +0200)]
net/mlx4: revert multicast echo prevention

This reverts commit 8b3ffe95e75d6d305992505005cbb95969874a15.

Multicast loopback prevention is not part of the standard Verbs interface.
Remove it temporarily.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: revert resource domain support
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:37 +0000 (10:06 +0200)]
net/mlx4: revert resource domain support

This reverts commit 3e49c148b715c3c0a12c1200295bb9b312f7028e.

Resource domains are not part of the standard Verbs interface. The
performance improvement they bring will be restored later through a
different data path implementation.

This commit makes the PMD not rely on the non-standard QP allocation
interface.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: use standard QP attributes
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:36 +0000 (10:06 +0200)]
net/mlx4: use standard QP attributes

The Verbs API used to set QP attributes is deprecated. Revert to the
standard API since it actually supports the remaining ones.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: drop inline receive support
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:35 +0000 (10:06 +0200)]
net/mlx4: drop inline receive support

The Verbs API used to implement inline receive is deprecated.
Support will be added back after refactoring the PMD.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: drop scatter/gather support
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:34 +0000 (10:06 +0200)]
net/mlx4: drop scatter/gather support

The Verbs API used to implement Tx and Rx burst functions is deprecated.
Drop scatter/gather support to ease refactoring while maintaining basic
single-segment Rx/Tx functionality in the meantime.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: drop packet type recognition support
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:33 +0000 (10:06 +0200)]
net/mlx4: drop packet type recognition support

The Verbs API used to implement packet type recognition is deprecated.
Support will be added back after refactoring the PMD.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: drop checksum offloads support
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:32 +0000 (10:06 +0200)]
net/mlx4: drop checksum offloads support

The Verbs API used to implement Tx and Rx checksum offloads is deprecated.
Support for these will be added back after refactoring the PMD.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: drop RSS support
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:31 +0000 (10:06 +0200)]
net/mlx4: drop RSS support

The Verbs RSS API used in this PMD is now obsolete. It is superseded by an
enhanced API with fewer constraints already used in the mlx5 PMD.

Drop RSS support in preparation for a major refactoring. The ability to
configure several Rx queues is retained, these can be targeted directly by
creating specific flow rules.

There is no need for "ignored" Rx queues anymore since their number is no
longer limited to powers of two.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: revert RSS parent queue refactoring
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:30 +0000 (10:06 +0200)]
net/mlx4: revert RSS parent queue refactoring

This reverts commit ff00a0dc5600dbb0a29e4aa7fa4b078f98c7a360.

Support for several RSS parent queues was necessary to implement the RSS
flow rule action, dropped in a prior commit.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: revert flow API RSS support
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:29 +0000 (10:06 +0200)]
net/mlx4: revert flow API RSS support

This reverts commit d7769c7c08cc08a9d1bc4e40b95524d9697707d9.

Existing RSS features rely on experimental Verbs provided by Mellanox OFED.

In order to replace this dependency with standard distribution packages,
RSS support must be temporarily removed to be re-implemented using a
different API.

Removing support for the RSS flow rule action is the first step toward this
goal.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: drop MAC flows affecting all Rx queues
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:28 +0000 (10:06 +0200)]
net/mlx4: drop MAC flows affecting all Rx queues

Configuring several Rx queues enables RSS, which causes an additional
special parent queue to be created to manage them.

MAC flows are associated with the queue supposed to receive packets; either
the parent one in case of RSS or the single orphan otherwise.

For historical reasons the current implementation supports another scenario
with multiple orphans, in which case MAC flows are configured on all of
them. This is harmless but useless since it cannot happen.

Removing this feature allows dissociating the remaining MAC flow from Rx
queues and store it inside the private structure where it belongs.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: remove MAC address configuration support
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:27 +0000 (10:06 +0200)]
net/mlx4: remove MAC address configuration support

Only the default port MAC address remains and is not configurable.
This is done in preparation for a major refactoring.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: remove VLAN filter support
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:26 +0000 (10:06 +0200)]
net/mlx4: remove VLAN filter support

This is done in preparation for a major refactoring.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: remove allmulti and promisc support
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:25 +0000 (10:06 +0200)]
net/mlx4: remove allmulti and promisc support

This is done in preparation for a major refactoring.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: remove Tx inline compilation option
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:24 +0000 (10:06 +0200)]
net/mlx4: remove Tx inline compilation option

This should be a run-time parameter.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: remove scatter mode compilation option
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:23 +0000 (10:06 +0200)]
net/mlx4: remove scatter mode compilation option

This option both sets the maximum number of segments for Rx/Tx packets and
whether scattered mode is supported at all. This commit removes the latter
as well as configuration file exposure since the most appropriate value
should be decided at run-time.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: remove soft counters compilation option
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:22 +0000 (10:06 +0200)]
net/mlx4: remove soft counters compilation option

Software counters are mandatory since hardware counters are not
implemented.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: remove useless code
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:21 +0000 (10:06 +0200)]
net/mlx4: remove useless code

Less code makes refactoring easier. No impact on functionality.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: remove secondary process support
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:20 +0000 (10:06 +0200)]
net/mlx4: remove secondary process support

Current implementation is partial (Tx only), not convenient to use and
not of primary concern.

Remove this feature before refactoring the PMD.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: remove useless compilation checks
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:19 +0000 (10:06 +0200)]
net/mlx4: remove useless compilation checks

Verbs support for RSS, inline receive and extended device query calls has
not been optional for a while. Their absence is untested and is therefore
unsupported.

Remove the related compilation checks and assume Mellanox OFED is up to
date, as described in the documentation.

Use this opportunity to remove a few useless data path debugging messages
behind compilation checks on never defined macros.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: check max number of ports dynamically
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:18 +0000 (10:06 +0200)]
net/mlx4: check max number of ports dynamically

Use maximum number reported by hardware capabilities as replacement for the
static check on MLX4_PMD_MAX_PHYS_PORTS.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
7 years agonet/mlx4: remove limitation on number of instances
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:17 +0000 (10:06 +0200)]
net/mlx4: remove limitation on number of instances

The seemingly artificial limitation on the maximum number of instances for
this PMD is an historical leftover that predates its first public release.

It was used as a workaround to support multiple physical ports on a PCI
device exposing a single bus address when mlx4 was implemented directly as
an Ethernet device driver instead of a PCI driver spawning Ethernet
devices.

Getting rid of it simplifies device initialization.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: add consistency to copyright notices
Adrien Mazarguil [Fri, 1 Sep 2017 08:06:16 +0000 (10:06 +0200)]
net/mlx4: add consistency to copyright notices

Copyright lasts long enough not to require notices to be updated yearly.

The current approach of updating them occasionally while working on
unrelated tasks should be deprecated in favor of dedicated commits updating
all files at once when necessary.

Standardize on a single year per copyright owner.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agodoc: add i40e firmware upgrade guide
Qiming Yang [Tue, 15 Aug 2017 03:26:55 +0000 (11:26 +0800)]
doc: add i40e firmware upgrade guide

This patch adds link to the DPDK i40e doc,
which is how to upgrade firmware guide for users.

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agonet/af_packet: support Tx scattered mbuf input
Wenfeng Liu [Mon, 7 Aug 2017 09:45:38 +0000 (09:45 +0000)]
net/af_packet: support Tx scattered mbuf input

Signed-off-by: Wenfeng Liu <liuwf@arraynetworks.com.cn>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agonet/sfc: support flow API RSS action
Ivan Malov [Wed, 30 Aug 2017 18:17:41 +0000 (19:17 +0100)]
net/sfc: support flow API RSS action

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
7 years agonet/sfc: use RSS key size define from base driver
Andrew Rybchenko [Wed, 30 Aug 2017 18:17:40 +0000 (19:17 +0100)]
net/sfc: use RSS key size define from base driver

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
7 years agonet/sfc/base: add RSS key size define
Ivan Malov [Wed, 30 Aug 2017 18:17:39 +0000 (19:17 +0100)]
net/sfc/base: add RSS key size define

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
7 years agonet/sfc/base: add API to set an RSS context for a filter
Mark Spender [Wed, 30 Aug 2017 18:17:38 +0000 (19:17 +0100)]
net/sfc/base: add API to set an RSS context for a filter

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
7 years agonet/sfc/base: update RSS API to take RSS context parameter
Mark Spender [Wed, 30 Aug 2017 18:17:37 +0000 (19:17 +0100)]
net/sfc/base: update RSS API to take RSS context parameter

Update efx_rx_scale_mode_set(), efx_rx_scale_key_set()
and efx_rx_scale_tbl_set().

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
7 years agonet/sfc/base: add API to allocate and free RSS contexts
Mark Spender [Wed, 30 Aug 2017 18:17:36 +0000 (19:17 +0100)]
net/sfc/base: add API to allocate and free RSS contexts

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
7 years agonet/sfc/base: rename API to check Rx scale and hash support
Mark Spender [Wed, 30 Aug 2017 18:17:35 +0000 (19:17 +0100)]
net/sfc/base: rename API to check Rx scale and hash support

Rename efx_rx_scale_support_get() to efx_rx_scale_default_support_get(),
and efx_rx_hash_support_get() to efx_rx_hash_default_support_get().

All these really report is whether an exclusive RSS context was
successfully acquired at efx_rx_init().

efx_rx_scale_support_get() sounds like it reports whether the device
supports RSS, and whether exclusive or shared contexts are supported,
but it doesn't do that. Renaming it to
efx_rx_scale_default_support_get() helps to reflect that it reports
what RSS support the client gets without trying to allocate RSS
contexts itself.

Also rename efx_rx_scale_support_t to efx_rx_scale_context_type_t, to
make the enum more suitable for specifying the type of an RSS context
to be allocated.

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
7 years agonet/sfc/base: add the max number of RSS exclusive contexts
Mark Spender [Wed, 30 Aug 2017 18:17:34 +0000 (19:17 +0100)]
net/sfc/base: add the max number of RSS exclusive contexts

The patch adds enc_rx_scale_max_exclusive_contexts member
to nic_cfg_t structure and sets the corresponding values
for Siena, Huntington and Medford

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
7 years agonet/sfc/base: fix default RSS context check on Siena
Mark Spender [Wed, 30 Aug 2017 18:17:33 +0000 (19:17 +0100)]
net/sfc/base: fix default RSS context check on Siena

Default RSS context check is carried out during filter
insertion on Siena and it needs to be fixed

Fixes: f7dc06bf35f21 ("net/sfc/base: import 5xxx/6xxx family support")
Cc: stable@dpdk.org
Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
7 years agonet/sfc/base: define a handle to denote default RSS context
Mark Spender [Wed, 30 Aug 2017 18:17:32 +0000 (19:17 +0100)]
net/sfc/base: define a handle to denote default RSS context

Make the existing filter-specific define more general.
This is the same as MC_CMD_RSS_CONTEXT_ALLOC_OUT_RSS_CONTEXT_ID_INVALID.

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
7 years agonet/sfc: fix unused variable in RSS-agnostic build
Ivan Malov [Wed, 30 Aug 2017 18:17:31 +0000 (19:17 +0100)]
net/sfc: fix unused variable in RSS-agnostic build

Unused variables will be found in several places if RSS
support is disabled at build time; the patch is to fix it

Fixes: 4ec1fc3ba881 ("net/sfc: add basic stubs for RSS support on driver attach")
Fixes: d9ff551fc974 ("net/sfc: support RSS hash offload")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
7 years agonet/failsafe: fix errno set on command execution
Gaetan Rivet [Wed, 30 Aug 2017 15:59:54 +0000 (17:59 +0200)]
net/failsafe: fix errno set on command execution

This is unacceptable behavior.

Fixes: a0194d828100 ("net/failsafe: add flexible device definition")
Fixes: 35ffe4208140 ("net/failsafe: fix missing pclose after popen")
Cc: stable@dpdk.org
Reported-by: Matan Azrad <matan@mellanox.com>
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
7 years agonet/sfc: support Tx descriptor status API
Ivan Malov [Wed, 30 Aug 2017 09:08:47 +0000 (10:08 +0100)]
net/sfc: support Tx descriptor status API

Support for the feature is added to EFX Tx datapath

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
7 years agonet/sfc: support Rx descriptor status API
Ivan Malov [Wed, 30 Aug 2017 09:08:46 +0000 (10:08 +0100)]
net/sfc: support Rx descriptor status API

Support for the feature is added to EFX Rx datapath

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
7 years agonet/liquidio: add API to set MTU
Shijith Thotton [Wed, 30 Aug 2017 07:11:58 +0000 (12:41 +0530)]
net/liquidio: add API to set MTU

Support MTU change in the range ETHER_MIN_MTU to PF_MTU. A drop in PF
MTU lowers VF MTU if it goes out of range.

Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
7 years agonet/mlx5: fix probe failure report
Matan Azrad [Sun, 13 Aug 2017 12:25:12 +0000 (15:25 +0300)]
net/mlx5: fix probe failure report

The corrupted code doesn't return error when probe function
fails due to error in device mac address getting.
By this way, the probe function may return success even if the
ETH dev is not allocated.

Hence, the probe caller, for example failsafe PMD, fails when it
tries to get ETH dev after the device was plugged out while mlx5
was probing it.

The fix adds error report to the probe caller when priv_get_mac fails
and in all other failure options which are missing it.

By this way, it prevents the unexpected behavior to miss ETH device
after the device was probed successfully.

This bug was already present in the original code taken from mlx4.

Fixes: 771fa900b73a ("mlx5: introduce new driver for Mellanox ConnectX-4 adapters")
Fixes: 1371f4df16bc ("mlx5: check port is configured as ethernet device")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: improve stack usage during link update
Nélio Laranjeiro [Wed, 30 Aug 2017 14:47:07 +0000 (16:47 +0200)]
net/mlx5: improve stack usage during link update

Allocate no more memory than necessary for the second call to
ETHTOOL_GLINKSETTINGS.

Cc: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx5: fix clang build
Nélio Laranjeiro [Wed, 30 Aug 2017 14:47:06 +0000 (16:47 +0200)]
net/mlx5: fix clang build

On redhat 7.2 clang reports the following error:
   CC mlx5_rxmode.o
 /drivers/net/mlx5/mlx5_ethdev.c:820:32: error: field 'edata' with
 variable sized type 'struct ethtool_link_settings' not at the end
 of a struct or class is a GNU extension
 [-Werror,-Wgnu-variable-sized-type-not-at-end]
      struct ethtool_link_settings edata;

Use alternative approach to reserve buffer space on the stack.

Fixes: ef09a7fc7620 ("net/mlx5: fix inconsistent link status query")
Cc: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/i40e: fix VF device stop issue
Beilei Xing [Tue, 29 Aug 2017 18:34:33 +0000 (02:34 +0800)]
net/i40e: fix VF device stop issue

i40e HW data is gotten wrongly in i40evf_dev_stop function,
it may cause device can't be stopped.
This patch is to fix the issue.

Fixes: 185993420249 ("net/i40e: fix VF add/del MAC")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
7 years agonet/sfc: specify correct scale table size on Rx start
Ivan Malov [Mon, 28 Aug 2017 12:53:46 +0000 (13:53 +0100)]
net/sfc: specify correct scale table size on Rx start

efx_rx_scale_tbl_set() takes the number of entries in the scale table
to be set, not the size of the table in bytes; currently this bug does
not make any damage since the size argument is used to wrap the loop
on the input table when filling in an MCDI request in case if the table
size in the MCDI request is larger then one provided by the user,
and MCDI scale table size is the same as the size of the table provided
by the driver; this patch brings a fix for the bug

Fixes: 4ec1fc3ba881 ("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>
7 years agonet/sfc/base: insert filters for encapsulated packets
Mark Spender [Mon, 28 Aug 2017 13:25:27 +0000 (14:25 +0100)]
net/sfc/base: insert filters for encapsulated packets

On Medford, with full-featured firmware running, encapsulated
packets may not be delivered unless filters are inserted for
them, as ordinary filters are not applied to encapsulated
packets. So filters for encapsulated packets need to be
inserted for each class of encapsulated packet. For simplicity,
catch-all filters are always inserted. These may match more
packets than the OS has asked for, but trying to insert more
precise filters increases complexity for little gain.

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
7 years agonet/sfc/base: support filters for encapsulated packets
Mark Spender [Mon, 28 Aug 2017 13:25:26 +0000 (14:25 +0100)]
net/sfc/base: support filters for encapsulated packets

This supports filters which match all unicast or multicast
inner frames in VXLAN, GENEVE, or NVGRE packets.
(Additional fields to match on can be added easily.)

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
7 years agonet/sfc/base: use proper MCDI command for encap filters
Mark Spender [Mon, 28 Aug 2017 13:25:25 +0000 (14:25 +0100)]
net/sfc/base: use proper MCDI command for encap filters

MC_CMD_FILTER_OP_IN_EXT is needed to set filters for encapsulated
packets.

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
7 years agonet/sfc/base: provide information about supported tunnels
Andrew Rybchenko [Mon, 28 Aug 2017 13:25:24 +0000 (14:25 +0100)]
net/sfc/base: provide information about supported tunnels

VXLAN/NVGRE (and Geneve) support is available on SFN8xxx with
full-feature firmware variant running.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Mark Spender <mspender@solarflare.com>
7 years agonet/failsafe: fix failsafe bus uninit return value
Raslan Darawsheh [Tue, 29 Aug 2017 09:08:08 +0000 (12:08 +0300)]
net/failsafe: fix failsafe bus uninit return value

fs_bus_uninit is always returning 0 no matter what was the status
of each sub device bus_uninit value.

Fixes: a46f8d584eb8 ("net/failsafe: add fail-safe PMD")
Cc: stable@dpdk.org
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
7 years agonet/i40e: fix interrupt throttling setting in PF
Jingjing Wu [Thu, 24 Aug 2017 01:57:51 +0000 (09:57 +0800)]
net/i40e: fix interrupt throttling setting in PF

As no matter the PF host driver is DPDK or other kernel drivers,
they are sharing the same virtchnnl interfaces to communicate to VFs.
To follow the generic interface, DPDK PF need to set Interrupt
Throttling (ITR) index according to the rxitr_idx from virtchnnl
instead of ITR_NONE.

Fixes: 6d59e4ea74a6 ("net/i40e: change version number to support Linux VF")
Cc: stable@dpdk.org
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e: remove DPDK PF version specific code
Beilei Xing [Wed, 23 Aug 2017 08:44:36 +0000 (16:44 +0800)]
net/i40e: remove DPDK PF version specific code

This patch removes unused code related to DPDK PF version.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
7 years agonet/i40e: remove virtual channel command for VSI queue
Beilei Xing [Wed, 23 Aug 2017 08:44:35 +0000 (16:44 +0800)]
net/i40e: remove virtual channel command for VSI queue

This patch removes specific virtual channel command
VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
7 years agonet/i40e: remove virtual channel command for VLAN pvid
Beilei Xing [Wed, 23 Aug 2017 08:44:34 +0000 (16:44 +0800)]
net/i40e: remove virtual channel command for VLAN pvid

Since there's no specific version number to distinguish
DPDK PF and Linux kernel PF, DPDK VF won't recognize if
host is DPDK PF or kernel PF. The specific virtual channel
commands for DPDK pf can be deleted.
This patch removes I40E_VIRTCHNL_OP_CFG_VLAN_PVID.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
7 years agonet/failsafe: fix parameters parsing
Matan Azrad [Sun, 27 Aug 2017 07:23:14 +0000 (10:23 +0300)]
net/failsafe: fix parameters parsing

The corrupted code used wrongly snprintf return value as the
number of characters actually copied, in spite of the meaning
is the number of characters which would be generated for the
given input.

It caused to remain zerod bytes between the failsafe command line
non sub device parameters indicates end of string.

Hence, when rte_kvargs_parse tried to parse all parameters, it
got end of string after the first one and the others weren't parsed.

So, if the mac parameters was the first in command line it was
taken while hotplug_poll was left default, and vice versa.

The fix updates the buffer index by dedicated variable contains
the copy size, by the way validates the comma separation.

Fixes: a46f8d584eb8 ("net/failsafe: add fail-safe PMD")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
7 years agonet/mlx5: don't map doorbell register to write combining
Shahaf Shuler [Sun, 27 Aug 2017 06:47:09 +0000 (09:47 +0300)]
net/mlx5: don't map doorbell register to write combining

By default, Verbs maps the doorbell register to write combining.
Working with write combining is useful for drivers which use blue flame
for the doorbell write.

Since mlx5 PMD uses only doorbells and write combining mapping requires
an extra memory barrier to flush the doorbell after its write, setting
the mapping to un-cached by default.

Such change is expected to reduce the max and average round trip latency.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Signed-off-by: Alexander Solganik <solganik@gmail.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: replace memory barrier type
Shahaf Shuler [Sun, 27 Aug 2017 06:47:08 +0000 (09:47 +0300)]
net/mlx5: replace memory barrier type

The reason for the requirement of a barrier between the txq writes
and the doorbell record writes is to avoid a case where the device
reads the doorbell record's new value before the txq writes are flushed
to memory.

The current use of rte_wmb is not necessary, and can be replaced by
rte_io_wmb which is more relaxed.

Replacing the rte_wmb is also expected to improve the throughput.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Signed-off-by: Alexander Solganik <solganik@gmail.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/qede: fix possible null pointer dereference
RongQiang Xie [Thu, 24 Aug 2017 07:12:33 +0000 (15:12 +0800)]
net/qede: fix possible null pointer dereference

In function qede_rss_reta_update(), the pointer params returned from
call to function rte_zmalloc() may be NULL and will be dereferenced.
So, should judge if the params is NULL or not.

Fixes: 8b3ee85efe11 ("net/qede: fix RSS table entries for 100G adapter")
Cc: stable@dpdk.org
Signed-off-by: RongQiang Xie <xie.rongqiang@zte.com.cn>
Acked-by: Harish Patil <harish.patil@cavium.com>
7 years agonet/failsafe: safer subdev iterator
Gaetan Rivet [Wed, 23 Aug 2017 13:05:30 +0000 (15:05 +0200)]
net/failsafe: safer subdev iterator

The sub_device iterator macro should follow the general gist of the
tailq API for an easier understanding and safer use.

Once the loop has finished, the iterator should be set to NULL.
If no sub_device was iterated upon, the iterator should still be NULL.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
7 years agonet/enic: fix possible null pointer dereference
RongQiang Xie [Wed, 23 Aug 2017 08:49:24 +0000 (16:49 +0800)]
net/enic: fix possible null pointer dereference

In enic_alloc_consistent() function, if rte_malloc for mze is failed,
!mze is true, memzone should be freed and function should return NULL.

Fixes: da5f560be966 ("net/enic: fix memory freeing")
Cc: stable@dpdk.org
Signed-off-by: RongQiang Xie <xie.rongqiang@zte.com.cn>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agonet/mlx5: extend debug logs verbosity
Shahaf Shuler [Wed, 23 Aug 2017 07:10:58 +0000 (10:10 +0300)]
net/mlx5: extend debug logs verbosity

Extend debug logs verbosity by printing the full completion with error
along with the entire txq in case of error. For the Rx case no logs were
added since such errors are counted and recovered by the Rx data path.

Such prints are essential to understand the root cause for the error.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agoapp/testpmd: fix wrong API of adding VF MAC
Wenzhuo Lu [Thu, 17 Aug 2017 18:33:43 +0000 (02:33 +0800)]
app/testpmd: fix wrong API of adding VF MAC

When adding a VF MAC address, rte_eth_dev_mac_addr_add is called.
It's not right, because this API is used to add a MAC address for
a VMDq pool not a VF. Although it can work on ixgbe as VMDq pool
and VF mean the same thing on ixgbe.

Fixes: 7741e4cf16c0 ("app/testpmd: VMDq and DCB updates")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet/i40e: new API to add VF MAC address from PF
Wenzhuo Lu [Thu, 17 Aug 2017 18:33:42 +0000 (02:33 +0800)]
net/i40e: new API to add VF MAC address from PF

Currently, rte_eth_dev_mac_addr_add is used by a testpmd CLI
to add a MAC address for VF. But the parameter 'pool' of this
API means the VMDq pool, not VF.
So, it's wrong to use it to add the VF MAC address.

This patch provides a new API that can be used to
add VF MAC address on i40e.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet/mlx5: fix locking in xstats functions
Matan Azrad [Mon, 14 Aug 2017 11:32:24 +0000 (14:32 +0300)]
net/mlx5: fix locking in xstats functions

The corrupted code didn't unlock the spinlock in xstats
get and reset functions error flow.

Hence, if these errors happened, the device spinlock was
left locked and many mlx5 device functionalities were blocked.

The fix unlocks the spinlock in the missed places.

Fixes: e62bc9e70608 ("net/mlx5: fix extended statistics")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/ixgbe: check memory allocation result
RongQiang Xie [Tue, 22 Aug 2017 11:49:21 +0000 (19:49 +0800)]
net/ixgbe: check memory allocation result

In the function ixgbe_flow_create(), the value ntuple_filter_ptr,
ethertype_filter_ptr, syn_filter_ptr, fdir_rule_ptr and l2_tn_filter_ptr
use rte_zmalloc().

malloc may return NULL, so we should check if the return value is NULL
or success.

Signed-off-by: RongQiang Xie <xie.rongqiang@zte.com.cn>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agonet/ixgbe: fix mapping of user priority to TC
Wei Dai [Mon, 21 Aug 2017 07:50:05 +0000 (15:50 +0800)]
net/ixgbe: fix mapping of user priority to TC

This patch fixes the mapping of user priority to traffic class
in Rx/Tx path of DCB configuration. Each DCB traffic class
should include all user priorities mapping to it in both Rx and
Tx path.

Fixes: 0807f80d35d0 ("ixgbe: DCB / flow control")
Cc: stable@dpdk.org
Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/mlx5: remove old MLNX OFED 3.3 verification
Nélio Laranjeiro [Wed, 23 Aug 2017 08:15:12 +0000 (10:15 +0200)]
net/mlx5: remove old MLNX OFED 3.3 verification

This version of MLNX_OFED is no more supported.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
7 years agonet/mlx5: remove multiple drop RSS queues
Nélio Laranjeiro [Wed, 23 Aug 2017 08:15:11 +0000 (10:15 +0200)]
net/mlx5: remove multiple drop RSS queues

Since MLNX_OFED 4.1 this code is no more useful.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
7 years agonet/mlx5: fix non working secondary process by removing it
Nélio Laranjeiro [Wed, 23 Aug 2017 08:15:10 +0000 (10:15 +0200)]
net/mlx5: fix non working secondary process by removing it

Secondary process is a copy/paste of the mlx4 drivers, it was never
tested and it even segfault at the secondary process start in the
mlx5_pci_probe().

This makes more sense to wipe this non working feature to re-write a
working and functional version.

Fixes: a48deada651b ("mlx5: allow operation in secondary processes")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
7 years agonet/mlx5: remove pedantic pragma
Nélio Laranjeiro [Wed, 23 Aug 2017 08:15:09 +0000 (10:15 +0200)]
net/mlx5: remove pedantic pragma

Those are useless since DPDK headers have been cleaned up.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
7 years agonet/mlx5: remove flow drop useless if branches
Nélio Laranjeiro [Wed, 23 Aug 2017 08:15:08 +0000 (10:15 +0200)]
net/mlx5: remove flow drop useless if branches

Those two if statements are useless as there is a verification on the drop
field of the flow to jump to the end of the function just above.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
7 years agonet/mlx5: cleanup Rx ring in free functions
Nélio Laranjeiro [Wed, 23 Aug 2017 08:15:07 +0000 (10:15 +0200)]
net/mlx5: cleanup Rx ring in free functions

Vector PMD returns buffers to the application without setting the pointers
in the Rx queue to null nor allocating them.  When the PMD cleanup the ring
it needs to take a special care to those pointers to not free the mbufs
before the application have used them nor if the application have already
freed them.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: prepare vector Rx ring at setup time
Nélio Laranjeiro [Wed, 23 Aug 2017 08:15:06 +0000 (10:15 +0200)]
net/mlx5: prepare vector Rx ring at setup time

To use the vector, it needs to add to the PMD Rx mbuf ring four extra mbuf
to avoid memory corruption.  This additional mbuf are added on dev_start()
whereas all other mbuf are allocated on queue setup.

This patch brings this allocation back to the same place as other mbuf
allocation.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: avoid reusing old queue's mbuf on reconfigure
Nélio Laranjeiro [Wed, 23 Aug 2017 08:15:05 +0000 (10:15 +0200)]
net/mlx5: avoid reusing old queue's mbuf on reconfigure

This patch prepare the merge of fake mbuf allocation needed by the vector
code with rxq_alloc_elts() where all mbuf of the queues should be
allocated.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/nfp: support new firmware medatada API
Alejandro Lucero [Tue, 22 Aug 2017 14:00:35 +0000 (15:00 +0100)]
net/nfp: support new firmware medatada API

We need to support how firmware metadata was handled until now and also
the new API, since NFP NFD 3.0 firmware versions. The new metadata API
adds flexibility for working with different metadata types and, mainly,
to allow adding metadata from different firmware components independently.

Although this patch just supports one type handled by the PMD, future uses
regarding firmware apps will extend this support.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/nfp: handle packets with length 0 as usual ones
Alejandro Lucero [Tue, 22 Aug 2017 10:41:26 +0000 (11:41 +0100)]
net/nfp: handle packets with length 0 as usual ones

A DPDK app could, whatever the reason, send packets with size 0.
The PMD is not sending those packets, which does make sense,
but the problem is the mbuf is not released either. That leads
to mbufs not being available, because the app trusts the
PMD will do it.

Although this is a problem related to app wrong behavior, we
should harden the PMD in this regard. Not sending a packet with
size 0 could be problematic, needing special handling inside the
PMD xmit function. It could be a burst of those packets, which can
be easily handled, but it could also be a single packet in a burst,
what is harder to handle.

It would be simpler to just send that kind of packets, which will
likely be dropped by the hw at some point. The main problem is how
the fw/hw handles the DMA, because a dma read to a hypothetical 0x0
address could trigger an IOMMU error. It turns out, it is safe to
send a descriptor with packet size 0 to the hardware: the DMA never
happens, from the PCIe point of view.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/ixgbe: add VLAN info in queue info msg to VF
Wei Dai [Mon, 21 Aug 2017 06:21:09 +0000 (14:21 +0800)]
net/ixgbe: add VLAN info in queue info msg to VF

This patch is to align with PF kernel driver version 5.1.3 to add the
number of queues to transmit VLAN packets in msg of queue info to VF.

If DCB is enabled, it is the number of DCB traffic classes.
If DCB is not enabled and default VLAN is enabled, it is 1.
For other cases, it is 0.

Signed-off-by: Wei Dai <wei.dai@intel.com>