Loading net/Kconfig +10 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,16 @@ config COMPAT_NETLINK_MESSAGES Newly written code should NEVER need this option but do compat-independent messages instead! config DISABLE_NET_SKB_FRAG_CACHE bool "Disable skb fragment cache" help Enabling this option ensures that when allocating skbs the network skb fragment cache is not used. Disabling use of the fragment cache can be useful on some low end targets because it reduces memory pressure. If you are unsure how to answer this question, answer N. menu "Networking options" source "net/packet/Kconfig" Loading net/core/skbuff.c +17 −0 Original line number Diff line number Diff line Loading @@ -443,6 +443,7 @@ EXPORT_SYMBOL(netdev_alloc_frag); * * %NULL is returned if there is no free memory. */ #ifndef CONFIG_DISABLE_NET_SKB_FRAG_CACHE struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int length, gfp_t gfp_mask) { Loading Loading @@ -473,6 +474,22 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev, } return skb; } #else struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int length, gfp_t gfp_mask) { struct sk_buff *skb = NULL; skb = __alloc_skb(length + NET_SKB_PAD, gfp_mask, SKB_ALLOC_RX, NUMA_NO_NODE); if (likely(skb)) { skb_reserve(skb, NET_SKB_PAD); skb->dev = dev; } return skb; } #endif EXPORT_SYMBOL(__netdev_alloc_skb); void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, int off, Loading Loading
net/Kconfig +10 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,16 @@ config COMPAT_NETLINK_MESSAGES Newly written code should NEVER need this option but do compat-independent messages instead! config DISABLE_NET_SKB_FRAG_CACHE bool "Disable skb fragment cache" help Enabling this option ensures that when allocating skbs the network skb fragment cache is not used. Disabling use of the fragment cache can be useful on some low end targets because it reduces memory pressure. If you are unsure how to answer this question, answer N. menu "Networking options" source "net/packet/Kconfig" Loading
net/core/skbuff.c +17 −0 Original line number Diff line number Diff line Loading @@ -443,6 +443,7 @@ EXPORT_SYMBOL(netdev_alloc_frag); * * %NULL is returned if there is no free memory. */ #ifndef CONFIG_DISABLE_NET_SKB_FRAG_CACHE struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int length, gfp_t gfp_mask) { Loading Loading @@ -473,6 +474,22 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev, } return skb; } #else struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int length, gfp_t gfp_mask) { struct sk_buff *skb = NULL; skb = __alloc_skb(length + NET_SKB_PAD, gfp_mask, SKB_ALLOC_RX, NUMA_NO_NODE); if (likely(skb)) { skb_reserve(skb, NET_SKB_PAD); skb->dev = dev; } return skb; } #endif EXPORT_SYMBOL(__netdev_alloc_skb); void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, int off, Loading