diff mbox series

[iproute2] uapi: add missing virtio related headers

Message ID 20210423174011.11309-1-stephen@networkplumber.org (mailing list archive)
State Accepted
Commit b5a6ed9cc9fc15df13d07fe6b2dcc58942d89a2a
Delegated to: David Ahern
Headers show
Series [iproute2] uapi: add missing virtio related headers | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Stephen Hemminger April 23, 2021, 5:40 p.m. UTC
The build of iproute2 relies on having correct copy of santized
kernel headers. The vdpa utility introduced a dependency on
the vdpa related headers, but these headers were not present
in iproute2 repo.

Fixes: c2ecc82b9d4c ("vdpa: Add vdpa tool")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 include/uapi/linux/vdpa.h       | 40 +++++++++++++++++++++++
 include/uapi/linux/virtio_ids.h | 58 +++++++++++++++++++++++++++++++++
 2 files changed, 98 insertions(+)
 create mode 100644 include/uapi/linux/vdpa.h
 create mode 100644 include/uapi/linux/virtio_ids.h

Comments

patchwork-bot+netdevbpf@kernel.org April 23, 2021, 5:50 p.m. UTC | #1
Hello:

This patch was applied to iproute2/iproute2.git (refs/heads/main):

On Fri, 23 Apr 2021 10:40:11 -0700 you wrote:
> The build of iproute2 relies on having correct copy of santized
> kernel headers. The vdpa utility introduced a dependency on
> the vdpa related headers, but these headers were not present
> in iproute2 repo.
> 
> Fixes: c2ecc82b9d4c ("vdpa: Add vdpa tool")
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> 
> [...]

Here is the summary with links:
  - [iproute2] uapi: add missing virtio related headers
    https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=b5a6ed9cc9fc

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Parav Pandit June 9, 2021, 5:15 a.m. UTC | #2
Hi Stephen,

vdpa headers were present in commit c2ecc82b9d4c at [1].

I added them at [1] after David's recommendation in [2].

Should we remove [1]?
Did you face compilation problem without this fix?

[1] ./vdpa/include/uapi/linux/vdpa.h
[2] https://lore.kernel.org/netdev/abc71731-012e-eaa4-0274-5347fc99c249@gmail.com/

Parav

> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Friday, April 23, 2021 11:10 PM
> 
> The build of iproute2 relies on having correct copy of santized kernel
> headers. The vdpa utility introduced a dependency on the vdpa related
> headers, but these headers were not present in iproute2 repo.
> 
> Fixes: c2ecc82b9d4c ("vdpa: Add vdpa tool")
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  include/uapi/linux/vdpa.h       | 40 +++++++++++++++++++++++
>  include/uapi/linux/virtio_ids.h | 58
> +++++++++++++++++++++++++++++++++
>  2 files changed, 98 insertions(+)
>  create mode 100644 include/uapi/linux/vdpa.h  create mode 100644
> include/uapi/linux/virtio_ids.h
> 
> diff --git a/include/uapi/linux/vdpa.h b/include/uapi/linux/vdpa.h new file
> mode 100644 index 000000000000..37ae26b6ba26
> --- /dev/null
> +++ b/include/uapi/linux/vdpa.h
> @@ -0,0 +1,40 @@
> +/* 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 */
> +};
> +
> +enum vdpa_attr {
> +	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 */
> +
> +	/* new attributes must be added above here */
> +	VDPA_ATTR_MAX,
> +};
> +
> +#endif
> diff --git a/include/uapi/linux/virtio_ids.h b/include/uapi/linux/virtio_ids.h
> new file mode 100644 index 000000000000..bc1c0621f5ed
> --- /dev/null
> +++ b/include/uapi/linux/virtio_ids.h
> @@ -0,0 +1,58 @@
> +#ifndef _LINUX_VIRTIO_IDS_H
> +#define _LINUX_VIRTIO_IDS_H
> +/*
> + * Virtio IDs
> + *
> + * This header is BSD licensed so anyone can use the definitions to
> +implement
> + * compatible drivers/servers.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + *    notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + *    notice, this list of conditions and the following disclaimer in the
> + *    documentation and/or other materials provided with the distribution.
> + * 3. Neither the name of IBM nor the names of its contributors
> + *    may be used to endorse or promote products derived from this
> software
> + *    without specific prior written permission.
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
> CONTRIBUTORS
> +``AS IS'' AND
> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
> TO,
> +THE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
> PARTICULAR
> +PURPOSE
> + * ARE DISCLAIMED.  IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
> +CONSEQUENTIAL
> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
> SUBSTITUTE
> +GOODS
> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
> +INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
> CONTRACT,
> +STRICT
> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
> IN
> +ANY WAY
> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
> POSSIBILITY
> +OF
> + * SUCH DAMAGE. */
> +
> +#define VIRTIO_ID_NET			1 /* virtio net */
> +#define VIRTIO_ID_BLOCK			2 /* virtio block */
> +#define VIRTIO_ID_CONSOLE		3 /* virtio console */
> +#define VIRTIO_ID_RNG			4 /* virtio rng */
> +#define VIRTIO_ID_BALLOON		5 /* virtio balloon */
> +#define VIRTIO_ID_IOMEM			6 /* virtio ioMemory */
> +#define VIRTIO_ID_RPMSG			7 /* virtio remote processor
> messaging */
> +#define VIRTIO_ID_SCSI			8 /* virtio scsi */
> +#define VIRTIO_ID_9P			9 /* 9p virtio console */
> +#define VIRTIO_ID_MAC80211_WLAN		10 /* virtio WLAN
> MAC */
> +#define VIRTIO_ID_RPROC_SERIAL		11 /* virtio remoteproc serial
> link */
> +#define VIRTIO_ID_CAIF			12 /* Virtio caif */
> +#define VIRTIO_ID_MEMORY_BALLOON	13 /* virtio memory balloon
> */
> +#define VIRTIO_ID_GPU			16 /* virtio GPU */
> +#define VIRTIO_ID_CLOCK			17 /* virtio clock/timer */
> +#define VIRTIO_ID_INPUT			18 /* virtio input */
> +#define VIRTIO_ID_VSOCK			19 /* virtio vsock transport */
> +#define VIRTIO_ID_CRYPTO		20 /* virtio crypto */
> +#define VIRTIO_ID_SIGNAL_DIST		21 /* virtio signal distribution
> device */
> +#define VIRTIO_ID_PSTORE		22 /* virtio pstore device */
> +#define VIRTIO_ID_IOMMU			23 /* virtio IOMMU */
> +#define VIRTIO_ID_MEM			24 /* virtio mem */
> +#define VIRTIO_ID_FS			26 /* virtio filesystem */
> +#define VIRTIO_ID_PMEM			27 /* virtio pmem */
> +#define VIRTIO_ID_MAC80211_HWSIM	29 /* virtio mac80211-hwsim
> */
> +
> +#endif /* _LINUX_VIRTIO_IDS_H */
> --
> 2.30.2
David Ahern June 11, 2021, 2:54 a.m. UTC | #3
On 6/8/21 11:15 PM, Parav Pandit wrote:
> Hi Stephen,
> 
> vdpa headers were present in commit c2ecc82b9d4c at [1].
> 
> I added them at [1] after David's recommendation in [2].
> 
> Should we remove [1]?
> Did you face compilation problem without this fix?
> 
> [1] ./vdpa/include/uapi/linux/vdpa.h
> [2] https://lore.kernel.org/netdev/abc71731-012e-eaa4-0274-5347fc99c249@gmail.com/
> 
> Parav

Stephen: Did you hit a compile issue? vdpa goes beyond networking and
features go through other trees AIUI so the decision was to put the uapi
file under the vdpa command similar to what rdma is doing.
Stephen Hemminger June 11, 2021, 4:21 p.m. UTC | #4
On Thu, 10 Jun 2021 20:54:45 -0600
David Ahern <dsahern@gmail.com> wrote:

