]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic/linux: update kernel headers
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 3 Dec 2020 02:07:52 +0000 (11:07 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 3 Dec 2020 02:20:59 +0000 (11:20 +0900)
From kernel commit 34816d20f173a90389c8a7e641166d8ea9dce70a.

src/basic/linux/btrfs_tree.h
src/basic/linux/if_bridge.h
src/basic/linux/if_link.h
src/basic/linux/l2tp.h
src/basic/linux/loadavg.h
src/basic/linux/netlink.h
src/basic/linux/update.sh

index 9ba64ca6b4ac953310d014ef9d4e3e6719f258b0..6b885982ece68775a97941b5b495d5b551609d2e 100644 (file)
@@ -4,6 +4,11 @@
 
 #include <linux/btrfs.h>
 #include <linux/types.h>
+#ifdef __KERNEL__
+#include <linux/stddef.h>
+#else
+#include <stddef.h>
+#endif
 
 /*
  * This header contains the structure definitions and constants used
@@ -644,6 +649,15 @@ struct btrfs_root_item {
        __le64 reserved[8]; /* for future */
 } __attribute__ ((__packed__));
 
+/*
+ * Btrfs root item used to be smaller than current size.  The old format ends
+ * at where member generation_v2 is.
+ */
+static inline __u32 btrfs_legacy_root_item_size(void)
+{
+       return offsetof(struct btrfs_root_item, generation_v2);
+}
+
 /*
  * this is used for both forward and backward root refs
  */
