Commit ea852c17 authored by Gerhard Engleder's avatar Gerhard Engleder Committed by David S. Miller

tsnep: Fix NAPI scheduling

According to the NAPI documentation networking/napi.rst, drivers which
have to mask interrupts explicitly should use the napi_schedule_prep()
and __napi_schedule() calls.

No problem seen so far with current implementation. Nevertheless, let's
align the implementation with documentation.
Signed-off-by: default avatarGerhard Engleder <gerhard@engleder-embedded.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent af21b94b
...@@ -87,8 +87,11 @@ static irqreturn_t tsnep_irq(int irq, void *arg) ...@@ -87,8 +87,11 @@ static irqreturn_t tsnep_irq(int irq, void *arg)
/* handle TX/RX queue 0 interrupt */ /* handle TX/RX queue 0 interrupt */
if ((active & adapter->queue[0].irq_mask) != 0) { if ((active & adapter->queue[0].irq_mask) != 0) {
tsnep_disable_irq(adapter, adapter->queue[0].irq_mask); if (napi_schedule_prep(&adapter->queue[0].napi)) {
napi_schedule(&adapter->queue[0].napi); tsnep_disable_irq(adapter, adapter->queue[0].irq_mask);
/* schedule after masking to avoid races */
__napi_schedule(&adapter->queue[0].napi);
}
} }
return IRQ_HANDLED; return IRQ_HANDLED;
...@@ -99,8 +102,11 @@ static irqreturn_t tsnep_irq_txrx(int irq, void *arg) ...@@ -99,8 +102,11 @@ static irqreturn_t tsnep_irq_txrx(int irq, void *arg)
struct tsnep_queue *queue = arg; struct tsnep_queue *queue = arg;
/* handle TX/RX queue interrupt */ /* handle TX/RX queue interrupt */
tsnep_disable_irq(queue->adapter, queue->irq_mask); if (napi_schedule_prep(&queue->napi)) {
napi_schedule(&queue->napi); tsnep_disable_irq(queue->adapter, queue->irq_mask);
/* schedule after masking to avoid races */
__napi_schedule(&queue->napi);
}
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment