Skip to content

Commit f2916ae

Browse files
kubalewskianguy11
authored andcommitted
i40e: Fix oops at i40e_rebuild()
Setup TC before the i40e_setup_pf_switch() call. Memory must be initialized for all the queues before using its resources. Previously it could be possible that a call: xdp_rxq_info_reg(&rx_ring->xdp_rxq, rx_ring->netdev, rx_ring->queue_index, rx_ring->q_vector->napi.napi_id); was made with q_vector being null. Oops could show up with the following sequence: - no driver loaded - FW LLDP agent is on (flag disable-fw-lldp:off) - link is up - DCB configured with number of Traffic Classes that will not divide completely the default number of queues (usually cpu cores) - driver load - set private flag: disable-fw-lldp:on Fixes: 4b208ea ("i40e: Add init and default config of software based DCB") Fixes: b02e5a0 ("xsk: Propagate napi_id to XDP socket Rx path") Signed-off-by: Aleksandr Loktionov <[email protected]> Signed-off-by: Arkadiusz Kubalewski <[email protected]> Tested-by: Tony Brelinski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 347b565 commit f2916ae

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10573,12 +10573,6 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
1057310573
goto end_core_reset;
1057410574
}
1057510575

10576-
if (!lock_acquired)
10577-
rtnl_lock();
10578-
ret = i40e_setup_pf_switch(pf, reinit);
10579-
if (ret)
10580-
goto end_unlock;
10581-
1058210576
#ifdef CONFIG_I40E_DCB
1058310577
/* Enable FW to write a default DCB config on link-up
1058410578
* unless I40E_FLAG_TC_MQPRIO was enabled or DCB
@@ -10607,6 +10601,11 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
1060710601
}
1060810602

1060910603
#endif /* CONFIG_I40E_DCB */
10604+
if (!lock_acquired)
10605+
rtnl_lock();
10606+
ret = i40e_setup_pf_switch(pf, reinit);
10607+
if (ret)
10608+
goto end_unlock;
1061010609

1061110610
/* The driver only wants link up/down and module qualification
1061210611
* reports from firmware. Note the negative logic.

0 commit comments

Comments
 (0)