Skip to content

Commit ce06fcb

Browse files
claudiu-mSasha Levin
authored andcommitted
enetc: Fix tx rings bitmap iteration range, irq handling
[ Upstream commit 0574e20 ] The rings bitmap of an interrupt vector encodes which of the device's rings were assigned to that interrupt vector. Hence the iteration range of the tx rings bitmap (for_each_set_bit()) should be the total number of Tx rings of that netdevice instead of the number of rings assigned to the interrupt vector. Since there are 2 cores, and one interrupt vector for each core, the number of rings asigned to an interrupt vector is half the number of available rings. The impact of this error is that the upper half of the tx rings could still generate interrupts during napi polling. Fixes: d4fd040 ("enetc: Introduce basic PF and VF ENETC ethernet drivers") Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b90ca32 commit ce06fcb

File tree

1 file changed

+2
-2
lines changed
  • drivers/net/ethernet/freescale/enetc

1 file changed

+2
-2
lines changed

drivers/net/ethernet/freescale/enetc/enetc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ static irqreturn_t enetc_msix(int irq, void *data)
254254
/* disable interrupts */
255255
enetc_wr_reg(v->rbier, 0);
256256

257-
for_each_set_bit(i, &v->tx_rings_map, v->count_tx_rings)
257+
for_each_set_bit(i, &v->tx_rings_map, ENETC_MAX_NUM_TXQS)
258258
enetc_wr_reg(v->tbier_base + ENETC_BDR_OFF(i), 0);
259259

260260
napi_schedule_irqoff(&v->napi);
@@ -290,7 +290,7 @@ static int enetc_poll(struct napi_struct *napi, int budget)
290290
/* enable interrupts */
291291
enetc_wr_reg(v->rbier, ENETC_RBIER_RXTIE);
292292

293-
for_each_set_bit(i, &v->tx_rings_map, v->count_tx_rings)
293+
for_each_set_bit(i, &v->tx_rings_map, ENETC_MAX_NUM_TXQS)
294294
enetc_wr_reg(v->tbier_base + ENETC_BDR_OFF(i),
295295
ENETC_TBIER_TXTIE);
296296

0 commit comments

Comments
 (0)