linux/drivers/infiniband/hw
Mark Bloch 1def2a94f4 RDMA/mlx5: Fix affinity assignment
[ Upstream commit 617f5db1a6 ]

The cited commit aimed to ensure that Virtual Functions (VFs) assign a
queue affinity to a Queue Pair (QP) to distribute traffic when
the LAG master creates a hardware LAG. If the affinity was set while
the hardware was not in LAG, the firmware would ignore the affinity value.

However, this commit unintentionally assigned an affinity to QPs on the LAG
master's VPORT even if the RDMA device was not marked as LAG-enabled.
In most cases, this was not an issue because when the hardware entered
hardware LAG configuration, the RDMA device of the LAG master would be
destroyed and a new one would be created, marked as LAG-enabled.

The problem arises when a user configures Equal-Cost Multipath (ECMP).
In ECMP mode, traffic can be directed to different physical ports based on
the queue affinity, which is intended for use by VPORTS other than the
E-Switch manager. ECMP mode is supported only if both E-Switch managers are
in switchdev mode and the appropriate route is configured via IP. In this
configuration, the RDMA device is not destroyed, and we retain the RDMA
device that is not marked as LAG-enabled.

To ensure correct behavior, Send Queues (SQs) opened by the E-Switch
manager through verbs should be assigned strict affinity. This means they
will only be able to communicate through the native physical port
associated with the E-Switch manager. This will prevent the firmware from
assigning affinity and will not allow the SQs to be remapped in case of
failover.

Fixes: 802dcc7fc5 ("RDMA/mlx5: Support TX port affinity for VF drivers in LAG mode")
Reviewed-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Link: https://lore.kernel.org/r/425b05f4da840bc684b0f7e8ebf61aeb5cef09b0.1685960567.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2023-06-21 16:01:00 +02:00
..
bnxt_re RDMA/bnxt_re: Fix return value of bnxt_re_process_raw_qp_pkt_rx 2023-06-09 10:33:59 +02:00
cxgb4 iw_cxgb4: Fix potential NULL dereference in c4iw_fill_res_cm_id_entry() 2023-03-10 09:33:39 +01:00
efa RDMA/efa: Fix unsupported page sizes in device 2023-06-09 10:33:58 +02:00
erdma RDMA/erdma: Use fixed hardware page size 2023-05-11 23:03:33 +09:00
hfi1 IB/hfi1: Fix bugs with non-PAGE_SIZE-end multi-iovec user SDMA requests 2023-05-11 23:03:34 +09:00
hns RDMA/hns: Modify the value of long message loopback slice 2023-06-09 10:33:59 +02:00
irdma RDMA/irdma: Fix Local Invalidate fencing 2023-06-09 10:34:02 +02:00
mlx4 RDMA/mlx4: Prevent shift wrapping in set_user_sq_size() 2023-05-11 23:03:33 +09:00
mlx5 RDMA/mlx5: Fix affinity assignment 2023-06-21 16:01:00 +02:00
mthca IB: move from strlcpy with unused retval to strscpy 2022-08-21 14:18:02 +03:00
ocrdma IB: move from strlcpy with unused retval to strscpy 2022-08-21 14:18:02 +03:00
qedr RDMA/qedr: clean up work queue on failure in qedr_alloc_resources() 2022-10-28 12:59:40 -03:00
qib RDMA/qib: fix repeated words in comments 2022-09-20 14:11:14 +03:00
usnic RDMA/usnic: use iommu_map_atomic() under spin_lock() 2023-02-14 19:11:43 +01:00
vmw_pvrdma RDMA/pvrdma: Remove useless DMA-32 fallback configuration 2022-01-28 10:49:04 -04:00
Makefile RDMA/erdma: Add driver to kernel build environment 2022-07-27 16:04:05 -03:00