--- zzzz-none-000/linux-3.10.107/include/linux/skbuff.h 2017-06-27 09:49:32.000000000 +0000 +++ vr9-7490-729/linux-3.10.107/include/linux/skbuff.h 2021-11-10 11:53:56.000000000 +0000 @@ -11,6 +11,12 @@ * 2 of the License, or (at your option) any later version. */ +/** + * Some part of this file is modified by Ikanos Communications. + * + * Copyright (C) 2013-2014 Ikanos Communications. + */ + #ifndef _LINUX_SKBUFF_H #define _LINUX_SKBUFF_H @@ -33,6 +39,12 @@ #include #include #include +#ifdef CONFIG_AVM_PA +#include +#endif +#ifdef CONFIG_AVM_GENERIC_CONNTRACK +#include +#endif /* Don't change this without changing skb_csum_unnecessary! */ #define CHECKSUM_NONE 0 @@ -54,6 +66,18 @@ SKB_DATA_ALIGN(sizeof(struct sk_buff)) + \ SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) +#if defined(CONFIG_FUSIV_ENABLE_AP_MBUF) || defined(CONFIG_FUSIV_ENABLE_MBUF_AP) +// This value indicates that cluster was not allocated for this skb +#define SKB_APBUF_UNALLOCATED ((unsigned char *)0x00) + +// This value indicates that cluster was allocated to this skb but now the cluster +// ownership has been given to the AP and host should not free the cluster +#define SKB_APBUF_STEAL ((unsigned char *)0x01) + +// This macro indicates that whether skb->apAllocAddr contains a valid cluster address or not +#define SKB_APBUF_ALLOCATED(skb) ((skb)->apAllocAddr > (unsigned char *)0x01) +#endif + /* A. Checksumming of received packets by device. * * NONE: device failed to checksum this packet. @@ -109,10 +133,225 @@ struct net_device; struct scatterlist; struct pipe_inode_info; +/* Structure Definition for QoS */ +#if defined(CONFIG_FUSIV_KERNEL_HOST_IPQOS) || defined(CONFIG_FUSIV_KERNEL_HOST_IPQOS_MODULE) +typedef struct +{ + /* Action */ + unsigned char qos_map; /* QoS Mapping Information */ + unsigned char qos_mark; /* QoS Marking Information */ + + /* Information */ + unsigned char qos_done; /* used to indicate whether ipqos mapping/marking done for the packet */ + unsigned char qos_cos; /* QoS VLAN-COS value */ + unsigned char qos_priority; /* QoS Traffic Priority */ + unsigned char qos_marking_priority; /* QoS Marking Info */ + unsigned char qos_cos_marking_priority; /* QoS COS Marking Info */ + +}QoSFlowInfo_t; +#endif + +#if defined(CONFIG_FUSIV_KERNEL_BWMON_STATS) || defined(CONFIG_FUSIV_KERNEL_BWMON_STATS_MODULE) +enum bwmonDirectionInfo +{ + BWMON_NOT_MONITORED=0, /* not marked by bw monitoring target ; is the + default value*/ + BWMON_LAN, /*Traffic received on non WAN interface */ + BWMON_WAN, /*Traffic received on WAN interface */ + BWMON_LAN_WAN, /*direction of traffic is from LAN to WAN */ + BWMON_WAN_LAN, /*direction of traffic is from WAN to LAN */ +} ; + + +typedef struct +{ + /* Bandwidth monitoring structure Information */ +#define ETH_ALEN 6 + unsigned char ucDevMacAddr[ETH_ALEN] ; /*source mac address LAN Rx driver*/ + unsigned char ucFlowDirection ; /* used for LAN,WAN classification*/ + unsigned char ucDevID; /* Bwmon Dev Marking Info */ + /*updated from pFrame on receive + * in Rx of WAN updated to Host Rx bytes + * of corresponding Device ID. + */ + unsigned short usReceivedLength ; +}bwmonFlowInfo_t; +#endif + +#if defined(CONFIG_FUSIV_KERNEL_AP_2_AP) || defined(CONFIG_FUSIV_KERNEL_AP_2_AP_MODULE) + +// Added for AP_FRAGMENTATION ....Start....... + +# define RESERVED_SPACE_FOR_FRAGMENT 20 + +// Module Types + +# define MODULE_TYPE_ADSL 1 +# define MODULE_TYPE_WLAN 2 + +// Packet Types for ADSL + +# define PKT_TYPE_PPPOE 0 +# define PKT_TYPE_VLAN 1 + +// Packet Types for WLAN + +# define PKT_TYPE_ATHEROS_ETH_HDR_CONVERT 2 +# define PKT_TYPE_ATHEROS_NO_ETH_HDR_CONVERT 3 +# define PKT_TYPE_RALINK_11N 4 +# define PKT_TYPE_RALINK_11G 5 + +// Information required for Fragmentation +struct fragmentInfo { + unsigned int mtuSize; + unsigned short l2HeaderLen; + unsigned short totalLength; + unsigned char moduleType; + unsigned char pktType; + int (*fragment_xmit_ptr)(struct sk_buff *skb, struct net_device *dev); +}; + +// Added for AP_FRAGMENTATION ....End....... + +/* This file is modified with new ADI ap-ap frame work */ +/* apEntryInfo structure is defined here */ + +struct apEntryInfo { + void *RftPtrs[3]; + unsigned short hashValue[3]; + unsigned char apId[3]; + unsigned long adi_nfmark; + unsigned long pktCount[3]; +#if defined(CONFIG_FUSIV_KERNEL_BWMON_STATS) || defined(CONFIG_FUSIV_KERNEL_BWMON_STATS_MODULE) + void *pDevIdStruct; /* pointer to Bwmon Device structure*/ +#endif +}; + +struct apFlowInfo { + unsigned char rxApId; + unsigned char txApId; + + struct net_device *rxDev; + struct net_device *txDev; + + struct nf_conntrack *nfct; +#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) || defined(CONFIG_IPV6_TUNNEL) || \ + defined(CONFIG_IPV6_TUNNEL_MODULE) || defined(CONFIG_L2TP_AP_SUPPORT) +#if defined(CONFIG_FUSIV_VX185) || defined(CONFIG_FUSIV_VX585) + + struct nf_conntrack *org_nfct; //connection track information of Original packet IPv4/IPV6 + __u8 org_nfctinfo:3, + encap_protocol:4; +#define PROCESS_PLAIN 0 +#define PROCESS_ENCAP 1 +#define PROCESS_DECAP 2 +#define PROCESS_ESP_ENCAP 3 +#define PROCESS_ESP_DECAP 4 +#define PROCESS_ESP_PASSTHRU 5 +#define PROCESS_ESP_NAT_T 6 +#define PROCESS_ESP_SLOW_PATH 7 +#define PROCESS_L2TP_ENCAP 8 +#define PROCESS_L2TP_DECAP 9 +#define PROCESS_L2TP_SLOW_PATH 10 +#define AP_FLAG1_IS_IPSEC_DECRYPTED_BIT 7 // bit set in info flag, when ESP packet is decrypted by SecAP +#else + struct nf_conntrack *pretunnel_nfct; + int *pretunnel_dir; +#endif +#endif + + + unsigned short hash; + + unsigned short flags1; + unsigned short flags2; + unsigned short flags3; + + // For ADSL modules like PPPoE, PPPoA, IPoA + int sessionId; + int connId; + char encap; + +#if defined(CONFIG_FUSIV_KERNEL_HOST_IPQOS) || defined(CONFIG_FUSIV_KERNEL_HOST_IPQOS_MODULE) + QoSFlowInfo_t qosInfo; /* For IPQOS */ +#endif +#if defined(CONFIG_FUSIV_KERNEL_BWMON_STATS) || defined(CONFIG_FUSIV_KERNEL_BWMON_STATS_MODULE) + bwmonFlowInfo_t bwmonInfo; /* For BandWidthMonitoringFeature */ +#endif + + struct net_device *postRtDev; + +/* Following macros represent bits of the control flag */ +#define CONTROL_FLOW 0x1 // Represents the control connection. +#define ESTABLISHED_FLOW 0x2 // Represents the established connection. +#define VLAN_FLOW 0x4 // Represents the VLAN flow. +#define AP2APROUTE_FLOW 0x8 // Represents the Route flow + // (to add into Route FlowTable). +#define AP2APBRIDGE_FLOW 0x10 // Represents the bridge flow. +//#define DIFFSERV_MARK 0x20 // Represents that the flow is marked with diffserv code point. +#define TCP_ACK_PACKET 0x20 +#define AP2AP_MCAST_ROUTE_FLOW 0x40 // Represents multicast route flow +#define IPQOS_HOQ_PACKET 0x80 + + unsigned char controlFlags; +#if IS_ENABLED(CONFIG_BRIDGE) + struct net_bridge_fdb_entry *smac_entry; + struct net_bridge_fdb_entry *dmac_entry; +#endif + + unsigned int txHandle; + unsigned int rxHandle; + void* neigh; +#if IS_ENABLED(CONFIG_FUSIV_KERNEL_PERI_AP) + void *wlanNode; + unsigned char wlanFlags; + unsigned char srcwlanFlags; + unsigned char dstwlanFlags; + unsigned char secHdrLen; + unsigned char srcsecHdrLen; + unsigned char dstsecHdrLen; + void *secKey; +#endif + +#if defined(CONFIG_NF_CT_PROTO_ESP) || defined(CONFIG_NF_CT_PROTO_ESP_MODULE) + unsigned int spi; +#endif +#ifdef CONFIG_IPSEC_AP_SUPPORT +/* unsigned int enc_tx_spi; + unsigned int enc_rx_spi; + unsigned int tx_seqNo; + unsigned int rx_seqNo; + unsigned char authAlg; + unsigned int authKeyLen; + unsigned char authKey[32]; + unsigned int encKeyLen; + unsigned char encAlg; + unsigned char encKey[32]; + unsigned int saddr; + unsigned int daddr; */ +#endif + +#if defined(CONFIG_IPSEC_AP_SUPPORT) || defined(CONFIG_L2TP_AP_SUPPORT) + void *pSA; +#ifndef ETH_ALEN +#define ETH_ALEN 6 +#endif + unsigned char srcMAC[ETH_ALEN]; + unsigned char dstMAC[ETH_ALEN]; +#endif +#ifdef CONFIG_L2TP_AP_SUPPORT + void *pApOps; +#endif + unsigned int mcastSPDPkt; //flag to identify multicast slowpath pkt +}; +#endif #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) struct nf_conntrack { atomic_t use; +#if defined(CONFIG_FUSIV_KERNEL_AP_2_AP) || defined(CONFIG_FUSIV_KERNEL_AP_2_AP_MODULE) + struct apEntryInfo apEntryData; +#endif }; #endif @@ -406,6 +645,9 @@ struct sock *sk; struct net_device *dev; +#if IS_ENABLED(CONFIG_AVM_NET_SKB_INPUT_DEV) + struct net_device *input_dev; +#endif /* * This is the control buffer. It is free to use for every @@ -414,6 +656,20 @@ * first. This is owned by whoever has the skb queued ATM. */ char cb[48] __aligned(8); +#if defined(CONFIG_FUSIV_KERNEL_AP_2_AP) || defined(CONFIG_FUSIV_KERNEL_AP_2_AP_MODULE) + struct apFlowInfo apFlowData; /* ADI Structure for + * AP-AP fast path */ +#else +#if defined(CONFIG_FUSIV_KERNEL_HOST_IPQOS) || defined(CONFIG_FUSIV_KERNEL_HOST_IPQOS_MODULE) + QoSFlowInfo_t qosInfo; /* QoS Info structure when AP is disabled */ +#endif +#endif + +#if defined(CONFIG_FUSIV_ENABLE_AP_MBUF) || defined(CONFIG_FUSIV_ENABLE_MBUF_AP) + /* Specific to FUSIV, used to map AP cluster to SK BUF and Vice + versa. */ + unsigned char* apAllocAddr; +#endif unsigned long _skb_refdst; #ifdef CONFIG_XFRM @@ -445,6 +701,14 @@ kmemcheck_bitfield_end(flags1); __be16 protocol; +#ifdef CONFIG_AVM_ENHANCED + /* uniq_id: Attention! This field does not exist in the 2.6.32 kernel + * anymore. We just use it to pass port and queue information between + * avm_cpmac and multid/dsld in the upper eight bits. */ + unsigned long uniq_id; +#define AVM_HAVE_SKB_UNIQ_ID +#endif + void (*destructor)(struct sk_buff *skb); #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) struct nf_conntrack *nfct; @@ -494,6 +758,21 @@ #ifdef CONFIG_NETWORK_SECMARK __u32 secmark; #endif + +#ifdef CONFIG_AVM_PA + union { + struct avm_pa_pkt_info pktinfo; + __u8 buf[256]; + } avm_pa; +#define AVM_PKT_INFO(skb) (&(skb)->avm_pa.pktinfo) +#endif +#ifdef CONFIG_AVM_GENERIC_CONNTRACK + struct generic_ct *generic_ct; +#endif +#ifdef CONFIG_NET_DEBUG_SKBUFF_LEAK + void *last_user; +#endif + union { __u32 mark; __u32 dropcount; @@ -516,6 +795,23 @@ }; #ifdef __KERNEL__ + +#ifdef CONFIG_AVM_PA +static inline void avm_pa_add_local_session(PKT *pkt, struct sock *sk) +{ + struct avm_pa_pkt_info *info = AVM_PKT_INFO(pkt); + if (info->ptype_pid_handle && info->is_accelerated == 0) + _avm_pa_add_local_session(pkt, sk); +} +#endif /* CONFIG_AVM_PA */ + +#ifdef CONFIG_NET_DEBUG_SKBUFF_LEAK +#define skb_track_caller(skb) do { if (skb) (skb)->last_user = (void *)_RET_IP_; } while (0) +#define skb_track_func(skb) do { if (skb) (skb)->last_user = (void *)_THIS_IP_; } while (0) +#define skb_track_funccall(skb, func) do { if (skb) (skb)->last_user = (void *)func; } while (0) +#endif + + /* * Handling routines are only of interest to the kernel */ @@ -1083,6 +1379,9 @@ struct sk_buff *prev, struct sk_buff *next, struct sk_buff_head *list) { +#ifdef CONFIG_NET_DEBUG_SKBUFF_LEAK + skb_track_caller(newsk); +#endif newsk->next = next; newsk->prev = prev; next->prev = prev->next = newsk; @@ -1237,6 +1536,9 @@ { struct sk_buff *next, *prev; +#ifdef CONFIG_NET_DEBUG_SKBUFF_LEAK + skb_track_caller(skb); +#endif list->qlen--; next = skb->next; prev = skb->prev; @@ -1508,6 +1810,9 @@ */ static inline void skb_reserve(struct sk_buff *skb, int len) { +#ifdef CONFIG_NET_DEBUG_SKBUFF_LEAK + skb_track_caller(skb); +#endif skb->data += len; skb->tail += len; } @@ -1849,7 +2154,9 @@ * 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) +// AVM/TKL: MERGE Ikanos increased padding +//#define NET_SKB_PAD max(32, L1_CACHE_BYTES) +#define NET_SKB_PAD max(64, L1_CACHE_BYTES) #endif extern int ___pskb_trim(struct sk_buff *skb, unsigned int len); @@ -1879,6 +2186,12 @@ return (len < skb->len) ? __pskb_trim(skb, len) : 0; } +// AVM/TKL: MERGE added unconditionally by Ikanos +#if defined(CONFIG_MACH_FUSIV) +extern struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev, + unsigned int length, gfp_t gfp); +#endif + /** * pskb_trim_unique - remove end from a paged unique (not cloned) buffer * @skb: buffer to alter @@ -1894,6 +2207,27 @@ BUG_ON(err); } +// AVM/TKL: MERGE added unconditionally by Ikanos +#if defined(CONFIG_MACH_FUSIV) +/* + * Caller wants to reduce memory needs before queueing skb + * The (expensive) copy should not be be done in fast path. + */ +static inline struct sk_buff *skb_reduce_truesize(struct sk_buff *skb) +{ + if (skb->truesize > 2 * SKB_TRUESIZE(skb->len)) { + struct sk_buff *nskb; + nskb = skb_copy_expand(skb, skb_headroom(skb), 0, + GFP_ATOMIC | __GFP_NOWARN); + if (nskb) { + __kfree_skb(skb); + skb = nskb; + } + } + return skb; +} +#endif + /** * skb_orphan - orphan a buffer * @skb: buffer to orphan @@ -1904,6 +2238,9 @@ */ static inline void skb_orphan(struct sk_buff *skb) { +#ifdef CONFIG_NET_DEBUG_SKBUFF_LEAK + skb_track_caller(skb); +#endif if (skb->destructor) skb->destructor(skb); skb->destructor = NULL; @@ -1984,7 +2321,8 @@ return netdev_alloc_skb(NULL, length); } - +// AVM/TKL: MERGE removed unconditionally by Ikanos +#if !defined(CONFIG_MACH_FUSIV) static inline struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev, unsigned int length, gfp_t gfp) { @@ -1994,6 +2332,7 @@ skb_reserve(skb, NET_IP_ALIGN); return skb; } +#endif static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev, unsigned int length) @@ -2299,7 +2638,7 @@ const struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i - 1]; return page == skb_frag_page(frag) && - off == frag->page_offset + skb_frag_size(frag); + off == (int)(frag->page_offset + skb_frag_size(frag)); } return false; } @@ -2491,6 +2830,9 @@ extern struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features); +// AVM/TKL: MERGE added by Ikanos +unsigned int skb_gso_transport_seglen(const struct sk_buff *skb); + unsigned int skb_gso_transport_seglen(const struct sk_buff *skb); static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, @@ -2567,6 +2909,9 @@ static inline void __net_timestamp(struct sk_buff *skb) { skb->tstamp = ktime_get_real(); +#ifdef CONFIG_NET_DEBUG_SKBUFF_LEAK + skb_track_caller(skb); +#endif } static inline ktime_t net_timedelta(ktime_t t) @@ -2588,11 +2933,11 @@ #else /* CONFIG_NETWORK_PHY_TIMESTAMPING */ -static inline void skb_clone_tx_timestamp(struct sk_buff *skb) +static inline void skb_clone_tx_timestamp(struct sk_buff *skb __maybe_unused) { } -static inline bool skb_defer_rx_timestamp(struct sk_buff *skb) +static inline bool skb_defer_rx_timestamp(struct sk_buff *skb __maybe_unused) { return false; } @@ -2688,6 +3033,38 @@ 0 : __skb_checksum_complete(skb); } +#ifdef CONFIG_AVM_GENERIC_CONNTRACK +static inline enum generic_ct_dir skb_get_ct_dir(struct sk_buff *skb) +{ + return skb->nfctinfo ? GENERIC_CT_DIR_REPLY : GENERIC_CT_DIR_ORIGINAL; +} + +static inline void skb_set_ct_dir(struct sk_buff *skb, enum generic_ct_dir dir) +{ + skb->nfctinfo = (dir & 1); +} + +static inline void generic_ct_reset(struct sk_buff *skb __maybe_unused) +{ + generic_ct_put(skb->generic_ct); + skb->generic_ct = NULL; +} + +static inline void __generic_ct_copy(struct sk_buff *dst __maybe_unused, + const struct sk_buff *src __maybe_unused) +{ + dst->generic_ct = generic_ct_get(src->generic_ct); + dst->nfctinfo = src->nfctinfo; +} + +static inline void generic_ct_copy(struct sk_buff *dst, const struct sk_buff *src) +{ + generic_ct_put(dst->generic_ct); + __generic_ct_copy(dst, src); +} +#endif + + #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) extern void nf_conntrack_destroy(struct nf_conntrack *nfct); static inline void nf_conntrack_put(struct nf_conntrack *nfct) @@ -2713,7 +3090,7 @@ 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 __maybe_unused) { #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) nf_conntrack_put(skb->nfct); @@ -2725,15 +3102,23 @@ #endif } -static inline void nf_reset_trace(struct sk_buff *skb) +static inline void nf_reset(struct sk_buff *skb __maybe_unused) +{ + nf_reset_no_generic_ct(skb); +#ifdef CONFIG_AVM_GENERIC_CONNTRACK + generic_ct_reset(skb); +#endif +} + +static inline void nf_reset_trace(struct sk_buff *skb __maybe_unused) { #if IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TRACE) skb->nf_trace = 0; #endif } -/* 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) +static inline void __nf_copy_no_generic_ct(struct sk_buff *dst __maybe_unused, + const struct sk_buff *src __maybe_unused) { #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) dst->nfct = src->nfct; @@ -2746,7 +3131,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 __maybe_unused, + const struct sk_buff *src __maybe_unused) +{ + __nf_copy_no_generic_ct(dst, src); +#ifdef CONFIG_AVM_GENERIC_CONNTRACK + __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); @@ -2754,7 +3149,15 @@ #ifdef CONFIG_BRIDGE_NETFILTER nf_bridge_put(dst->nf_bridge); #endif - __nf_copy(dst, src); + __nf_copy_no_generic_ct(dst, src); +} + +static inline void nf_copy(struct sk_buff *dst, const struct sk_buff *src) +{ + nf_copy_no_generic_ct(dst, src); +#ifdef CONFIG_AVM_GENERIC_CONNTRACK + generic_ct_copy(dst, src); +#endif } #ifdef CONFIG_NETWORK_SECMARK @@ -2768,10 +3171,11 @@ skb->secmark = 0; } #else -static inline void skb_copy_secmark(struct sk_buff *to, const struct sk_buff *from) +static inline void skb_copy_secmark(struct sk_buff *to __maybe_unused, + const struct sk_buff *from __maybe_unused) { } -static inline void skb_init_secmark(struct sk_buff *skb) +static inline void skb_init_secmark(struct sk_buff *skb __maybe_unused) { } #endif @@ -2815,7 +3219,7 @@ return skb->sp; } #else -static inline struct sec_path *skb_sec_path(struct sk_buff *skb) +static inline struct sec_path *skb_sec_path(struct sk_buff *skb __maybe_unused) { return NULL; } @@ -2892,7 +3296,8 @@ * Instead of forcing ip_summed to CHECKSUM_NONE, we can * use this helper, to document places where we make this assertion. */ -static inline void skb_checksum_none_assert(const struct sk_buff *skb) +static inline void skb_checksum_none_assert(const struct sk_buff *skb + __maybe_unused) { #ifdef DEBUG BUG_ON(skb->ip_summed != CHECKSUM_NONE); @@ -2917,6 +3322,7 @@ return !skb->head_frag || skb_cloned(skb); } +// AVM/TKL: MERGE Ikanos /** * skb_gso_network_seglen - Return length of individual segments of a gso packet * @@ -2933,5 +3339,21 @@ skb_network_header(skb); return hdr_len + skb_gso_transport_seglen(skb); } + +#if defined(CONFIG_AVM_SKB_CACHE_SPLIT) +struct kmem_cache *skb_cache_create_per_swirq(const char *tasklet_name); +/*--- in softirq.c ---*/ +extern struct kmem_cache *skb_swirq_context(void); +#endif/*--- #if defined(CONFIG_AVM_SKB_CACHE_SPLIT) ---*/ + +static inline struct kmem_cache *avm_skb_get_cachep(void) { + struct kmem_cache *c; +#if defined(CONFIG_AVM_SKB_CACHE_SPLIT) + c = skb_swirq_context(); + if(c == NULL) +#endif/*--- #if defined(CONFIG_AVM_SKB_CACHE_SPLIT) ---*/ + c = skbuff_head_cache; + return c; +} #endif /* __KERNEL__ */ #endif /* _LINUX_SKBUFF_H */