index c1227aecd38fd7aa5b903a61b65be7342bf2fab0..4c687686aa8f73f8429346208a7223cf6febed54 100644 (file)
@@ -455,10 +455,33 @@ enum {
 enum {
        MDBA_MDB_EATTR_UNSPEC,
        MDBA_MDB_EATTR_TIMER,
+       MDBA_MDB_EATTR_SRC_LIST,
+       MDBA_MDB_EATTR_GROUP_MODE,
+       MDBA_MDB_EATTR_SOURCE,
+       MDBA_MDB_EATTR_RTPROT,
        __MDBA_MDB_EATTR_MAX
 };
 #define MDBA_MDB_EATTR_MAX (__MDBA_MDB_EATTR_MAX - 1)
 
+/* per mdb entry source */
+enum {
+       MDBA_MDB_SRCLIST_UNSPEC,
+       MDBA_MDB_SRCLIST_ENTRY,
+       __MDBA_MDB_SRCLIST_MAX
+};
+#define MDBA_MDB_SRCLIST_MAX (__MDBA_MDB_SRCLIST_MAX - 1)
+
+/* per mdb entry per source attributes
+ * these are embedded in MDBA_MDB_SRCLIST_ENTRY
+ */
+enum {
+       MDBA_MDB_SRCATTR_UNSPEC,
+       MDBA_MDB_SRCATTR_ADDRESS,
+       MDBA_MDB_SRCATTR_TIMER,
+       __MDBA_MDB_SRCATTR_MAX
+};
+#define MDBA_MDB_SRCATTR_MAX (__MDBA_MDB_SRCATTR_MAX - 1)
+
 /* multicast router types */
 enum {
        MDB_RTR_TYPE_DISABLED,
@@ -495,6 +518,8 @@ struct br_mdb_entry {
        __u8 state;
 #define MDB_FLAGS_OFFLOAD      (1 << 0)
 #define MDB_FLAGS_FAST_LEAVE   (1 << 1)
+#define MDB_FLAGS_STAR_EXCL    (1 << 2)
+#define MDB_FLAGS_BLOCKED      (1 << 3)
        __u8 flags;
        __u16 vid;
        struct {
@@ -509,10 +534,23 @@ struct br_mdb_entry {
 enum {
        MDBA_SET_ENTRY_UNSPEC,
        MDBA_SET_ENTRY,
+       MDBA_SET_ENTRY_ATTRS,
        __MDBA_SET_ENTRY_MAX,
 };
 #define MDBA_SET_ENTRY_MAX (__MDBA_SET_ENTRY_MAX - 1)
 
+/* [MDBA_SET_ENTRY_ATTRS] = {
+ *    [MDBE_ATTR_xxx]
+ *    ...
+ * }
+ */
+enum {
+       MDBE_ATTR_UNSPEC,
+       MDBE_ATTR_SOURCE,
+       __MDBE_ATTR_MAX,
+};
+#define MDBE_ATTR_MAX (__MDBE_ATTR_MAX - 1)
+
 /* Embedded inside LINK_XSTATS_TYPE_BRIDGE */
 enum {
        BRIDGE_XSTATS_UNSPEC,
index 7fba4de511dec7e3877244f625f2a59b91b601b7..c4b23f06f69e0f503585c99d422969086821ce2d 100644 (file)
@@ -7,24 +7,23 @@
 
 /* This struct should be in sync with struct rtnl_link_stats64 */
 struct rtnl_link_stats {
-       __u32   rx_packets;             /* total packets received       */
-       __u32   tx_packets;             /* total packets transmitted    */
-       __u32   rx_bytes;               /* total bytes received         */
-       __u32   tx_bytes;               /* total bytes transmitted      */
-       __u32   rx_errors;              /* bad packets received         */
-       __u32   tx_errors;              /* packet transmit problems     */
-       __u32   rx_dropped;             /* no space in linux buffers    */
-       __u32   tx_dropped;             /* no space available in linux  */
-       __u32   multicast;              /* multicast packets received   */
+       __u32   rx_packets;
+       __u32   tx_packets;
+       __u32   rx_bytes;
+       __u32   tx_bytes;
+       __u32   rx_errors;
+       __u32   tx_errors;
+       __u32   rx_dropped;
+       __u32   tx_dropped;
+       __u32   multicast;
        __u32   collisions;
-
        /* detailed rx_errors: */
        __u32   rx_length_errors;
-       __u32   rx_over_errors;         /* receiver ring buff overflow  */
-       __u32   rx_crc_errors;          /* recved pkt with crc error    */
-       __u32   rx_frame_errors;        /* recv'd frame alignment error */
-       __u32   rx_fifo_errors;         /* recv'r fifo overrun          */
-       __u32   rx_missed_errors;       /* receiver missed packet       */
+       __u32   rx_over_errors;
+       __u32   rx_crc_errors;
+       __u32   rx_frame_errors;
+       __u32   rx_fifo_errors;
+       __u32   rx_missed_errors;
 
        /* detailed tx_errors */
        __u32   tx_aborted_errors;
@@ -37,29 +36,200 @@ struct rtnl_link_stats {
        __u32   rx_compressed;
        __u32   tx_compressed;
 
-       __u32   rx_nohandler;           /* dropped, no handler found    */
+       __u32   rx_nohandler;
 };
 
-/* The main device statistics structure */
+/**
+ * struct rtnl_link_stats64 - The main device statistics structure.
+ *
+ * @rx_packets: Number of good packets received by the interface.
+ *   For hardware interfaces counts all good packets received from the device
+ *   by the host, including packets which host had to drop at various stages
+ *   of processing (even in the driver).
+ *
+ * @tx_packets: Number of packets successfully transmitted.
+ *   For hardware interfaces counts packets which host was able to successfully
+ *   hand over to the device, which does not necessarily mean that packets
+ *   had been successfully transmitted out of the device, only that device
+ *   acknowledged it copied them out of host memory.
+ *
+ * @rx_bytes: Number of good received bytes, corresponding to @rx_packets.
+ *
+ *   For IEEE 802.3 devices should count the length of Ethernet Frames
+ *   excluding the FCS.
+ *
+ * @tx_bytes: Number of good transmitted bytes, corresponding to @tx_packets.
+ *
+ *   For IEEE 802.3 devices should count the length of Ethernet Frames
+ *   excluding the FCS.
+ *
+ * @rx_errors: Total number of bad packets received on this network device.
+ *   This counter must include events counted by @rx_length_errors,
+ *   @rx_crc_errors, @rx_frame_errors and other errors not otherwise
+ *   counted.
+ *
+ * @tx_errors: Total number of transmit problems.
+ *   This counter must include events counter by @tx_aborted_errors,
+ *   @tx_carrier_errors, @tx_fifo_errors, @tx_heartbeat_errors,
+ *   @tx_window_errors and other errors not otherwise counted.
+ *
+ * @rx_dropped: Number of packets received but not processed,
+ *   e.g. due to lack of resources or unsupported protocol.
+ *   For hardware interfaces this counter should not include packets
+ *   dropped by the device which are counted separately in
+ *   @rx_missed_errors (since procfs folds those two counters together).
+ *
+ * @tx_dropped: Number of packets dropped on their way to transmission,
+ *   e.g. due to lack of resources.
+ *
+ * @multicast: Multicast packets received.
+ *   For hardware interfaces this statistic is commonly calculated
+ *   at the device level (unlike @rx_packets) and therefore may include
+ *   packets which did not reach the host.
+ *
+ *   For IEEE 802.3 devices this counter may be equivalent to:
+ *
+ *    - 30.3.1.1.21 aMulticastFramesReceivedOK
+ *
+ * @collisions: Number of collisions during packet transmissions.
+ *
+ * @rx_length_errors: Number of packets dropped due to invalid length.
+ *   Part of aggregate "frame" errors in `/proc/net/dev`.
+ *
+ *   For IEEE 802.3 devices this counter should be equivalent to a sum
+ *   of the following attributes:
+ *
+ *    - 30.3.1.1.23 aInRangeLengthErrors
+ *    - 30.3.1.1.24 aOutOfRangeLengthField
+ *    - 30.3.1.1.25 aFrameTooLongErrors
+ *
+ * @rx_over_errors: Receiver FIFO overflow event counter.
+ *
+ *   Historically the count of overflow events. Such events may be
+ *   reported in the receive descriptors or via interrupts, and may
+ *   not correspond one-to-one with dropped packets.
+ *
+ *   The recommended interpretation for high speed interfaces is -
+ *   number of packets dropped because they did not fit into buffers
+ *   provided by the host, e.g. packets larger than MTU or next buffer
+ *   in the ring was not available for a scatter transfer.
+ *
+ *   Part of aggregate "frame" errors in `/proc/net/dev`.
+ *
+ *   This statistics was historically used interchangeably with
+ *   @rx_fifo_errors.
+ *
+ *   This statistic corresponds to hardware events and is not commonly used
+ *   on software devices.
+ *
+ * @rx_crc_errors: Number of packets received with a CRC error.
+ *   Part of aggregate "frame" errors in `/proc/net/dev`.
+ *
+ *   For IEEE 802.3 devices this counter must be equivalent to:
+ *
+ *    - 30.3.1.1.6 aFrameCheckSequenceErrors
+ *
+ * @rx_frame_errors: Receiver frame alignment errors.
+ *   Part of aggregate "frame" errors in `/proc/net/dev`.
+ *
+ *   For IEEE 802.3 devices this counter should be equivalent to:
+ *
+ *    - 30.3.1.1.7 aAlignmentErrors
+ *
+ * @rx_fifo_errors: Receiver FIFO error counter.
+ *
+ *   Historically the count of overflow events. Those events may be
+ *   reported in the receive descriptors or via interrupts, and may
+ *   not correspond one-to-one with dropped packets.
+ *
+ *   This statistics was used interchangeably with @rx_over_errors.
+ *   Not recommended for use in drivers for high speed interfaces.
+ *
+ *   This statistic is used on software devices, e.g. to count software
+ *   packet queue overflow (can) or sequencing errors (GRE).
+ *
+ * @rx_missed_errors: Count of packets missed by the host.
+ *   Folded into the "drop" counter in `/proc/net/dev`.
+ *
+ *   Counts number of packets dropped by the device due to lack
+ *   of buffer space. This usually indicates that the host interface
+ *   is slower than the network interface, or host is not keeping up
+ *   with the receive packet rate.
+ *
+ *   This statistic corresponds to hardware events and is not used
+ *   on software devices.
+ *
+ * @tx_aborted_errors:
+ *   Part of aggregate "carrier" errors in `/proc/net/dev`.
+ *   For IEEE 802.3 devices capable of half-duplex operation this counter
+ *   must be equivalent to:
+ *
+ *    - 30.3.1.1.11 aFramesAbortedDueToXSColls
+ *
+ *   High speed interfaces may use this counter as a general device
+ *   discard counter.
+ *
+ * @tx_carrier_errors: Number of frame transmission errors due to loss
+ *   of carrier during transmission.
+ *   Part of aggregate "carrier" errors in `/proc/net/dev`.
+ *
+ *   For IEEE 802.3 devices this counter must be equivalent to:
+ *
+ *    - 30.3.1.1.13 aCarrierSenseErrors
+ *
+ * @tx_fifo_errors: Number of frame transmission errors due to device
+ *   FIFO underrun / underflow. This condition occurs when the device
+ *   begins transmission of a frame but is unable to deliver the
+ *   entire frame to the transmitter in time for transmission.
+ *   Part of aggregate "carrier" errors in `/proc/net/dev`.
+ *
+ * @tx_heartbeat_errors: Number of Heartbeat / SQE Test errors for
+ *   old half-duplex Ethernet.
+ *   Part of aggregate "carrier" errors in `/proc/net/dev`.
+ *
+ *   For IEEE 802.3 devices possibly equivalent to:
+ *
+ *    - 30.3.2.1.4 aSQETestErrors
+ *
+ * @tx_window_errors: Number of frame transmission errors due
+ *   to late collisions (for Ethernet - after the first 64B of transmission).
+ *   Part of aggregate "carrier" errors in `/proc/net/dev`.
+ *
+ *   For IEEE 802.3 devices this counter must be equivalent to:
+ *
+ *    - 30.3.1.1.10 aLateCollisions
+ *
+ * @rx_compressed: Number of correctly received compressed packets.
+ *   This counters is only meaningful for interfaces which support
+ *   packet compression (e.g. CSLIP, PPP).
+ *
+ * @tx_compressed: Number of transmitted compressed packets.
+ *   This counters is only meaningful for interfaces which support
+ *   packet compression (e.g. CSLIP, PPP).
+ *
+ * @rx_nohandler: Number of packets received on the interface
+ *   but dropped by the networking stack because the device is
+ *   not designated to receive packets (e.g. backup link in a bond).
+ */
 struct rtnl_link_stats64 {
-       __u64   rx_packets;             /* total packets received       */
-       __u64   tx_packets;             /* total packets transmitted    */
-       __u64   rx_bytes;               /* total bytes received         */
-       __u64   tx_bytes;               /* total bytes transmitted      */
-       __u64   rx_errors;              /* bad packets received         */
-       __u64   tx_errors;              /* packet transmit problems     */
-       __u64   rx_dropped;             /* no space in linux buffers    */
-       __u64   tx_dropped;             /* no space available in linux  */
-       __u64   multicast;              /* multicast packets received   */
+       __u64   rx_packets;
+       __u64   tx_packets;
+       __u64   rx_bytes;
+       __u64   tx_bytes;
+       __u64   rx_errors;
+       __u64   tx_errors;
+       __u64   rx_dropped;
+       __u64   tx_dropped;
+       __u64   multicast;
        __u64   collisions;
 
        /* detailed rx_errors: */
        __u64   rx_length_errors;
-       __u64   rx_over_errors;         /* receiver ring buff overflow  */
-       __u64   rx_crc_errors;          /* recved pkt with crc error    */
-       __u64   rx_frame_errors;        /* recv'd frame alignment error */
-       __u64   rx_fifo_errors;         /* recv'r fifo overrun          */
-       __u64   rx_missed_errors;       /* receiver missed packet       */
+       __u64   rx_over_errors;
+       __u64   rx_crc_errors;
+       __u64   rx_frame_errors;
+       __u64   rx_fifo_errors;
+       __u64   rx_missed_errors;
 
        /* detailed tx_errors */
        __u64   tx_aborted_errors;
@@ -71,8 +241,7 @@ struct rtnl_link_stats64 {
        /* for cslip etc */
        __u64   rx_compressed;
        __u64   tx_compressed;
-
-       __u64   rx_nohandler;           /* dropped, no handler found    */
+       __u64   rx_nohandler;
 };
 
 /* The struct should be in sync with struct ifmap */
index 61158f5a1a5bc272743769adb382d609329a17db..30c80d5ba4bfcba26a2bdd14045cfe0b936fdbfb 100644 (file)
@@ -108,7 +108,7 @@ enum {
        L2TP_ATTR_VLAN_ID,              /* u16 (not used) */
        L2TP_ATTR_COOKIE,               /* 0, 4 or 8 bytes */
        L2TP_ATTR_PEER_COOKIE,          /* 0, 4 or 8 bytes */
-       L2TP_ATTR_DEBUG,                /* u32, enum l2tp_debug_flags */
+       L2TP_ATTR_DEBUG,                /* u32, enum l2tp_debug_flags (not used) */
        L2TP_ATTR_RECV_SEQ,             /* u8 */
        L2TP_ATTR_SEND_SEQ,             /* u8 */
        L2TP_ATTR_LNS_MODE,             /* u8 */
@@ -144,6 +144,7 @@ enum {
        L2TP_ATTR_RX_OOS_PACKETS,       /* u64 */
        L2TP_ATTR_RX_ERRORS,            /* u64 */
        L2TP_ATTR_STATS_PAD,
+       L2TP_ATTR_RX_COOKIE_DISCARDS,   /* u64 */
        __L2TP_ATTR_STATS_MAX,
 };
 
@@ -177,7 +178,9 @@ enum l2tp_seqmode {
 };
 
 /**
- * enum l2tp_debug_flags - debug message categories for L2TP tunnels/sessions
+ * enum l2tp_debug_flags - debug message categories for L2TP tunnels/sessions.
+ *
+ * Unused.
  *
  * @L2TP_MSG_DEBUG: verbose debug (if compiled in)
  * @L2TP_MSG_CONTROL: userspace - kernel interface
index 521a787e8ae310fc329d84f2e225f11c2dfabbbd..83ec54b65e792f13e87121918dad334af5481578 100644 (file)
  *    the EXP_n values would be 1981, 2034 and 2043 if still using only
  *    11 bit fractions.
  */
-extern unsigned long avenrun[];                 /* Load averages */
+extern unsigned long avenrun[];                /* Load averages */
 extern void get_avenrun(unsigned long *loads, unsigned long offset, int shift);
 
-#define FSHIFT          11                      /* nr of bits of precision */
-#define FIXED_1         (1<<FSHIFT)             /* 1.0 as fixed-point */
-#define LOAD_FREQ       (5*HZ+1)                /* 5 sec intervals */
-#define EXP_1           1884                    /* 1/exp(5sec/1min) as fixed-point */
-#define EXP_5           2014                    /* 1/exp(5sec/5min) */
-#define EXP_15          2037                    /* 1/exp(5sec/15min) */
+#define FSHIFT         11              /* nr of bits of precision */
+#define FIXED_1                (1<<FSHIFT)     /* 1.0 as fixed-point */
+#define LOAD_FREQ      (5*HZ+1)        /* 5 sec intervals */
+#define EXP_1          1884            /* 1/exp(5sec/1min) as fixed-point */
+#define EXP_5          2014            /* 1/exp(5sec/5min) */
+#define EXP_15         2037            /* 1/exp(5sec/15min) */
 
 /*
  * a1 = a0 * e + a * (1 - e)
@@ -28,21 +28,21 @@ extern void get_avenrun(unsigned long *loads, unsigned long offset, int shift);
 static inline unsigned long
 calc_load(unsigned long load, unsigned long exp, unsigned long active)
 {
-        unsigned long newload;
+       unsigned long newload;
 
-        newload = load * exp + active * (FIXED_1 - exp);
-        if (active >= load)
-                newload += FIXED_1-1;
+       newload = load * exp + active * (FIXED_1 - exp);
+       if (active >= load)
+               newload += FIXED_1-1;
 
-        return newload / FIXED_1;
+       return newload / FIXED_1;
 }
 
 extern unsigned long calc_load_n(unsigned long load, unsigned long exp,
-                                 unsigned long active, unsigned int n);
+                                unsigned long active, unsigned int n);
 
 #define LOAD_INT(x) ((x) >> FSHIFT)
 #define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100)
 
-extern void calc_global_load(unsigned long ticks);
+extern void calc_global_load(void);
 
 #endif /* _LINUX_SCHED_LOADAVG_H */
index eac8a6a648ea3cd7c6df262f7451c0597e63b24f..c3816ff7bfc32f4bd68315f92cb6c6a01f8cc6fc 100644 (file)
@@ -129,6 +129,7 @@ struct nlmsgerr {
  * @NLMSGERR_ATTR_COOKIE: arbitrary subsystem specific cookie to
  *     be used - in the success case - to identify a created
  *     object or operation or similar (binary)
+ * @NLMSGERR_ATTR_POLICY: policy for a rejected attribute
  * @__NLMSGERR_ATTR_MAX: number of attributes
  * @NLMSGERR_ATTR_MAX: highest attribute number
  */
@@ -137,6 +138,7 @@ enum nlmsgerr_attrs {
        NLMSGERR_ATTR_MSG,
        NLMSGERR_ATTR_OFFS,
        NLMSGERR_ATTR_COOKIE,
+       NLMSGERR_ATTR_POLICY,
 
        __NLMSGERR_ATTR_MAX,
        NLMSGERR_ATTR_MAX = __NLMSGERR_ATTR_MAX - 1
@@ -331,6 +333,7 @@ enum netlink_attribute_type {
  *     the index, if limited inside the nesting (U32)
  * @NL_POLICY_TYPE_ATTR_BITFIELD32_MASK: valid mask for the
  *     bitfield32 type (U32)
+ * @NL_POLICY_TYPE_ATTR_MASK: mask of valid bits for unsigned integers (U64)
  * @NL_POLICY_TYPE_ATTR_PAD: pad attribute for 64-bit alignment
  */
 enum netlink_policy_type_attr {
@@ -346,6 +349,7 @@ enum netlink_policy_type_attr {
        NL_POLICY_TYPE_ATTR_POLICY_MAXTYPE,
        NL_POLICY_TYPE_ATTR_BITFIELD32_MASK,
        NL_POLICY_TYPE_ATTR_PAD,
+       NL_POLICY_TYPE_ATTR_MASK,
 
        /* keep last */
        __NL_POLICY_TYPE_ATTR_MAX,
index b0b0cdc949066bce38410198a14ab2b259c791dd..5595736f21f86579d3570aa6f46a1a38b553b78e 100755 (executable)
@@ -3,7 +3,11 @@
 set -eu
 
 for i in *.h */*.h; do
-    curl https://raw.githubusercontent.com/torvalds/linux/master/include/uapi/linux/$i -o $i
+    if [[ $i == 'loadavg.h' ]]; then
+        curl https://raw.githubusercontent.com/torvalds/linux/master/include/linux/sched/$i -o $i
+    else
+        curl https://raw.githubusercontent.com/torvalds/linux/master/include/uapi/linux/$i -o $i
+    fi
 
     sed -i -e 's/__user //g' -e '/^#include <linux\/compiler.h>/ d' $i
 done