ar71xx: Add GRO support to ag71xx
authorRosen Penev <rosenp@gmail.com>
Sun, 3 Sep 2017 18:35:46 +0000 (11:35 -0700)
committerJohn Crispin <john@phrozen.org>
Mon, 11 Sep 2017 15:12:42 +0000 (17:12 +0200)
On a TL-WN710N, this patch increases iperf performance from ~92.5 to ~93.5 mbps. Keep in mind the WN710N is a 100mbps device. I expect greater numbers from gigabit devices.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c

index 566e9513d8b7c6ef101902ae7d281dcc1c233893..ae1bdf60662d805d891e18907ac663d443955d7b 100644 (file)
@@ -1089,7 +1089,7 @@ next:
 
        while ((skb = __skb_dequeue(&queue)) != NULL) {
                skb->protocol = eth_type_trans(skb, dev);
-               netif_receive_skb(skb);
+               napi_gro_receive(&ag->napi, skb);
        }
 
        DBG("%s: rx finish, curr=%u, dirty=%u, done=%d\n",
@@ -1141,7 +1141,7 @@ static int ag71xx_poll(struct napi_struct *napi, int limit)
                DBG("%s: disable polling mode, rx=%d, tx=%d,limit=%d\n",
                        dev->name, rx_done, tx_done, limit);
 
-               napi_complete(napi);
+               napi_complete_done(napi, rx_done);
 
                /* enable interrupts */
                spin_lock_irqsave(&ag->lock, flags);
@@ -1160,7 +1160,7 @@ oom:
                pr_info("%s: out of memory\n", dev->name);
 
        mod_timer(&ag->oom_timer, jiffies + AG71XX_OOM_REFILL);
-       napi_complete(napi);
+       napi_complete_done(napi, rx_done);
        return 0;
 }