Skip to contentSkip to conversation

uapi: add vdpa.h

PATCH Applied Stephen Hemminger 4 participants 8 messages Jul 18, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uapi: add vdpa.h

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")
---
 include/uapi/linux/vdpa.h | 59 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 include/uapi/linux/vdpa.h
include/uapi/linux/vdpa.h new file +59 -0
new file mode 100644
index 000000000000..94e4dad1d86c
@@ -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
Signature · 1 line
2.35.1
#1 lore raw
This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Hello:

This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Quoted 8 lines · 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")

[...]

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!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#2 lore raw
Quoted 26 lines

From: [email protected] <patchwork- [email protected]>
Sent: Monday, July 18, 2022 12:40 PM
To: Stephen Hemminger <[email protected]>
Cc: Parav Pandit <[email protected]>; [email protected]
Subject: Re: [PATCH iproute2] uapi: add vdpa.h

Hello:

This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Quoted 8 lines · 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")

[...]

Here is the summary with links:
- [iproute2] uapi: add vdpa.h

Quoted 8 lines

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.

#3 lore raw
In reply to Stephen Hemminger

+ David

Hi Stephen,

include/uapi/linux/vdpa.h

Quoted 19 lines

From: Stephen Hemminger <[email protected]>
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")
---
 include/uapi/linux/vdpa.h | 59
+++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 include/uapi/linux/vdpa.h
include/uapi/linux/vdpa.h new file renamed from include/uapi/linux/vdpa.h +0 -0

mode 100644 index 000000000000..94e4dad1d86c

include/uapi/linux/vdpa.h new file +0 -0

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.

#4 lore raw
Quoted 28 lines · On Mon, 18 Jul 2022 16:40:30 +0000 Parav Pandit <[email protected]> wrote:

+ David

Hi Stephen,

include/uapi/linux/vdpa.h

Quoted 19 lines

From: Stephen Hemminger <[email protected]>
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")
---
 include/uapi/linux/vdpa.h | 59
+++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 include/uapi/linux/vdpa.h
include/uapi/linux/vdpa.h new file renamed from include/uapi/linux/vdpa.h +0 -0

mode 100644 index 000000000000..94e4dad1d86c

include/uapi/linux/vdpa.h new file +0 -0

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.

Quoted 3 lines

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.

#5 lore raw
In reply to Parav Pandit
Quoted 4 lines · On Mon, 18 Jul 2022 16:40:30 +0000 Parav Pandit <[email protected]> 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.

Quoted 8 lines

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.

#6 lore raw
Quoted 13 lines · Stephen Hemminger
Quoted 10 lines · On Mon, 18 Jul 2022 16:40:30 +0000 Parav Pandit <[email protected]> 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?

Quoted 7 lines
Quoted 2 lines

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.

#7 lore raw
Quoted 22 lines · On Mon, 18 Jul 2022 11:51:09 -0600 David Ahern <[email protected]> wrote:
Quoted 13 lines · Stephen Hemminger
Quoted 10 lines · On Mon, 18 Jul 2022 16:40:30 +0000 Parav Pandit <[email protected]> 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?

Quoted 7 lines
Quoted 2 lines

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.

Quoted 4 lines

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.