diff options
author | oulijun <oulijun@huawei.com> | 2018-04-26 14:46:16 +0800 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2018-04-27 14:20:47 -0400 |
commit | 328d405b3d4c8dd1f06bfd77f498e23281ae348c (patch) | |
tree | ee1d29d3c3b1d92c918d2128e386e8889c754486 /drivers/infiniband | |
parent | 215a8c09e5e2aa6ae1fbcef87f8f27d65d5d1ca4 (diff) | |
download | talos-obmc-linux-328d405b3d4c8dd1f06bfd77f498e23281ae348c.tar.gz talos-obmc-linux-328d405b3d4c8dd1f06bfd77f498e23281ae348c.zip |
RDMA/hns: Intercept illegal RDMA operation when use inline data
RDMA read operation is not supported inline data. If user cofigures
issue a RDMA read and use inline data, it will happen a hardware
error.
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 8b84ab7800d8..aa5f9b3e1c10 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -71,6 +71,11 @@ static int set_rwqe_data_seg(struct ib_qp *ibqp, struct ib_send_wr *wr, return -EINVAL; } + if (wr->opcode == IB_WR_RDMA_READ) { + dev_err(hr_dev->dev, "Not support inline data!\n"); + return -EINVAL; + } + for (i = 0; i < wr->num_sge; i++) { memcpy(wqe, ((void *)wr->sg_list[i].addr), wr->sg_list[i].length); |