dpdk.git
7 years agonet/i40e: fix memory leak if VF init fails
Jingjing Wu [Tue, 12 Sep 2017 23:54:23 +0000 (07:54 +0800)]
net/i40e: fix memory leak if VF init fails

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Cc: stable@dpdk.org
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
7 years agonet/failsafe: stat support enhancement
Matan Azrad [Thu, 7 Sep 2017 11:31:13 +0000 (14:31 +0300)]
net/failsafe: stat support enhancement

The previous stats code returned only the current TX sub
device stats.

This enhancement extends it to return the sum of all sub
devices stats with history of removed sub-devices.

Dedicated stats accumulator saves the stat history of all
sub device remove events.

Each failsafe sub device contains the last stats asked by
the user and updates the accumulator in removal time.

I would like to implement ultimate snapshot on removal time.
The stats_get API needs to be changed to return error in the
case it is too late to retrieve statistics.
By this way, failsafe can get stats snapshot in removal interrupt
callback for each PMD which can give stats after removal event.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
7 years agonet/mlx5: support device removal event
Matan Azrad [Fri, 8 Sep 2017 10:47:45 +0000 (13:47 +0300)]
net/mlx5: support device removal event

Extend the LSC event handling to support the device removal as well.

The mlx5 event handling has been made capable of receiving and
signaling several event types at once.

This support includes next:
1. Removal event detection according to the user configuration.
2. Calling to all registered mlx5 removal callbacks.
3. Capabilities extension to include removal interrupt handling.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx5: link status update separation
Matan Azrad [Wed, 6 Sep 2017 15:03:57 +0000 (18:03 +0300)]
net/mlx5: link status update separation

Link status is sometimes inconsistent during a LSC event.
When it occurs, the PMD refrains from immediately notifying
the application; instead, an alarm is scheduled to check
link status later and notify the application once it has settled.

In the previous code the alarm callback calls to the interrupt
handler for link status recheck and may cause to unnecessary
interrupt events check.

This patch separates the link status update and the interrupt event
handler to avoid the unnecessary check and arranges the interrupt
handler for more interrupt supports in the future.

Comment was added in the new function to explain the inconsistent
link status reason.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/thunderx: add device speed capability info
Jerin Jacob [Mon, 4 Sep 2017 15:10:06 +0000 (20:40 +0530)]
net/thunderx: add device speed capability info

updated nicvf feature file to mark support.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agonet/vmxnet3: fix MAC address set
David Harton [Fri, 25 Aug 2017 18:54:57 +0000 (14:54 -0400)]
net/vmxnet3: fix MAC address set

Updated vmxnet3_mac_addr_set() to store the newly set MAC address.
Modified vmxnet3_write_mac() so the h/w is updated in an endian
neutral manner.

Fixes: 139f39a97859 ("vmxnet3: support setting MAC address")
Cc: stable@dpdk.org
Signed-off-by: David Harton <dharton@cisco.com>
Acked-by: Shrikrishna Khare <skhare@vmware.com>
7 years agonet/vmxnet3: replenish ring buffers in Rx
David Harton [Fri, 25 Aug 2017 15:22:11 +0000 (11:22 -0400)]
net/vmxnet3: replenish ring buffers in Rx

vmxnet3 Rx processing should replenish ring buffers after new buffers
are available to prevent the interface from getting stuck in a state
that no new work is processed.

