Commit Graph

21507 Commits

Author SHA1 Message Date
Amaranath Somalapuram
410cf0870c net/axgbe: advertise supported packet types
Adding api for eth_dev_supported_ptypes_get_t

Signed-off-by: Amaranath Somalapuram <asomalap@amd.com>
Acked-by: Ravi Kumar <ravi1.kumar@amd.com>
2020-03-18 15:29:39 +01:00
Amaranath Somalapuram
7aed95c93d net/axgbe: support queue query
Adding API for axgbe_rxq_info_get, axgbe_txq_info_get

Signed-off-by: Amaranath Somalapuram <asomalap@amd.com>
Acked-by: Ravi Kumar <ravi1.kumar@amd.com>
2020-03-18 15:29:39 +01:00
Amaranath Somalapuram
e0543d4e79 net/axgbe: support priority flow control
Adding API for priority_flow_ctrl_set.
Priority flow control to set water high and low,
pause_time and priority.

Signed-off-by: Amaranath Somalapuram <asomalap@amd.com>
Acked-by: Ravi Kumar <ravi1.kumar@amd.com>
2020-03-18 15:29:39 +01:00
Amaranath Somalapuram
cf97f33e8b net/axgbe: support flow control
Adding api for flow_ctrl_get and flow_ctrl_set.
By default axgbe driver flow control is disabled.
Adding dpdk flow control to set water high and low.

Signed-off-by: Amaranath Somalapuram <asomalap@amd.com>
Acked-by: Ravi Kumar <ravi1.kumar@amd.com>
2020-03-18 15:29:39 +01:00
Wisam Jaddo
85e26044cb net/mlx5: fix zero metadata action
There is no reason to prevent the user from using zero metadata,
it indeed means no metadata, but sometimes the user may need to
report to datapath that there is no metadata anymore, which is
valid case.

Fixes: fcc8d2f716 ("net/mlx5: extend flow metadata support")
Cc: stable@dpdk.org

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-03-18 15:29:39 +01:00
Guinan Sun
a6131c7a95 net/ixgbe: fix setting VF MAC address
The reason why PF cannot receive data normally is that vf performed
the clear_rar operation through dev close without adding a mac address. 
This will cause the association between the index and rx address set
by VMDq to be cancelled,thus affecting the data reception of PF. The
correction method is to add a check action, and do not perform the
set_rar operation without adding a mac address to prevent affecting the
reception of data.

Fixes: 3c42701875 ("net/ixgbe: support VF MAC address add/remove")
Cc: stable@dpdk.org

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-03-18 15:29:39 +01:00
Karra Satwik
536db938a4 net/cxgbe: add devargs to control filtermode and filtermask
Apart from the 4-tuple (IP src/dst addresses and TCP/UDP src/dst
port addresses), there are only 40-bits available to match other
fields in packet headers. Not all combinations of packet header
fields can fit in the 40-bit tuple.

Currently, the combination of packet header fields to match are
configured via filterMode for LETCAM filters and filterMask for
HASH filters in firmware config files (t5/t6-config.txt). So, add
devargs to allow User to dynamically select the filterMode and
filterMask combination during runtime, without having to modify the
firmware config files and reflashing them onto the adapter. A table
of supported combinations is maintained by the driver to internally
translate the User specified devargs combination to hardware's internal
format before writing the requested combination to hardware

Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2020-03-18 15:29:39 +01:00
Karra Satwik
629315fb66 net/cxgbe: use firmware API for validating filter spec
Add new firmware API FW_PARAM_DEV_FILTER_MODE_MASK to fetch
the filtermode and filtermask values configured in hardware,
which are used to validate the match combinations in the filter
spec before offloading the filter rules to hardware. For older
firmware that doesn't support the new API, fallback to older way
of directly reading from indirect registers

Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2020-03-18 15:29:39 +01:00
Karra Satwik
993541b2fa net/cxgbe: support flow API for source MAC rewrite
Add support to rewrite Source MAC addresses. The new Source
MAC address is written into a free entry in the SMT table
and the corresponding SMT index is used by hardware to
rewrite the Source MAC address of the packets hitting the
flow.

Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2020-03-18 15:29:39 +01:00
Karra Satwik
a99564c680 net/cxgbe: support Source MAC Table
Source MAC Table (SMT) is used for storing Source MAC
addresses to be written in packets transmitted on the
wire. Hence, the SMT table can be used for overwriting
Source MAC addresses in packets, hitting corresponding
filter rules inserted by the rte_flow API.

