* [PATCH net-next-2.6] r8169: add gro support
@ 2010-09-07 4:46 Eric Dumazet
2010-09-07 20:24 ` Francois Romieu
0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2010-09-07 4:46 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Francois Romieu
- 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>
CC: Francois Romieu <romieu@fr.zoreil.com>
---
drivers/net/r8169.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 56a11e2..ddff42b 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -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);
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next-2.6] r8169: add gro support
2010-09-07 4:46 [PATCH net-next-2.6] r8169: add gro support Eric Dumazet
@ 2010-09-07 20:24 ` Francois Romieu
2010-09-07 20:47 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Francois Romieu @ 2010-09-07 20:24 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, netdev
Eric Dumazet <eric.dumazet@gmail.com> :
> - 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>
> CC: Francois Romieu <romieu@fr.zoreil.com>
[...]
> @@ -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 <romieu@fr.zoreil.com>
--
Ueimor
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next-2.6] r8169: add gro support
2010-09-07 20:24 ` Francois Romieu
@ 2010-09-07 20:47 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2010-09-07 20:47 UTC (permalink / raw)
To: romieu; +Cc: eric.dumazet, netdev
From: Francois Romieu <romieu@fr.zoreil.com>
Date: Tue, 7 Sep 2010 22:24:45 +0200
> Eric Dumazet <eric.dumazet@gmail.com> :
>> - 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>
>> CC: Francois Romieu <romieu@fr.zoreil.com>
> [...]
>> @@ -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 <romieu@fr.zoreil.com>
I've made this change and applied the patch, thanks guys!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-09-07 20:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-07 4:46 [PATCH net-next-2.6] r8169: add gro support Eric Dumazet
2010-09-07 20:24 ` Francois Romieu
2010-09-07 20:47 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).