dpdk.git
3 years agonet/ice: fix flow rule checking
Jeff Guo [Tue, 19 Jan 2021 08:07:31 +0000 (16:07 +0800)]
net/ice: fix flow rule checking

Add empty item into the pattern mapping list when checking the ptype is
supported or not, since we do support the NUll pattern for rte flow in
ice pmd.

Fixes: 68b6240ee9f0 ("net/ice: refactor packet type parsing")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agodoc: add known issue with RSS in ixgbe guide
Beilei Xing [Tue, 19 Jan 2021 07:01:52 +0000 (15:01 +0800)]
doc: add known issue with RSS in ixgbe guide

Currently, IXGBE doesn't support RSS when double VLAN
is enabled due to FW limitation.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
3 years agonet/ixgbe: fix configuration of max frame size
Alvin Zhang [Tue, 19 Jan 2021 05:25:51 +0000 (13:25 +0800)]
net/ixgbe: fix configuration of max frame size

For some types of NIC, jumbo frame is not supported in IOV mode,
so if a VF requests to configure the frame size to not bigger
than IXGBE_ETH_MAX_LEN, the kernel driver returns 0, but the DPDK
ixgbe PMD returns -1, this will cause the VF to fail to start
when the PF driven by DPDK ixgbe PMD.

This patch keeps ixgbe PMD's handling mode consistent with kernel
driver in above situation.

In addition, the value set by the command IXGBE_VF_SET_LPE
represents the max frame size, not the mtu.

Fixes: 1b9ea09c067b ("ixgbe: support X550")
Fixes: 95a27b3ba5f5 ("net/ixgbe: enable jumbo frame for VF")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
3 years agonet/ice: refactor DCF VLAN handling
Haiyue Wang [Mon, 18 Jan 2021 11:38:29 +0000 (19:38 +0800)]
net/ice: refactor DCF VLAN handling

Since DCF always configure the outer VLAN offloads for the target AVF,
so rename the related variables to align with this design.

Also, the DCF needs to trace the AVF reset status to re-apply the VLAN
offload setting, refactor the reset event handling to support this.

Change the VF representor API 'ethdev' parameter to 'vf_rep_eth_dev' to
avoid introducing confusion with VF representor eth_dev ops name.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/i40e: fix out of scope variable
Alvin Zhang [Fri, 15 Jan 2021 08:34:11 +0000 (16:34 +0800)]
net/i40e: fix out of scope variable

Using "key", which points to an out-of-scope variable "rss_key_default".

Coverity issue: 365293
Fixes: ef4c16fd9148 ("net/i40e: refactor RSS flow")

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
3 years agonet/iavf: workaround RSS cleanup failure handling
Xuan Ding [Mon, 18 Jan 2021 08:28:26 +0000 (08:28 +0000)]
net/iavf: workaround RSS cleanup failure handling

Allow to ignore error returned from virtual channel command
 VIRTCHNL_OP_SET_RSS_HENA with hena = 0 due to some legacy
kernel driver does not support this. Add warning message when
this happen.

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: enable QinQ filter for switch
Junfeng Guo [Mon, 18 Jan 2021 14:07:41 +0000 (14:07 +0000)]
net/ice: enable QinQ filter for switch

Enable the double VLAN support for switch QinQ filtering.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/mlx5: handle RSS action in sample
Jiawei Wang [Thu, 14 Jan 2021 07:24:47 +0000 (09:24 +0200)]
net/mlx5: handle RSS action in sample

PMD validates the rss action in the sample sub-actions list,
then translates into rdma-core action and it will be used for sample
path destination.

If the RSS action is in both sample sub-actions list and original flow,
the rss level and rss type in the sample sub-actions list should be
consistent with the original flow list, since the expanding items
for RSS should be the same for both actions.

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: fix unnecessary checking for RSS action
Jiawei Wang [Thu, 14 Jan 2021 07:24:46 +0000 (09:24 +0200)]
net/mlx5: fix unnecessary checking for RSS action

RSS action is valid only in NIC-RX domain, this fix bypass
the function that getting RSS action from the flow action list
under no NIC-RX domain.

Fixes: e745f900072e ("net/mlx5: optimize flow RSS struct")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agoapp/testpmd: support RSS in sample action
Jiawei Wang [Thu, 14 Jan 2021 07:24:45 +0000 (09:24 +0200)]
app/testpmd: support RSS in sample action

Support rss action in the sample sub-actions list.

The examples for the sample flow use case and result as below:
set sample_actions 0 mark id  0x12 / rss queues  0 1 2 3 end  / end
flow create 0 ingress group 1 pattern eth / end actions
sample ratio 1 index 0 / jump group 2 / end

This flow will result in all the matched ingress packets will be
jumped to next table, and the each packet will be marked with 0x12
and duplicated to rss queues of the control application.

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agocommon/sfc_efx/base: apply mask to value on match field set
Ivan Malov [Sun, 17 Jan 2021 22:21:11 +0000 (01:21 +0300)]
common/sfc_efx/base: apply mask to value on match field set

An application may submit all-zeros masks for a given field
to be used in two given specifications and, in the meantime,
use different unmasked values. Later on, when compared, the
two specifications will prove unequal, and, if the rules in
question are outer, the client driver will have to allocate
a separate rule for the second specification. Provided that
all other match criteria are the same, the HW will deem the
two outer rules being duplicates, which is in fact the case.

Apply masks to values in efx_mae_match_spec_field_set() API
to fix the issue and avoid duplicate outer rule allocations.

Fixes: 370ed675a952 ("common/sfc_efx/base: support setting PPORT in match spec")
Cc: stable@dpdk.org
Reported-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
3 years agoapp/testpmd: support modify field flow action
Alexander Kozyrev [Mon, 18 Jan 2021 21:40:26 +0000 (21:40 +0000)]
app/testpmd: support modify field flow action

Add support for the RTE_FLOW_ACTION_MODIFY_FIELD to the testpmd.
Implement CLI to create the modify_field action and supply all the
needed parameters to modify an arbitrary packet field (as well as
mark, tag or metadata) with data from another field or immediate
value.

Example of the flow is the following:
flow create 0 egress group 1 pattern eth / ipv4 / udp / end
  actions modify_field op set dst_type tag dst_level 2 dst_offset 8
          src_type gtp_teid src_level 0 src_offset 0 width 16 / end

This flow copies 16 bits from the second Tag in the Tags array
into the outermost GTP TEID packet header field. 8 bits of the
Tag are skipped as indicated by the dst_offset action parameter.

op, dst_type, src_type and width are the mandatory parameters to
specify. Levels and offset are 0 by default if they are not
overridden by a user. The operation can be set, add or sub.

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agoethdev: introduce generic modify flow action
Alexander Kozyrev [Mon, 18 Jan 2021 21:40:25 +0000 (21:40 +0000)]
ethdev: introduce generic modify flow action

