ice: add missing checks for PF vsi type
Subsystems (2)
PATCH 1/1 ice: add missing checks for PF vsi type
There were a few places we had missed checking the VSI type to make sure it was definitely a PF VSI, before calling setup functions intended only for the PF VSI.
This doesn't fix any explicit bugs but cleans up the code in a few places and removes one explicit != vsi->type check that can be superseded by this code (it's a super set)
--- drivers/net/ethernet/intel/ice/ice_main.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
drivers/net/ethernet/intel/ice/ice_main.c +8 -9
@@ -6232,15 +6232,12 @@ int ice_vsi_cfg(struct ice_vsi *vsi) {int err; -if (vsi->netdev) { +if (vsi->netdev && vsi->type ==ICE_VSI_PF ) {ice_set_rx_mode (vsi->netdev); -if (vsi->type !=ICE_VSI_LB ) { - err =ice_vsi_vlan_setup (vsi); - -if (err) -return err; - } + err =ice_vsi_vlan_setup (vsi); +if (err) +return err; }ice_vsi_cfg_dcb_rings (vsi);
@@ -6421,7 +6418,7 @@ static int ice_up_complete(struct ice_vsi *vsi)if (vsi->port_info && (vsi->port_info->phy.link_info.link_info &ICE_AQ_LINK_UP ) && - vsi->netdev) { + vsi->netdev && vsi->type ==ICE_VSI_PF ) {ice_print_link_msg (vsi, true);netif_tx_start_all_queues (vsi->netdev);netif_carrier_on (vsi->netdev);
@@ -6432,7 +6429,9 @@ static int ice_up_complete(struct ice_vsi *vsi)* set the baseline so counters are ready when interface is up */ ice_update_eth_stats (vsi); -ice_service_task_schedule (pf); + +if (vsi->type ==ICE_VSI_PF ) +ice_service_task_schedule (pf);return 0 ; }
base-commit: 17251986c9c39d851f2a1d47374afeef3ed36cfe
Signature · 6 lines
2.31.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Quoted 15 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Jesse Brandeburg
Sent: Wednesday, December 14, 2022 5:32 AM
To: [email protected]
Cc: Brandeburg, Jesse <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next v1] ice: add missing checks for PF vsi typeThere were a few places we had missed checking the VSI type to make sure it was definitely a PF VSI, before calling setup functions intended only for the PF VSI.
Quoted 9 lines
This doesn't fix any explicit bugs but cleans up the code in a few places and removes one explicit !=
vsi->typecheck that can be superseded by this code (it's a super set)Signed-off-by Jesse Brandeburg <[email protected]>--- drivers/net/ethernet/intel/ice/ice_main.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan