diff mbox series

[rdma-core,5/6] verbs: Device memory cannot be on demand in rc_pingpong

Message ID 1544016291-10815-6-git-send-email-yishaih@mellanox.com (mailing list archive)
State Not Applicable
Headers show
Series verbs: Introduce ibv_advise_mr() verb | expand

Commit Message

Yishai Hadas Dec. 5, 2018, 1:24 p.m. UTC
From: Moni Shoua <monis@mellanox.com>

If MR is of type DM it doesn't make sense to ask MR to be on-demand.

Fixes: f06164d5ea8d ("verbs: Add device memory support in rc_pingpong example")
Signed-off-by: Moni Shoua <monis@mellanox.com>
Reviewed-by: Guy Levi <guyle@mellanox.com>
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
---
 libibverbs/examples/rc_pingpong.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/libibverbs/examples/rc_pingpong.c b/libibverbs/examples/rc_pingpong.c
index 089d482..d4c5df5 100644
--- a/libibverbs/examples/rc_pingpong.c
+++ b/libibverbs/examples/rc_pingpong.c
@@ -856,6 +856,11 @@  int main(int argc, char *argv[])
 		return 1;
 	}
 
+	if (use_odp && use_dm) {
+		fprintf(stderr, "DM memory region can't be on demand\n");
+		return 1;
+	}
+
 	if (use_ts) {
 		ts.comp_recv_max_time_delta = 0;
 		ts.comp_recv_min_time_delta = 0xffffffff;