Commit Graph

4395 Commits

Author SHA1 Message Date
Matan Azrad
295f7ed2dd net/failsafe: fix Rx clean race
When removing a device, the fail-safe checks that it is not within its
datapath before cleaning it.

When checking whether an Rx burst should be performed on a device, the
remove flag is not checked. Thus the port could still enter its datapath
and miss a removal round. Furthermore, there is a race between the
thread removing the device and the polling thread.

Check the remove flag before entering a sub-device Rx burst when in safe
mode. This check mitigates the aforementioned race condition.

Fixes: 72a57bfd9a ("net/failsafe: add fast burst functions")
Cc: stable@dpdk.org

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-27 01:05:55 +02:00
Pavan Nikhilesh
9f9fad8f21 eventdev: remove schedule API
remove eventdev schedule api and enforce sw driver to use service core
feature for event scheduling.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-10-27 00:53:07 +02:00
Pavan Nikhilesh
4c2fd9791d event/sw: extend service capability
Extend the service capability of the sw event device by exposing service id
to the application.
The application can use service id to configure service cores to run event
scheduling.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-10-27 00:53:07 +02:00
Pavan Nikhilesh
13370a3877 eventdev: fix inconsistency in queue config
With the current scheme of event queue configuration the cfg schedule
type macros (RTE_EVENT_QUEUE_CFG_*_ONLY) are inconsistent with the
event schedule type (RTE_SCHED_TYPE_*) this requires unnecessary
conversion between the fastpath and slowpath API's while scheduling
events or configuring event queues.

This patch aims to fix such inconsistency by using event schedule
types (RTE_SCHED_TYPE_*) for event queue configuration.

This patch also fixes example/eventdev_pipeline_sw_pmd as it doesn't
convert RTE_EVENT_QUEUE_CFG_*_ONLY to RTE_SCHED_TYPE_* which leads to
improper events being enqueued to the eventdev.

Fixes: adb5d5486c ("examples/eventdev_pipeline_sw_pmd: add sample app")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-10-27 00:52:57 +02:00
Jonas Pfefferle
f25f8f3676 bus/pci: check VFIO reset ioctl error
Check return value of device reset ioctl

Coverity issue: 195003
Fixes: 33604c3135 ("vfio: refactor PCI BAR mapping")

Signed-off-by: Jonas Pfefferle <jpf@zurich.ibm.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2017-10-26 23:51:39 +02:00
Jianfeng Tan
633e4c7d71 bus/pci: fix UIO bind check
When checking if any devices bound to uio, we did not exclude
those which are blacklisted (or in the case that a whitelist
is specified).

This patch fixes it by only checking whitelisted devices, or
not-blacklisted devices depending on the bus scan mode.

Fixes: 815c7deaed ("pci: get IOMMU class on Linux")

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2017-10-26 23:35:00 +02:00
Gaetan Rivet
c752998b5e pci: introduce library and driver
The PCI lib defines the types and methods allowing to use PCI elements.

The PCI bus implements a bus driver for PCI devices by constructing
rte_bus elements using the PCI lib.

Move the relevant code out of the EAL to its expected place.

Libraries, drivers, unit tests and applications are updated to use the
new rte_bus_pci.h header when necessary.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
3df742a917 net/bonding: use local prefix namespace
The current name conflicts with the librte_pci naming convention.
Additionally, it is easier to use gdb when having prefixed even private
functions.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Gaetan Rivet
279b581c89 vfio: expose functions
The following symbols are used by vfio implementations within the PCI bus.
They need to be publicly available for the PCI bus to be outside the
EAL.

  + vfio_enable;
  + vfio_is_enabled;
  + vfio_noiommu_is_enabled;
  + vfio_release_device;
  + vfio_setup_device;

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Shreyansh Jain
a57bbb68d4 event/dpaa2: fix shared build
Fixes: cbc12b0a96 ("mk: do not generate LDLIBS from directory dependencies")
Fixes: b677d4c6d2 ("net/dpaa2: add API for event Rx adapter")

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2017-10-26 23:04:54 +02:00
Shreyansh Jain
22f5f3cb6b crypto/dpaa_sec: fix shared build
Various symbols are being used by DPAA Crypto driver which were not exposed
from DPAA bus during initial version. This breaks the shared build.

This patch also adds the LDLIBS line required after (cbc12b0a9) patch.

Fixes: c3e85bdcc6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2017-10-26 22:50:53 +02:00
Radu Nicolau
6115b677bc crypto/dpaa2_sec: forbid build without security lib
Build fails when rte_security is disabled; make rte_security mandatory

Fixes: 0a23d4b6f4 ("crypto/dpaa2_sec: support protocol offload IPsec")

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
2017-10-26 22:46:58 +02:00
Radu Nicolau
71864623ba net/ixgbe: fix build without security library
Fixes: 9a0752f498 ("net/ixgbe: enable inline IPsec")

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Tested-by: David Marchand <david.marchand@6wind.com>
2017-10-26 22:30:28 +02:00
David Harton
289ba0c0f5 ethdev: allow returning error on VLAN offload ops
Some devices may not support or fail setting VLAN offload
configuration based on dynamic circumstances so the
vlan_offload_set_t vector is modified to return an int so
the caller can determine success or not.

rte_eth_dev_set_vlan_offload is updated to return the
value provided by the vector when called along with restoring
the original offload configs on failure.

Existing vlan_offload_set_t vectors are modified to return
an int.  Majority of cases return 0 but a few that actually
can fail now return their failure codes.

Finally, a vlan_offload_set_t vector is added to virtio
to facilitate dynamically turning VLAN strip on or off.

Signed-off-by: David Harton <dharton@cisco.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26 02:33:01 +02:00
Tomasz Kulasek
6abd94d72a net/bonding: fix check slaves link properties
Result of slaves link properties validation is not used when new slave
is added.

This patch uses the value of link_properties_valid() to determinate if
slave can be used in the bonding. If function fails, error is returned
preventing to add slave with invalid link properties.

Coverity issue: 158661
Fixes: deba8a2f8b ("net/bonding: fix link properties management")
Cc: stable@dpdk.org

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26 02:33:01 +02:00
Nélio Laranjeiro
5f64e6bfa1 net/mlx5: fix device stop with multiple regions
LIST macro are not safe when inside a LIST_FOREACH() a LIST_REMOVE() is
called to remove an entry, this behavior is undefined causing some entries
to disappear from the list.

Fixes: 6e78005a9b ("net/mlx5: add reference counter on DPDK Tx queues")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-26 02:33:01 +02:00
Roger Melton
3ba62841c2 net/e1000: correct VLAN tag byte order for i35x LB packets
When copying VLAN tags from the RX descriptor to the vlan_tci field
in the mbuf header,  igb_rxtx.c:eth_igb_recv_pkts() and
eth_igb_recv_scattered_pkts() both assume that the VLAN tag is always
little endian.  While i350, i354 and /i350vf VLAN non-loopback
packets are stored little endian, VLAN tags in loopback packets (LB)
for those devices are big endian.

For i350, i354 and i350vf VLAN loopback packets, swap the tag when
copying from the RX descriptor to the mbuf header.  This will ensure
that the mbuf vlan_tci is always little endian.