Signed-off-by: David Harton <dharton@cisco.com>
Acked-by: Shrikrishna Khare <skhare@vmware.com>
7 years agonet/ixgbe: remove unnecessary void casts
Stephen Hemminger [Wed, 23 Aug 2017 15:44:45 +0000 (08:44 -0700)]
net/ixgbe: remove unnecessary void casts

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
7 years agonet/i40e: remove unnecessary void casts
Stephen Hemminger [Wed, 23 Aug 2017 15:44:44 +0000 (08:44 -0700)]
net/i40e: remove unnecessary void casts

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/igb: remove unnecessary void casts
Stephen Hemminger [Wed, 23 Aug 2017 15:44:43 +0000 (08:44 -0700)]
net/igb: remove unnecessary void casts

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
7 years agonet/sfc: remove unnecessary void casts
Stephen Hemminger [Wed, 23 Aug 2017 15:44:42 +0000 (08:44 -0700)]
net/sfc: remove unnecessary void casts

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
7 years agonet/bnx2x: remove unnecessary void casts
Stephen Hemminger [Wed, 23 Aug 2017 15:44:41 +0000 (08:44 -0700)]
net/bnx2x: remove unnecessary void casts

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
7 years agoapp/testpmd: remove unnecessary void casts
Stephen Hemminger [Wed, 23 Aug 2017 15:44:40 +0000 (08:44 -0700)]
app/testpmd: remove unnecessary void casts

The testpmd was doing old BSD lint style casts of rte_memcpy
to (void). This is unnecessary.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/ixgbe: fix adding a mirror rule
Wei Dai [Tue, 5 Sep 2017 09:16:57 +0000 (17:16 +0800)]
net/ixgbe: fix adding a mirror rule

mirror rule_type can be a bit OR result of multiple mirror type of
a rule.

Fixes: 7ba29a76b196 ("ethdev: rename and extend the mirror type")
Cc: stable@dpdk.org
Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/mlx4: merge interrupt collector function
Adrien Mazarguil [Tue, 5 Sep 2017 12:56:39 +0000 (14:56 +0200)]
net/mlx4: merge interrupt collector function

Since interrupt handler is the only function relying on it, merging them
simplifies the code as there is no need for an API to return collected
events.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: fix rescheduled link status check
Adrien Mazarguil [Tue, 5 Sep 2017 12:56:38 +0000 (14:56 +0200)]
net/mlx4: fix rescheduled link status check

Link status is sometimes inconsistent during a LSC event. When it occurs,
the PMD refrains from immediately notifying the application; instead, an
alarm is scheduled to check link status later and notify the application
once it has settled.

The problem is that subsequent link status checks are only performed if
additional LSC events occur in the meantime, which is not always the case.

Worse, since support for removal events was added, rescheduled link status
checks may consume them as well without notifying the application. With the
right timing, a link loss occurring just before a device removal event may
hide it from the application.

Fixes: 6dd7b7056d7f ("net/mlx4: support device removal event")
Fixes: 2d449f7c52de ("net/mlx4: fix assertion failure on link update")
Cc: stable@dpdk.org
Reported-by: Matan Azrad <matan@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: fix unhandled event debug message
Adrien Mazarguil [Tue, 5 Sep 2017 12:56:37 +0000 (14:56 +0200)]
net/mlx4: fix unhandled event debug message

When LSC or RMV events are received by the PMD but are not requested by the
application, a misleading debugging message implying the PMD does not
support them is shown.

Fixes: 6dd7b7056d7f ("net/mlx4: support device removal event")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agodoc: create different features files for NFP drivers
Alejandro Lucero [Fri, 1 Sep 2017 14:12:21 +0000 (15:12 +0100)]
doc: create different features files for NFP drivers

NFP PMD implement now PF and VF drivers. Although the driver
functionality is the same by now, except for initialization, it
will change with future PF additions.

A new feature is required for describing the firmware upload
capability coming with the NFP PF now, so the PF file will be
updated soon in another patch.

SRIOV is not supported by the PF yet, and it is wrong to include it
as a VF driver feature, so none of the files have such a feature.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agodoc: update release notes with NFP PF support
Alejandro Lucero [Fri, 1 Sep 2017 14:12:20 +0000 (15:12 +0100)]
doc: update release notes with NFP PF support

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agodoc: update NFP with PF support information
Alejandro Lucero [Wed, 6 Sep 2017 15:14:16 +0000 (16:14 +0100)]
doc: update NFP with PF support information

