Describe the veth attributes in rt-link.yaml, so that YNL can set and read them. The next patch uses them to test VETH_INFO_TX_EXTRA_HEADROOM. YNL includes linux/veth.h from the source tree with get_hdr_inc, which needs the source header guard to differ from the installed one. Prefix the guard with _UAPI, as commit 8066e388be48 ("net: add UAPI to the header guard in various network headers") did for other network headers. headers_install strips the prefix, so the installed header does not change. Signed-off-by: Tianyi Gao --- v2: - New patch. --- Documentation/netlink/specs/rt-link.yaml | 14 ++++++++++++++ include/uapi/linux/veth.h | 4 ++-- tools/net/ynl/Makefile.deps | 3 ++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Documentation/netlink/specs/rt-link.yaml b/Documentation/netlink/specs/rt-link.yaml index 81b58633911d..36dece251778 100644 --- a/Documentation/netlink/specs/rt-link.yaml +++ b/Documentation/netlink/specs/rt-link.yaml @@ -2368,6 +2368,17 @@ attribute-sets: name: mode type: u8 enum: ovpn-mode + - + name: linkinfo-veth-attrs + name-prefix: veth-info- + header: linux/veth.h + attributes: + - + name: peer + type: binary + - + name: tx-extra-headroom + type: uint sub-messages: - @@ -2427,6 +2438,9 @@ sub-messages: - value: ovpn attribute-set: linkinfo-ovpn-attrs + - + value: veth + attribute-set: linkinfo-veth-attrs - name: linkinfo-member-data-msg formats: diff --git a/include/uapi/linux/veth.h b/include/uapi/linux/veth.h index 04cb408e5b3a..d22a29b1bbb2 100644 --- a/include/uapi/linux/veth.h +++ b/include/uapi/linux/veth.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef __NET_VETH_H_ -#define __NET_VETH_H_ +#ifndef _UAPI__NET_VETH_H_ +#define _UAPI__NET_VETH_H_ enum { VETH_INFO_UNSPEC, diff --git a/tools/net/ynl/Makefile.deps b/tools/net/ynl/Makefile.deps index f8850444d240..39abd83c014f 100644 --- a/tools/net/ynl/Makefile.deps +++ b/tools/net/ynl/Makefile.deps @@ -43,7 +43,8 @@ CFLAGS_psp:=$(call get_hdr_inc,_LINUX_PSP_H,psp.h) CFLAGS_rt-addr:=$(call get_hdr_inc,__LINUX_RTNETLINK_H,rtnetlink.h) \ $(call get_hdr_inc,__LINUX_IF_ADDR_H,if_addr.h) CFLAGS_rt-link:=$(call get_hdr_inc,__LINUX_RTNETLINK_H,rtnetlink.h) \ - $(call get_hdr_inc,_LINUX_IF_LINK_H,if_link.h) + $(call get_hdr_inc,_LINUX_IF_LINK_H,if_link.h) \ + $(call get_hdr_inc,__NET_VETH_H_,veth.h) CFLAGS_rt-neigh:=$(call get_hdr_inc,__LINUX_RTNETLINK_H,rtnetlink.h) \ $(call get_hdr_inc,__LINUX_NEIGHBOUR_H,neighbour.h) CFLAGS_rt-nexthop:=$(call get_hdr_inc,__LINUX_RTNETLINK_H,rtnetlink.h) \ -- 2.56.0