mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-06 17:35:20 +02:00
net: xilinx: axienet: Schedule NAPI in two steps
[ Upstream commitba0da2dc93
] As advised by Documentation/networking/napi.rst, masking IRQs after calling napi_schedule can be racy. Avoid this by only masking/scheduling if napi_schedule_prep returns true. Fixes:9e2bc267e7
("net: axienet: Use NAPI for TX completion path") Fixes:cc37610caa
("net: axienet: implement NAPI and GRO receive") Signed-off-by: Sean Anderson <sean.anderson@linux.dev> Reviewed-by: Shannon Nelson <shannon.nelson@amd.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20240913145711.2284295-1-sean.anderson@linux.dev Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
9360d077d3
commit
bcce13930b
|
@ -1042,9 +1042,10 @@ static irqreturn_t axienet_tx_irq(int irq, void *_ndev)
|
||||||
u32 cr = lp->tx_dma_cr;
|
u32 cr = lp->tx_dma_cr;
|
||||||
|
|
||||||
cr &= ~(XAXIDMA_IRQ_IOC_MASK | XAXIDMA_IRQ_DELAY_MASK);
|
cr &= ~(XAXIDMA_IRQ_IOC_MASK | XAXIDMA_IRQ_DELAY_MASK);
|
||||||
axienet_dma_out32(lp, XAXIDMA_TX_CR_OFFSET, cr);
|
if (napi_schedule_prep(&lp->napi_tx)) {
|
||||||
|
axienet_dma_out32(lp, XAXIDMA_TX_CR_OFFSET, cr);
|
||||||
napi_schedule(&lp->napi_tx);
|
__napi_schedule(&lp->napi_tx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
|
@ -1086,9 +1087,10 @@ static irqreturn_t axienet_rx_irq(int irq, void *_ndev)
|
||||||
u32 cr = lp->rx_dma_cr;
|
u32 cr = lp->rx_dma_cr;
|
||||||
|
|
||||||
cr &= ~(XAXIDMA_IRQ_IOC_MASK | XAXIDMA_IRQ_DELAY_MASK);
|
cr &= ~(XAXIDMA_IRQ_IOC_MASK | XAXIDMA_IRQ_DELAY_MASK);
|
||||||
axienet_dma_out32(lp, XAXIDMA_RX_CR_OFFSET, cr);
|
if (napi_schedule_prep(&lp->napi_rx)) {
|
||||||
|
axienet_dma_out32(lp, XAXIDMA_RX_CR_OFFSET, cr);
|
||||||
napi_schedule(&lp->napi_rx);
|
__napi_schedule(&lp->napi_rx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user