Signed-off-by: Roger Melton <rmelton@cisco.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-10-26 02:33:01 +02:00
Yongseok Koh
fb870be5a8 net/mlx5: fix Tx doorbell memory barrier
Configuring UAR as IO-mapped makes maximum throughput decline by
noticeable amount. If UAR is configured as write-combining register,
a write memory barrier is needed on ringing a doorbell.

rte_wmb() is mostly effective when the size of a burst is comparatively
small. Revert the register back to write-combining and enforce a write
memory barrier instead, except for vectorized Tx burst routines.
Application can change it by setting MLX5_SHUT_UP_BF under its own
necessity.

Fixes: 9f9bebae55 ("net/mlx5: don't map doorbell register to write combining")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-26 02:33:01 +02:00
Nélio Laranjeiro
2262eed752 net/mlx5: fix adjust priority for drop queue
Drop queue should also adjust their priority according the most specific
layer in the pattern they are matching to avoid dropping all the
traffic.

Fixes: 8086cf08b2 ("net/mlx5: handle RSS hash configuration in RSS flow")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2017-10-26 02:33:01 +02:00
Ferruh Yigit
f064b2cba0 net/octeontx: fix build for gcc < 4.6
-Ofast option supported starting from gcc4.6 [1], for older versions
using "-O3 -ffast-math" instead.

[1] build error:
  CC octeontx_rxtx.o
  cc1: error: invalid option argument ‘-Ofast’

Fixes: 9e747589bd ("net/octeontx: add packet transmit burst function")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2017-10-26 02:33:01 +02:00
Olivier Matz
380a7aab1a mbuf: rename deprecated VLAN flags
PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT are deprecated for a while.
As explained in [1], these flags were kept to let the applications and
PMDs move to the new flag. There is also a need to support Rx vlan
offload without vlan strip (at least for the ixgbe driver).

This patch renames the old flags for this feature, knowing that some
PMDs were using PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT to indicate that
the vlan tci has been saved in the mbuf structure.

It is likely that some PMDs do not set the proper flags when doing vlan
offload, and it would be worth making a pass on all of them.

Link: [1] http://dpdk.org/ml/archives/dev/2017-June/067712.html

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26 02:33:01 +02:00
Gaetan Rivet
00a3d8104a ethdev: remove detachable device flag
This flag is not necessary at the ether layer anymore.
Buses are able to advertise their hotplug support. The ether layer can
rely upon this capability instead of a special flag.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
bb102e1368 net/bnxt: check VLANs from pool map only for VMDq
Fixes: 75cd6fb1d9 ("net/bnxt: fix the association of a MACVLAN per VNIC")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
8159471a3a net/bnxt: fix an unused value
return value stored in "rc" but it has been overwritten before use.

Coverity issue: 147216
Fixes: 7a5b087444 ("net/bnxt: support to add a VF MAC address")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
60fff858ad net/bnxt: fix a pointer deref before null check
Coverity issue: 158634
Fixes: daef48efe5 ("net/bnxt: support set MTU")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
faabf471da net/bnxt: fix a potential null pointer dereference
Coverity issue: 158634
Fixes: daef48efe5 ("net/bnxt: support set MTU")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
8ec40353d4 net/bnxt: fix a potential null pointer dereference
Coverity issue: 195046
Fixes: f7ecea911e ("net/bnxt: fix interrupt handler")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
90cdc91c12 net/bnxt: fix a potential null pointer dereference
Coverity issue: 195017
Fixes: 5ef3b79fdf ("net/bnxt: support flow filter ops")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
e6bea83ee3 net/bnxt: fix a pointer deref before null check
Coverity issue: 195015
Fixes: b7435d660a ("net/bnxt: add ntuple filtering support")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
1498060ffb net/bnxt: fix a potential null pointer dereference
Fix a potential null pointer reported by Coverity.

Coverity issue: 195001
Fixes: 5ef3b79fdf ("net/bnxt: support flow filter ops")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
9c7b024296 net/bnxt: fix a bit shift operation
We are left shifting more bits than we should be doing.
This patch fixes that.

Coverity issue: 127546
Fixes: 778b759ba1 ("net/bnxt: add MAC address")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
231bd2a2dd net/bnxt: fix redirecting traffic to a VF
The case to handle redirect a flow to a VF is not handled.
This patch fixes it.

Fixes: 5ef3b79fdf ("net/bnxt: support flow filter ops")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
6eda9e550e net/bnxt: remove redundant code parsing pool map
This patch removes some redundant code from bnxt_mq_rx_configure().

Fixes: 75cd6fb1d9 ("net/bnxt: fix the association of a MACVLAN per VNIC")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
8103a57ab4 net/bnxt: handle Rx multi queue creation properly
This patch simplifies logic for RSS queue creation.
1) Do not hardcode number of VNIC pools in case of RSS
2) Log a message if Number of queues is > RTE_ETHDEV_QUEUE_STAT_CNTRS
3) Move the check for allocation of l2_filter inside the for loop.

Fixes: 6133f20797 ("net/bnxt: add Rx queue create/destroy")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
0489c654e5 net/bnxt: fix Rx offload capability
We are not setting the rx_offload capabilities. Fixing that.

Fixes: 0a6d2a7200 ("net/bnxt: get device infos")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
1a54416d9a net/bnxt: fix Tx offload capability
We are not indicating VLAN insert capability of HW. Fixing it.

Fixes: 0a6d2a7200 ("net/bnxt: get device infos")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Ajit Khaparde
2bc5130146 net/bnxt: update HWRM to 1.8.2
This patch updates the HWRM API to version 1.8.2

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-26 02:33:01 +02:00
Wei Zhao
70697032d5 net/i40e: fix queue number error in queue region
when VSI is enabled with smaller number of queues, for example 1 or 6,
it will cause error.

64 is the max number of queues that can be used for RSS, but VSI might
be created with only few queues.

Fixes: 7cbecc2f74 ("net/i40e: support queue region set and flush")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26 02:33:01 +02:00
Xiao Wang
ac0decfa08 net/fm10k: support switch restart on VF
For VF events indicating a change in the state of the switch manager,
the driver will restore the basic port configurations and then pass this
event to application so that the application can restore any additional
configurations if required.

In this way, once the switch manager restarts, the DPDK application can
resume its network.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26 02:33:01 +02:00
Xiao Wang
6c9f372455 net/fm10k: support switch restart on PF
For PF events indicating a change in the state of the switch manager,
the driver will restore the basic port configurations and then pass this
event to application so that the application can restore any additional
configurations if required.

In this way, once the switch manager restarts, the DPDK application can
resume its network.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26 02:33:01 +02:00
Xiao Wang
6f22f2f672 net/fm10k: redefine link status semantics
As fm10k host interface is not directly connected to PHY, marking the
link status as UP doesn't mean a lot to the application.

So, this patch basically redefines the link status as the state of
switch manager: when switch manager is running, it's LINK_UP;
when switch manager goes down by calling the fmTerminate function,
status turns to LINK_DOWN.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26 02:33:01 +02:00
Nélio Laranjeiro
db303de11e net/mlx5: fix flow director flow add
Flows are added by priv_flow_create() in the associated list, adding them a
second time corrupts the list causing an infinite loop when parsing it.

Fixes: 4c3e9bcdd5 ("net/mlx5: support flow director")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2017-10-26 02:33:01 +02:00
Nélio Laranjeiro
f8cb4b57e6 net/mlx5: fix reception when VLAN is added
When VLAN is enabled in the Rx side, only packets matching this VLAN are
expected, this also includes the broadcast and all multicast packets.

Fixes: 272733b5eb ("net/mlx5: use flow to enable unicast traffic")
Fixes: 6a6b6828fe ("net/mlx5: use flow to enable all multi mode")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2017-10-26 02:33:01 +02:00
Nélio Laranjeiro
d5b854f2b1 net/mlx5: fix mark action with drop action
Marking a packet which will not be received by the NIC is useless, even
if this action remains possible, it blocks the creation of the flow
counter which embed a mark action to a drop queue to be created.

Fixes: 31ba9997f1 ("net/mlx5: fully convert a flow to verbs in validate")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2017-10-26 02:33:01 +02:00
Nélio Laranjeiro
afca916135 net/mlx5: fix flow director drop action
Flow director drop action as not been brought back with the new
implementation on top of rte flow.

Fixes: 4c3e9bcdd5 ("net/mlx5: support flow director")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2017-10-26 02:33:01 +02:00
Nélio Laranjeiro
79b0fb7096 net/mlx5: fix drop flows when port is stopped
Fix the drop queue rule creation when the port is stopped.

Fixes: 8086cf08b2 ("net/mlx5: handle RSS hash configuration in RSS flow")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2017-10-26 02:33:01 +02:00
Nélio Laranjeiro
ebd0cd832b net/mlx5: fix work queue array size
Indirection table size must be in log to communicate with verbs when the
number of queue is not a power of two, the maximum indirection table
size is use, but not converted to log2.  This makes a memory corruption.

Fixes: 4c7a0f5ff8 ("net/mlx5: make indirection tables shareable")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2017-10-26 02:33:01 +02:00
Nélio Laranjeiro
7bb5fa069d net/mlx5: fix segfault on flow creation
When ports are stopped, the hash Rx queue should not be created.

Fixes: 8086cf08b2 ("net/mlx5: handle RSS hash configuration in RSS flow")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2017-10-26 02:33:01 +02:00
Matan Azrad
a76bec521a net/mlx4: fix targetless internal rule creation
The corrupted code allowed to create internal rule with no any target
queue in case the rule creation occurred before queues creation.

For example, when user calls rte_eth_dev_default_mac_addr_set after
probe and before dev_configure, mlx4 fails because the RSS queue number
was 0.

The fix prevents internal rules creation before queues creation based on
future creation before traffic start.

Fixes: 7d8675956f ("net/mlx4: add RSS support outside flow API")
Fixes: bdcad2f484 ("net/mlx4: refactor internal flow rules")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-10-26 02:33:01 +02:00
Kirill Rybalchenko
412f60a0e1 net/i40e: fix unsecure usage of strncpy function
Use more secure snprintf function instead of strncpy
to prevent memory access violation.

Fixes: 40d1324423 ("net/i40e: get ddp profile protocol info")

Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
2017-10-26 02:33:01 +02:00
Kirill Rybalchenko
66c78f4799 net/i40e: add support for packet template to flow director
For complex packets use raw flow type with pre-constructed packet buffer
instead of creating a packet internally in PMD.

Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26 02:33:01 +02:00
Shahaf Shuler
3ca63b88a8 net/mlx5: fix packet type flags for Ethernet only frame
Considering the PMD supports only Ethernet transport, packet which
arrives without any packet type flags in the completion should be
marked with L2_ETHER flag.

Fixes: ea16068c00 ("net/mlx5: fix L4 packet type support")
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>
2017-10-26 02:33:01 +02:00
Wei Dai
9be9050134 net/ixgbe: fix PF DCB info
When SRIOV is active, the function ixgbe_dev_get_dcb_info( )
should return the DCB traffic class info of its own queues,
not including any DCB info of the queues of any its VF.

When VMDQ is active, all queues are belonged to the PF,
the function ixgbe_dev_get_dcb_info can return DCB info
of all queues.

Fixes: 89d6728c78 ("ethdev: get DCB information")
Cc: stable@dpdk.org

Signed-off-by: Wei Dai <wei.dai@intel.com>
Reviewed-by: Jingjing Wu <jingjing.wu@intel.com>
2017-10-26 02:33:01 +02:00
Xueming Li
50dcb0c521 net/mlx5: fix icc compiler warning
Initialize variable to avoid ICC compiler warning:
http://www.dpdk.org/ml/archives/dev/2017-October/077971.html

Fixes: f8b9a3bad4 ("net/mlx5: install a socket to exchange a file descriptor")

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-26 02:33:01 +02:00
John Daley
ea5f15b1c4 net/enic: fix packet loss after MTU change
If multiple Rx queues and Rx Scatter are used and the MTU is
modified so that the number of mbufs per packet changes, packet
loss is possible.

The enic completion queue index was miscalculated leaving the
upper half of the queues uninitialized after an MTU change, possibly
leading to completions on those queues not getting processed.

Fixes: c3e09182bc ("net/enic: support scatter Rx in MTU update")
Cc: stable@dpdk.org

Signed-off-by: John Daley <johndale@cisco.com>
2017-10-26 02:33:01 +02:00
Nélio Laranjeiro
920b4e545e net/mlx5: fix RSS hash update
Few bugs fixes in both configuration get and hash update where inputs
are not handled as expected by the ethdev layer.

RSS structure may not be totally usable, the PMD should try to take as
most information from it has it can when it is an hash update or it
should try to fill as most as possible in the configuration get.
This means that in the RSS configuration structure, the memory space for
the RSS hash key may not be present, but the PMD should consider the
hash field valid and process/set it.

Fixes: 29c1d8bb3e ("net/mlx5: handle a single RSS hash key for all protocols")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2017-10-26 02:33:01 +02:00
Nélio Laranjeiro
643456761d net/mlx5: fix flow priority for queue action
Priority is wrongly configured when the action is queue, using the
Ethernet layer priority instead of the most specific layer found.

Fixes: 8086cf08b2 ("net/mlx5: handle RSS hash configuration in RSS flow")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2017-10-26 02:33:01 +02:00
Matan Azrad
9dda3e3393 net/failsafe: add timestamp to stats snapshot
Fail-safe attempts to read an ultimate statistics on removal time; if
that fails, it uses the latest recorded snapshot.

This patch adds timestamp for each stats snapshot to allow a time report
since the last snapshot in case of the above failure.

By this way, the user can estimate the stats read accuracy.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 02:33:01 +02:00
Matan Azrad
321809bb8c net/failsafe: improve stats accuracy
The stats_get API was changed to signal a potential failure to read
stats. Furthermore, some PMDs are able to provide statistics even
after a removal event occurred.

Considering this, the fail-safe can try to access the latest
statistics of a PMD to improve statistics accuracy.

Attempt an ultimate statistics read on removal time; if that
fails, use the latest recorded snapshot.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 02:33:01 +02:00
Adrien Mazarguil
cad92582d2 net/mlx4: fix restriction on TCP/UDP flow rules
The code as currently written requires TCP/UDP source and destination
ports to be always specified.

No such restriction is enforced by hardware; all TCP and UDP traffic
can be matched by providing an empty mask for these fields.

