From 01887ccc308a555fed9701f15298e91010db42d7 Mon Sep 17 00:00:00 2001 From: Alexey Marchuk Date: Wed, 24 Nov 2021 15:04:56 +0300 Subject: [PATCH] rdma: Set REMOTE_WRITE permission for iWARP on target side iWARP requires REMOTE_WRITE permission ofr RDMA_READ operation. Fixes #2253 Signed-off-by: Alexey Marchuk Change-Id: Iddfda091903e000d1c4839c1fce67bf25d4a13c2 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10392 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Reviewed-by: Changpeng Liu Reviewed-by: Dong Yi Reviewed-by: Ben Walker --- lib/rdma/common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/rdma/common.c b/lib/rdma/common.c index 37de0ffde7..2d59c23a05 100644 --- a/lib/rdma/common.c +++ b/lib/rdma/common.c @@ -73,6 +73,10 @@ rdma_mem_notify(void *cb_ctx, struct spdk_mem_map *map, switch (rmap->role) { case SPDK_RDMA_MEMORY_MAP_ROLE_TARGET: access_flags = IBV_ACCESS_LOCAL_WRITE; + if (pd->context->device->transport_type == IBV_TRANSPORT_IWARP) { + /* IWARP requires REMOTE_WRITE permission for RDMA_READ operation */ + access_flags |= IBV_ACCESS_REMOTE_WRITE; + } break; case SPDK_RDMA_MEMORY_MAP_ROLE_INITIATOR: access_flags = IBV_ACCESS_LOCAL_WRITE | IBV_ACCESS_REMOTE_READ | IBV_ACCESS_REMOTE_WRITE;