Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef1f048b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "skbuff: support disabling of skb fragment cache"

parents 7b262653 53f89b88
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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"
+17 −0
Original line number Diff line number Diff line
@@ -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)
{
@@ -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,