RDMA/hns: Update the usage of sr_max and rr_max field
authoroulijun <oulijun@huawei.com>
Wed, 3 Jan 2018 02:44:04 +0000 (10:44 +0800)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 3 Jan 2018 20:58:58 +0000 (13:58 -0700)
commit4f3f7a704b3bff9e4eb322ab3c989b505f7562eb
treec677b73e2bd6db3cc126e73fff783b9148fa8a91
parent0009c2dbe8a47008a11abca04da2db57f9eea6a8
RDMA/hns: Update the usage of sr_max and rr_max field

This patch fixes the usage with sr_max filed and rr_max of qp
context when modify qp. Its modifications include:
1. Adjust location of filling sr_max filed of qpc
2. Only assign the number of responder resource if
   IB_QP_MAX_DEST_RD_ATOMIC bit is set
3. Only assign the number of outstanding resource if
   IB_QP_MAX_QP_RD_ATOMIC
4. Fix the assgin algorithms for the field of sr_max
   and rr_max of qp context

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hns/hns_roce_hw_v2.c