Merge branch 'r8169-use-napi_complete_done-return-value'
Heiner Kallweit says: ==================== r8169: use napi_complete_done return value 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: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
0b3fc8b2e3
@ -617,7 +617,6 @@ struct rtl8169_private {
|
|||||||
struct work_struct work;
|
struct work_struct work;
|
||||||
} wk;
|
} wk;
|
||||||
|
|
||||||
unsigned irq_enabled:1;
|
|
||||||
unsigned supports_gmii:1;
|
unsigned supports_gmii:1;
|
||||||
unsigned aspm_manageable:1;
|
unsigned aspm_manageable:1;
|
||||||
dma_addr_t counters_phys_addr;
|
dma_addr_t counters_phys_addr;
|
||||||
@ -1280,12 +1279,10 @@ static void rtl_irq_disable(struct rtl8169_private *tp)
|
|||||||
RTL_W32(tp, IntrMask_8125, 0);
|
RTL_W32(tp, IntrMask_8125, 0);
|
||||||
else
|
else
|
||||||
RTL_W16(tp, IntrMask, 0);
|
RTL_W16(tp, IntrMask, 0);
|
||||||
tp->irq_enabled = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rtl_irq_enable(struct rtl8169_private *tp)
|
static void rtl_irq_enable(struct rtl8169_private *tp)
|
||||||
{
|
{
|
||||||
tp->irq_enabled = 1;
|
|
||||||
if (rtl_is_8125(tp))
|
if (rtl_is_8125(tp))
|
||||||
RTL_W32(tp, IntrMask_8125, tp->irq_mask);
|
RTL_W32(tp, IntrMask_8125, tp->irq_mask);
|
||||||
else
|
else
|
||||||
@ -4541,8 +4538,7 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
|
|||||||
struct rtl8169_private *tp = dev_instance;
|
struct rtl8169_private *tp = dev_instance;
|
||||||
u32 status = rtl_get_events(tp);
|
u32 status = rtl_get_events(tp);
|
||||||
|
|
||||||
if (!tp->irq_enabled || (status & 0xffff) == 0xffff ||
|
if ((status & 0xffff) == 0xffff || !(status & tp->irq_mask))
|
||||||
!(status & tp->irq_mask))
|
|
||||||
return IRQ_NONE;
|
return IRQ_NONE;
|
||||||
|
|
||||||
if (unlikely(status & SYSErr)) {
|
if (unlikely(status & SYSErr)) {
|
||||||
@ -4596,10 +4592,8 @@ static int rtl8169_poll(struct napi_struct *napi, int budget)
|
|||||||
|
|
||||||
rtl_tx(dev, tp, budget);
|
rtl_tx(dev, tp, budget);
|
||||||
|
|
||||||
if (work_done < budget) {
|
if (work_done < budget && napi_complete_done(napi, work_done))
|
||||||
napi_complete_done(napi, work_done);
|
|
||||||
rtl_irq_enable(tp);
|
rtl_irq_enable(tp);
|
||||||
}
|
|
||||||
|
|
||||||
return work_done;
|
return work_done;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user