basic/linux: update kernel headers from v6.12
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 22 Nov 2024 19:33:57 +0000 (04:33 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 23 Nov 2024 08:31:12 +0000 (17:31 +0900)
src/basic/linux/auto_fs.h
src/basic/linux/bpf.h
src/basic/linux/const.h
src/basic/linux/ethtool.h
src/basic/linux/fib_rules.h
src/basic/linux/if_packet.h
src/basic/linux/in.h
src/basic/linux/libc-compat.h
src/basic/linux/netfilter/nf_tables.h
src/basic/linux/nexthop.h

index 623015682a9aeffed8554e9bf4dbc2726bb39792..fedff6e751dd9b434d131b56db2bd0113af291fd 100644 (file)
@@ -21,7 +21,7 @@
 #define AUTOFS_MIN_PROTO_VERSION       3
 #define AUTOFS_MAX_PROTO_VERSION       5
 
-#define AUTOFS_PROTO_SUBVERSION                5
+#define AUTOFS_PROTO_SUBVERSION                6
 
 /*
  * The wait_queue_token (autofs_wqt_t) is part of a structure which is passed
index f4d7e495dd015b902162779ab02437b19cc7dcca..aa381a3d982da5f193c278479f16550647616bd3 100644 (file)
@@ -1121,6 +1121,9 @@ enum bpf_attach_type {
 
 #define MAX_BPF_ATTACH_TYPE __MAX_BPF_ATTACH_TYPE
 
+/* Add BPF_LINK_TYPE(type, name) in bpf_types.h to keep bpf_link_type_strs[]
+ * in sync with the definitions below.
+ */
 enum bpf_link_type {
        BPF_LINK_TYPE_UNSPEC = 0,
        BPF_LINK_TYPE_RAW_TRACEPOINT = 1,
@@ -2851,7 +2854,7 @@ union bpf_attr {
  *               **TCP_SYNCNT**, **TCP_USER_TIMEOUT**, **TCP_NOTSENT_LOWAT**,
  *               **TCP_NODELAY**, **TCP_MAXSEG**, **TCP_WINDOW_CLAMP**,
  *               **TCP_THIN_LINEAR_TIMEOUTS**, **TCP_BPF_DELACK_MAX**,
- *               **TCP_BPF_RTO_MIN**.
+ *               **TCP_BPF_RTO_MIN**, **TCP_BPF_SOCK_OPS_CB_FLAGS**.
  *             * **IPPROTO_IP**, which supports *optname* **IP_TOS**.
  *             * **IPPROTO_IPV6**, which supports the following *optname*\ s:
  *               **IPV6_TCLASS**, **IPV6_AUTOFLOWLABEL**.
@@ -5519,11 +5522,12 @@ union bpf_attr {
  *             **-EOPNOTSUPP** if the hash calculation failed or **-EINVAL** if
  *             invalid arguments are passed.
  *
- * void *bpf_kptr_xchg(void *map_value, void *ptr)
+ * void *bpf_kptr_xchg(void *dst, void *ptr)
  *     Description
- *             Exchange kptr at pointer *map_value* with *ptr*, and return the
- *             old value. *ptr* can be NULL, otherwise it must be a referenced
- *             pointer which will be released when this helper is called.
+ *             Exchange kptr at pointer *dst* with *ptr*, and return the old value.
+ *             *dst* can be map value or local kptr. *ptr* can be NULL, otherwise
+ *             it must be a referenced pointer which will be released when this helper
+ *             is called.
  *     Return
  *             The old value of kptr (which can be NULL). The returned pointer
  *             if not NULL, is a reference which must be released using its
@@ -6046,11 +6050,6 @@ enum {
        BPF_F_MARK_ENFORCE              = (1ULL << 6),
 };
 
-/* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */
-enum {
-       BPF_F_INGRESS                   = (1ULL << 0),
-};
-
 /* BPF_FUNC_skb_set_tunnel_key and BPF_FUNC_skb_get_tunnel_key flags. */
 enum {
        BPF_F_TUNINFO_IPV6              = (1ULL << 0),
@@ -6197,10 +6196,12 @@ enum {
        BPF_F_BPRM_SECUREEXEC   = (1ULL << 0),
 };
 
-/* Flags for bpf_redirect_map helper */
+/* Flags for bpf_redirect and bpf_redirect_map helpers */
 enum {
-       BPF_F_BROADCAST         = (1ULL << 3),
-       BPF_F_EXCLUDE_INGRESS   = (1ULL << 4),
+       BPF_F_INGRESS           = (1ULL << 0), /* used for skb path */
+       BPF_F_BROADCAST         = (1ULL << 3), /* used for XDP path */
+       BPF_F_EXCLUDE_INGRESS   = (1ULL << 4), /* used for XDP path */
+#define BPF_F_REDIRECT_FLAGS (BPF_F_INGRESS | BPF_F_BROADCAST | BPF_F_EXCLUDE_INGRESS)
 };
 
 #define __bpf_md_ptr(type, name)       \
@@ -7080,6 +7081,7 @@ enum {
        TCP_BPF_SYN             = 1005, /* Copy the TCP header */
        TCP_BPF_SYN_IP          = 1006, /* Copy the IP[46] and TCP header */
        TCP_BPF_SYN_MAC         = 1007, /* Copy the MAC, IP[46], and TCP header */
+       TCP_BPF_SOCK_OPS_CB_FLAGS = 1008, /* Get or Set TCP sock ops flags */
 };
 
 enum {
@@ -7512,4 +7514,13 @@ struct bpf_iter_num {
        __u64 __opaque[1];
 } __attribute__((aligned(8)));
 
+/*
+ * Flags to control BPF kfunc behaviour.
+ *     - BPF_F_PAD_ZEROS: Pad destination buffer with zeros. (See the respective
+ *       helper documentation for details.)
+ */
+enum bpf_kfunc_flags {
+       BPF_F_PAD_ZEROS = (1ULL << 0),
+};
+
 #endif /* __LINUX_BPF_H__ */
index 1eb84b5087f8a1d1c1c8f44b5fcc246e04a5a76e..2122610de7f97a8f0129bbd3e6d6f72e4b405414 100644 (file)
 #define _BITUL(x)      (_UL(1) << (x))
 #define _BITULL(x)     (_ULL(1) << (x))
 
+#if !defined(__ASSEMBLY__)
+/*
+ * Missing __asm__ support
+ *
+ * __BIT128() would not work in the __asm__ code, as it shifts an
+ * 'unsigned __init128' data type as direct representation of
+ * 128 bit constants is not supported in the gcc compiler, as
+ * they get silently truncated.
+ *
+ * TODO: Please revisit this implementation when gcc compiler
+ * starts representing 128 bit constants directly like long
+ * and unsigned long etc. Subsequently drop the comment for
+ * GENMASK_U128() which would then start supporting __asm__ code.
+ */
+#define _BIT128(x)     ((unsigned __int128)(1) << (x))
+#endif
+
 #define __ALIGN_KERNEL(x, a)           __ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1)
 #define __ALIGN_KERNEL_MASK(x, mask)   (((x) + (mask)) & ~(mask))
 
index 5aa2ae0a4bb679c9ae202c28b0129df57a43bcc2..a32293ba206ee3c0b4fc79449f804e2eafd1e42c 100644 (file)
@@ -2531,4 +2531,20 @@ struct ethtool_link_settings {
         * __u32 map_lp_advertising[link_mode_masks_nwords];
         */
 };
+
+/**
+ * enum phy_upstream - Represents the upstream component a given PHY device
+ * is connected to, as in what is on the other end of the MII bus. Most PHYs
+ * will be attached to an Ethernet MAC controller, but in some cases, there's
+ * an intermediate PHY used as a media-converter, which will driver another
+ * MII interface as its output.
+ * @PHY_UPSTREAM_MAC: Upstream component is a MAC (a switch port,
+ *                   or ethernet controller)
+ * @PHY_UPSTREAM_PHY: Upstream component is a PHY (likely a media converter)
+ */
+enum phy_upstream {
+       PHY_UPSTREAM_MAC,
+       PHY_UPSTREAM_PHY,
+};
+
 #endif /* _LINUX_ETHTOOL_H */
index 232df14e1287a3297716f0c16a0632194a189d50..a6924dd3aff1701fe0d30d7bdea8a0b4997a9c69 100644 (file)
@@ -67,6 +67,7 @@ enum {
        FRA_IP_PROTO,   /* ip proto */
        FRA_SPORT_RANGE, /* sport */
        FRA_DPORT_RANGE, /* dport */
+       FRA_DSCP,       /* dscp */
        __FRA_MAX
 };
 
index 9efc42382fdb98f9e9b5470ae2a66ccf4d0ba4e1..1d2718dd9647254e9a9488b27c0d50caff8b924e 100644 (file)
@@ -230,8 +230,8 @@ struct tpacket_hdr_v1 {
         * ts_first_pkt:
         *              Is always the time-stamp when the block was opened.
         *              Case a) ZERO packets
-        *                      No packets to deal with but atleast you know the
-        *                      time-interval of this block.
+        *                      No packets to deal with but at least you know
+        *                      the time-interval of this block.
         *              Case b) Non-zero packets
         *                      Use the ts of the first packet in the block.
         *
@@ -265,7 +265,8 @@ enum tpacket_versions {
    - struct tpacket_hdr
    - pad to TPACKET_ALIGNMENT=16
    - struct sockaddr_ll
-   - Gap, chosen so that packet data (Start+tp_net) alignes to TPACKET_ALIGNMENT=16
+   - Gap, chosen so that packet data (Start+tp_net) aligns to
+     TPACKET_ALIGNMENT=16
    - Start+tp_mac: [ Optional MAC header ]
    - Start+tp_net: Packet data, aligned to TPACKET_ALIGNMENT=16.
    - Pad to align to TPACKET_ALIGNMENT=16
index 43cfcb010ccf52ebded9891826285c4ad5ccd8cc..a7d41bb6c68736cc53f258dc82456a64dd708eaa 100644 (file)
@@ -141,7 +141,7 @@ struct in_addr {
  */
 #define IP_PMTUDISC_INTERFACE          4
 /* weaker version of IP_PMTUDISC_INTERFACE, which allows packets to get
- * fragmented if they exeed the interface mtu
+ * fragmented if they exceed the interface mtu
  */
 #define IP_PMTUDISC_OMIT               5
 
index a1599911e7a942322aed41c6aa730caaa66075e9..e25cd3f486328ea7961d925fadf395f1fe13464e 100644 (file)
 
 #endif /* _NETINET_IN_H */
 
-/* Coordinate with glibc netipx/ipx.h header. */
-#if defined(__NETIPX_IPX_H)
-
-#define __UAPI_DEF_SOCKADDR_IPX                        0
-#define __UAPI_DEF_IPX_ROUTE_DEFINITION                0
-#define __UAPI_DEF_IPX_INTERFACE_DEFINITION    0
-#define __UAPI_DEF_IPX_CONFIG_DATA             0
-#define __UAPI_DEF_IPX_ROUTE_DEF               0
-
-#else /* defined(__NETIPX_IPX_H) */
-
-#define __UAPI_DEF_SOCKADDR_IPX                        1
-#define __UAPI_DEF_IPX_ROUTE_DEFINITION                1
-#define __UAPI_DEF_IPX_INTERFACE_DEFINITION    1
-#define __UAPI_DEF_IPX_CONFIG_DATA             1
-#define __UAPI_DEF_IPX_ROUTE_DEF               1
-
-#endif /* defined(__NETIPX_IPX_H) */
-
 /* Definitions for xattr.h */
 #if defined(_SYS_XATTR_H)
 #define __UAPI_DEF_XATTR               0
 #define __UAPI_DEF_IP6_MTUINFO         1
 #endif
 
-/* Definitions for ipx.h */
-#ifndef __UAPI_DEF_SOCKADDR_IPX
-#define __UAPI_DEF_SOCKADDR_IPX                        1
-#endif
-#ifndef __UAPI_DEF_IPX_ROUTE_DEFINITION
-#define __UAPI_DEF_IPX_ROUTE_DEFINITION                1
-#endif
-#ifndef __UAPI_DEF_IPX_INTERFACE_DEFINITION
-#define __UAPI_DEF_IPX_INTERFACE_DEFINITION    1
-#endif
-#ifndef __UAPI_DEF_IPX_CONFIG_DATA
-#define __UAPI_DEF_IPX_CONFIG_DATA             1
-#endif
-#ifndef __UAPI_DEF_IPX_ROUTE_DEF
-#define __UAPI_DEF_IPX_ROUTE_DEF               1
-#endif
-
 /* Definitions for xattr.h */
 #ifndef __UAPI_DEF_XATTR
 #define __UAPI_DEF_XATTR               1
index 639894ed1b9732b95dc263cc0526ce5325e401a2..9e9079321380ab7a302338d590309a0b6982c060 100644 (file)
@@ -436,7 +436,7 @@ enum nft_set_elem_flags {
  * @NFTA_SET_ELEM_KEY: key value (NLA_NESTED: nft_data)
  * @NFTA_SET_ELEM_DATA: data value of mapping (NLA_NESTED: nft_data_attributes)
  * @NFTA_SET_ELEM_FLAGS: bitmask of nft_set_elem_flags (NLA_U32)
- * @NFTA_SET_ELEM_TIMEOUT: timeout value (NLA_U64)
+ * @NFTA_SET_ELEM_TIMEOUT: timeout value, zero means never times out (NLA_U64)
  * @NFTA_SET_ELEM_EXPIRATION: expiration time (NLA_U64)
  * @NFTA_SET_ELEM_USERDATA: user data (NLA_BINARY)
  * @NFTA_SET_ELEM_EXPR: expression (NLA_NESTED: nft_expr_attributes)
@@ -1694,7 +1694,7 @@ enum nft_flowtable_flags {
  *
  * @NFTA_FLOWTABLE_TABLE: name of the table containing the expression (NLA_STRING)
  * @NFTA_FLOWTABLE_NAME: name of this flow table (NLA_STRING)
- * @NFTA_FLOWTABLE_HOOK: netfilter hook configuration(NLA_U32)
+ * @NFTA_FLOWTABLE_HOOK: netfilter hook configuration (NLA_NESTED)
  * @NFTA_FLOWTABLE_USE: number of references to this flow table (NLA_U32)
  * @NFTA_FLOWTABLE_HANDLE: object handle (NLA_U64)
  * @NFTA_FLOWTABLE_FLAGS: flags (NLA_U32)
index 7e340bec94f2753a853eaefd9fe3238d0404e58c..afbd064f8fd6dc8e948b22201d38595cf4c5eeb8 100644 (file)
@@ -16,10 +16,15 @@ struct nhmsg {
 struct nexthop_grp {
        __u32   id;       /* nexthop id - must exist */
        __u8    weight;   /* weight of this nexthop */
-       __u8    resvd1;
+       __u8    weight_high;    /* high order bits of weight */
        __u16   resvd2;
 };
 
+static __inline__ __u16 nexthop_grp_weight(const struct nexthop_grp *entry)
+{
+       return ((entry->weight_high << 8) | entry->weight) + 1;
+}
+
 enum {
        NEXTHOP_GRP_TYPE_MPATH,  /* hash-threshold nexthop group
                                  * default type if not specified
@@ -33,6 +38,9 @@ enum {
 #define NHA_OP_FLAG_DUMP_STATS         BIT(0)
 #define NHA_OP_FLAG_DUMP_HW_STATS      BIT(1)
 
+/* Response OP_FLAGS. */
+#define NHA_OP_FLAG_RESP_GRP_RESVD_0   BIT(31) /* Dump clears resvd fields. */
+
 enum {
        NHA_UNSPEC,
        NHA_ID,         /* u32; id for nexthop. id == 0 means auto-assign */