Skip to contentSkip to conversation

rdma-core: Recognize IBV_DEVICE_LOCAL_DMA_LKEY in ibv_devinfo

PATCH In review Andrew Boyer 2 participants 4 messages Nov 25, 2019 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rdma-core: Recognize IBV_DEVICE_LOCAL_DMA_LKEY in ibv_devinfo

This bit is defined in the kernel but not displayed by ibv_devinfo.

---
 libibverbs/examples/devinfo.c | 3 +++
 libibverbs/verbs.h            | 1 +
 2 files changed, 4 insertions(+)
libibverbs/examples/devinfo.c +3 -0
index bf53eac2..e3210f6e 100644
@@ -220,6 +220,7 @@ static void print_device_cap_flags(uint32_t dev_cap_flags)
 				   IBV_DEVICE_RC_RNR_NAK_GEN |
 				   IBV_DEVICE_SRQ_RESIZE |
 				   IBV_DEVICE_N_NOTIFY_CQ |
+				   IBV_DEVICE_LOCAL_DMA_LKEY |
 				   IBV_DEVICE_MEM_WINDOW |
 				   IBV_DEVICE_UD_IP_CSUM |
 				   IBV_DEVICE_XRC |
@@ -260,6 +261,8 @@ static void print_device_cap_flags(uint32_t dev_cap_flags)
 		printf("\t\t\t\t\tSRQ_RESIZE\n");
 	if (dev_cap_flags & IBV_DEVICE_N_NOTIFY_CQ)
 		printf("\t\t\t\t\tN_NOTIFY_CQ\n");
+	if (dev_cap_flags & IBV_DEVICE_LOCAL_DMA_LKEY)
+		printf("\t\t\t\t\tLOCAL_DMA_LKEY\n");
 	if (dev_cap_flags & IBV_DEVICE_MEM_WINDOW)
 		printf("\t\t\t\t\tMEM_WINDOW\n");
 	if (dev_cap_flags & IBV_DEVICE_UD_IP_CSUM)
