Commit 479dc93b authored by Wenpeng Liang's avatar Wenpeng Liang Committed by Jason Gunthorpe

RDMA/hns: Remove redundant parameter "mailbox" in the mailbox

The parameter "out_param" of the mailbox is always null when the context is
destroyed. So remove the function parameter "mailbox".

Link: https://lore.kernel.org/r/20220302064830.61706-4-liangwenpeng@huawei.comSigned-off-by: default avatarWenpeng Liang <liangwenpeng@huawei.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent 0018ed4b
...@@ -1145,7 +1145,6 @@ int hns_roce_map_mr_sg(struct ib_mr *ibmr, struct scatterlist *sg, int sg_nents, ...@@ -1145,7 +1145,6 @@ int hns_roce_map_mr_sg(struct ib_mr *ibmr, struct scatterlist *sg, int sg_nents,
unsigned int *sg_offset); unsigned int *sg_offset);
int hns_roce_dereg_mr(struct ib_mr *ibmr, struct ib_udata *udata); int hns_roce_dereg_mr(struct ib_mr *ibmr, struct ib_udata *udata);
int hns_roce_hw_destroy_mpt(struct hns_roce_dev *hr_dev, int hns_roce_hw_destroy_mpt(struct hns_roce_dev *hr_dev,
struct hns_roce_cmd_mailbox *mailbox,
unsigned long mpt_index); unsigned long mpt_index);
unsigned long key_to_hw_index(u32 key); unsigned long key_to_hw_index(u32 key);
......
...@@ -56,11 +56,10 @@ static int hns_roce_hw_create_mpt(struct hns_roce_dev *hr_dev, ...@@ -56,11 +56,10 @@ static int hns_roce_hw_create_mpt(struct hns_roce_dev *hr_dev,
} }
int hns_roce_hw_destroy_mpt(struct hns_roce_dev *hr_dev, int hns_roce_hw_destroy_mpt(struct hns_roce_dev *hr_dev,
struct hns_roce_cmd_mailbox *mailbox,
unsigned long mpt_index) unsigned long mpt_index)
{ {
return hns_roce_cmd_mbox(hr_dev, 0, mailbox ? mailbox->dma : 0, return hns_roce_cmd_mbox(hr_dev, 0, 0, mpt_index,
mpt_index, HNS_ROCE_CMD_DESTROY_MPT); HNS_ROCE_CMD_DESTROY_MPT);
} }
static int alloc_mr_key(struct hns_roce_dev *hr_dev, struct hns_roce_mr *mr) static int alloc_mr_key(struct hns_roce_dev *hr_dev, struct hns_roce_mr *mr)
...@@ -142,7 +141,7 @@ static void hns_roce_mr_free(struct hns_roce_dev *hr_dev, ...@@ -142,7 +141,7 @@ static void hns_roce_mr_free(struct hns_roce_dev *hr_dev,
int ret; int ret;
if (mr->enabled) { if (mr->enabled) {
ret = hns_roce_hw_destroy_mpt(hr_dev, NULL, ret = hns_roce_hw_destroy_mpt(hr_dev,
key_to_hw_index(mr->key) & key_to_hw_index(mr->key) &
(hr_dev->caps.num_mtpts - 1)); (hr_dev->caps.num_mtpts - 1));
if (ret) if (ret)
...@@ -306,7 +305,7 @@ struct ib_mr *hns_roce_rereg_user_mr(struct ib_mr *ibmr, int flags, u64 start, ...@@ -306,7 +305,7 @@ struct ib_mr *hns_roce_rereg_user_mr(struct ib_mr *ibmr, int flags, u64 start,
if (ret) if (ret)
goto free_cmd_mbox; goto free_cmd_mbox;
ret = hns_roce_hw_destroy_mpt(hr_dev, NULL, mtpt_idx); ret = hns_roce_hw_destroy_mpt(hr_dev, mtpt_idx);
if (ret) if (ret)
ibdev_warn(ib_dev, "failed to destroy MPT, ret = %d.\n", ret); ibdev_warn(ib_dev, "failed to destroy MPT, ret = %d.\n", ret);
...@@ -477,7 +476,7 @@ static void hns_roce_mw_free(struct hns_roce_dev *hr_dev, ...@@ -477,7 +476,7 @@ static void hns_roce_mw_free(struct hns_roce_dev *hr_dev,
int ret; int ret;
if (mw->enabled) { if (mw->enabled) {
ret = hns_roce_hw_destroy_mpt(hr_dev, NULL, ret = hns_roce_hw_destroy_mpt(hr_dev,
key_to_hw_index(mw->rkey) & key_to_hw_index(mw->rkey) &
(hr_dev->caps.num_mtpts - 1)); (hr_dev->caps.num_mtpts - 1));
if (ret) if (ret)
......
...@@ -68,11 +68,9 @@ static int hns_roce_hw_create_srq(struct hns_roce_dev *dev, ...@@ -68,11 +68,9 @@ static int hns_roce_hw_create_srq(struct hns_roce_dev *dev,
} }
static int hns_roce_hw_destroy_srq(struct hns_roce_dev *dev, static int hns_roce_hw_destroy_srq(struct hns_roce_dev *dev,
struct hns_roce_cmd_mailbox *mailbox,
unsigned long srq_num) unsigned long srq_num)
{ {
return hns_roce_cmd_mbox(dev, 0, mailbox ? mailbox->dma : 0, srq_num, return hns_roce_cmd_mbox(dev, 0, 0, srq_num, HNS_ROCE_CMD_DESTROY_SRQ);
HNS_ROCE_CMD_DESTROY_SRQ);
} }
static int alloc_srqc(struct hns_roce_dev *hr_dev, struct hns_roce_srq *srq) static int alloc_srqc(struct hns_roce_dev *hr_dev, struct hns_roce_srq *srq)
...@@ -144,7 +142,7 @@ static void free_srqc(struct hns_roce_dev *hr_dev, struct hns_roce_srq *srq) ...@@ -144,7 +142,7 @@ static void free_srqc(struct hns_roce_dev *hr_dev, struct hns_roce_srq *srq)
struct hns_roce_srq_table *srq_table = &hr_dev->srq_table; struct hns_roce_srq_table *srq_table = &hr_dev->srq_table;
int ret; int ret;
ret = hns_roce_hw_destroy_srq(hr_dev, NULL, srq->srqn); ret = hns_roce_hw_destroy_srq(hr_dev, srq->srqn);
if (ret) if (ret)
dev_err(hr_dev->dev, "DESTROY_SRQ failed (%d) for SRQN %06lx\n", dev_err(hr_dev->dev, "DESTROY_SRQ failed (%d) for SRQN %06lx\n",
ret, srq->srqn); ret, srq->srqn);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment