dpdk.git
7 years agonet/qede/base: avoid possible race condition
Rasesh Mody [Tue, 19 Sep 2017 01:29:58 +0000 (18:29 -0700)]
net/qede/base: avoid possible race condition

There's a possible race in multiple VF scenarios for base driver users
that use the optional APIs ecore_iov_pf_get_and_clear_pending_events,
ecore_iov_pf_add_pending_events. If the client doesn't synchronize the two
calls, it's possible for the PF to clear a VF pending message indication
without ever getting it [as 'get & clear' isn't atomic], leading to VF
timeout on the command.

The solution is to switch into a per-VF indication rather than having a
bitfield for the various VFs with pending events. As part of the solution,
the setting/clearing of the indications is done internally by base driver.
As a result, ecore_iov_pf_add_pending_events is no longer needed and
ecore_iov_pf_get_and_clear_pending_events loses the 'and_clear' from its
name as its now a proper getter.

A VF would be considered 'pending' [I.e., get_pending_events() should
have '1' for it in its bitfield] beginning with the PF's base driver
recognizing a message sent by that VF [in SP_DPC] and ending only when
that VF message is processed.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: prevent re-assertions of parity errors
Rasesh Mody [Tue, 19 Sep 2017 01:29:57 +0000 (18:29 -0700)]
net/qede/base: prevent re-assertions of parity errors

Prevent parity errors from being re-asserted. Mask any parity error, even
if it is not associated with a HW block.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: use passed ptt handler
Rasesh Mody [Tue, 19 Sep 2017 01:29:56 +0000 (18:29 -0700)]
net/qede/base: use passed ptt handler

Use the ptt[PF translation table] handler that is passed rather than using
main ptt from the HW function.
In ecore_hw_get_resc()'s error flow, release the MFW generic resource lock
only if needed.
Change the verbosity level of GRC timeout from DP_INFO() to DP_NOTICE().
Reduce verbosity of print in ecore_hw_bar_size().

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: add EEE support
Rasesh Mody [Tue, 19 Sep 2017 01:29:55 +0000 (18:29 -0700)]
net/qede/base: add EEE support

- Base driver EEE (Energy efficient ethernet) support.
 - Provide supported-speed mask to driver though shared memory.
 - Read/use eee-supported capabilities value from the shared memory.
 - Update qed_fill_link() to advertise the EEE capabilities.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: add mdump sub-commands
Rasesh Mody [Tue, 19 Sep 2017 01:29:54 +0000 (18:29 -0700)]
net/qede/base: add mdump sub-commands

- Add support to retain/clear data for crash dump by introducing the mdump
   GET_RETAIN/CLR_RETAIN sub commands, new APIs
   ecore_mcp_mdump_get_retain() and ecore_mcp_mdump_clr_retain()
 - Avoid checking for mdump logs and data in case of an emulator
 - Fix "deadbeaf" returned value in case of pcie status command read
   fails (prevent false detection)

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: alter driver's force load behavior
Rasesh Mody [Tue, 19 Sep 2017 01:29:53 +0000 (18:29 -0700)]
net/qede/base: alter driver's force load behavior

- Add an option to override the default force load behavior.
 - PMD will set the override force load parameter to
   ECORE_OVERRIDE_FORCE_LOAD_ALWAYS.
 - Modify the printout when a force load is required to include the loaded
   value
 - No need for 'default' when switching over enums and covering all the
   values.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: add SmartAN support
Rasesh Mody [Tue, 19 Sep 2017 01:29:52 +0000 (18:29 -0700)]
net/qede/base: add SmartAN support

Add SmartAN feature that automatically detects peer switch capabilities
which relieves users from fumbling with adapter and switch configuration
Add new cmd DRV_MSG_CODE_GET_MFW_FEATURE_SUPPORT. Add new SmartLinQ config
method using NVM cfg options 239.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: add a sanity check
Rasesh Mody [Tue, 19 Sep 2017 01:29:51 +0000 (18:29 -0700)]
net/qede/base: add a sanity check

Add a sanity check that the offset being used to access the runtime array
is not greater/equal than/to RUNTIME_ARRAY_SIZE

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: fix to use a passed ptt handle
Rasesh Mody [Tue, 19 Sep 2017 01:29:50 +0000 (18:29 -0700)]
net/qede/base: fix to use a passed ptt handle

Fix ecore_configure_vp_wfq_on_link_change() to use a provided ptt[PF
translation table] handle instead of directly using p_dpc_ptt

Fixes: ec94dbc57362 ("qede: add base driver")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: restrict cache line size register padding
Rasesh Mody [Tue, 19 Sep 2017 01:29:49 +0000 (18:29 -0700)]
net/qede/base: restrict cache line size register padding

Add a restriction on the pad to cache line size register.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: add API to configure coalescing for VF queues
Rasesh Mody [Tue, 19 Sep 2017 01:29:48 +0000 (18:29 -0700)]
net/qede/base: add API to configure coalescing for VF queues

Add API for PF to configure coalescing for VF queues.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: interchangeably use SB between PF and VF
Rasesh Mody [Tue, 19 Sep 2017 01:29:47 +0000 (18:29 -0700)]
net/qede/base: interchangeably use SB between PF and VF

Status Block reallocation - allow a PF and its child VF to change SB
between them using new base driver APIs.

The changes that are inside base driver flows are:

New APIs ecore_int_igu_reset_cam() and ecore_int_igu_reset_cam_default()
added to reset IGU CAM.
 a. During hw_prepare(), driver would re-initialize the IGU CAM.
 b. During hw_stop(), driver would initialize the IGU CAM to default.

Use igu_sb_id instead of sb_idx [protocol index] to allow setting of
the timer-resolution in CAU[coalescing algorithm unit] for all SBs,
sb_idx could limit SBs 0-11 only to be able change their timer-resolution.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: changes for VF queue zone
Rasesh Mody [Tue, 19 Sep 2017 01:29:46 +0000 (18:29 -0700)]
net/qede/base: changes for VF queue zone

Allow opening Multiple Tx queues on a single qzone for VFs.
This is supported by Rx/Tx TLVs now having an additional extended TLV that
passes the `qid_usage_idx', a unique number per each queue-cid that was
opened for a given queue-zone.

Fix to overcome TX timeout issue due to more than 16 CIDs by adding an
additional VF legacy mode. This will detach the CIDs from the original
only-existing legacy mode suited for older releases.
Following this change, only VFs that would publish VFPF_ACQUIRE_CAP_QIDS
would have the new CIDs scheme applied. I.e., the new 'legacy' mode is
actually whether this capability is published or not.

Changed the logic to clear doorbells for legacy and non-legacy VFs, so
the PF is cleaning the doorbells for both cases.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: convert device type to enum
Rasesh Mody [Tue, 19 Sep 2017 01:29:45 +0000 (18:29 -0700)]
net/qede/base: convert device type to enum

Add a new enum for device type and device type details to device info.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: allocate VF queues before PF
Rasesh Mody [Tue, 19 Sep 2017 01:29:44 +0000 (18:29 -0700)]
net/qede/base: allocate VF queues before PF

Change the order by which we allocate the resources to align with
management FW by first allocating the VF l2 queues and only
afterwards use what's left for the PF.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: use crc32 OSAL macro
Rasesh Mody [Tue, 19 Sep 2017 01:29:43 +0000 (18:29 -0700)]
net/qede/base: use crc32 OSAL macro

Move ecore_crc32() macro to within base driver to qede_crc32() and use
OSAL_CRC32() where required.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: update management FW supported features
Rasesh Mody [Tue, 19 Sep 2017 01:29:42 +0000 (18:29 -0700)]
net/qede/base: update management FW supported features

- Add transceivers temperature monitoring/reporting feature
 - Add new mbox command DRV_MSG_CODE_FEATURE_SUPPORT to exchange info
   between drivers and management FW regarding features supported
 - Add EEE to Link Flap Avoidance check, etc.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/qede/base: add NVM config options
Rasesh Mody [Tue, 19 Sep 2017 01:29:41 +0000 (18:29 -0700)]
net/qede/base: add NVM config options

Add new NVM configuration options like
 - enabling Preboot Debug Mode,
 - 20G ethernet backplane support,
 - add RDMA to NPAR protocol list,
 - PHY module temperature thresholds, etc.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
7 years agonet/i40e: fix variable assignment
Jingjing Wu [Mon, 18 Sep 2017 18:53:06 +0000 (02:53 +0800)]
net/i40e: fix variable assignment

rx/tx_queue_setup functions are shared between PF and VF
drivers. So the var 'pf' should not be assigned at the beginning.
This patch fixes the issue, and also corrects the return err code.

Fixes: b6583ee40265 ("i40e: full VMDQ pools support")
Cc: stable@dpdk.org
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e/base: fix bool definition
Jingjing Wu [Mon, 18 Sep 2017 18:11:28 +0000 (02:11 +0800)]
net/i40e/base: fix bool definition

Use stdbool.h instead of defining the bool type, to make
sure the virtchnnl msg format definition is the same
between PF and VF.

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Cc: stable@dpdk.org
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/mlx5: replace network to host macros
Shachar Beiser [Sun, 17 Sep 2017 10:42:02 +0000 (10:42 +0000)]
net/mlx5: replace network to host macros

Signed-off-by: Shachar Beiser <shacharbe@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/igb: fix memcpy length
Yong Wang [Tue, 12 Sep 2017 12:44:00 +0000 (08:44 -0400)]
net/igb: fix memcpy length

The size of "flex_filter.filter_info.mask" and "filter->mask" are 16
bytes, but the length of memcpy--"RTE_ALIGN(filter->len, sizeof(char))
/ sizeof(char)" may reach 128 bytes which may cause array access out
of bound.

Fix it by replacing "sizeof(char)" by "CHAR_BIT".

Fixes: 231d43909a31 ("igb: migrate flex filter to new API")
Cc: stable@dpdk.org
Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agonet/liquidio: fix uninitialized variable
Yong Wang [Fri, 15 Sep 2017 11:48:28 +0000 (07:48 -0400)]
net/liquidio: fix uninitialized variable

In func lio_dev_link_update(), "link.link_autoneg" is used in func call
lio_dev_atomic_write_link_status(), but it is uninitialized.

Fixes: 3766020513df ("net/liquidio: add APIs to start device and update link")
Cc: stable@dpdk.org
Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
7 years agonet/mlx5: fix TSO segment size verification
Shahaf Shuler [Sun, 17 Sep 2017 08:12:49 +0000 (11:12 +0300)]
net/mlx5: fix TSO segment size verification

TSO segment size must be larger then 0.

Fixes: 3f13f8c23a7c ("net/mlx5: support hardware TSO")
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/tap: fix flow and port commands
Ophir Munk [Sat, 16 Sep 2017 22:32:38 +0000 (22:32 +0000)]
net/tap: fix flow and port commands

This commit fixes two bugs related to tap devices. The first bug occurs
when executing in testpmd the following flow rule assuming tap device has
4 rx and tx pair queues
"flow create 0 ingress pattern eth / end actions queue index 5 / end"
This command will report on success and will print ""Flow rule #0 created"
although it should have failed as queue index number 5 does not exist

The second bug occurs when executing in testpmd "port start all" following
a port configuration. Assuming 1 pair of rx and tx queues an error is
reported: "Fail to start port 0"

Before this commit a fixed max number (16) of rx and tx queue pairs were
created on startup where the file descriptors (fds) of rx and tx pairs were
identical.  As a result in the first bug queue index 5 existed because the
tap device was created with 16 rx and tx queue pairs regardless of the
configured number of queues. In the second bug when tap device was started
tx fd was closed before opening it and executing ioctl() on it. However
closing the sole fd of the device caused ioctl to fail with "No such
device".

This commit creates the configured number of rx and tx queue pairs (up to
max 16) and assigns a unique fd to each queue. It was written to solve the
first bug and was found as the right fix for the second bug as well.

Fixes: 02f96a0a82d1 ("net/tap: add TUN/TAP device PMD")
Fixes: bf7b7f437b49 ("net/tap: create netdevice during probing")
Fixes: de96fe68ae95 ("net/tap: add basic flow API patterns and actions")
Cc: stable@dpdk.org
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Pascal Mazon <pascal.mazon@6wind.com>
7 years agotest: fix assignment operation
Zhiyong Yang [Fri, 15 Sep 2017 02:35:57 +0000 (10:35 +0800)]
test: fix assignment operation

This should be an comparison operation rather than an assignment
operation.

Fixes: 5e41ab250dfa ("app/test: unit tests for bonding mode 4")
Cc: stable@dpdk.org
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agonet/ixgbe: eliminate duplicate filterlist symbols
David Harton [Thu, 14 Sep 2017 12:50:41 +0000 (08:50 -0400)]
net/ixgbe: eliminate duplicate filterlist symbols

Some compilers generate warnings for duplicate symbols for the
set of filter lists current defined in ixgbe_ethdev.h.

This commits moves the definition and declaration to the source
file that actually uses them and provides a function to
initialize the values akin to its flush function.

Signed-off-by: David Harton <dharton@cisco.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Radu Nicolau <radu.nicolau@intel.com>
7 years agonet/nfp: write PF MAC to config BAR
Alejandro Lucero [Wed, 13 Sep 2017 20:55:45 +0000 (21:55 +0100)]
net/nfp: write PF MAC to config BAR

VFs rely on config BAR for getting the MAC address, although a
random one is created a valid address is not found.

A PF port has a fixed MAC which is currently acquired using the NSPU
interface. Some NFP firmwares require the MAC being writing back
to the config BAR for doing proper MAC filtering.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/nfp: configure capabilities by default
Alejandro Lucero [Wed, 13 Sep 2017 11:28:16 +0000 (12:28 +0100)]
net/nfp: configure capabilities by default

These capabilities are enabled in current NFP firmwares by
default, but it could be they are not with NFP firmwares to come.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/nfp: configure L2 broadcast and multicast
Alejandro Lucero [Wed, 13 Sep 2017 11:27:01 +0000 (12:27 +0100)]
net/nfp: configure L2 broadcast and multicast

This is required in some NFP firmwares when working with VFs.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/nfp: remove firmware ABI check
Alejandro Lucero [Mon, 11 Sep 2017 13:44:11 +0000 (14:44 +0100)]
net/nfp: remove firmware ABI check

Link speed is not advertised in old firmwares. However, it is safe
to remove the check because reading NFP_NET_CFG_STS returns 0 in
those cases.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/nfp: add info about RSS capabilities
Alejandro Lucero [Mon, 11 Sep 2017 13:27:32 +0000 (14:27 +0100)]
net/nfp: add info about RSS capabilities

NFP supports RSS but it is not being advertised.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/bonding: fix slaves capacity check
Tomasz Kulasek [Thu, 27 Jul 2017 12:00:27 +0000 (14:00 +0200)]
net/bonding: fix slaves capacity check

For i40e NIC bond_ethdev_8023ad_flow_verify fails when action queue
index indicates unavailable queue before slaves configuration.

This fix verifies flow settings for queue 0, which is always available,
and checks if slaves max queue number capacity meets requirements.

Fixes: 112891cd27e5 ("net/bonding: add dedicated HW queues for LACP control")
Cc: stable@dpdk.org
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
7 years agonet/i40e: fix packet count for PF
Qi Zhang [Sun, 20 Aug 2017 20:05:35 +0000 (04:05 +0800)]
net/i40e: fix packet count for PF

Previously, for PF statistics we use VSI register for packet count
but use port's register for packet bytes, that cause inconsistent
situation of PF statistics when some VF is active, since it will
cover VF's packet bytes but not packet count.

The patch will take port register for PF packet count back, but still
exclude main vsi's discard packet count.
Just like previous fix, its still not perfect, (since RX packet number
is over counted when there is VF discard packet) but seems it make the
overall better.

Fixes: 9aace75fc82e ("i40e: fix statistics")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
7 years agonet/sfc: free mbufs in bulks on simple EF10 Tx reap
Ivan Malov [Wed, 13 Sep 2017 09:33:34 +0000 (10:33 +0100)]
net/sfc: free mbufs in bulks on simple EF10 Tx reap

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
7 years agonet/sfc: free mbufs in bulks on EF10 native Tx reap
Ivan Malov [Wed, 13 Sep 2017 09:33:33 +0000 (10:33 +0100)]
net/sfc: free mbufs in bulks on EF10 native Tx reap

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
7 years agonet/mlx5: enforce Tx num of segments limitation
Shahaf Shuler [Thu, 14 Sep 2017 10:50:39 +0000 (13:50 +0300)]
net/mlx5: enforce Tx num of segments limitation

Mellanox NICs has a limitation on the number of mbuf segments a multi
segment mbuf can have. The max number depends on the Tx offloads
requested.

The current code not enforce such limitation, which might cause
malformed work requests to be written to the device.

This commit adds verification for the number of mbuf segments posted
to the device. In case of overflow the packet will not be sent.

In addition update the nic documentation with the limitation.
Considering device limitation is 63 data segments in a work request, the
maximum number of segment in mbuf was calculated taking TSO as the worst
case:

max_nb_segs = 63 - (control_segment + ethernet segment +
    TSO headers inline + inline segment +
    extra inline to align to cacheline)

Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: fix Tx stats error counter logic
Shahaf Shuler [Thu, 14 Sep 2017 10:50:38 +0000 (13:50 +0300)]
net/mlx5: fix Tx stats error counter logic

Tx error counter lacks the logic of incrementation, making it useless
for applications.

Fixes: 87011737b715 ("mlx5: add software counters")
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: fix Tx stats error counter definition
Shahaf Shuler [Thu, 14 Sep 2017 10:50:37 +0000 (13:50 +0300)]
net/mlx5: fix Tx stats error counter definition

The current Tx error counter counts, according to its description,
the total number of packets not sent when TX ring full. It is reported
to application as part of oerrors field.

The drop due to full ring is not the statistic that should be set on
oerrors field. Such number can be counted by the application using the
return value of the Tx burst function.
The number that should be set there is the number of packets the device
could not transmit in any way, even when it has resources.

Therefore, replace this counter to count the total number of failed
transmitted packets.

Fixes: 87011737b715 ("mlx5: add software counters")
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: fix num seg assumption in SSE Tx
Shahaf Shuler [Thu, 14 Sep 2017 10:50:36 +0000 (13:50 +0300)]
net/mlx5: fix num seg assumption in SSE Tx

vPMD Tx function assumes that after the scatter of the
multi-segment packets the next packet will be a single segment packet.

This is not current as the function can return due to lack of resources
without sending all of the multi-segment mbufs sequence.

Fixes: 6cb559d67b83 ("net/mlx5: add vectorized Rx/Tx burst for x86")
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: fix calculating TSO inline size
Yongseok Koh [Thu, 31 Aug 2017 16:27:06 +0000 (09:27 -0700)]
net/mlx5: fix calculating TSO inline size

Tx descriptor for TSO embeds packet header to be replicated. If Tx
inline is enabled, there could be additional packet data inlined with
4B inline header ahead. And between the header and additional inlined
packet data, there may be padding to make the inline part aligned to
MLX5_WQE_DWORD_SIZE. In calculating the total size of inlined data,
the size of inline header and padding is missing.

Fixes: 3f13f8c23a7c ("net/mlx5: support hardware TSO")
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/i40e: fix i40evf MAC filter table
David Harton [Wed, 13 Sep 2017 03:21:10 +0000 (23:21 -0400)]
net/i40e: fix i40evf MAC filter table

The i40e maintains a single MAC filter table for both
unicast and multicast addresses.  The i40e_validate_mac_addr
function was preventing multicast addresses from being added
to the table via i40evf_add_mac_addr.  Fixed the issue by
adjusting the check in i40evf_add_mac_addr.

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Fixes: 97ac72aa71a9 ("i40e: support setting VF MAC address")
Cc: stable@dpdk.org
Signed-off-by: David Harton <dharton@cisco.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
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>