OSDN Git Service

RDMA/hns: Refactor process of setting extended sge
authorWeihang Li <liweihang@huawei.com>
Sat, 28 Nov 2020 10:22:39 +0000 (18:22 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Wed, 2 Dec 2020 00:58:43 +0000 (20:58 -0400)
commit05201e01be937be47e4c970c0a9eb6b6fb375b1e
tree7e1598008a15cd0384867658f5ec574e787a93de
parentd34895c319faa1e0fc1a48c3b06bba6a8a39ba44
RDMA/hns: Refactor process of setting extended sge

The variable 'cnt' is used to represent the max number of sge an SQ WQE
can use at first, then it means how many extended sge an SQ has. In
addition, this function has no need to return a value. So refactor and
encapsulate the parts of getting number of extended sge a WQE can use to
make it easier to understand.

Link: https://lore.kernel.org/r/1606558959-48510-4-git-send-email-liweihang@huawei.com
Signed-off-by: Weihang Li <liweihang@huawei.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/hns/hns_roce_qp.c