From: Wang Hai wanghai38@huawei.com
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8OWRC
----------------------------------------------------
Reserve some fields beforehand for net bpf framework related structures prone to change.
Signed-off-by: Wang Hai wanghai38@huawei.com Signed-off-by: Zhengchao Shao shaozhengchao@huawei.com --- include/linux/skmsg.h | 11 +++++++++++ include/net/tcp.h | 6 ++++++ include/net/xdp.h | 6 ++++++ 3 files changed, 23 insertions(+)
diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h index c953b8c0d2f4..03fdbb75d2cf 100644 --- a/include/linux/skmsg.h +++ b/include/linux/skmsg.h @@ -12,6 +12,7 @@ #include <net/sock.h> #include <net/tcp.h> #include <net/strparser.h> +#include <linux/kabi.h>
#define MAX_MSG_FRAGS MAX_SKB_FRAGS #define NR_MSG_FRAG_IDS (MAX_MSG_FRAGS + 1) @@ -58,6 +59,11 @@ struct sk_psock_progs { struct bpf_prog *stream_parser; struct bpf_prog *stream_verdict; struct bpf_prog *skb_verdict; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) };
enum sk_psock_state_bits { @@ -108,6 +114,11 @@ struct sk_psock { struct delayed_work work; struct sock *sk_pair; struct rcu_work rwork; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) };
int sk_msg_alloc(struct sock *sk, struct sk_msg *msg, int len, diff --git a/include/net/tcp.h b/include/net/tcp.h index 6f821f37e5aa..f4adfba58b31 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -45,6 +45,7 @@ #include <linux/memcontrol.h> #include <linux/bpf-cgroup.h> #include <linux/siphash.h> +#include <linux/kabi.h>
extern struct inet_hashinfo tcp_hashinfo;
@@ -1112,6 +1113,11 @@ struct tcp_congestion_ops { void (*init)(struct sock *sk); /* cleanup private data (optional) */ void (*release)(struct sock *sk); + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) } ____cacheline_aligned_in_smp;
int tcp_register_congestion_control(struct tcp_congestion_ops *type); diff --git a/include/net/xdp.h b/include/net/xdp.h index de08c8e0d134..c283668458ca 100644 --- a/include/net/xdp.h +++ b/include/net/xdp.h @@ -10,6 +10,7 @@ #include <linux/filter.h> #include <linux/netdevice.h> #include <linux/skbuff.h> /* skb_shared_info */ +#include <linux/kabi.h>
/** * DOC: XDP RX-queue information @@ -64,6 +65,11 @@ struct xdp_rxq_info { struct xdp_mem_info mem; unsigned int napi_id; u32 frag_size; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) } ____cacheline_aligned; /* perf critical, avoid false-sharing */
struct xdp_txq_info {