> On 6/8/21 11:15 PM, Parav Pandit wrote:
> > Hi Stephen,
> > 
> > vdpa headers were present in commit c2ecc82b9d4c at [1].
> > 
> > I added them at [1] after David's recommendation in [2].
> > 
> > Should we remove [1]?
> > Did you face compilation problem without this fix?
> > 
> > [1] ./vdpa/include/uapi/linux/vdpa.h
> > [2] https://lore.kernel.org/netdev/abc71731-012e-eaa4-0274-5347fc99c249@gmail.com/
> > 
> > Parav  
> 
> Stephen: Did you hit a compile issue? vdpa goes beyond networking and
> features go through other trees AIUI so the decision was to put the uapi
> file under the vdpa command similar to what rdma is doing.
> 

In iproute2, all kernel headers used during the build should come from include/uapi.
If new command or function needs a new header, then the sanitized version should be
included.

I update these with an automated script, and making special case for vdpa
seems to be needless effort. Please just let iproute's include/uapi just be
a copy of what kernel "make install_headers" generates.
David Ahern June 15, 2021, 1:03 a.m. UTC | #5
On 6/11/21 10:21 AM, Stephen Hemminger wrote:
> On Thu, 10 Jun 2021 20:54:45 -0600
> David Ahern <dsahern@gmail.com> wrote:
> 
>> On 6/8/21 11:15 PM, Parav Pandit wrote:
>>> Hi Stephen,
>>>
>>> vdpa headers were present in commit c2ecc82b9d4c at [1].
>>>
>>> I added them at [1] after David's recommendation in [2].
>>>
>>> Should we remove [1]?
>>> Did you face compilation problem without this fix?
>>>
>>> [1] ./vdpa/include/uapi/linux/vdpa.h
>>> [2] https://lore.kernel.org/netdev/abc71731-012e-eaa4-0274-5347fc99c249@gmail.com/
>>>
>>> Parav  
>>
>> Stephen: Did you hit a compile issue? vdpa goes beyond networking and
>> features go through other trees AIUI so the decision was to put the uapi
>> file under the vdpa command similar to what rdma is doing.
>>
> 
> In iproute2, all kernel headers used during the build should come from include/uapi.
> If new command or function needs a new header, then the sanitized version should be
> included.
> 
> I update these with an automated script, and making special case for vdpa
> seems to be needless effort. Please just let iproute's include/uapi just be
> a copy of what kernel "make install_headers" generates.
> 

an exception was made for rdma because of the order in which uapi
updates hit the net-next tree. The same exception was being made for
vdpa for the same reason.
Leon Romanovsky June 15, 2021, 6:13 a.m. UTC | #6
On Mon, Jun 14, 2021 at 07:03:36PM -0600, David Ahern wrote:
> On 6/11/21 10:21 AM, Stephen Hemminger wrote:
> > On Thu, 10 Jun 2021 20:54:45 -0600
> > David Ahern <dsahern@gmail.com> wrote:
> > 
> >> On 6/8/21 11:15 PM, Parav Pandit wrote:
> >>> Hi Stephen,
> >>>
> >>> vdpa headers were present in commit c2ecc82b9d4c at [1].
> >>>
> >>> I added them at [1] after David's recommendation in [2].
> >>>
> >>> Should we remove [1]?
> >>> Did you face compilation problem without this fix?
> >>>
> >>> [1] ./vdpa/include/uapi/linux/vdpa.h
> >>> [2] https://lore.kernel.org/netdev/abc71731-012e-eaa4-0274-5347fc99c249@gmail.com/
> >>>
> >>> Parav  
> >>
> >> Stephen: Did you hit a compile issue? vdpa goes beyond networking and
> >> features go through other trees AIUI so the decision was to put the uapi
> >> file under the vdpa command similar to what rdma is doing.
> >>
> > 
> > In iproute2, all kernel headers used during the build should come from include/uapi.
> > If new command or function needs a new header, then the sanitized version should be
> > included.
> > 
> > I update these with an automated script, and making special case for vdpa
> > seems to be needless effort. Please just let iproute's include/uapi just be
> > a copy of what kernel "make install_headers" generates.
> > 
> 
> an exception was made for rdma because of the order in which uapi
> updates hit the net-next tree. The same exception was being made for
> vdpa for the same reason.

