aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
diff options
context:
space:
mode:
authoroulijun <oulijun@huawei.com>2018-04-26 14:46:16 +0800
committerDoug Ledford <dledford@redhat.com>2018-04-27 14:20:47 -0400
commit328d405b3d4c8dd1f06bfd77f498e23281ae348c (patch)
treeee1d29d3c3b1d92c918d2128e386e8889c754486 /drivers/infiniband/hw/hns/hns_roce_hw_v2.c
parentRDMA/hns: Bugfix for init hem table (diff)
downloadlinux-dev-328d405b3d4c8dd1f06bfd77f498e23281ae348c.tar.xz
linux-dev-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 '')
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_hw_v2.c5
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);