Commit Graph

14320 Commits

Author SHA1 Message Date
Matan Azrad
b7fa0bf4d5 vdpa/mlx5: fix polling threads scheduling
When the event mode is with 0 fixed delay, the polling-thread will never
give-up CPU.

So, when multi-polling-threads are active, the context-switch between
them will be managed by the system which may affect latency according to
the time-out decided by the system.

In order to fix multi-devices polling thread scheduling, this patch
forces rescheduling for each CQ poll iteration.

Move the polling thread to SCHED_RR mode with maximum priority to
complete the fairness.

Fixes: 6956a48cab ("vdpa/mlx5: set polling mode default delay to zero")

Signed-off-by: Matan Azrad <matan@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Xueming Li <xuemingl@nvidia.com>
2021-02-10 22:17:47 +01:00
Feifei Wang
b9c366e029 net/ixgbe: fix UDP zero checksum on Arm
There is an 82599 errata that UDP frames with a zero checksum are
incorrectly marked as checksum invalid by the hardware.  This was
leading to misleading PKT_RX_L4_CKSUM_BAD flag.

To fix it for the NEON path in Arm platform, change the bad UDP checksum to
unknown, and then let software application to recompute the checksum.

NICs: 82599(igb)
Driver: ixgbe(vector)
Architecture: arm64
$:./app/dpdk-testpmd -c 0x3 -w 0002:f9:00.0 -- -i
--port-topology=chained --enable-rx-cksum
test-pmd> set fwd rxonly
test-pmd> set verbose 1
test-pmd> start