libibverbs/verbs.h +1 -0
index 7b8d4310..81e5812c 100644
@@ -112,6 +112,7 @@ enum ibv_device_cap_flags {
 	IBV_DEVICE_RC_RNR_NAK_GEN	= 1 << 12,
 	IBV_DEVICE_SRQ_RESIZE		= 1 << 13,
 	IBV_DEVICE_N_NOTIFY_CQ		= 1 << 14,
+	IBV_DEVICE_LOCAL_DMA_LKEY	= 1 << 15,
 	IBV_DEVICE_MEM_WINDOW           = 1 << 17,
 	IBV_DEVICE_UD_IP_CSUM		= 1 << 18,
 	IBV_DEVICE_XRC			= 1 << 20,
Signature · 1 line
2.17.1
#1 lore raw
Quoted 31 lines · Andrew Boyer

This bit is defined in the kernel but not displayed by ibv_devinfo.

 libibverbs/examples/devinfo.c | 3 +++
 libibverbs/verbs.h            | 1 +
 2 files changed, 4 insertions(+)
libibverbs/examples/devinfo.c +4 -0
index bf53eac2..e3210f6e 100644
+++ b/libibverbs/examples/devinfo.c
@@ -220,6 +220,7 @@ static void print_device_cap_flags(uint32_t dev_cap_flags)
 				   IBV_DEVICE_RC_RNR_NAK_GEN |
 				   IBV_DEVICE_SRQ_RESIZE |
 				   IBV_DEVICE_N_NOTIFY_CQ |
+				   IBV_DEVICE_LOCAL_DMA_LKEY |
 				   IBV_DEVICE_MEM_WINDOW |
 				   IBV_DEVICE_UD_IP_CSUM |
 				   IBV_DEVICE_XRC |
@@ -260,6 +261,8 @@ static void print_device_cap_flags(uint32_t dev_cap_flags)
 		printf("\t\t\t\t\tSRQ_RESIZE\n");
 	if (dev_cap_flags & IBV_DEVICE_N_NOTIFY_CQ)
 		printf("\t\t\t\t\tN_NOTIFY_CQ\n");
+	if (dev_cap_flags & IBV_DEVICE_LOCAL_DMA_LKEY)
+		printf("\t\t\t\t\tLOCAL_DMA_LKEY\n");
 	if (dev_cap_flags & IBV_DEVICE_MEM_WINDOW)
 		printf("\t\t\t\t\tMEM_WINDOW\n");
 	if (dev_cap_flags & IBV_DEVICE_UD_IP_CSUM)
libibverbs/verbs.h +1 -0
index 7b8d4310..81e5812c 100644
+++ b/libibverbs/verbs.h

libibverbs/verbs.h enum ibv_device_cap_flags { · line 118

Quoted 7 lines
libibverbs/verbs.h +1 -0
@@ -112,6 +112,7 @@ enum ibv_device_cap_flags {
 	IBV_DEVICE_RC_RNR_NAK_GEN	= 1 << 12,
 	IBV_DEVICE_SRQ_RESIZE		= 1 << 13,
 	IBV_DEVICE_N_NOTIFY_CQ		= 1 << 14,
+	IBV_DEVICE_LOCAL_DMA_LKEY	= 1 << 15,
 	IBV_DEVICE_MEM_WINDOW           = 1 << 17,
 	IBV_DEVICE_UD_IP_CSUM		= 1 << 18,
 	IBV_DEVICE_XRC			= 1 << 20,

This flag really only has meaning for the kernel, it should come out of the uapi at all.

It is a mistake that kernel internal bits have been mixed in with userspace bits.

Jason

#2 lore raw
Quoted 46 lines · Jason Gunthorpe
Quoted 31 lines · Andrew Boyer

This bit is defined in the kernel but not displayed by ibv_devinfo.

libibverbs/examples/devinfo.c | 3 +++
libibverbs/verbs.h | 1 +

2 files changed, 4 insertions(+)
libibverbs/examples/devinfo.c +4 -0
index bf53eac2..e3210f6e 100644
+++ b/libibverbs/examples/devinfo.c
@@ -220,6 +220,7 @@ static void print_device_cap_flags(uint32_t dev_cap_flags)
 				   IBV_DEVICE_RC_RNR_NAK_GEN |
 				   IBV_DEVICE_SRQ_RESIZE |
 				   IBV_DEVICE_N_NOTIFY_CQ |
+				   IBV_DEVICE_LOCAL_DMA_LKEY |
 				   IBV_DEVICE_MEM_WINDOW |
 				   IBV_DEVICE_UD_IP_CSUM |
 				   IBV_DEVICE_XRC |
@@ -260,6 +261,8 @@ static void print_device_cap_flags(uint32_t dev_cap_flags)
 		printf("\t\t\t\t\tSRQ_RESIZE\n");
 	if (dev_cap_flags & IBV_DEVICE_N_NOTIFY_CQ)
 		printf("\t\t\t\t\tN_NOTIFY_CQ\n");
+	if (dev_cap_flags & IBV_DEVICE_LOCAL_DMA_LKEY)
+		printf("\t\t\t\t\tLOCAL_DMA_LKEY\n");
 	if (dev_cap_flags & IBV_DEVICE_MEM_WINDOW)
 		printf("\t\t\t\t\tMEM_WINDOW\n");
 	if (dev_cap_flags & IBV_DEVICE_UD_IP_CSUM)
libibverbs/verbs.h +1 -0
index 7b8d4310..81e5812c 100644
+++ b/libibverbs/verbs.h

libibverbs/verbs.h enum ibv_device_cap_flags { · line 118

Quoted 7 lines
libibverbs/verbs.h +1 -0
@@ -112,6 +112,7 @@ enum ibv_device_cap_flags {
 	IBV_DEVICE_RC_RNR_NAK_GEN	= 1 << 12,
 	IBV_DEVICE_SRQ_RESIZE		= 1 << 13,
 	IBV_DEVICE_N_NOTIFY_CQ		= 1 << 14,
+	IBV_DEVICE_LOCAL_DMA_LKEY	= 1 << 15,
 	IBV_DEVICE_MEM_WINDOW           = 1 << 17,
 	IBV_DEVICE_UD_IP_CSUM		= 1 << 18,
 	IBV_DEVICE_XRC			= 1 << 20,

This flag really only has meaning for the kernel, it should come out of the uapi at all.

Quoted 4 lines

It is a mistake that kernel internal bits have been mixed in with userspace bits.

Jason

Isn’t there value in having the userspace tools tell the user about a device’s in-kernel capabilities?

-Andrew

#3 lore raw
Quoted 46 lines · Andrew Boyer
Quoted 46 lines · Jason Gunthorpe
Quoted 31 lines · Andrew Boyer

This bit is defined in the kernel but not displayed by ibv_devinfo.

libibverbs/examples/devinfo.c | 3 +++
libibverbs/verbs.h | 1 +

2 files changed, 4 insertions(+)
libibverbs/examples/devinfo.c +4 -0
index bf53eac2..e3210f6e 100644
+++ b/libibverbs/examples/devinfo.c
@@ -220,6 +220,7 @@ static void print_device_cap_flags(uint32_t dev_cap_flags)
 				   IBV_DEVICE_RC_RNR_NAK_GEN |
 				   IBV_DEVICE_SRQ_RESIZE |
 				   IBV_DEVICE_N_NOTIFY_CQ |
+				   IBV_DEVICE_LOCAL_DMA_LKEY |
 				   IBV_DEVICE_MEM_WINDOW |
 				   IBV_DEVICE_UD_IP_CSUM |
 				   IBV_DEVICE_XRC |
@@ -260,6 +261,8 @@ static void print_device_cap_flags(uint32_t dev_cap_flags)
 		printf("\t\t\t\t\tSRQ_RESIZE\n");
 	if (dev_cap_flags & IBV_DEVICE_N_NOTIFY_CQ)
 		printf("\t\t\t\t\tN_NOTIFY_CQ\n");
+	if (dev_cap_flags & IBV_DEVICE_LOCAL_DMA_LKEY)
+		printf("\t\t\t\t\tLOCAL_DMA_LKEY\n");
 	if (dev_cap_flags & IBV_DEVICE_MEM_WINDOW)
 		printf("\t\t\t\t\tMEM_WINDOW\n");
 	if (dev_cap_flags & IBV_DEVICE_UD_IP_CSUM)
libibverbs/verbs.h +1 -0
index 7b8d4310..81e5812c 100644
+++ b/libibverbs/verbs.h

libibverbs/verbs.h enum ibv_device_cap_flags { · line 118

Quoted 7 lines
libibverbs/verbs.h +1 -0
@@ -112,6 +112,7 @@ enum ibv_device_cap_flags {
 	IBV_DEVICE_RC_RNR_NAK_GEN	= 1 << 12,
 	IBV_DEVICE_SRQ_RESIZE		= 1 << 13,
 	IBV_DEVICE_N_NOTIFY_CQ		= 1 << 14,
+	IBV_DEVICE_LOCAL_DMA_LKEY	= 1 << 15,
 	IBV_DEVICE_MEM_WINDOW           = 1 << 17,
 	IBV_DEVICE_UD_IP_CSUM		= 1 << 18,
 	IBV_DEVICE_XRC			= 1 << 20,

This flag really only has meaning for the kernel, it should come out of the uapi at all.

Quoted 7 lines
Quoted 4 lines

It is a mistake that kernel internal bits have been mixed in with userspace bits.

Jason

Isn’t there value in having the userspace tools tell the user about a device’s in-kernel capabilities?

Sure, but that is more a rdmatool thing, not uverbs

Jason