RDMA/bnxt_re: Refurbish CQ to NQ hash calculation
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Thu, 14 Nov 2024 09:49:07 +0000 (01:49 -0800)
committerLeon Romanovsky <leon@kernel.org>
Thu, 14 Nov 2024 14:52:37 +0000 (09:52 -0500)
commitcb97b377a13589b4880eeb1524dbc47087c3244b
tree5ccbeff850550fbcb29d97e577bd135d4bc8232d
parent30b871338c3ebab4c5efb74f6b23b59f1ac4ca1f
RDMA/bnxt_re: Refurbish CQ to NQ hash calculation

There are few use cases where CQ create and destroy
is seen before re-creating the CQ, this kind of use
case is disturbing the RR distribution and all the
active CQ getting mapped to only 2 NQ alternatively.

Fixing the CQ to NQ hash calculation by implementing
a quick load sorting mechanism under a mutex.

Using this, if the CQ was allocated and destroyed
before using it, the nq selecting algorithm still
obtains the least loaded CQ. Thus balancing the load
on NQs.

Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Link: https://patch.msgid.link/1731577748-1804-4-git-send-email-selvin.xavier@broadcom.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/bnxt_re/bnxt_re.h
drivers/infiniband/hw/bnxt_re/ib_verbs.c
drivers/infiniband/hw/bnxt_re/main.c
drivers/infiniband/hw/bnxt_re/qplib_fp.c
drivers/infiniband/hw/bnxt_re/qplib_fp.h