diff mbox series

[iproute2] uapi: add vdpa.h

Message ID 20220718163112.11023-1-stephen@networkplumber.org (mailing list archive)
State Accepted
Commit 291898c5ff881d0dc5d947031def0528101476cb
Delegated to: David Ahern
Headers show
Series [iproute2] uapi: add vdpa.h | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Stephen Hemminger July 18, 2022, 4:31 p.m. UTC
Iproute2 depends on kernel headers and all necessary kernel headers
should be in iproute tree. When vdpa was added the kernel header
file was not.

Fixes: c2ecc82b9d4c ("vdpa: Add vdpa tool")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 include/uapi/linux/vdpa.h | 59 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 include/uapi/linux/vdpa.h

Comments

patchwork-bot+netdevbpf@kernel.org July 18, 2022, 4:40 p.m. UTC | #1
Hello:

This patch was applied to iproute2/iproute2.git (main)
by Stephen Hemminger <stephen@networkplumber.org>:

On Mon, 18 Jul 2022 09:31:13 -0700 you wrote:
> Iproute2 depends on kernel headers and all necessary kernel headers
> should be in iproute tree. When vdpa was added the kernel header
> file was not.
> 
> Fixes: c2ecc82b9d4c ("vdpa: Add vdpa tool")
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> 
> [...]

Here is the summary with links:
  - [iproute2] uapi: add vdpa.h
    https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=291898c5ff88

You are awesome, thank you!
Parav Pandit July 18, 2022, 4:40 p.m. UTC | #2
+ David

Hi Stephen,

> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Monday, July 18, 2022 12:31 PM
> 
> Iproute2 depends on kernel headers and all necessary kernel headers should
> be in iproute tree. When vdpa was added the kernel header file was not.
> 
> Fixes: c2ecc82b9d4c ("vdpa: Add vdpa tool")
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

> ---
>  include/uapi/linux/vdpa.h | 59
> +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 59 insertions(+)
>  create mode 100644 include/uapi/linux/vdpa.h
> 
> diff --git a/include/uapi/linux/vdpa.h b/include/uapi/linux/vdpa.h new file
> mode 100644 index 000000000000..94e4dad1d86c
> --- /dev/null
> +++ b/include/uapi/linux/vdpa.h

We kept this in vdpa/include/uapi/linux/vdpa.h after inputs from David.
This is because vdpa was following rdma style sync with the kernel headers.
Rdma subsystem kernel header is in rdma/include/uapi/rdma/rdma_netlink.h.

Any reason to take different route for vdpa?
If so, duplicate file from vdpa/include/uapi/linux/vdpa.h should be removed.
So that there is only one vdpa.h file.

If so, should we move rdma files also similarly?