Implement the generic modify flow API to allow manipulations on
an arbitrary header field (as well as mark, metadata or tag) using
data from another field or a user-specified value.
This generic modify mechanism removes the necessity to implement
a separate RTE Flow action every time we need to modify a new packet
field in the future.

Supported operation are:
- set: copy data from source to destination.
- add: integer addition, stores the result in destination.
- sub: integer subtraction, stores the result in destination.

The field ID is used to specify the desired source/destination packet
field in order to simplify the API for various encapsulation models.
Specifying the packet field ID with the needed encapsulation level
is able to quickly get a packet field for any inner packet header.

Alternatively, the special ID (ITEM_START) can be used to point to
the very beginning of a packet. This ID in conjunction with the
offset parameter provides great flexibility to copy/modify any part of
a packet as needed.

The number of bits to use from a source as well as the offset can be
be specified to allow a partial copy or dividing a big packet field
into multiple small fields (e.g. copying 128 bits of IPv6 to 4 tags).

An immediate value (or a pointer to it) can be specified instead of the
level and the offset for the special FIELD_VALUE ID (or FIELD_POINTER).
Can be used as a source only.

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/hns3: remove unused assignment for RSS key
Lijun Ou [Thu, 14 Jan 2021 13:33:37 +0000 (21:33 +0800)]
net/hns3: remove unused assignment for RSS key

The default RSS key does not need to be configured repeatedly
when call hns3_dev_configure function with the NULL RSS key
because the default RSS key has been configured when the PMD
driver run hns3_do_start function with starting device.

Besides, it will not overwrite the initialized key if
rte_eth_dev_configure API will be called directly and RSS key is NULL
after init PMD driver.

Therefore, the assignment for RSS key in hns3_dev_configure
function is unnecessary.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix dump register out of range
Chengchang Tang [Thu, 14 Jan 2021 13:33:36 +0000 (21:33 +0800)]
net/hns3: fix dump register out of range

Currently, when dump the queue interrupt registers, the number of
registers that should be dumped is calculated from num_msi. But the
value of num_msi includes the number of misc interrupts. So, for some
hardware version, like kupeng930, it will lead to an illegal access.

This patch replace num_msi with intr_tqps_num which indicate the
number of interrupts used by the tqps.

Fixes: 936eda25e8da ("net/hns3: support dump register")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix data overwriting during register dump
Chengchang Tang [Thu, 14 Jan 2021 13:33:35 +0000 (21:33 +0800)]
net/hns3: fix data overwriting during register dump

The data pointer has not moved after BAR register dumped. This causes
the later register to overwrite the previous data.

This patch fix the overwriting by move the pointer after every dump
function. And the missing separator between 32-bit register and the
64-bit register is also added to avoid a parsing error.

Fixes: 936eda25e8da ("net/hns3: support dump register")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix register length when dumping registers
Chengchang Tang [Thu, 14 Jan 2021 13:33:34 +0000 (21:33 +0800)]
net/hns3: fix register length when dumping registers

Currently, the reg length return by HNS3 is the total length of all the
registers. But for upper layer user, the total register length is the
length multiplied by width. This can lead to a waste of memory and print
some invalid information.

This patch corrects the length and width of the register.

Fixes: 936eda25e8da ("net/hns3: support dump register")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: use new opcode for clearing hardware resource
Hongbo Zheng [Thu, 14 Jan 2021 13:33:33 +0000 (21:33 +0800)]
net/hns3: use new opcode for clearing hardware resource

The original command opcode '0x700A' may cause firmware error,
so '0x700A' is deserted, now use '0x700B' to replace it.

Fixes: 223d9eceaeee ("net/hns3: clear residual hardware configurations on init")
Cc: stable@dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix VF query link status in dev init
Chengwen Feng [Thu, 14 Jan 2021 13:33:32 +0000 (21:33 +0800)]
net/hns3: fix VF query link status in dev init

Current hns3vf queried link status in dev init stage, but the link
status should be maintained in dev start stage, this patch fix this.

Also, in the dev start stage, we use quick query instead of delayed
query to make sure update the link status soon.

Fixes: a5475d61fa34 ("net/hns3: support VF")
Fixes: 958edf6627d5 ("net/hns3: fix VF link status")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: support traffic management
Chengwen Feng [Thu, 14 Jan 2021 13:33:31 +0000 (21:33 +0800)]
net/hns3: support traffic management

This patch support RTE TM ops function for PF, which could
used to:
1. config port's peak rate.
2. config TC's peak rate.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: use C11 atomics builtins for resetting
Lijun Ou [Thu, 14 Jan 2021 13:33:30 +0000 (21:33 +0800)]
net/hns3: use C11 atomics builtins for resetting

Use C11 atomic builtins with explicit ordering instead of
rte_atomic ops with the resetting member of hns3_reset_data
structure.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/ionic: fix link speed and autonegotiation
Andrew Boyer [Mon, 11 Jan 2021 19:02:09 +0000 (11:02 -0800)]
net/ionic: fix link speed and autonegotiation

Don't assume autoneg in link_update().

Always call ionic_dev_cmd_port_autoneg() in start().

This allows the client to specify the link settings.

Fixes: 598f6726390f ("net/ionic: add basic port operations")
Cc: stable@dpdk.org
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
3 years agonet/ionic: clear up confusion around FC autoneg
Andrew Boyer [Mon, 11 Jan 2021 19:02:08 +0000 (11:02 -0800)]
net/ionic: clear up confusion around FC autoneg

IONIC does not support Flow-Control autonegotiation.

Always wait for completion after each dev cmd.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
3 years agonet/ionic: do not add station MAC filter on init
Andrew Boyer [Mon, 11 Jan 2021 19:02:07 +0000 (11:02 -0800)]
net/ionic: do not add station MAC filter on init

The address is not needed in the firmware.
This reduces the startup time a bit.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Signed-off-by: Neel Patel <neel@pensando.io>
3 years agonet/ionic: set port admin state to up in port init
Andrew Boyer [Mon, 11 Jan 2021 19:02:06 +0000 (11:02 -0800)]
net/ionic: set port admin state to up in port init

This reduces the startup time a bit.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Signed-off-by: Neel Patel <neel@pensando.io>
3 years agonet/ionic: combine queue init and enable commands
Andrew Boyer [Mon, 11 Jan 2021 19:02:05 +0000 (11:02 -0800)]
net/ionic: combine queue init and enable commands

Adding F_ENA to the q_init command has the same effect as q_enable.
This reduces the startup time a bit.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Signed-off-by: Neel Patel <neel@pensando.io>
3 years agonet/ionic: revise configuration flag handling
Andrew Boyer [Mon, 11 Jan 2021 19:02:04 +0000 (11:02 -0800)]
net/ionic: revise configuration flag handling

