]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/mlx5: Set local port to one when accessing counters
authorChris Mi <cmi@nvidia.com>
Mon, 29 Aug 2022 09:02:28 +0000 (12:02 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2022 10:04:55 +0000 (12:04 +0200)
commit52dc450241ec376c52748dbbdde593daa2da8f1c
treeee19086d22aa8ed7525dba9c3707b244e13667be
parentee2fd7fbfe212374dc116a42aac11e062a943385
RDMA/mlx5: Set local port to one when accessing counters

[ Upstream commit dc69d04cf9d2a51311d03edbed6ba063b3086442 ]

When accessing Ports Performance Counters Register (PPCNT),
local port must be one if it is Function-Per-Port HCA that
HCA_CAP.num_ports is 1.

The offending patch can change the local port to other values
when accessing PPCNT after enabling switchdev mode. The following
syndrome will be printed:

 # cat /sys/class/infiniband/rdmap4s0f0/ports/2/counters/*
 # dmesg
 mlx5_core 0000:04:00.0: mlx5_cmd_check:756:(pid 12450): ACCESS_REG(0x805) op_mod(0x1) failed, status bad parameter(0x3), syndrome (0x1e5585)

Fix it by setting local port to one for Function-Per-Port HCA.

Fixes: e66b090392e4 ("IB/mlx5: When not in dual port RoCE mode, use provided port as native")
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Chris Mi <cmi@nvidia.com>
Link: https://lore.kernel.org/r/6c5086c295c76211169e58dbd610fb0402360bab.1661763459.git.leonro@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/mlx5/mad.c