RDMA/hns: Simplify the calculation and usage of wqe idx for post verbs
authorYixian Liu <liuyixian@huawei.com>
Tue, 10 Dec 2019 12:45:02 +0000 (20:45 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Mar 2020 15:43:48 +0000 (16:43 +0100)
commit3065f57761bd35bae691e5e7a26ef9eb7acb4799
tree30468e508b6d55839b5f817658edfb32ade987db
parent7fd3329a4df08464342e2708633e7cc5255f556d
RDMA/hns: Simplify the calculation and usage of wqe idx for post verbs

commit 4768820243d71d49f1044b3f911ac3d52bdb79af upstream.

Currently, the wqe idx is calculated repeatly everywhere it is used.  This
patch defines wqe_idx and calculated it only once, then just use it as
needed.

Fixes: 2d40788825ac ("RDMA/hns: Add support for processing send wr and receive wr")
Link: https://lore.kernel.org/r/1575981902-5274-1-git-send-email-liweihang@hisilicon.com
Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Weihang Li <liweihang@hisilicon.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/hns/hns_roce_device.h
drivers/infiniband/hw/hns/hns_roce_hw_v1.c
drivers/infiniband/hw/hns/hns_roce_hw_v2.c