IB/hfi1: Calculate flow weight based on QP MTU for TID RDMA
authorKaike Wan <kaike.wan@intel.com>
Fri, 25 Oct 2019 19:58:36 +0000 (15:58 -0400)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 6 Nov 2019 17:15:36 +0000 (13:15 -0400)
commitc2be3865a1763c4be39574937e1aae27e917af4d
tree9216c73b5ee76745df1120d7c4c7bd179f195676
parentc1abd865bd125015783286b353abb8da51644f59
IB/hfi1: Calculate flow weight based on QP MTU for TID RDMA

For a TID RDMA WRITE request, a QP on the responder side could be put into
a queue when a hardware flow is not available. A RNR NAK will be returned
to the requester with a RNR timeout value based on the position of the QP
in the queue. The tid_rdma_flow_wt variable is used to calculate the
timeout value and is determined by using a MTU of 4096 at the module
loading time. This could reduce the timeout value by half from the desired
value, leading to excessive RNR retries.

This patch fixes the issue by calculating the flow weight with the real
MTU assigned to the QP.

Fixes: 07b923701e38 ("IB/hfi1: Add functions to receive TID RDMA WRITE request")
Link: https://lore.kernel.org/r/20191025195836.106825.77769.stgit@awfm-01.aw.intel.com
Cc: <stable@vger.kernel.org>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hfi1/init.c
drivers/infiniband/hw/hfi1/tid_rdma.c
drivers/infiniband/hw/hfi1/tid_rdma.h