ethernet/realtek: use napi_alloc_skb instead of netdev_alloc_skb_ip_align
This replaces most of the calls to netdev_alloc_skb_ip_align in the Realtek drivers. The one instance I didn't replace in 8139cp.c is because it was called as a part of init and as such is not always accessed from the softirq context. Cc: Realtek linux nic maintainers <nic_swsd@realtek.com> Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e0e31216ef
commit
e2338f86b3
3 changed files with 3 additions and 3 deletions
|
@ -507,7 +507,7 @@ rx_status_loop:
|
||||||
netif_dbg(cp, rx_status, dev, "rx slot %d status 0x%x len %d\n",
|
netif_dbg(cp, rx_status, dev, "rx slot %d status 0x%x len %d\n",
|
||||||
rx_tail, status, len);
|
rx_tail, status, len);
|
||||||
|
|
||||||
new_skb = netdev_alloc_skb_ip_align(dev, buflen);
|
new_skb = napi_alloc_skb(napi, buflen);
|
||||||
if (!new_skb) {
|
if (!new_skb) {
|
||||||
dev->stats.rx_dropped++;
|
dev->stats.rx_dropped++;
|
||||||
goto rx_next;
|
goto rx_next;
|
||||||
|
|
|
@ -2037,7 +2037,7 @@ keep_pkt:
|
||||||
/* Malloc up new buffer, compatible with net-2e. */
|
/* Malloc up new buffer, compatible with net-2e. */
|
||||||
/* Omit the four octet CRC from the length. */
|
/* Omit the four octet CRC from the length. */
|
||||||
|
|
||||||
skb = netdev_alloc_skb_ip_align(dev, pkt_size);
|
skb = napi_alloc_skb(&tp->napi, pkt_size);
|
||||||
if (likely(skb)) {
|
if (likely(skb)) {
|
||||||
#if RX_BUF_IDX == 3
|
#if RX_BUF_IDX == 3
|
||||||
wrap_copy(skb, rx_ring, ring_offset+4, pkt_size);
|
wrap_copy(skb, rx_ring, ring_offset+4, pkt_size);
|
||||||
|
|
|
@ -7260,7 +7260,7 @@ static struct sk_buff *rtl8169_try_rx_copy(void *data,
|
||||||
data = rtl8169_align(data);
|
data = rtl8169_align(data);
|
||||||
dma_sync_single_for_cpu(d, addr, pkt_size, DMA_FROM_DEVICE);
|
dma_sync_single_for_cpu(d, addr, pkt_size, DMA_FROM_DEVICE);
|
||||||
prefetch(data);
|
prefetch(data);
|
||||||
skb = netdev_alloc_skb_ip_align(tp->dev, pkt_size);
|
skb = napi_alloc_skb(&tp->napi, pkt_size);
|
||||||
if (skb)
|
if (skb)
|
||||||
memcpy(skb->data, data, pkt_size);
|
memcpy(skb->data, data, pkt_size);
|
||||||
dma_sync_single_for_device(d, addr, pkt_size, DMA_FROM_DEVICE);
|
dma_sync_single_for_device(d, addr, pkt_size, DMA_FROM_DEVICE);
|
||||||
|
|
Loading…
Add table
Reference in a new issue