Query firmware for SMT start and size information available
to the underlying PF. Allocate and maintain the corresponding
driver's copy of the hardware SMT table, with appropriate
refcount mechanism. If SMT information is not available, then
use the entire hardware SMT table.

Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2020-03-18 15:29:39 +01:00
Karra Satwik
7d71ba5d15 net/cxgbe: support flow API for destination MAC rewrite
Add support for overwriting destination MAC addresses.
The new MAC address is written into a free entry in the
L2T table and the corresponding L2T index is used by
hardware to overwrite the destination MAC address of the
packets hitting the flow

Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2020-03-18 15:29:39 +01:00
Karra Satwik
24c1d49ac8 net/cxgbe: support flow API for matching all packets on VF
Add support to match all packets received on the underlying VF.

Use new firmware API to fetch the Virtual Interface Number (VIN)
allocated to each VF by the firmware. The VIN is required to
write filter rules to match all packets on VFs, whose identifier
is beyond max 7-bit value (i.e. 127) in VIID.

If firmware doesn't support fetching the VIN information, then
fallback to manually retrieving the VIN value from the 7-bit field
in the VIID, which only supports in range of 0..127. In this case,
packets belonging to VFs, whose identifier is beyond 127 can't be
matched.

Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2020-03-18 15:29:39 +01:00
Karra Satwik
caa0142433 net/cxgbe: support flow API for matching all packets on PF
Add support to match all packets received on the underlying PF

Note that the same 17-bit hardware tuple is shared between QinQ
and PF match. Hence, match on either QinQ or PF only can be done
at a time. Both QinQ and PF match can't be enabled at the same time.

Also, remove check to reject rules without spec because
RTE_FLOW_ITEM_TYPE_PF doesn't require a spec. Due to this check
removal, RTE_FLOW_ITEM_TYPE_PHY_PORT item needs to be updated to
handle NULL spec

Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2020-03-18 15:29:39 +01:00
Karra Satwik
095e67601f net/cxgbe: support flow API for matching IP TOS
Add support to match Type of Service (TOS) field in
IPv4/IPv6 header

Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2020-03-18 10:21:42 +01:00
Karra Satwik
55f003d888 net/cxgbe: support flow API for matching QinQ VLAN
Add support to match fields in 802.1ad Q-in-Q VLAN packets.
Relax check for repeated pattern items for RTE_FLOW_ITEM_TYPE_VLAN
item, since the same item is used to represent both QinQ and VLAN
packets.

When QinQ match is enabled, the ethertype field in the hardware
spec must contain the innermost VLAN header's ethertype field,
and not the Ethernet header's ethertype field. The hardware
automatically searches for ethertype 0x88A8/0x8100 in Ethernet
header, when parsing incoming packet against QinQ/VLAN pattern,
respectively.

Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2020-03-18 10:21:42 +01:00
Igor Romanov
585c22edb2 net/sfc/base: handle manual and auto filter clashes in EF10
Make user filters a priority in EF10 datapath. When a manual
filter with a specification that is equal to an existing auto
filter is inserted, the manual filter:
- replaces auto filter if the specification is exclusive;
- is inserted along existing auto filter otherwise;

In the first case the auto filter that was replaced is saved.
This saved filter can be updated on filter reconfiguration and
is restored on the manual filter removal.

Fixes: e7cd430c86 ("net/sfc/base: import SFN7xxx family support")
Cc: stable@dpdk.org

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-03-18 10:21:42 +01:00
Igor Romanov
ad3727f71f net/sfc/base: refactor filter lookup loop in EF10
The code is refactored to make it more clear and allow for
more convenient further changes.

Fixes: e7cd430c86 ("net/sfc/base: import SFN7xxx family support")
Cc: stable@dpdk.org

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-03-18 10:21:42 +01:00
Igor Romanov
fbf423bbf2 net/sfc/base: reject automatic filter creation by users
The automatic filter priority may only be used by filter implementation,
so reject the attempts to create such filters by client drivers.

Fixes: f9565517ff ("net/sfc/base: import filters support")
Cc: stable@dpdk.org

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-03-18 10:21:42 +01:00
Igor Romanov
5b1dd95e27 net/sfc/base: reduce filter priorities to implemented only
Only implemented filter priorities are manual and auto. Remove
unused priorities since exposing unimplemented functionality
is of no benefit.

