Skip to content

Commit cbf996f

Browse files
mfijalkoanguy11
authored andcommitted
ixgbe: {dis, en}able irqs in ixgbe_txrx_ring_{dis, en}able
Currently routines that are supposed to toggle state of ring pair do not take care of associated interrupt with queue vector that these rings belong to. This causes funky issues such as dead interface due to irq misconfiguration, as per Pavel's report from Closes: tag. Add a function responsible for disabling single IRQ in EIMC register and call this as a very first thing when disabling ring pair during xsk_pool setup. For enable let's reuse ixgbe_irq_enable_queues(). Besides this, disable/enable NAPI as first/last thing when dealing with closing or opening ring pair that xsk_pool is being configured on. Reported-by: Pavel Vazharov <[email protected]> Closes: https://lore.kernel.org/netdev/CAJEV1ijxNyPTwASJER1bcZzS9nMoZJqfR86nu_3jFFVXzZQ4NA@mail.gmail.com/ Fixes: 024aa58 ("ixgbe: added Rx/Tx ring disable/enable functions") Signed-off-by: Maciej Fijalkowski <[email protected]> Acked-by: Magnus Karlsson <[email protected]> Tested-by: Chandan Kumar Rout <[email protected]> (A Contingent Worker at Intel) Signed-off-by: Tony Nguyen <[email protected]>
1 parent 1c61728 commit cbf996f

File tree

1 file changed

+49
-7
lines changed

1 file changed

+49
-7
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2939,8 +2939,8 @@ static void ixgbe_check_lsc(struct ixgbe_adapter *adapter)
29392939
static inline void ixgbe_irq_enable_queues(struct ixgbe_adapter *adapter,
29402940
u64 qmask)
29412941
{
2942-
u32 mask;
29432942
struct ixgbe_hw *hw = &adapter->hw;
2943+
u32 mask;
29442944

29452945
switch (hw->mac.type) {
29462946
case ixgbe_mac_82598EB:
@@ -10524,6 +10524,44 @@ static void ixgbe_reset_rxr_stats(struct ixgbe_ring *rx_ring)
1052410524
memset(&rx_ring->rx_stats, 0, sizeof(rx_ring->rx_stats));
1052510525
}
1052610526

10527+
/**
10528+
* ixgbe_irq_disable_single - Disable single IRQ vector
10529+
* @adapter: adapter structure
10530+
* @ring: ring index
10531+
**/
10532+
static void ixgbe_irq_disable_single(struct ixgbe_adapter *adapter, u32 ring)
10533+
{
10534+
struct ixgbe_hw *hw = &adapter->hw;
10535+
u64 qmask = BIT_ULL(ring);
10536+
u32 mask;
10537+
10538+
switch (adapter->hw.mac.type) {
10539+
case ixgbe_mac_82598EB:
10540+
mask = qmask & IXGBE_EIMC_RTX_QUEUE;
10541+
IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, mask);
10542+
break;
10543+
case ixgbe_mac_82599EB:
10544+
case ixgbe_mac_X540:
10545+
case ixgbe_mac_X550:
10546+
case ixgbe_mac_X550EM_x:
10547+
case ixgbe_mac_x550em_a:
10548+
mask = (qmask & 0xFFFFFFFF);
10549+
if (mask)
10550+
IXGBE_WRITE_REG(hw, IXGBE_EIMS_EX(0), mask);
10551+
mask = (qmask >> 32);
10552+
if (mask)
10553+
IXGBE_WRITE_REG(hw, IXGBE_EIMS_EX(1), mask);
10554+
break;
10555+
default:
10556+
break;
10557+
}
10558+
IXGBE_WRITE_FLUSH(&adapter->hw);
10559+
if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED)
10560+
synchronize_irq(adapter->msix_entries[ring].vector);
10561+
else
10562+
synchronize_irq(adapter->pdev->irq);
10563+
}
10564+
1052710565
/**
1052810566
* ixgbe_txrx_ring_disable - Disable Rx/Tx/XDP Tx rings
1052910567
* @adapter: adapter structure
@@ -10540,6 +10578,11 @@ void ixgbe_txrx_ring_disable(struct ixgbe_adapter *adapter, int ring)
1054010578
tx_ring = adapter->tx_ring[ring];
1054110579
xdp_ring = adapter->xdp_ring[ring];
1054210580

10581+
ixgbe_irq_disable_single(adapter, ring);
10582+
10583+
/* Rx/Tx/XDP Tx share the same napi context. */
10584+
napi_disable(&rx_ring->q_vector->napi);
10585+
1054310586
ixgbe_disable_txr(adapter, tx_ring);
1054410587
if (xdp_ring)
1054510588
ixgbe_disable_txr(adapter, xdp_ring);
@@ -10548,9 +10591,6 @@ void ixgbe_txrx_ring_disable(struct ixgbe_adapter *adapter, int ring)
1054810591
if (xdp_ring)
1054910592
synchronize_rcu();
1055010593

10551-
/* Rx/Tx/XDP Tx share the same napi context. */
10552-
napi_disable(&rx_ring->q_vector->napi);
10553-
1055410594
ixgbe_clean_tx_ring(tx_ring);
1055510595
if (xdp_ring)
1055610596
ixgbe_clean_tx_ring(xdp_ring);
@@ -10578,9 +10618,6 @@ void ixgbe_txrx_ring_enable(struct ixgbe_adapter *adapter, int ring)
1057810618
tx_ring = adapter->tx_ring[ring];
1057910619
xdp_ring = adapter->xdp_ring[ring];
1058010620

10581-
/* Rx/Tx/XDP Tx share the same napi context. */
10582-
napi_enable(&rx_ring->q_vector->napi);
10583-
1058410621
ixgbe_configure_tx_ring(adapter, tx_ring);
1058510622
if (xdp_ring)
1058610623
ixgbe_configure_tx_ring(adapter, xdp_ring);
@@ -10589,6 +10626,11 @@ void ixgbe_txrx_ring_enable(struct ixgbe_adapter *adapter, int ring)
1058910626
clear_bit(__IXGBE_TX_DISABLED, &tx_ring->state);
1059010627
if (xdp_ring)
1059110628
clear_bit(__IXGBE_TX_DISABLED, &xdp_ring->state);
10629+
10630+
/* Rx/Tx/XDP Tx share the same napi context. */
10631+
napi_enable(&rx_ring->q_vector->napi);
10632+
ixgbe_irq_enable_queues(adapter, BIT_ULL(ring));
10633+
IXGBE_WRITE_FLUSH(&adapter->hw);
1059210634
}
1059310635

1059410636
/**

0 commit comments

Comments
 (0)