Configuration flags come to the driver in dev_configure(). From there,
the driver calls ionic_lif_configure() to update the lif->feature
bitfield, and then programs the port.

Features like VLAN_RX_FILTER and RX_HASH cannot be disabled in the
device, so do nothing in response to requests to disable them. (The
device config would ideally show them enabled by default, but some
DTS tests fail if RSS_HASH is set but RSS is not.)

Move features from the per-queue to per-port lists. IONIC does not
really support per-queue configuration: the stack disallows disabling
a queue feature if it is enabled on the port, while the device
disallows enabling a queue feature if it is disabled on the port.
Thus all configuration is per-port.

Move the guts of ionic_vlan_offload_set() into a new function,
ionic_lif_configure_vlan_offload(), so it can be called by
ionic_lif_configure().

Move the check for DEV_RX_OFFLOAD_SCATTER from rx_queue_setup() up
into ionic_lif_configure().

Warn if rx_drop_en is not set.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
3 years agoapp/testpmd: fix IP checksum calculation
George Prekas [Thu, 7 Jan 2021 20:42:28 +0000 (14:42 -0600)]
app/testpmd: fix IP checksum calculation

Strict-aliasing rules are violated by cast to uint16_t* in flowgen.c and
the calculated IP checksum is wrong. Use attribute __may_alias__ to fix
the problem.

Fixes: e9e23a617eb8 ("app/testpmd: add flowgen forwarding engine")
Cc: stable@dpdk.org
Signed-off-by: George Prekas <prekageo@amazon.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/enic: use 64B completion queue entries if available
Hyong Youb Kim [Thu, 7 Jan 2021 14:01:54 +0000 (06:01 -0800)]
net/enic: use 64B completion queue entries if available

Latest VIC adapters support 64B CQ (completion queue) entries as well
as 16B entries available on all VIC models. 64B entries can greatly
reduce cache contention (CPU stall cycles) between DMA writes (Rx
packet descriptors) and polling CPU. The effect is very noticeable on
Intel platforms with DDIO. As most UCS servers are based on Intel
platforms, enable and use 64B CQ entries by default, if
available. Also, add devarg 'cq64' so the user can explicitly disable
64B CQ.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
3 years agoethdev: avoid blocking telemetry for link status
Bruce Richardson [Thu, 14 Jan 2021 12:17:33 +0000 (12:17 +0000)]
ethdev: avoid blocking telemetry for link status

When querying the link status via telemetry interface, we don't want the
client to have to wait for multiple seconds for a reply. Therefore use
"rte_eth_link_get_nowait()" rather than "rte_eth_link_get()" in the
telemetry callback.

Fixes: c190daedb9b1 ("ethdev: add telemetry callbacks")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
3 years agonet/fm10k: remove vector config
David Marchand [Fri, 15 Jan 2021 13:40:21 +0000 (14:40 +0100)]
net/fm10k: remove vector config

This config item is not exposed anymore now that we removed make
support.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/i40e: remove vector config
David Marchand [Fri, 15 Jan 2021 13:40:20 +0000 (14:40 +0100)]
net/i40e: remove vector config

This config item is not exposed anymore now that we removed make
support.
Note: all architectures provide vectorised functions.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/hinic: restore vectorised code
David Marchand [Fri, 15 Jan 2021 13:40:19 +0000 (14:40 +0100)]
net/hinic: restore vectorised code

Following make support removal, the vectorised code is not built
anymore, fix the build flag check.

Fixes: 3cc6ecfdfe85 ("build: remove makefiles")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
3 years agonet/mlx5: add GENEVE TLV option flow translation
Shiri Kuzin [Sun, 17 Jan 2021 10:21:22 +0000 (12:21 +0200)]
net/mlx5: add GENEVE TLV option flow translation

The GENEVE TLV option matching flows must be created
using a translation function.

This function checks whether we already created a Devx
object for the matching and either creates the objects
or updates the reference counter.

Signed-off-by: Shiri Kuzin <shirik@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: add GENEVE TLV option flow validation
Shiri Kuzin [Sun, 17 Jan 2021 10:21:21 +0000 (12:21 +0200)]
net/mlx5: add GENEVE TLV option flow validation

This patch adds validation routine for the GENEVE
header TLV option.

The GENEVE TLV option match must include all fields
with full masks due to NIC does not support masking
on option class, type and length.

The option data length must be non zero and provided
data pattern should be zero neither due to hardware
limitations.

Signed-off-by: Shiri Kuzin <shirik@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: create GENEVE TLV option management
Shiri Kuzin [Sun, 17 Jan 2021 10:21:20 +0000 (12:21 +0200)]
net/mlx5: create GENEVE TLV option management

Currently firmware supports the only TLV object per device
to match on the GENEVE header option.

This patch adds the simple TLV object management to the mlx5 PMD.

Signed-off-by: Shiri Kuzin <shirik@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agocommon/mlx5: create GENEVE TLV option object with DevX
Shiri Kuzin [Sun, 17 Jan 2021 10:21:19 +0000 (12:21 +0200)]
common/mlx5: create GENEVE TLV option object with DevX

TLV object is a special firmware maintained entity used
to support match on GENEVE header extension option.

The TLV object is created with DevX API and accepts
the option class, type and lehgth fields.

The class type and length fields are set using MLX5_SET
and the Devx object is created using mlx5 glue function.

Signed-off-by: Shiri Kuzin <shirik@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agocommon/mlx5: check GENEVE TLV support in HCA attributes
Shiri Kuzin [Sun, 17 Jan 2021 10:21:18 +0000 (12:21 +0200)]
common/mlx5: check GENEVE TLV support in HCA attributes

This is preparation step to support match on GENEVE TLV option.

In this Patch we add the HCA attributes that will allow
supporting GENEVE TLV option matching.

Signed-off-by: Shiri Kuzin <shirik@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agoapp/testpmd: support GENEVE header option length
Viacheslav Ovsiienko [Sun, 17 Jan 2021 10:21:17 +0000 (12:21 +0200)]
app/testpmd: support GENEVE header option length

The patch adds the GENEVE rte flow option length support to
command line interpreter. The flow command with GENEVE
option items looks like:

    flow create 0 ingress pattern eth / ipv4 / udp / geneve vni
    is 100 optlen is 2 / end actions drop / end

The option length should be specified in 32-bit words, this
value specifies the all options length in the GENEVE header.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
3 years agoapp/testpmd: support GENEVE option item
Viacheslav Ovsiienko [Sun, 17 Jan 2021 10:21:16 +0000 (12:21 +0200)]
app/testpmd: support GENEVE option item