Tx filter specification default priority is changed to manual,
since required priority does not differ from it in the implementation.

Fixes: f9565517ff ("net/sfc/base: import filters support")
Cc: stable@dpdk.org

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-03-18 10:21:42 +01:00
Igor Romanov
f6752f660f net/sfc: set priority of created filters to manual
The priority should be explicitly set to manual for correct
usage of libefx filters.

Fixes: a9825ccf5b ("net/sfc: support flow API filters")
Cc: stable@dpdk.org

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-03-18 10:21:42 +01:00
Igor Romanov
7329b56f11 net/sfc: fix promiscuous and allmulticast toggles errors
Returned errors of ethdev callbacks are negative. Internal
sfc functions return positive errors, so convert them to
negative value.

Fixes: 9039c81257 ("ethdev: change promiscuous callbacks to return status")
Cc: stable@dpdk.org

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-03-18 10:21:42 +01:00
Stephen Hemminger
897358cc1e ethdev: fix spelling
Minor spelling errors found by aspell and codespell

Fixes: 1daa338058 ("ethdev: validate offloads set by PMD")
Fixes: 81f9db8ecc ("ethdev: add vlan offload support")
Fixes: c8231c63dd ("ethdev: insert Rx callback as head of list")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-03-18 10:21:42 +01:00
Sunil Kumar Kori
e40303eb0f net/ionic: use standard boolean type
Any DPDK public header file which includes stdbool.h may conflict with
local definition of bool, if any, which further results in compilation
error. To avoid, used standard stdbool.h instead of defining bool
internally.

I observed this issue during a development where I included rte_uuid.h
into rte_ethdev.h. As rte_ethdev.h is included to PMD driver, it started
throwing error as given below:

  CC ionic_rxtx.o
In file included from .../dpdk/build/include/rte_uuid.h:17:0,
                 from .../dpdk/build/include/rte_ethdev.h:161,
                 from .../dpdk/build/include/rte_ethdev_driver.h:18,
                 from .../dpdk/drivers/net/ionic/ionic_rxtx.c:34:
.../dpdk/drivers/net/ionic/ionic_osdep.h:48:17:
    error: two or more data types in declaration specifiers
typedef uint8_t bool;
                 ^
In file included from .../dpdk/drivers/net/ionic/ionic_dev.h:8:0,
                 from .../dpdk/drivers/net/ionic/ionic.h:13,
                 from .../dpdk/drivers/net/ionic/ionic_mac_api.h:8,
                 from .../dpdk/drivers/net/ionic/ionic_rxtx.c:45:
.../dpdk/drivers/net/ionic/ionic_osdep.h:48:1:
    warning: useless type name in empty declaration
typedef uint8_t bool;
^~~~~~~
cc1: warning: unrecognized command line option
				‘-Wno-address-of-packed-member’
.../dpdk/mk/internal/rte.compile-pre.mk:114:
			recipe for target 'ionic_rxtx.o' failed

Fixes: 5ef518098e ("net/ionic: register and initialize adapter")
Cc: stable@dpdk.org

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Alfredo Cardigliano <cardigliano@ntop.org>
2020-03-18 10:21:42 +01:00
Chengchang Tang
eb4f9b6a55 net/hns3: fix promiscuous mode for PF
Currently, when promiscuous mode is enabled, it is just allowed to
accept all the unicast and broadcast packets in hns3 PF PMD driver. It
should also be able to receive multicast packets.

Fixes: 19a3ca4c99 ("net/hns3: add start/stop and configure operations")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
2020-03-18 10:21:42 +01:00
Chengchang Tang
40486d3849 net/hns3: support promiscuous and allmulticast mode for VF
Currently, we only support VF device is bound to vfio_pci or igb_uio and
then driven by DPDK driver when PF is driven by kernel mode hns3 ethdev
driver, VF is not supported when PF is driven by hns3 DPDK driver.

This patch adds promiscuous and allmulticast mode support for hns3 VF
PMD driver.
1) The promiscuous/allmulticast mode can be configured successfully only
   based on the trusted VF device. If based on the non trusted VF
   device, configuring promiscuous/allmulticast mode will fail. The hns3
   VF device can be configured as trusted device by hns3 PF kernel
   ethdev driver on the host by "ip link set <eth num> vf <vf id> turst
   on" command.
2) After the promiscuous mode is configured successfully, hns3 VF PMD
   driver can receive the ingress and outgoing traffic. In the words,
   all the ingress packets, all the packets sent from the PF and other
   VFs on the same physical port.
3) Note: Because of the hardware constraints, By default vlan filter is
   enabled and couldn't be turned off based on VF device, so vlan filter
   is still effective even in promiscuous mode. If upper applications
   don't call rte_eth_dev_vlan_filter API function to set vlan based on
   VF device, hns3 VF PMD driver will can't receive the packets with
   vlan tag in promiscuous mode.

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
2020-03-18 10:21:42 +01:00
Chengchang Tang
4bf2c84bd8 net/hns3: remove restriction on setting VF MTU
The hns3 PF/VF devices on the same port share the hardware MTU
configuration. Currently, we send mailbox to inform hns3 PF kernel
ethdev driver to finish hardware MTU configuration in hns3 VF PMD
driver, there is no need to stop the port for hns3 VF device, and
the MTU value issued by hns3 VF PMD driver must be less than or
equal to PF's MTU.

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
2020-03-18 10:21:42 +01:00
Wei Hu (Xavier)
ef2e785c36 net/hns3: fix Tx interrupt when enabling Rx interrupt
Currently, when receiving and transmitting packets based on hns3 network
engine there are probably unexpected and redundant Tx interrupts if Rx
interrupt is enabled.

The root cause as below:
Tx and Rx queues with the same number share the interrupt vector in hns3
network engine, and in this case there are the residual hardware mapping
relationship configuration between queue and interrupt vector configured
in hns3 kernel ethdev driver.

We should clear the all hardware mapping relationship configurations in
the initialization. Because of the hardware constraints, we have to
implement clearing the relationship by binding all queues to the last
interrupt vector and reserving the last interrupt vector, this method
results in a decrease of the maximum queues when upper applications call
the rte_eth_dev_configure API function to enable Rx interrupt.

Fixes: 02a7b55657 ("net/hns3: support Rx interrupt")
Cc: stable@dpdk.org

Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
2020-03-18 10:21:42 +01:00
Hongbo Zheng
6dca716c9e net/hns3: support TSO
This patch adds TCP segment offload support for hns3 PMD driver.

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
2020-03-18 10:21:42 +01:00
Xiao Zhang
ecbc857013 ethdev: add PFCP header to flow API
This patch adds the new flow item RTE_FLOW_ITEM_TYPE_PFCP to flow API to
match a PFCP header.
Add sample PFCP rules for testpmd guide. Since Session Endpoint
Identifier (SEID) only will be present in PFCP Session header and PFCP
Session headers shall be identified when the S field is equal to 1, when
create rules for PFCP Session header with certain SEID the S field need
be set 1.

Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
Acked-by: Ori Kam <orika@mellanox.com>
2020-03-18 10:21:42 +01:00
Qi Zhang
edec6dd838 net/ice: remove redundant functions
Remove function ice_clear_queues, since all equivalent code
has already been executed during ice_rx|tx_queue_stop.

Also function ice_rx|tx_queue_release_mbufs simply wrapped a
function pointer call which is not necessary, remove them.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-03-18 10:21:42 +01:00
Kevin Traynor
ece8e4c262 net/hinic: fix repeating cable log and length check
gcc 10.0.1 reports:

../drivers/net/hinic/base/hinic_pmd_hwdev.c: In function ‘print_cable_info’:
../drivers/net/hinic/base/hinic_pmd_hwdev.c:1398:3:
warning:
‘snprintf’ argument 4 may overlap destination object ‘tmp_str’
[-Wrestrict]
 1398 |   snprintf(tmp_str + strlen(tmp_str), (sizeof(tmp_str) - 1),
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1399 |     "%s, Temperature: %u", tmp_str,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1400 |     info->cable_temp);
      |     ~~~~~~~~~~~~~~~~~

The warning is that tmp_str is in both src and dest.

Anyway, the current code is incorrect and because of the +strlen
the existing string will be repeated twice and max length
does not limit to the end of the string.

Fix by removing tmp_str from the src of snprintf and adding the
correct max length.

