tg3: Use napi_alloc_frag()
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Fri, 7 Jun 2019 19:20:39 +0000 (21:20 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 10 Jun 2019 02:40:10 +0000 (19:40 -0700)
tg3_alloc_rx_data() uses netdev_alloc_frag() for skb allocation. All
callers of tg3_alloc_rx_data() either hold tp->lock (which is held with
BH disabled) or run in NAPI context.

Use napi_alloc_frag() for skb allocations.

Cc: Siva Reddy Kallam <siva.kallam@broadcom.com>
Cc: Prashant Sreedharan <prashant@broadcom.com>
Cc: Michael Chan <mchan@broadcom.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/tg3.c

index 6d1f9c822548ef4191c798079be4cb467df20584..4c404d2213f98812d6389572bc0a6df7555e201d 100644 (file)
@@ -6710,7 +6710,7 @@ static int tg3_alloc_rx_data(struct tg3 *tp, struct tg3_rx_prodring_set *tpr,
        skb_size = SKB_DATA_ALIGN(data_size + TG3_RX_OFFSET(tp)) +
                   SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
        if (skb_size <= PAGE_SIZE) {
-               data = netdev_alloc_frag(skb_size);
+               data = napi_alloc_frag(skb_size);
                *frag_size = skb_size;
        } else {
                data = kmalloc(skb_size, GFP_ATOMIC);