diff mbox series

[iproute2-next,v1,1/4] rdma: update uapi headers

Message ID 20200624104012.1450880-2-leon@kernel.org
State New
Headers show
Series [iproute2-next,v1,1/4] rdma: update uapi headers | expand

Commit Message

Leon Romanovsky June 24, 2020, 10:40 a.m. UTC
From: Maor Gottlieb <maorg@mellanox.com>

Update rdma_netlink.h file upto kernel commit ba1f4991cc55
("RDMA: Add support to dump resource tracker in RAW format")

Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 rdma/include/uapi/rdma/rdma_netlink.h | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

David Ahern July 5, 2020, 3:02 p.m. UTC | #1
On 6/24/20 4:40 AM, Leon Romanovsky wrote:
> diff --git a/rdma/include/uapi/rdma/rdma_netlink.h b/rdma/include/uapi/rdma/rdma_netlink.h

> index ae5a77a1..fe127b88 100644

> --- a/rdma/include/uapi/rdma/rdma_netlink.h

> +++ b/rdma/include/uapi/rdma/rdma_netlink.h

> @@ -287,6 +287,12 @@ enum rdma_nldev_command {

>  

>  	RDMA_NLDEV_CMD_STAT_DEL,

>  

> +	RDMA_NLDEV_CMD_RES_QP_GET_RAW, /* can dump */

> +

> +	RDMA_NLDEV_CMD_RES_CQ_GET_RAW, /* can dump */

> +

> +	RDMA_NLDEV_CMD_RES_MR_GET_RAW, /* can dump */

> +

>  	RDMA_NLDEV_NUM_OPS

>  };


you are inserting new commands in the middle which breaks existing users
of this API.
Leon Romanovsky July 5, 2020, 6:04 p.m. UTC | #2
On Sun, Jul 05, 2020 at 09:02:42AM -0600, David Ahern wrote:
> On 6/24/20 4:40 AM, Leon Romanovsky wrote:

> > diff --git a/rdma/include/uapi/rdma/rdma_netlink.h b/rdma/include/uapi/rdma/rdma_netlink.h

> > index ae5a77a1..fe127b88 100644

> > --- a/rdma/include/uapi/rdma/rdma_netlink.h

> > +++ b/rdma/include/uapi/rdma/rdma_netlink.h

> > @@ -287,6 +287,12 @@ enum rdma_nldev_command {

> >

> >  	RDMA_NLDEV_CMD_STAT_DEL,

> >

> > +	RDMA_NLDEV_CMD_RES_QP_GET_RAW, /* can dump */

> > +

> > +	RDMA_NLDEV_CMD_RES_CQ_GET_RAW, /* can dump */

> > +

> > +	RDMA_NLDEV_CMD_RES_MR_GET_RAW, /* can dump */

> > +

> >  	RDMA_NLDEV_NUM_OPS

> >  };

>

> you are inserting new commands in the middle which breaks existing users

> of this API.


RDMA_NLDEV_NUM_OPS is not a command, but enum item to help calculate array
size, exactly like devlink_command in include/uapi/linux/devlink.h.

Thanks

>
David Ahern July 5, 2020, 6:07 p.m. UTC | #3
On 7/5/20 12:04 PM, Leon Romanovsky wrote:
> RDMA_NLDEV_NUM_OPS is not a command, but enum item to help calculate array

> size, exactly like devlink_command in include/uapi/linux/devlink.h.


ok. usually the last field is __FOO_MAX not FOO_NUM.
Leon Romanovsky July 6, 2020, 5:33 a.m. UTC | #4
On Sun, Jul 05, 2020 at 12:07:31PM -0600, David Ahern wrote:
> On 7/5/20 12:04 PM, Leon Romanovsky wrote:

> > RDMA_NLDEV_NUM_OPS is not a command, but enum item to help calculate array

> > size, exactly like devlink_command in include/uapi/linux/devlink.h.

>

> ok. usually the last field is __FOO_MAX not FOO_NUM.


I used same naming style as we had for other enums in rdma_netlink.h.

Thanks
diff mbox series

Patch

diff --git a/rdma/include/uapi/rdma/rdma_netlink.h b/rdma/include/uapi/rdma/rdma_netlink.h
index ae5a77a1..fe127b88 100644
--- a/rdma/include/uapi/rdma/rdma_netlink.h
+++ b/rdma/include/uapi/rdma/rdma_netlink.h
@@ -287,6 +287,12 @@  enum rdma_nldev_command {
 
 	RDMA_NLDEV_CMD_STAT_DEL,
 
+	RDMA_NLDEV_CMD_RES_QP_GET_RAW, /* can dump */
+
+	RDMA_NLDEV_CMD_RES_CQ_GET_RAW, /* can dump */
+
+	RDMA_NLDEV_CMD_RES_MR_GET_RAW, /* can dump */
+
 	RDMA_NLDEV_NUM_OPS
 };
 
@@ -525,6 +531,8 @@  enum rdma_nldev_attr {
 	 */
 	RDMA_NLDEV_ATTR_DEV_DIM,                /* u8 */
 
+	RDMA_NLDEV_ATTR_RES_RAW,                /* binary */
+
 	/*
 	 * Always the end
 	 */