Fixes: d9ce191794 ("net/hinic/base: add hardware operation")
Cc: stable@dpdk.org

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-03-18 10:21:42 +01:00
Kevin Traynor
9c84acab47 net/hinic: fix snprintf length of cable info
Correct length and remove unnecessary brackets.

Fixes: d9ce191794 ("net/hinic/base: add hardware operation")
Cc: stable@dpdk.org

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-03-18 10:21:42 +01:00
Július Milan
06123fdd60 net/memif: fix init when already connected
This patch fixes the situation when there is already connected pair of
memif interfaces and another slave tries to initiate the connection with
(already occupied) master. Expected behavior is that the second slave
is refused and gets disconnect message with reason: "Already connected",
while old connection remains functional.

Fixes: 09c7e63a71 ("net/memif: introduce memory interface PMD")
Cc: stable@dpdk.org

Signed-off-by: Július Milan <jmilan.dev@gmail.com>
Reviewed-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-03-18 10:21:41 +01:00
Július Milan
cbbbbd3365 net/memif: enable loopback
With this patch it is possible to connect 2 DPDK memifs into loopback,
i.e. when they have the same id and different roles, as for example:
  "--vdev=net_memif0,role=master,id=0"
  "--vdev=net_memif1,role=slave,id=0"

Signed-off-by: Július Milan <jmilan.dev@gmail.com>
Reviewed-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-03-18 10:21:41 +01:00
Tonghao Zhang
a6e7cd81fa common/mlx5: fix build without dlopen option
When setting the CONFIG_RTE_BUILD_SHARED_LIB to y,
and build the mlx5 pmd, there is a building error.
To fix it, add RTE_IBVERBS_LINK_DLOPEN to include
relative codes.

    mlx5_common.o: In function `mlx5_glue_init':
    drivers/common/mlx5/mlx5_common.c:324: undefined reference to `dlclose'

Fixes: 7b4f1e6bd3 ("common/mlx5: introduce common library")
Cc: stable@dpdk.org

Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Tested-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-03-18 10:21:41 +01:00
Dekel Peled
e8e5fdfdd6 net/mlx5: support match on IPv4 TTL and IPv6 HLIM
This patch adds to MLX5 PMD the support of matching on IPv4 TTL and
IPv6 hoplimit.
Support is valid when using DV flow engine (Verbs flow engine doesn't
support matching on this field).

Signed-off-by: Eli Britstein <elibr@mellanox.com>
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-03-18 10:21:41 +01:00
Dekel Peled
6bd5efb23d net/mlx5: fix mask used for IPv6 item validation
The nic_mask struct in function mlx5_flow_validate_item_ipv6()
includes hop_limits field.
This is redundant since matching on this item is not supported using
Verbs flow engine (dv_flow_en=0).

(Separate patch will be sent to handle this issue for DV flow engine.)

Setting a rule including match on this field will fail:
testpmd> flow create 0 ingress pattern eth / ipv6 hop is 1 / end actions
drop / end
port_flow_complain(): Caught PMD error type 1 (cause unspecified):
hardware refuses to create flow: Operation not supported

This patch removes the redundant field from nic_mask, to ensure that
such flow rules will be rejected by PMD validation:
testpmd> flow create 0 ingress pattern eth / ipv6 hop is 1 / end actions
drop / end
port_flow_complain(): Caught PMD error type 13 (specific pattern item):
cause: 0x7fffffffa2c8, mask enables non supported bits: Operation not
supported

The related lines in function flow_verbs_translate_item_ipv6() are
removed as well, since they are redundant.

Fixes: 23c1d42c71 ("net/mlx5: split flow validation to dedicated function")
Fixes: 84c406e745 ("net/mlx5: add flow translate function")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-03-18 10:21:41 +01:00
Qi Zhang
af3f83032b net/ice: remove bulk alloc option
Remove CONFIG_RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC with below
consideration:

1. A default Rx path can always be selected by setting a proper
   rx_free_thresh value at runtime, see
   ice_check_rx_burst_bulk_alloc_preconditions.

2. Its not a big deal to always reserve more space for desc ring.
   "ring_size = (uint16_t)(rxq->nb_rx_desc + ICE_RX_MAX_BURST);"

