Commit 385565a1 authored by Lendacky, Thomas's avatar Lendacky, Thomas Committed by David S. Miller

amd-xgbe: Use napi_alloc_skb when allocating skb in softirq

Use the napi_alloc_skb function to allocate an skb when running within
the softirq context to avoid calls to local_irq_save/restore.
Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4a57ebcc
...@@ -1821,16 +1821,15 @@ static void xgbe_rx_refresh(struct xgbe_channel *channel) ...@@ -1821,16 +1821,15 @@ static void xgbe_rx_refresh(struct xgbe_channel *channel)
lower_32_bits(rdata->rdesc_dma)); lower_32_bits(rdata->rdesc_dma));
} }
static struct sk_buff *xgbe_create_skb(struct xgbe_prv_data *pdata, static struct sk_buff *xgbe_create_skb(struct napi_struct *napi,
struct xgbe_ring_data *rdata, struct xgbe_ring_data *rdata,
unsigned int *len) unsigned int *len)
{ {
struct net_device *netdev = pdata->netdev;
struct sk_buff *skb; struct sk_buff *skb;
u8 *packet; u8 *packet;
unsigned int copy_len; unsigned int copy_len;
skb = netdev_alloc_skb_ip_align(netdev, rdata->rx.hdr.dma_len); skb = napi_alloc_skb(napi, rdata->rx.hdr.dma_len);
if (!skb) if (!skb)
return NULL; return NULL;
...@@ -2000,7 +1999,7 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, int budget) ...@@ -2000,7 +1999,7 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, int budget)
rdata->rx.hdr.dma_len, rdata->rx.hdr.dma_len,
DMA_FROM_DEVICE); DMA_FROM_DEVICE);
skb = xgbe_create_skb(pdata, rdata, &put_len); skb = xgbe_create_skb(napi, rdata, &put_len);
if (!skb) { if (!skb) {
error = 1; error = 1;
goto skip_data; goto skip_data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment