You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
drivers: net: generalize napi_complete_done()
napi_complete_done() allows to opt-in for gro_flush_timeout,
added back in linux-3.19, commit 3b47d30396
("net: gro: add a per device gro flush timer")
This allows for more efficient GRO aggregation without
sacrifying latencies.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
63a6fff353
commit
6ad20165d3
@@ -813,7 +813,7 @@ static int at91_poll(struct napi_struct *napi, int quota)
|
||||
u32 reg_ier = AT91_IRQ_ERR_FRAME;
|
||||
reg_ier |= get_irq_mb_rx(priv) & ~AT91_MB_MASK(priv->rx_next);
|
||||
|
||||
napi_complete(napi);
|
||||
napi_complete_done(napi, work_done);
|
||||
at91_write(priv, AT91_IER, reg_ier);
|
||||
}
|
||||
|
||||
|
||||
@@ -1070,7 +1070,7 @@ static int c_can_poll(struct napi_struct *napi, int quota)
|
||||
|
||||
end:
|
||||
if (work_done < quota) {
|
||||
napi_complete(napi);
|
||||
napi_complete_done(napi, work_done);
|
||||
/* enable all IRQs if we are not in bus off state */
|
||||
if (priv->can.state != CAN_STATE_BUS_OFF)
|
||||
c_can_irq_control(priv, true);
|
||||
|
||||
@@ -703,7 +703,7 @@ static int flexcan_poll(struct napi_struct *napi, int quota)
|
||||
work_done += flexcan_poll_bus_err(dev, reg_esr);
|
||||
|
||||
if (work_done < quota) {
|
||||
napi_complete(napi);
|
||||
napi_complete_done(napi, work_done);
|
||||
/* enable IRQs */
|
||||
flexcan_write(FLEXCAN_IFLAG_DEFAULT, ®s->imask1);
|
||||
flexcan_write(priv->reg_ctrl_default, ®s->ctrl);
|
||||
|
||||
@@ -578,7 +578,7 @@ static int ifi_canfd_poll(struct napi_struct *napi, int quota)
|
||||
work_done += ifi_canfd_do_rx_poll(ndev, quota - work_done);
|
||||
|
||||
if (work_done < quota) {
|
||||
napi_complete(napi);
|
||||
napi_complete_done(napi, work_done);
|
||||
ifi_canfd_irq_enable(ndev, 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -1475,7 +1475,7 @@ static int ican3_napi(struct napi_struct *napi, int budget)
|
||||
/* We have processed all packets that the adapter had, but it
|
||||
* was less than our budget, stop polling */
|
||||
if (received < budget)
|
||||
napi_complete(napi);
|
||||
napi_complete_done(napi, received);
|
||||
|
||||
spin_lock_irqsave(&mod->lock, flags);
|
||||
|
||||
|
||||
@@ -730,7 +730,7 @@ static int m_can_poll(struct napi_struct *napi, int quota)
|
||||
work_done += m_can_do_rx_poll(dev, (quota - work_done));
|
||||
|
||||
if (work_done < quota) {
|
||||
napi_complete(napi);
|
||||
napi_complete_done(napi, work_done);
|
||||
m_can_enable_all_interrupts(priv);
|
||||
}
|
||||
|
||||
|
||||
@@ -695,7 +695,7 @@ static int rcar_can_rx_poll(struct napi_struct *napi, int quota)
|
||||
}
|
||||
/* All packets processed */
|
||||
if (num_pkts < quota) {
|
||||
napi_complete(napi);
|
||||
napi_complete_done(napi, num_pkts);
|
||||
priv->ier |= RCAR_CAN_IER_RXFIE;
|
||||
writeb(priv->ier, &priv->regs->ier);
|
||||
}
|
||||
|
||||
@@ -1512,7 +1512,7 @@ static int rcar_canfd_rx_poll(struct napi_struct *napi, int quota)
|
||||
|
||||
/* All packets processed */
|
||||
if (num_pkts < quota) {
|
||||
napi_complete(napi);
|
||||
napi_complete_done(napi, num_pkts);
|
||||
/* Enable Rx FIFO interrupts */
|
||||
rcar_canfd_set_bit(priv->base, RCANFD_RFCC(ridx),
|
||||
RCANFD_RFCC_RFIE);
|
||||
|
||||
@@ -726,7 +726,7 @@ static int xcan_rx_poll(struct napi_struct *napi, int quota)
|
||||
can_led_event(ndev, CAN_LED_EVENT_RX);
|
||||
|
||||
if (work_done < quota) {
|
||||
napi_complete(napi);
|
||||
napi_complete_done(napi, work_done);
|
||||
ier = priv->read_reg(priv, XCAN_IER_OFFSET);
|
||||
ier |= (XCAN_IXR_RXOK_MASK | XCAN_IXR_RXNEMP_MASK);
|
||||
priv->write_reg(priv, XCAN_IER_OFFSET, ier);
|
||||
|
||||
@@ -1753,7 +1753,7 @@ typhoon_poll(struct napi_struct *napi, int budget)
|
||||
}
|
||||
|
||||
if (work_done < budget) {
|
||||
napi_complete(napi);
|
||||
napi_complete_done(napi, work_done);
|
||||
iowrite32(TYPHOON_INTR_NONE,
|
||||
tp->ioaddr + TYPHOON_REG_INTR_MASK);
|
||||
typhoon_post_pci_writes(tp->ioaddr);
|
||||
|
||||
@@ -1274,7 +1274,7 @@ static int bfin_mac_poll(struct napi_struct *napi, int budget)
|
||||
}
|
||||
|
||||
if (i < budget) {
|
||||
napi_complete(napi);
|
||||
napi_complete_done(napi, i);
|
||||
if (test_and_clear_bit(BFIN_MAC_RX_IRQ_DISABLED, &lp->flags))
|
||||
enable_irq(IRQ_MAC_RX);
|
||||
}
|
||||
|
||||
@@ -3575,7 +3575,7 @@ static int et131x_poll(struct napi_struct *napi, int budget)
|
||||
et131x_handle_send_pkts(adapter);
|
||||
|
||||
if (work_done < budget) {
|
||||
napi_complete(&adapter->napi);
|
||||
napi_complete_done(&adapter->napi, work_done);
|
||||
et131x_enable_interrupts(adapter);
|
||||
}
|
||||
|
||||
|
||||
@@ -513,7 +513,7 @@ static int tse_poll(struct napi_struct *napi, int budget)
|
||||
|
||||
if (rxcomplete < budget) {
|
||||
|
||||
napi_complete(napi);
|
||||
napi_complete_done(napi, rxcomplete);
|
||||
|
||||
netdev_dbg(priv->dev,
|
||||
"NAPI Complete, did %d packets with budget %d\n",
|
||||
|
||||
@@ -840,7 +840,7 @@ static int xgene_enet_napi(struct napi_struct *napi, const int budget)
|
||||
processed = xgene_enet_process_ring(ring, budget);
|
||||
|
||||
if (processed != budget) {
|
||||
napi_complete(napi);
|
||||
napi_complete_done(napi, processed);
|
||||
enable_irq(ring->irq);
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ __acquires(&self->lock)
|
||||
work_done = budget;
|
||||
|
||||
if (work_done < budget) {
|
||||
napi_complete(napi);
|
||||
napi_complete_done(napi, work_done);
|
||||
self->aq_hw_ops->hw_irq_enable(self->aq_hw,
|
||||
1U << self->aq_ring_param.vec_idx);
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ static int arc_emac_poll(struct napi_struct *napi, int budget)
|
||||
|
||||
work_done = arc_emac_rx(ndev, budget);
|
||||
if (work_done < budget) {
|
||||
napi_complete(napi);
|
||||
napi_complete_done(napi, work_done);
|
||||
arc_reg_or(priv, R_ENABLE, RXINT_MASK | TXINT_MASK);
|
||||
}
|
||||
|
||||
|
||||
@@ -311,7 +311,7 @@ static int alx_poll(struct napi_struct *napi, int budget)
|
||||
if (!tx_complete || work == budget)
|
||||
return budget;
|
||||
|
||||
napi_complete(&np->napi);
|
||||
napi_complete_done(&np->napi, work);
|
||||
|
||||
/* enable interrupt */
|
||||
if (alx->flags & ALX_FLAG_USING_MSIX) {
|
||||
|
||||
@@ -1892,7 +1892,7 @@ static int atl1c_clean(struct napi_struct *napi, int budget)
|
||||
|
||||
if (work_done < budget) {
|
||||
quit_polling:
|
||||
napi_complete(napi);
|
||||
napi_complete_done(napi, work_done);
|
||||
adapter->hw.intr_mask |= ISR_RX_PKT;
|
||||
AT_WRITE_REG(&adapter->hw, REG_IMR, adapter->hw.intr_mask);
|
||||
}
|
||||
|
||||
@@ -1526,7 +1526,7 @@ static int atl1e_clean(struct napi_struct *napi, int budget)
|
||||
/* If no Tx and not enough Rx work done, exit the polling mode */
|
||||
if (work_done < budget) {
|
||||
quit_polling:
|
||||
napi_complete(napi);
|
||||
napi_complete_done(napi, work_done);
|
||||
imr_data = AT_READ_REG(&adapter->hw, REG_IMR);
|
||||
AT_WRITE_REG(&adapter->hw, REG_IMR, imr_data | ISR_RX_EVENT);
|
||||
/* test debug */
|
||||
|
||||
@@ -2457,7 +2457,7 @@ static int atl1_rings_clean(struct napi_struct *napi, int budget)
|
||||
if (work_done >= budget)
|
||||
return work_done;
|
||||
|
||||
napi_complete(napi);
|
||||
napi_complete_done(napi, work_done);
|
||||
/* re-enable Interrupt */
|
||||
if (likely(adapter->int_enabled))
|
||||
atlx_imr_set(adapter, IMR_NORMAL_MASK);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user