提交 6a8d013e 编写于 作者: J Jesse Brandeburg 提交者: Tony Nguyen

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)
Signed-off-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
上级 d5a6df44
...@@ -6144,16 +6144,13 @@ int ice_vsi_cfg(struct ice_vsi *vsi) ...@@ -6144,16 +6144,13 @@ int ice_vsi_cfg(struct ice_vsi *vsi)
{ {
int err; int err;
if (vsi->netdev) { if (vsi->netdev && vsi->type == ICE_VSI_PF) {
ice_set_rx_mode(vsi->netdev); ice_set_rx_mode(vsi->netdev);
if (vsi->type != ICE_VSI_LB) {
err = ice_vsi_vlan_setup(vsi); err = ice_vsi_vlan_setup(vsi);
if (err) if (err)
return err; return err;
} }
}
ice_vsi_cfg_dcb_rings(vsi); ice_vsi_cfg_dcb_rings(vsi);
err = ice_vsi_cfg_lan_txqs(vsi); err = ice_vsi_cfg_lan_txqs(vsi);
...@@ -6333,7 +6330,7 @@ static int ice_up_complete(struct ice_vsi *vsi) ...@@ -6333,7 +6330,7 @@ static int ice_up_complete(struct ice_vsi *vsi)
if (vsi->port_info && if (vsi->port_info &&
(vsi->port_info->phy.link_info.link_info & ICE_AQ_LINK_UP) && (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); ice_print_link_msg(vsi, true);
netif_tx_start_all_queues(vsi->netdev); netif_tx_start_all_queues(vsi->netdev);
netif_carrier_on(vsi->netdev); netif_carrier_on(vsi->netdev);
...@@ -6344,6 +6341,8 @@ static int ice_up_complete(struct ice_vsi *vsi) ...@@ -6344,6 +6341,8 @@ static int ice_up_complete(struct ice_vsi *vsi)
* set the baseline so counters are ready when interface is up * set the baseline so counters are ready when interface is up
*/ */
ice_update_eth_stats(vsi); ice_update_eth_stats(vsi);
if (vsi->type == ICE_VSI_PF)
ice_service_task_schedule(pf); ice_service_task_schedule(pf);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册