Skip to content

Commit e2338f8

Browse files
Alexander Duyckdavem330
authored andcommitted
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>
1 parent e0e3121 commit e2338f8

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

drivers/net/ethernet/realtek/8139cp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ static int cp_rx_poll(struct napi_struct *napi, int budget)
507507
netif_dbg(cp, rx_status, dev, "rx slot %d status 0x%x len %d\n",
508508
rx_tail, status, len);
509509

510-
new_skb = netdev_alloc_skb_ip_align(dev, buflen);
510+
new_skb = napi_alloc_skb(napi, buflen);
511511
if (!new_skb) {
512512
dev->stats.rx_dropped++;
513513
goto rx_next;

drivers/net/ethernet/realtek/8139too.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2037,7 +2037,7 @@ static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp,
20372037
/* Malloc up new buffer, compatible with net-2e. */
20382038
/* Omit the four octet CRC from the length. */
20392039

2040-
skb = netdev_alloc_skb_ip_align(dev, pkt_size);
2040+
skb = napi_alloc_skb(&tp->napi, pkt_size);
20412041
if (likely(skb)) {
20422042
#if RX_BUF_IDX == 3
20432043
wrap_copy(skb, rx_ring, ring_offset+4, pkt_size);

drivers/net/ethernet/realtek/r8169.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7260,7 +7260,7 @@ static struct sk_buff *rtl8169_try_rx_copy(void *data,
72607260
data = rtl8169_align(data);
72617261
dma_sync_single_for_cpu(d, addr, pkt_size, DMA_FROM_DEVICE);
72627262
prefetch(data);
7263-
skb = netdev_alloc_skb_ip_align(tp->dev, pkt_size);
7263+
skb = napi_alloc_skb(&tp->napi, pkt_size);
72647264
if (skb)
72657265
memcpy(skb->data, data, pkt_size);
72667266
dma_sync_single_for_device(d, addr, pkt_size, DMA_FROM_DEVICE);

0 commit comments

Comments
 (0)