Fixes: 680d5280c2 ("net/mlx4: refactor flow item validation code")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-26 02:33:01 +02:00
Beilei Xing
373840beaf net/i40e: fix flow director issue
For L3 or L4 packets, PCtype is parsed wrongly when
input set is VLAN only.
This patch fixes the issue.

Fixes: 15018d79f0 ("net/i40e: add FDIR support for GTP-C and GTP-U")
Fixes: 7d83c152a2 ("net/i40e: parse flow director filter")
Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2017-10-26 02:33:01 +02:00
Beilei Xing
3a112d0940 net/i40e: update parsing inner packet info
Since meta data in profile is updated, parsing inner
packet information needs to be updated, too.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2017-10-26 02:33:01 +02:00
Beilei Xing
5838a74502 net/i40e: fix string overflow issue
This patch fixes the coverity STRING_OVERFLOW issue.

Coverity issue: 195002
Fixes: e163c18a15 ("net/i40e: update ptype and pctype info")

Reported-by: John McNamara <john.mcnamara@intel.com>
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2017-10-26 02:33:01 +02:00
Raslan Darawsheh
b8f4fa4103 net/failsafe: fix PCI devices init
When trying to attach a port as a sub-device, the ethdev port
was compared with devargs.
In the case of a PCI device, the name in devargs is the PCI address.
And since DPDK 17.08, the devargs name of the underlying device was
used to match an ethdev port:
        a1e7c17555 ("ethdev: use device name from device structure")

But the recent commit 72e3efb149 has reverted this wrong matching
to use the ethdev port name as identifier of the port.
It impacts functions like rte_eth_dev_allocated() used in failsafe
for matching ports with given devargs.
The fix is to search for matching devargs in underlying device of
all ethdev ports.
If many ports match the same PCI device, only the first one is matched.

This limitation was already present in previous implementation of
rte_eth_dev_allocated(), and must be adressed later with a better
devargs syntax.

Fixes: 72e3efb149 ("ethdev: revert use port name from device structure")
Cc: stable@dpdk.org

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 02:33:01 +02:00
Adrien Mazarguil
5697a41421 net/mlx4: relax Rx queue configuration order
Various hardware limitations apply to RSS indirection tables, one of
them being they must be an exact 1:1 mapping of the configured Rx queue
indices.

While this restriction is enforced when creating RSS flow rules, it is
not the case when Rx queues themselves are created; underlying WQ
numbers are assigned in turn, not according to queue index.

Applications such as l3fwd-power that create Rx queues from highest to
lowest index (or any other non-sequential order) thus fail to get a
working RSS context.

This commit postpones WQ initialization to dev_start(), once all Rx
queues are configured in order to address this issue.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-26 02:33:01 +02:00
Adrien Mazarguil
0ef007c939 net/mlx4: fix indirection table error rollback
In case of error occurring while setting up indirection table and
related RSS context resources, intermediate objects are not cleaned up.

Moreover although unlikely, an error other than EINVAL (e.g. ENOMEM)
may be returned.

A description of mlx4_rss_attach()'s return value is also missing.

Fixes: 078b8b452e ("net/mlx4: add RSS flow rule action support")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-26 02:33:01 +02:00
Adrien Mazarguil
14f2d6688c net/mlx4: fix useless flow rules synchronization
According to the original commit, Rx queues cannot be created nor
destroyed while the device is started. Synchronizing flow rules during
such events is unnecessary as it occurs later when starting the device.

Fixes: 7977082649 ("net/mlx4: drop live queue reconfiguration support")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-26 02:33:00 +02:00
Adrien Mazarguil
ed4724c80d net/mlx4: use dedicated list iterator
Dumb unconditional iteration on flow rules should be performed using the
dedicated macro.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-26 02:33:00 +02:00
Jasvinder Singh
762be1b25b net/softnic: fix integer overflow
Fixed integer overflow by casting hard_rate to uint64_t type.

Coverity issue: 195020
Fixes: 8316b9816b ("net/softnic: support traffic management")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26 02:33:00 +02:00
Harish Patil
daee4e07fc net/qede: fix to re-enable LRO during device start
Move LRO configuration from dev_configure to dev_start so that
LRO configuration can be re-enabled following a port restart.

Fixes: 9a6d30ae6d ("net/qede: refactoring vport handling code")
Cc: stable@dpdk.org

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-10-26 02:33:00 +02:00
Harish Patil
e0947ed912 net/qede: add support for VXLAN UDP port config over VF
- Allow VXLAN enable/disable over VF using udp_tunnel_port_add/del APIs.
  Only default MAC/VLAN classification is supported.
- Enable VxLAN before UDP port configuration.
- Change VxLAN default UDP port to 4789 instead of 8472.

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-10-26 02:33:00 +02:00
Harish Patil
fb88acb59a net/qede: fix supported packet types
Update/fix supported ptypes to return both inner and outer headers,
tunnel_type, fragmented and VLAN packet types.

Fixes: 3d4bb44116 ("net/qede: add fastpath support for VXLAN tunneling")
Fixes: 2ea6f76aff ("qede: add core driver")
Cc: stable@dpdk.org

Signed-off-by: Harish Patil <harish.patil@cavium.com>
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-10-26 02:33:00 +02:00
Ivan Malov
d112a3ecb7 net/sfc: fix Tx reap behaviour on port stop on EF10 datapath
Tx reap mechanism on EF10 native datapath was altered by one
of the recent patches to introduce performance optimisations
using the common technique of freeing mbuf segments in bulks.

From this perspective, the way of associating SW descriptors
with individual mbuf segments rather than with whole packets
was adopted as a key requirement for the entire optimisation.

However, only the fast path reap function was amended to fit
the new scheme whilst the corresponding function on the port
stop path was left intact by mistake. This implies incorrect
usage of rte_pktmbuf_free() with regard to separate segments
rather than calling rte_pktmbuf_free_seg() and must be fixed.