1. UDP Test:
Package: (Ether()/IP()/UDP(checksum=0)
ol_flags: PKT_RX_L4_CKSUM_UNKNOWN PKT_RX_IP_CKSUM_GOOD

2. TCP Test:
Package: (Ether()/IP()/TCP(checksum=0)
ol_flags: PKT_RX_L4_CKSUM_BAD PKT_RX_IP_CKSUM_GOOD

Bugzilla ID: 629
Fixes: af75078fec ("first public release")
Cc: stable@dpdk.org

Reported-by: Paolo Valerio <pvalerio@redhat.com>
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2021-02-10 21:51:38 +01:00
Haiyue Wang
9a40edb599 net/ixgbe: fix UDP zero checksum on x86
There is an 82599 errata that UDP frames with a zero checksum are
incorrectly marked as checksum invalid by the hardware.  This was
leading to misleading PKT_RX_L4_CKSUM_BAD flag.

This patch changes the bad UDP checksum to PKT_RX_L4_CKSUM_UNKNOWN,
so the software application will then have to recompute the checksum
itself if needed.

Bugzilla ID: 629
Fixes: af75078fec ("first public release")
Cc: stable@dpdk.org

Reported-by: Paolo Valerio <pvalerio@redhat.com>
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Paolo Valerio <pvalerio@redhat.com>
2021-02-10 21:49:00 +01:00
Timothy McDaniel
d9e8329518 event/dlb: fix accessing uninitialized variables
This patch updates the PMD to initialize response fields
prior to calling into the PF layer.

Coverity issue: 366200, 366202, 366205
Fixes: eb14a3421a ("event/dlb: add eventdev start")
Fixes: f007362194 ("event/dlb: add eventdev stop and close")
Cc: stable@dpdk.org

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
2021-02-04 13:25:43 +01:00
Matan Azrad
c024991991 compress/mlx5: fix asserts
When ASSERT is enabled for compilation, the 2 usages of assert mechanism
in the driver are failed due to typos.

Fix the typos.

Fixes: f8c97babc9 ("compress/mlx5: add data-path functions")
Fixes: 37862dafcb ("compress/mlx5: support 32-bit systems")

Reported-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Signed-off-by: Matan Azrad <matan@nvidia.com>
Tested-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2021-02-04 18:56:15 +01:00
Ankur Dwivedi
d4f6f2680b crypto/octeontx2: fix null pointer dereferences
Coverity reports that pointers ip and ip6 may be dereferenced
with null value. This patch fixes this.

Coverity issue: 365549, 365551
Fixes: 8f685ec2d5 ("crypto/octeontx2: support AES-CBC SHA1-HMAC")

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
2021-02-04 18:55:52 +01:00
Andrew Boyer
d13d7829fc net/ionic: fix Tx fragment limits
The reported nb_seg_max should include the main fragment in the
descriptor and the fragments in the accompanying SGL.

Update the Tx prep check as well.

These were missed when updating to the v1 Tx queue structures.

Fixes: 5611763610 ("net/ionic: clean up Tx queue version support")

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
2021-02-05 12:44:16 +01:00
Hyong Youb Kim
89ce72c6ff net/enic: fix filter log message
A debug message for filter API is using a wrong flag. Use the correct
one.

Fixes: 936a9b9975 ("net/enic: flow API debug")
Cc: stable@dpdk.org

Reported-by: Hanoch Haim <hhaim@cisco.com>
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2021-02-05 11:28:48 +01:00
Viacheslav Ovsiienko
00984de533 net/mlx5: fix Tx queue size created with DevX
The number of descriptors specified for queue creation
implies the queue should be able to contain the specified
amount of packets being sent. Typically one packet takes
one queue descriptor (WQE) to be handled. If there is inline
data option enabled one packet might require more WQEs to
embrace the inline data and the overall queue size (the
number of queue descriptors) should be adjusted accordingly.

In mlx5 PMD the queues can be created either via Verbs, using
the rdma-core library or via DevX as direct kernel/firmware call.
The rdma-core does queue size adjustment internally, depending on
TSO and inline setting. The DevX approach missed this point.
This caused the queue size discrepancy and performance variations.

The patch adjusts the Tx queue size for the DevX approach
in the same as it is done in rdma-core implementation.

Fixes: 86d259cec8 ("net/mlx5: separate Tx queue object creations")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2021-02-04 18:44:26 +01:00
Dekel Peled
207b4d06c3 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: e1592b6c4d ("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>
2021-02-04 18:44:26 +01:00
Dekel Peled
ae8fdc8067 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: d2046c09aa ("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>
2021-02-04 18:44:26 +01:00
Ferruh Yigit
f62490e64d 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: a3f5252e5c ("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>
2021-02-04 18:19:37 +01:00
Ferruh Yigit
cec222d6e5 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: a3f5252e5c ("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>
2021-02-04 18:19:37 +01:00
Haiyue Wang
295b34f55b 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: 14e7a4b37b ("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>
2021-02-04 18:19:37 +01:00
Huisong Li
b8a67b10ee 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: 19a3ca4c99 ("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>
2021-02-04 18:19:37 +01:00
Chengchang Tang
ff81c6b7d0 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: 2790c64647 ("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>
2021-02-04 18:19:37 +01:00
Chengchang Tang
5ef63df128 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: 737f30e1c3 ("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>
2021-02-04 18:19:37 +01:00
Chengwen Feng
2b9a66e1b6 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: fcba820d9b ("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>
2021-02-04 18:19:37 +01:00
Chengchang Tang
b52366011d 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>
2021-02-04 18:19:37 +01:00
Chengchang Tang
c27e64ee3e 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: 8839c5e202 ("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>
2021-02-04 18:19:37 +01:00
Chengwen Feng
e9550856f8 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: fcba820d9b ("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>
2021-02-04 18:19:37 +01:00
Chengwen Feng
3e5c397ce4 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: c09c7847d8 ("net/hns3: support traffic management")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
2021-02-04 18:19:37 +01:00
Lijun Ou
0fce2c46dc 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: c37ca66f2b ("net/hns3: support RSS")
Cc: stable@dpdk.org

Signed-off-by: Lijun Ou <oulijun@huawei.com>
2021-02-04 18:19:37 +01:00
Huisong Li
bac6a06441 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: 109e4dd1bd ("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>
2021-02-04 18:19:37 +01:00
Huisong Li
7f2a320df9 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: 109e4dd1bd ("net/hns3: get link state change through mailbox")
Fixes: 59fad0f321 ("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>
2021-02-04 18:19:37 +01:00
Jiawei Wang
255b8f86eb 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: 6a951567c1 ("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>
2021-02-04 18:19:37 +01:00
Souvik Dey
493f0bb51c 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: f22442cb5d ("net/mlx5: reduce Netlink commands dependencies")
Fixes: ccdcba53a3 ("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>
2021-02-04 18:19:37 +01:00
Jiawei Wang
5fe95d7364 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: e7138997e0 ("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>
2021-02-04 18:19:37 +01:00
Sunil Kumar Kori
82a752e3eb net/octeontx: fix max Rx packet length
Maximum Rx packet length is getting updated twice which
corrupts actual value.

Fixes: 3151e6a687 ("net/octeontx: support MTU")
Cc: stable@dpdk.org

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Harman Kalra <hkalra@marvell.com>
2021-02-04 18:19:37 +01:00
Leyi Rong
419c6e9af6 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: 5c38c33f78 ("net/i40e: disable AVX512 with MinGW")

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Tested-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2021-02-04 18:19:36 +01:00
Xiaoyun Li
3aa9573385 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: 1c301e8c3c ("net/iavf: support new VLAN capabilities")

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2021-02-04 18:19:36 +01:00
Yuying Zhang
ec732d933d 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: bb3386f348 ("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>
2021-02-04 18:19:36 +01:00
Haiyue Wang
8ac4307504 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: 14e7a4b37b ("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>
2021-02-04 18:19:36 +01:00
Maxime Coquelin
aa0d4b8a01 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: c8d4b02f72 ("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>
2021-02-04 18:19:36 +01:00
Alexander Kozyrev
fdc44cdc78 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: 54c2d46b16 ("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>
2021-02-04 18:19:36 +01:00
Alexander Kozyrev
3d3f4e6d1a 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: 54c2d46b16 ("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>
2021-02-04 18:19:36 +01:00
Ivan Malov
be56d20ff1 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: c1ce2ba218 ("net/sfc: support tunnel TSO on EF10 native Tx datapath")
Fixes: 6bc985e411 ("net/sfc: support TSO in EF10 Tx datapath")
Fixes: fec33d5bb3 ("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>
2021-02-03 11:37:08 +01:00
Xuan Ding
3b0181038d 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: 0d84f86c30 ("net/ice: fix GTPU header parsing")

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2021-02-03 00:48:11 +01:00
Maxime Coquelin
b93c3530c1 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: 512e27eeb7 ("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>
2021-02-03 00:48:11 +01:00
Maxime Coquelin
0ea5be8d25 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: 949735312f ("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>
2021-02-03 00:48:11 +01:00
Hyong Youb Kim
d700f0d0d7 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: 26faa126d8 ("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>
2021-02-03 00:48:11 +01:00
Andrew Boyer
5611763610 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>
2021-02-03 00:48:11 +01:00
Andrew Boyer
76276d716b net/ionic: use existing array size macro
Using the RTE_DIM() macro makes the code clearer.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
2021-02-03 00:48:11 +01:00
Chengwen Feng
e63ae349e1 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>
2021-02-03 00:48:11 +01:00
Dekel Peled
c83456cdd7 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: d7cfcddded ("net/mlx5: translate shared action for RSS action")
Fixes: d2046c09aa ("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>
2021-02-03 00:48:11 +01:00
Dekel Peled
b65057385f 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>
2021-02-03 00:48:11 +01:00
Lance Richardson
8e18a019c1 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: 04067844a3 ("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>
2021-02-03 00:48:11 +01:00
Xuan Ding
c678299594 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: 95f2f0e9fc ("net/iavf: improve default RSS")

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2021-02-03 00:48:11 +01:00
Jingjing Wu
b08728b4a0 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: d6bde6b5ea ("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>
2021-01-29 18:16:12 +01:00
Kalesh AP
d3376cdc7d 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: 899f061307 ("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>
2021-01-29 18:16:12 +01:00