The patch adds the GENEVE option rte flow item support to
command line interpreter. The flow command with GENEVE
option items looks like:

  flow create 0 ingress pattern eth / ipv4 / udp / geneve vni is 100 /
       geneve-opt class is 99 length is 1 type is 0 data is 0x669988 /
       end actions drop / end

The option length should be specified in 32-bit words, this
value specifies the length of the data pattern/mask arrays (should be
multiplied by sizeof(uint32_t) to be expressed in bytes. If match
on the length itself is not needed the mask should be set to zero, in
this case length is used to specify the pattern/mask array lengths only.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
3 years agoethdev: introduce GENEVE header TLV option item
Shiri Kuzin [Sun, 17 Jan 2021 10:21:15 +0000 (12:21 +0200)]
ethdev: introduce GENEVE header TLV option item

The Geneve tunneling protocol is designed to allow the
user to specify some data context on the packet.
The GENEVE TLV (Type-Length-Variable) Option
is the mean intended to present the user data.

In order to support GENEVE TLV Option the new rte_flow
item "rte_flow_item_geneve_opt" is added.
The new item contains the values and masks for the
following fields:
-option class
-option type
-length
-data

New item will be added to testpmd to support match and
raw encap/decap actions.

Signed-off-by: Shiri Kuzin <shirik@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/liquidio: fix jumbo frame flag condition for MTU set
Steve Yang [Mon, 18 Jan 2021 07:04:28 +0000 (07:04 +0000)]
net/liquidio: fix jumbo frame flag condition for MTU set

The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition.
If the Ether overhead is larger than 18 when it supports VLAN tag,
that will cause the jumbo flag rx offload is wrong when MTU size is
'RTE_ETHER_MTU'.

This fix will normalize the boundary condition with 'RTE_ETHER_MTU'
and overhead even though current overhead is 18.

Fixes: 9f1c00266d82 ("net/liquidio: add API to set MTU")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/nfp: fix jumbo frame flag condition for MTU set
Steve Yang [Mon, 18 Jan 2021 07:04:27 +0000 (07:04 +0000)]
net/nfp: fix jumbo frame flag condition for MTU set

The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition.
If the Ether overhead is larger than 18 when it supports VLAN tag,
that will cause the jumbo flag rx offload is wrong when MTU size is
'RTE_ETHER_MTU'.

This fix will change the boundary condition with 'RTE_ETHER_MTU',
that perhaps impacts the cases of the jumbo frame related.

Fixes: d4a27a3b092a ("nfp: add basic features")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/hinic: fix jumbo frame flag condition for MTU set
Steve Yang [Mon, 18 Jan 2021 07:04:26 +0000 (07:04 +0000)]
net/hinic: fix jumbo frame flag condition for MTU set

The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition.
If the Ether overhead is larger than 18 when it supports VLAN tag,
that will cause the jumbo flag rx offload is wrong when MTU size is
'RTE_ETHER_MTU'.

This fix will normalize the boundary condition with 'RTE_ETHER_MTU'
and overhead even though current overhead is 18.

Fixes: 254bd849b132 ("net/hinic: set jumbo frame offload flag")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/enetc: fix jumbo frame flag condition for MTU set
Steve Yang [Mon, 18 Jan 2021 07:04:25 +0000 (07:04 +0000)]
net/enetc: fix jumbo frame flag condition for MTU set

The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition.
If the Ether overhead is larger than 18 when it supports VLAN tag,
that will cause the jumbo flag rx offload is wrong when MTU size is
'RTE_ETHER_MTU'.

This fix will normalize the boundary condition with 'RTE_ETHER_MTU'
and overhead even though current overhead is 18.

Fixes: 5d5589b0c858 ("net/enetc: support MTU update and jumbo frames")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/axgbe: fix jumbo frame flag condition for MTU set
Steve Yang [Mon, 18 Jan 2021 07:04:24 +0000 (07:04 +0000)]
net/axgbe: fix jumbo frame flag condition for MTU set

The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition.
If the Ether overhead is larger than 18 when it supports VLAN tag,
that will cause the jumbo flag rx offload is wrong when MTU size is
'RTE_ETHER_MTU'.

This fix will normalize the boundary condition with 'RTE_ETHER_MTU'
and overhead even though current overhead is 18.

Fixes: b58d8781fa1f ("net/axgbe: support setting MTU")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/cxgbe: fix jumbo frame flag condition
Steve Yang [Mon, 18 Jan 2021 07:04:23 +0000 (07:04 +0000)]
net/cxgbe: fix jumbo frame flag condition

The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition.
If the Ether overhead is larger than 18 when it supports VLAN tag,
that will cause the jumbo flag rx offload is wrong when MTU size is
'RTE_ETHER_MTU'.

This fix will normalize the boundary condition with 'RTE_ETHER_MTU'
and overhead even though current overhead is 18.

Fixes: 4b2eff452d2e ("cxgbe: enable jumbo frames")
Fixes: 0ec33be4c857 ("cxgbe: allow to change mtu")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/ixgbe: fix jumbo frame flag condition
Steve Yang [Mon, 18 Jan 2021 07:04:22 +0000 (07:04 +0000)]
net/ixgbe: fix jumbo frame flag condition

The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition.
If the Ether overhead is larger than 18 when it supports VLAN tag,
that will cause the jumbo flag rx offload is wrong when MTU size is
'RTE_ETHER_MTU'.

This fix will normalize the boundary condition with 'RTE_ETHER_MTU'
and overhead even though current overhead is 18.

Fixes: 59d0ecdbf0e1 ("ethdev: MTU accessors")
Fixes: 95a27b3ba5f5 ("net/ixgbe: enable jumbo frame for VF")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
3 years agonet/thunderx: fix jumbo frame flag condition for MTU set
Steve Yang [Mon, 18 Jan 2021 07:04:21 +0000 (07:04 +0000)]
net/thunderx: fix jumbo frame flag condition for MTU set

The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition,
but the Ether overhead is larger than 18 when it supports dual VLAN tags.
That will cause the jumbo flag rx offload is wrong when MTU size is
'RTE_ETHER_MTU'.

This fix will change the boundary condition with 'RTE_ETHER_MTU' and
overhead, that perhaps impacts the cases of the jumbo frame related.

Fixes: 65d9804edc05 ("net/thunderx: support MTU configuration")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/sfc: fix jumbo frame flag condition for MTU set
Steve Yang [Mon, 18 Jan 2021 07:04:20 +0000 (07:04 +0000)]
net/sfc: fix jumbo frame flag condition for MTU set

The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition,
but the Ether overhead is larger than 18 when it supports VLAN tag.
That will cause the jumbo flag rx offload is wrong when MTU size is
'RTE_ETHER_MTU'.

This fix will change the boundary condition with 'RTE_ETHER_MTU',
that perhaps impacts the cases of the jumbo frame related.

Fixes: ff6a1197c3b1 ("net/sfc: convert to new Rx offload API")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/qede: fix jumbo frame flag condition for MTU set
Steve Yang [Mon, 18 Jan 2021 07:04:19 +0000 (07:04 +0000)]
net/qede: fix jumbo frame flag condition for MTU set

The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition,
but the Ether overhead is larger than 18 when it supports dual VLAN tags.
That will cause the jumbo flag rx offload is wrong when MTU size is
'RTE_ETHER_MTU'.

This fix will change the boundary condition with 'RTE_ETHER_MTU' and
overhead, that perhaps impacts the cases of the jumbo frame related.

Fixes: 200645ac7909 ("net/qede: set MTU")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/octeontx2: fix jumbo frame flag condition for MTU
Steve Yang [Mon, 18 Jan 2021 07:04:18 +0000 (07:04 +0000)]
net/octeontx2: fix jumbo frame flag condition for MTU

The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition,
but the Ether overhead is larger than 18 when it supports dual VLAN tags.
That will cause the jumbo flag rx offload is wrong when MTU size is
'RTE_ETHER_MTU'.

This fix will change the boundary condition with 'RTE_ETHER_MTU' and
overhead, that perhaps impacts the cases of the jumbo frame related.

Fixes: 0e2efd02db58 ("net/octeontx2: add MTU set operation")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Acked-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
3 years agonet/octeontx: fix jumbo frame flag condition for MTU set
Steve Yang [Mon, 18 Jan 2021 07:04:17 +0000 (07:04 +0000)]
net/octeontx: fix jumbo frame flag condition for MTU set

The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition,
but the Ether overhead is larger than 18 when it supports dual VLAN tags.
That will cause the jumbo flag rx offload is wrong when MTU size is
'RTE_ETHER_MTU'.

This fix will change the boundary condition with 'RTE_ETHER_MTU' and
overhead, that perhaps impacts the cases of the jumbo frame related.

Fixes: 3151e6a687a3 ("net/octeontx: support MTU")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Harman Kalra <hkalra@marvell.com>
3 years agonet/ipn3ke: fix jumbo frame flag condition for MTU set
Steve Yang [Mon, 18 Jan 2021 07:04:16 +0000 (07:04 +0000)]
net/ipn3ke: fix jumbo frame flag condition for MTU set

The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition,
but the Ether overhead is larger than 18 when it supports dual VLAN tags.
That will cause the jumbo flag rx offload is wrong when MTU size is
'RTE_ETHER_MTU'.

This fix will change the boundary condition with 'RTE_ETHER_MTU' and
overhead, that perhaps impacts the cases of the jumbo frame related.

Fixes: 70d6b7f550f4 ("net/ipn3ke: add representor")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
3 years agonet/ice: fix jumbo frame flag condition
Steve Yang [Mon, 18 Jan 2021 07:04:15 +0000 (07:04 +0000)]
net/ice: fix jumbo frame flag condition

The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition,
but the Ether overhead is larger than 18 when it supports dual VLAN tags.
That will cause the jumbo flag rx offload is wrong when MTU size is
'RTE_ETHER_MTU'.

This fix will change the boundary condition with 'RTE_ETHER_MTU' and
overhead, that perhaps impacts the cases of the jumbo frame related.

Fixes: 84dc7a95a2d3 ("net/ice: enable flow director engine")
Fixes: 1b009275e2c8 ("net/ice: add Rx queue init in DCF")
Fixes: ae2bdd0219cb ("net/ice: support MTU setting")
Fixes: 50370662b727 ("net/ice: support device and queue ops")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/iavf: fix jumbo frame flag condition
Steve Yang [Mon, 18 Jan 2021 07:04:14 +0000 (07:04 +0000)]
net/iavf: fix jumbo frame flag condition

The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition,
but the Ether overhead is larger than 18 when it supports dual VLAN tags.
That will cause the jumbo flag rx offload is wrong when MTU size is
'RTE_ETHER_MTU'.

This fix will change the boundary condition with 'RTE_ETHER_MTU' and
overhead, that perhaps impacts the cases of the jumbo frame related.

Fixes: 3fd7a3719c66 ("net/avf: enable ops for MTU setting")
Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/i40e: fix jumbo frame flag condition
Steve Yang [Mon, 18 Jan 2021 07:04:13 +0000 (07:04 +0000)]
net/i40e: fix jumbo frame flag condition

The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition,
but the Ether overhead is larger than 18 when it supports dual VLAN tags.
That will cause the jumbo flag rx offload is wrong when MTU size is
'RTE_ETHER_MTU'.

This fix will change the boundary condition with 'RTE_ETHER_MTU' and
overhead, that perhaps impacts the cases of the jumbo frame related.

Fixes: c1715402df8f ("i40evf: fix jumbo frame support")
Fixes: 43e5488c0ac6 ("net/i40e: support MTU configuration")
Fixes: a778a1fa2e4e ("i40e: set up and initialize flow director")
Fixes: c3ac7c5b0b8a ("net/i40e: convert to new Rx offloads API")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
3 years agonet/hns3: fix jumbo frame flag condition for MTU set
Steve Yang [Mon, 18 Jan 2021 07:04:12 +0000 (07:04 +0000)]
net/hns3: fix jumbo frame flag condition for MTU set

The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition,
but the Ether overhead is larger than 18 when it supports dual VLAN tags.
That will cause the jumbo flag rx offload is wrong when MTU size is
'RTE_ETHER_MTU'.

This fix will change the boundary condition with 'HSN3_DEFAULT_FRAME_LEN',
that perhaps impacts the cases of the jumbo frame related.

Fixes: 1f5ca0b460cd ("net/hns3: support some device operations")
Fixes: a5475d61fa34 ("net/hns3: support VF")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Acked-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/e1000: fix jumbo frame flag condition for MTU set
Steve Yang [Mon, 18 Jan 2021 07:04:11 +0000 (07:04 +0000)]
net/e1000: fix jumbo frame flag condition for MTU set

The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition,
but the Ether overhead is larger than 18 when it supports VLAN tag.
That will cause the jumbo flag rx offload is wrong when MTU size is
'RTE_ETHER_MTU'.

This fix will change the boundary condition with 'RTE_ETHER_MTU' and
overhead, that perhaps impacts the cases of the jumbo frame related.

Fixes: ef990fb56e55 ("net/e1000: convert to new Rx offloads API")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
3 years agonet/dpaa2: fix jumbo frame flag condition for MTU set
Steve Yang [Mon, 18 Jan 2021 07:04:10 +0000 (07:04 +0000)]
net/dpaa2: fix jumbo frame flag condition for MTU set

The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition,
but the Ether overhead is larger than 18 when it supports VLAN tag.
That will cause the jumbo flag rx offload is wrong when MTU size is
'RTE_ETHER_MTU'.

This fix will change the boundary condition with 'RTE_ETHER_MTU' and
overhead, that perhaps impacts the cases of the jumbo frame related.

Fixes: e16408499412 ("net/dpaa2: configure jumbo frames")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
3 years agonet/dpaa: fix jumbo frame flag condition for MTU set
Steve Yang [Mon, 18 Jan 2021 07:04:09 +0000 (07:04 +0000)]
net/dpaa: fix jumbo frame flag condition for MTU set

The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition,
but the Ether overhead is larger than 18 when it supports VLAN tag.
That will cause the jumbo flag rx offload is wrong when MTU size is
'RTE_ETHER_MTU'.

This fix will change the boundary condition with 'RTE_ETHER_MTU' and
overhead, that perhaps impacts the cases of the jumbo frame related.

Fixes: 25f854197abc ("net/dpaa: support jumbo frames")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
3 years agoapp/testpmd: fix max Rx packet length for VLAN packets
Steve Yang [Mon, 18 Jan 2021 07:04:08 +0000 (07:04 +0000)]
app/testpmd: fix max Rx packet length for VLAN packets

When the max rx packet length is smaller than the sum of mtu size and
ether overhead size, it should be enlarged, otherwise the VLAN packets
will be dropped.

Removed the rx_offloads assignment for jumbo frame during command line
parsing, and set the correct jumbo frame flag if MTU size is larger than
the default value 'RTE_ETHER_MTU' within 'init_config()'.

Fixes: 384161e00627 ("app/testpmd: adjust on the fly VLAN configuration")
Fixes: 35b2d13fd6fd ("net: add rte prefix to ether defines")
Fixes: ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
Fixes: 150c9ac2df13 ("app/testpmd: update Rx offload after setting MTU")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoethdev: fix max Rx packet length check
Steve Yang [Mon, 18 Jan 2021 07:04:07 +0000 (07:04 +0000)]
ethdev: fix max Rx packet length check

Ethdev is using default Ethernet overhead to decide if provided
'max_rx_pkt_len' value is bigger than max (non jumbo) MTU value,
and limits it to MAX if it is.

Since the application/driver used Ethernet overhead is different than
the ethdev one, check result is wrong.

If the driver is using Ethernet overhead bigger than the default one,
the provided 'max_rx_pkt_len' is trimmed down, and in the driver when
correct Ethernet overhead is used to convert back, the resulting MTU is
less than the intended one, causing some packets to be dropped.

Like,
app     -> max_rx_pkt_len = 1500/*mtu*/ + 22/*overhead*/ = 1522
ethdev  -> 1522 > 1518/*MAX*/; max_rx_pkt_len = 1518
driver  -> MTU = 1518 - 22 = 1496
Packets with size 1497-1500 are dropped although intention is to be able
to send/receive them.

The fix is to make ethdev use the correct Ethernet overhead for port,
instead of default one.

Fixes: 59d0ecdbf0e1 ("ethdev: MTU accessors")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agodoc: update for txgbe
Jiawen Wu [Fri, 15 Jan 2021 11:03:10 +0000 (19:03 +0800)]
doc: update for txgbe

Add txgbe PMD new features in release notes,
update user guide in txgbe.rst for flow API and traffic manager.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/iavf: adjust CRC statistics calculation
Haiyue Wang [Fri, 15 Jan 2021 06:57:08 +0000 (14:57 +0800)]
net/iavf: adjust CRC statistics calculation

The AVF can support to enable / disable CRC strip, so it needs to adjust
the statistics calculation for ibytes according to offload setting.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: add PTYPE mapping for eCPRI
Jeff Guo [Wed, 13 Jan 2021 14:05:17 +0000 (22:05 +0800)]
net/iavf: add PTYPE mapping for eCPRI

Until the new eCPRI PTYPE be added into the RTE lib, just mapping eCPRI
to the PTYPE of RTE_PTYPE_L4_UDP in iavf pmd.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: add PTYPE mapping for eCPRI
Jeff Guo [Wed, 13 Jan 2021 14:05:16 +0000 (22:05 +0800)]
net/ice: add PTYPE mapping for eCPRI

Until the new eCPRI PTYPE be added into the RTE lib, just mapping eCPRI
to the PTYPE of RTE_PTYPE_L4_UDP in ice pmd.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agocommon/sfc_efx/base: enhance field ID check in field set API
Ivan Malov [Wed, 6 Jan 2021 10:06:01 +0000 (13:06 +0300)]
common/sfc_efx/base: enhance field ID check in field set API

A field ID passed to the API may point to a gap in the array
of field descriptors. Turn down such invocations as improper.

Fixes: 370ed675a952 ("common/sfc_efx/base: support setting PPORT in match spec")
Cc: stable@dpdk.org
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
3 years agocommon/sfc_efx/base: fix MAE match spec class comparison API
Ivan Malov [Wed, 6 Jan 2021 10:06:00 +0000 (13:06 +0300)]
common/sfc_efx/base: fix MAE match spec class comparison API

The helper exits once it encounters a field which hasn't its
capability status reported by the FW. Handle the corner case
when the two mask-value pairs match for the field, which, in
the absence of capability information, is sufficient to deem
the class unaffected by the field. Explain this in a comment.

Fixes: bb71f7e0a35a ("common/sfc_efx/base: add match specs class comparison API")
Cc: stable@dpdk.org
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
3 years agocommon/sfc_efx/base: fix MAE match spec validation helper
Ivan Malov [Wed, 6 Jan 2021 10:05:59 +0000 (13:05 +0300)]
common/sfc_efx/base: fix MAE match spec validation helper

A particular FW version is aware of some set of match fields.
Depending on FW configuration and match specification type, a
known field may not necessarily be allowed to have a non-zero
mask. FW communicates such restrictions via field capabilities
MCDI. Newer FW may be aware of more fields. For such fields,
older FW simply does not report any capabilities.

A situation may occur when libefx is aware of a match field
which the FW is unaware of (eg., older FW), that is, FW does
not report capability status for this field. In this case,
libefx must consider such field as unsupported and demand
all-zeros mask for it when validating match specifications.

Currently, the helper in question simply exits and reports
that the specification is valid when it encounters a field
with no capability status available. This is clearly wrong.

Introduce the missing check to fix the problem.

Fixes: 34285fd0891d ("common/sfc_efx/base: add match spec validate API")
Cc: stable@dpdk.org
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
3 years agocommon/sfc_efx/base: fix MPORT related byte order handling
Ivan Malov [Mon, 28 Dec 2020 03:00:23 +0000 (06:00 +0300)]
common/sfc_efx/base: fix MPORT related byte order handling

MPORT values derived by helper functions are little-endian.
At the same time, MCDIs which consume these values perform
one more host-order to little-endian conversion internally.

Fix the helper functions to return host-order MPORT values.

Fixes: 370ed675a952 ("common/sfc_efx/base: support setting PPORT in match spec")
Fixes: bb024542fffd ("common/sfc_efx/base: add API for adding action drop")
Fixes: 097058033f03 ("common/sfc_efx/base: add API to get mport of PF/VF")
Cc: stable@dpdk.org
Reported-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
3 years agoapp/testpmd: allocate FEC capability array dynamically
Karra Satwik [Thu, 24 Dec 2020 11:18:49 +0000 (16:48 +0530)]
app/testpmd: allocate FEC capability array dynamically

Request the driver for number of entries in the FEC caps
array and then dynamically allocate the array.

Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/cxgbe: support configuring link FEC
Karra Satwik [Sun, 20 Dec 2020 22:47:42 +0000 (04:17 +0530)]
net/cxgbe: support configuring link FEC

Add ethdev ops to query and configure link FEC.

Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
3 years agonet/cxgbe: rework and simplify link handling
Karra Satwik [Sun, 20 Dec 2020 22:47:41 +0000 (04:17 +0530)]
net/cxgbe: rework and simplify link handling

Rework and simplify link handling code. Remove redundant
variables in link configuration structure and directly
extract information from the 32-bit link capabilities.

Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
3 years agonet/cxgbe: remove legacy 16-bit link capabilities
Karra Satwik [Sun, 20 Dec 2020 22:47:40 +0000 (04:17 +0530)]
net/cxgbe: remove legacy 16-bit link capabilities

Remove legacy 16-bit link capabilities and always request for the
32-bit link capabilities from firmware.

Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
3 years agoapp/testpmd: fix start index for showing FEC array
Karra Satwik [Sun, 20 Dec 2020 22:47:01 +0000 (04:17 +0530)]
app/testpmd: fix start index for showing FEC array

Start from index 0 when going through the FEC array. This will allow
"off" to get printed for RTE_ETH_FEC_NOFEC mode.

Fixes: b19da32e3151 ("app/testpmd: add FEC command")
Cc: stable@dpdk.org
Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/qede: fix promiscuous enable
Balazs Nemeth [Wed, 23 Dec 2020 14:15:49 +0000 (15:15 +0100)]
net/qede: fix promiscuous enable

When calling rte_eth_promiscuous_enable(port_id) followed by
rte_eth_allmulticast_enable(port_id), the port is not in promisc mode
anymore. This patch ensures that promisc mode takes precedence over
allmulticast mode fixing the regression introduced by b10231aed1ed.

Fixes: b10231aed1ed ("net/qede: fix multicast drop in promiscuous mode")
Cc: stable@dpdk.org
Signed-off-by: Balazs Nemeth <bnemeth@redhat.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
3 years agonet/ice: fix GTPU header parsing
Xuan Ding [Thu, 14 Jan 2021 08:00:53 +0000 (08:00 +0000)]
net/ice: fix GTPU header parsing

Refine the GTPU template to avoid incorrect header type be parsed.
Some indentation is adjusted.

Fixes: 38d632cbdc88 ("net/ice: refactor PF RSS")

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agoapp/testpmd: add UDP tunnel port for eCPRI
Jeff Guo [Fri, 15 Jan 2021 05:15:42 +0000 (13:15 +0800)]
app/testpmd: add UDP tunnel port for eCPRI

Add new UDP tunnel port params for eCPRI configuration, the command
as below:

testpmd> port config 0 udp_tunnel_port add ecpri 6789
testpmd> port config 0 udp_tunnel_port rm ecpri 6789

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoethdev: add eCPRI tunnel type
Jeff Guo [Fri, 15 Jan 2021 05:15:41 +0000 (13:15 +0800)]
ethdev: add eCPRI tunnel type

Add type of RTE_TUNNEL_TYPE_ECPRI into the enum of ethdev tunnel type.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/mlx5: add GTP PSC item translation
Shiri Kuzin [Mon, 11 Jan 2021 18:21:52 +0000 (20:21 +0200)]
net/mlx5: add GTP PSC item translation

This patch adds the translation function which
sets the qfi, PDU type.

The next extension header which indicates the following
extension header type is set to 0x85 - a PDU session
container.

Signed-off-by: Shiri Kuzin <shirik@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: add GTP PSC flow validation
Shiri Kuzin [Mon, 11 Jan 2021 18:21:51 +0000 (20:21 +0200)]
net/mlx5: add GTP PSC flow validation

In this patch we add validation routine for
GTP PSC extension header.

The GTP PSC extension header must follow the
GTP item.

Signed-off-by: Shiri Kuzin <shirik@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agocommon/mlx5: add matcher fields for GTP extensions
Shiri Kuzin [Mon, 11 Jan 2021 18:21:50 +0000 (20:21 +0200)]
common/mlx5: add matcher fields for GTP extensions

This is a preparation step to support GTP extension header.

In this patch we add the matcher fields that will be
used to match on the GTP extension header.

Signed-off-by: Shiri Kuzin <shirik@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agoapp/testpmd: support GTP PSC option in raw sets
Viacheslav Ovsiienko [Mon, 11 Jan 2021 18:21:49 +0000 (20:21 +0200)]
app/testpmd: support GTP PSC option in raw sets

This patch add support for generating GTP PDU container
session option for the raw encap and raw decap sets.
The generated options is single 32-bit word with
minimal length specified as 4, no extra fields in the
option are supported. The option item must be preceded
with the GTP item itself, and GTP item flags must be
set accordingly:

  - E flag must be set, we are going to provide extension
  - S flag must be reset, because GTP item does not
    provide the value for SQN field, we can't fill this one
  - PN flag must be reset, no N-PDU value provided by
    GTP item either

The raw set example:

  set raw_encap 2 eth / ipv4 / udp /
                  gtp v_pt_rsv_flags is 0x34 / gtp_psc / end_set

Please, note - value 0x34 provides the required flag combination.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
3 years agoethdev: update GTP headers
Viacheslav Ovsiienko [Mon, 11 Jan 2021 18:21:48 +0000 (20:21 +0200)]
ethdev: update GTP headers

This patch introduces the GTP header individual flag bit fields
and the header optional word with N-PDU number, Sequence Number
and Next Extension Header type.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/hns3: remove unnecessary memset
Lijun Ou [Wed, 6 Jan 2021 03:46:32 +0000 (11:46 +0800)]
net/hns3: remove unnecessary memset

The hns3_cmd_desc has memset when setup and the memset
for req is unnecessary.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix crash with multi-process
Min Hu (Connor) [Wed, 6 Jan 2021 03:46:31 +0000 (11:46 +0800)]
net/hns3: fix crash with multi-process

In current version, procedure of saving eth_dev in
hns3 PMD init will be called more than twice, one
for primary, the other for secondary. That will cause
segmentation fault in Multi-process as eth_dev will
be changed in secondary process, which is different
from one in primary process.

The initial problem was access to 'rte_eth_devices'
global variable, which is wrong. But current approach
can cause problem for the secondaries, moving 'eth_dev'
to process private can work but before making things
more complex.

This patch deserted the procedure of saving eth_dev in
hns3 PMD init. Instead, it creates an internal function
that gets "struct hns3_hw" as parameter and it can be
called internally without knowing 'eth_dev'and the
.dev_ops can be wrapper to this.

Fixes: 2390bf217f4d ("net/hns3: fix FEC state query")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix Rx/Tx errors stats
Huisong Li [Wed, 6 Jan 2021 03:46:30 +0000 (11:46 +0800)]
net/hns3: fix Rx/Tx errors stats

Abnormal errors stats in Rx/Tx datapath are statistics
items in driver, and displayed in xstats. They should
be cleared by the rte_eth_xstats_reset api, instead of
the rte_eth_stats_reset.

Fixes: c4b7d6761d01 ("net/hns3: get Tx abnormal errors in xstats")
Fixes: 521ab3e93361 ("net/hns3: add simple Rx path")
Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix error code in xstats
Huisong Li [Wed, 6 Jan 2021 03:46:29 +0000 (11:46 +0800)]
net/hns3: fix error code in xstats

The ethdev API has processed the failure to obtain
xstats statistics. Therefore, driver should return
an error code instead of 0 in 'hns3_dev_xstats_get'
API.

Fixes: 8839c5e202f3 ("net/hns3: support device stats")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix xstats with id and names
Huisong Li [Wed, 6 Jan 2021 03:46:28 +0000 (11:46 +0800)]
net/hns3: fix xstats with id and names

Currently, validity check for ids and values in the
hns3_dev_xstats_get_by_id API is incorrect, which will
cause a problem. Namely, if the ID range of the xstats
stats item does not include the basic stats item, the
app can not obtain the corresponding xstats statistics
in hns3_dev_xstats_get_by_id.

Similarly, the hns3_dev_xstats_get_names_by_id interface
also has a problem.

Although the input parameter verification code cannot be
executed due to the implementation of the ethdev framework
interface, the driver needs to ensure the correctness of
the input parameters.

Fixes: 8839c5e202f3 ("net/hns3: support device stats")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix interception with flow director
Lijun Ou [Wed, 6 Jan 2021 03:46:27 +0000 (11:46 +0800)]
net/hns3: fix interception with flow director

The rte_fdir_conf structure has deprecated and users need
to use the specified rule parameters of rte_flow structure
when configure a flow rule. As a result, it is incorrectly
used in the rte_flow API.

Fixes: fcba820d9b9e ("net/hns3: support flow director")
Cc: stable@dpdk.org
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/iavf: fix null pointer dereference in eCPRI rule
Simei Su [Thu, 14 Jan 2021 05:23:24 +0000 (13:23 +0800)]
net/iavf: fix null pointer dereference in eCPRI rule

A pointer has already been dereferenced before checking if it is NULL.
It doesn't make any sense, so correct to avoid it.

Coverity issue: 365290
Fixes: f57ebdae3cd0 ("net/iavf: support eCPRI message type 0 for RSS")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/i40e: optimize Tx by using AVX512
Leyi Rong [Thu, 14 Jan 2021 06:39:51 +0000 (14:39 +0800)]
net/i40e: optimize Tx by using AVX512

Optimize Tx path by using AVX512 instructions and vectorize the
tx free bufs process.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
3 years agonet/i40e: add AVX512 vector path
Leyi Rong [Thu, 14 Jan 2021 06:39:50 +0000 (14:39 +0800)]
net/i40e: add AVX512 vector path

Add AVX512 support for i40e PMD. This patch adds i40e_rxtx_vec_avx512.c
to support i40e AVX512 vPMD.

This patch aims to enable AVX512 on i40e vPMD. Main changes are focus
on Rx path compared with AVX2 vPMD.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
3 years agonet/i40e: remove devarg use-latest-supported-vec
Leyi Rong [Thu, 14 Jan 2021 06:39:49 +0000 (14:39 +0800)]
net/i40e: remove devarg use-latest-supported-vec

As eal parameter --force-max-simd-bitwidth is already introduced,
to make it more clear when setting rx/tx function, remove
devarg use-latest-supported-vec support.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
3 years agonet/i40e: fix X722 for 802.1ad frames ability
Weifeng Li [Sun, 10 Jan 2021 08:34:17 +0000 (16:34 +0800)]
net/i40e: fix X722 for 802.1ad frames ability

I40E_DEV_ID_SFP_I_X722 does not support 802.1ad frames ability,
so I40E_HW_FLAG_802_1AD_CAPABLE should not be set.
The patch also correct the comment for I40E_HW_FLAG_802_1AD_CAPABLE
configure.

Fixes: 9efa8d28b4da ("net/i40e: fix SFP X722 with FW4.16")
Cc: stable@dpdk.org
Signed-off-by: Weifeng Li <liweifeng96@126.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agoapp/crypto-perf: fix spelling in output
Ciara Power [Mon, 18 Jan 2021 11:34:10 +0000 (11:34 +0000)]
app/crypto-perf: fix spelling in output

Fixes some spelling errors in app logs and help text.

Fixes: 7da018731c56 ("app/crypto-perf: add help option")
Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
3 years agocrypto/dpaa2_sec: support AES-CMAC integrity check
Hemant Agrawal [Thu, 14 Jan 2021 07:05:02 +0000 (12:35 +0530)]
crypto/dpaa2_sec: support AES-CMAC integrity check

This patch adds support for AES_CMAC integrity in non-security mode.
This patch modifies the camm flib to handles the AES CMAC
without conflicting the proto ALG operations. i.e. by creating
another ALG operation routine.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
3 years agocrypto/dpaa_sec: reduce log on queue closure
Hemant Agrawal [Thu, 14 Jan 2021 07:05:01 +0000 (12:35 +0530)]
crypto/dpaa_sec: reduce log on queue closure

If for some reason the queue is not close properly,
specially in test cases.
The QUEUE retire prints are flooding the screen.
They are not really required as WARNING.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
3 years agocommon/dpaax/caamflib: update ZUC-ZUC descriptor sharing
Akhil Goyal [Thu, 14 Jan 2021 07:05:00 +0000 (12:35 +0530)]
common/dpaax/caamflib: update ZUC-ZUC descriptor sharing

The descriptor sharing needed to be changed for ZUC+ZUC as we
were getting invalid CHA combination error due to sharing
being done on DECOs simultaneously.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>