Fixes: d321954343 ("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>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2017-10-26 02:33:00 +02:00
Shahaf Shuler
5ea2030718 net/mlx5: fix interrupt management fields assignment
Rxq creation was missing assignment for cq fields required for interrupt
management.

Fixes: 09cb5b5817 ("net/mlx5: separate DPDK from verbs Rx queue objects")

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-26 02:33:00 +02:00
Shahaf Shuler
8d92964180 net/mlx5: fix segfault on interrupt disable
Interrupt disable can be called when the interrupt vector is not yet
allocated. Such case ends up with segmentation fault.

Fixing it by adding verification for interrupt vector validity.

Fixes: 09cb5b5817 ("net/mlx5: separate DPDK from verbs Rx queue objects")

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-26 02:33:00 +02:00
Tomasz Duszynski
00fabc423d net/mrvl: update copyright holders
Add Marvell International Ltd. to the copyright holders.

Fixes: 0ddc9b815b ("net/mrvl: add net PMD skeleton")
Fixes: 1a286a1139 ("doc: add mrvl NIC guide")

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-26 02:33:00 +02:00
Tomasz Duszynski
b32a42e4d6 net/mrvl: remove DMA buffer size from configuration
RTE_MRVL_MUSDK_DMA_MEMSIZE can be removed from DPDK configuration
as it's no longer used as a synchronization point for net and crypto
mrvl pmds.

Fixes: 0ddc9b815b ("net/mrvl: add net PMD skeleton")

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-26 02:33:00 +02:00
Xueming Li
8fe4d212dc net/mlx5: fix secondary process Tx error
Uninitialized UAR mmap offset caused secondary tx doorbell mapped to
wrong address. This patch restores missing UAR mmap offset init code
overridden by wrong merge.

Fixes: faf2667fe8 ("net/mlx5: separate DPDK from verbs Tx queue objects")

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-26 02:33:00 +02:00
Wenzhuo Lu
49b6b461af net/i40e: fix parent when adding TM node
Queue's parent is TC not port. It's wrong to always set
the parent to root.

Fixes: e0ff4d304c ("net/ixgbe: support adding TM node")
Cc: stable@dpdk.org

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-26 02:33:00 +02:00
Wenzhuo Lu
a20a3c8c8b net/ixgbe: fix not supporting NULL TM profile
It's by design that APP can add a TM node without shaper
profile. But ixgbe doesn't support it currently.

Fixes: e0ff4d304c ("net/ixgbe: support adding TM node")
Fixes: 5713ade697 ("net/ixgbe: support committing TM hierarchy")
Cc: stable@dpdk.org

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-26 02:33:00 +02:00
Wenzhuo Lu
70039fe684 net/i40e: fix not supporting NULL TM profile
It's by design that APP can add a TM node without shaper
profile. But i40e doesn't support it currently.

Fixes: 03a249b62b ("net/i40e: support adding TM node")
Fixes: cac29c3c00 ("net/i40e: support committing TM hierarchy")
Cc: stable@dpdk.org

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-26 02:33:00 +02:00
Wenzhuo Lu
7039bcacb9 net/ixgbe: fix TM level capability getting
Only queue nodes should be taken as leaf nodes, all
the other nodes are non-leaf nodes.
Correct it when getting the TM level capability.

Fixes: 596988e193 ("net/ixgbe: support getting TM level capability")
Cc: stable@dpdk.org

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-10-26 02:33:00 +02:00
Wenzhuo Lu
6bff19690d net/ixgbe: fix TM node parameter checking
Only queue nodes should be taken as leaf nodes, all
the other nodes are non-leaf nodes.
Correct it when checking the parameters of the TM nodes.

Fixes: e0ff4d304c ("net/ixgbe: support adding TM node")
Cc: stable@dpdk.org

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-26 02:33:00 +02:00
Wenzhuo Lu
0d0f144831 net/i40e: fix TM level capability getting
Only queue nodes should be taken as leaf nodes, all
the other nodes are non-leaf nodes.
Correct it when getting the TM level capability.

Fixes: 0fb1ef1e79 ("net/i40e: support getting TM level capability")
Cc: stable@dpdk.org

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-26 02:33:00 +02:00
Wenzhuo Lu
1be6985827 net/i40e: fix TM node parameter checking
Only queue nodes should be taken as leaf nodes, all
the other nodes are non-leaf nodes.
Correct it when checking the parameters of the TM nodes.

Fixes: 03a249b62b ("net/i40e: support adding TM node")
Cc: stable@dpdk.org

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-10-26 02:33:00 +02:00
Yongseok Koh
e589960c0b net/mlx5: fix parsing flags of multi-packet send
Fixes: 43e9d9794c ("net/mlx5: support upstream rdma-core")
Cc: stable@dpdk.org

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-26 02:33:00 +02:00
Akhil Goyal
0a23d4b6f4 crypto/dpaa2_sec: support protocol offload IPsec
Driver implementation to support rte_security APIs

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
2017-10-26 03:12:41 +02:00
Radu Nicolau
9a0752f498 net/ixgbe: enable inline IPsec
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
2017-10-26 03:12:34 +02:00
Declan Doherty
b1ce0ad9e8 cryptodev: break dependency on PCI device bus
Removes any dependency of librte_cryptodev on the PCI device
infrastructure code and removes the functions which were virtual
device specific.

Updates QAT crypto PMD to remove dependencies on rte_cryptodev_pci.h
and replaces those calls with the new bus independent functions.

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2017-10-25 18:11:01 +02:00
Declan Doherty
f2f020d210 cryptodev: break dependency on virtual device bus
Removes any dependency of librte_cryptodev on the virtual device
infrastructure code and removes the functions which were virtual
device specific.

Updates all virtual PMDs to remove dependencies on rte_cryptodev_vdev.h
and replaces those calls with the new bus independent functions.

Due to these changes, the cryptodev ABI version gets bumped.

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-25 18:11:01 +02:00
Pablo de Lara
0ef45a9ae8 crypto/qat: fix HMAC supported digest sizes
For HMAC algorithms (MD5-HMAC, SHAx-HMAC), the supported
digest sizes are not a fixed value, but a range between
1 and the maximum digest size for those algorithms.

Fixes: 26c2e4ad5a ("cryptodev: add capabilities discovery")
Cc: stable@dpdk.org

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
2017-10-25 18:11:01 +02:00
Alok Makhariya
a389434efc crypto/dpaa_sec: support out of place buffers
Enable out of place buffer test cases in dpaa_sec

Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2017-10-25 18:11:00 +02:00
Alok Makhariya
dbd0df5611 crypto/dpaa2_sec: support out of place buffers
Enable out of place buffer test cases in nxp dpaa2_sec

Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2017-10-25 18:11:00 +02:00
Tomasz Duszynski
cdea34452b crypto/mrvl: update copyright holders
Add Marvell International Ltd. to the copyright holders.

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-25 18:10:40 +02:00
Tomasz Duszynski
5f4a38008d crypto/mrvl: print message if DMA mem is initialized
In case MUSDK dma memory has been already initialized by a different
driver (and perhaps do the different size) mv_sys_dma_mem_init()
will return -EEXIST error code.

Printing extra message makes it clear.

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-25 18:10:40 +02:00
Tomasz Duszynski
4816fb37ce crypto/mrvl: fix enabling debug logs
Using non-existent configuration option for enabling debug
messages will actually never enable them.

Fixes: 8a61c83af2 ("crypto/mrvl: add mrvl crypto driver")

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-25 18:10:40 +02:00
Tomasz Duszynski
238fba5b97 crypto/mrvl: fix driver name in debug log
Since CRYPTODEV_NAME_MRVL_CRYPTO_PMD is undefined RTE_STR() expands
it to "CRYPTODEV_NAME_MRVL_CRYPTO_PMD" instead of "crypto_mrvl".

This patch fixes that by using proper name definition in debug logs.

Fixes: 8a61c83af2 ("crypto/mrvl: add mrvl crypto driver")

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2017-10-25 18:10:40 +02:00
Alok Makhariya
9b0b95a48c crypto/dpaa2_sec: add check for segmented buffer
The code would crash for segmented buffer if no check.

Fixes: 8d1f3a5d75 ("crypto/dpaa2_sec: support crypto operation")
Cc: stable@dpdk.org

Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2017-10-25 18:10:15 +02:00
Alok Makhariya
cf6f70eea4 crypto/dpaa_sec: add check for segmented buffer
The code would crash in case of segmented buffer if no check

Fixes: c3e85bdcc6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")

Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2017-10-25 18:10:15 +02:00
Alok Makhariya
6d93f7cff0 crypto/dpaa2_sec: remove ICV memset on decryption side
Since the packet lengths are modified, it is not required to
explicitly reset the ICV.

Fixes: 13273250ee ("crypto/dpaa2_sec: support AES-GCM and CTR")
Fixes: 8d1f3a5d75 ("crypto/dpaa2_sec: support crypto operation")
Cc: stable@dpdk.org

Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2017-10-25 18:10:02 +02:00
Alok Makhariya
74658bda33 crypto/dpaa_sec: remove ICV memset on decryption side
Since the packet lengths are modified, it is not required to
explicitly reset the ICV.

Fixes: c3e85bdcc6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")

Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
2017-10-25 18:09:26 +02:00
Pavan Nikhilesh
45a914c5bd event/octeontx: support event Rx adapter
Add Rx adapter queue add and delete API for both generic eth_devices as
well as HW backed eth_octeontx which supports direct event injection to
event device.
The HW injected event needs to be converted into mbuf, previously this
was done in eth_octeontx during rx_burst now it is moved to
event_octeontx as events from Rx adapter are dequeued directly from
event device.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Reviewed-by: Nikhil Rao <nikhil.rao@intel.com>
2017-10-25 14:03:43 +02:00
Pavan Nikhilesh
d0d6549860 net/octeontx: support event Rx adapter
Add functions to modify and delete qos responsible for mapping eth queues
to event queues used for configuring event Rx adapter.
The mbox functions have been moved from octeontx_pkivf.c to
octeontx_pkivf.h to allow event_octeontx to access them.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
2017-10-25 14:03:43 +02:00
Nipun Gupta
49ccbfb634 event/dpaa2: improve error handling and logs
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-25 14:03:43 +02:00
Nipun Gupta
120843bda5 event/dpaa2: support event Rx adapter
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Reviewed-by: Nikhil Rao <nikhil.rao@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-25 14:03:43 +02:00
Nipun Gupta
18fe5c1cf5 drivers: add net as dependency for event drivers
With the introduction of eventdev-ethdev RX adapter support in event
device, some of the event device will have dependency on their respective
ethernet drivers. This patch adds the net as a dependency for eventdevs.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-10-25 14:03:43 +02:00
Nipun Gupta
b677d4c6d2 net/dpaa2: add API for event Rx adapter
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-25 14:03:43 +02:00
Nipun Gupta
e6c9c22aa0 event/dpaa2: add queue parameter in processing callback
For event dequeues for ethernet queues, a dpaa2_queue structure is
required to get the configuration for that ethernet queue. Based on
this configuration the rte_event is to be filled at the ingress side.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-10-25 14:03:43 +02:00
Harry van Haaren
8747b23929 event/sw: fix get of single xstat value
This commit allows the xstats_get() API to return just a single
value based on its ID. Previously, the "ret_n_lt_stats" value
set to 1 ensured a check to take place that the array was larger
than the available xstats.

The xstats_get() API allows retriving of individual stats - hence
this check should be removed - by setting "ret_n_lt_stats" to zero.

Fixes: c1ad03df7a ("event/sw: support xstats")

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-10-25 14:03:43 +02:00
Gage Eads
6cf8620263 event/sw: allow forward and release when out of credits
When forwarding or releasing events, the operation would fail if the port
has 0 inflight credits and cannot acquire more, or the inflight count
exceeds the port's new event threshold.

This patch fixes that by counting the number of new events in the burst,
and applying the credit and new event threshold checks accordingly.

Signed-off-by: Gage Eads <gage.eads@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-10-25 14:03:43 +02:00
Zhiyong Yang
f1216c1eca net/virtio: fix Tx packet length stats
In the function virtqueue_enqueue_xmit(), when can_push is true,
vtnet_hdr_size is added to pkt_len by calling rte_pktmbuf_prepend.
which is wrong for pkt stats, virtio header length should be subtracted
before calling stats function.

Fixes: 58169a9c81 ("net/virtio: support Tx checksum offload")
Cc: stable@dpdk.org

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2017-10-24 21:31:48 +02:00
Sebastian Basierski
2fd826a301 net/virtio: check error on setting non block flag
Report an error message if the flag O_NONBLOCK setting fails,
then return from function.

Coverity issue: 143439
Fixes: ef53b60300 ("net/virtio-user: support LSC")
Cc: stable@dpdk.org

Signed-off-by: Sebastian Basierski <sebastianx.basierski@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2017-10-24 21:29:47 +02:00
Tiwei Bie
d8227497ec net/virtio: flush Rx queues on start
After starting a device, the driver shouldn't deliver the
packets that already existed before the device is started
to applications. Otherwise it will lead to incorrect packet
collection for port state. This patch fixes this issue by
flushing the Rx queues when starting the device.

Fixes: a85786dc81 ("virtio: fix states handling during initialization")
Cc: stable@dpdk.org

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2017-10-24 21:26:57 +02:00
Olivier Matz
cbc12b0a96 mk: do not generate LDLIBS from directory dependencies
The list of libraries in LDLIBS was generated from the DEPDIRS-xyz
variable. This is valid when the subdirectory name match the library
name, but it's not always the case, especially for PMDs.

The patches removes this feature and explicitly adds the proper
libraries in LDLIBS.

Some DEPDIRS-xyz variables become useless, remove them.

Reported-by: Gage Eads <gage.eads@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Gage Eads <gage.eads@intel.com>
2017-10-24 02:14:57 +02:00
Olivier Matz
4761b145b1 mempool/octeontx: fix dependency
The syntax "DEPDIRS-y = ..." is deprecated since
commit feb9f680cd ("mk: optimize directory dependencies").

Replace it with the new style.

Fixes: 8700239f77 ("mempool/octeontx: add build and log infrastructure")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-10-24 02:14:54 +02:00
Olivier Matz
772b80237a crypto/dpaa2_sec: remove uneffective dependency
The syntax "DEPDIRS-y = ..." is deprecated since
commit feb9f680cd ("mk: optimize directory dependencies").

Remove this uneffective lines.

The effective dependencies are already declared in
drivers/crypto/Makefile, so there is nothing to add.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-10-24 02:14:50 +02:00
Santosh Shukla
89ee1e94bc mempool/octeontx: move mbox from event to mempool
Octeontx mempool pmd need mailbox for pool setup.
That mailbox was defined at drivers/event/octeontx.
So mempool has dependency on event/octeontx driver and
commit:8700239f7767 has added make rule which makes sure event/*
get build before mempool, but this rule introduces
cyclic dependency and may create problem to future
feature addition in drivers/Makefile.

Same problem noticed and reported in below thread:
http://dpdk.org/ml/archives/dev/2017-October/079187.html

The patch solves problem by moving mbox definition from
drivers/event/octeontx to drivers/mempool/octeontx.
Moving mbox files involves below changes:

* Renamed ssovf_mbox.[ch] --> octeontx_mbox.[ch]
* Renamed ssovf_probe.c  --> octeontx_ssovf.c
* Introduced pool logger file.
* Moved API from rte_pmd_octeontx_ssovf_version.map to
  rte_mempool_octeontx_version.map.
* Respective Makefile changes done in
  drivers/event/octeontx/Makefile and drivers/mempool/octeontx/Makefile.

Fixes: 8700239f77 ("mempool/octeontx: add build and log infrastructure")

Reported-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
2017-10-23 16:51:00 +02:00
Santosh Shukla
1513fc3023 mempool/octeontx: remove dead code
Coverity Issue: 195000
Fixes: 02fd6c7443 ("mempool/octeontx: support allocation")

Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-10-23 16:51:00 +02:00
Jingjing Wu
8cacf78469 net/i40e: fix VF initialization error
In igb_uio, FLR is issued during open device file. i40evf is trying
to initialize admin queue when driver probe, while the FLR is not
done by host driver. That will cause initialization fail.

This patch is adding the checking if VF reset is done before
adimin queue initialization.

Fixes: b58eedfc7d ("igb_uio: issue FLR during open and release of device file")
Cc: stable@dpdk.org

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-10-13 22:35:29 +01:00
Yongseok Koh
8fa9c312e1 net/mlx5: fix creation of compressed Rx completion queue
The size of Rx completion queue should be doubled if compression is enabled
in case of non-vectorized Rx.

Fixes: 523f5a7421 ("net/mlx5: fix configuration of Rx CQE compression")
Cc: stable@dpdk.org

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-13 22:13:13 +02:00
Zhiyong Yang
e6399f6b90 net/mrvl: fix port id type
port id should be defined as uint16_t.

Fixes: f8244c6399 ("ethdev: increase port id range")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
2017-10-13 21:57:48 +02:00
Zhiyong Yang
299609434d net/fm10k: fix port id type
The variable "port" should be defined as uint16_t, fix it here.

Fixes: f8244c6399 ("ethdev: increase port id range")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
2017-10-13 21:57:48 +02:00
Zhiyong Yang
04b443fb2c net/i40e: fix port id type
Some functions applied were still developed on top of uint8_t port_id,
however port_id has been increased range to uint16_t. The patch fixes
the issue.

Fixes: f8244c6399 ("ethdev: increase port id range")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
2017-10-13 21:57:48 +02:00
Zhiyong Yang
398fb97f9b net/bonding: fix port id type
Fixes: f8244c6399 ("ethdev: increase port id range")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
2017-10-13 21:57:48 +02:00
Jerin Jacob
50aa486c87 mempool/octeontx: fix build with old gcc
Replaced _Static_assert compiler function with RTE_BUILD_BUG_ON()
to fix build issue with old gcc.

Fixes: 02fd6c7443 ("mempool/octeontx: support allocation")

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-10-13 15:28:09 +02:00
Wei Zhao
562251e007 net/i40e: fix build on FreeBSD
ENODATA can not be build in FreeBSD.

Fixes: 7cbecc2f74 ("net/i40e: support queue region set and flush")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2017-10-13 12:46:03 +02:00
Adrien Mazarguil
cf2fdf7263 net/mlx4: fix missing initializers for old GCC
This patch works around compilation issues so far only seen on RHEL 7.2
using GCC 4.8.5:

 [...]/mlx4_rxq.c: In function `mlx4_rx_queue_setup':
 [...]/mlx4_rxq.c:473:3: error: missing initializer for field `ipackets' of
     `struct mlx4_rxq_stats' [-Werror=missing-field-initializers]

 [...]/mlx4_txq.c: In function `mlx4_tx_queue_setup':
 [...]/mlx4_txq.c:265:3: error: missing initializer for field `opackets' of
     `struct mlx4_txq_stats' [-Werror=missing-field-initializers]

Fixes: 7977082649 ("net/mlx4: drop live queue reconfiguration support")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-13 12:29:14 +02:00
Moti Haimovsky
43d77c2295 net/mlx4: add loopback Tx from VF
This patch adds loopback functionality used when the chip is a VF in order
to enable packet transmission between VFs and PF.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-10-13 01:18:48 +01:00
Moti Haimovsky
9f57340a80 net/mlx4: restore Rx offloads
This patch adds hardware offloading support for IPV4, UDP and TCP checksum
verification, including inner/outer checksums on supported tunnel types.

It also restores packet type recognition support.

Signed-off-by: Vasily Philipov <vasilyf@mellanox.com>
Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-10-13 01:18:48 +01:00
Moti Haimovsky
5db1d36408 net/mlx4: restore Tx checksum offloads
This patch adds hardware offloading support for IPv4, UDP and TCP checksum
calculation, including inner/outer checksums on supported tunnel types.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-10-13 01:18:48 +01:00
Moti Haimovsky
6681b84503 net/mlx4: add Rx bypassing Verbs
This patch adds support for accessing the hardware directly when
handling Rx packets eliminating the need to use Verbs in the Rx data
path.

Rx scatter support: calculate the number of scatters on the fly
according to the maximum expected packet size.

Signed-off-by: Vasily Philipov <vasilyf@mellanox.com>
Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-10-13 01:18:48 +01:00
Moti Haimovsky
c3c977bbec net/mlx4: add Tx bypassing Verbs
Modify PMD to send single-buffer packets directly to the device
bypassing the Verbs Tx post and poll routines.

Tx gather support: add support for transmitting packets spanning
over multiple buffers.

Take into consideration the amount of entries a packet occupies
in the TxQ when setting the report-completion flag of the chip.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-10-13 01:18:48 +01:00
Adrien Mazarguil
7d8675956f net/mlx4: add RSS support outside flow API
Bring back support for automatic RSS with the default flow rules when not
in isolated mode. Balancing is done according to unspecified default
settings, as was the case before this entire rework.

Since the number of queues part of RSS contexts is limited to power of two
values, the number of configured queues is rounded down to its previous
power of two; extra queues are silently discarded. This does not prevent
dedicated flow rules from targeting them.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-13 01:18:48 +01:00
Adrien Mazarguil
31c629c6f7 net/mlx4: disable UDP support in RSS flow rules
When part of the RSS hash calculation, UDP packets are discarded (not
received on any queue) likely due to an issue with the kernel
implementation.

Temporarily disable UDP RSS support until this issue is resolved.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-13 01:18:48 +01:00
Adrien Mazarguil
078b8b452e net/mlx4: add RSS flow rule action support
This patch dissociates single-queue indirection tables and hash QP objects
from Rx queue structures to relinquish their control to users through the
RSS flow rule action, while simultaneously allowing multiple queues to be
associated with RSS contexts.

Flow rules share identical RSS contexts (hashed fields, hash key, target
queues) to save on memory and other resources. The trade-off is some added
complexity due to reference counters management on RSS contexts.

The QUEUE action is re-implemented on top of an automatically-generated
single-queue RSS context.

The following hardware limitations apply to RSS contexts:

- The number of queues in a group must be a power of two.
- Queue indices must be consecutive, for instance the [0 1 2 3] set is
  allowed, however [3 2 1 0], [0 2 1 3] and [0 0 1 1 2 3 3 3] are not.
- The first queue of a group must be aligned to a multiple of the context
  size, e.g. if queues [0 1 2 3 4] are defined globally, allowed group
  combinations are [0 1] and [2 3]; groups [1 2] and [3 4] are not
  supported.
- RSS hash key, while configurable per context, must be exactly 40 bytes
  long.
- The only supported hash algorithm is Toeplitz.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-13 01:18:48 +01:00
Adrien Mazarguil
74d76e7ba5 net/mlx4: remove unnecessary check
Device operation callbacks are not supposed to handle a missing private
data structure.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-13 01:18:48 +01:00
Adrien Mazarguil
fc4e66649a net/mlx4: convert Rx path to work queues
Work queues (WQs) are lower-level than standard queue pairs (QPs). They are
dedicated to one traffic direction and have to be used in conjunction with
indirection tables and special "hash" QPs to get the same level of
functionality.

These extra objects however are the building blocks for RSS support brought
by subsequent commits, as a single "hash" QP can manage several WQs through
an indirection table according to a hash algorithm and other parameters.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-13 01:18:48 +01:00
Adrien Mazarguil
c64c58adc0 net/mlx4: allocate queues and mbuf rings together
Since live Tx and Rx queues cannot be reused anymore without being
destroyed first, mbuf ring sizes are fixed and known from the start.

This allows a single allocation for queue data structures and mbuf ring
together, saving space and bringing them closer in memory.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-13 01:18:48 +01:00
Adrien Mazarguil
7977082649 net/mlx4: drop live queue reconfiguration support
DPDK ensures that setup functions are never called on configured queues,
or only if they have previously been released.

PMDs therefore do not need to deal with the unexpected reconfiguration of
live queues which may fail with no easy way to recover. Dropping support
for this scenario greatly simplifies the code as allocation and setup steps
and checks can be merged.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-13 01:18:48 +01:00
Adrien Mazarguil
c8912bec52 net/mlx4: fix invalid errno value sign
Tx queue elements allocation function sets rte_errno properly and returns
its negative version. Reassigning this value to rte_errno is thus both
invalid and unnecessary.

Fixes: 9d14b27308 ("net/mlx4: standardize on negative errno values")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-13 01:18:48 +01:00
Adrien Mazarguil
67e6cce675 net/mlx4: update Rx/Tx callbacks consistently
Although their "removed" version acts as a safety against unexpected bursts
while queues are being modified by the control path, these callbacks are
set per device instead of per queue. It makes sense to update them during
start/stop/close cycles instead of queue setup.

As a side effect, this commit addresses a bug left over from a prior
commit: bringing the link down causes the "removed" Tx callback to be used,
however the normal callback is not restored when bringing it back up,
preventing the application from sending traffic at all.

Updating callbacks for a link change is not necessary as bringing the
netdevice down is normally enough to prevent traffic from flowing in.

Fixes: 3f75a02719 ("net/mlx4: drop scatter/gather support")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-13 01:18:48 +01:00
Adrien Mazarguil
eacaac7bae net/mlx4: restore promisc and allmulti support
Implement promiscuous and all multicast through internal flow rules
automatically generated according to the configured mode.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-13 01:18:48 +01:00
Adrien Mazarguil
3e49f870c5 net/mlx4: add flow support for multicast traffic
Give users the ability to create flow rules that match all multicast
traffic. Like promiscuous flow rules, they come with restrictions such as
not allowing additional matching criteria.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-13 01:18:48 +01:00
Adrien Mazarguil
30695adbdd net/mlx4: add VLAN filter configuration support
This commit brings back VLAN filter configuration support without any
artificial limitation on the number of simultaneous VLANs that can be
configured (previously 127).

Also thanks to the fact it does not rely on fixed per-queue arrays for
potential Verbs flow handle storage anymore, this version wastes a lot less
memory (previously 128 * 127 * pointer size, i.e. 130 kiB per Rx queue,
only one of which actually had any use for this room: the RSS parent
queue).

The number of internal flow rules generated still depends on the number of
configured MAC addresses times that of configured VLAN filters though.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-13 01:18:48 +01:00
Adrien Mazarguil
1437784b03 net/mlx4: add MAC addresses configuration support
This commit brings back support for configuring up to 128 MAC addresses on
a port through internal flow rules automatically generated on demand.

Unlike its previous incarnation, the necessary extra flow rule for
broadcast traffic does not consume an entry from the MAC array anymore.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-13 01:18:48 +01:00
Adrien Mazarguil
680d5280c2 net/mlx4: refactor flow item validation code
Since flow rule validation and creation have been refactored into a common
two-pass function, having separate callback functions to validate and
convert individual items seems redundant.

The purpose of these item validation functions is to reject partial masks
as those are not supported by hardware, before handing over the item to a
separate function that performs basic sanity checks.

The current approach and related code have the following issues:

- Lack of flow handle context in validation code requires kludges such as
  the special treatment reserved to spec-less Ethernet pattern items.
- Lack of useful error reporting; users need as much help as possible to
  understand what they did wrong, particularly when they hit hardware
  limitations that aren't mentioned by the flow API. Preventing them from
  going berserk after getting a generic "item not supported" message for no
  apparent reason is mandatory.
- Generic checks should be performed by the caller, not by item-specific
  validation functions.
- Mask checks either missing or too lax in some cases (Ethernet, VLAN).

This commit addresses all the above by combining validation and conversion
callbacks as "merge" callbacks that take an additional error context
parameter. Also:

- Support for source MAC address matching is removed as it has no effect.
- Providing an empty mask no longer bypasses the Ethernet specification
  check that causes a rule to become promiscuous-like.
- VLAN VIDs must be matched exactly, as matching all VLAN traffic while
  excluding non-VLAN traffic is not supported.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-13 01:18:48 +01:00
Adrien Mazarguil
fee75e14f3 net/mlx4: simplify trigger code for flow rules
Since flow rules synchronization function mlx4_flow_sync() takes into
account the state of the device (whether it is started), trigger functions
mlx4_flow_start() and mlx4_flow_stop() are redundant. Standardize on
mlx4_flow_sync().

Use this opportunity to enhance this function with better error reporting
as the inability to start the device due to a problem with a flow rule
otherwise results in a nondescript error code.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-13 01:18:48 +01:00
Adrien Mazarguil
fc49cbb768 net/mlx4: generalize flow rule priority support
Since both internal and user-defined flow rules are handled by a common
implementation, flow rule priority overlaps are easier to detect. No need
to restrict their use to isolated mode only.

With this patch, only the lowest priority level remains inaccessible to
users outside isolated mode.

Also, the PMD no longer automatically assigns a fixed priority level to
user-defined flow rules, which means collisions between overlapping rules
matching a different number of protocol layers at a given priority level
won't be avoided anymore (e.g. "eth" vs. "eth / ipv4 / udp").

As a reminder, the outcome of overlapping rules for a given priority level
was, and still is, undefined territory according to API documentation.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-13 01:18:48 +01:00
Adrien Mazarguil
bdcad2f484 net/mlx4: refactor internal flow rules
When not in isolated mode, a flow rule is automatically configured by the
PMD to receive traffic addressed to the MAC address of the device. This
somewhat duplicates flow API functionality.

Remove legacy support for internal flow rules to instead handle them
through the flow API implementation.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-13 01:18:48 +01:00
Adrien Mazarguil
328bf8e5a3 net/mlx4: relax check on missing flow rule target
Creating a flow rule targeting a missing (unconfigured) queue is not
possible. However, nothing really prevents the destruction of a queue with
existing flow rules still pointing at it, except currently the port must be
in a stopped state in order to avoid crashing.

Problem is that the port cannot be restarted if flow rules cannot be
re-applied due to missing queues. This flexibility will be needed by
subsequent work on this PMD.

Given that a PMD cannot decide on its own to remove problematic
user-defined flow rules in order to restart a port, work around this
restriction by making the affected ones drop-like, i.e. rules targeting
nonexistent queues drop packets instead.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-13 01:18:48 +01:00