Skip to content

Commit 78e6a35

Browse files
mellowcandlemrgolin
authored andcommitted
Fix MR registration for providers which don't support extended
Check for the right errno that returned from the missing implementation. The check tests EPROTONOSUPPORT but it can also fail with EOPNOTSUPP. Reviewed-by: Yonatan Nachum <[email protected]> Reviewed-by: Yossi Leybovich <[email protected]> Signed-off-by: Ramon Fried <[email protected]>
1 parent 4bee61f commit 78e6a35

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/perftest_resources.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1902,7 +1902,8 @@ static int register_memory_region(struct pingpong_context *ctx,
19021902

19031903
mr = register_func(ctx, user_param, qp_index, flags, dmabuf_fd, dmabuf_offset);
19041904

1905-
if (!mr && errno == EPROTONOSUPPORT && register_func != register_mr) {
1905+
if (!mr && (errno == EOPNOTSUPP || errno == EPROTONOSUPPORT) &&
1906+
register_func != register_mr) {
19061907
/* If extended registration is not supported, fall back to standard registration */
19071908
register_func = register_mr;
19081909
mr = register_func(ctx, user_param, qp_index, flags, dmabuf_fd, dmabuf_offset);

0 commit comments

Comments
 (0)