3. Fixes a potential invalid memory access in ice_reset_rx_queue.
   If CONFIG_RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC is turned on while
   ice_check_rx_burst_bulk_alloc_preconditions return fail.
   Below code will have problem.

   for (i = 0; i < ICE_RX_MAX_BURST; ++i)
   	rxq->sw_ring[rxq->nb_rx_desc + i].mbuf = &rxq->fake_mbuf;

Fixes: 50370662b7 ("net/ice: support device and queue ops")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-03-18 10:21:41 +01:00
Igor Romanov
a8bcd99de4 net/sfc: fix Rx queue start failure path
Call correct cleanup operations on failure in Rx queue start function.

Fixes: df1bfde4ff ("net/sfc: factor out libefx-based Rx datapath")
Fixes: 28944ac098 ("net/sfc: implement Rx queue start and stop operations")
Cc: stable@dpdk.org

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-03-18 10:21:41 +01:00
Ivan Malov
2e2e5bdf90 net/sfc: generalise flow pattern item processing
This is needed to reuse pattern processing engine for MAE.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-03-18 10:21:41 +01:00
Ivan Malov
4f867ad6a0 net/sfc: generalise flow start and stop path
As a preparation step, generalise flow start and stop path using
callbacks.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-03-18 10:21:41 +01:00
Ivan Malov
5b2b9236aa net/sfc: generalise flow parsing
Generalise flow attribute parsing function in regard to transfer attribute.
Add a method table and factor out VNIC-specific parsing code as a callback.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-03-18 10:21:41 +01:00
Ivan Malov
7ba166841c net/sfc: introduce flow allocation and free path
Riverhead boards maintain support for MAE, a low-level Match-Action Engine.
The upcoming patches will bring support for MAE to RTE flow implementation.

A follow-up patch will introduce MAE-specific specification cleanup method.
In order to prepare for the patch, introduce flow allocation and free path.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-03-18 10:21:41 +01:00
Ivan Malov
6f63bf7bda net/sfc: generalise flow specification structure
Add the concept of a flow specification type.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-03-18 10:21:41 +01:00
Ivan Malov
1962171292 net/sfc: make flow list engine-agnostic
A backend which a driver employs to handle flow rules of a given
type depends on the underlying NIC flow engine. The driver in
question in its current state is tailored to support the only
flow engine, VNIC filtering. As the need arises to add support
for transfer rules, the driver has to be reworked so that it
becomes possible to introduce yet another backend.

As a preparation step, make the flow list shared
between different engines.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-03-18 10:21:41 +01:00
Ivan Malov
7571c08d9f net/sfc: make flow RSS details VNIC-specific
The flow specification structure will be transformed to a generic one, and
its current contents will be fenced off to form a VNIC-specific parameters.
Flow RSS details do not belong to the said specification currently, albeit
being VNIC-specific. This patch addresses this issue as a preparation step.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-03-18 10:21:41 +01:00
Chandu Babu N
e01d9b2e98 net/axgbe: support unicast hash table for MAC address
Implement eth_dev_ops uc_hash_table_set and uc_all_hash_table_set

Signed-off-by: Chandu Babu N <chandu@amd.com>
Acked-by: Ravi Kumar <ravi1.kumar@amd.com>
2020-03-18 10:21:41 +01:00
Chandu Babu N
49a5e6226a net/axgbe: support setting MAC address
Supports adding MAC addresses to enable whitelist filtering to
accept packets
implement eth_dev_ops mac_addr_set, mac_addr_add, mac_addr_remove and
set_mc_addr_list

Signed-off-by: Chandu Babu N <chandu@amd.com>
Acked-by: Ravi Kumar <ravi1.kumar@amd.com>
2020-03-18 10:21:41 +01:00
Shougang Wang
b1eca6cc85 net/i40e: fix DCB initialization
Stopping LLDP is necessary for DPDK, but it will cause DCB init failure.
For kernel shared code, the prerequisite for successful initialization
of DCB is that LLDP is enabled. This patch starts LLDP before DCB init
and stops it when init finishes.

Fixes: a8e84b22bd ("net/i40e/base: support persistent LLDP")
Cc: stable@dpdk.org

Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-03-18 10:21:41 +01:00
Igor Romanov
ba77f3e171 net/sfc: fix initialization error path
NIC deinitialization should not happen after a failed NIC
initialization.

Fixes: 91831d4068 ("net/sfc: estimate available resources")
Cc: stable@dpdk.org

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-03-18 10:21:41 +01:00