net: fec: Avoid allocating rx buffer using ATOMIC in ndo_open
authorMichael Trimarchi <michael@amarulasolutions.com>
Wed, 18 May 2022 06:20:07 +0000 (08:20 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 19 May 2022 09:38:02 +0000 (11:38 +0200)
Make ndo_open less sensitive to memory pressure.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20220518062007.10056-1-michael@amarulasolutions.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/freescale/fec_main.c

index 6e52f3a..3cb298f 100644 (file)
@@ -3076,7 +3076,7 @@ fec_enet_alloc_rxq_buffers(struct net_device *ndev, unsigned int queue)
        rxq = fep->rx_queue[queue];
        bdp = rxq->bd.base;
        for (i = 0; i < rxq->bd.ring_size; i++) {
-               skb = netdev_alloc_skb(ndev, FEC_ENET_RX_FRSIZE);
+               skb = __netdev_alloc_skb(ndev, FEC_ENET_RX_FRSIZE, GFP_KERNEL);
                if (!skb)
                        goto err_alloc;