dpdk.git
3 years agonet/mlx5: validate hash Rx queue pointer
Dekel Peled [Wed, 3 Feb 2021 10:09:09 +0000 (12:09 +0200)]
net/mlx5: validate hash Rx queue pointer

Implementation of mlx5_hrxq_get() tries to get pointer to a hrxq
object, by reusing an existing hrxq, or creating a new one.
There is no check of the obtained pointer, so using it might result
in error.

This patch adds check of the pointer before using it, and return 0
if the pointer is NULL to indicate error.

Fixes: e1592b6c4dea ("net/mlx5: make Rx queue thread safe")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: fix shared RSS capability check
Dekel Peled [Wed, 3 Feb 2021 10:08:42 +0000 (12:08 +0200)]
net/mlx5: fix shared RSS capability check

Existing code to create shared RSS action doesn't fully check
driver capabilities.
Using older driver, if DevX capabilities are insufficient,
the IBV operations are used.
In this case the ind_table_modify operation is not supported, and
shared RSS action can't be modified after creation.

This patch adds check of driver capability, and fails the validation
for shared RSS action in case it is insufficient.

Fixes: d2046c09aa64 ("net/mlx5: support shared action for RSS")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/pcap: fix infinite Rx with large files
Ferruh Yigit [Thu, 4 Feb 2021 16:51:03 +0000 (16:51 +0000)]
net/pcap: fix infinite Rx with large files

Packet forwarding is not working when infinite Rx feature is used with
large .pcap files that has high number of packets.

The problem is number of allocated mbufs are less than the infinite Rx
ring size, and all mbufs consumed to fill the ring, so there is no mbuf
left for forwarding.

Current logic can not detect that infinite Rx ring is not filled
completely and no more mbufs left, and setup continues which leads
silent fail on packet forwarding.

There isn't much can be done when there is not enough mbuf for the given
.pcap file, so additional checks added to detect the case and fail
explicitly with an error log.

Bugzilla ID: 595
Fixes: a3f5252e5cbd ("net/pcap: enable infinitely Rx a pcap file")
Cc: stable@dpdk.org
Reported-by: Cian Ferriter <cian.ferriter@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Cian Ferriter <cian.ferriter@intel.com>
3 years agonet/pcap: fix byte stats for drop Tx
Ferruh Yigit [Wed, 3 Feb 2021 17:30:25 +0000 (17:30 +0000)]
net/pcap: fix byte stats for drop Tx

Drop Tx path in pcap is Tx that just drops the packets, which is used
for the case only Rx from a pcap file is requested/matters.

The byte stats was calculated using first mbuf segment, which gives
wrong values for multi segmented mbufs, updated to use packet length
instead.

Bugzilla ID: 597
Fixes: a3f5252e5cbd ("net/pcap: enable infinitely Rx a pcap file")
Cc: stable@dpdk.org
Reported-by: Cian Ferriter <cian.ferriter@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Cian Ferriter <cian.ferriter@intel.com>
3 years agonet/ice: fix VLAN 0 adding based on VLAN mode
Haiyue Wang [Thu, 4 Feb 2021 12:50:29 +0000 (20:50 +0800)]
net/ice: fix VLAN 0 adding based on VLAN mode

In Single VLAN Mode, single VLAN filters via ICE_SW_LKUP_VLAN are based
on the inner VLAN ID, so the VLAN TPID (i.e. 0x8100 or 0x888a8) doesn't
matter.

In Double VLAN Mode, outer/single VLAN filters via ICE_SW_LKUP_VLAN are
based on the outer/single VLAN ID + VLAN TPID.

For both modes, adding a VLAN 0 + no VLAN TPID filter to handle untagged
traffic when VLAN pruning is enabled. Also, this handles VLAN 0 priority
tagged traffic in Single VLAN Mode, since the VLAN TPID is not part of
filtering.

If Double VLAN Mode is enabled then an explicit VLAN 0 + VLAN TPID filter
needs to be added to allow VLAN 0 priority tagged traffic in DVM, since
the VLAN TPID is part of filtering.

Fixes: 14e7a4b37b4f ("net/ice/base: support configuring device in double VLAN mode")

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agoapp/testpmd: support shared age action query
Dekel Peled [Thu, 4 Feb 2021 10:04:15 +0000 (12:04 +0200)]
app/testpmd: support shared age action query

Shared age action query was implemented as part of flow query,
but was not implemented as part of shared action query.

This patch adds the required implementation.

Fixes: 2f622174bf86 ("app/testpmd: support query of age action")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/hns3: validate requested maximum Rx frame length
Huisong Li [Wed, 3 Feb 2021 12:23:57 +0000 (20:23 +0800)]
net/hns3: validate requested maximum Rx frame length

When jumbo frame is enabled, the MTU size needs to be modified
based on 'max_rx_pkt_len'. Driver needs to check the validity
of 'max_rx_pkt_len'. And it should be in the range of
HNS3_DEFAULT_FRAME_LEN and HNS3_MAX_FRAME_LEN. Otherwise, it may
cause that the MTU size is inconsistent with jumbo frame offload.

Fixes: 19a3ca4c99cf ("net/hns3: add start/stop and configure 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 VF reset on mailbox failure
Chengchang Tang [Wed, 3 Feb 2021 12:23:56 +0000 (20:23 +0800)]
net/hns3: fix VF reset on mailbox failure

Currently, during the VF reset, the VF will send a MBX to inform
PF to reset it and the disable command bit will be set whether
the MBX is successful. Generally, multiple reset attempts are made
after a failure. However, because the command is disabled, all
subsequent reset will all fail.

This patch disable the command only after the MBX message is
successfully.

Fixes: 2790c6464725 ("net/hns3: support device reset")
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 firmware exceptions by concurrent commands
Chengchang Tang [Wed, 3 Feb 2021 12:23:55 +0000 (20:23 +0800)]
net/hns3: fix firmware exceptions by concurrent commands

There are two scenarios that command queue uninit performed
concurrently with the firmware command: asynchronous command
and timeout command.

For asynchronous command, if a large number of functions send
commands, these commands may need to be queued to wait for
firmware processing. If a function is uninited suddenly, CMDQ
clearing and firmware processing may be performed concurrently.

For timeout command, if the command failed due to busy scheduling
of firmware, this command will be processed in the next scheduling.
And this may lead to concurrency.

The preceding concurrency may lead to a firmware exceptions.

This patch add a waiting time to ensure the firmware complete the
processing of left over command when PMD uninit.

Fixes: 737f30e1c3ab ("net/hns3: support command interface with firmware")
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 flow director rule residue on malloc failure
Chengwen Feng [Wed, 3 Feb 2021 12:23:54 +0000 (20:23 +0800)]
net/hns3: fix flow director rule residue on malloc failure

After FD rule config success, driver will malloc fdir_rule to hold the
rule info, if malloc fail the FD rule in hardware was not cleanup.

Fixes: fcba820d9b9e ("net/hns3: support flow director")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: use C11 atomics
Chengchang Tang [Wed, 3 Feb 2021 12:23:53 +0000 (20:23 +0800)]
net/hns3: use C11 atomics

Replace all the atomic type with C11 atomic builtins in hns3
PMD.

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix stats flip overflow
Chengchang Tang [Wed, 3 Feb 2021 12:23:52 +0000 (20:23 +0800)]
net/hns3: fix stats flip overflow

Currently, statistics may overflow in some scenarios.

For example, if HW statistics are reset by stats reset operation,
but there are still a lot of residual packets exist in the HW
queues and these packets are error packets, flip may occurred
because the ipacket is obtained by subtracting the number of
software error packets from the number of HW received packets.

This patch verifies the calculation and returns 0 when overflow
may occur.

Fixes: 8839c5e202f3 ("net/hns3: support device stats")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: remove MPLS from supported flow items
Chengwen Feng [Wed, 3 Feb 2021 12:23:51 +0000 (20:23 +0800)]
net/hns3: remove MPLS from supported flow items

The Kunpeng920 and Kunpeng930 don't support parse MPLS packet, so
remove the type from supported flow items.

Fixes: fcba820d9b9e ("net/hns3: support flow director")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: constrain TM peak rate
Chengwen Feng [Wed, 3 Feb 2021 12:23:50 +0000 (20:23 +0800)]
net/hns3: constrain TM peak rate

User could config Port or TC's peak rate by TM ops, but hardware does
not support peak rate which lower than 1Mbps. So we constraint TM
peak rate must be at least 1Mbps.

Fixes: c09c7847d892 ("net/hns3: support traffic management")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix RSS indirection table size
Lijun Ou [Wed, 3 Feb 2021 12:23:49 +0000 (20:23 +0800)]
net/hns3: fix RSS indirection table size

The driver should not use the fixed value as the validity check of
RSS indirection table size with HW supported. As a result, it will
cause misjudgment when the RSS RETA size with HW supported have
changed.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix link status change from firmware
Huisong Li [Wed, 3 Feb 2021 12:23:48 +0000 (20:23 +0800)]
net/hns3: fix link status change from firmware

When the hardware link status changes, the firmware proactively
reports the link status change message, and then driver update
link status. This feature is lack of a switch to control in PF
driver. Otherwise, this feature does not take effect when the
kernel PF driver that supports the feature is not loaded.

Fixes: 109e4dd1bd7a ("net/hns3: get link state change through mailbox")
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 query order of link status and link info
Huisong Li [Wed, 3 Feb 2021 12:23:47 +0000 (20:23 +0800)]
net/hns3: fix query order of link status and link info

When link information is updated in the firmware, the link information
is updated first and then the link status is updated. In a 1s periodic
task, PF driver queries the link information and then obtains link
status.
It may lead to a 1s time difference for obtaining valid link information
when the port is up. Therefore, the query order of driver should be
reversed to the order of firmware.

Fixes: 109e4dd1bd7a ("net/hns3: get link state change through mailbox")
Fixes: 59fad0f32135 ("net/hns3: support link update operation")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/mlx5: fix E-Switch egress mirror flow validation
Jiawei Wang [Wed, 3 Feb 2021 08:29:17 +0000 (10:29 +0200)]
net/mlx5: fix E-Switch egress mirror flow validation

The stored metadata in all registers C were lost in E-Switch egress
mirroring flows due to HW limitation. The register C0 keeps the
source vport index that also was used as one of the flow matcher.

While sample action and jump action (jump to table X) was in the
E-Switch egress flow, the flow in the next table X wasn't hit since
source vport value lost.

The modify actions after sample action should be applied to the packet
on normal path, not to the sampled packet. In order to support this
mlx5 PMD splits the flow into sub flows and jump action is engaged
implicitly, causing malfunction due to registers corruption.

This patch adds the validation the for E-Switch mirroring jump egress
flow, and checks for this hidden jump as well and reject the flows with
modify actions after sampling.

Fixes: 6a951567c159 ("net/mlx5: support E-Switch mirroring and jump in one flow")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agocommon/mlx5: fix storing synced MAC to internal table
Souvik Dey [Tue, 2 Feb 2021 17:48:40 +0000 (12:48 -0500)]
common/mlx5: fix storing synced MAC to internal table

As the internal MAC table is divided into Unicast and Multicast address
sections, we should check the type of synced MAC address before storing
it to the internal table. Currently the check is not done, and the
synced MAC of 33:33:00:00:00:01 gets stored in the unicast section
(mostly index 1) causing all subsequent mlx5_set_mc_addr_list()
to fail with error -EADDRINUSE, as the mac_list contains the MAC
33:33:00:00:00:01. This denies adding of any new multicast address to
the internal list and also fails to add the MAC address to the device
in case of SR-IOV VF.

Fixes: f22442cb5d42 ("net/mlx5: reduce Netlink commands dependencies")
Fixes: ccdcba53a3f4 ("net/mlx5: use Netlink to add/remove MAC addresses")
Cc: stable@dpdk.org
Signed-off-by: Souvik Dey <sodey@rbbn.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: fix counter and age flow action validation
Jiawei Wang [Tue, 2 Feb 2021 16:42:49 +0000 (18:42 +0200)]
net/mlx5: fix counter and age flow action validation

Currently old age action was implemented by flow counter and only one
counter index was maintained in each flow. While there was old age
action and share count action in one flow, and the same share count
action in the another flow, the counter was updated if second flow
was hit, so it may cause the first flow didn't aged out since the
counter was updated by second flow.

This patch updates the validation function for count and old age action:
  - Old age and shared count action combination is not supported.
  - Old age and count(not shared) action could work in the same sub
    flow.

Fixes: e7138997e07d ("net/mlx5: make shared counters thread safe")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agodoc: fix supported feature table in mlx5 guide
Viacheslav Ovsiienko [Tue, 2 Feb 2021 14:27:32 +0000 (16:27 +0200)]
doc: fix supported feature table in mlx5 guide

This sets the correct minimal requirements for these features:

- Buffer Split offload is supported/verified on ConnectX-5
- Tx scheduling requires ConnectX-6DX and depends on firmware version

Fixes: cb7b0c24c835 ("doc: update hardware offloads support in mlx5 guide")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Reviewed-by: Asaf Penso <asafp@nvidia.com>
3 years agonet/octeontx: fix max Rx packet length
Sunil Kumar Kori [Tue, 26 Jan 2021 08:52:43 +0000 (14:22 +0530)]
net/octeontx: fix max Rx packet length

Maximum Rx packet length is getting updated twice which
corrupts actual value.

Fixes: 3151e6a687a3 ("net/octeontx: support MTU")
Cc: stable@dpdk.org
Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Harman Kalra <hkalra@marvell.com>
3 years agonet/i40e: fix build for Windows MinGW
Leyi Rong [Tue, 2 Feb 2021 14:32:58 +0000 (22:32 +0800)]
net/i40e: fix build for Windows MinGW

Adds extra cflags '-fno-asynchronous-unwind-tables'
to avoid the MinGW build error:
Error: invalid register for .seh_savexmm

Fixes: 5c38c33f7880 ("net/i40e: disable AVX512 with MinGW")

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Tested-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
3 years agonet/iavf: fix VLAN insert
Xiaoyun Li [Thu, 4 Feb 2021 03:11:18 +0000 (11:11 +0800)]
net/iavf: fix VLAN insert

The new VIRTCHNL_VF_OFFLOAD_VLAN_V2 capability allows PF to set the
location of TX VLAN insertion.

So VF needs to insert VLAN tag according to the location flags.

Fixes: 1c301e8c3cff ("net/iavf: support new VLAN capabilities")

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
3 years agonet/ice: fix QinQ switch rule input set mask
Yuying Zhang [Thu, 4 Feb 2021 06:07:51 +0000 (06:07 +0000)]
net/ice: fix QinQ switch rule input set mask

QinQ switch rule doesn't support ethertype field match.
QinQ ethertype pattern should not be created. Change the
input set mask to fix the issue.

Fixes: bb3386f348dd ("net/ice: enable QinQ filter for switch")

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: fix VLAN strip for double VLAN
Haiyue Wang [Thu, 4 Feb 2021 02:03:33 +0000 (10:03 +0800)]
net/ice: fix VLAN strip for double VLAN

VLAN strip was failing for double VLAN because of hardware
configuration, resulting mbuf not having the vlan_tci information.

Adjusted the strip setting according to current VLAN mode to fix the
VLAN strip.

Fixes: 14e7a4b37b4f ("net/ice/base: support configuring device in double VLAN mode")

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/virtio: fix secondary process crash with PCI devices
Maxime Coquelin [Wed, 3 Feb 2021 15:58:11 +0000 (16:58 +0100)]
net/virtio: fix secondary process crash with PCI devices

The Virtio rework series mistakenly moved the rte_pci_device
pointer to struct virtio_hw, which is shared between the two
processes. But this structure is per-process, so this change
made secondary process to try accessing primary process-only
memory, leading to a crash.

This patch reverts to proper behavior, by storing the
rte_pci_device pointer into the per-process
virtio_pci_internal struct. It also provides helper to get
the pointer from the virtio_hw struct pointer.

Bugzilla ID: 633
Fixes: c8d4b02f72ae ("net/virtio: move legacy IO to virtio PCI")

Reported-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agoexamples/vhost: add error propagation in ioat ops
Cheng Jiang [Wed, 3 Feb 2021 14:29:04 +0000 (14:29 +0000)]
examples/vhost: add error propagation in ioat ops

This patch adds add error propagation for rte_ioat_completed_ops call,
and also changes dev_id type from int to uint16_t.

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agoexamples/vhost: fix potentially overflowing expression
Cheng Jiang [Tue, 2 Feb 2021 07:24:21 +0000 (07:24 +0000)]
examples/vhost: fix potentially overflowing expression

Change the type of buff_idx from uint64_t to uint32_t to fix coverity
issue.

Coverity issue: 366264
Fixes: a68ba8e0a6b6 ("examples/vhost: refactor vhost data path")

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agoexamples/vhost: remove async inflight packet counter
Cheng Jiang [Tue, 2 Feb 2021 06:17:51 +0000 (06:17 +0000)]
examples/vhost: remove async inflight packet counter

Remove async inflight packet counter since there is no need to keep
tracking it. Increase MAX_ENQUEUED_SIZE to prevent packet segment number
tracking ring from being exhausted.

Fixes: a68ba8e0a6b6 ("examples/vhost: refactor vhost data path")

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agovhost: fix vid allocation race
Fei Chen [Mon, 1 Feb 2021 08:48:44 +0000 (16:48 +0800)]
vhost: fix vid allocation race

vhost_new_device might be called in different threads at
the same time.

thread 1(config thread)
            rte_vhost_driver_start
               ->vhost_user_start_client
                   ->vhost_user_add_connection
                     -> vhost_new_device

thread 2(vhost-events)
vhost_user_read_cb
           ->vhost_user_msg_handler (return value < 0)
             -> vhost_user_start_client
                 -> vhost_new_device

So there could be a case that a same vid has been allocated
twice, or some vid might be lost in DPDK lib however still
held by the upper applications.

Another place where race would happen is at the func
*vhost_destroy_device*, but after a detailed investigation,
the race does not exist as long as no two devices have the
same vid: Calling vhost_destroy_devices in different
threads with different vids is actually safe.

Fixes: a277c7159876 ("vhost: refactor code structure")
Cc: stable@dpdk.org
Reported-by: Peng He <hepeng.0320@bytedance.com>
Signed-off-by: Fei Chen <chenwei.0515@bytedance.com>
Reviewed-by: Zhihong Wang <wangzhihong.wzh@bytedance.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
3 years agonet/mlx5: fix miniCQE configuration for Verbs
Alexander Kozyrev [Mon, 1 Feb 2021 17:16:30 +0000 (17:16 +0000)]
net/mlx5: fix miniCQE configuration for Verbs

Verbs cannot be used to configure newly introduced miniCQE formats for
Flow Tag and L3/L4 Header compression. Support for these formats has
been added to the DevX configuration only. And the RX queue descriptor
has been updated with the CQE compression format information only as
well. But the datapath relies on this info no matter which method is
used for Rx queues configuration. Set proper CQE compression format
information in the Verbs configuration to fix the miniCQE parsing logic.

Fixes: 54c2d46b160f ("net/mlx5: support flow tag and packet header miniCQEs")
Cc: stable@dpdk.org
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: check FW miniCQE format capabilities
Alexander Kozyrev [Tue, 2 Feb 2021 02:07:37 +0000 (02:07 +0000)]
net/mlx5: check FW miniCQE format capabilities

miniCQE formats for Flow Tag and L3/L4 Header compression are only
supported by Mellanox FW starting version 16.29.392. There is no
point to allow user to enable these formats if FW cannot provide them.
Check FW capabilities and deny user requests if the selected miniCQE
format is not supported by an underlying NIC.

Fixes: 54c2d46b160f ("net/mlx5: support flow tag and packet header miniCQEs")
Cc: stable@dpdk.org
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agodoc: group mlx5 shared actions
Xiaoyu Min [Tue, 2 Feb 2021 12:23:51 +0000 (12:23 +0000)]
doc: group mlx5 shared actions

Put all supported shared actions in one new table

Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
Reviewed-by: Asaf Penso <asafp@nvidia.com>
3 years agodoc: add more explanation about flow shared action
Xiaoyu Min [Tue, 2 Feb 2021 12:23:50 +0000 (12:23 +0000)]
doc: add more explanation about flow shared action

Added more information of shared action on
how to update, query, and the benefits.

Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Reviewed-by: Asaf Penso <asafp@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agodoc: update i40e Windows support
Pallavi Kadam [Tue, 2 Feb 2021 19:09:16 +0000 (11:09 -0800)]
doc: update i40e Windows support

Add documentation to support i40e PMD on Windows.
Update the release notes and features list for the same.

Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/sfc: fix TSO and checksum offloads for EF10
Ivan Malov [Tue, 2 Feb 2021 15:23:45 +0000 (18:23 +0300)]
net/sfc: fix TSO and checksum offloads for EF10

This is workaround for 8000-series EF10 hardware TSO bug.
Innermost IP length and outer UDP datagram length must be
greater than or equal to the corresponding values derived
from the MSS; otherwise, the checksum offloads will break.

Fixes: c1ce2ba218f8 ("net/sfc: support tunnel TSO on EF10 native Tx datapath")
Fixes: 6bc985e41155 ("net/sfc: support TSO in EF10 Tx datapath")
Fixes: fec33d5bb3eb ("net/sfc: support firmware-assisted TSO")
Cc: stable@dpdk.org
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 agomaintainers: update for nfp
Heinrich Kuhn [Sun, 31 Jan 2021 10:36:07 +0000 (12:36 +0200)]
maintainers: update for nfp

Release-on-close has been implemented for the NFP PMD. Remove the
UNMAINTAINED flag.

Signed-off-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agodoc: fix product link in hns3 guide
Lijun Ou [Fri, 29 Jan 2021 09:22:05 +0000 (17:22 +0800)]
doc: fix product link in hns3 guide

Here fixes the Kunpeng introduction address link with hns3.rst

Fixes: 565829db8b8f ("net/hns3: add build and doc infrastructure")
Cc: stable@dpdk.org
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agodoc: update release notes for hns3
Lijun Ou [Fri, 29 Jan 2021 09:22:04 +0000 (17:22 +0800)]
doc: update release notes for hns3

Add TM(Traffic Management) feature with hns3 in release notes.
It includes:
1. configure port's peak rate with PF
2. configure TC's peak rate with PF

Fixes: c09c7847d892 ("net/hns3: support traffic management")
Cc: stable@dpdk.org
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agodoc: add FEC to NIC features
Min Hu (Connor) [Fri, 29 Jan 2021 09:22:03 +0000 (17:22 +0800)]
doc: add FEC to NIC features

Document FEC in NIC features, add information about FEC and add
implementation related support.

Fixes: b7ccfb09da95 ("ethdev: introduce FEC API")
Fixes: 9bf2ea8dbc65 ("net/hns3: support FEC")
Fixes: 62aafe035896 ("net/cxgbe: support configuring link FEC")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agodoc: add mirror rule limitation of X722
Lingyu Liu [Tue, 2 Feb 2021 09:56:22 +0000 (09:56 +0000)]
doc: add mirror rule limitation of X722

Currently, X722 firmware doesn't support to add more than
one mirror rule in one VSI.

Signed-off-by: Lingyu Liu <lingyu.liu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
3 years agonet/ice: fix RSS type checking
Xuan Ding [Mon, 1 Feb 2021 05:16:59 +0000 (05:16 +0000)]
net/ice: fix RSS type checking

For pattern MAC_PPPOE_IPV4/6, add ETH_RSS_ETH into input_set_mask
to fix RSS rule cannot be created when set eth as RSS type.

Fixes: 0d84f86c3022 ("net/ice: fix GTPU header parsing")

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/virtio: fix PCI ops assignment
Maxime Coquelin [Mon, 1 Feb 2021 20:31:38 +0000 (21:31 +0100)]
net/virtio: fix PCI ops assignment

VIRTIO_OPS() macro relies on the port ID stored in the
virtio_hw struct. Issue is that it is used before being
assigned at init time. It results in all devices setting
ops on port ID 0, causing crash later when calling ops
for port IDs other than 0.

This patch ensures port ID assignment is done at early
primary process probe time, before it is being used.

Bugzilla ID: 631
Fixes: 512e27eeb743 ("net/virtio: move PCI specific dev init to PCI ethdev init")

Reported-by: Wei Ling <weix.ling@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Tested-by: Wei Ling <weix.ling@intel.com>
3 years agonet/virtio: fix listen file initialization
Maxime Coquelin [Mon, 1 Feb 2021 09:33:17 +0000 (10:33 +0100)]
net/virtio: fix listen file initialization

When running in client mode, the listen file descriptor
is not initialized, and so has value 0. At destroy time,
the listen FD is closed if its value is greater than or
equal to zero, which causes STDIN to be closed.

Bugzilla ID: 630
Fixes: 949735312f5e ("net/virtio: move vhost-user specifics to its backend")

Reported-by: Jun W Zhou <junx.w.zhou@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Tested-by: Jun W Zhou <junx.w.zhou@intel.com>
3 years agonet/enic: fix filter type used for flow API
Hyong Youb Kim [Tue, 2 Feb 2021 00:24:23 +0000 (16:24 -0800)]
net/enic: fix filter type used for flow API

The filter type (struct filter_v2.type) should always be set to
FILTER_DPDK_1, when advanced filtering is enabled in firmware.
Otherwise, for some old firmware versions, the driver sets
it to FILTER_USNIC_IP, and attempts to install filters fail. This
behavior matches that of the now-removed flow director implementation
(enic_clsf.c).

Fixes: 26faa126d87e ("net/enic: flow API for NICs with advanced filters disabled")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
3 years agonet/ionic: clean up Tx queue version support
Andrew Boyer [Fri, 29 Jan 2021 22:44:34 +0000 (14:44 -0800)]
net/ionic: clean up Tx queue version support

The ionic PMD only supports Tx queue version 1 or greater.
Version 1 introduced a new SGL format with support for more
fragments per descriptor.

Add release notes and an explanation to the docs.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
3 years agonet/ionic: use existing array size macro
Andrew Boyer [Fri, 29 Jan 2021 22:44:33 +0000 (14:44 -0800)]
net/ionic: use existing array size macro

Using the RTE_DIM() macro makes the code clearer.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
3 years agonet/hns3: support LSC event report
Chengwen Feng [Fri, 22 Jan 2021 10:18:52 +0000 (18:18 +0800)]
net/hns3: support LSC event report

This patch support LSC (Link Status Change) event report.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agodoc: fix QinQ flow rules in testpmd guide
Bernard Iremonger [Tue, 19 Jan 2021 13:00:52 +0000 (13:00 +0000)]
doc: fix QinQ flow rules in testpmd guide

In the Testpmd Flow rules management section, correct
the TPID values in the Sample QinQ flow rules sub section.
Also replace the keyword qinq_strip with extend in the
vlan set command.

Fixes: bef3bfe7d5f4 ("doc: revise sample testpmd flow commands")
Cc: stable@dpdk.org
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
3 years agoapp/testpmd: add PF and VF targets to sample flow action
Satheesh Paul [Mon, 21 Dec 2020 05:46:36 +0000 (11:16 +0530)]
app/testpmd: add PF and VF targets to sample flow action

Add support to specify PF or VF as targets in "set sample_actions"
command.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Ori Kam <orika@nvidia.com>
3 years agonet/mlx5: fix shared RSS translation and cleanup
Dekel Peled [Mon, 1 Feb 2021 09:28:57 +0000 (11:28 +0200)]
net/mlx5: fix shared RSS translation and cleanup

This patch includes several updates of the shared RSS action:

(1)
The shared RSS action, introduced recently, uses existing definitions
of the regular RSS action.
The new defined value MLX5_RSS_HASH_IPV4_TCP uses existing definition
IBV_RX_HASH_SRC_PORT_TCP twice, instead of using
IBV_RX_HASH_SRC_PORT_TCP and IBV_RX_HASH_DST_PORT_TCP.
            ---                          ---
The same is true for IPv4-UDP, IPv6-TCP, IPv6-UDP.
As result, a shared RSS action with L4 type is specified as src-only.
Flow rule using such shared action, while specifying L4 item in flow
pattern, will fail to create.
This patch updates the new definitions, to use the existing values
correctly.

(2)
On shared RSS action destroy, in function __flow_dv_action_rss_release,
the indirection table shared_rss->ind_tbl was released before
shared_rss->refcnt was checked.
This order is incorrect, since the indirection table should be
released only when the shared RSS action is destroyed.
This patch puts release function calls in correct order.

(3)
Variables declared of type "struct mlx5_shared_action_rss" are named
"shared_rss", "action", and "shared_action".
To improve code readability, this patch renames all to "shared_rss".

Fixes: d7cfcddded61 ("net/mlx5: translate shared action for RSS action")
Fixes: d2046c09aa64 ("net/mlx5: support shared action for RSS")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: update flow meter capability flags names
Dekel Peled [Sun, 31 Jan 2021 13:29:40 +0000 (15:29 +0200)]
net/mlx5: update flow meter capability flags names

Existing names of the flags denoting flow meter capability are unclear
and may be misleading.

This patch updates the names to align with the updated documentation.
Comments were edited, describing the names clearly.

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/bnxt: fix Rx completion ring size calculation
Lance Richardson [Fri, 29 Jan 2021 18:07:09 +0000 (13:07 -0500)]
net/bnxt: fix Rx completion ring size calculation

The size of the receive completion ring should be recalculated
when MTU is increased to a size that requires scattered receive
or when LRO is enabled. Move logic for this calculation from
the ring configuration path to the device start path.
   - Made size calculation dependent only on scattered_rx
     status.
   - Moved calculation of scattered_rx up in the initialization
     sequence.
   - Made LRO offload status part of scattered_rx calculation.

When the completion ring size is too small, completion overflows
can occur causing the ring to be disabled in hardware.

Fixes: 04067844a3e9 ("net/bnxt: reduce CQ queue size without aggregation ring")
Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/iavf: fix default RSS configuration
Xuan Ding [Sun, 31 Jan 2021 10:47:24 +0000 (10:47 +0000)]
net/iavf: fix default RSS configuration

Add advanced RSS offloads check due to some legacy driver (kernel/DPDK
PF) does not support virtual channel command VIRTCHNL_OP_RSS_HENA with
hena = 0 and VIRTCHNL_OP_ADD_RSS_CFG.

Fixes: 95f2f0e9fc2a ("net/iavf: improve default RSS")

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agodevtools: fix examples build test
David Marchand [Tue, 2 Feb 2021 10:54:05 +0000 (11:54 +0100)]
devtools: fix examples build test

Since we don't check ABI on the x86-default target anymore, installation
of the target must always happen for examples external compilation check
to work.

Fixes: 6a426d733ec0 ("devtools: reduce ABI checks and static binaries")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
3 years agodevtools: add acronyms in dictionary for commit checks
Ferruh Yigit [Mon, 1 Feb 2021 22:47:24 +0000 (22:47 +0000)]
devtools: add acronyms in dictionary for commit checks

eCPRI -> enhanced Common Public Radio Interface
FEC   -> Forward Error Correction
SMP   -> Symmetric MultiProcessing

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoconfig/arm: replace native machine args
Juraj Linkeš [Tue, 2 Feb 2021 09:05:27 +0000 (10:05 +0100)]
config/arm: replace native machine args

There are compiler issues when building with -mcpu=native with popular
compilers, such as GCC-8.4:
In file included from ../lib/librte_eal/arm/include/rte_vect.h:11,
                 from ../lib/librte_net/net_crc_neon.c:10:
../lib/librte_net/net_crc_neon.c: In function â€˜crcr32_folding_round’:
/usr/lib/gcc/aarch64-linux-gnu/8/include/arm_neon.h:26094:1: error:
inlining failed in call to always_inline â€˜vmull_p64’:
target specific option mismatch
 vmull_p64 (poly64_t a, poly64_t b)
../lib/librte_net/net_crc_neon.c:50:20: note: called from here
  uint64x2_t tmp1 = vreinterpretq_u64_p128(vmull_p64(
    vgetq_lane_p64(vreinterpretq_p64_u64(fold), 0),
    vgetq_lane_p64(vreinterpretq_p64_u64(precomp), 1)));

and clang:
gcc -E -dM -mcpu="native" - < /dev/null | grep __ARM_FEATURE_ATOMICS
clang-9 -E -dM -mcpu="native" - < /dev/null | grep __ARM_FEATURE_ATOMICS
<no output> # no clang support

Fix this by always specifying the proper machine args and never using
the native flags.

Fixes: 78ac8eac7e8a ("config/arm: use native machine build arguments")

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
3 years agoconfig/arm: fix variable names
Ferruh Yigit [Tue, 2 Feb 2021 08:35:07 +0000 (08:35 +0000)]
config/arm: fix variable names

A config variable rename seems missed to update all config files and new
config file get with old variable names.

Reflect config variable rename to all config files, changed
'implementor_id' to 'implementer_id',
'implementor_pn' to 'part_number'.

Fixes: 3d01d65ba0d3 ("config: add aarch64 clang for Ubuntu 18.04")
Fixes: 7870ae8994c6 ("config/arm: rename variables")

Reported-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
3 years agoci: ignore APT update failure in GitHub Actions
David Marchand [Mon, 1 Feb 2021 14:30:59 +0000 (15:30 +0100)]
ci: ignore APT update failure in GitHub Actions

Ubuntu 18.04 GHA virtual machine images point at an invalid APT
repository.
We have no control over this, simply ignore the failure.

This was caught by Ilya for OVS and the robot just hit the same issue
for DPDK:

"""
Get:46 http://security.ubuntu.com/ubuntu bionic-security/restricted
Translation-en [29.9 kB]
Get:47 http://security.ubuntu.com/ubuntu bionic-security/universe amd64
Packages [1104 kB]
Get:48 http://security.ubuntu.com/ubuntu bionic-security/universe
Translation-en [247 kB]
Reading package lists...
E: The repository 'https://apt.postgresql.org/pub/repos/apt bionic-pgdg
Release' no longer has a Release file.
Error: Process completed with exit code 100.
"""

Fixes: 9d620630ea30 ("ci: fix package installation in GitHub Actions")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ilya Maximets <i.maximets@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
3 years agoversion: 21.02-rc2
Thomas Monjalon [Sat, 30 Jan 2021 00:35:54 +0000 (01:35 +0100)]
version: 21.02-rc2

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
3 years agoexamples: warn about broken pkg-config
Bruce Richardson [Tue, 19 Jan 2021 13:03:24 +0000 (13:03 +0000)]
examples: warn about broken pkg-config

Since the examples are designed to be built by end-users using Make, we
can detect and warn about broken pkg-config on the user's system as part
of the build process.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
3 years agomem: fix deadlock on secondary allocation
Anatoly Burakov [Fri, 29 Jan 2021 15:29:51 +0000 (15:29 +0000)]
mem: fix deadlock on secondary allocation

Previous fix used `rte_malloc_heap_socket_is_external()` to check if the
heap was an external heap. However, that API is thread-safe, and when
we're inside the allocation process, we're already write-locked, so
calling `rte_malloc_heap_socket_is_external()` will result in a
deadlock followed by a timeout.

Fix it by replacing the API call with a check against maximum number of
NUMA nodes, because external heaps always have higher socket ID's.

Fixes: 7ac31e82bc8f ("mem: improve parameter checking on memory hotplug")

Reported-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
3 years agoapp/testpmd: fix queue reconfig request on Rx split update
Viacheslav Ovsiienko [Thu, 21 Jan 2021 12:46:33 +0000 (12:46 +0000)]
app/testpmd: fix queue reconfig request on Rx split update

There is the "set rxpkts" command in the testpmd interactive mode,
it configures the segment sizes to split the packet on receiving.
The mentioned segment sizes are provided on the Rx queue setup
as part of queue configuration. Hence, to take the rxpkts command
into effect the Rx queues must be explicitly reconfigured.

The explained above is related to the "set rxoffs" as well.

The patch sets the queue reconfiguration request flag for
all devices once Rx split settings are updated, to take
the changes into effect the port(s) should be restarted.

Fixes: 0f2096d7ab36 ("app/testpmd: add rxpkts commands and parameters")
Fixes: 91c78e090eed ("app/testpmd: add rxoffs commands and parameters")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/iavf: fix vector mapping with queue
Jingjing Wu [Thu, 28 Jan 2021 15:00:21 +0000 (23:00 +0800)]
net/iavf: fix vector mapping with queue

Fix the vector mapping with queue by changing the recircle when
exceeds RX_VEC_START + nb_msix;

Fixes: d6bde6b5eae9 ("net/avf: enable Rx interrupt")
Cc: stable@dpdk.org
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
3 years agonet/bnxt: fix mbuf flags for PTP packets
Kalesh AP [Thu, 28 Jan 2021 03:53:30 +0000 (09:23 +0530)]
net/bnxt: fix mbuf flags for PTP packets

Commit "899f06130724" broke the update of mbuf flags for PTP packets.
"mbuf->ol_flags" is overwritten in bnxt_set_ol_flags() function.

Fixes: 899f06130724 ("net/bnxt: add Rx logic for 58818 chips")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/octeontx_ep: add Tx path
Nalla Pradeep [Fri, 29 Jan 2021 12:45:10 +0000 (04:45 -0800)]
net/octeontx_ep: add Tx path

1. Packet transmit function for both otx and otx2 are added.
2. Flushing transmit(command) queue when pending commands are more than
   maximum allowed value (currently 16).
3. Scatter gather support if the packet spans multiple buffers.

Signed-off-by: Nalla Pradeep <pnalla@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/octeontx_ep: add Rx path
Nalla Pradeep [Fri, 29 Jan 2021 12:45:09 +0000 (04:45 -0800)]
net/octeontx_ep: add Rx path

Function to deliver packets from DROQ to application is added. It also
fills DROQ with receive buffers timely such that device can fill them
with incoming packets.

Signed-off-by: Nalla Pradeep <pnalla@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/octeontx_ep: add device start and stop
Nalla Pradeep [Fri, 29 Jan 2021 12:45:08 +0000 (04:45 -0800)]
net/octeontx_ep: add device start and stop

Dev start and stop operations are added. To accomplish this internal
functions to enable or disable IO queues are incorporated.

Signed-off-by: Nalla Pradeep <pnalla@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/octeontx_ep: set up IQ and OQ registers
Nalla Pradeep [Fri, 29 Jan 2021 12:45:07 +0000 (04:45 -0800)]
net/octeontx_ep: set up IQ and OQ registers

Configuring hardware registers with command queue (IQ) and driver output
queue (OQ) parameters.
List of parameters configured for IQ after making sure it is idle
1. Base address
2. Instruction size
3. Disabling interrupts for fastpath

List of parameters configured for OQ after making sure it is idle
1. Base address
2. Output buffer size
3. Clear output queue doorbell
4. Disable interrupts for fastpath

Signed-off-by: Nalla Pradeep <pnalla@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/octeontx_ep: add Tx queue setup and release
Nalla Pradeep [Fri, 29 Jan 2021 12:45:06 +0000 (04:45 -0800)]
net/octeontx_ep: add Tx queue setup and release

Transmit queue setup involves allocating memory for the command queue
considering tx descriptor count and initializing data structure
representing the queue. Transmit queue release function frees the
command queue.

Signed-off-by: Nalla Pradeep <pnalla@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/octeontx_ep: add Rx queue setup and release
Nalla Pradeep [Fri, 29 Jan 2021 12:45:05 +0000 (04:45 -0800)]
net/octeontx_ep: add Rx queue setup and release

Receive queue setup involves allocating memory for the queue,
initializing data structure representing the queue and filling queue
with receive buffers of rx descriptor count. Receive queues are referred
as droq. Hardware fills the receive buffers in queue with the packet.

In receive queue release, receive buffers are freed along with the
receive queue.

Signed-off-by: Nalla Pradeep <pnalla@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/octeontx_ep: add device info get and configure
Nalla Pradeep [Fri, 29 Jan 2021 12:45:04 +0000 (04:45 -0800)]
net/octeontx_ep: add device info get and configure

Add device information get and device configure operations.

Signed-off-by: Nalla Pradeep <pnalla@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/octeontx_ep: add basic device setup
Nalla Pradeep [Fri, 29 Jan 2021 12:45:03 +0000 (04:45 -0800)]
net/octeontx_ep: add basic device setup

Functions to setup device, basic input queue and output queue registers
are added.

Signed-off-by: Nalla Pradeep <pnalla@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/octeontx_ep: add device init and uninit
Nalla Pradeep [Fri, 29 Jan 2021 12:45:02 +0000 (04:45 -0800)]
net/octeontx_ep: add device init and uninit

Add basic init and uninit function which includes
initializing fields of ethdev private structure.

Signed-off-by: Nalla Pradeep <pnalla@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/octeontx_ep: add ethdev probe and remove
Nalla Pradeep [Fri, 29 Jan 2021 12:45:01 +0000 (04:45 -0800)]
net/octeontx_ep: add ethdev probe and remove

Add basic PCIe ethdev probe and remove.

Signed-off-by: Nalla Pradeep <pnalla@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/octeontx_ep: add build and doc infrastructure
Nalla Pradeep [Fri, 29 Jan 2021 12:45:00 +0000 (04:45 -0800)]
net/octeontx_ep: add build and doc infrastructure

Adding bare minimum PMD library and doc build infrastructure
and claim the maintainership for octeontx end point PMD.

Signed-off-by: Nalla Pradeep <pnalla@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoraw/octeontx2_ep: change PCI device ID
Nalla Pradeep [Fri, 29 Jan 2021 12:44:59 +0000 (04:44 -0800)]
raw/octeontx2_ep: change PCI device ID

Device id to be probed by octeontx_ep raw device pmd is changed from
B203 to B204. B203 is for octeontx_ep net device pmd to probe.

Signed-off-by: Nalla Pradeep <pnalla@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/ena: prevent double doorbell
Igor Chauskin [Tue, 26 Jan 2021 18:32:26 +0000 (19:32 +0100)]
net/ena: prevent double doorbell

Add per-tx-ring flag for packets that were pushed to HW but await
doorbell. That is to prevent a situation when a doorbell is sent due to
reaching Tx burst threshold and next send fails (e.g., due to queue
full). In such case we shouldn't send another doorbell because there are
no actual packets waiting for transmission.

Fixes: c7519ea5eb8d ("net/ena: call additional doorbells if needed")
Cc: stable@dpdk.org
Signed-off-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
3 years agonet/ena: fix Tx SQ free space assessment
Igor Chauskin [Tue, 26 Jan 2021 18:32:25 +0000 (19:32 +0100)]
net/ena: fix Tx SQ free space assessment

Before starting transmission of Tx burst, the driver checked the
available space in the sq and limited the number of packets for
transmission accordingly.
The calculation was incorrect for fragmented packets and potentially had
significantly limited the length of Tx bursts.

This patch removes the assessment and pushes packets to the sq as long
as the burst is not exhausted and space is available in the sq.

Correct evaluation of the required space isn't possible before the burst
because it depends on the number of segments of each packet.
This patch adds per-packet space evaluation for each packet before
attempting to process it. In case there is not enough queue space, the
burst will just stop without error.

Fixes: 2061fe41f212 ("net/ena: linearize Tx mbuf")
Cc: stable@dpdk.org
Signed-off-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
3 years agonet/ena: validate Rx req ID upon acquiring descriptor
Michal Krawczyk [Tue, 26 Jan 2021 18:32:24 +0000 (19:32 +0100)]
net/ena: validate Rx req ID upon acquiring descriptor

Instead of verifying the Rx descriptor each time it's being used in the
driver code, now the verification happens on the HAL side.

This simplifies code a lot as instead of doing 2 validations, only
single one is needed. The driver have to check the rc value returned
by the ena_com upon reading the Rx descriptor and trigger the reset
if needed. It was previously the responsibility of the
validate_rx_req_id() function.

As part of the change, the version of the driver was bumped to v2.2.1.

Fixes: 2061fe41f212 ("net/ena: linearize Tx mbuf")
Cc: stable@dpdk.org
Signed-off-by: Ido Segev <idose@amazon.com>
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
3 years agonet/ena: fix Tx doorbell statistics
Amit Bernstein [Tue, 26 Jan 2021 18:32:23 +0000 (19:32 +0100)]
net/ena: fix Tx doorbell statistics

Increment Tx doorbell statistics on tx_pkt_burst
after writing to doorbell and in case max burst size achieved

Fixes: c7519ea5eb8d ("net/ena: call additional doorbells if needed")
Cc: stable@dpdk.org
Signed-off-by: Amit Bernstein <amitbern@amazon.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
3 years agonet/ena: flush Rx buffers memory pool cache
Ido Segev [Tue, 26 Jan 2021 18:32:22 +0000 (19:32 +0100)]
net/ena: flush Rx buffers memory pool cache

As the refill called as part of ena_start(), we end up the refill
progress with stuck buffers at the caller core cache.

Calling to flush the cache results with invalidate this cache and free
those stuck buffers.

Fixes: 1173fca25af9 ("ena: add polling-mode driver")
Cc: stable@dpdk.org
Signed-off-by: Ido Segev <idose@amazon.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
3 years agonet/nfp: read chip model from PluDevice register
Heinrich Kuhn [Mon, 25 Jan 2021 15:25:44 +0000 (17:25 +0200)]
net/nfp: read chip model from PluDevice register

For newer smartNIC NVRAM versions the chip model should be read from the
PluDevice register as it provides the authoritative chip model/revision.
This method of reading the chip model is backwards compatible with
legacy NVRAM versions too.

Since the model number is purely used for reporting purposes, follow the
hardware team convention of subtracting 0x10 from the PluDevice register
to obtain the chip model/revision number.

Fixes: c7e9729da6b5 ("net/nfp: support CPP")
Cc: stable@dpdk.org
Signed-off-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Reviewed-by: Louis Peens <louis.peens@netronome.com>
3 years agoapp/testpmd: avoid exit without terminal restore
Dapeng Yu [Mon, 25 Jan 2021 03:29:53 +0000 (11:29 +0800)]
app/testpmd: avoid exit without terminal restore

In interactive mode, if testpmd exit by calling rte_exit without
restore terminal attributes, terminal will not echo keyboard input.

register a function with atexit() in prompt(), when exit() in
rte_exit() is called, the registered function restores terminal
attributes.

Fixes: 5a8fb55c48ab ("app/testpmd: support unidirectional configuration")
Cc: stable@dpdk.org
Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
3 years agoapp/testpmd: support sending cloned packets in flowgen
Igor Russkikh [Thu, 21 Jan 2021 18:05:30 +0000 (19:05 +0100)]
app/testpmd: support sending cloned packets in flowgen

When testing high performance numbers, it is often that CPU performance
limits the max values device can reach (both in pps and in gbps)

Here instead of recreating each packet separately, we use clones counter
to resend the same mbuf to the line multiple times.

PMDs handle that transparently due to reference counting inside of mbuf.

Reaching max PPS on small packet sizes helps here:
Some data from our 2 port x 50G device. Using 2*6 tx queues, 64b packets,
PowerEdge R7525, AMD EPYC 7452:

./build/app/dpdk-testpmd -l 32-63  -- --forward-mode=flowgen \
  --rxq=6 --txq=6  --disable-crc-strip --burst=512 \
  --flowgen-clones=0 --txd=4096 --stats-period=1 --txpkts=64

Gives ~46MPPS TX output:

  Tx-pps:     22926849          Tx-bps:  11738590176
  Tx-pps:     23642629          Tx-bps:  12105024112

Setting flowgen-clones to 512 pushes TX almost to our device
physical limit (68MPPS) using same 2*6 queues(cores):

  Tx-pps:     34357556          Tx-bps:  17591073696
  Tx-pps:     34353211          Tx-bps:  17588802640

Doing similar measurements per core, I see one core can do
6.9MPPS (without clones) vs 11MPPS (with clones)

Verified on Marvell qede and atlantic PMDs.

Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoapp/testpmd: fix setting maximum packet length
Steve Yang [Thu, 28 Jan 2021 12:07:08 +0000 (12:07 +0000)]
app/testpmd: fix setting maximum packet length

"port config all max-pkt-len" command fails because it doesn't set the
'DEV_RX_OFFLOAD_JUMBO_FRAME' offload flag properly.

Commit in the fixes line moved the 'DEV_RX_OFFLOAD_JUMBO_FRAME' offload
flag update from 'cmd_config_max_pkt_len_parsed()' to 'init_config()'.
'init_config()' function is only called during testpmd startup, but the
flag status needs to be calculated whenever 'max_rx_pkt_len' changes.

The issue can be reproduced as [1], where the 'max-pkt-len' reduced and
'DEV_RX_OFFLOAD_JUMBO_FRAME' offload flag should be cleared but it
didn't.

Adding the 'update_jumbo_frame_offload()' helper function to update
'DEV_RX_OFFLOAD_JUMBO_FRAME' offload flag and 'max_rx_pkt_len'. This
function is called both by 'init_config()' and
'cmd_config_max_pkt_len_parsed()'.

Default 'max-pkt-len' value set to zero, 'update_jumbo_frame_offload()'
updates it to "RTE_ETHER_MTU + PMD specific Ethernet overhead" when it
is zero.
If '--max-pkt-len=N' argument provided, it will be used instead.
And with each "port config all max-pkt-len" command, the
'DEV_RX_OFFLOAD_JUMBO_FRAME' offload flag, 'max-pkt-len' and MTU is
updated.

[1]
--------------------------------------------------------------------------
dpdk-testpmd -c 0xf -n 4 -- -i --max-pkt-len=9000 --tx-offloads=0x8000
--rxq=4 --txq=4 --disable-rss
testpmd>  set verbose 3
testpmd>  port stop all
testpmd>  port config all max-pkt-len 1518
testpmd>  port start all

// Got fail error info without this patch
Configuring Port 0 (socket 1)
Ethdev port_id=0 rx_queue_id=0, new added offloads 0x800 must be
within per-queue offload capabilities 0x0 in rte_eth_rx_queue_setup()
Fail to configure port 0 rx queues //<-- Fail error info;
--------------------------------------------------------------------------

Bugzilla ID: 625
Fixes: 761c4d66900f ("app/testpmd: fix max Rx packet length for VLAN packets")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Tested-by: Bo Chen <box.c.chen@intel.com>
3 years agonet/hns3: adjust format specifier for enum
Lijun Ou [Fri, 22 Jan 2021 10:18:51 +0000 (18:18 +0800)]
net/hns3: adjust format specifier for enum

Here uses %d as printing output for enumeration member.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: remove unnecessary parentheses
Lijun Ou [Fri, 22 Jan 2021 10:18:50 +0000 (18:18 +0800)]
net/hns3: remove unnecessary parentheses

Remove unnecessary parentheses as well as keep a reasonable
blank line.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: adjust some comments
Lijun Ou [Fri, 22 Jan 2021 10:18:49 +0000 (18:18 +0800)]
net/hns3: adjust some comments

Fix some error comments and remove some meaningless comments.

Fixes: f8e7fcbfd0b8 ("net/hns3: support flow action of queue region")
Fixes: fcba820d9b9e ("net/hns3: support flow director")
Fixes: c37ca66f2b27 ("net/hns3: support RSS")
Fixes: ec674cb742e5 ("net/hns3: fix flushing RSS rule")
Cc: stable@dpdk.org
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: rename RSS functions
Lijun Ou [Fri, 22 Jan 2021 10:18:48 +0000 (18:18 +0800)]
net/hns3: rename RSS functions

Rename some function about RSS implement functions
in order to make the functions naming style more
reasonable and consistency.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix interrupt resources in Rx interrupt mode
Chengchang Tang [Fri, 22 Jan 2021 10:18:47 +0000 (18:18 +0800)]
net/hns3: fix interrupt resources in Rx interrupt mode

For Kunpeng930, the NIC engine support 1280 tqps being taken over by
a PF. In this case, a maximum of 1281 interrupt resources are also
supported in this PF. To support the maximum number of queues, several
patches are made. But the interrupt related modification are missing.
So, in RX interrupt mode, a large number of queues will be aggregated
into one interrupt due to insufficient interrupts. It will lead to
waste of interrupt resources and reduces usability.

To utilize all these interrupt resources, related IMP command has been
extended. And, the I/O address of the extended interrupt resources are
different from the existing ones. So, a function used for calculating
the address offset has been added.

Fixes: 76d794566d43 ("net/hns3: maximize queue number")
Fixes: 27911a6e62e5 ("net/hns3: add Rx interrupts compatibility")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
3 years agonet/hns3: fix memory leak on secondary process exit
Lijun Ou [Fri, 22 Jan 2021 10:18:46 +0000 (18:18 +0800)]
net/hns3: fix memory leak on secondary process exit

The secondary process is applied a memory for the process_private
during initialization. Therefore, the memory needs to be released
when exiting.

Fixes: c203571b3602 ("net/hns3: register and add log interface")
Cc: stable@dpdk.org
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: refactor reset event report function
Lijun Ou [Fri, 22 Jan 2021 10:18:45 +0000 (18:18 +0800)]
net/hns3: refactor reset event report function

Here encapsulate the process code of the imp reset report and
global reset report into function in order to reduce the
complexity of the hns3_check_event_cause function.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: extract common checks for flow director
Lijun Ou [Fri, 22 Jan 2021 10:18:44 +0000 (18:18 +0800)]
net/hns3: extract common checks for flow director

When parse flow director with all types, it needs to judge the spec
of item and mask of item for all packet types. The judgement is the
same for all types. Therefore, we move it into the concentrated
location.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: reconstruct Rx interrupt map
Chengchang Tang [Fri, 22 Jan 2021 10:18:43 +0000 (18:18 +0800)]
net/hns3: reconstruct Rx interrupt map

This patch reconstruct the Rx interrupt map to reduce the cyclic
complexity and improve readability and maintainability.

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: refactor flow checks into own functions
Lijun Ou [Fri, 22 Jan 2021 10:18:42 +0000 (18:18 +0800)]
net/hns3: refactor flow checks into own functions

Here moves some judgement conditions to a separated function
for parsing IPv4 hdr and TCP hdr in hns3_parse_normal function.
Also, move the check of the selected input tuple of RSS to a
separated functions named hns3_rss_input_tuple_supported
in order to enhance scalability and complexity.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: refactor converting descriptor error
Lijun Ou [Fri, 22 Jan 2021 10:18:41 +0000 (18:18 +0800)]
net/hns3: refactor converting descriptor error

Use errno array instead of switch-case for refactor
the hns3_cmd_convert_err_code function.

Besides, we add a type for ROH(RDMA Over HCCS) check
cmdq return error in Kunpeng930 NIC hardware.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: move queue stats to xstats
Huisong Li [Fri, 22 Jan 2021 10:18:40 +0000 (18:18 +0800)]
net/hns3: move queue stats to xstats

One of the hot discussions in community recently was moving queue stats
to xstats. In this solution, a temporary
'RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS' device flag is created to implement
the smooth switch. And the first half of this work has been completed in
the ethdev framework. Now driver needs to remove the flag from the
driver initialization process and does the rest of work.

For better readability and reasonability, per-queue stats also should be
cleared when rte_eth_stats is cleared. Otherwise, the sum of one item in
per-queue stats may be greater than corresponding item in rte_eth_stats.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: encapsulate DFX stats in datapath
Huisong Li [Fri, 22 Jan 2021 10:18:39 +0000 (18:18 +0800)]
net/hns3: encapsulate DFX stats in datapath

pkt_len_errors and l2_errors in Rx datapath indicate that driver
needs to discard received packets. And driver does not discard
packets for l3/l4/ol3/ol4_csum_errors in Rx datapath and others
stats in Tx datapath. Therefore, it is necessary for improving
code readability and maintainability to encapsulate error stats
and dfx stats.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>