Skip to content

Commit 7ce7679

Browse files
bengaldavem330
authored andcommitted
net: arc_emac: enable tx interrupts
In the current implementation the cleaning of tx ring is done by the NAPI poll handler, which is scheduled after rx interrupts. Thus, in absence of received packets the reclaim of used tx buffers is never executed, blocking further transmission. This can be easily reproduced starting the transmission of a UDP flow with iperf, which blocks almost immediately because skbs are not returned to the stack and the socket send buffer becomes full. The patch enables tx interrupts so that the tx reclaim is scheduled after completed transmissions. Signed-off-by: Beniamino Galvani <b.galvani@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1d7efe9 commit 7ce7679

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎drivers/net/ethernet/arc/emac_main.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ static int arc_emac_poll(struct napi_struct *napi, int budget)
298298
work_done = arc_emac_rx(ndev, budget);
299299
if (work_done < budget) {
300300
napi_complete(napi);
301-
arc_reg_or(priv, R_ENABLE, RXINT_MASK);
301+
arc_reg_or(priv, R_ENABLE, RXINT_MASK | TXINT_MASK);
302302
}
303303

304304
return work_done;
@@ -327,9 +327,9 @@ static irqreturn_t arc_emac_intr(int irq, void *dev_instance)
327327
/* Reset all flags except "MDIO complete" */
328328
arc_reg_set(priv, R_STATUS, status);
329329

330-
if (status & RXINT_MASK) {
330+
if (status & (RXINT_MASK | TXINT_MASK)) {
331331
if (likely(napi_schedule_prep(&priv->napi))) {
332-
arc_reg_clr(priv, R_ENABLE, RXINT_MASK);
332+
arc_reg_clr(priv, R_ENABLE, RXINT_MASK | TXINT_MASK);
333333
__napi_schedule(&priv->napi);
334334
}
335335
}
@@ -440,7 +440,7 @@ static int arc_emac_open(struct net_device *ndev)
440440
arc_reg_set(priv, R_TX_RING, (unsigned int)priv->txbd_dma);
441441

442442
/* Enable interrupts */
443-
arc_reg_set(priv, R_ENABLE, RXINT_MASK | ERR_MASK);
443+
arc_reg_set(priv, R_ENABLE, RXINT_MASK | TXINT_MASK | ERR_MASK);
444444

445445
/* Set CONTROL */
446446
arc_reg_set(priv, R_CTRL,
@@ -511,7 +511,7 @@ static int arc_emac_stop(struct net_device *ndev)
511511
netif_stop_queue(ndev);
512512

513513
/* Disable interrupts */
514-
arc_reg_clr(priv, R_ENABLE, RXINT_MASK | ERR_MASK);
514+
arc_reg_clr(priv, R_ENABLE, RXINT_MASK | TXINT_MASK | ERR_MASK);
515515

516516
/* Disable EMAC */
517517
arc_reg_clr(priv, R_CTRL, EN_MASK);

0 commit comments

Comments
 (0)