NFP PMD has now support for both, PF and VFs. This patch updates
the guide and give some information about implications.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Reviewed-by: John McNamara <john.mcnamara@intel.com>
7 years agonet/nfp: read PF port MAC addr using NSP
Alejandro Lucero [Fri, 1 Sep 2017 14:12:18 +0000 (15:12 +0100)]
net/nfp: read PF port MAC addr using NSP

During initialization, mac address is read from configuration bar. This is
the default option when using VFs.

This patch adds support for reading the mac address using the NSPU
interface when PMD works with the PF.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/nfp: support HW port link configuration
Alejandro Lucero [Fri, 1 Sep 2017 14:12:17 +0000 (15:12 +0100)]
net/nfp: support HW port link configuration

PMD has to configure the hardware port: link up when port started and
link down when port stopped. This is not required for VFs but it is
for PF ports.

A minor refactoring in PMD stop and close functions is done because the
Link down needs to happen just when device is stopped.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/nfp: add NSP support for HW link configuration
Alejandro Lucero [Fri, 1 Sep 2017 14:12:16 +0000 (15:12 +0100)]
net/nfp: add NSP support for HW link configuration

Adding a new NSPU command for being able to read and write the ethernet
port table from/to the NFP. This will allow the PMD to put the Link up
or down when a port is started or stopped. Until now, this was performed
by the firmware independently of PMD functionality.

The ethernet port table has also some other useful information that will
be used in further commits.

Usually NSPU is used at device probe time and that is sequential code
execution. However, reading and writing the NFP eth table can be done at
different times and from different cores, and it implies it could happen
a concurrent access. A spinlock is added to the global nspu object for
protecting the NFP and avoiding the concurrent access.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/nfp: support PF multiport
Alejandro Lucero [Fri, 1 Sep 2017 14:12:15 +0000 (15:12 +0100)]
net/nfp: support PF multiport

A NFP PF PCI device can have several physical ports, up to 8. Because
DPDK core creates one eth_dev per PCI device, nfp pf probe function
is used. Number of PF ports is obtained from firmware symbol using
NSPU API. Inside PF probe function an eth_dev per port is created and
nfp_net_init invoked for each port.

There are some limitations regarding multiport: rx interrupts and
device hotplug are not supported.

Interrupts are handled with the VFIO or UIO drivers help. Those
drivers just know about PCI devices, so it is not possible, without
changing how DPDK handles interrupts, manage interrupts assigned to
different PF ports.

About hotplug, the problem is this functionality is based on a PCI
device, and although device plugin is possible, which would add as
many ports as supported by firmware, unplug is based on device name
linked to a eth_dev, and device name has a suffix now (_portX, with X
being the port index) which DPDK core is not aware of. While rx
interrupts with multiport could be likely solved with some layer of
indirection, hotplug would require changes to DPDK core.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/nfp: allocate ethernet device from PF probe function
Alejandro Lucero [Fri, 1 Sep 2017 14:12:14 +0000 (15:12 +0100)]
net/nfp: allocate ethernet device from PF probe function

NFP can support several physical ports per PF device. Depending on
firmware info, one or more eth_dev objects will need to be created.

This patch adds the call to create just one eth_dev by now with future
commits supporting the multiport option. Once the eth_dev has been
created, probe function invokes pmd initialization with the new eth_dev.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/nfp: support PF devices inside PMD initialization
Alejandro Lucero [Fri, 1 Sep 2017 14:12:13 +0000 (15:12 +0100)]
net/nfp: support PF devices inside PMD initialization

nfp_net_init is where a dpdk port related to a eth_dev is initialized.
NFP VF vNICs use VF PCI BARs as they come after SRIOV is enabled. But for
NFP PF vNIC just a subset of PF PCI BARs are used.

