Skip to content

Commit 47fe2fc

Browse files
committed
Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2024-03-01 (ixgbe, i40e, ice) This series contains updates to ixgbe, i40e, and ice drivers. Maciej corrects disable flow for ixgbe, i40e, and ice drivers which could cause non-functional interface with AF_XDP. Michal restores host configuration when changing MSI-X count for VFs on ice driver. * '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: ice: reconfig host after changing MSI-X on VF ice: reorder disabling IRQ and NAPI in ice_qp_dis i40e: disable NAPI right after disabling irqs when handling xsk_pool ixgbe: {dis, en}able irqs in ixgbe_txrx_ring_{dis, en}able ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 89d72d4 + 4035c72 commit 47fe2fc

File tree

4 files changed

+64
-14
lines changed

4 files changed

+64
-14
lines changed

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13560,9 +13560,9 @@ int i40e_queue_pair_disable(struct i40e_vsi *vsi, int queue_pair)
1356013560
return err;
1356113561

1356213562
i40e_queue_pair_disable_irq(vsi, queue_pair);
13563+
i40e_queue_pair_toggle_napi(vsi, queue_pair, false /* off */);
1356313564
err = i40e_queue_pair_toggle_rings(vsi, queue_pair, false /* off */);
1356413565
i40e_clean_rx_ring(vsi->rx_rings[queue_pair]);
13565-
i40e_queue_pair_toggle_napi(vsi, queue_pair, false /* off */);
1356613566
i40e_queue_pair_clean_rings(vsi, queue_pair);
1356713567
i40e_queue_pair_reset_stats(vsi, queue_pair);
1356813568

drivers/net/ethernet/intel/ice/ice_sriov.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,7 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count)
10681068
struct ice_pf *pf = pci_get_drvdata(pdev);
10691069
u16 prev_msix, prev_queues, queues;
10701070
bool needs_rebuild = false;
1071+
struct ice_vsi *vsi;
10711072
struct ice_vf *vf;
10721073
int id;
10731074

@@ -1102,6 +1103,10 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count)
11021103
if (!vf)
11031104
return -ENOENT;
11041105

1106+
vsi = ice_get_vf_vsi(vf);
1107+
if (!vsi)
1108+
return -ENOENT;
1109+
11051110
prev_msix = vf->num_msix;
11061111
prev_queues = vf->num_vf_qs;
11071112

@@ -1122,7 +1127,7 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count)
11221127
if (vf->first_vector_idx < 0)
11231128
goto unroll;
11241129

1125-
if (ice_vf_reconfig_vsi(vf)) {
1130+
if (ice_vf_reconfig_vsi(vf) || ice_vf_init_host_cfg(vf, vsi)) {
11261131
/* Try to rebuild with previous values */
11271132
needs_rebuild = true;
11281133
goto unroll;
@@ -1148,8 +1153,10 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count)
11481153
if (vf->first_vector_idx < 0)
11491154
return -EINVAL;
11501155

1151-
if (needs_rebuild)
1156+
if (needs_rebuild) {
11521157
ice_vf_reconfig_vsi(vf);
1158+
ice_vf_init_host_cfg(vf, vsi);
1159+
}
11531160

11541161
ice_ena_vf_mappings(vf);
11551162
ice_put_vf(vf);

drivers/net/ethernet/intel/ice/ice_xsk.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ static int ice_qp_dis(struct ice_vsi *vsi, u16 q_idx)
179179
return -EBUSY;
180180
usleep_range(1000, 2000);
181181
}
182+
183+
ice_qvec_dis_irq(vsi, rx_ring, q_vector);
184+
ice_qvec_toggle_napi(vsi, q_vector, false);
185+
182186
netif_tx_stop_queue(netdev_get_tx_queue(vsi->netdev, q_idx));
183187

184188
ice_fill_txq_meta(vsi, tx_ring, &txq_meta);
@@ -195,13 +199,10 @@ static int ice_qp_dis(struct ice_vsi *vsi, u16 q_idx)
195199
if (err)
196200
return err;
197201
}
198-
ice_qvec_dis_irq(vsi, rx_ring, q_vector);
199-
200202
err = ice_vsi_ctrl_one_rx_ring(vsi, false, q_idx, true);
201203
if (err)
202204
return err;
203205

204-
ice_qvec_toggle_napi(vsi, q_vector, false);
205206
ice_qp_clean_rings(vsi, q_idx);
206207
ice_qp_reset_stats(vsi, q_idx);
207208

@@ -259,11 +260,11 @@ static int ice_qp_ena(struct ice_vsi *vsi, u16 q_idx)
259260
if (err)
260261
return err;
261262

262-
clear_bit(ICE_CFG_BUSY, vsi->state);
263263
ice_qvec_toggle_napi(vsi, q_vector, true);
264264
ice_qvec_ena_irq(vsi, q_vector);
265265

266266
netif_tx_start_queue(netdev_get_tx_queue(vsi->netdev, q_idx));
267+
clear_bit(ICE_CFG_BUSY, vsi->state);
267268

268269
return 0;
269270
}

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)