[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6a2940ff-ade4-64b5-2014-4e0701c14b87@gmail.com>
Date: Wed, 29 May 2019 15:48:51 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
netdev@...r.kernel.org
Cc: tglx@...utronix.de, "David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH net-next 1/7] net: Don't disable interrupts in
napi_alloc_frag()
On 5/29/19 3:15 PM, Sebastian Andrzej Siewior wrote:
> netdev_alloc_frag() can be used from any context and is used by NAPI
> and non-NAPI drivers. Non-NAPI drivers use it in interrupt context
> and NAPI drivers use it during initial allocation (->ndo_open() or
> ->ndo_change_mtu()). Some NAPI drivers share the same function for the
> initial allocation and the allocation in their NAPI callback.
...
> +
> + fragsz = SKB_DATA_ALIGN(fragsz);
> + if (irqs_disabled()) {
What is the difference between this prior test, and the following ?
if (in_irq() || irqs_disabled())
I am asking because I see the latter being used in __dev_kfree_skb_any()
> + nc = this_cpu_ptr(&netdev_alloc_cache);
> + data = page_frag_alloc(nc, fragsz, GFP_ATOMIC);
> + } else {
> + local_bh_disable();
> + data = __napi_alloc_frag(fragsz, GFP_ATOMIC);
> + local_bh_enable();
> + }
> + return data;
> +}
> +EXPORT_SYMBOL(netdev_alloc_frag);
> +
> /**
> * __netdev_alloc_skb - allocate an skbuff for rx on a specific device
> * @dev: network device to receive on
>
Powered by blists - more mailing lists