Commit c1484691 authored by Tony Nguyen's avatar Tony Nguyen

ice: Propagate error codes

As all functions now return standard error codes, propagate the values
being returned instead of converting them to generic values.
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: default avatarGurucharan G <gurucharanx.g@intel.com>
parent 2ccc1c1c
...@@ -806,7 +806,7 @@ ice_vsi_cfg_txq(struct ice_vsi *vsi, struct ice_tx_ring *ring, ...@@ -806,7 +806,7 @@ ice_vsi_cfg_txq(struct ice_vsi *vsi, struct ice_tx_ring *ring,
if (status) { if (status) {
dev_err(ice_pf_to_dev(pf), "Failed to set LAN Tx queue context, error: %d\n", dev_err(ice_pf_to_dev(pf), "Failed to set LAN Tx queue context, error: %d\n",
status); status);
return -ENODEV; return status;
} }
/* Add Tx Queue TEID into the VSI Tx ring from the /* Add Tx Queue TEID into the VSI Tx ring from the
...@@ -964,7 +964,7 @@ ice_vsi_stop_tx_ring(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src, ...@@ -964,7 +964,7 @@ ice_vsi_stop_tx_ring(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src,
} else if (status) { } else if (status) {
dev_dbg(ice_pf_to_dev(vsi->back), "Failed to disable LAN Tx queues, error: %d\n", dev_dbg(ice_pf_to_dev(vsi->back), "Failed to disable LAN Tx queues, error: %d\n",
status); status);
return -ENODEV; return status;
} }
return 0; return 0;
......
...@@ -270,7 +270,6 @@ static int ice_devlink_info_get(struct devlink *devlink, ...@@ -270,7 +270,6 @@ static int ice_devlink_info_get(struct devlink *devlink,
dev_dbg(dev, "Failed to discover device capabilities, status %d aq_err %s\n", dev_dbg(dev, "Failed to discover device capabilities, status %d aq_err %s\n",
err, ice_aq_str(hw->adminq.sq_last_status)); err, ice_aq_str(hw->adminq.sq_last_status));
NL_SET_ERR_MSG_MOD(extack, "Unable to discover device capabilities"); NL_SET_ERR_MSG_MOD(extack, "Unable to discover device capabilities");
err = -EIO;
goto out_free_ctx; goto out_free_ctx;
} }
...@@ -776,7 +775,7 @@ static int ice_devlink_nvm_snapshot(struct devlink *devlink, ...@@ -776,7 +775,7 @@ static int ice_devlink_nvm_snapshot(struct devlink *devlink,
status, hw->adminq.sq_last_status); status, hw->adminq.sq_last_status);
NL_SET_ERR_MSG_MOD(extack, "Failed to acquire NVM semaphore"); NL_SET_ERR_MSG_MOD(extack, "Failed to acquire NVM semaphore");
vfree(nvm_data); vfree(nvm_data);
return -EIO; return status;
} }
status = ice_read_flat_nvm(hw, 0, &nvm_size, nvm_data, false); status = ice_read_flat_nvm(hw, 0, &nvm_size, nvm_data, false);
...@@ -786,7 +785,7 @@ static int ice_devlink_nvm_snapshot(struct devlink *devlink, ...@@ -786,7 +785,7 @@ static int ice_devlink_nvm_snapshot(struct devlink *devlink,
NL_SET_ERR_MSG_MOD(extack, "Failed to read NVM contents"); NL_SET_ERR_MSG_MOD(extack, "Failed to read NVM contents");
ice_release_nvm(hw); ice_release_nvm(hw);
vfree(nvm_data); vfree(nvm_data);
return -EIO; return status;
} }
ice_release_nvm(hw); ice_release_nvm(hw);
...@@ -832,7 +831,7 @@ ice_devlink_devcaps_snapshot(struct devlink *devlink, ...@@ -832,7 +831,7 @@ ice_devlink_devcaps_snapshot(struct devlink *devlink,
status, hw->adminq.sq_last_status); status, hw->adminq.sq_last_status);
NL_SET_ERR_MSG_MOD(extack, "Failed to read device capabilities"); NL_SET_ERR_MSG_MOD(extack, "Failed to read device capabilities");
vfree(devcaps); vfree(devcaps);
return -EIO; return status;
} }
*data = (u8 *)devcaps; *data = (u8 *)devcaps;
......
...@@ -288,7 +288,6 @@ ice_get_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom, ...@@ -288,7 +288,6 @@ ice_get_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom,
if (ret) { if (ret) {
dev_err(dev, "ice_acquire_nvm failed, err %d aq_err %s\n", dev_err(dev, "ice_acquire_nvm failed, err %d aq_err %s\n",
ret, ice_aq_str(hw->adminq.sq_last_status)); ret, ice_aq_str(hw->adminq.sq_last_status));
ret = -EIO;
goto out; goto out;
} }
...@@ -297,7 +296,6 @@ ice_get_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom, ...@@ -297,7 +296,6 @@ ice_get_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom,
if (ret) { if (ret) {
dev_err(dev, "ice_read_flat_nvm failed, err %d aq_err %s\n", dev_err(dev, "ice_read_flat_nvm failed, err %d aq_err %s\n",
ret, ice_aq_str(hw->adminq.sq_last_status)); ret, ice_aq_str(hw->adminq.sq_last_status));
ret = -EIO;
goto release; goto release;
} }
...@@ -1077,10 +1075,8 @@ ice_get_fecparam(struct net_device *netdev, struct ethtool_fecparam *fecparam) ...@@ -1077,10 +1075,8 @@ ice_get_fecparam(struct net_device *netdev, struct ethtool_fecparam *fecparam)
err = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_TOPO_CAP_MEDIA, err = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_TOPO_CAP_MEDIA,
caps, NULL); caps, NULL);
if (err) { if (err)
err = -EAGAIN;
goto done; goto done;
}
/* Set supported/configured FEC modes based on PHY capability */ /* Set supported/configured FEC modes based on PHY capability */
if (caps->caps & ICE_AQC_PHY_EN_AUTO_FEC) if (caps->caps & ICE_AQC_PHY_EN_AUTO_FEC)
...@@ -1987,10 +1983,8 @@ ice_get_link_ksettings(struct net_device *netdev, ...@@ -1987,10 +1983,8 @@ ice_get_link_ksettings(struct net_device *netdev,
err = ice_aq_get_phy_caps(vsi->port_info, false, err = ice_aq_get_phy_caps(vsi->port_info, false,
ICE_AQC_REPORT_ACTIVE_CFG, caps, NULL); ICE_AQC_REPORT_ACTIVE_CFG, caps, NULL);
if (err) { if (err)
err = -EIO;
goto done; goto done;
}
/* Set the advertised flow control based on the PHY capability */ /* Set the advertised flow control based on the PHY capability */
if ((caps->caps & ICE_AQC_PHY_EN_TX_LINK_PAUSE) && if ((caps->caps & ICE_AQC_PHY_EN_TX_LINK_PAUSE) &&
...@@ -2024,10 +2018,8 @@ ice_get_link_ksettings(struct net_device *netdev, ...@@ -2024,10 +2018,8 @@ ice_get_link_ksettings(struct net_device *netdev,
err = ice_aq_get_phy_caps(vsi->port_info, false, err = ice_aq_get_phy_caps(vsi->port_info, false,
ICE_AQC_REPORT_TOPO_CAP_MEDIA, caps, NULL); ICE_AQC_REPORT_TOPO_CAP_MEDIA, caps, NULL);
if (err) { if (err)
err = -EIO;
goto done; goto done;
}
/* Set supported FEC modes based on PHY capability */ /* Set supported FEC modes based on PHY capability */
ethtool_link_ksettings_add_link_mode(ks, supported, FEC_NONE); ethtool_link_ksettings_add_link_mode(ks, supported, FEC_NONE);
...@@ -2233,10 +2225,8 @@ ice_set_link_ksettings(struct net_device *netdev, ...@@ -2233,10 +2225,8 @@ ice_set_link_ksettings(struct net_device *netdev,
else else
err = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_TOPO_CAP_MEDIA, err = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_TOPO_CAP_MEDIA,
phy_caps, NULL); phy_caps, NULL);
if (err) { if (err)
err = -EIO;
goto done; goto done;
}
/* save autoneg out of ksettings */ /* save autoneg out of ksettings */
autoneg = copy_ks.base.autoneg; autoneg = copy_ks.base.autoneg;
...@@ -2303,10 +2293,8 @@ ice_set_link_ksettings(struct net_device *netdev, ...@@ -2303,10 +2293,8 @@ ice_set_link_ksettings(struct net_device *netdev,
/* Call to get the current link speed */ /* Call to get the current link speed */
pi->phy.get_link_info = true; pi->phy.get_link_info = true;
err = ice_get_link_status(pi, &linkup); err = ice_get_link_status(pi, &linkup);
if (err) { if (err)
err = -EIO;
goto done; goto done;
}
curr_link_speed = pi->phy.link_info.link_speed; curr_link_speed = pi->phy.link_info.link_speed;
adv_link_speed = ice_ksettings_find_adv_link_speed(ks); adv_link_speed = ice_ksettings_find_adv_link_speed(ks);
...@@ -2378,7 +2366,6 @@ ice_set_link_ksettings(struct net_device *netdev, ...@@ -2378,7 +2366,6 @@ ice_set_link_ksettings(struct net_device *netdev,
err = ice_aq_set_phy_cfg(&pf->hw, pi, &config, NULL); err = ice_aq_set_phy_cfg(&pf->hw, pi, &config, NULL);
if (err) { if (err) {
netdev_info(netdev, "Set phy config failed,\n"); netdev_info(netdev, "Set phy config failed,\n");
err = -EIO;
goto done; goto done;
} }
...@@ -2546,7 +2533,7 @@ ice_set_rss_hash_opt(struct ice_vsi *vsi, struct ethtool_rxnfc *nfc) ...@@ -2546,7 +2533,7 @@ ice_set_rss_hash_opt(struct ice_vsi *vsi, struct ethtool_rxnfc *nfc)
if (status) { if (status) {
dev_dbg(dev, "ice_add_rss_cfg failed, vsi num = %d, error = %d\n", dev_dbg(dev, "ice_add_rss_cfg failed, vsi num = %d, error = %d\n",
vsi->vsi_num, status); vsi->vsi_num, status);
return -EINVAL; return status;
} }
return 0; return 0;
...@@ -3030,7 +3017,7 @@ ice_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause) ...@@ -3030,7 +3017,7 @@ ice_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause)
NULL); NULL);
if (err) { if (err) {
kfree(pcaps); kfree(pcaps);
return -EIO; return err;
} }
is_an = ice_is_phy_caps_an_enabled(pcaps) ? AUTONEG_ENABLE : is_an = ice_is_phy_caps_an_enabled(pcaps) ? AUTONEG_ENABLE :
...@@ -3927,7 +3914,7 @@ ice_get_module_info(struct net_device *netdev, ...@@ -3927,7 +3914,7 @@ ice_get_module_info(struct net_device *netdev,
status = ice_aq_sff_eeprom(hw, 0, ICE_I2C_EEPROM_DEV_ADDR, 0x00, 0x00, status = ice_aq_sff_eeprom(hw, 0, ICE_I2C_EEPROM_DEV_ADDR, 0x00, 0x00,
0, &value, 1, 0, NULL); 0, &value, 1, 0, NULL);
if (status) if (status)
return -EIO; return status;
switch (value) { switch (value) {
case ICE_MODULE_TYPE_SFP: case ICE_MODULE_TYPE_SFP:
...@@ -3935,12 +3922,12 @@ ice_get_module_info(struct net_device *netdev, ...@@ -3935,12 +3922,12 @@ ice_get_module_info(struct net_device *netdev,
ICE_MODULE_SFF_8472_COMP, 0x00, 0, ICE_MODULE_SFF_8472_COMP, 0x00, 0,
&sff8472_comp, 1, 0, NULL); &sff8472_comp, 1, 0, NULL);
if (status) if (status)
return -EIO; return status;
status = ice_aq_sff_eeprom(hw, 0, ICE_I2C_EEPROM_DEV_ADDR, status = ice_aq_sff_eeprom(hw, 0, ICE_I2C_EEPROM_DEV_ADDR,
ICE_MODULE_SFF_8472_SWAP, 0x00, 0, ICE_MODULE_SFF_8472_SWAP, 0x00, 0,
&sff8472_swap, 1, 0, NULL); &sff8472_swap, 1, 0, NULL);
if (status) if (status)
return -EIO; return status;
if (sff8472_swap & ICE_MODULE_SFF_ADDR_MODE) { if (sff8472_swap & ICE_MODULE_SFF_ADDR_MODE) {
modinfo->type = ETH_MODULE_SFF_8079; modinfo->type = ETH_MODULE_SFF_8079;
...@@ -3960,7 +3947,7 @@ ice_get_module_info(struct net_device *netdev, ...@@ -3960,7 +3947,7 @@ ice_get_module_info(struct net_device *netdev,
ICE_MODULE_REVISION_ADDR, 0x00, 0, ICE_MODULE_REVISION_ADDR, 0x00, 0,
&sff8636_rev, 1, 0, NULL); &sff8636_rev, 1, 0, NULL);
if (status) if (status)
return -EIO; return status;
/* Check revision compliance */ /* Check revision compliance */
if (sff8636_rev > 0x02) { if (sff8636_rev > 0x02) {
/* Module is SFF-8636 compliant */ /* Module is SFF-8636 compliant */
...@@ -4007,7 +3994,7 @@ ice_get_module_eeprom(struct net_device *netdev, ...@@ -4007,7 +3994,7 @@ ice_get_module_eeprom(struct net_device *netdev,
status = ice_aq_sff_eeprom(hw, 0, addr, offset, page, 0, value, 1, 0, status = ice_aq_sff_eeprom(hw, 0, addr, offset, page, 0, value, 1, 0,
NULL); NULL);
if (status) if (status)
return -EIO; return status;
if (value[0] == ICE_MODULE_TYPE_SFP) if (value[0] == ICE_MODULE_TYPE_SFP)
is_sfp = true; is_sfp = true;
......
...@@ -690,7 +690,7 @@ int ice_flash_pldm_image(struct ice_pf *pf, const struct firmware *fw, ...@@ -690,7 +690,7 @@ int ice_flash_pldm_image(struct ice_pf *pf, const struct firmware *fw,
dev_err(dev, "Failed to acquire device flash lock, err %d aq_err %s\n", dev_err(dev, "Failed to acquire device flash lock, err %d aq_err %s\n",
err, ice_aq_str(hw->adminq.sq_last_status)); err, ice_aq_str(hw->adminq.sq_last_status));
NL_SET_ERR_MSG_MOD(extack, "Failed to acquire device flash lock"); NL_SET_ERR_MSG_MOD(extack, "Failed to acquire device flash lock");
return -EIO; return err;
} }
err = pldmfw_flash_image(&priv.context, fw); err = pldmfw_flash_image(&priv.context, fw);
...@@ -744,7 +744,7 @@ int ice_check_for_pending_update(struct ice_pf *pf, const char *component, ...@@ -744,7 +744,7 @@ int ice_check_for_pending_update(struct ice_pf *pf, const char *component,
if (err) { if (err) {
NL_SET_ERR_MSG_MOD(extack, "Unable to read device capabilities"); NL_SET_ERR_MSG_MOD(extack, "Unable to read device capabilities");
kfree(dev_caps); kfree(dev_caps);
return -EIO; return err;
} }
if (dev_caps->common_cap.nvm_update_pending_nvm) { if (dev_caps->common_cap.nvm_update_pending_nvm) {
...@@ -794,7 +794,7 @@ int ice_check_for_pending_update(struct ice_pf *pf, const char *component, ...@@ -794,7 +794,7 @@ int ice_check_for_pending_update(struct ice_pf *pf, const char *component,
dev_err(dev, "Failed to acquire device flash lock, err %d aq_err %s\n", dev_err(dev, "Failed to acquire device flash lock, err %d aq_err %s\n",
err, ice_aq_str(hw->adminq.sq_last_status)); err, ice_aq_str(hw->adminq.sq_last_status));
NL_SET_ERR_MSG_MOD(extack, "Failed to acquire device flash lock"); NL_SET_ERR_MSG_MOD(extack, "Failed to acquire device flash lock");
return -EIO; return err;
} }
pending |= ICE_AQC_NVM_REVERT_LAST_ACTIV; pending |= ICE_AQC_NVM_REVERT_LAST_ACTIV;
......
...@@ -1764,7 +1764,6 @@ int ice_vsi_kill_vlan(struct ice_vsi *vsi, u16 vid) ...@@ -1764,7 +1764,6 @@ int ice_vsi_kill_vlan(struct ice_vsi *vsi, u16 vid)
} else { } else {
dev_err(dev, "Error removing VLAN %d on vsi %i error: %d\n", dev_err(dev, "Error removing VLAN %d on vsi %i error: %d\n",
vid, vsi->vsi_num, err); vid, vsi->vsi_num, err);
err = -EIO;
} }
return err; return err;
...@@ -2127,7 +2126,6 @@ int ice_vsi_manage_vlan_insertion(struct ice_vsi *vsi) ...@@ -2127,7 +2126,6 @@ int ice_vsi_manage_vlan_insertion(struct ice_vsi *vsi)
if (ret) { if (ret) {
dev_err(ice_pf_to_dev(vsi->back), "update VSI for VLAN insert failed, err %d aq_err %s\n", dev_err(ice_pf_to_dev(vsi->back), "update VSI for VLAN insert failed, err %d aq_err %s\n",
ret, ice_aq_str(hw->adminq.sq_last_status)); ret, ice_aq_str(hw->adminq.sq_last_status));
ret = -EIO;
goto out; goto out;
} }
...@@ -2178,7 +2176,6 @@ int ice_vsi_manage_vlan_stripping(struct ice_vsi *vsi, bool ena) ...@@ -2178,7 +2176,6 @@ int ice_vsi_manage_vlan_stripping(struct ice_vsi *vsi, bool ena)
if (ret) { if (ret) {
dev_err(ice_pf_to_dev(vsi->back), "update VSI for VLAN strip failed, ena = %d err %d aq_err %s\n", dev_err(ice_pf_to_dev(vsi->back), "update VSI for VLAN strip failed, ena = %d err %d aq_err %s\n",
ena, ret, ice_aq_str(hw->adminq.sq_last_status)); ena, ret, ice_aq_str(hw->adminq.sq_last_status));
ret = -EIO;
goto out; goto out;
} }
...@@ -3700,7 +3697,6 @@ int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc) ...@@ -3700,7 +3697,6 @@ int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc)
ret = ice_update_vsi(&pf->hw, vsi->idx, ctx, NULL); ret = ice_update_vsi(&pf->hw, vsi->idx, ctx, NULL);
if (ret) { if (ret) {
dev_info(dev, "Failed VSI Update\n"); dev_info(dev, "Failed VSI Update\n");
ret = -EIO;
goto out; goto out;
} }
...@@ -3714,7 +3710,6 @@ int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc) ...@@ -3714,7 +3710,6 @@ int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc)
if (ret) { if (ret) {
dev_err(dev, "VSI %d failed TC config, error %d\n", dev_err(dev, "VSI %d failed TC config, error %d\n",
vsi->vsi_num, ret); vsi->vsi_num, ret);
ret = -EIO;
goto out; goto out;
} }
ice_vsi_update_q_map(vsi, ctx); ice_vsi_update_q_map(vsi, ctx);
...@@ -3833,7 +3828,7 @@ int ice_set_dflt_vsi(struct ice_sw *sw, struct ice_vsi *vsi) ...@@ -3833,7 +3828,7 @@ int ice_set_dflt_vsi(struct ice_sw *sw, struct ice_vsi *vsi)
if (status) { if (status) {
dev_err(dev, "Failed to set VSI %d as the default forwarding VSI, error %d\n", dev_err(dev, "Failed to set VSI %d as the default forwarding VSI, error %d\n",
vsi->vsi_num, status); vsi->vsi_num, status);
return -EIO; return status;
} }
sw->dflt_vsi = vsi; sw->dflt_vsi = vsi;
...@@ -3972,7 +3967,7 @@ int ice_set_min_bw_limit(struct ice_vsi *vsi, u64 min_tx_rate) ...@@ -3972,7 +3967,7 @@ int ice_set_min_bw_limit(struct ice_vsi *vsi, u64 min_tx_rate)
dev_err(dev, "failed to set min Tx rate(%llu Kbps) for %s %d\n", dev_err(dev, "failed to set min Tx rate(%llu Kbps) for %s %d\n",
min_tx_rate, ice_vsi_type_str(vsi->type), min_tx_rate, ice_vsi_type_str(vsi->type),
vsi->idx); vsi->idx);
return -EIO; return status;
} }
dev_dbg(dev, "set min Tx rate(%llu Kbps) for %s\n", dev_dbg(dev, "set min Tx rate(%llu Kbps) for %s\n",
...@@ -3984,7 +3979,7 @@ int ice_set_min_bw_limit(struct ice_vsi *vsi, u64 min_tx_rate) ...@@ -3984,7 +3979,7 @@ int ice_set_min_bw_limit(struct ice_vsi *vsi, u64 min_tx_rate)
if (status) { if (status) {
dev_err(dev, "failed to clear min Tx rate configuration for %s %d\n", dev_err(dev, "failed to clear min Tx rate configuration for %s %d\n",
ice_vsi_type_str(vsi->type), vsi->idx); ice_vsi_type_str(vsi->type), vsi->idx);
return -EIO; return status;
} }
dev_dbg(dev, "cleared min Tx rate configuration for %s %d\n", dev_dbg(dev, "cleared min Tx rate configuration for %s %d\n",
...@@ -4033,7 +4028,7 @@ int ice_set_max_bw_limit(struct ice_vsi *vsi, u64 max_tx_rate) ...@@ -4033,7 +4028,7 @@ int ice_set_max_bw_limit(struct ice_vsi *vsi, u64 max_tx_rate)
dev_err(dev, "failed setting max Tx rate(%llu Kbps) for %s %d\n", dev_err(dev, "failed setting max Tx rate(%llu Kbps) for %s %d\n",
max_tx_rate, ice_vsi_type_str(vsi->type), max_tx_rate, ice_vsi_type_str(vsi->type),
vsi->idx); vsi->idx);
return -EIO; return status;
} }
dev_dbg(dev, "set max Tx rate(%llu Kbps) for %s %d\n", dev_dbg(dev, "set max Tx rate(%llu Kbps) for %s %d\n",
...@@ -4045,7 +4040,7 @@ int ice_set_max_bw_limit(struct ice_vsi *vsi, u64 max_tx_rate) ...@@ -4045,7 +4040,7 @@ int ice_set_max_bw_limit(struct ice_vsi *vsi, u64 max_tx_rate)
if (status) { if (status) {
dev_err(dev, "failed clearing max Tx rate configuration for %s %d\n", dev_err(dev, "failed clearing max Tx rate configuration for %s %d\n",
ice_vsi_type_str(vsi->type), vsi->idx); ice_vsi_type_str(vsi->type), vsi->idx);
return -EIO; return status;
} }
dev_dbg(dev, "cleared max Tx rate configuration for %s %d\n", dev_dbg(dev, "cleared max Tx rate configuration for %s %d\n",
...@@ -4086,7 +4081,7 @@ int ice_set_link(struct ice_vsi *vsi, bool ena) ...@@ -4086,7 +4081,7 @@ int ice_set_link(struct ice_vsi *vsi, bool ena)
dev_err(dev, "can't set link to %s, err %d aq_err %s\n", dev_err(dev, "can't set link to %s, err %d aq_err %s\n",
(ena ? "ON" : "OFF"), status, (ena ? "ON" : "OFF"), status,
ice_aq_str(hw->adminq.sq_last_status)); ice_aq_str(hw->adminq.sq_last_status));
return -EIO; return status;
} }
return 0; return 0;
......
...@@ -157,18 +157,13 @@ static int ice_init_mac_fltr(struct ice_pf *pf) ...@@ -157,18 +157,13 @@ static int ice_init_mac_fltr(struct ice_pf *pf)
{ {
struct ice_vsi *vsi; struct ice_vsi *vsi;
u8 *perm_addr; u8 *perm_addr;
int status;
vsi = ice_get_main_vsi(pf); vsi = ice_get_main_vsi(pf);
if (!vsi) if (!vsi)
return -EINVAL; return -EINVAL;
perm_addr = vsi->port_info->mac.perm_addr; perm_addr = vsi->port_info->mac.perm_addr;
status = ice_fltr_add_mac_and_broadcast(vsi, perm_addr, ICE_FWD_TO_VSI); return ice_fltr_add_mac_and_broadcast(vsi, perm_addr, ICE_FWD_TO_VSI);
if (status)
return -EIO;
return 0;
} }
/** /**
...@@ -253,10 +248,7 @@ static int ice_set_promisc(struct ice_vsi *vsi, u8 promisc_m) ...@@ -253,10 +248,7 @@ static int ice_set_promisc(struct ice_vsi *vsi, u8 promisc_m)
status = ice_fltr_set_vlan_vsi_promisc(&vsi->back->hw, vsi, promisc_m); status = ice_fltr_set_vlan_vsi_promisc(&vsi->back->hw, vsi, promisc_m);
else else
status = ice_fltr_set_vsi_promisc(&vsi->back->hw, vsi->idx, promisc_m, 0); status = ice_fltr_set_vsi_promisc(&vsi->back->hw, vsi->idx, promisc_m, 0);
if (status) return status;
return -EIO;
return 0;
} }
/** /**
...@@ -276,10 +268,7 @@ static int ice_clear_promisc(struct ice_vsi *vsi, u8 promisc_m) ...@@ -276,10 +268,7 @@ static int ice_clear_promisc(struct ice_vsi *vsi, u8 promisc_m)
status = ice_fltr_clear_vlan_vsi_promisc(&vsi->back->hw, vsi, promisc_m); status = ice_fltr_clear_vlan_vsi_promisc(&vsi->back->hw, vsi, promisc_m);
else else
status = ice_fltr_clear_vsi_promisc(&vsi->back->hw, vsi->idx, promisc_m, 0); status = ice_fltr_clear_vsi_promisc(&vsi->back->hw, vsi->idx, promisc_m, 0);
if (status) return status;
return -EIO;
return 0;
} }
/** /**
...@@ -356,7 +345,6 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi) ...@@ -356,7 +345,6 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)
netdev_warn(netdev, "Reached MAC filter limit, forcing promisc mode on VSI %d\n", netdev_warn(netdev, "Reached MAC filter limit, forcing promisc mode on VSI %d\n",
vsi->vsi_num); vsi->vsi_num);
} else { } else {
err = -EIO;
goto out; goto out;
} }
} }
...@@ -1889,7 +1877,6 @@ static int ice_init_nvm_phy_type(struct ice_port_info *pi) ...@@ -1889,7 +1877,6 @@ static int ice_init_nvm_phy_type(struct ice_port_info *pi)
if (err) { if (err) {
dev_err(ice_pf_to_dev(pf), "Get PHY capability failed.\n"); dev_err(ice_pf_to_dev(pf), "Get PHY capability failed.\n");
err = -EIO;
goto out; goto out;
} }
...@@ -2005,7 +1992,6 @@ static int ice_init_phy_user_cfg(struct ice_port_info *pi) ...@@ -2005,7 +1992,6 @@ static int ice_init_phy_user_cfg(struct ice_port_info *pi)
pcaps, NULL); pcaps, NULL);
if (err) { if (err) {
dev_err(ice_pf_to_dev(pf), "Get PHY capability failed.\n"); dev_err(ice_pf_to_dev(pf), "Get PHY capability failed.\n");
err = -EIO;
goto err_out; goto err_out;
} }
...@@ -2084,7 +2070,6 @@ static int ice_configure_phy(struct ice_vsi *vsi) ...@@ -2084,7 +2070,6 @@ static int ice_configure_phy(struct ice_vsi *vsi)
if (err) { if (err) {
dev_err(dev, "Failed to get PHY configuration, VSI %d error %d\n", dev_err(dev, "Failed to get PHY configuration, VSI %d error %d\n",
vsi->vsi_num, err); vsi->vsi_num, err);
err = -EIO;
goto done; goto done;
} }
...@@ -2106,7 +2091,6 @@ static int ice_configure_phy(struct ice_vsi *vsi) ...@@ -2106,7 +2091,6 @@ static int ice_configure_phy(struct ice_vsi *vsi)
if (err) { if (err) {
dev_err(dev, "Failed to get PHY caps, VSI %d error %d\n", dev_err(dev, "Failed to get PHY caps, VSI %d error %d\n",
vsi->vsi_num, err); vsi->vsi_num, err);
err = -EIO;
goto done; goto done;
} }
...@@ -2160,11 +2144,9 @@ static int ice_configure_phy(struct ice_vsi *vsi) ...@@ -2160,11 +2144,9 @@ static int ice_configure_phy(struct ice_vsi *vsi)
cfg->caps |= ICE_AQ_PHY_ENA_AUTO_LINK_UPDT | ICE_AQ_PHY_ENA_LINK; cfg->caps |= ICE_AQ_PHY_ENA_AUTO_LINK_UPDT | ICE_AQ_PHY_ENA_LINK;
err = ice_aq_set_phy_cfg(&pf->hw, pi, cfg, NULL); err = ice_aq_set_phy_cfg(&pf->hw, pi, cfg, NULL);
if (err) { if (err)
dev_err(dev, "Failed to set phy config, VSI %d error %d\n", dev_err(dev, "Failed to set phy config, VSI %d error %d\n",
vsi->vsi_num, err); vsi->vsi_num, err);
err = -EIO;
}
kfree(cfg); kfree(cfg);
done: done:
...@@ -3542,10 +3524,8 @@ static int ice_setup_pf_sw(struct ice_pf *pf) ...@@ -3542,10 +3524,8 @@ static int ice_setup_pf_sw(struct ice_pf *pf)
INIT_LIST_HEAD(&vsi->ch_list); INIT_LIST_HEAD(&vsi->ch_list);
status = ice_cfg_netdev(vsi); status = ice_cfg_netdev(vsi);
if (status) { if (status)
status = -ENODEV;
goto unroll_vsi_setup; goto unroll_vsi_setup;
}
/* netdev has to be configured before setting frame size */ /* netdev has to be configured before setting frame size */
ice_vsi_cfg_frame_size(vsi); ice_vsi_cfg_frame_size(vsi);
...@@ -3569,7 +3549,6 @@ static int ice_setup_pf_sw(struct ice_pf *pf) ...@@ -3569,7 +3549,6 @@ static int ice_setup_pf_sw(struct ice_pf *pf)
if (status) { if (status) {
dev_err(dev, "Failed to set CPU Rx map VSI %d error %d\n", dev_err(dev, "Failed to set CPU Rx map VSI %d error %d\n",
vsi->vsi_num, status); vsi->vsi_num, status);
status = -EINVAL;
goto unroll_napi_add; goto unroll_napi_add;
} }
status = ice_init_mac_fltr(pf); status = ice_init_mac_fltr(pf);
...@@ -5486,13 +5465,11 @@ ice_set_tx_maxrate(struct net_device *netdev, int queue_index, u32 maxrate) ...@@ -5486,13 +5465,11 @@ ice_set_tx_maxrate(struct net_device *netdev, int queue_index, u32 maxrate)
else else
status = ice_cfg_q_bw_lmt(vsi->port_info, vsi->idx, tc, status = ice_cfg_q_bw_lmt(vsi->port_info, vsi->idx, tc,
q_handle, ICE_MAX_BW, maxrate * 1000); q_handle, ICE_MAX_BW, maxrate * 1000);
if (status) { if (status)
netdev_err(netdev, "Unable to set Tx max rate, error %d\n", netdev_err(netdev, "Unable to set Tx max rate, error %d\n",
status); status);
return -EIO;
}
return 0; return status;
} }
/** /**
...@@ -6547,7 +6524,7 @@ static int ice_vsi_rebuild_by_type(struct ice_pf *pf, enum ice_vsi_type type) ...@@ -6547,7 +6524,7 @@ static int ice_vsi_rebuild_by_type(struct ice_pf *pf, enum ice_vsi_type type)
if (err) { if (err) {
dev_err(dev, "replay VSI failed, error %d, VSI index %d, type %s\n", dev_err(dev, "replay VSI failed, error %d, VSI index %d, type %s\n",
err, vsi->idx, ice_vsi_type_str(type)); err, vsi->idx, ice_vsi_type_str(type));
return -EIO; return err;
} }
/* Re-map HW VSI number, using VSI handle that has been /* Re-map HW VSI number, using VSI handle that has been
...@@ -6950,13 +6927,11 @@ int ice_set_rss_lut(struct ice_vsi *vsi, u8 *lut, u16 lut_size) ...@@ -6950,13 +6927,11 @@ int ice_set_rss_lut(struct ice_vsi *vsi, u8 *lut, u16 lut_size)
params.lut = lut; params.lut = lut;
status = ice_aq_set_rss_lut(hw, &params); status = ice_aq_set_rss_lut(hw, &params);
if (status) { if (status)
dev_err(ice_pf_to_dev(vsi->back), "Cannot set RSS lut, err %d aq_err %s\n", dev_err(ice_pf_to_dev(vsi->back), "Cannot set RSS lut, err %d aq_err %s\n",
status, ice_aq_str(hw->adminq.sq_last_status)); status, ice_aq_str(hw->adminq.sq_last_status));
return -EIO;
}
return 0; return status;
} }
/** /**
...@@ -6975,13 +6950,11 @@ int ice_set_rss_key(struct ice_vsi *vsi, u8 *seed) ...@@ -6975,13 +6950,11 @@ int ice_set_rss_key(struct ice_vsi *vsi, u8 *seed)
return -EINVAL; return -EINVAL;
status = ice_aq_set_rss_key(hw, vsi->idx, (struct ice_aqc_get_set_rss_keys *)seed); status = ice_aq_set_rss_key(hw, vsi->idx, (struct ice_aqc_get_set_rss_keys *)seed);
if (status) { if (status)
dev_err(ice_pf_to_dev(vsi->back), "Cannot set RSS key, err %d aq_err %s\n", dev_err(ice_pf_to_dev(vsi->back), "Cannot set RSS key, err %d aq_err %s\n",
status, ice_aq_str(hw->adminq.sq_last_status)); status, ice_aq_str(hw->adminq.sq_last_status));
return -EIO;
}
return 0; return status;
} }
/** /**
...@@ -7007,13 +6980,11 @@ int ice_get_rss_lut(struct ice_vsi *vsi, u8 *lut, u16 lut_size) ...@@ -7007,13 +6980,11 @@ int ice_get_rss_lut(struct ice_vsi *vsi, u8 *lut, u16 lut_size)
params.lut = lut; params.lut = lut;
status = ice_aq_get_rss_lut(hw, &params); status = ice_aq_get_rss_lut(hw, &params);
if (status) { if (status)
dev_err(ice_pf_to_dev(vsi->back), "Cannot get RSS lut, err %d aq_err %s\n", dev_err(ice_pf_to_dev(vsi->back), "Cannot get RSS lut, err %d aq_err %s\n",
status, ice_aq_str(hw->adminq.sq_last_status)); status, ice_aq_str(hw->adminq.sq_last_status));
return -EIO;
}
return 0; return status;
} }
/** /**
...@@ -7032,13 +7003,11 @@ int ice_get_rss_key(struct ice_vsi *vsi, u8 *seed) ...@@ -7032,13 +7003,11 @@ int ice_get_rss_key(struct ice_vsi *vsi, u8 *seed)
return -EINVAL; return -EINVAL;
status = ice_aq_get_rss_key(hw, vsi->idx, (struct ice_aqc_get_set_rss_keys *)seed); status = ice_aq_get_rss_key(hw, vsi->idx, (struct ice_aqc_get_set_rss_keys *)seed);
if (status) { if (status)
dev_err(ice_pf_to_dev(vsi->back), "Cannot get RSS key, err %d aq_err %s\n", dev_err(ice_pf_to_dev(vsi->back), "Cannot get RSS key, err %d aq_err %s\n",
status, ice_aq_str(hw->adminq.sq_last_status)); status, ice_aq_str(hw->adminq.sq_last_status));
return -EIO;
}
return 0; return status;
} }
/** /**
...@@ -7101,7 +7070,6 @@ static int ice_vsi_update_bridge_mode(struct ice_vsi *vsi, u16 bmode) ...@@ -7101,7 +7070,6 @@ static int ice_vsi_update_bridge_mode(struct ice_vsi *vsi, u16 bmode)
if (ret) { if (ret) {
dev_err(ice_pf_to_dev(vsi->back), "update VSI for bridge mode failed, bmode = %d err %d aq_err %s\n", dev_err(ice_pf_to_dev(vsi->back), "update VSI for bridge mode failed, bmode = %d err %d aq_err %s\n",
bmode, ret, ice_aq_str(hw->adminq.sq_last_status)); bmode, ret, ice_aq_str(hw->adminq.sq_last_status));
ret = -EIO;
goto out; goto out;
} }
/* Update sw flags for book keeping */ /* Update sw flags for book keeping */
...@@ -7173,7 +7141,7 @@ ice_bridge_setlink(struct net_device *dev, struct nlmsghdr *nlh, ...@@ -7173,7 +7141,7 @@ ice_bridge_setlink(struct net_device *dev, struct nlmsghdr *nlh,
ice_aq_str(hw->adminq.sq_last_status)); ice_aq_str(hw->adminq.sq_last_status));
/* revert hw->evb_veb */ /* revert hw->evb_veb */
hw->evb_veb = (pf_sw->bridge_mode == BRIDGE_MODE_VEB); hw->evb_veb = (pf_sw->bridge_mode == BRIDGE_MODE_VEB);
return -EIO; return err;
} }
pf_sw->bridge_mode = mode; pf_sw->bridge_mode = mode;
...@@ -8361,7 +8329,7 @@ int ice_open_internal(struct net_device *netdev) ...@@ -8361,7 +8329,7 @@ int ice_open_internal(struct net_device *netdev)
err = ice_update_link_info(pi); err = ice_update_link_info(pi);
if (err) { if (err) {
netdev_err(netdev, "Failed to get link info, error %d\n", err); netdev_err(netdev, "Failed to get link info, error %d\n", err);
return -EIO; return err;
} }
ice_check_link_cfg_err(pf, pi->phy.link_info.link_cfg_err); ice_check_link_cfg_err(pf, pi->phy.link_info.link_cfg_err);
......
...@@ -455,7 +455,6 @@ ice_eswitch_add_tc_fltr(struct ice_vsi *vsi, struct ice_tc_flower_fltr *fltr) ...@@ -455,7 +455,6 @@ ice_eswitch_add_tc_fltr(struct ice_vsi *vsi, struct ice_tc_flower_fltr *fltr)
goto exit; goto exit;
} else if (ret) { } else if (ret) {
NL_SET_ERR_MSG_MOD(fltr->extack, "Unable to add filter due to error"); NL_SET_ERR_MSG_MOD(fltr->extack, "Unable to add filter due to error");
ret = -EIO;
goto exit; goto exit;
} }
......
...@@ -680,7 +680,6 @@ static int ice_vsi_manage_pvid(struct ice_vsi *vsi, u16 pvid_info, bool enable) ...@@ -680,7 +680,6 @@ static int ice_vsi_manage_pvid(struct ice_vsi *vsi, u16 pvid_info, bool enable)
if (ret) { if (ret) {
dev_info(ice_hw_to_dev(hw), "update VSI for port VLAN failed, err %d aq_err %s\n", dev_info(ice_hw_to_dev(hw), "update VSI for port VLAN failed, err %d aq_err %s\n",
ret, ice_aq_str(hw->adminq.sq_last_status)); ret, ice_aq_str(hw->adminq.sq_last_status));
ret = -EIO;
goto out; goto out;
} }
...@@ -2945,7 +2944,6 @@ int ice_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool ena) ...@@ -2945,7 +2944,6 @@ int ice_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool ena)
if (ret) { if (ret) {
dev_err(dev, "Failed to %sable spoofchk on VF %d VSI %d\n error %d\n", dev_err(dev, "Failed to %sable spoofchk on VF %d VSI %d\n error %d\n",
ena ? "en" : "dis", vf->vf_id, vf_vsi->vsi_num, ret); ena ? "en" : "dis", vf->vf_id, vf_vsi->vsi_num, ret);
ret = -EIO;
goto out; goto out;
} }
...@@ -3801,7 +3799,7 @@ ice_vc_add_mac_addr(struct ice_vf *vf, struct ice_vsi *vsi, ...@@ -3801,7 +3799,7 @@ ice_vc_add_mac_addr(struct ice_vf *vf, struct ice_vsi *vsi,
} else if (ret) { } else if (ret) {
dev_err(dev, "Failed to add MAC %pM for VF %d\n, error %d\n", dev_err(dev, "Failed to add MAC %pM for VF %d\n, error %d\n",
mac_addr, vf->vf_id, ret); mac_addr, vf->vf_id, ret);
return -EIO; return ret;
} else { } else {
vf->num_mac++; vf->num_mac++;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment