aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/sw/rxe/rxe_mr.c
diff options
context:
space:
mode:
authorAndrew Boyer <andrew.boyer@dell.com>2016-11-23 12:39:21 -0500
committerDoug Ledford <dledford@redhat.com>2016-12-12 16:31:45 -0500
commitd4fb59256ac03d84f68e36c430b58d6fc76dd651 (patch)
tree439d45878decc2d4ea3eed161be54dffb034d87f /drivers/infiniband/sw/rxe/rxe_mr.c
parentIB/rxe: Unblock loopback by moving skb_out increment (diff)
downloadlinux-dev-d4fb59256ac03d84f68e36c430b58d6fc76dd651.tar.xz
linux-dev-d4fb59256ac03d84f68e36c430b58d6fc76dd651.zip
IB/rxe: Add support for zero-byte operations
The last_psn algorithm fails in the zero-byte case: it calculates first_psn = N, last_psn = N-1. This makes the operation unretryable since the res structure will fail the (first_psn <= psn <= last_psn) test in find_resource(). While here, use BTH_PSN_MASK to mask the calculated last_psn. Signed-off-by: Andrew Boyer <andrew.boyer@dell.com> Reviewed-by: Moni Shoua <monis@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/sw/rxe/rxe_mr.c')
-rw-r--r--drivers/infiniband/sw/rxe/rxe_mr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c
index 1869152f1d23..d0faca294006 100644
--- a/drivers/infiniband/sw/rxe/rxe_mr.c
+++ b/drivers/infiniband/sw/rxe/rxe_mr.c
@@ -355,6 +355,9 @@ int rxe_mem_copy(struct rxe_mem *mem, u64 iova, void *addr, int length,
size_t offset;
u32 crc = crcp ? (*crcp) : 0;
+ if (length == 0)
+ return 0;
+
if (mem->type == RXE_MEM_TYPE_DMA) {
u8 *src, *dest;