This patch adds support for mapping the right PCI BAR subsets for the PF
vNIC. It uses the NSPU API functions introduced previously for configuring
NFP expansion bars.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/nfp: support vNIC Rx/Tx BAR mappings
Alejandro Lucero [Fri, 1 Sep 2017 14:12:12 +0000 (15:12 +0100)]
net/nfp: support vNIC Rx/Tx BAR mappings

NFP vNICs use a subset of PCI device BARs. vNIC rx/tx bars point to
NFP hardware queues unit. Unlike vNIC config bar, the NFP address is
always the same so the NFP expansion bar configuration always uses
the same hardcoded physical address.

This patch adds a NSPU API function for getting vNIC rx/tx bars
mapped through a expansion bar using that specific physical address.

The PMD will use the PCI bar offset returned for mapping the vNIC
rx/tx bars.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/nfp: support vNIC config BAR mapping
Alejandro Lucero [Fri, 1 Sep 2017 14:12:11 +0000 (15:12 +0100)]
net/nfp: support vNIC config BAR mapping

NFP vNICs use a subset of PCI device BARs. vNIC config bar depends on
firmware symbol defining how to map it through a NFP expansion bar.

This patch adds a NSPU API function for getting a vNIC config bar
mapped through a expansion bar giving a firmware symbol. The PMD will
use the PCI bar offset returned for accessing the vNIC bar.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/nfp: add FW upload logic
Alejandro Lucero [Fri, 1 Sep 2017 14:12:10 +0000 (15:12 +0100)]
net/nfp: add FW upload logic

PMD will use this function for uploading the firmware. First, a
symbol resolution is done for finding out if there is a firmware
already there. If not, a NFP reset is called before using NSPU
fw upload code.

PMD PF probe function is now using this logic.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/nfp: add NSP symbol resolution command
Alejandro Lucero [Fri, 1 Sep 2017 14:12:09 +0000 (15:12 +0100)]
net/nfp: add NSP symbol resolution command

Firmware has symbols helping to configure things like number of
PF ports, vNIC BARs addresses inside NFP memories, or ethernet
link state. Different firmware apps have different things to map
and likely different internal NFP addresses to use.

Host drivers can use the NSPU interface for getting symbol data
regarding different hardware configurations. Once the driver has
the information about a specific object, a mapping is required
configuring an NFP expansion bar creating a device PCI bar window.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/nfp: add NSP FW upload command
Alejandro Lucero [Fri, 1 Sep 2017 14:12:08 +0000 (15:12 +0100)]
net/nfp: add NSP FW upload command

Using NSPU interface for fw upload. Firmware file needs to be
installed in specific path inside system firmware directory.

NSPU buffer is used for writing the firmware before sending the
command.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/nfp: add NSP support for commands
Alejandro Lucero [Fri, 1 Sep 2017 14:12:07 +0000 (15:12 +0100)]
net/nfp: add NSP support for commands

NSPU interface declares a buffer controlled by the NFP NSP service
processor. It is possible to send commands to the NSP using the NSPU
and this buffer for data related to the command. A command can imply
buffer read, buffer write, both or none.

Initial command for resetting the firmware is added as well which
does not require the buffer at all.

Commands will allow firmware upload, symbol resolution and ethernet
link configuration. Future commands will allow specific offloads like
flow offloads and eBPF offload.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/nfp: support new PCI id
Alejandro Lucero [Fri, 1 Sep 2017 14:12:06 +0000 (15:12 +0100)]
net/nfp: support new PCI id

A NFP PF PCI devices can have PCI ID 4000 or 6000.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/nfp: add specific PF probe function
Alejandro Lucero [Fri, 1 Sep 2017 14:12:05 +0000 (15:12 +0100)]
net/nfp: add specific PF probe function

Configuring the NFP PMD for using the PF requires access through the
NSPU interface for device configuration. This patch adds a specific probe
function for the PF which uses the NSPU interface. Just basic NSPU access
is done by now reading the NSPU ABI version.

NSPU ABI version needs to be greater than 0.19.

No ethernet port is created yet.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/nfp: add NSP user space interface
Alejandro Lucero [Fri, 1 Sep 2017 14:12:04 +0000 (15:12 +0100)]
net/nfp: add NSP user space interface

Working with the PF requires access to the NFP for basic configuration.
NSP is the NFP Service Processor helping with hardware and firmware
configuration. NSPU is the NSP user space interface for working with the
NSP.

Configuration through NSPU allows to create PCI BAR windows for accessing
different NFP hardware units, including the BAR window for the NSPU
interface access itself. NFP expansion bar registers are used for creating
those PCI BAR windows. NSPU uses a specific expansion bar which is
reprogrammed for accessing/doing different things.

Other expansion bars will be configured later for configuring the PF vNIC
bars, a subset of PF PCI BARs.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/cxgbe: fix memory leak
Congwen Zhang [Tue, 5 Sep 2017 08:46:57 +0000 (16:46 +0800)]
net/cxgbe: fix memory leak

In function t4_wr_mbox_meat_timeout(), dynamic memory stored
in 'temp' variable and it is not freed when the function return,
this is a possible memory leak.

Fixes: 3bd122eef2cc ("cxgbe/base: add hardware API for Chelsio T5 series adapters")
Cc: stable@dpdk.org
Signed-off-by: Congwen Zhang <zhang.congwen@zte.com.cn>
Acked-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
7 years agonet/mlx5: fix tunnel offload detection
Xueming Li [Mon, 4 Sep 2017 11:43:51 +0000 (19:43 +0800)]
net/mlx5: fix tunnel offload detection

PMD driver got random tunnel_en value on ConnextX-4LX NIC, depends on
compile optimization level. The variable was not initialized and
detection logic was absent.

Fixes: f5fde5205101 ("net/mlx5: add hardware checksum offload for tunnel packets")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/i40e: remove unused and incorrect definition
Jingjing Wu [Sun, 3 Sep 2017 18:37:38 +0000 (02:37 +0800)]
net/i40e: remove unused and incorrect definition

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agonet/failsafe: fix adding MAC error report miss
Matan Azrad [Sun, 3 Sep 2017 15:26:45 +0000 (18:26 +0300)]
net/failsafe: fix adding MAC error report miss

The corrupted code don't reply error in case of MAC
address adding failure while failsafe PMD was trying
to apply configuration to the sub device.

Hence, the application may get unwanted packets.

The fix adds error report for this case.

Fixes: ebea83f899d8 ("net/failsafe: add plug-in support")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
7 years agonet/mlx4: rely on ethdev for Tx/Rx queue arrays
Adrien Mazarguil [Fri, 1 Sep 2017 08:07:06 +0000 (10:07 +0200)]
net/mlx4: rely on ethdev for Tx/Rx queue arrays

Allocation and management of Tx/Rx queue arrays is done by wrappers at the
ethdev level. The resulting information is copied to the private structure
while configuring the device, where it is managed separately by the PMD.

This is redundant and consumes space in the private structure.

Relying more on ethdev also means there is no need to protect the PMD
against burst function calls while closing the device anymore.

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

Considering the remaining functionality, the only difference between
isolated and non-isolated mode is that a default MAC flow rule is present
with the latter.

The restriction on enabling isolated mode before creating any queues can
therefore be lifted.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: clean up includes and comments
Adrien Mazarguil [Fri, 1 Sep 2017 08:07:04 +0000 (10:07 +0200)]
net/mlx4: clean up includes and comments

Add missing includes and sort them, then update/remove comments around them
for consistency.

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

No impact on functionality.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: rename private functions in flow API
Adrien Mazarguil [Fri, 1 Sep 2017 08:07:02 +0000 (10:07 +0200)]
net/mlx4: rename private functions in flow API

While internal static functions do not cause link time conflicts, this
differentiates them from their mlx5 PMD counterparts while debugging.

No impact on functionality.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
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>