dpdk.git
6 years agoethdev: rename physical port item in flow API
Adrien Mazarguil [Wed, 25 Apr 2018 15:28:06 +0000 (17:28 +0200)]
ethdev: rename physical port item in flow API

While RTE_FLOW_ITEM_TYPE_PORT refers to physical ports of the underlying
device using specific identifiers, these are often confused with DPDK port
IDs exposed to applications in the global name space.

Since this pattern item is seldom used, rename it RTE_FLOW_ITEM_PHY_PORT
for better clarity.

No ABI impact.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agoethdev: fix behavior of VF/PF in flow API
Adrien Mazarguil [Wed, 25 Apr 2018 15:28:03 +0000 (17:28 +0200)]
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: b1a4b4cbc0a8 ("ethdev: introduce generic flow API")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agoethdev: add transfer attribute to flow API
Adrien Mazarguil [Wed, 25 Apr 2018 15:28:01 +0000 (17:28 +0200)]
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>
6 years agoethdev: fix default VLAN TCI mask in flow API
Adrien Mazarguil [Wed, 25 Apr 2018 15:27:58 +0000 (17:27 +0200)]
ethdev: fix default VLAN TCI mask in flow API

VLAN TCI is a 16-bit field broken down as PCP (3b), DEI (1b) and VID (12b).

The default mask used by PMDs for the VLAN pattern when one isn't provided
by the application comprises the entire TCI, which is problematic because
most devices only support VID matching.

This forces applications to always provide a mask limited to the VID part
in order to successfully apply a flow rule with a VLAN pattern item.
Moreover, applications rarely want to match PCP and DEI intentionally.

Given the above and since VID is what is commonly referred to when talking
about VLAN, this commit excludes PCP and DEI from the default mask.

