r8169: add gro support
Subsystems (2)
PATCH 1/1 r8169: add gro support
- Use napi_gro_receive() and vlan_gro_receive()
- Enable GRO by default
Tested on a RTL8111/8168 adapter
--- drivers/net/r8169.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/net/r8169.c +8 -2
@@ -1076,7 +1076,12 @@ static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc,int ret;if (vlgrp && (opts2 & RxVlanTag)) { -__vlan_hwaccel_rx (skb, vlgrp,swab16 (opts2 &0xffff ), polling); +u16 vtag =swab16 (opts2 &0xffff ); + +if (polling) +vlan_gro_receive (&tp->napi, vlgrp, vtag, skb); +else +__vlan_hwaccel_rx (skb, vlgrp, vtag, polling); ret =0 ; }else ret =-1 ;
@@ -3186,6 +3191,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)#ifdef CONFIG_R8169_VLAN dev->features |=NETIF_F_HW_VLAN_TX |NETIF_F_HW_VLAN_RX ;#endif + dev->features |=NETIF_F_GRO ; tp->intr_mask =0xffff ; tp->align = cfg->align;
@@ -4561,7 +4567,7 @@ static int rtl8169_rx_interrupt(struct net_device *dev,if (rtl8169_rx_vlan_skb (tp, desc, skb, polling) <0 ) {if (likely (polling)) -netif_receive_skb (skb); +napi_gro_receive (&tp->napi, skb);else netif_rx (skb); }
Eric Dumazet <[email protected]> :
Quoted 7 lines
- Use
napi_gro_receive()andvlan_gro_receive()
- Enable GRO by defaultTested on a RTL8111/8168 adapter
Signed-off-by Eric Dumazet <[email protected]>CC Francois Romieu <[email protected]>
[...]
drivers/net/r8169.c static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc, · line 1081
Quoted 8 lines
drivers/net/r8169.c +3
-1@@ -1076,7 +1076,12 @@ static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc,int ret;if (vlgrp && (opts2 & RxVlanTag)) { -__vlan_hwaccel_rx (skb, vlgrp,swab16 (opts2 &0xffff ), polling); +u16 vtag =swab16 (opts2 &0xffff ); + +if (polling)
if (likely(polling))
Otherwise Acked-by: Francois Romieu <[email protected]>
Signature · 1 line
Ueimor
David Miller
maintainerFrom: Francois Romieu <[email protected]>
Date: Tue, 7 Sep 2010 22:24:45 +0200
Quoted 20 lines
Eric Dumazet <[email protected]> :
Quoted 7 lines
- Use
napi_gro_receive()andvlan_gro_receive()
- Enable GRO by defaultTested on a RTL8111/8168 adapter
Signed-off-by Eric Dumazet <[email protected]>CC Francois Romieu <[email protected]>[...]
drivers/net/r8169.c static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc, · line 1081
Quoted 8 lines
drivers/net/r8169.c +3
-1@@ -1076,7 +1076,12 @@ static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc,int ret;if (vlgrp && (opts2 & RxVlanTag)) { -__vlan_hwaccel_rx (skb, vlgrp,swab16 (opts2 &0xffff ), polling); +u16 vtag =swab16 (opts2 &0xffff ); + +if (polling)if (likely(polling))
Quoted 1 line
Otherwise Acked-by: Francois Romieu <[email protected]>
I've made this change and applied the patch, thanks guys!