--- zzzz-none-000/linux-4.9.276/include/linux/skbuff.h 2021-07-20 14:21:16.000000000 +0000 +++ falcon-5530-750/linux-4.9.276/include/linux/skbuff.h 2023-04-05 08:19:02.000000000 +0000 @@ -39,6 +39,23 @@ #include #include #include +#ifdef CONFIG_NETWORK_EXTMARK +#include +#endif +#ifdef CONFIG_LTQ_DATAPATH_SKB +#include +#endif + +#include + +/* Do not include avm_pa.h to avoid include cycle. Since we can't determine + * the size here we reserve some space, including some extra space for future + * extensions without having to rebuild the world. + * + * avm_pa contains a BUILD_BUG_ON() in case the reserve is too small. + */ +#define AVM_PA_PKT_INFO_SKB_RESERVE 256 +struct avm_pa_pkt_info; /* The interface for checksum offload between the stack and networking drivers * is as follows... @@ -646,6 +663,9 @@ struct rb_node rbnode; /* used in netem, ip4 defrag, and tcp stack */ }; +#ifdef CONFIG_LTQ_DATAPATH_SKB + struct ltq_dp_skb dp_skb_info; +#endif union { struct sock *sk; int ip_defrag_offset; @@ -669,6 +689,11 @@ #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) struct nf_conntrack *nfct; #endif +#if IS_ENABLED(CONFIG_AVM_PA_GENERIC_CT) + struct generic_ct_data ct_data; +#define SKB_GENERIC_CT(skb) ((skb)->ct_data.generic_ct) +#define SKB_GENERIC_CT_DIR(skb) ((skb)->ct_data.generic_ct_dir) +#endif #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) struct nf_bridge_info *nf_bridge; #endif @@ -747,7 +772,8 @@ #ifdef CONFIG_NET_SWITCHDEV __u8 offload_fwd_mark:1; #endif - /* 2, 4 or 5 bit hole */ + __u8 gro_skip : 1; + /* 1, 3 or 4 bit hole */ #ifdef CONFIG_NET_SCHED __u16 tc_index; /* traffic control index */ @@ -797,8 +823,29 @@ __u16 network_header; __u16 mac_header; +#if defined(CONFIG_LTQ_CBM) || IS_ENABLED(CONFIG_DIRECTCONNECT_DP_API) + __u32 DW0, DW1, DW2, DW3; +#endif +#ifdef CONFIG_NETWORK_EXTMARK + __u32 extmark; +#endif +#if IS_ENABLED(CONFIG_BRIDGE_IGMP_SNOOPING) +#if IS_ENABLED(CONFIG_MCAST_HELPER) + int mc_gid; +#endif +#endif +#ifdef CONFIG_PPA + void *ptr_ppa_pitem; +#endif /* private: */ __u32 headers_end[0]; + +#ifdef CONFIG_AVM_PA + __u8 avm_pa[AVM_PA_PKT_INFO_SKB_RESERVE]; +#define AVM_PKT_INFO(skb) ((struct avm_pa_pkt_info *) (skb)->avm_pa) +#else +#define AVM_PKT_INFO(skb) ((struct avm_pa_pkt_info *) NULL) +#endif /* public: */ /* These elements must be at the end, see alloc_skb() for details. */ @@ -2316,7 +2363,7 @@ * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8) */ #ifndef NET_SKB_PAD -#define NET_SKB_PAD max(32, L1_CACHE_BYTES) +#define NET_SKB_PAD max(64, L1_CACHE_BYTES) #endif int ___pskb_trim(struct sk_buff *skb, unsigned int len); @@ -2351,6 +2398,9 @@ return (len < skb->len) ? __pskb_trim(skb, len) : 0; } +extern struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev, + unsigned int length, gfp_t gfp); + /** * pskb_trim_unique - remove end from a paged unique (not cloned) buffer * @skb: buffer to alter @@ -2471,16 +2521,6 @@ } -static inline struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev, - unsigned int length, gfp_t gfp) -{ - struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp); - - if (NET_IP_ALIGN && skb) - skb_reserve(skb, NET_IP_ALIGN); - return skb; -} - static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev, unsigned int length) { @@ -3354,6 +3394,10 @@ skb_checksum_start_offset(skb) >= 0)); } +#ifdef CONFIG_LTQ_CBM +void ltq_copy_skb_header(struct sk_buff *n, const struct sk_buff *skb); +#endif + /** * skb_checksum_complete - Calculate checksum of an entire packet * @skb: packet to process @@ -3592,6 +3636,29 @@ atomic_inc(&nfct->use); } #endif + +#if IS_ENABLED(CONFIG_AVM_PA_GENERIC_CT) +static inline void generic_ct_reset(struct sk_buff *skb) +{ + generic_ct_put(SKB_GENERIC_CT(skb)); + SKB_GENERIC_CT(skb) = NULL; +} + +static inline void __generic_ct_copy(struct sk_buff *dst, + const struct sk_buff *src) +{ + SKB_GENERIC_CT(dst) = generic_ct_get(SKB_GENERIC_CT(src)); + SKB_GENERIC_CT_DIR(dst) = SKB_GENERIC_CT_DIR(src); +} + +static inline void generic_ct_copy(struct sk_buff *dst, + const struct sk_buff *src) +{ + generic_ct_put(SKB_GENERIC_CT(dst)); + __generic_ct_copy(dst, src); +} +#endif + #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) static inline void nf_bridge_put(struct nf_bridge_info *nf_bridge) { @@ -3604,7 +3671,8 @@ atomic_inc(&nf_bridge->use); } #endif /* CONFIG_BRIDGE_NETFILTER */ -static inline void nf_reset(struct sk_buff *skb) + +static inline void nf_reset_no_generic_ct(struct sk_buff *skb) { #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) nf_conntrack_put(skb->nfct); @@ -3616,6 +3684,14 @@ #endif } +static inline void nf_reset(struct sk_buff *skb) +{ + nf_reset_no_generic_ct(skb); +#if IS_ENABLED(CONFIG_AVM_PA_GENERIC_CT) + generic_ct_reset(skb); +#endif +} + static inline void nf_reset_trace(struct sk_buff *skb) { #if IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TRACE) || defined(CONFIG_NF_TABLES) @@ -3631,8 +3707,9 @@ } /* Note: This doesn't put any conntrack and bridge info in dst. */ -static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src, - bool copy) +static inline void __nf_copy_no_generic_ct(struct sk_buff *dst, + const struct sk_buff *src, + bool copy) { #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) dst->nfct = src->nfct; @@ -3650,7 +3727,17 @@ #endif } -static inline void nf_copy(struct sk_buff *dst, const struct sk_buff *src) +/* Note: This doesn't put any conntrack and bridge info in dst. */ +static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src, + bool copy) +{ + __nf_copy_no_generic_ct(dst, src, copy); +#if IS_ENABLED(CONFIG_AVM_PA_GENERIC_CT) + __generic_ct_copy(dst, src); +#endif +} + +static inline void nf_copy_no_generic_ct(struct sk_buff *dst, const struct sk_buff *src) { #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) nf_conntrack_put(dst->nfct); @@ -3658,7 +3745,15 @@ #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) nf_bridge_put(dst->nf_bridge); #endif - __nf_copy(dst, src, true); + __nf_copy_no_generic_ct(dst, src, true); +} + +static inline void nf_copy(struct sk_buff *dst, const struct sk_buff *src) +{ + nf_copy_no_generic_ct(dst, src); +#if IS_ENABLED(CONFIG_AVM_PA_GENERIC_CT) + generic_ct_copy(dst, src); +#endif } #ifdef CONFIG_NETWORK_SECMARK