Skip to content

Commit 9da75a5

Browse files
mfijalkoanguy11
authored andcommitted
ice: toggle netif_carrier when setting up XSK pool
This so we prevent Tx timeout issues. One of conditions checked on running in the background dev_watchdog() is netif_carrier_ok(), so let us turn it off when we disable the queues that belong to a q_vector where XSK pool is being configured. Turn carrier on in ice_qp_ena() only when ice_get_link_status() tells us that physical link is up. Fixes: 2d4238f ("ice: Add support for AF_XDP") Reviewed-by: Shannon Nelson <[email protected]> Tested-by: Chandan Kumar Rout <[email protected]> (A Contingent Worker at Intel) Signed-off-by: Maciej Fijalkowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent d592271 commit 9da75a5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ static int ice_qp_dis(struct ice_vsi *vsi, u16 q_idx)
180180
}
181181

182182
synchronize_net();
183+
netif_carrier_off(vsi->netdev);
183184
netif_tx_stop_queue(netdev_get_tx_queue(vsi->netdev, q_idx));
184185

185186
ice_qvec_dis_irq(vsi, rx_ring, q_vector);
@@ -218,6 +219,7 @@ static int ice_qp_ena(struct ice_vsi *vsi, u16 q_idx)
218219
{
219220
struct ice_q_vector *q_vector;
220221
int fail = 0;
222+
bool link_up;
221223
int err;
222224

223225
err = ice_vsi_cfg_single_txq(vsi, vsi->tx_rings, q_idx);
@@ -248,7 +250,11 @@ static int ice_qp_ena(struct ice_vsi *vsi, u16 q_idx)
248250
ice_qvec_toggle_napi(vsi, q_vector, true);
249251
ice_qvec_ena_irq(vsi, q_vector);
250252

251-
netif_tx_start_queue(netdev_get_tx_queue(vsi->netdev, q_idx));
253+
ice_get_link_status(vsi->port_info, &link_up);
254+
if (link_up) {
255+
netif_tx_start_queue(netdev_get_tx_queue(vsi->netdev, q_idx));
256+
netif_carrier_on(vsi->netdev);
257+
}
252258
clear_bit(ICE_CFG_BUSY, vsi->state);
253259

254260
return fail;

0 commit comments

Comments
 (0)