diff mbox

[v2,iproute2-next,1/3] rdma: update rdma_netlink.h to get new driver attributes

Message ID ef3d41db66cf503f717f92f6e595c065ea4dbe4e.1526312594.git.swise@opengridcomputing.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Steve Wise May 14, 2018, 3:42 p.m. UTC
Pull in the rdma_netlink.h changes from kernel
commits:

25a0ad85156a ("RDMA/nldev: Add explicit pad attribute")
da5c85078215 ("RDMA/nldev: add driver-specific resource tracking)"

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---
 rdma/include/uapi/rdma/rdma_netlink.h | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

Comments

David Ahern May 15, 2018, 7:37 p.m. UTC | #1
On 5/14/18 9:42 AM, Steve Wise wrote:
> diff --git a/rdma/include/uapi/rdma/rdma_netlink.h b/rdma/include/uapi/rdma/rdma_netlink.h
> index 60416ed..40be0d8 100644
> --- a/rdma/include/uapi/rdma/rdma_netlink.h
> +++ b/rdma/include/uapi/rdma/rdma_netlink.h
> @@ -249,10 +249,22 @@ enum rdma_nldev_command {
>  	RDMA_NLDEV_NUM_OPS
>  };
>  
> +enum {
> +	RDMA_NLDEV_ATTR_ENTRY_STRLEN = 16,
> +};
> +
> +enum rdma_nldev_print_type {
> +	RDMA_NLDEV_PRINT_TYPE_UNSPEC,
> +	RDMA_NLDEV_PRINT_TYPE_HEX,
> +};
> +
>  enum rdma_nldev_attr {
>  	/* don't change the order or add anything between, this is ABI! */

I asked this before and did not get a response. As the comment above
states with an emphasis (!) ...

>  	RDMA_NLDEV_ATTR_UNSPEC,
>  
> +	/* Pad attribute for 64b alignment */
> +	RDMA_NLDEV_ATTR_PAD = RDMA_NLDEV_ATTR_UNSPEC,
> +

... are you really adding new attributes in the middle?

>  	/* Identifier for ib_device */
>  	RDMA_NLDEV_ATTR_DEV_INDEX,		/* u32 */
>  
> @@ -387,6 +399,20 @@ enum rdma_nldev_attr {
>  	RDMA_NLDEV_ATTR_RES_PD_ENTRY,		/* nested table */
>  	RDMA_NLDEV_ATTR_RES_LOCAL_DMA_LKEY,	/* u32 */
>  	RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY,	/* u32 */
> +	/*
> +	 * driver-specific attributes.
> +	 */
> +	RDMA_NLDEV_ATTR_DRIVER,			/* nested table */
> +	RDMA_NLDEV_ATTR_DRIVER_ENTRY,		/* nested table */
> +	RDMA_NLDEV_ATTR_DRIVER_STRING,		/* string */
> +	/*
> +	 * u8 values from enum rdma_nldev_print_type
> +	 */
> +	RDMA_NLDEV_ATTR_DRIVER_PRINT_TYPE,	/* u8 */
> +	RDMA_NLDEV_ATTR_DRIVER_S32,		/* s32 */
> +	RDMA_NLDEV_ATTR_DRIVER_U32,		/* u32 */
> +	RDMA_NLDEV_ATTR_DRIVER_S64,		/* s64 */
> +	RDMA_NLDEV_ATTR_DRIVER_U64,		/* u64 */

and again here.

>  
>  	/*
>  	 * Provides logical name and index of netdevice which is
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Doug Ledford May 15, 2018, 7:47 p.m. UTC | #2
On Tue, 2018-05-15 at 13:37 -0600, David Ahern wrote:
> On 5/14/18 9:42 AM, Steve Wise wrote:
> > diff --git a/rdma/include/uapi/rdma/rdma_netlink.h b/rdma/include/uapi/rdma/rdma_netlink.h
> > index 60416ed..40be0d8 100644
> > --- a/rdma/include/uapi/rdma/rdma_netlink.h
> > +++ b/rdma/include/uapi/rdma/rdma_netlink.h
> > @@ -249,10 +249,22 @@ enum rdma_nldev_command {
> >  	RDMA_NLDEV_NUM_OPS
> >  };
> >  
> > +enum {
> > +	RDMA_NLDEV_ATTR_ENTRY_STRLEN = 16,
> > +};
> > +
> > +enum rdma_nldev_print_type {
> > +	RDMA_NLDEV_PRINT_TYPE_UNSPEC,
> > +	RDMA_NLDEV_PRINT_TYPE_HEX,
> > +};
> > +
> >  enum rdma_nldev_attr {
> >  	/* don't change the order or add anything between, this is ABI! */
> 
> I asked this before and did not get a response. As the comment above
> states with an emphasis (!) ...
> 
> >  	RDMA_NLDEV_ATTR_UNSPEC,
> >  
> > +	/* Pad attribute for 64b alignment */
> > +	RDMA_NLDEV_ATTR_PAD = RDMA_NLDEV_ATTR_UNSPEC,
> > +
> 
> ... are you really adding new attributes in the middle?

Not really.  The new item is being explicitly set to the same value as
the item above it.  It therefore becomes two entries with the same enum
value.  The rest of the enum is all unchanged.

> >  	/* Identifier for ib_device */
> >  	RDMA_NLDEV_ATTR_DEV_INDEX,		/* u32 */
> >  
> > @@ -387,6 +399,20 @@ enum rdma_nldev_attr {
> >  	RDMA_NLDEV_ATTR_RES_PD_ENTRY,		/* nested table */
> >  	RDMA_NLDEV_ATTR_RES_LOCAL_DMA_LKEY,	/* u32 */
> >  	RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY,	/* u32 */
> > +	/*
> > +	 * driver-specific attributes.
> > +	 */
> > +	RDMA_NLDEV_ATTR_DRIVER,			/* nested table */
> > +	RDMA_NLDEV_ATTR_DRIVER_ENTRY,		/* nested table */
> > +	RDMA_NLDEV_ATTR_DRIVER_STRING,		/* string */
> > +	/*
> > +	 * u8 values from enum rdma_nldev_print_type
> > +	 */
> > +	RDMA_NLDEV_ATTR_DRIVER_PRINT_TYPE,	/* u8 */
> > +	RDMA_NLDEV_ATTR_DRIVER_S32,		/* s32 */
> > +	RDMA_NLDEV_ATTR_DRIVER_U32,		/* u32 */
> > +	RDMA_NLDEV_ATTR_DRIVER_S64,		/* s64 */
> > +	RDMA_NLDEV_ATTR_DRIVER_U64,		/* u64 */
> 
> and again here.
> 
> >  
> >  	/*
> >  	 * Provides logical name and index of netdevice which is
> > 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Doug Ledford May 15, 2018, 7:52 p.m. UTC | #3
On Tue, 2018-05-15 at 13:37 -0600, David Ahern wrote:
> On 5/14/18 9:42 AM, Steve Wise wrote:
> > diff --git a/rdma/include/uapi/rdma/rdma_netlink.h b/rdma/include/uapi/rdma/rdma_netlink.h
> > index 60416ed..40be0d8 100644
> > --- a/rdma/include/uapi/rdma/rdma_netlink.h
> > +++ b/rdma/include/uapi/rdma/rdma_netlink.h
> > 
> > @@ -387,6 +399,20 @@ enum rdma_nldev_attr {
> >  	RDMA_NLDEV_ATTR_RES_PD_ENTRY,		/* nested table */
> >  	RDMA_NLDEV_ATTR_RES_LOCAL_DMA_LKEY,	/* u32 */
> >  	RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY,	/* u32 */
> > +	/*
> > +	 * driver-specific attributes.
> > +	 */
> > +	RDMA_NLDEV_ATTR_DRIVER,			/* nested table */
> > +	RDMA_NLDEV_ATTR_DRIVER_ENTRY,		/* nested table */
> > +	RDMA_NLDEV_ATTR_DRIVER_STRING,		/* string */
> > +	/*
> > +	 * u8 values from enum rdma_nldev_print_type
> > +	 */
> > +	RDMA_NLDEV_ATTR_DRIVER_PRINT_TYPE,	/* u8 */
> > +	RDMA_NLDEV_ATTR_DRIVER_S32,		/* s32 */
> > +	RDMA_NLDEV_ATTR_DRIVER_U32,		/* u32 */
> > +	RDMA_NLDEV_ATTR_DRIVER_S64,		/* s64 */
> > +	RDMA_NLDEV_ATTR_DRIVER_U64,		/* u64 */
> 
> and again here.

This chunk, however, is a problem.  We'll need to fix that in the kernel
and in this patch too.
David Ahern May 15, 2018, 7:53 p.m. UTC | #4
On 5/15/18 1:47 PM, Doug Ledford wrote:
> On Tue, 2018-05-15 at 13:37 -0600, David Ahern wrote:
>> On 5/14/18 9:42 AM, Steve Wise wrote:
>>> diff --git a/rdma/include/uapi/rdma/rdma_netlink.h b/rdma/include/uapi/rdma/rdma_netlink.h
>>> index 60416ed..40be0d8 100644
>>> --- a/rdma/include/uapi/rdma/rdma_netlink.h
>>> +++ b/rdma/include/uapi/rdma/rdma_netlink.h
>>> @@ -249,10 +249,22 @@ enum rdma_nldev_command {
>>>  	RDMA_NLDEV_NUM_OPS
>>>  };
>>>  
>>> +enum {
>>> +	RDMA_NLDEV_ATTR_ENTRY_STRLEN = 16,
>>> +};
>>> +
>>> +enum rdma_nldev_print_type {
>>> +	RDMA_NLDEV_PRINT_TYPE_UNSPEC,
>>> +	RDMA_NLDEV_PRINT_TYPE_HEX,
>>> +};
>>> +
>>>  enum rdma_nldev_attr {
>>>  	/* don't change the order or add anything between, this is ABI! */
>>
>> I asked this before and did not get a response. As the comment above
>> states with an emphasis (!) ...
>>
>>>  	RDMA_NLDEV_ATTR_UNSPEC,
>>>  
>>> +	/* Pad attribute for 64b alignment */
>>> +	RDMA_NLDEV_ATTR_PAD = RDMA_NLDEV_ATTR_UNSPEC,
>>> +
>>
>> ... are you really adding new attributes in the middle?
> 
> Not really.  The new item is being explicitly set to the same value as
> the item above it.  It therefore becomes two entries with the same enum
> value.  The rest of the enum is all unchanged.

sure for the above, but not the ones below.

Before this patch, this program:
$ cat a.c
#include <uapi/rdma/rdma_netlink.h>
#include <stdio.h>

int main(void)
{
	printf("RDMA_NLDEV_ATTR_NDEV_INDEX = %d\n", RDMA_NLDEV_ATTR_NDEV_INDEX);

	return 0;
}

prints this:
$ ./a.out
RDMA_NLDEV_ATTR_NDEV_INDEX = 50

After this patch,
$ ./a.out
RDMA_NLDEV_ATTR_NDEV_INDEX = 58


> 
>>>  	/* Identifier for ib_device */
>>>  	RDMA_NLDEV_ATTR_DEV_INDEX,		/* u32 */
>>>  
>>> @@ -387,6 +399,20 @@ enum rdma_nldev_attr {
>>>  	RDMA_NLDEV_ATTR_RES_PD_ENTRY,		/* nested table */
>>>  	RDMA_NLDEV_ATTR_RES_LOCAL_DMA_LKEY,	/* u32 */
>>>  	RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY,	/* u32 */
>>> +	/*
>>> +	 * driver-specific attributes.
>>> +	 */
>>> +	RDMA_NLDEV_ATTR_DRIVER,			/* nested table */
>>> +	RDMA_NLDEV_ATTR_DRIVER_ENTRY,		/* nested table */
>>> +	RDMA_NLDEV_ATTR_DRIVER_STRING,		/* string */
>>> +	/*
>>> +	 * u8 values from enum rdma_nldev_print_type
>>> +	 */
>>> +	RDMA_NLDEV_ATTR_DRIVER_PRINT_TYPE,	/* u8 */
>>> +	RDMA_NLDEV_ATTR_DRIVER_S32,		/* s32 */
>>> +	RDMA_NLDEV_ATTR_DRIVER_U32,		/* u32 */
>>> +	RDMA_NLDEV_ATTR_DRIVER_S64,		/* s64 */
>>> +	RDMA_NLDEV_ATTR_DRIVER_U64,		/* u64 */
>>
>> and again here.
>>
>>>  
>>>  	/*
>>>  	 * Provides logical name and index of netdevice which is
>>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-rdma" icat n
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Doug Ledford May 15, 2018, 8 p.m. UTC | #5
On Tue, 2018-05-15 at 13:53 -0600, David Ahern wrote:
> sure for the above, but not the ones below.
> 
> Before this patch, this program:
> $ cat a.c
> #include <uapi/rdma/rdma_netlink.h>
> #include <stdio.h>
> 
> int main(void)
> {
>         printf("RDMA_NLDEV_ATTR_NDEV_INDEX = %d\n", RDMA_NLDEV_ATTR_NDEV_INDEX);
> 
>         return 0;
> }
> 
> prints this:
> $ ./a.out
> RDMA_NLDEV_ATTR_NDEV_INDEX = 50
> 
> After this patch,
> $ ./a.out
> RDMA_NLDEV_ATTR_NDEV_INDEX = 58

I just sent an incremental fix to the list under separate cover.  You
can squash that fix into Steve's patch and it should resolve the issue. 
Or Steve can respin the set.  Either way.
David Ahern May 15, 2018, 8:01 p.m. UTC | #6
On 5/15/18 2:00 PM, Doug Ledford wrote:
> I just sent an incremental fix to the list under separate cover.  You
> can squash that fix into Steve's patch and it should resolve the issue. 
> Or Steve can respin the set.  Either way.

Once the patch has been committed to the upstream repo, spin a new set
with the correct header update.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Doug Ledford May 15, 2018, 8:05 p.m. UTC | #7
On Tue, 2018-05-15 at 14:01 -0600, David Ahern wrote:
> On 5/15/18 2:00 PM, Doug Ledford wrote:
> > I just sent an incremental fix to the list under separate cover.  You
> > can squash that fix into Steve's patch and it should resolve the issue. 
> > Or Steve can respin the set.  Either way.
> 
> Once the patch has been committed to the upstream repo, spin a new set
> with the correct header update.

Well, I wrote it, so it's in my repo now ;-).  I just sent it to the
list because that's what you do when you are writing fixup patches even
if you've already committed them.
Steve Wise May 15, 2018, 8:25 p.m. UTC | #8
> On Tue, 2018-05-15 at 13:37 -0600, David Ahern wrote:
> > On 5/14/18 9:42 AM, Steve Wise wrote:
> > > diff --git a/rdma/include/uapi/rdma/rdma_netlink.h
> b/rdma/include/uapi/rdma/rdma_netlink.h
> > > index 60416ed..40be0d8 100644
> > > --- a/rdma/include/uapi/rdma/rdma_netlink.h
> > > +++ b/rdma/include/uapi/rdma/rdma_netlink.h
> > > @@ -249,10 +249,22 @@ enum rdma_nldev_command {
> > >  	RDMA_NLDEV_NUM_OPS
> > >  };
> > >
> > > +enum {
> > > +	RDMA_NLDEV_ATTR_ENTRY_STRLEN = 16,
> > > +};
> > > +
> > > +enum rdma_nldev_print_type {
> > > +	RDMA_NLDEV_PRINT_TYPE_UNSPEC,
> > > +	RDMA_NLDEV_PRINT_TYPE_HEX,
> > > +};
> > > +
> > >  enum rdma_nldev_attr {
> > >  	/* don't change the order or add anything between, this is ABI! */
> >
> > I asked this before and did not get a response. As the comment above
> > states with an emphasis (!) ...

Sorry David, I missed your question previously. ☹

> >
> > >  	RDMA_NLDEV_ATTR_UNSPEC,
> > >
> > > +	/* Pad attribute for 64b alignment */
> > > +	RDMA_NLDEV_ATTR_PAD = RDMA_NLDEV_ATTR_UNSPEC,
> > > +
> >
> > ... are you really adding new attributes in the middle?
> 
> Not really.  The new item is being explicitly set to the same value as
> the item above it.  It therefore becomes two entries with the same enum
> value.  The rest of the enum is all unchanged.

Correct.

The reason this was done was because a kernel had already been released where 64b nlattrs were being padded with 0 instead of defining an explicit pad attribute.  Jason thought the kernel side should define an explicit PAD attribute and use it.  To preserve the ABI we defined it but set it to 0 (aka ATTR_UNSPEC aka the first in the enum).  


> 
> > >  	/* Identifier for ib_device */
> > >  	RDMA_NLDEV_ATTR_DEV_INDEX,		/* u32 */
> > >
> > > @@ -387,6 +399,20 @@ enum rdma_nldev_attr {
> > >  	RDMA_NLDEV_ATTR_RES_PD_ENTRY,		/* nested table */
> > >  	RDMA_NLDEV_ATTR_RES_LOCAL_DMA_LKEY,	/* u32 */
> > >  	RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY,	/* u32 */
> > > +	/*
> > > +	 * driver-specific attributes.
> > > +	 */
> > > +	RDMA_NLDEV_ATTR_DRIVER,			/* nested table */
> > > +	RDMA_NLDEV_ATTR_DRIVER_ENTRY,		/* nested table */
> > > +	RDMA_NLDEV_ATTR_DRIVER_STRING,		/* string */
> > > +	/*
> > > +	 * u8 values from enum rdma_nldev_print_type
> > > +	 */
> > > +	RDMA_NLDEV_ATTR_DRIVER_PRINT_TYPE,	/* u8 */
> > > +	RDMA_NLDEV_ATTR_DRIVER_S32,		/* s32 */
> > > +	RDMA_NLDEV_ATTR_DRIVER_U32,		/* u32 */
> > > +	RDMA_NLDEV_ATTR_DRIVER_S64,		/* s64 */
> > > +	RDMA_NLDEV_ATTR_DRIVER_U64,		/* u64 */
> >
> > and again here.
> >

Ugh, this looks like a mistake maybe due to me rebasing and not noticing this commit added the name/index attrs.

5b2cc79de878 leonro@mellanox.com RDMA/nldev: Provide netdevice name and index 

Both of these are in -next to be merged upstream together.  

Should I do anything?


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steve Wise May 15, 2018, 8:28 p.m. UTC | #9
> -----Original Message-----
> From: linux-rdma-owner@vger.kernel.org <linux-rdma-
> owner@vger.kernel.org> On Behalf Of Doug Ledford
> Sent: Tuesday, May 15, 2018 2:53 PM
> To: David Ahern <dsahern@gmail.com>; Steve Wise
> <swise@opengridcomputing.com>; leon@kernel.org
> Cc: stephen@networkplumber.org; netdev@vger.kernel.org; linux-
> rdma@vger.kernel.org
> Subject: Re: [PATCH v2 iproute2-next 1/3] rdma: update rdma_netlink.h to
> get new driver attributes
> 
> On Tue, 2018-05-15 at 13:37 -0600, David Ahern wrote:
> > On 5/14/18 9:42 AM, Steve Wise wrote:
> > > diff --git a/rdma/include/uapi/rdma/rdma_netlink.h
> b/rdma/include/uapi/rdma/rdma_netlink.h
> > > index 60416ed..40be0d8 100644
> > > --- a/rdma/include/uapi/rdma/rdma_netlink.h
> > > +++ b/rdma/include/uapi/rdma/rdma_netlink.h
> > >
> > > @@ -387,6 +399,20 @@ enum rdma_nldev_attr {
> > >  	RDMA_NLDEV_ATTR_RES_PD_ENTRY,		/* nested table */
> > >  	RDMA_NLDEV_ATTR_RES_LOCAL_DMA_LKEY,	/* u32 */
> > >  	RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY,	/* u32 */
> > > +	/*
> > > +	 * driver-specific attributes.
> > > +	 */
> > > +	RDMA_NLDEV_ATTR_DRIVER,			/* nested table */
> > > +	RDMA_NLDEV_ATTR_DRIVER_ENTRY,		/* nested table */
> > > +	RDMA_NLDEV_ATTR_DRIVER_STRING,		/* string */
> > > +	/*
> > > +	 * u8 values from enum rdma_nldev_print_type
> > > +	 */
> > > +	RDMA_NLDEV_ATTR_DRIVER_PRINT_TYPE,	/* u8 */
> > > +	RDMA_NLDEV_ATTR_DRIVER_S32,		/* s32 */
> > > +	RDMA_NLDEV_ATTR_DRIVER_U32,		/* u32 */
> > > +	RDMA_NLDEV_ATTR_DRIVER_S64,		/* s64 */
> > > +	RDMA_NLDEV_ATTR_DRIVER_U64,		/* u64 */
> >
> > and again here.
> 
> This chunk, however, is a problem.  We'll need to fix that in the kernel
> and in this patch too.

I'll fix this series once I fix the kernel side.  Doug, should I send a patch that basically moves the DRIVER attributes to the bottom?

Sorry about missing this!

Steve


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steve Wise May 15, 2018, 8:29 p.m. UTC | #10
> -----Original Message-----
> From: David Ahern <dsahern@gmail.com>
> Sent: Tuesday, May 15, 2018 3:02 PM
> To: Doug Ledford <dledford@redhat.com>; Steve Wise
> <swise@opengridcomputing.com>; leon@kernel.org
> Cc: stephen@networkplumber.org; netdev@vger.kernel.org; linux-
> rdma@vger.kernel.org
> Subject: Re: [PATCH v2 iproute2-next 1/3] rdma: update rdma_netlink.h to
> get new driver attributes
> 
> On 5/15/18 2:00 PM, Doug Ledford wrote:
> > I just sent an incremental fix to the list under separate cover.  You
> > can squash that fix into Steve's patch and it should resolve the issue.
> > Or Steve can respin the set.  Either way.
> 
> Once the patch has been committed to the upstream repo, spin a new set
> with the correct header update.

Will do!

Steve.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Doug Ledford May 15, 2018, 8:39 p.m. UTC | #11
On Tue, 2018-05-15 at 15:28 -0500, Steve Wise wrote:
> > -----Original Message-----
> > From: linux-rdma-owner@vger.kernel.org <linux-rdma-
> > owner@vger.kernel.org> On Behalf Of Doug Ledford
> > Sent: Tuesday, May 15, 2018 2:53 PM
> > To: David Ahern <dsahern@gmail.com>; Steve Wise
> > <swise@opengridcomputing.com>; leon@kernel.org
> > Cc: stephen@networkplumber.org; netdev@vger.kernel.org; linux-
> > rdma@vger.kernel.org
> > Subject: Re: [PATCH v2 iproute2-next 1/3] rdma: update rdma_netlink.h to
> > get new driver attributes
> > 
> > On Tue, 2018-05-15 at 13:37 -0600, David Ahern wrote:
> > > On 5/14/18 9:42 AM, Steve Wise wrote:
> > > > diff --git a/rdma/include/uapi/rdma/rdma_netlink.h
> > 
> > b/rdma/include/uapi/rdma/rdma_netlink.h
> > > > index 60416ed..40be0d8 100644
> > > > --- a/rdma/include/uapi/rdma/rdma_netlink.h
> > > > +++ b/rdma/include/uapi/rdma/rdma_netlink.h
> > > > 
> > > > @@ -387,6 +399,20 @@ enum rdma_nldev_attr {
> > > >  	RDMA_NLDEV_ATTR_RES_PD_ENTRY,		/* nested table */
> > > >  	RDMA_NLDEV_ATTR_RES_LOCAL_DMA_LKEY,	/* u32 */
> > > >  	RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY,	/* u32 */
> > > > +	/*
> > > > +	 * driver-specific attributes.
> > > > +	 */
> > > > +	RDMA_NLDEV_ATTR_DRIVER,			/* nested table */
> > > > +	RDMA_NLDEV_ATTR_DRIVER_ENTRY,		/* nested table */
> > > > +	RDMA_NLDEV_ATTR_DRIVER_STRING,		/* string */
> > > > +	/*
> > > > +	 * u8 values from enum rdma_nldev_print_type
> > > > +	 */
> > > > +	RDMA_NLDEV_ATTR_DRIVER_PRINT_TYPE,	/* u8 */
> > > > +	RDMA_NLDEV_ATTR_DRIVER_S32,		/* s32 */
> > > > +	RDMA_NLDEV_ATTR_DRIVER_U32,		/* u32 */
> > > > +	RDMA_NLDEV_ATTR_DRIVER_S64,		/* s64 */
> > > > +	RDMA_NLDEV_ATTR_DRIVER_U64,		/* u64 */
> > > 
> > > and again here.
> > 
> > This chunk, however, is a problem.  We'll need to fix that in the kernel
> > and in this patch too.
> 
> I'll fix this series once I fix the kernel side.  Doug, should I send a patch that basically moves the DRIVER attributes to the bottom?
> 
> Sorry about missing this!

I missed it too.  I knew about the first hunk, but thought this one was
at the end.  Anyway, I've already pushed the fix to my wip/dl-for-next
branch, so you can get it there now.
diff mbox

Patch

diff --git a/rdma/include/uapi/rdma/rdma_netlink.h b/rdma/include/uapi/rdma/rdma_netlink.h
index 60416ed..40be0d8 100644
--- a/rdma/include/uapi/rdma/rdma_netlink.h
+++ b/rdma/include/uapi/rdma/rdma_netlink.h
@@ -249,10 +249,22 @@  enum rdma_nldev_command {
 	RDMA_NLDEV_NUM_OPS
 };
 
+enum {
+	RDMA_NLDEV_ATTR_ENTRY_STRLEN = 16,
+};
+
+enum rdma_nldev_print_type {
+	RDMA_NLDEV_PRINT_TYPE_UNSPEC,
+	RDMA_NLDEV_PRINT_TYPE_HEX,
+};
+
 enum rdma_nldev_attr {
 	/* don't change the order or add anything between, this is ABI! */
 	RDMA_NLDEV_ATTR_UNSPEC,
 
+	/* Pad attribute for 64b alignment */
+	RDMA_NLDEV_ATTR_PAD = RDMA_NLDEV_ATTR_UNSPEC,
+
 	/* Identifier for ib_device */
 	RDMA_NLDEV_ATTR_DEV_INDEX,		/* u32 */
 
@@ -387,6 +399,20 @@  enum rdma_nldev_attr {
 	RDMA_NLDEV_ATTR_RES_PD_ENTRY,		/* nested table */
 	RDMA_NLDEV_ATTR_RES_LOCAL_DMA_LKEY,	/* u32 */
 	RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY,	/* u32 */
+	/*
+	 * driver-specific attributes.
+	 */
+	RDMA_NLDEV_ATTR_DRIVER,			/* nested table */
+	RDMA_NLDEV_ATTR_DRIVER_ENTRY,		/* nested table */
+	RDMA_NLDEV_ATTR_DRIVER_STRING,		/* string */
+	/*
+	 * u8 values from enum rdma_nldev_print_type
+	 */
+	RDMA_NLDEV_ATTR_DRIVER_PRINT_TYPE,	/* u8 */
+	RDMA_NLDEV_ATTR_DRIVER_S32,		/* s32 */
+	RDMA_NLDEV_ATTR_DRIVER_U32,		/* u32 */
+	RDMA_NLDEV_ATTR_DRIVER_S64,		/* s64 */
+	RDMA_NLDEV_ATTR_DRIVER_U64,		/* u64 */
 
 	/*
 	 * Provides logical name and index of netdevice which is