r8169: use napi_complete_done return value
authorHeiner Kallweit <hkallweit1@gmail.com>
Wed, 19 Aug 2020 11:02:01 +0000 (13:02 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Aug 2020 20:03:03 +0000 (13:03 -0700)
Consider the return value of napi_complete_done(), this allows users to
use the gro_flush_timeout sysfs attribute as an alternative to classic
interrupt coalescing.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/realtek/r8169_main.c

index d1da92a..dbc324c 100644 (file)
@@ -4596,10 +4596,8 @@ static int rtl8169_poll(struct napi_struct *napi, int budget)
 
        rtl_tx(dev, tp, budget);
 
-       if (work_done < budget) {
-               napi_complete_done(napi, work_done);
+       if (work_done < budget && napi_complete_done(napi, work_done))
                rtl_irq_enable(tp);
-       }
 
        return work_done;
 }