Skip to content

Commit 2edae08

Browse files
Eric Dumazetdavem330
authored andcommitted
r8169: add gro support
- Use napi_gro_receive() and vlan_gro_receive() - Enable GRO by default Tested on a RTL8111/8168 adapter Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Acked-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c936335 commit 2edae08

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎drivers/net/r8169.c‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,12 @@ static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc,
10761076
int ret;
10771077

10781078
if (vlgrp && (opts2 & RxVlanTag)) {
1079-
__vlan_hwaccel_rx(skb, vlgrp, swab16(opts2 & 0xffff), polling);
1079+
u16 vtag = swab16(opts2 & 0xffff);
1080+
1081+
if (likely(polling))
1082+
vlan_gro_receive(&tp->napi, vlgrp, vtag, skb);
1083+
else
1084+
__vlan_hwaccel_rx(skb, vlgrp, vtag, polling);
10801085
ret = 0;
10811086
} else
10821087
ret = -1;
@@ -3186,6 +3191,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
31863191
#ifdef CONFIG_R8169_VLAN
31873192
dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
31883193
#endif
3194+
dev->features |= NETIF_F_GRO;
31893195

31903196
tp->intr_mask = 0xffff;
31913197
tp->align = cfg->align;
@@ -4561,7 +4567,7 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
45614567

45624568
if (rtl8169_rx_vlan_skb(tp, desc, skb, polling) < 0) {
45634569
if (likely(polling))
4564-
netif_receive_skb(skb);
4570+
napi_gro_receive(&tp->napi, skb);
45654571
else
45664572
netif_rx(skb);
45674573
}

0 commit comments

Comments
 (0)