]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
Update kernel headers from 5.12-pre rc
authorStephen Hemminger <stephen@networkplumber.org>
Wed, 24 Feb 2021 07:10:51 +0000 (23:10 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 24 Feb 2021 07:11:12 +0000 (23:11 -0800)
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
include/uapi/linux/bpf.h
include/uapi/linux/mptcp.h
include/uapi/linux/pkt_cls.h

index 1daeda13f0b707668cf170e34747d6b0c12a204d..9c135426c8ca09d1d6928987963bfa645597ea14 100644 (file)
@@ -1656,22 +1656,30 @@ union bpf_attr {
  *             networking traffic statistics as it provides a global socket
  *             identifier that can be assumed unique.
  *     Return
- *             A 8-byte long non-decreasing number on success, or 0 if the
- *             socket field is missing inside *skb*.
+ *             A 8-byte long unique number on success, or 0 if the socket
+ *             field is missing inside *skb*.
  *
  * u64 bpf_get_socket_cookie(struct bpf_sock_addr *ctx)
  *     Description
  *             Equivalent to bpf_get_socket_cookie() helper that accepts
  *             *skb*, but gets socket from **struct bpf_sock_addr** context.
  *     Return
- *             A 8-byte long non-decreasing number.
+ *             A 8-byte long unique number.
  *
  * u64 bpf_get_socket_cookie(struct bpf_sock_ops *ctx)
  *     Description
  *             Equivalent to **bpf_get_socket_cookie**\ () helper that accepts
  *             *skb*, but gets socket from **struct bpf_sock_ops** context.
  *     Return
- *             A 8-byte long non-decreasing number.
+ *             A 8-byte long unique number.
+ *
+ * u64 bpf_get_socket_cookie(struct sock *sk)
+ *     Description
+ *             Equivalent to **bpf_get_socket_cookie**\ () helper that accepts
+ *             *sk*, but gets socket from a BTF **struct sock**. This helper
+ *             also works for sleepable programs.
+ *     Return
+ *             A 8-byte long unique number or 0 if *sk* is NULL.
  *
  * u32 bpf_get_socket_uid(struct sk_buff *skb)
  *     Return
@@ -2231,6 +2239,9 @@ union bpf_attr {
  *             * > 0 one of **BPF_FIB_LKUP_RET_** codes explaining why the
  *               packet is not forwarded or needs assist from full stack
  *
+ *             If lookup fails with BPF_FIB_LKUP_RET_FRAG_NEEDED, then the MTU
+ *             was exceeded and output params->mtu_result contains the MTU.
+ *
  * long bpf_sock_hash_update(struct bpf_sock_ops *skops, struct bpf_map *map, void *key, u64 flags)
  *     Description
  *             Add an entry to, or update a sockhash *map* referencing sockets.
@@ -3836,6 +3847,69 @@ union bpf_attr {
  *     Return
  *             A pointer to a struct socket on success or NULL if the file is
  *             not a socket.
+ *
+ * long bpf_check_mtu(void *ctx, u32 ifindex, u32 *mtu_len, s32 len_diff, u64 flags)
+ *     Description
+
+ *             Check ctx packet size against exceeding MTU of net device (based
+ *             on *ifindex*).  This helper will likely be used in combination
+ *             with helpers that adjust/change the packet size.
+ *
+ *             The argument *len_diff* can be used for querying with a planned
+ *             size change. This allows to check MTU prior to changing packet
+ *             ctx. Providing an *len_diff* adjustment that is larger than the
+ *             actual packet size (resulting in negative packet size) will in
+ *             principle not exceed the MTU, why it is not considered a
+ *             failure.  Other BPF-helpers are needed for performing the
+ *             planned size change, why the responsability for catch a negative
+ *             packet size belong in those helpers.
+ *
+ *             Specifying *ifindex* zero means the MTU check is performed
+ *             against the current net device.  This is practical if this isn't
+ *             used prior to redirect.
+ *
+ *             The Linux kernel route table can configure MTUs on a more
+ *             specific per route level, which is not provided by this helper.
+ *             For route level MTU checks use the **bpf_fib_lookup**\ ()
+ *             helper.
+ *
+ *             *ctx* is either **struct xdp_md** for XDP programs or
+ *             **struct sk_buff** for tc cls_act programs.
+ *
+ *             The *flags* argument can be a combination of one or more of the
+ *             following values:
+ *
+ *             **BPF_MTU_CHK_SEGS**
+ *                     This flag will only works for *ctx* **struct sk_buff**.
+ *                     If packet context contains extra packet segment buffers
+ *                     (often knows as GSO skb), then MTU check is harder to
+ *                     check at this point, because in transmit path it is
+ *                     possible for the skb packet to get re-segmented
+ *                     (depending on net device features).  This could still be
+ *                     a MTU violation, so this flag enables performing MTU
+ *                     check against segments, with a different violation
+ *                     return code to tell it apart. Check cannot use len_diff.
+ *
+ *             On return *mtu_len* pointer contains the MTU value of the net
+ *             device.  Remember the net device configured MTU is the L3 size,
+ *             which is returned here and XDP and TX length operate at L2.
+ *             Helper take this into account for you, but remember when using
+ *             MTU value in your BPF-code.  On input *mtu_len* must be a valid
+ *             pointer and be initialized (to zero), else verifier will reject
+ *             BPF program.
+ *
+ *     Return
+ *             * 0 on success, and populate MTU value in *mtu_len* pointer.
+ *
+ *             * < 0 if any input argument is invalid (*mtu_len* not updated)
+ *
+ *             MTU violations return positive values, but also populate MTU
+ *             value in *mtu_len* pointer, as this can be needed for
+ *             implementing PMTU handing:
+ *
+ *             * **BPF_MTU_CHK_RET_FRAG_NEEDED**
+ *             * **BPF_MTU_CHK_RET_SEGS_TOOBIG**
+ *
  */
 #define __BPF_FUNC_MAPPER(FN)          \
        FN(unspec),                     \
@@ -4001,6 +4075,7 @@ union bpf_attr {
        FN(ktime_get_coarse_ns),        \
        FN(ima_inode_hash),             \
        FN(sock_from_file),             \
+       FN(check_mtu),                  \
        /* */
 
 /* integer value in 'imm' field of BPF_CALL instruction selects which helper
@@ -4501,6 +4576,7 @@ struct bpf_prog_info {
        __aligned_u64 prog_tags;
        __u64 run_time_ns;
        __u64 run_cnt;
+       __u64 recursion_misses;
 } __attribute__((aligned(8)));
 
 struct bpf_map_info {
@@ -4981,9 +5057,13 @@ struct bpf_fib_lookup {
        __be16  sport;
        __be16  dport;
 
-       /* total length of packet from network header - used for MTU check */
-       __u16   tot_len;
+       union { /* used for MTU check */
+               /* input to lookup */
+               __u16   tot_len; /* L3 length from network hdr (iph->tot_len) */
 
+               /* output: MTU value */
+               __u16   mtu_result;
+       };
        /* input: L3 device index for lookup
         * output: device index from FIB lookup
         */
@@ -5029,6 +5109,17 @@ struct bpf_redir_neigh {
        };
 };
 
+/* bpf_check_mtu flags*/
+enum  bpf_check_mtu_flags {
+       BPF_MTU_CHK_SEGS  = (1U << 0),
+};
+
+enum bpf_check_mtu_ret {
+       BPF_MTU_CHK_RET_SUCCESS,      /* check and lookup successful */
+       BPF_MTU_CHK_RET_FRAG_NEEDED,  /* fragmentation required to fwd */
+       BPF_MTU_CHK_RET_SEGS_TOOBIG,  /* GSO re-segmentation needed to fwd */
+};
+
 enum bpf_task_fd_type {
        BPF_FD_TYPE_RAW_TRACEPOINT,     /* tp name */
        BPF_FD_TYPE_TRACEPOINT,         /* tp name */
index 58ce1c6aab9b0c661f23f741b894268ea6c86126..c3e40165ad4b0fa34dc807eac37132d265a9d5d2 100644 (file)
@@ -103,6 +103,8 @@ struct mptcp_info {
        __u64   mptcpi_write_seq;
        __u64   mptcpi_snd_una;
        __u64   mptcpi_rcv_nxt;
+       __u8    mptcpi_local_addr_used;
+       __u8    mptcpi_local_addr_max;
 };
 
 /*
index afe6836e44b15c2da29f40b740f1968c6865d58b..7ea59cfe1fa7221c8516f25199933b9054342893 100644 (file)
@@ -593,6 +593,7 @@ enum {
        TCA_FLOWER_KEY_CT_FLAGS_TRACKED = 1 << 3, /* Conntrack has occurred. */
        TCA_FLOWER_KEY_CT_FLAGS_INVALID = 1 << 4, /* Conntrack is invalid. */
        TCA_FLOWER_KEY_CT_FLAGS_REPLY = 1 << 5, /* Packet is in the reply direction. */
+       __TCA_FLOWER_KEY_CT_FLAGS_MAX,
 };
 
 enum {