Right, and almost all RDMA features are accompanied by the commit like
this which brings headers cycle earlier than they will appear in net-next.

commit 212e2c1d0cb27f0d1f87b9cc6454b8afbeb2d467
Author: Gal Pressman <galpress@amazon.com>
Date:   Thu Apr 29 09:48:02 2021 +0300

    rdma: update uapi headers

    Update rdma_netlink.h file upto kernel commit
    6cc9e215eb27 ("RDMA/nldev: Add copy-on-fork attribute to get sys command")

    Signed-off-by: Gal Pressman <galpress@amazon.com>
    Acked-by: Leon Romanovsky <leonro@nvidia.com>
    Signed-off-by: David Ahern <dsahern@kernel.org>
diff mbox series

Patch

diff --git a/include/uapi/linux/vdpa.h b/include/uapi/linux/vdpa.h
new file mode 100644
index 000000000000..37ae26b6ba26
--- /dev/null
+++ b/include/uapi/linux/vdpa.h
@@ -0,0 +1,40 @@ 
+/* 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 */
+};
+
+enum vdpa_attr {
+	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 */
+
+	/* new attributes must be added above here */
+	VDPA_ATTR_MAX,
+};
+
+#endif
diff --git a/include/uapi/linux/virtio_ids.h b/include/uapi/linux/virtio_ids.h
new file mode 100644
index 000000000000..bc1c0621f5ed
--- /dev/null
+++ b/include/uapi/linux/virtio_ids.h
@@ -0,0 +1,58 @@ 
+#ifndef _LINUX_VIRTIO_IDS_H
+#define _LINUX_VIRTIO_IDS_H
+/*
+ * Virtio IDs
+ *
+ * This header is BSD licensed so anyone can use the definitions to implement
+ * compatible drivers/servers.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of IBM nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE. */
+
+#define VIRTIO_ID_NET			1 /* virtio net */
+#define VIRTIO_ID_BLOCK			2 /* virtio block */
+#define VIRTIO_ID_CONSOLE		3 /* virtio console */
+#define VIRTIO_ID_RNG			4 /* virtio rng */
+#define VIRTIO_ID_BALLOON		5 /* virtio balloon */
+#define VIRTIO_ID_IOMEM			6 /* virtio ioMemory */
+#define VIRTIO_ID_RPMSG			7 /* virtio remote processor messaging */
+#define VIRTIO_ID_SCSI			8 /* virtio scsi */
+#define VIRTIO_ID_9P			9 /* 9p virtio console */
+#define VIRTIO_ID_MAC80211_WLAN		10 /* virtio WLAN MAC */
+#define VIRTIO_ID_RPROC_SERIAL		11 /* virtio remoteproc serial link */
+#define VIRTIO_ID_CAIF			12 /* Virtio caif */
+#define VIRTIO_ID_MEMORY_BALLOON	13 /* virtio memory balloon */
+#define VIRTIO_ID_GPU			16 /* virtio GPU */
+#define VIRTIO_ID_CLOCK			17 /* virtio clock/timer */
+#define VIRTIO_ID_INPUT			18 /* virtio input */
+#define VIRTIO_ID_VSOCK			19 /* virtio vsock transport */
+#define VIRTIO_ID_CRYPTO		20 /* virtio crypto */
+#define VIRTIO_ID_SIGNAL_DIST		21 /* virtio signal distribution device */
+#define VIRTIO_ID_PSTORE		22 /* virtio pstore device */
+#define VIRTIO_ID_IOMMU			23 /* virtio IOMMU */
+#define VIRTIO_ID_MEM			24 /* virtio mem */
+#define VIRTIO_ID_FS			26 /* virtio filesystem */
+#define VIRTIO_ID_PMEM			27 /* virtio pmem */
+#define VIRTIO_ID_MAC80211_HWSIM	29 /* virtio mac80211-hwsim */
+
+#endif /* _LINUX_VIRTIO_IDS_H */