Fixes: 6de5c0f1302c ("ethdev: define default item masks in flow API")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agoethdev: fix TPID handling in flow API
Adrien Mazarguil [Wed, 25 Apr 2018 15:27:56 +0000 (17:27 +0200)]
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: b1a4b4cbc0a8 ("ethdev: introduce generic flow API")
Fixes: 99e7003831c3 ("net/ixgbe: parse L2 tunnel filter")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agoethdev: add encap level to RSS flow API action
Adrien Mazarguil [Wed, 25 Apr 2018 15:27:54 +0000 (17:27 +0200)]
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 676b605182a5 ("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>
6 years agoethdev: add hash function to RSS flow API action
Adrien Mazarguil [Wed, 25 Apr 2018 15:27:52 +0000 (17:27 +0200)]
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>
6 years agoethdev: flatten RSS configuration in flow API
Adrien Mazarguil [Wed, 25 Apr 2018 15:27:50 +0000 (17:27 +0200)]
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 676b605182a5 ("doc: announce ethdev API change for RSS
    configuration")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agoethdev: fix C99 flexible arrays from flow API
Adrien Mazarguil [Wed, 25 Apr 2018 15:27:48 +0000 (17:27 +0200)]
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: b1a4b4cbc0a8 ("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>
6 years agoethdev: alter behavior of flow API actions
Adrien Mazarguil [Wed, 25 Apr 2018 15:27:46 +0000 (17:27 +0200)]
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>
6 years agoethdev: remove DUP action from flow API
Adrien Mazarguil [Wed, 25 Apr 2018 15:27:44 +0000 (17:27 +0200)]
ethdev: remove DUP action from flow API

Upcoming changes in relation to the handling of actions list will make the
DUP action redundant as specifying several QUEUE actions will achieve the
same behavior. Besides, no PMD implements this action.

By removing an entry from enum rte_flow_action_type, this patch 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>
6 years agodoc: remove flow API migration section
Adrien Mazarguil [Wed, 25 Apr 2018 15:27:43 +0000 (17:27 +0200)]
doc: remove flow API migration section

This section has become less relevant since the flow API (rte_flow) is now
a mature DPDK API with applications developed directly on top of it instead
of an afterthought.

This patch removes it for the following reasons:

- It has never been updated to track the latest changes in the legacy
  filter types and never will.

- Many provided examples are theoretical and misleading since PMDs do not
  implement them. Others are obvious.

- Upcoming work on the flow API will alter the behavior of several pattern
  items, actions and in some cases, flow rules, which will in turn cause
  existing examples to be wrong.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agoethdev: clarify flow API pattern items and actions
Adrien Mazarguil [Wed, 25 Apr 2018 15:27:41 +0000 (17:27 +0200)]
ethdev: clarify flow API pattern items and actions

Although pattern items and actions examples end with "and so on", these
lists include all existing definitions and as a result are updated almost
every time new types are added. This is cumbersome and pointless.

This patch also synchronizes Doxygen and external API documentation wording
with a slight clarification regarding meta pattern items.

No fundamental API change.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agoethdev: add error types to flow API
Adrien Mazarguil [Wed, 25 Apr 2018 15:27:38 +0000 (17:27 +0200)]
ethdev: add error types to flow API

These enable more precise reporting of objects responsible for errors.

This breaks ABI compatibility for the following public functions:

- rte_flow_create()
- rte_flow_destroy()
- rte_flow_error_set()
- rte_flow_flush()
- rte_flow_isolate()
- rte_flow_query()
- rte_flow_validate()

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/i40e: add module EEPROM callbacks for i40e
Zijie Pan [Wed, 25 Apr 2018 14:02:06 +0000 (16:02 +0200)]
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>
6 years agonet/e1000: add module EEPROM callbacks for e1000
Zijie Pan [Wed, 25 Apr 2018 14:02:05 +0000 (16:02 +0200)]
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>
6 years agonet/ixgbe: add module EEPROM callbacks for ixgbe
Zijie Pan [Wed, 25 Apr 2018 14:02:04 +0000 (16:02 +0200)]
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>
6 years agoexamples/ethtool: add a new command module-eeprom
Zijie Pan [Wed, 25 Apr 2018 14:02:03 +0000 (16:02 +0200)]
examples/ethtool: add a new command module-eeprom

Add a new command "module-eeprom" to get the 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>
6 years agoethdev: add access to EEPROM
Zijie Pan [Wed, 25 Apr 2018 14:02:02 +0000 (16:02 +0200)]
ethdev: add access to EEPROM

add new APIs:
- rte_eth_dev_get_module_info
- rte_eth_dev_get_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>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agoethdev: remove experimental flag of ports enumeration
Thomas Monjalon [Tue, 24 Apr 2018 02:15:11 +0000 (04:15 +0200)]
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: 8728ccf37615 ("fix ethdev ports enumeration")
Fixes: d9a42a69febf ("ethdev: deprecate port count function")
Fixes: e70e26861eaf ("net/mvpp2: fix build")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: David Marchand <david.marchand@6wind.com>
6 years agonet/mlx5: allow max 192B TSO inline header length
Xueming Li [Sun, 8 Apr 2018 12:41:21 +0000 (20:41 +0800)]
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>
6 years agonet/mlx5: support generic tunnel offloading
Xueming Li [Sun, 8 Apr 2018 12:41:20 +0000 (20:41 +0800)]
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>
6 years agonet/mlx5: separate TSO function in Tx data path
Xueming Li [Sun, 8 Apr 2018 12:41:19 +0000 (20:41 +0800)]
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>
6 years agonet/mlx5: implement multicast add list devop
Nélio Laranjeiro [Mon, 23 Apr 2018 11:09:28 +0000 (13:09 +0200)]
net/mlx5: implement multicast add list devop

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
6 years agonet/mlx5: split MAC address add/remove code
Nélio Laranjeiro [Mon, 23 Apr 2018 11:09:27 +0000 (13:09 +0200)]
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>
6 years agonet/mlx5: add more checks on MAC addresses
Nélio Laranjeiro [Mon, 23 Apr 2018 11:09:26 +0000 (13:09 +0200)]
net/mlx5: add more checks on MAC addresses

Verify MAC address before further process.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
6 years agodrivers/net: fix link autoneg value for virtual PMDs
Ferruh Yigit [Fri, 20 Apr 2018 00:01:24 +0000 (01:01 +0100)]
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: 1e3a958f40b3 ("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>
6 years agoapp/testpmd: add option to configure UDP tunnel port
Shahed Shaikh [Sun, 22 Apr 2018 20:59:24 +0000 (13:59 -0700)]
app/testpmd: add option to configure UDP tunnel port

This change adds a new option to "port config" command to
add udp tunnel port for VXLAN and GENEVE tunneling protocols.
This command can be extended for other tunneling protocols
listed in "enum rte_eth_tunnel_type" as and when needed.

usage:
port config <port_id> udp_tunnel_port add|rm vxlan|geneve <udp_port>

Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/dpaa2: fix the ethdev offload checks
Sunil Kumar Kori [Tue, 24 Apr 2018 17:16:14 +0000 (22:46 +0530)]
net/dpaa2: fix the ethdev offload checks

Fixes: 0ebce6129bc6 ("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>
6 years agonet/dpaa: fix the ethdev offload checks
Sunil Kumar Kori [Tue, 24 Apr 2018 17:16:13 +0000 (22:46 +0530)]
net/dpaa: fix the ethdev offload checks

Fixes: 16e2c27f4fc7 ("net/dpaa: support new ethdev offload APIs")

Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
6 years agonet/tap: fix icc build
Ferruh Yigit [Mon, 12 Mar 2018 19:31:33 +0000 (19:31 +0000)]
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: 7748a4b44196 ("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>
6 years agonet/bonding: support flow API
Matan Azrad [Wed, 28 Mar 2018 11:16:01 +0000 (11:16 +0000)]
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>
6 years agonet/i40e: enable runtime queue setup
Qi Zhang [Tue, 24 Apr 2018 12:44:10 +0000 (20:44 +0800)]
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>
6 years agoapp/testpmd: enable queue ring size configure
Qi Zhang [Tue, 24 Apr 2018 12:44:09 +0000 (20:44 +0800)]
app/testpmd: enable queue ring size configure

Add command to change specific queue's ring size configure,
the new value will only take effect after command that restart
the device(port stop <port_id>/port start <port_id>) or command
that setup the queue(port <port_id> rxq <qid> setup) at runtime.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoapp/testpmd: enable per queue configure
Qi Zhang [Tue, 24 Apr 2018 12:44:08 +0000 (20:44 +0800)]
app/testpmd: enable per queue configure

Each queue has independent configure information in rte_port.
Base on this, we are able to add new commands to configure
different queues with different value.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoapp/testpmd: add command for queue setup
Qi Zhang [Tue, 24 Apr 2018 12:44:07 +0000 (20:44 +0800)]
app/testpmd: add command for queue setup

Add new command to setup queue, rte_eth_[rx|tx]_queue_setup will
be called corresponsively.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoethdev: support runtime queue setup
Qi Zhang [Tue, 24 Apr 2018 12:44:06 +0000 (20:44 +0800)]
ethdev: support runtime queue setup

It's not possible to setup a queue when the port is started
because of a check in ethdev layer. New capability flags are
added in order to relax this check for devices which support
queue setup in runtime. The functions rte_eth_[rx|tx]_queue_setup
will raise an error only if the port is started and runtime setup
of queue is not supported.

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>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agonet/nfp: fix mbufs releasing when stop or close
Alejandro Lucero [Mon, 23 Apr 2018 11:23:58 +0000 (12:23 +0100)]
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: b812daadad0d ("nfp: add Rx and Tx")
Cc: stable@dpdk.org
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
6 years agonet/vdev_netvsc: prefer netvsc devices in scan
Matan Azrad [Tue, 10 Apr 2018 13:32:08 +0000 (13:32 +0000)]
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>
6 years agonet/vdev_netvsc: add check for specifying by 1 way
Matan Azrad [Tue, 10 Apr 2018 13:32:07 +0000 (13:32 +0000)]
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>
6 years agonet/vdev_netvsc: remove specified devices IP check
Matan Azrad [Tue, 10 Apr 2018 13:32:06 +0000 (13:32 +0000)]
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>
6 years agonet/vdev_netvsc: shorten devices names
Ophir Munk [Tue, 10 Apr 2018 07:20:21 +0000 (07:20 +0000)]
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>
6 years agonet/failsafe: add TCP TSO default Tx capability
Ophir Munk [Tue, 10 Apr 2018 06:17:00 +0000 (06:17 +0000)]
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>
6 years agonet/bnx2x: reserve enough headroom for mbuf prepend
Yangchao Zhou [Tue, 6 Feb 2018 11:20:33 +0000 (19:20 +0800)]
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>
6 years agoapp/testpmd: fix command token
Qi Zhang [Tue, 24 Apr 2018 05:59:57 +0000 (13:59 +0800)]
app/testpmd: fix command token

Correct token for queue start stop command.

Fixes: 5f4ec54f1d16 ("testpmd: queue start and stop")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoapp/testpmd: fix port id type
Qi Zhang [Tue, 24 Apr 2018 05:59:56 +0000 (13:59 +0800)]
app/testpmd: fix port id type

Correct couple port id from uint8_t to uint16_t.

Fixes: f8244c6399d9 ("ethdev: increase port id range")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoapp/testpmd: support generic tunnel Tx offloads
Xueming Li [Mon, 23 Apr 2018 11:36:03 +0000 (19:36 +0800)]
app/testpmd: support generic tunnel Tx offloads

"show port cap" and "csum parse tunnel" command support TX generic
tunnel offloads

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
6 years agoethdev: introduce generic IP/UDP tunnel checksum and TSO
Xueming Li [Mon, 23 Apr 2018 11:49:35 +0000 (19:49 +0800)]
ethdev: introduce generic IP/UDP tunnel checksum and TSO

This patch introduce new TX offload flags for device that supports
IP or UDP tunneled packet L3/L4 checksum and TSO offload.
It will be used for non-standard tunnels.

The support from the device is for inner and outer checksums on
IPV4/TCP/UDP and TSO for *any packet with the following format*:

<some headers> / [optional IPv4/IPv6] / [optional TCP/UDP] / <some
headers> / [optional inner IPv4/IPv6] / [optional TCP/UDP]

For example the following packets can use this feature:

1. eth / ipv4 / udp / VXLAN / ip / tcp
2. eth / ipv4 / GRE / MPLS / ipv4 / udp

Please note that specific tunnel headers that contain payload length,
sequence id or checksum will not be updated.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
6 years agoapp/testpmd: new parameter for port config all RSS command
Xueming Li [Fri, 20 Apr 2018 14:30:23 +0000 (22:30 +0800)]
app/testpmd: new parameter for port config all RSS command

This patches add "default" parameter to "port config all rss" command.
"default" means all supported hash types reported by device info.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agoethdev: add supported hash function check
Xueming Li [Fri, 20 Apr 2018 14:30:22 +0000 (22:30 +0800)]
ethdev: add supported hash function check

Add supported RSS hash function check in device configuration to
have better error verbosity for application developers.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agonet/vmxnet3: skip empty segments in transmission
Didier Pallard [Wed, 28 Mar 2018 15:43:49 +0000 (17:43 +0200)]
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>
6 years agonet/vmxnet3: ignore empty segments in reception
Didier Pallard [Wed, 28 Mar 2018 15:43:48 +0000 (17:43 +0200)]
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>
6 years agonet/vmxnet3: guess MSS if not provided in LRO mode
Didier Pallard [Wed, 28 Mar 2018 15:43:47 +0000 (17:43 +0200)]
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>
6 years agonet/vmxnet3: complete Rx offloads support
Didier Pallard [Wed, 28 Mar 2018 15:43:46 +0000 (17:43 +0200)]
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>
6 years agonet/vmxnet3: fix Rx offload information in multiseg packets
Didier Pallard [Wed, 28 Mar 2018 15:43:45 +0000 (17:43 +0200)]
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: 2fdd835f992c ("vmxnet3: support jumbo frames")
Cc: stable@dpdk.org
Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Acked-by: Yong Wang <yongwang@vmware.com>
6 years agonet/vmxnet3: gather offload data on first and last segment
Didier Pallard [Wed, 28 Mar 2018 15:43:44 +0000 (17:43 +0200)]
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>
6 years agonet/vmxnet3: return unknown IPv4 extension len ptype
Didier Pallard [Wed, 28 Mar 2018 15:43:43 +0000 (17:43 +0200)]
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>
6 years agonet: export IPv6 header extensions skip function
Didier Pallard [Wed, 28 Mar 2018 15:43:42 +0000 (17:43 +0200)]
net: export IPv6 header extensions skip function

skip_ip6_ext function can be exported as a helper, it may be used
by some PMD to skip IPv6 header extensions.

Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Yong Wang <yongwang@vmware.com>
6 years agonet/mlx5: fix flow director mask
Nélio Laranjeiro [Tue, 17 Apr 2018 09:01:36 +0000 (11:01 +0200)]
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: 4c3e9bcdd52e ("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>
6 years agonet/mlx5: split L3/L4 in flow director
Nélio Laranjeiro [Tue, 17 Apr 2018 09:01:35 +0000 (11:01 +0200)]
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>
6 years agonet/mlx5: fix invalid flow item check
Xueming Li [Fri, 13 Apr 2018 15:00:36 +0000 (23:00 +0800)]
net/mlx5: fix invalid flow item check

This patch fixed invalid flow item check.

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

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
6 years agonet/mlx4: fix alignment of memory region
Yongseok Koh [Tue, 17 Apr 2018 18:39:14 +0000 (11:39 -0700)]
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: c2fe5823224a ("net/mlx4: use virt2memseg instead of iteration")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agonet/mlx5: fix alignment of memory region
Yongseok Koh [Tue, 17 Apr 2018 18:39:13 +0000 (11:39 -0700)]
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: 718e35999c96 ("net/mlx5: use virt2memseg instead of iteration")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
6 years agonet/bnxt: fix mbuf data offset initialization
Ajit Khaparde [Fri, 20 Apr 2018 14:22:02 +0000 (07:22 -0700)]
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: 2eb53b134aae ("net/bnxt: add initial Rx code")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
6 years agonet/bnxt: avoid invalid vnic id in set L2 Rx mask
Ajit Khaparde [Fri, 20 Apr 2018 14:22:01 +0000 (07:22 -0700)]
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: 244bc98b0da7 ("net/bnxt: set L2 Rx mask")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
6 years agonet/bnxt: cache address of doorbell to subsequent access
Ajit Khaparde [Fri, 20 Apr 2018 14:22:00 +0000 (07:22 -0700)]
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>
6 years agonet/vmxnet3: keep link state consistent
Chas Williams [Sun, 18 Mar 2018 01:45:52 +0000 (21:45 -0400)]
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: 1e3a958f40b3 ("ethdev: fix link autonegotiation value")
Cc: stable@dpdk.org
Signed-off-by: Chas Williams <chas3@att.com>
Acked-by: Yong Wang <yongwang@vmware.com>
6 years agodrivers/net: update link status
Ferruh Yigit [Tue, 17 Apr 2018 11:30:35 +0000 (12:30 +0100)]
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>
6 years agonet/vhost: update license to SPDX format
Junjie Chen [Thu, 12 Apr 2018 16:43:07 +0000 (12:43 -0400)]
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>
6 years agonet/vmxnet3: increase Rx data ring descriptor size
Shraddha Joshi [Thu, 19 Apr 2018 18:19:01 +0000 (11:19 -0700)]
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>
6 years agonet/bnx2x: make init and driver logtype names consistent
Rasesh Mody [Wed, 18 Apr 2018 20:15:09 +0000 (13:15 -0700)]
net/bnx2x: make init and driver logtype names consistent

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
6 years agonet/bnx2x: fix for PCI FLR after ungraceful exit
Rasesh Mody [Wed, 18 Apr 2018 20:15:08 +0000 (13:15 -0700)]
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: 540a211084a7 ("bnx2x: driver core")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
6 years agonet/mvpp2: update maintainers
Tomasz Duszynski [Thu, 19 Apr 2018 10:48:01 +0000 (12:48 +0200)]
net/mvpp2: update maintainers

Jacek will no longer be maintaining mvpp2 net PMD.
Special thanks to him for his development and support.

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
6 years agoethdev: fix missing include in flow API
Adrien Mazarguil [Thu, 19 Apr 2018 10:07:45 +0000 (12:07 +0200)]
ethdev: fix missing include in flow API

Fixes: b1a4b4cbc0a8 ("ethdev: introduce generic flow API")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoethdev: fix shallow copy of flow API RSS action
Adrien Mazarguil [Thu, 19 Apr 2018 10:07:44 +0000 (12:07 +0200)]
ethdev: fix shallow copy of flow API RSS action

The rss_conf field is defined as a pointer to struct rte_eth_rss_conf.

Even assuming it is permanently allocated and a pointer copy is safe,
pointed data may change and not reflect an applied flow rule anymore.

This patch aligns with testpmd by making a deep copy instead.

Fixes: 18da437b5f63 ("ethdev: add flow rule copy function")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoapp/testpmd: fix missing boolean values in flow command
Adrien Mazarguil [Thu, 19 Apr 2018 10:07:42 +0000 (12:07 +0200)]
app/testpmd: fix missing boolean values in flow command

Original implementation lacks the on/off toggle.

This patch shows up as a fix because it has been a popular request ever
since the first DPDK release with the original implementation but was never
addressed.

Fixes: abc3d81aca1b ("app/testpmd: add item raw to flow command")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoapp/testpmd: fix missing RSS fields in flow action
Adrien Mazarguil [Thu, 19 Apr 2018 10:07:40 +0000 (12:07 +0200)]
app/testpmd: fix missing RSS fields in flow action

Users cannot override the default RSS settings when entering a RSS action,
only a list of queues can be provided.

This patch enables them to set a RSS hash key and types for a flow rule.

Fixes: 05d34c6e9d2c ("app/testpmd: add queue actions to flow command")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoapp/testpmd: fix RSS flow action configuration
Adrien Mazarguil [Thu, 19 Apr 2018 10:07:37 +0000 (12:07 +0200)]
app/testpmd: fix RSS flow action configuration

Except for a list of queues, RSS configuration (hash key and fields) cannot
be specified from the flow command line and testpmd does not provide safe
defaults either.

In order to validate their implementation with testpmd, PMDs had to
interpret its NULL RSS configuration parameters somehow, however this has
never been valid to begin with.

This patch makes testpmd always provide default values.

The list of RSS types to use is exclusively taken from the global "rss_hf"
variable, itself configured through the "port config all rss" command or
--rss-ip/--rss-udp command-line options.

Fixes: 05d34c6e9d2c ("app/testpmd: add queue actions to flow command")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoapp/testpmd: fix lack of flow action configuration
Adrien Mazarguil [Thu, 19 Apr 2018 10:07:35 +0000 (12:07 +0200)]
app/testpmd: fix lack of flow action configuration

Configuration structure is not optional with flow rule actions that expect
one; this pointer is not supposed to be NULL and PMDs should not have to
verify it.

Like pattern item spec/last/mask fields, it is currently set when at least
one configuration parameter is provided on the command line. This patch
sets it as soon as an action is created instead.

Fixes: 7a91969ad35e ("app/testpmd: add various actions to flow command")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoapp/testpmd: fix flow completion for RSS queues
Adrien Mazarguil [Thu, 19 Apr 2018 10:07:33 +0000 (12:07 +0200)]
app/testpmd: fix flow completion for RSS queues

The lack of a working completion for RSS queues was overlooked during
development; until now only "end" was displayed as a valid token.

Fixes: 05d34c6e9d2c ("app/testpmd: add queue actions to flow command")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/bnxt: fix matching of flow API item masks
Adrien Mazarguil [Thu, 19 Apr 2018 10:07:31 +0000 (12:07 +0200)]
net/bnxt: fix matching of flow API item masks

Some values are interpreted without endian conversion and/or without
taking the proper mask into account.

Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/mlx5: fix RSS flow action bounds check
Adrien Mazarguil [Thu, 19 Apr 2018 10:07:29 +0000 (12:07 +0200)]
net/mlx5: fix RSS flow action bounds check

The number of queues provided by the application is not checked against
parser's supported maximum.

Fixes: 3d821d6fea40 ("net/mlx5: support RSS action flow rule")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/mlx4: fix ignored RSS hash types
Adrien Mazarguil [Thu, 19 Apr 2018 10:07:27 +0000 (12:07 +0200)]
net/mlx4: fix ignored RSS hash types

When an unsupported hash type is part of a RSS configuration structure, it
is silently ignored instead of triggering an error. This may lead
applications to assume that such types are accepted, while they are in fact
not part of the resulting flow rules.

Fixes: 078b8b452e6b ("net/mlx4: add RSS flow rule action support")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/mlx4: fix RSS resource leak in case of error
Adrien Mazarguil [Thu, 19 Apr 2018 10:07:25 +0000 (12:07 +0200)]
net/mlx4: fix RSS resource leak in case of error

When memory cannot be allocated for a flow rule, its RSS context reference
is not dropped.

Fixes: 078b8b452e6b ("net/mlx4: add RSS flow rule action support")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/ixgbe: enable vector PMD for icc 32 bits
Pablo de Lara [Tue, 17 Apr 2018 13:39:04 +0000 (14:39 +0100)]
net/ixgbe: enable vector PMD for icc 32 bits

IXGBE vector PMD was re-enabled for 32 bits, but only for gcc.
This commit enables it for icc too.

Fixes: e6672d2f0f88 ("net/ixgbe: enable ixgbe vector PMD for i686")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agonet/axgbe: fix incorrect cache alignment macro
Pavan Nikhilesh [Tue, 17 Apr 2018 20:04:58 +0000 (01:34 +0530)]
net/axgbe: fix incorrect cache alignment macro

Due to missing ____cacheline_aligned definition compiler treats it as a
global variable replace it with proper cache alignment macro.

Fixes: 9e890103267e ("net/axgbe: add Rx/Tx setup")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/enic: fix uninitialized variable
John Daley [Wed, 18 Apr 2018 00:00:20 +0000 (17:00 -0700)]
net/enic: fix uninitialized variable

A local variable was used without initialization and triggered a
coverity issue.

Is is fixed here, but there is no ill effect of not initializing
the variable in this case. 'rxq_interrupt_offset' is irrelevant
if 'rxq_interrupt_enable' is not set (the condition caught by
coverity).

Coverity issue: 268314
Fixes: fc2c8c0668fd ("net/enic: use Tx completion index instead of messages")
Cc: stable@dpdk.org
Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
6 years agonet/thunderx: fix MTU configuration for jumbo packets
Nitin Saxena [Mon, 16 Apr 2018 10:44:47 +0000 (10:44 +0000)]
net/thunderx: fix MTU configuration for jumbo packets

thunderx pmd driver passes dev_info.max_rx_pktlen as
9200 (via rte_eth_dev_info_get()) to application.
But, when application tries to set MTU as
(9200 - sizeof(ethernet_header_t)) the operation fails
because of missing CRC and VLAN additions.

This patch fixes the following for thunderx pmd driver:
 - Sets NIC_HW_MAX_FRS to 9216 (instead of 9200)
 - Sets NIC_HW_MAX_MTU to 9190 (NIC_HW_MAX_FRS - ETH_HLEN
   - ETHER_CRC_LEN - 2*VLAN_HLEN)
 - Sets dev_info->max_rx_pkt_len to NIC_HW_MAX_MTU +
   ETH_HLEN (instead of 9200)
 - Allows rte_eth_dev_set_mtu() to pass if application
   (like VPP) calls rte_eth_dev_set_mtu() before
   rte_eth_dev_start() by putting appropriate check for
   dev->data->dev_started

Fixes: 65d9804edc05 ("net/thunderx: support MTU configuration")
Cc: stable@dpdk.org
Signed-off-by: Nitin Saxena <nitin.saxena@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agonet/ixgbe: fix segfault in configuring VF VLAN strip
Wei Dai [Mon, 16 Apr 2018 08:14:25 +0000 (16:14 +0800)]
net/ixgbe: fix segfault in configuring VF VLAN strip

This patch fixes a segment fault in ixgbevf_vlan_offload_set( )
when a Rx queue with index < max_rx_queues is not setup.
For such queue, rxq = dev->data->rx_queues[i] is null pointer.

Fixes: 860a94d3c692 ("net/ixgbe: support VLAN strip per queue offloading in VF")

Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Xueqin Lin <xueqin.lin@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/ixgbe: fix missing support of multi-segs offloading
Wei Dai [Tue, 17 Apr 2018 07:43:50 +0000 (15:43 +0800)]
net/ixgbe: fix missing support of multi-segs offloading

This patch adds missing supported Tx multi-segs offloading.

Fixes: 51215925a32f ("net/ixgbe: convert to new Tx offloads API")
Cc: stable@dpdk.org
Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
6 years agonet/ixgbe: add access and locking APIs for MDIO
Helin Zhang [Mon, 16 Apr 2018 07:30:05 +0000 (03:30 -0400)]
net/ixgbe: add access and locking APIs for MDIO

Add ixgbe MDIO lock/unlock and access APIs to read and write registers
using specific device address. This provides MDIO access to any devices
that are not associated with the autoprobed PHY.Export these APIs via
the map file

Signed-off-by: Shweta Choudaha <shweta.choudaha@att.com>
Reviewed-by: Chas Williams <chas3@att.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/bnxt: add device ID for Stratus VF
Somnath Kotur [Tue, 17 Apr 2018 01:11:26 +0000 (18:11 -0700)]
net/bnxt: add device ID for Stratus VF

Fixes: 1cd45aeb3270 ("net/bnxt: support Stratus VF device")

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
6 years agonet/bnxt: avoid freeing memzone multiple times
Ajit Khaparde [Tue, 17 Apr 2018 01:11:25 +0000 (18:11 -0700)]
net/bnxt: avoid freeing memzone multiple times

Since we are storing the mem_zone address for each ring created,
we are freeing the same address multiple times.
For example the memory zone created for Rx is being freed during
Rx ring cleanup, AGG ring cleanup and CQ cleanup.
Avoid this by storing the memory zone address in RXQ instead and
free it as a part of queue_release dev_op.
In the same way do the same for TX queues as well.

Fixes: 51c87ebafc7d ("net/bnxt: add Tx queue create/destroy")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
6 years agonet/bnxt: use UINT64_MAX to initialize filter ids
Ajit Khaparde [Tue, 17 Apr 2018 01:11:24 +0000 (18:11 -0700)]
net/bnxt: use UINT64_MAX to initialize filter ids

Use UINT64_MAX to initialize l2, ntuple, em filter_id fields
instead of hardcoded -1;

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
6 years agonet/bnxt: free memory allocated for VF filters
Ajit Khaparde [Tue, 17 Apr 2018 01:11:23 +0000 (18:11 -0700)]
net/bnxt: free memory allocated for VF filters

Memory allocated to hold VF filter info is not being freed currently.
This can cause potential memory leak.

Fixes: 7a5b0874440e ("net/bnxt: support to add a VF MAC address")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
6 years agonet/bnxt: reset L2 filter id once filter is freed
Ajit Khaparde [Tue, 17 Apr 2018 01:11:22 +0000 (18:11 -0700)]
net/bnxt: reset L2 filter id once filter is freed

The fw_l2_filter_id for a ntuple filter is needed only for the lifetime
of the ntuple filter. Once the filter is free, reset the field.
The associated l2_filter will be freed as a part of its own cleanup.

Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
6 years agonet/bnxt: maintain mbuf alloc failure counter per queue
Ajit Khaparde [Tue, 17 Apr 2018 01:11:21 +0000 (18:11 -0700)]
net/bnxt: maintain mbuf alloc failure counter per queue

Currently we have a single counter for mbuf alloc failure.
Make it per RxQ instead.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
6 years agonet/bnxt: add code to determine the Tx COS queue
Ajit Khaparde [Tue, 17 Apr 2018 01:11:20 +0000 (18:11 -0700)]
net/bnxt: add code to determine the Tx COS queue

The hwrm_queue_qportcfg command has been extended to determine
the COS queue that a Tx ring needs to use. This patch adds code
to determine the information from the FW and use it while
creating the Tx rings.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
6 years agonet/bnxt: fix flow destroy
Ajit Khaparde [Tue, 17 Apr 2018 01:11:19 +0000 (18:11 -0700)]
net/bnxt: fix flow destroy

bnxt_hwrm_clear_l2_filter needs to be called only if the filter type
is L2 and not otherwise.
Also check for the return value of bnxt_hwrm_clear_l2_filter().

Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
6 years agonet/bnxt: fix L2 filter cleanup
Ajit Khaparde [Tue, 17 Apr 2018 01:11:18 +0000 (18:11 -0700)]
net/bnxt: fix L2 filter cleanup

We are wrongly freeing up a filter in the driver while it is still
configured in the HW. This can cause incorrect L2 filter id to be
used for filters created subsequently.

This filter will be cleared on cleanup anyway.

Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>