Commit Graph

4199 Commits

Author SHA1 Message Date
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