[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c9d9c8dd-682e-ab38-a3af-6159adbebba7@gmail.com>
Date: Tue, 15 May 2018 13:53:08 -0600
From: David Ahern <dsahern@...il.com>
To: Doug Ledford <dledford@...hat.com>,
Steve Wise <swise@...ngridcomputing.com>, leon@...nel.org
Cc: stephen@...workplumber.org, netdev@...r.kernel.org,
linux-rdma@...r.kernel.org
Subject: Re: [PATCH v2 iproute2-next 1/3] rdma: update rdma_netlink.h to get
new driver attributes
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@...r.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
Powered by blists - more mailing lists