linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rdma-core: Recognize IBV_DEVICE_LOCAL_DMA_LKEY in ibv_devinfo
@ 2019-11-25 15:22 Andrew Boyer
  2019-11-25 17:56 ` Jason Gunthorpe
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Boyer @ 2019-11-25 15:22 UTC (permalink / raw)
  To: linux-rdma; +Cc: Andrew Boyer, allenbh

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

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
---
 libibverbs/examples/devinfo.c | 3 +++
 libibverbs/verbs.h            | 1 +
 2 files changed, 4 insertions(+)

diff --git a/libibverbs/examples/devinfo.c b/libibverbs/examples/devinfo.c
index bf53eac2..e3210f6e 100644
--- a/libibverbs/examples/devinfo.c
+++ 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)
diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h
index 7b8d4310..81e5812c 100644
--- a/libibverbs/verbs.h
+++ b/libibverbs/verbs.h
@@ -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,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] rdma-core: Recognize IBV_DEVICE_LOCAL_DMA_LKEY in ibv_devinfo
  2019-11-25 15:22 [PATCH] rdma-core: Recognize IBV_DEVICE_LOCAL_DMA_LKEY in ibv_devinfo Andrew Boyer
@ 2019-11-25 17:56 ` Jason Gunthorpe
  2019-11-25 19:32   ` Andrew Boyer
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Gunthorpe @ 2019-11-25 17:56 UTC (permalink / raw)
  To: Andrew Boyer; +Cc: linux-rdma, allenbh

On Mon, Nov 25, 2019 at 07:22:37AM -0800, Andrew Boyer wrote:
> This bit is defined in the kernel but not displayed by ibv_devinfo.
> 
> Signed-off-by: Andrew Boyer <aboyer@pensando.io>
>  libibverbs/examples/devinfo.c | 3 +++
>  libibverbs/verbs.h            | 1 +
>  2 files changed, 4 insertions(+)
> 
> diff --git a/libibverbs/examples/devinfo.c b/libibverbs/examples/devinfo.c
> 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)
> diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h
> index 7b8d4310..81e5812c 100644
> +++ b/libibverbs/verbs.h
> @@ -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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rdma-core: Recognize IBV_DEVICE_LOCAL_DMA_LKEY in ibv_devinfo
  2019-11-25 17:56 ` Jason Gunthorpe
@ 2019-11-25 19:32   ` Andrew Boyer
  2019-11-25 20:08     ` Jason Gunthorpe
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Boyer @ 2019-11-25 19:32 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: linux-rdma, allenbh


> On Nov 25, 2019, at 12:56 PM, Jason Gunthorpe <jgg@ziepe.ca> wrote:
> 
> On Mon, Nov 25, 2019 at 07:22:37AM -0800, Andrew Boyer wrote:
>> This bit is defined in the kernel but not displayed by ibv_devinfo.
>> 
>> Signed-off-by: Andrew Boyer <aboyer@pensando.io>
>> libibverbs/examples/devinfo.c | 3 +++
>> libibverbs/verbs.h            | 1 +
>> 2 files changed, 4 insertions(+)
>> 
>> diff --git a/libibverbs/examples/devinfo.c b/libibverbs/examples/devinfo.c
>> 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)
>> diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h
>> index 7b8d4310..81e5812c 100644
>> +++ b/libibverbs/verbs.h
>> @@ -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

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

-Andrew


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rdma-core: Recognize IBV_DEVICE_LOCAL_DMA_LKEY in ibv_devinfo
  2019-11-25 19:32   ` Andrew Boyer
@ 2019-11-25 20:08     ` Jason Gunthorpe
  0 siblings, 0 replies; 4+ messages in thread
From: Jason Gunthorpe @ 2019-11-25 20:08 UTC (permalink / raw)
  To: Andrew Boyer; +Cc: linux-rdma, allenbh

On Mon, Nov 25, 2019 at 02:32:31PM -0500, Andrew Boyer wrote:
> 
> > On Nov 25, 2019, at 12:56 PM, Jason Gunthorpe <jgg@ziepe.ca> wrote:
> > 
> > On Mon, Nov 25, 2019 at 07:22:37AM -0800, Andrew Boyer wrote:
> >> This bit is defined in the kernel but not displayed by ibv_devinfo.
> >> 
> >> Signed-off-by: Andrew Boyer <aboyer@pensando.io>
> >> libibverbs/examples/devinfo.c | 3 +++
> >> libibverbs/verbs.h            | 1 +
> >> 2 files changed, 4 insertions(+)
> >> 
> >> diff --git a/libibverbs/examples/devinfo.c b/libibverbs/examples/devinfo.c
> >> 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)
> >> diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h
> >> index 7b8d4310..81e5812c 100644
> >> +++ b/libibverbs/verbs.h
> >> @@ -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
> 
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-11-25 20:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-25 15:22 [PATCH] rdma-core: Recognize IBV_DEVICE_LOCAL_DMA_LKEY in ibv_devinfo Andrew Boyer
2019-11-25 17:56 ` Jason Gunthorpe
2019-11-25 19:32   ` Andrew Boyer
2019-11-25 20:08     ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).