Similar discussion came up in the past. (don't have ready reference to the discussion).
And David's input was to keep the way it is like rdma.

Added him for his inputs if something changed lately.
Parav Pandit July 18, 2022, 4:42 p.m. UTC | #3
> From: patchwork-bot+netdevbpf@kernel.org <patchwork-
> bot+netdevbpf@kernel.org>
> Sent: Monday, July 18, 2022 12:40 PM
> To: Stephen Hemminger <stephen@networkplumber.org>
> Cc: Parav Pandit <parav@nvidia.com>; netdev@vger.kernel.org
> Subject: Re: [PATCH iproute2] uapi: add vdpa.h
> 
> Hello:
> 
> This patch was applied to iproute2/iproute2.git (main) by Stephen
> Hemminger <stephen@networkplumber.org>:
> 
> On Mon, 18 Jul 2022 09:31:13 -0700 you wrote:
> > Iproute2 depends on kernel headers and all necessary kernel headers
> > should be in iproute tree. When vdpa was added the kernel header file
> > was not.
> >
> > Fixes: c2ecc82b9d4c ("vdpa: Add vdpa tool")
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> >
> > [...]
> 
> Here is the summary with links:
>   - [iproute2] uapi: add vdpa.h
> 
> https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=
> 291898c5ff88
> 
> You are awesome, thank you!
> --
> Deet-doot-dot, I am a bot.
> https://korg.docs.kernel.org/patchwork/pwbot.html
> 
Wait, this is applied too quickly, and it is not correct/complete patch.

Patch doesn’t remove existing vdpa.h located in vdpa/include/uapi/linux/vdpa.h.

I replied in patch email to seek David's input.
Stephen Hemminger July 18, 2022, 4:50 p.m. UTC | #4
On Mon, 18 Jul 2022 16:40:30 +0000
Parav Pandit <parav@nvidia.com> wrote:

> + David
> 
> Hi Stephen,
> 
> > From: Stephen Hemminger <stephen@networkplumber.org>
> > Sent: Monday, July 18, 2022 12:31 PM
> > 
> > Iproute2 depends on kernel headers and all necessary kernel headers should
> > be in iproute tree. When vdpa was added the kernel header file was not.
> > 
> > Fixes: c2ecc82b9d4c ("vdpa: Add vdpa tool")
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>  
> 
> > ---
> >  include/uapi/linux/vdpa.h | 59
> > +++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 59 insertions(+)
> >  create mode 100644 include/uapi/linux/vdpa.h
> > 
> > diff --git a/include/uapi/linux/vdpa.h b/include/uapi/linux/vdpa.h new file
> > mode 100644 index 000000000000..94e4dad1d86c
> > --- /dev/null
> > +++ b/include/uapi/linux/vdpa.h  
> 
> We kept this in vdpa/include/uapi/linux/vdpa.h after inputs from David.
> This is because vdpa was following rdma style sync with the kernel headers.
> Rdma subsystem kernel header is in rdma/include/uapi/rdma/rdma_netlink.h.
> 
> Any reason to take different route for vdpa?
> If so, duplicate file from vdpa/include/uapi/linux/vdpa.h should be removed.
> So that there is only one vdpa.h file.

Ok, sorry the semi-automated scan script didn't find the other one.
Stephen Hemminger July 18, 2022, 4:55 p.m. UTC | #5
On Mon, 18 Jul 2022 16:40:30 +0000
Parav Pandit <parav@nvidia.com> wrote:

> We kept this in vdpa/include/uapi/linux/vdpa.h after inputs from David.
> This is because vdpa was following rdma style sync with the kernel headers.
> Rdma subsystem kernel header is in rdma/include/uapi/rdma/rdma_netlink.h.
> 
> Any reason to take different route for vdpa?
> If so, duplicate file from vdpa/include/uapi/linux/vdpa.h should be removed.
> So that there is only one vdpa.h file.
> 
> If so, should we move rdma files also similarly?
> 
> Similar discussion came up in the past. (don't have ready reference to the discussion).
> And David's input was to keep the way it is like rdma.

RDMA is different and contained to one directory.
VDPA is picking up things from linux/.
And the current version is not kept up to date with kernel headers.
Fixing that now.
David Ahern July 18, 2022, 5:51 p.m. UTC | #6
On 7/18/22 10:55 AM, Stephen Hemminger wrote:
> On Mon, 18 Jul 2022 16:40:30 +0000
> Parav Pandit <parav@nvidia.com> wrote:
> 
>> We kept this in vdpa/include/uapi/linux/vdpa.h after inputs from David.
>> This is because vdpa was following rdma style sync with the kernel headers.
>> Rdma subsystem kernel header is in rdma/include/uapi/rdma/rdma_netlink.h.
>>
>> Any reason to take different route for vdpa?
>> If so, duplicate file from vdpa/include/uapi/linux/vdpa.h should be removed.
>> So that there is only one vdpa.h file.
>>
>> If so, should we move rdma files also similarly?
>>
>> Similar discussion came up in the past. (don't have ready reference to the discussion).
>> And David's input was to keep the way it is like rdma.
> 
> RDMA is different and contained to one directory.
> VDPA is picking up things from linux/.
> And the current version is not kept up to date with kernel headers.
> Fixing that now.

Updates to vdpa.h do not go through net-next so moving it to
include/uapi/linux can cause problems when trying to sync headers to
net-next commits. That's why it was put under vpda, similar to the rdma
model.
Stephen Hemminger July 18, 2022, 8:18 p.m. UTC | #7
On Mon, 18 Jul 2022 11:51:09 -0600
David Ahern <dsahern@gmail.com> wrote:

> On 7/18/22 10:55 AM, Stephen Hemminger wrote:
> > On Mon, 18 Jul 2022 16:40:30 +0000
> > Parav Pandit <parav@nvidia.com> wrote:
> >   
> >> We kept this in vdpa/include/uapi/linux/vdpa.h after inputs from David.
> >> This is because vdpa was following rdma style sync with the kernel headers.
> >> Rdma subsystem kernel header is in rdma/include/uapi/rdma/rdma_netlink.h.
> >>
> >> Any reason to take different route for vdpa?
> >> If so, duplicate file from vdpa/include/uapi/linux/vdpa.h should be removed.
> >> So that there is only one vdpa.h file.
> >>
> >> If so, should we move rdma files also similarly?
> >>
> >> Similar discussion came up in the past. (don't have ready reference to the discussion).
> >> And David's input was to keep the way it is like rdma.  
> > 
> > RDMA is different and contained to one directory.
> > VDPA is picking up things from linux/.
> > And the current version is not kept up to date with kernel headers.
> > Fixing that now.  
> 
> Updates to vdpa.h do not go through net-next so moving it to
> include/uapi/linux can cause problems when trying to sync headers to
> net-next commits. That's why it was put under vpda, similar to the rdma
> model.

Ok, will make sure the update script for current picks it up correctly.
diff mbox series

Patch

diff --git a/include/uapi/linux/vdpa.h b/include/uapi/linux/vdpa.h
new file mode 100644
index 000000000000..94e4dad1d86c
--- /dev/null
+++ b/include/uapi/linux/vdpa.h
@@ -0,0 +1,59 @@ 
+/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
+/*
+ * vdpa device management interface
+ * Copyright (c) 2020 Mellanox Technologies Ltd. All rights reserved.
+ */
+
+#ifndef _LINUX_VDPA_H_
+#define _LINUX_VDPA_H_
+
+#define VDPA_GENL_NAME "vdpa"
+#define VDPA_GENL_VERSION 0x1
+
+enum vdpa_command {
+	VDPA_CMD_UNSPEC,
+	VDPA_CMD_MGMTDEV_NEW,
+	VDPA_CMD_MGMTDEV_GET,		/* can dump */
+	VDPA_CMD_DEV_NEW,
+	VDPA_CMD_DEV_DEL,
+	VDPA_CMD_DEV_GET,		/* can dump */
+	VDPA_CMD_DEV_CONFIG_GET,	/* can dump */
+	VDPA_CMD_DEV_VSTATS_GET,
+};
+
+enum vdpa_attr {
+	VDPA_ATTR_UNSPEC,
+
+	/* Pad attribute for 64b alignment */
+	VDPA_ATTR_PAD = VDPA_ATTR_UNSPEC,
+
+	/* bus name (optional) + dev name together make the parent device handle */
+	VDPA_ATTR_MGMTDEV_BUS_NAME,		/* string */
+	VDPA_ATTR_MGMTDEV_DEV_NAME,		/* string */
+	VDPA_ATTR_MGMTDEV_SUPPORTED_CLASSES,	/* u64 */
+
+	VDPA_ATTR_DEV_NAME,			/* string */
+	VDPA_ATTR_DEV_ID,			/* u32 */
+	VDPA_ATTR_DEV_VENDOR_ID,		/* u32 */
+	VDPA_ATTR_DEV_MAX_VQS,			/* u32 */
+	VDPA_ATTR_DEV_MAX_VQ_SIZE,		/* u16 */
+	VDPA_ATTR_DEV_MIN_VQ_SIZE,		/* u16 */
+
+	VDPA_ATTR_DEV_NET_CFG_MACADDR,		/* binary */
+	VDPA_ATTR_DEV_NET_STATUS,		/* u8 */
+	VDPA_ATTR_DEV_NET_CFG_MAX_VQP,		/* u16 */
+	VDPA_ATTR_DEV_NET_CFG_MTU,		/* u16 */
+
+	VDPA_ATTR_DEV_NEGOTIATED_FEATURES,	/* u64 */
+	VDPA_ATTR_DEV_MGMTDEV_MAX_VQS,		/* u32 */
+	VDPA_ATTR_DEV_SUPPORTED_FEATURES,	/* u64 */
+
+	VDPA_ATTR_DEV_QUEUE_INDEX,              /* u32 */
+	VDPA_ATTR_DEV_VENDOR_ATTR_NAME,		/* string */
+	VDPA_ATTR_DEV_VENDOR_ATTR_VALUE,        /* u64 */
+
+	/* new attributes must be added above here */
+	VDPA_ATTR_MAX,
+};
+
+#endif