]> www.infradead.org Git - users/dwmw2/linux.git/commit
mlxsw: pci: Store DQ pointer as part of CQ structure
authorAmit Cohen <amcohen@nvidia.com>
Tue, 2 Apr 2024 13:54:28 +0000 (15:54 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 4 Apr 2024 02:50:41 +0000 (19:50 -0700)
commit77c6e27df9e50dfe7deb5a0cfe8c30175b88d89a
treeb77b50c219d5ad358b2eeb477a729cbd39b13029
parent82238f0ddb4628af28e021e2ee07c7b7d97f2eb2
mlxsw: pci: Store DQ pointer as part of CQ structure

Currently, for each completion, we check the number of descriptor queue
and take it via mlxsw_pci_{sdq,rdq}_get(). This is inefficient, the
DQ should be the same for all the completions in CQ, as each CQ handles
only one DQ - SDQ or RDQ. This mapping is handled as part of DQ
initialization via mlxsw_cmd_mbox_sw2hw_dq_cq_set().

Instead, as part of DQ initialization, set DQ pointer in the appropriate
CQ structure. When we handle completions, warn in case that the DQ number
that we expect is different from the number we get in the CQE. Call
WARN_ON_ONCE() only after checking the value, to avoid calling this method
for each completion.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/a5b2559cd6d532c120f3194f89a1e257110318f1.1712062203.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/pci.c