ice: Remove excess error variables
ice_status previously had a variable to contain these values where other error codes had a variable as well. With ice_status now being an int, there is no need for two variables to hold error values. In cases where this occurs, remove one of the excess variables and use a single one. Some initialization of variables are no longer needed and have been removed. Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Tested-by: Gurucharan G <gurucharanx.g@intel.com>
This commit is contained in:
parent
5518ac2a64
commit
2ccc1c1ccc
10 changed files with 223 additions and 282 deletions
|
@ -4447,7 +4447,6 @@ ice_ena_vsi_rdma_qset(struct ice_port_info *pi, u16 vsi_handle, u8 tc,
|
||||||
struct ice_sched_node *parent;
|
struct ice_sched_node *parent;
|
||||||
struct ice_hw *hw;
|
struct ice_hw *hw;
|
||||||
u16 i, buf_size;
|
u16 i, buf_size;
|
||||||
int status;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!pi || pi->port_state != ICE_SCHED_PORT_STATE_READY)
|
if (!pi || pi->port_state != ICE_SCHED_PORT_STATE_READY)
|
||||||
|
@ -4496,12 +4495,10 @@ ice_ena_vsi_rdma_qset(struct ice_port_info *pi, u16 vsi_handle, u8 tc,
|
||||||
node.data.elem_type = ICE_AQC_ELEM_TYPE_LEAF;
|
node.data.elem_type = ICE_AQC_ELEM_TYPE_LEAF;
|
||||||
for (i = 0; i < num_qsets; i++) {
|
for (i = 0; i < num_qsets; i++) {
|
||||||
node.node_teid = buf->rdma_qsets[i].qset_teid;
|
node.node_teid = buf->rdma_qsets[i].qset_teid;
|
||||||
status = ice_sched_add_node(pi, hw->num_tx_sched_layers - 1,
|
ret = ice_sched_add_node(pi, hw->num_tx_sched_layers - 1,
|
||||||
&node);
|
&node);
|
||||||
if (status) {
|
if (ret)
|
||||||
ret = status;
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
qset_teid[i] = le32_to_cpu(node.node_teid);
|
qset_teid[i] = le32_to_cpu(node.node_teid);
|
||||||
}
|
}
|
||||||
rdma_error_exit:
|
rdma_error_exit:
|
||||||
|
|
|
@ -251,7 +251,6 @@ static int ice_devlink_info_get(struct devlink *devlink,
|
||||||
struct device *dev = ice_pf_to_dev(pf);
|
struct device *dev = ice_pf_to_dev(pf);
|
||||||
struct ice_hw *hw = &pf->hw;
|
struct ice_hw *hw = &pf->hw;
|
||||||
struct ice_info_ctx *ctx;
|
struct ice_info_ctx *ctx;
|
||||||
int status;
|
|
||||||
size_t i;
|
size_t i;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
@ -266,20 +265,20 @@ static int ice_devlink_info_get(struct devlink *devlink,
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
/* discover capabilities first */
|
/* discover capabilities first */
|
||||||
status = ice_discover_dev_caps(hw, &ctx->dev_caps);
|
err = ice_discover_dev_caps(hw, &ctx->dev_caps);
|
||||||
if (status) {
|
if (err) {
|
||||||
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",
|
||||||
status, 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;
|
err = -EIO;
|
||||||
goto out_free_ctx;
|
goto out_free_ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->dev_caps.common_cap.nvm_update_pending_orom) {
|
if (ctx->dev_caps.common_cap.nvm_update_pending_orom) {
|
||||||
status = ice_get_inactive_orom_ver(hw, &ctx->pending_orom);
|
err = ice_get_inactive_orom_ver(hw, &ctx->pending_orom);
|
||||||
if (status) {
|
if (err) {
|
||||||
dev_dbg(dev, "Unable to read inactive Option ROM version data, status %d aq_err %s\n",
|
dev_dbg(dev, "Unable to read inactive Option ROM version data, status %d aq_err %s\n",
|
||||||
status, ice_aq_str(hw->adminq.sq_last_status));
|
err, ice_aq_str(hw->adminq.sq_last_status));
|
||||||
|
|
||||||
/* disable display of pending Option ROM */
|
/* disable display of pending Option ROM */
|
||||||
ctx->dev_caps.common_cap.nvm_update_pending_orom = false;
|
ctx->dev_caps.common_cap.nvm_update_pending_orom = false;
|
||||||
|
@ -287,10 +286,10 @@ static int ice_devlink_info_get(struct devlink *devlink,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->dev_caps.common_cap.nvm_update_pending_nvm) {
|
if (ctx->dev_caps.common_cap.nvm_update_pending_nvm) {
|
||||||
status = ice_get_inactive_nvm_ver(hw, &ctx->pending_nvm);
|
err = ice_get_inactive_nvm_ver(hw, &ctx->pending_nvm);
|
||||||
if (status) {
|
if (err) {
|
||||||
dev_dbg(dev, "Unable to read inactive NVM version data, status %d aq_err %s\n",
|
dev_dbg(dev, "Unable to read inactive NVM version data, status %d aq_err %s\n",
|
||||||
status, ice_aq_str(hw->adminq.sq_last_status));
|
err, ice_aq_str(hw->adminq.sq_last_status));
|
||||||
|
|
||||||
/* disable display of pending Option ROM */
|
/* disable display of pending Option ROM */
|
||||||
ctx->dev_caps.common_cap.nvm_update_pending_nvm = false;
|
ctx->dev_caps.common_cap.nvm_update_pending_nvm = false;
|
||||||
|
@ -298,10 +297,10 @@ static int ice_devlink_info_get(struct devlink *devlink,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->dev_caps.common_cap.nvm_update_pending_netlist) {
|
if (ctx->dev_caps.common_cap.nvm_update_pending_netlist) {
|
||||||
status = ice_get_inactive_netlist_ver(hw, &ctx->pending_netlist);
|
err = ice_get_inactive_netlist_ver(hw, &ctx->pending_netlist);
|
||||||
if (status) {
|
if (err) {
|
||||||
dev_dbg(dev, "Unable to read inactive Netlist version data, status %d aq_err %s\n",
|
dev_dbg(dev, "Unable to read inactive Netlist version data, status %d aq_err %s\n",
|
||||||
status, ice_aq_str(hw->adminq.sq_last_status));
|
err, ice_aq_str(hw->adminq.sq_last_status));
|
||||||
|
|
||||||
/* disable display of pending Option ROM */
|
/* disable display of pending Option ROM */
|
||||||
ctx->dev_caps.common_cap.nvm_update_pending_netlist = false;
|
ctx->dev_caps.common_cap.nvm_update_pending_netlist = false;
|
||||||
|
|
|
@ -271,8 +271,7 @@ ice_get_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom,
|
||||||
struct ice_pf *pf = vsi->back;
|
struct ice_pf *pf = vsi->back;
|
||||||
struct ice_hw *hw = &pf->hw;
|
struct ice_hw *hw = &pf->hw;
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
int ret = 0;
|
int ret;
|
||||||
int status;
|
|
||||||
u8 *buf;
|
u8 *buf;
|
||||||
|
|
||||||
dev = ice_pf_to_dev(pf);
|
dev = ice_pf_to_dev(pf);
|
||||||
|
@ -285,19 +284,19 @@ ice_get_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom,
|
||||||
if (!buf)
|
if (!buf)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
status = ice_acquire_nvm(hw, ICE_RES_READ);
|
ret = ice_acquire_nvm(hw, ICE_RES_READ);
|
||||||
if (status) {
|
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",
|
||||||
status, ice_aq_str(hw->adminq.sq_last_status));
|
ret, ice_aq_str(hw->adminq.sq_last_status));
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = ice_read_flat_nvm(hw, eeprom->offset, &eeprom->len, buf,
|
ret = ice_read_flat_nvm(hw, eeprom->offset, &eeprom->len, buf,
|
||||||
false);
|
false);
|
||||||
if (status) {
|
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",
|
||||||
status, ice_aq_str(hw->adminq.sq_last_status));
|
ret, ice_aq_str(hw->adminq.sq_last_status));
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
goto release;
|
goto release;
|
||||||
}
|
}
|
||||||
|
@ -1050,8 +1049,7 @@ ice_get_fecparam(struct net_device *netdev, struct ethtool_fecparam *fecparam)
|
||||||
struct ice_link_status *link_info;
|
struct ice_link_status *link_info;
|
||||||
struct ice_vsi *vsi = np->vsi;
|
struct ice_vsi *vsi = np->vsi;
|
||||||
struct ice_port_info *pi;
|
struct ice_port_info *pi;
|
||||||
int err = 0;
|
int err;
|
||||||
int status;
|
|
||||||
|
|
||||||
pi = vsi->port_info;
|
pi = vsi->port_info;
|
||||||
|
|
||||||
|
@ -1077,9 +1075,9 @@ ice_get_fecparam(struct net_device *netdev, struct ethtool_fecparam *fecparam)
|
||||||
if (!caps)
|
if (!caps)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
status = 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 (status) {
|
if (err) {
|
||||||
err = -EAGAIN;
|
err = -EAGAIN;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
@ -1936,8 +1934,7 @@ ice_get_link_ksettings(struct net_device *netdev,
|
||||||
struct ice_aqc_get_phy_caps_data *caps;
|
struct ice_aqc_get_phy_caps_data *caps;
|
||||||
struct ice_link_status *hw_link_info;
|
struct ice_link_status *hw_link_info;
|
||||||
struct ice_vsi *vsi = np->vsi;
|
struct ice_vsi *vsi = np->vsi;
|
||||||
int err = 0;
|
int err;
|
||||||
int status;
|
|
||||||
|
|
||||||
ethtool_link_ksettings_zero_link_mode(ks, supported);
|
ethtool_link_ksettings_zero_link_mode(ks, supported);
|
||||||
ethtool_link_ksettings_zero_link_mode(ks, advertising);
|
ethtool_link_ksettings_zero_link_mode(ks, advertising);
|
||||||
|
@ -1988,9 +1985,9 @@ ice_get_link_ksettings(struct net_device *netdev,
|
||||||
if (!caps)
|
if (!caps)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
status = 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 (status) {
|
if (err) {
|
||||||
err = -EIO;
|
err = -EIO;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
@ -2025,9 +2022,9 @@ ice_get_link_ksettings(struct net_device *netdev,
|
||||||
caps->link_fec_options & ICE_AQC_PHY_FEC_25G_RS_544_REQ)
|
caps->link_fec_options & ICE_AQC_PHY_FEC_25G_RS_544_REQ)
|
||||||
ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_RS);
|
ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_RS);
|
||||||
|
|
||||||
status = 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 (status) {
|
if (err) {
|
||||||
err = -EIO;
|
err = -EIO;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
@ -2210,9 +2207,8 @@ ice_set_link_ksettings(struct net_device *netdev,
|
||||||
u8 autoneg_changed = 0;
|
u8 autoneg_changed = 0;
|
||||||
u64 phy_type_high = 0;
|
u64 phy_type_high = 0;
|
||||||
u64 phy_type_low = 0;
|
u64 phy_type_low = 0;
|
||||||
int err = 0;
|
|
||||||
bool linkup;
|
bool linkup;
|
||||||
int status;
|
int err;
|
||||||
|
|
||||||
pi = np->vsi->port_info;
|
pi = np->vsi->port_info;
|
||||||
|
|
||||||
|
@ -2232,12 +2228,12 @@ ice_set_link_ksettings(struct net_device *netdev,
|
||||||
|
|
||||||
/* Get the PHY capabilities based on media */
|
/* Get the PHY capabilities based on media */
|
||||||
if (ice_fw_supports_report_dflt_cfg(pi->hw))
|
if (ice_fw_supports_report_dflt_cfg(pi->hw))
|
||||||
status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_DFLT_CFG,
|
err = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_DFLT_CFG,
|
||||||
phy_caps, NULL);
|
phy_caps, NULL);
|
||||||
else
|
else
|
||||||
status = 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 (status) {
|
if (err) {
|
||||||
err = -EIO;
|
err = -EIO;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
@ -2306,8 +2302,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;
|
||||||
status = ice_get_link_status(pi, &linkup);
|
err = ice_get_link_status(pi, &linkup);
|
||||||
if (status) {
|
if (err) {
|
||||||
err = -EIO;
|
err = -EIO;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
@ -2379,8 +2375,8 @@ ice_set_link_ksettings(struct net_device *netdev,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* make the aq call */
|
/* make the aq call */
|
||||||
status = ice_aq_set_phy_cfg(&pf->hw, pi, &config, NULL);
|
err = ice_aq_set_phy_cfg(&pf->hw, pi, &config, NULL);
|
||||||
if (status) {
|
if (err) {
|
||||||
netdev_info(netdev, "Set phy config failed,\n");
|
netdev_info(netdev, "Set phy config failed,\n");
|
||||||
err = -EIO;
|
err = -EIO;
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -3003,9 +2999,8 @@ ice_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause)
|
||||||
struct ice_port_info *pi;
|
struct ice_port_info *pi;
|
||||||
u8 aq_failures;
|
u8 aq_failures;
|
||||||
bool link_up;
|
bool link_up;
|
||||||
int err = 0;
|
|
||||||
int status;
|
|
||||||
u32 is_an;
|
u32 is_an;
|
||||||
|
int err;
|
||||||
|
|
||||||
pi = vsi->port_info;
|
pi = vsi->port_info;
|
||||||
hw_link_info = &pi->phy.link_info;
|
hw_link_info = &pi->phy.link_info;
|
||||||
|
@ -3031,9 +3026,9 @@ ice_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
/* Get current PHY config */
|
/* Get current PHY config */
|
||||||
status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_ACTIVE_CFG, pcaps,
|
err = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_ACTIVE_CFG, pcaps,
|
||||||
NULL);
|
NULL);
|
||||||
if (status) {
|
if (err) {
|
||||||
kfree(pcaps);
|
kfree(pcaps);
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
@ -3071,19 +3066,19 @@ ice_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* Set the FC mode and only restart AN if link is up */
|
/* Set the FC mode and only restart AN if link is up */
|
||||||
status = ice_set_fc(pi, &aq_failures, link_up);
|
err = ice_set_fc(pi, &aq_failures, link_up);
|
||||||
|
|
||||||
if (aq_failures & ICE_SET_FC_AQ_FAIL_GET) {
|
if (aq_failures & ICE_SET_FC_AQ_FAIL_GET) {
|
||||||
netdev_info(netdev, "Set fc failed on the get_phy_capabilities call with err %d aq_err %s\n",
|
netdev_info(netdev, "Set fc failed on the get_phy_capabilities call with err %d aq_err %s\n",
|
||||||
status, ice_aq_str(hw->adminq.sq_last_status));
|
err, ice_aq_str(hw->adminq.sq_last_status));
|
||||||
err = -EAGAIN;
|
err = -EAGAIN;
|
||||||
} else if (aq_failures & ICE_SET_FC_AQ_FAIL_SET) {
|
} else if (aq_failures & ICE_SET_FC_AQ_FAIL_SET) {
|
||||||
netdev_info(netdev, "Set fc failed on the set_phy_config call with err %d aq_err %s\n",
|
netdev_info(netdev, "Set fc failed on the set_phy_config call with err %d aq_err %s\n",
|
||||||
status, ice_aq_str(hw->adminq.sq_last_status));
|
err, ice_aq_str(hw->adminq.sq_last_status));
|
||||||
err = -EAGAIN;
|
err = -EAGAIN;
|
||||||
} else if (aq_failures & ICE_SET_FC_AQ_FAIL_UPDATE) {
|
} else if (aq_failures & ICE_SET_FC_AQ_FAIL_UPDATE) {
|
||||||
netdev_info(netdev, "Set fc failed on the get_link_info call with err %d aq_err %s\n",
|
netdev_info(netdev, "Set fc failed on the get_link_info call with err %d aq_err %s\n",
|
||||||
status, ice_aq_str(hw->adminq.sq_last_status));
|
err, ice_aq_str(hw->adminq.sq_last_status));
|
||||||
err = -EAGAIN;
|
err = -EAGAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -533,7 +533,6 @@ ice_fdir_set_hw_fltr_rule(struct ice_pf *pf, struct ice_flow_seg_info *seg,
|
||||||
u64 entry1_h = 0;
|
u64 entry1_h = 0;
|
||||||
u64 entry2_h = 0;
|
u64 entry2_h = 0;
|
||||||
u64 prof_id;
|
u64 prof_id;
|
||||||
int status;
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
main_vsi = ice_get_main_vsi(pf);
|
main_vsi = ice_get_main_vsi(pf);
|
||||||
|
@ -581,24 +580,20 @@ ice_fdir_set_hw_fltr_rule(struct ice_pf *pf, struct ice_flow_seg_info *seg,
|
||||||
* actions (NULL) and zero actions 0.
|
* actions (NULL) and zero actions 0.
|
||||||
*/
|
*/
|
||||||
prof_id = flow + tun * ICE_FLTR_PTYPE_MAX;
|
prof_id = flow + tun * ICE_FLTR_PTYPE_MAX;
|
||||||
status = ice_flow_add_prof(hw, ICE_BLK_FD, ICE_FLOW_RX, prof_id, seg,
|
err = ice_flow_add_prof(hw, ICE_BLK_FD, ICE_FLOW_RX, prof_id, seg,
|
||||||
TNL_SEG_CNT(tun), &prof);
|
TNL_SEG_CNT(tun), &prof);
|
||||||
if (status)
|
if (err)
|
||||||
return status;
|
return err;
|
||||||
status = ice_flow_add_entry(hw, ICE_BLK_FD, prof_id, main_vsi->idx,
|
err = ice_flow_add_entry(hw, ICE_BLK_FD, prof_id, main_vsi->idx,
|
||||||
main_vsi->idx, ICE_FLOW_PRIO_NORMAL,
|
main_vsi->idx, ICE_FLOW_PRIO_NORMAL,
|
||||||
seg, &entry1_h);
|
seg, &entry1_h);
|
||||||
if (status) {
|
if (err)
|
||||||
err = status;
|
|
||||||
goto err_prof;
|
goto err_prof;
|
||||||
}
|
err = ice_flow_add_entry(hw, ICE_BLK_FD, prof_id, main_vsi->idx,
|
||||||
status = ice_flow_add_entry(hw, ICE_BLK_FD, prof_id, main_vsi->idx,
|
|
||||||
ctrl_vsi->idx, ICE_FLOW_PRIO_NORMAL,
|
ctrl_vsi->idx, ICE_FLOW_PRIO_NORMAL,
|
||||||
seg, &entry2_h);
|
seg, &entry2_h);
|
||||||
if (status) {
|
if (err)
|
||||||
err = status;
|
|
||||||
goto err_entry;
|
goto err_entry;
|
||||||
}
|
|
||||||
|
|
||||||
hw_prof->fdir_seg[tun] = seg;
|
hw_prof->fdir_seg[tun] = seg;
|
||||||
hw_prof->entry_h[0][tun] = entry1_h;
|
hw_prof->entry_h[0][tun] = entry1_h;
|
||||||
|
@ -1192,7 +1187,6 @@ ice_fdir_write_fltr(struct ice_pf *pf, struct ice_fdir_fltr *input, bool add,
|
||||||
struct ice_vsi *ctrl_vsi;
|
struct ice_vsi *ctrl_vsi;
|
||||||
u8 *pkt, *frag_pkt;
|
u8 *pkt, *frag_pkt;
|
||||||
bool has_frag;
|
bool has_frag;
|
||||||
int status;
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
ctrl_vsi = ice_get_ctrl_vsi(pf);
|
ctrl_vsi = ice_get_ctrl_vsi(pf);
|
||||||
|
@ -1209,11 +1203,9 @@ ice_fdir_write_fltr(struct ice_pf *pf, struct ice_fdir_fltr *input, bool add,
|
||||||
}
|
}
|
||||||
|
|
||||||
ice_fdir_get_prgm_desc(hw, input, &desc, add);
|
ice_fdir_get_prgm_desc(hw, input, &desc, add);
|
||||||
status = ice_fdir_get_gen_prgm_pkt(hw, input, pkt, false, is_tun);
|
err = ice_fdir_get_gen_prgm_pkt(hw, input, pkt, false, is_tun);
|
||||||
if (status) {
|
if (err)
|
||||||
err = status;
|
|
||||||
goto err_free_all;
|
goto err_free_all;
|
||||||
}
|
|
||||||
err = ice_prgm_fdir_fltr(ctrl_vsi, &desc, pkt);
|
err = ice_prgm_fdir_fltr(ctrl_vsi, &desc, pkt);
|
||||||
if (err)
|
if (err)
|
||||||
goto err_free_all;
|
goto err_free_all;
|
||||||
|
@ -1223,12 +1215,10 @@ ice_fdir_write_fltr(struct ice_pf *pf, struct ice_fdir_fltr *input, bool add,
|
||||||
if (has_frag) {
|
if (has_frag) {
|
||||||
/* does not return error */
|
/* does not return error */
|
||||||
ice_fdir_get_prgm_desc(hw, input, &desc, add);
|
ice_fdir_get_prgm_desc(hw, input, &desc, add);
|
||||||
status = ice_fdir_get_gen_prgm_pkt(hw, input, frag_pkt, true,
|
err = ice_fdir_get_gen_prgm_pkt(hw, input, frag_pkt, true,
|
||||||
is_tun);
|
is_tun);
|
||||||
if (status) {
|
if (err)
|
||||||
err = status;
|
|
||||||
goto err_frag;
|
goto err_frag;
|
||||||
}
|
|
||||||
err = ice_prgm_fdir_fltr(ctrl_vsi, &desc, frag_pkt);
|
err = ice_prgm_fdir_fltr(ctrl_vsi, &desc, frag_pkt);
|
||||||
if (err)
|
if (err)
|
||||||
goto err_frag;
|
goto err_frag;
|
||||||
|
|
|
@ -276,7 +276,6 @@ ice_write_one_nvm_block(struct ice_pf *pf, u16 module, u32 offset,
|
||||||
struct ice_rq_event_info event;
|
struct ice_rq_event_info event;
|
||||||
struct ice_hw *hw = &pf->hw;
|
struct ice_hw *hw = &pf->hw;
|
||||||
u32 completion_offset;
|
u32 completion_offset;
|
||||||
int status;
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
memset(&event, 0, sizeof(event));
|
memset(&event, 0, sizeof(event));
|
||||||
|
@ -284,11 +283,11 @@ ice_write_one_nvm_block(struct ice_pf *pf, u16 module, u32 offset,
|
||||||
dev_dbg(dev, "Writing block of %u bytes for module 0x%02x at offset %u\n",
|
dev_dbg(dev, "Writing block of %u bytes for module 0x%02x at offset %u\n",
|
||||||
block_size, module, offset);
|
block_size, module, offset);
|
||||||
|
|
||||||
status = ice_aq_update_nvm(hw, module, offset, block_size, block,
|
err = ice_aq_update_nvm(hw, module, offset, block_size, block,
|
||||||
last_cmd, 0, NULL);
|
last_cmd, 0, NULL);
|
||||||
if (status) {
|
if (err) {
|
||||||
dev_err(dev, "Failed to flash module 0x%02x with block of size %u at offset %u, err %d aq_err %s\n",
|
dev_err(dev, "Failed to flash module 0x%02x with block of size %u at offset %u, err %d aq_err %s\n",
|
||||||
module, block_size, offset, status,
|
module, block_size, offset, err,
|
||||||
ice_aq_str(hw->adminq.sq_last_status));
|
ice_aq_str(hw->adminq.sq_last_status));
|
||||||
NL_SET_ERR_MSG_MOD(extack, "Failed to program flash module");
|
NL_SET_ERR_MSG_MOD(extack, "Failed to program flash module");
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
@ -443,7 +442,6 @@ ice_erase_nvm_module(struct ice_pf *pf, u16 module, const char *component,
|
||||||
struct ice_rq_event_info event;
|
struct ice_rq_event_info event;
|
||||||
struct ice_hw *hw = &pf->hw;
|
struct ice_hw *hw = &pf->hw;
|
||||||
struct devlink *devlink;
|
struct devlink *devlink;
|
||||||
int status;
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
dev_dbg(dev, "Beginning erase of flash component '%s', module 0x%02x\n", component, module);
|
dev_dbg(dev, "Beginning erase of flash component '%s', module 0x%02x\n", component, module);
|
||||||
|
@ -454,10 +452,10 @@ ice_erase_nvm_module(struct ice_pf *pf, u16 module, const char *component,
|
||||||
|
|
||||||
devlink_flash_update_timeout_notify(devlink, "Erasing", component, ICE_FW_ERASE_TIMEOUT);
|
devlink_flash_update_timeout_notify(devlink, "Erasing", component, ICE_FW_ERASE_TIMEOUT);
|
||||||
|
|
||||||
status = ice_aq_erase_nvm(hw, module, NULL);
|
err = ice_aq_erase_nvm(hw, module, NULL);
|
||||||
if (status) {
|
if (err) {
|
||||||
dev_err(dev, "Failed to erase %s (module 0x%02x), err %d aq_err %s\n",
|
dev_err(dev, "Failed to erase %s (module 0x%02x), err %d aq_err %s\n",
|
||||||
component, module, status,
|
component, module, err,
|
||||||
ice_aq_str(hw->adminq.sq_last_status));
|
ice_aq_str(hw->adminq.sq_last_status));
|
||||||
NL_SET_ERR_MSG_MOD(extack, "Failed to erase flash module");
|
NL_SET_ERR_MSG_MOD(extack, "Failed to erase flash module");
|
||||||
err = -EIO;
|
err = -EIO;
|
||||||
|
@ -523,15 +521,14 @@ static int ice_switch_flash_banks(struct ice_pf *pf, u8 activate_flags,
|
||||||
struct ice_rq_event_info event;
|
struct ice_rq_event_info event;
|
||||||
struct ice_hw *hw = &pf->hw;
|
struct ice_hw *hw = &pf->hw;
|
||||||
u16 completion_retval;
|
u16 completion_retval;
|
||||||
int status;
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
memset(&event, 0, sizeof(event));
|
memset(&event, 0, sizeof(event));
|
||||||
|
|
||||||
status = ice_nvm_write_activate(hw, activate_flags);
|
err = ice_nvm_write_activate(hw, activate_flags);
|
||||||
if (status) {
|
if (err) {
|
||||||
dev_err(dev, "Failed to switch active flash banks, err %d aq_err %s\n",
|
dev_err(dev, "Failed to switch active flash banks, err %d aq_err %s\n",
|
||||||
status, 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 switch active flash banks");
|
NL_SET_ERR_MSG_MOD(extack, "Failed to switch active flash banks");
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
@ -667,7 +664,6 @@ int ice_flash_pldm_image(struct ice_pf *pf, const struct firmware *fw,
|
||||||
struct device *dev = ice_pf_to_dev(pf);
|
struct device *dev = ice_pf_to_dev(pf);
|
||||||
struct ice_hw *hw = &pf->hw;
|
struct ice_hw *hw = &pf->hw;
|
||||||
struct ice_fwu_priv priv;
|
struct ice_fwu_priv priv;
|
||||||
int status;
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
switch (preservation) {
|
switch (preservation) {
|
||||||
|
@ -689,10 +685,10 @@ int ice_flash_pldm_image(struct ice_pf *pf, const struct firmware *fw,
|
||||||
priv.pf = pf;
|
priv.pf = pf;
|
||||||
priv.activate_flags = preservation;
|
priv.activate_flags = preservation;
|
||||||
|
|
||||||
status = ice_acquire_nvm(hw, ICE_RES_WRITE);
|
err = ice_acquire_nvm(hw, ICE_RES_WRITE);
|
||||||
if (status) {
|
if (err) {
|
||||||
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",
|
||||||
status, 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 -EIO;
|
||||||
}
|
}
|
||||||
|
@ -733,7 +729,6 @@ int ice_check_for_pending_update(struct ice_pf *pf, const char *component,
|
||||||
struct ice_hw_dev_caps *dev_caps;
|
struct ice_hw_dev_caps *dev_caps;
|
||||||
struct ice_hw *hw = &pf->hw;
|
struct ice_hw *hw = &pf->hw;
|
||||||
u8 pending = 0;
|
u8 pending = 0;
|
||||||
int status;
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
dev_caps = kzalloc(sizeof(*dev_caps), GFP_KERNEL);
|
dev_caps = kzalloc(sizeof(*dev_caps), GFP_KERNEL);
|
||||||
|
@ -745,8 +740,8 @@ int ice_check_for_pending_update(struct ice_pf *pf, const char *component,
|
||||||
* may have changed, e.g. if an update was previously completed and
|
* may have changed, e.g. if an update was previously completed and
|
||||||
* the system has not yet rebooted.
|
* the system has not yet rebooted.
|
||||||
*/
|
*/
|
||||||
status = ice_discover_dev_caps(hw, dev_caps);
|
err = ice_discover_dev_caps(hw, dev_caps);
|
||||||
if (status) {
|
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 -EIO;
|
||||||
|
@ -794,11 +789,10 @@ int ice_check_for_pending_update(struct ice_pf *pf, const char *component,
|
||||||
"Canceling previous pending update",
|
"Canceling previous pending update",
|
||||||
component, 0, 0);
|
component, 0, 0);
|
||||||
|
|
||||||
status = ice_acquire_nvm(hw, ICE_RES_WRITE);
|
err = ice_acquire_nvm(hw, ICE_RES_WRITE);
|
||||||
if (status) {
|
if (err) {
|
||||||
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",
|
||||||
status,
|
err, ice_aq_str(hw->adminq.sq_last_status));
|
||||||
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 -EIO;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1750,20 +1750,20 @@ int ice_vsi_kill_vlan(struct ice_vsi *vsi, u16 vid)
|
||||||
{
|
{
|
||||||
struct ice_pf *pf = vsi->back;
|
struct ice_pf *pf = vsi->back;
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
int err = 0;
|
int err;
|
||||||
int status;
|
|
||||||
|
|
||||||
dev = ice_pf_to_dev(pf);
|
dev = ice_pf_to_dev(pf);
|
||||||
|
|
||||||
status = ice_fltr_remove_vlan(vsi, vid, ICE_FWD_TO_VSI);
|
err = ice_fltr_remove_vlan(vsi, vid, ICE_FWD_TO_VSI);
|
||||||
if (!status) {
|
if (!err) {
|
||||||
vsi->num_vlan--;
|
vsi->num_vlan--;
|
||||||
} else if (status == -ENOENT) {
|
} else if (err == -ENOENT) {
|
||||||
dev_dbg(dev, "Failed to remove VLAN %d on VSI %i, it does not exist, error: %d\n",
|
dev_dbg(dev, "Failed to remove VLAN %d on VSI %i, it does not exist, error: %d\n",
|
||||||
vid, vsi->vsi_num, status);
|
vid, vsi->vsi_num, err);
|
||||||
|
err = 0;
|
||||||
} 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, status);
|
vid, vsi->vsi_num, err);
|
||||||
err = -EIO;
|
err = -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2105,8 +2105,7 @@ int ice_vsi_manage_vlan_insertion(struct ice_vsi *vsi)
|
||||||
{
|
{
|
||||||
struct ice_hw *hw = &vsi->back->hw;
|
struct ice_hw *hw = &vsi->back->hw;
|
||||||
struct ice_vsi_ctx *ctxt;
|
struct ice_vsi_ctx *ctxt;
|
||||||
int ret = 0;
|
int ret;
|
||||||
int status;
|
|
||||||
|
|
||||||
ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL);
|
ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL);
|
||||||
if (!ctxt)
|
if (!ctxt)
|
||||||
|
@ -2124,11 +2123,10 @@ int ice_vsi_manage_vlan_insertion(struct ice_vsi *vsi)
|
||||||
|
|
||||||
ctxt->info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_VLAN_VALID);
|
ctxt->info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_VLAN_VALID);
|
||||||
|
|
||||||
status = ice_update_vsi(hw, vsi->idx, ctxt, NULL);
|
ret = ice_update_vsi(hw, vsi->idx, ctxt, NULL);
|
||||||
if (status) {
|
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",
|
||||||
status,
|
ret, ice_aq_str(hw->adminq.sq_last_status));
|
||||||
ice_aq_str(hw->adminq.sq_last_status));
|
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -2148,8 +2146,7 @@ int ice_vsi_manage_vlan_stripping(struct ice_vsi *vsi, bool ena)
|
||||||
{
|
{
|
||||||
struct ice_hw *hw = &vsi->back->hw;
|
struct ice_hw *hw = &vsi->back->hw;
|
||||||
struct ice_vsi_ctx *ctxt;
|
struct ice_vsi_ctx *ctxt;
|
||||||
int status;
|
int ret;
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
/* do not allow modifying VLAN stripping when a port VLAN is configured
|
/* do not allow modifying VLAN stripping when a port VLAN is configured
|
||||||
* on this VSI
|
* on this VSI
|
||||||
|
@ -2177,11 +2174,10 @@ int ice_vsi_manage_vlan_stripping(struct ice_vsi *vsi, bool ena)
|
||||||
|
|
||||||
ctxt->info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_VLAN_VALID);
|
ctxt->info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_VLAN_VALID);
|
||||||
|
|
||||||
status = ice_update_vsi(hw, vsi->idx, ctxt, NULL);
|
ret = ice_update_vsi(hw, vsi->idx, ctxt, NULL);
|
||||||
if (status) {
|
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, status,
|
ena, ret, ice_aq_str(hw->adminq.sq_last_status));
|
||||||
ice_aq_str(hw->adminq.sq_last_status));
|
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -2577,7 +2573,6 @@ ice_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi,
|
||||||
struct device *dev = ice_pf_to_dev(pf);
|
struct device *dev = ice_pf_to_dev(pf);
|
||||||
struct ice_vsi *vsi;
|
struct ice_vsi *vsi;
|
||||||
int ret, i;
|
int ret, i;
|
||||||
int status;
|
|
||||||
|
|
||||||
if (vsi_type == ICE_VSI_CHNL)
|
if (vsi_type == ICE_VSI_CHNL)
|
||||||
vsi = ice_vsi_alloc(pf, vsi_type, ch, ICE_INVAL_VFID);
|
vsi = ice_vsi_alloc(pf, vsi_type, ch, ICE_INVAL_VFID);
|
||||||
|
@ -2724,11 +2719,11 @@ ice_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi,
|
||||||
}
|
}
|
||||||
|
|
||||||
dev_dbg(dev, "vsi->tc_cfg.ena_tc = %d\n", vsi->tc_cfg.ena_tc);
|
dev_dbg(dev, "vsi->tc_cfg.ena_tc = %d\n", vsi->tc_cfg.ena_tc);
|
||||||
status = ice_cfg_vsi_lan(vsi->port_info, vsi->idx, vsi->tc_cfg.ena_tc,
|
ret = ice_cfg_vsi_lan(vsi->port_info, vsi->idx, vsi->tc_cfg.ena_tc,
|
||||||
max_txqs);
|
max_txqs);
|
||||||
if (status) {
|
if (ret) {
|
||||||
dev_err(dev, "VSI %d failed lan queue config, error %d\n",
|
dev_err(dev, "VSI %d failed lan queue config, error %d\n",
|
||||||
vsi->vsi_num, status);
|
vsi->vsi_num, ret);
|
||||||
goto unroll_clear_rings;
|
goto unroll_clear_rings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3274,7 +3269,6 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi)
|
||||||
enum ice_vsi_type vtype;
|
enum ice_vsi_type vtype;
|
||||||
struct ice_pf *pf;
|
struct ice_pf *pf;
|
||||||
int ret, i;
|
int ret, i;
|
||||||
int status;
|
|
||||||
|
|
||||||
if (!vsi)
|
if (!vsi)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -3420,14 +3414,14 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi)
|
||||||
/* If MQPRIO is set, means channel code path, hence for main
|
/* If MQPRIO is set, means channel code path, hence for main
|
||||||
* VSI's, use TC as 1
|
* VSI's, use TC as 1
|
||||||
*/
|
*/
|
||||||
status = ice_cfg_vsi_lan(vsi->port_info, vsi->idx, 1, max_txqs);
|
ret = ice_cfg_vsi_lan(vsi->port_info, vsi->idx, 1, max_txqs);
|
||||||
else
|
else
|
||||||
status = ice_cfg_vsi_lan(vsi->port_info, vsi->idx,
|
ret = ice_cfg_vsi_lan(vsi->port_info, vsi->idx,
|
||||||
vsi->tc_cfg.ena_tc, max_txqs);
|
vsi->tc_cfg.ena_tc, max_txqs);
|
||||||
|
|
||||||
if (status) {
|
if (ret) {
|
||||||
dev_err(ice_pf_to_dev(pf), "VSI %d failed lan queue config, error %d\n",
|
dev_err(ice_pf_to_dev(pf), "VSI %d failed lan queue config, error %d\n",
|
||||||
vsi->vsi_num, status);
|
vsi->vsi_num, ret);
|
||||||
if (init_vsi) {
|
if (init_vsi) {
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
goto err_vectors;
|
goto err_vectors;
|
||||||
|
@ -3665,7 +3659,6 @@ int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc)
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
int i, ret = 0;
|
int i, ret = 0;
|
||||||
u8 num_tc = 0;
|
u8 num_tc = 0;
|
||||||
int status;
|
|
||||||
|
|
||||||
dev = ice_pf_to_dev(pf);
|
dev = ice_pf_to_dev(pf);
|
||||||
if (vsi->tc_cfg.ena_tc == ena_tc &&
|
if (vsi->tc_cfg.ena_tc == ena_tc &&
|
||||||
|
@ -3704,8 +3697,8 @@ int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc)
|
||||||
|
|
||||||
/* must to indicate which section of VSI context are being modified */
|
/* must to indicate which section of VSI context are being modified */
|
||||||
ctx->info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_RXQ_MAP_VALID);
|
ctx->info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_RXQ_MAP_VALID);
|
||||||
status = ice_update_vsi(&pf->hw, vsi->idx, ctx, NULL);
|
ret = ice_update_vsi(&pf->hw, vsi->idx, ctx, NULL);
|
||||||
if (status) {
|
if (ret) {
|
||||||
dev_info(dev, "Failed VSI Update\n");
|
dev_info(dev, "Failed VSI Update\n");
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -3713,15 +3706,14 @@ int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc)
|
||||||
|
|
||||||
if (vsi->type == ICE_VSI_PF &&
|
if (vsi->type == ICE_VSI_PF &&
|
||||||
test_bit(ICE_FLAG_TC_MQPRIO, pf->flags))
|
test_bit(ICE_FLAG_TC_MQPRIO, pf->flags))
|
||||||
status = ice_cfg_vsi_lan(vsi->port_info, vsi->idx, 1,
|
ret = ice_cfg_vsi_lan(vsi->port_info, vsi->idx, 1, max_txqs);
|
||||||
max_txqs);
|
|
||||||
else
|
else
|
||||||
status = ice_cfg_vsi_lan(vsi->port_info, vsi->idx,
|
ret = ice_cfg_vsi_lan(vsi->port_info, vsi->idx,
|
||||||
vsi->tc_cfg.ena_tc, max_txqs);
|
vsi->tc_cfg.ena_tc, max_txqs);
|
||||||
|
|
||||||
if (status) {
|
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, status);
|
vsi->vsi_num, ret);
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
|
@ -296,9 +296,8 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)
|
||||||
struct ice_pf *pf = vsi->back;
|
struct ice_pf *pf = vsi->back;
|
||||||
struct ice_hw *hw = &pf->hw;
|
struct ice_hw *hw = &pf->hw;
|
||||||
u32 changed_flags = 0;
|
u32 changed_flags = 0;
|
||||||
int status = 0;
|
|
||||||
u8 promisc_m;
|
u8 promisc_m;
|
||||||
int err = 0;
|
int err;
|
||||||
|
|
||||||
if (!vsi->netdev)
|
if (!vsi->netdev)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -328,25 +327,23 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remove MAC addresses in the unsync list */
|
/* Remove MAC addresses in the unsync list */
|
||||||
status = ice_fltr_remove_mac_list(vsi, &vsi->tmp_unsync_list);
|
err = ice_fltr_remove_mac_list(vsi, &vsi->tmp_unsync_list);
|
||||||
ice_fltr_free_list(dev, &vsi->tmp_unsync_list);
|
ice_fltr_free_list(dev, &vsi->tmp_unsync_list);
|
||||||
if (status) {
|
if (err) {
|
||||||
netdev_err(netdev, "Failed to delete MAC filters\n");
|
netdev_err(netdev, "Failed to delete MAC filters\n");
|
||||||
/* if we failed because of alloc failures, just bail */
|
/* if we failed because of alloc failures, just bail */
|
||||||
if (status == -ENOMEM) {
|
if (err == -ENOMEM)
|
||||||
err = -ENOMEM;
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Add MAC addresses in the sync list */
|
/* Add MAC addresses in the sync list */
|
||||||
status = ice_fltr_add_mac_list(vsi, &vsi->tmp_sync_list);
|
err = ice_fltr_add_mac_list(vsi, &vsi->tmp_sync_list);
|
||||||
ice_fltr_free_list(dev, &vsi->tmp_sync_list);
|
ice_fltr_free_list(dev, &vsi->tmp_sync_list);
|
||||||
/* If filter is added successfully or already exists, do not go into
|
/* If filter is added successfully or already exists, do not go into
|
||||||
* 'if' condition and report it as error. Instead continue processing
|
* 'if' condition and report it as error. Instead continue processing
|
||||||
* rest of the function.
|
* rest of the function.
|
||||||
*/
|
*/
|
||||||
if (status && status != -EEXIST) {
|
if (err && err != -EEXIST) {
|
||||||
netdev_err(netdev, "Failed to add MAC filters\n");
|
netdev_err(netdev, "Failed to add MAC filters\n");
|
||||||
/* If there is no more space for new umac filters, VSI
|
/* If there is no more space for new umac filters, VSI
|
||||||
* should go into promiscuous mode. There should be some
|
* should go into promiscuous mode. There should be some
|
||||||
|
@ -363,6 +360,7 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
err = 0;
|
||||||
/* check for changes in promiscuous modes */
|
/* check for changes in promiscuous modes */
|
||||||
if (changed_flags & IFF_ALLMULTI) {
|
if (changed_flags & IFF_ALLMULTI) {
|
||||||
if (vsi->current_netdev_flags & IFF_ALLMULTI) {
|
if (vsi->current_netdev_flags & IFF_ALLMULTI) {
|
||||||
|
@ -409,6 +407,7 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)
|
||||||
~IFF_PROMISC;
|
~IFF_PROMISC;
|
||||||
goto out_promisc;
|
goto out_promisc;
|
||||||
}
|
}
|
||||||
|
err = 0;
|
||||||
ice_cfg_vlan_pruning(vsi, false);
|
ice_cfg_vlan_pruning(vsi, false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1879,17 +1878,16 @@ static int ice_init_nvm_phy_type(struct ice_port_info *pi)
|
||||||
{
|
{
|
||||||
struct ice_aqc_get_phy_caps_data *pcaps;
|
struct ice_aqc_get_phy_caps_data *pcaps;
|
||||||
struct ice_pf *pf = pi->hw->back;
|
struct ice_pf *pf = pi->hw->back;
|
||||||
int err = 0;
|
int err;
|
||||||
int status;
|
|
||||||
|
|
||||||
pcaps = kzalloc(sizeof(*pcaps), GFP_KERNEL);
|
pcaps = kzalloc(sizeof(*pcaps), GFP_KERNEL);
|
||||||
if (!pcaps)
|
if (!pcaps)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_TOPO_CAP_NO_MEDIA, pcaps,
|
err = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_TOPO_CAP_NO_MEDIA,
|
||||||
NULL);
|
pcaps, NULL);
|
||||||
|
|
||||||
if (status) {
|
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;
|
err = -EIO;
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -1990,8 +1988,7 @@ static int ice_init_phy_user_cfg(struct ice_port_info *pi)
|
||||||
struct ice_aqc_get_phy_caps_data *pcaps;
|
struct ice_aqc_get_phy_caps_data *pcaps;
|
||||||
struct ice_phy_info *phy = &pi->phy;
|
struct ice_phy_info *phy = &pi->phy;
|
||||||
struct ice_pf *pf = pi->hw->back;
|
struct ice_pf *pf = pi->hw->back;
|
||||||
int err = 0;
|
int err;
|
||||||
int status;
|
|
||||||
|
|
||||||
if (!(phy->link_info.link_info & ICE_AQ_MEDIA_AVAILABLE))
|
if (!(phy->link_info.link_info & ICE_AQ_MEDIA_AVAILABLE))
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
@ -2001,12 +1998,12 @@ static int ice_init_phy_user_cfg(struct ice_port_info *pi)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
if (ice_fw_supports_report_dflt_cfg(pi->hw))
|
if (ice_fw_supports_report_dflt_cfg(pi->hw))
|
||||||
status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_DFLT_CFG,
|
err = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_DFLT_CFG,
|
||||||
pcaps, NULL);
|
pcaps, NULL);
|
||||||
else
|
else
|
||||||
status = 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,
|
||||||
pcaps, NULL);
|
pcaps, NULL);
|
||||||
if (status) {
|
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;
|
err = -EIO;
|
||||||
goto err_out;
|
goto err_out;
|
||||||
|
@ -2062,8 +2059,7 @@ static int ice_configure_phy(struct ice_vsi *vsi)
|
||||||
struct ice_aqc_set_phy_cfg_data *cfg;
|
struct ice_aqc_set_phy_cfg_data *cfg;
|
||||||
struct ice_phy_info *phy = &pi->phy;
|
struct ice_phy_info *phy = &pi->phy;
|
||||||
struct ice_pf *pf = vsi->back;
|
struct ice_pf *pf = vsi->back;
|
||||||
int err = 0;
|
int err;
|
||||||
int status;
|
|
||||||
|
|
||||||
/* Ensure we have media as we cannot configure a medialess port */
|
/* Ensure we have media as we cannot configure a medialess port */
|
||||||
if (!(phy->link_info.link_info & ICE_AQ_MEDIA_AVAILABLE))
|
if (!(phy->link_info.link_info & ICE_AQ_MEDIA_AVAILABLE))
|
||||||
|
@ -2083,11 +2079,11 @@ static int ice_configure_phy(struct ice_vsi *vsi)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
/* Get current PHY config */
|
/* Get current PHY config */
|
||||||
status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_ACTIVE_CFG, pcaps,
|
err = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_ACTIVE_CFG, pcaps,
|
||||||
NULL);
|
NULL);
|
||||||
if (status) {
|
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, status);
|
vsi->vsi_num, err);
|
||||||
err = -EIO;
|
err = -EIO;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
@ -2102,14 +2098,14 @@ static int ice_configure_phy(struct ice_vsi *vsi)
|
||||||
/* Use PHY topology as baseline for configuration */
|
/* Use PHY topology as baseline for configuration */
|
||||||
memset(pcaps, 0, sizeof(*pcaps));
|
memset(pcaps, 0, sizeof(*pcaps));
|
||||||
if (ice_fw_supports_report_dflt_cfg(pi->hw))
|
if (ice_fw_supports_report_dflt_cfg(pi->hw))
|
||||||
status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_DFLT_CFG,
|
err = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_DFLT_CFG,
|
||||||
pcaps, NULL);
|
pcaps, NULL);
|
||||||
else
|
else
|
||||||
status = 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,
|
||||||
pcaps, NULL);
|
pcaps, NULL);
|
||||||
if (status) {
|
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, status);
|
vsi->vsi_num, err);
|
||||||
err = -EIO;
|
err = -EIO;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
@ -2163,10 +2159,10 @@ static int ice_configure_phy(struct ice_vsi *vsi)
|
||||||
/* Enable link and link update */
|
/* Enable link and link update */
|
||||||
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;
|
||||||
|
|
||||||
status = ice_aq_set_phy_cfg(&pf->hw, pi, cfg, NULL);
|
err = ice_aq_set_phy_cfg(&pf->hw, pi, cfg, NULL);
|
||||||
if (status) {
|
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, status);
|
vsi->vsi_num, err);
|
||||||
err = -EIO;
|
err = -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3533,7 +3529,7 @@ static int ice_setup_pf_sw(struct ice_pf *pf)
|
||||||
{
|
{
|
||||||
struct device *dev = ice_pf_to_dev(pf);
|
struct device *dev = ice_pf_to_dev(pf);
|
||||||
struct ice_vsi *vsi;
|
struct ice_vsi *vsi;
|
||||||
int status = 0;
|
int status;
|
||||||
|
|
||||||
if (ice_is_reset_in_progress(pf->state))
|
if (ice_is_reset_in_progress(pf->state))
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
@ -3580,7 +3576,7 @@ static int ice_setup_pf_sw(struct ice_pf *pf)
|
||||||
if (status)
|
if (status)
|
||||||
goto free_cpu_rx_map;
|
goto free_cpu_rx_map;
|
||||||
|
|
||||||
return status;
|
return 0;
|
||||||
|
|
||||||
free_cpu_rx_map:
|
free_cpu_rx_map:
|
||||||
ice_free_cpu_rx_rmap(vsi);
|
ice_free_cpu_rx_rmap(vsi);
|
||||||
|
@ -5357,9 +5353,8 @@ static int ice_set_mac_address(struct net_device *netdev, void *pi)
|
||||||
struct sockaddr *addr = pi;
|
struct sockaddr *addr = pi;
|
||||||
u8 old_mac[ETH_ALEN];
|
u8 old_mac[ETH_ALEN];
|
||||||
u8 flags = 0;
|
u8 flags = 0;
|
||||||
int err = 0;
|
|
||||||
int status;
|
|
||||||
u8 *mac;
|
u8 *mac;
|
||||||
|
int err;
|
||||||
|
|
||||||
mac = (u8 *)addr->sa_data;
|
mac = (u8 *)addr->sa_data;
|
||||||
|
|
||||||
|
@ -5391,22 +5386,22 @@ static int ice_set_mac_address(struct net_device *netdev, void *pi)
|
||||||
netif_addr_unlock_bh(netdev);
|
netif_addr_unlock_bh(netdev);
|
||||||
|
|
||||||
/* Clean up old MAC filter. Not an error if old filter doesn't exist */
|
/* Clean up old MAC filter. Not an error if old filter doesn't exist */
|
||||||
status = ice_fltr_remove_mac(vsi, old_mac, ICE_FWD_TO_VSI);
|
err = ice_fltr_remove_mac(vsi, old_mac, ICE_FWD_TO_VSI);
|
||||||
if (status && status != -ENOENT) {
|
if (err && err != -ENOENT) {
|
||||||
err = -EADDRNOTAVAIL;
|
err = -EADDRNOTAVAIL;
|
||||||
goto err_update_filters;
|
goto err_update_filters;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add filter for new MAC. If filter exists, return success */
|
/* Add filter for new MAC. If filter exists, return success */
|
||||||
status = ice_fltr_add_mac(vsi, mac, ICE_FWD_TO_VSI);
|
err = ice_fltr_add_mac(vsi, mac, ICE_FWD_TO_VSI);
|
||||||
if (status == -EEXIST)
|
if (err == -EEXIST)
|
||||||
/* Although this MAC filter is already present in hardware it's
|
/* Although this MAC filter is already present in hardware it's
|
||||||
* possible in some cases (e.g. bonding) that dev_addr was
|
* possible in some cases (e.g. bonding) that dev_addr was
|
||||||
* modified outside of the driver and needs to be restored back
|
* modified outside of the driver and needs to be restored back
|
||||||
* to this value.
|
* to this value.
|
||||||
*/
|
*/
|
||||||
netdev_dbg(netdev, "filter for MAC %pM already exists\n", mac);
|
netdev_dbg(netdev, "filter for MAC %pM already exists\n", mac);
|
||||||
else if (status)
|
else if (err)
|
||||||
/* error if the new filter addition failed */
|
/* error if the new filter addition failed */
|
||||||
err = -EADDRNOTAVAIL;
|
err = -EADDRNOTAVAIL;
|
||||||
|
|
||||||
|
@ -5425,10 +5420,10 @@ err_update_filters:
|
||||||
|
|
||||||
/* write new MAC address to the firmware */
|
/* write new MAC address to the firmware */
|
||||||
flags = ICE_AQC_MAN_MAC_UPDATE_LAA_WOL;
|
flags = ICE_AQC_MAN_MAC_UPDATE_LAA_WOL;
|
||||||
status = ice_aq_manage_mac_write(hw, mac, flags, NULL);
|
err = ice_aq_manage_mac_write(hw, mac, flags, NULL);
|
||||||
if (status) {
|
if (err) {
|
||||||
netdev_err(netdev, "can't set MAC %pM. write to firmware failed error %d\n",
|
netdev_err(netdev, "can't set MAC %pM. write to firmware failed error %d\n",
|
||||||
mac, status);
|
mac, err);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -6531,7 +6526,6 @@ static void ice_vsi_release_all(struct ice_pf *pf)
|
||||||
static int ice_vsi_rebuild_by_type(struct ice_pf *pf, enum ice_vsi_type type)
|
static int ice_vsi_rebuild_by_type(struct ice_pf *pf, enum ice_vsi_type type)
|
||||||
{
|
{
|
||||||
struct device *dev = ice_pf_to_dev(pf);
|
struct device *dev = ice_pf_to_dev(pf);
|
||||||
int status;
|
|
||||||
int i, err;
|
int i, err;
|
||||||
|
|
||||||
ice_for_each_vsi(pf, i) {
|
ice_for_each_vsi(pf, i) {
|
||||||
|
@ -6549,10 +6543,10 @@ static int ice_vsi_rebuild_by_type(struct ice_pf *pf, enum ice_vsi_type type)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* replay filters for the VSI */
|
/* replay filters for the VSI */
|
||||||
status = ice_replay_vsi(&pf->hw, vsi->idx);
|
err = ice_replay_vsi(&pf->hw, vsi->idx);
|
||||||
if (status) {
|
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",
|
||||||
status, vsi->idx, ice_vsi_type_str(type));
|
err, vsi->idx, ice_vsi_type_str(type));
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6616,7 +6610,6 @@ static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)
|
||||||
{
|
{
|
||||||
struct device *dev = ice_pf_to_dev(pf);
|
struct device *dev = ice_pf_to_dev(pf);
|
||||||
struct ice_hw *hw = &pf->hw;
|
struct ice_hw *hw = &pf->hw;
|
||||||
int ret;
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (test_bit(ICE_DOWN, pf->state))
|
if (test_bit(ICE_DOWN, pf->state))
|
||||||
|
@ -6624,9 +6617,9 @@ static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)
|
||||||
|
|
||||||
dev_dbg(dev, "rebuilding PF after reset_type=%d\n", reset_type);
|
dev_dbg(dev, "rebuilding PF after reset_type=%d\n", reset_type);
|
||||||
|
|
||||||
ret = ice_init_all_ctrlq(hw);
|
err = ice_init_all_ctrlq(hw);
|
||||||
if (ret) {
|
if (err) {
|
||||||
dev_err(dev, "control queues init failed %d\n", ret);
|
dev_err(dev, "control queues init failed %d\n", err);
|
||||||
goto err_init_ctrlq;
|
goto err_init_ctrlq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6640,9 +6633,9 @@ static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)
|
||||||
ice_load_pkg(NULL, pf);
|
ice_load_pkg(NULL, pf);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = ice_clear_pf_cfg(hw);
|
err = ice_clear_pf_cfg(hw);
|
||||||
if (ret) {
|
if (err) {
|
||||||
dev_err(dev, "clear PF configuration failed %d\n", ret);
|
dev_err(dev, "clear PF configuration failed %d\n", err);
|
||||||
goto err_init_ctrlq;
|
goto err_init_ctrlq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6654,21 +6647,21 @@ static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)
|
||||||
|
|
||||||
ice_clear_pxe_mode(hw);
|
ice_clear_pxe_mode(hw);
|
||||||
|
|
||||||
ret = ice_init_nvm(hw);
|
err = ice_init_nvm(hw);
|
||||||
if (ret) {
|
if (err) {
|
||||||
dev_err(dev, "ice_init_nvm failed %d\n", ret);
|
dev_err(dev, "ice_init_nvm failed %d\n", err);
|
||||||
goto err_init_ctrlq;
|
goto err_init_ctrlq;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = ice_get_caps(hw);
|
err = ice_get_caps(hw);
|
||||||
if (ret) {
|
if (err) {
|
||||||
dev_err(dev, "ice_get_caps failed %d\n", ret);
|
dev_err(dev, "ice_get_caps failed %d\n", err);
|
||||||
goto err_init_ctrlq;
|
goto err_init_ctrlq;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = ice_aq_set_mac_cfg(hw, ICE_AQ_SET_MAC_FRAME_SIZE_MAX, NULL);
|
err = ice_aq_set_mac_cfg(hw, ICE_AQ_SET_MAC_FRAME_SIZE_MAX, NULL);
|
||||||
if (ret) {
|
if (err) {
|
||||||
dev_err(dev, "set_mac_cfg failed %d\n", ret);
|
dev_err(dev, "set_mac_cfg failed %d\n", err);
|
||||||
goto err_init_ctrlq;
|
goto err_init_ctrlq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6751,10 +6744,10 @@ static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)
|
||||||
ice_update_pf_netdev_link(pf);
|
ice_update_pf_netdev_link(pf);
|
||||||
|
|
||||||
/* tell the firmware we are up */
|
/* tell the firmware we are up */
|
||||||
ret = ice_send_version(pf);
|
err = ice_send_version(pf);
|
||||||
if (ret) {
|
if (err) {
|
||||||
dev_err(dev, "Rebuild failed due to error sending driver version: %d\n",
|
dev_err(dev, "Rebuild failed due to error sending driver version: %d\n",
|
||||||
ret);
|
err);
|
||||||
goto err_vsi_rebuild;
|
goto err_vsi_rebuild;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7086,8 +7079,7 @@ static int ice_vsi_update_bridge_mode(struct ice_vsi *vsi, u16 bmode)
|
||||||
struct ice_aqc_vsi_props *vsi_props;
|
struct ice_aqc_vsi_props *vsi_props;
|
||||||
struct ice_hw *hw = &vsi->back->hw;
|
struct ice_hw *hw = &vsi->back->hw;
|
||||||
struct ice_vsi_ctx *ctxt;
|
struct ice_vsi_ctx *ctxt;
|
||||||
int ret = 0;
|
int ret;
|
||||||
int status;
|
|
||||||
|
|
||||||
vsi_props = &vsi->info;
|
vsi_props = &vsi->info;
|
||||||
|
|
||||||
|
@ -7105,10 +7097,10 @@ static int ice_vsi_update_bridge_mode(struct ice_vsi *vsi, u16 bmode)
|
||||||
ctxt->info.sw_flags &= ~ICE_AQ_VSI_SW_FLAG_ALLOW_LB;
|
ctxt->info.sw_flags &= ~ICE_AQ_VSI_SW_FLAG_ALLOW_LB;
|
||||||
ctxt->info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_SW_VALID);
|
ctxt->info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_SW_VALID);
|
||||||
|
|
||||||
status = ice_update_vsi(hw, vsi->idx, ctxt, NULL);
|
ret = ice_update_vsi(hw, vsi->idx, ctxt, NULL);
|
||||||
if (status) {
|
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, status, ice_aq_str(hw->adminq.sq_last_status));
|
bmode, ret, ice_aq_str(hw->adminq.sq_last_status));
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -7143,7 +7135,6 @@ ice_bridge_setlink(struct net_device *dev, struct nlmsghdr *nlh,
|
||||||
struct ice_hw *hw = &pf->hw;
|
struct ice_hw *hw = &pf->hw;
|
||||||
struct ice_sw *pf_sw;
|
struct ice_sw *pf_sw;
|
||||||
int rem, v, err = 0;
|
int rem, v, err = 0;
|
||||||
int status;
|
|
||||||
|
|
||||||
pf_sw = pf->first_sw;
|
pf_sw = pf->first_sw;
|
||||||
/* find the attribute in the netlink message */
|
/* find the attribute in the netlink message */
|
||||||
|
@ -7175,10 +7166,10 @@ ice_bridge_setlink(struct net_device *dev, struct nlmsghdr *nlh,
|
||||||
/* Update the unicast switch filter rules for the corresponding
|
/* Update the unicast switch filter rules for the corresponding
|
||||||
* switch of the netdev
|
* switch of the netdev
|
||||||
*/
|
*/
|
||||||
status = ice_update_sw_rule_bridge_mode(hw);
|
err = ice_update_sw_rule_bridge_mode(hw);
|
||||||
if (status) {
|
if (err) {
|
||||||
netdev_err(dev, "switch rule update failed, mode = %d err %d aq_err %s\n",
|
netdev_err(dev, "switch rule update failed, mode = %d err %d aq_err %s\n",
|
||||||
mode, status,
|
mode, err,
|
||||||
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);
|
||||||
|
@ -8357,7 +8348,6 @@ int ice_open_internal(struct net_device *netdev)
|
||||||
struct ice_vsi *vsi = np->vsi;
|
struct ice_vsi *vsi = np->vsi;
|
||||||
struct ice_pf *pf = vsi->back;
|
struct ice_pf *pf = vsi->back;
|
||||||
struct ice_port_info *pi;
|
struct ice_port_info *pi;
|
||||||
int status;
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (test_bit(ICE_NEEDS_RESTART, pf->state)) {
|
if (test_bit(ICE_NEEDS_RESTART, pf->state)) {
|
||||||
|
@ -8368,10 +8358,9 @@ int ice_open_internal(struct net_device *netdev)
|
||||||
netif_carrier_off(netdev);
|
netif_carrier_off(netdev);
|
||||||
|
|
||||||
pi = vsi->port_info;
|
pi = vsi->port_info;
|
||||||
status = ice_update_link_info(pi);
|
err = ice_update_link_info(pi);
|
||||||
if (status) {
|
if (err) {
|
||||||
netdev_err(netdev, "Failed to get link info, error %d\n",
|
netdev_err(netdev, "Failed to get link info, error %d\n", err);
|
||||||
status);
|
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -399,8 +399,7 @@ ice_eswitch_add_tc_fltr(struct ice_vsi *vsi, struct ice_tc_flower_fltr *fltr)
|
||||||
struct ice_adv_lkup_elem *list;
|
struct ice_adv_lkup_elem *list;
|
||||||
u32 flags = fltr->flags;
|
u32 flags = fltr->flags;
|
||||||
int lkups_cnt;
|
int lkups_cnt;
|
||||||
int ret = 0;
|
int ret;
|
||||||
int status;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!flags || (flags & ICE_TC_FLWR_FIELD_ENC_SRC_L4_PORT)) {
|
if (!flags || (flags & ICE_TC_FLWR_FIELD_ENC_SRC_L4_PORT)) {
|
||||||
|
@ -449,12 +448,12 @@ ice_eswitch_add_tc_fltr(struct ice_vsi *vsi, struct ice_tc_flower_fltr *fltr)
|
||||||
/* specify the cookie as filter_rule_id */
|
/* specify the cookie as filter_rule_id */
|
||||||
rule_info.fltr_rule_id = fltr->cookie;
|
rule_info.fltr_rule_id = fltr->cookie;
|
||||||
|
|
||||||
status = ice_add_adv_rule(hw, list, lkups_cnt, &rule_info, &rule_added);
|
ret = ice_add_adv_rule(hw, list, lkups_cnt, &rule_info, &rule_added);
|
||||||
if (status == -EEXIST) {
|
if (ret == -EEXIST) {
|
||||||
NL_SET_ERR_MSG_MOD(fltr->extack, "Unable to add filter because it already exist");
|
NL_SET_ERR_MSG_MOD(fltr->extack, "Unable to add filter because it already exist");
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto exit;
|
goto exit;
|
||||||
} else if (status) {
|
} 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;
|
ret = -EIO;
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
|
@ -566,7 +566,6 @@ ice_vc_fdir_write_flow_prof(struct ice_vf *vf, enum ice_fltr_ptype flow,
|
||||||
u64 entry1_h = 0;
|
u64 entry1_h = 0;
|
||||||
u64 entry2_h = 0;
|
u64 entry2_h = 0;
|
||||||
u64 prof_id;
|
u64 prof_id;
|
||||||
int status;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
pf = vf->pf;
|
pf = vf->pf;
|
||||||
|
@ -603,29 +602,26 @@ ice_vc_fdir_write_flow_prof(struct ice_vf *vf, enum ice_fltr_ptype flow,
|
||||||
prof_id = ICE_FLOW_PROF_FD(vf_vsi->vsi_num, flow,
|
prof_id = ICE_FLOW_PROF_FD(vf_vsi->vsi_num, flow,
|
||||||
tun ? ICE_FLTR_PTYPE_MAX : 0);
|
tun ? ICE_FLTR_PTYPE_MAX : 0);
|
||||||
|
|
||||||
status = ice_flow_add_prof(hw, ICE_BLK_FD, ICE_FLOW_RX, prof_id, seg,
|
ret = ice_flow_add_prof(hw, ICE_BLK_FD, ICE_FLOW_RX, prof_id, seg,
|
||||||
tun + 1, &prof);
|
tun + 1, &prof);
|
||||||
ret = status;
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_dbg(dev, "Could not add VSI flow 0x%x for VF %d\n",
|
dev_dbg(dev, "Could not add VSI flow 0x%x for VF %d\n",
|
||||||
flow, vf->vf_id);
|
flow, vf->vf_id);
|
||||||
goto err_exit;
|
goto err_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = ice_flow_add_entry(hw, ICE_BLK_FD, prof_id, vf_vsi->idx,
|
ret = ice_flow_add_entry(hw, ICE_BLK_FD, prof_id, vf_vsi->idx,
|
||||||
vf_vsi->idx, ICE_FLOW_PRIO_NORMAL,
|
vf_vsi->idx, ICE_FLOW_PRIO_NORMAL,
|
||||||
seg, &entry1_h);
|
seg, &entry1_h);
|
||||||
ret = status;
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_dbg(dev, "Could not add flow 0x%x VSI entry for VF %d\n",
|
dev_dbg(dev, "Could not add flow 0x%x VSI entry for VF %d\n",
|
||||||
flow, vf->vf_id);
|
flow, vf->vf_id);
|
||||||
goto err_prof;
|
goto err_prof;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = ice_flow_add_entry(hw, ICE_BLK_FD, prof_id, vf_vsi->idx,
|
ret = ice_flow_add_entry(hw, ICE_BLK_FD, prof_id, vf_vsi->idx,
|
||||||
ctrl_vsi->idx, ICE_FLOW_PRIO_NORMAL,
|
ctrl_vsi->idx, ICE_FLOW_PRIO_NORMAL,
|
||||||
seg, &entry2_h);
|
seg, &entry2_h);
|
||||||
ret = status;
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_dbg(dev,
|
dev_dbg(dev,
|
||||||
"Could not add flow 0x%x Ctrl VSI entry for VF %d\n",
|
"Could not add flow 0x%x Ctrl VSI entry for VF %d\n",
|
||||||
|
@ -1202,7 +1198,6 @@ static int ice_vc_fdir_write_fltr(struct ice_vf *vf,
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
struct ice_pf *pf;
|
struct ice_pf *pf;
|
||||||
struct ice_hw *hw;
|
struct ice_hw *hw;
|
||||||
int status;
|
|
||||||
int ret;
|
int ret;
|
||||||
u8 *pkt;
|
u8 *pkt;
|
||||||
|
|
||||||
|
@ -1229,8 +1224,7 @@ static int ice_vc_fdir_write_fltr(struct ice_vf *vf,
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
ice_fdir_get_prgm_desc(hw, input, &desc, add);
|
ice_fdir_get_prgm_desc(hw, input, &desc, add);
|
||||||
status = ice_fdir_get_gen_prgm_pkt(hw, input, pkt, false, is_tun);
|
ret = ice_fdir_get_gen_prgm_pkt(hw, input, pkt, false, is_tun);
|
||||||
ret = status;
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_dbg(dev, "Gen training pkt for VF %d ptype %d failed\n",
|
dev_dbg(dev, "Gen training pkt for VF %d ptype %d failed\n",
|
||||||
vf->vf_id, input->flow_type);
|
vf->vf_id, input->flow_type);
|
||||||
|
|
|
@ -653,8 +653,7 @@ static int ice_vsi_manage_pvid(struct ice_vsi *vsi, u16 pvid_info, bool enable)
|
||||||
struct ice_hw *hw = &vsi->back->hw;
|
struct ice_hw *hw = &vsi->back->hw;
|
||||||
struct ice_aqc_vsi_props *info;
|
struct ice_aqc_vsi_props *info;
|
||||||
struct ice_vsi_ctx *ctxt;
|
struct ice_vsi_ctx *ctxt;
|
||||||
int ret = 0;
|
int ret;
|
||||||
int status;
|
|
||||||
|
|
||||||
ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL);
|
ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL);
|
||||||
if (!ctxt)
|
if (!ctxt)
|
||||||
|
@ -677,10 +676,10 @@ static int ice_vsi_manage_pvid(struct ice_vsi *vsi, u16 pvid_info, bool enable)
|
||||||
info->valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_VLAN_VALID |
|
info->valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_VLAN_VALID |
|
||||||
ICE_AQ_VSI_PROP_SW_VALID);
|
ICE_AQ_VSI_PROP_SW_VALID);
|
||||||
|
|
||||||
status = ice_update_vsi(hw, vsi->idx, ctxt, NULL);
|
ret = ice_update_vsi(hw, vsi->idx, ctxt, NULL);
|
||||||
if (status) {
|
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",
|
||||||
status, ice_aq_str(hw->adminq.sq_last_status));
|
ret, ice_aq_str(hw->adminq.sq_last_status));
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -1735,7 +1734,6 @@ static int ice_init_vf_vsi_res(struct ice_vf *vf)
|
||||||
u8 broadcast[ETH_ALEN];
|
u8 broadcast[ETH_ALEN];
|
||||||
struct ice_vsi *vsi;
|
struct ice_vsi *vsi;
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
int status;
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
vf->first_vector_idx = ice_calc_vf_first_vector_idx(pf, vf);
|
vf->first_vector_idx = ice_calc_vf_first_vector_idx(pf, vf);
|
||||||
|
@ -1753,11 +1751,10 @@ static int ice_init_vf_vsi_res(struct ice_vf *vf)
|
||||||
}
|
}
|
||||||
|
|
||||||
eth_broadcast_addr(broadcast);
|
eth_broadcast_addr(broadcast);
|
||||||
status = ice_fltr_add_mac(vsi, broadcast, ICE_FWD_TO_VSI);
|
err = ice_fltr_add_mac(vsi, broadcast, ICE_FWD_TO_VSI);
|
||||||
if (status) {
|
if (err) {
|
||||||
dev_err(dev, "Failed to add broadcast MAC filter for VF %d, error %d\n",
|
dev_err(dev, "Failed to add broadcast MAC filter for VF %d, error %d\n",
|
||||||
vf->vf_id, status);
|
vf->vf_id, err);
|
||||||
err = status;
|
|
||||||
goto release_vsi;
|
goto release_vsi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2003,7 +2000,6 @@ int ice_sriov_configure(struct pci_dev *pdev, int num_vfs)
|
||||||
{
|
{
|
||||||
struct ice_pf *pf = pci_get_drvdata(pdev);
|
struct ice_pf *pf = pci_get_drvdata(pdev);
|
||||||
struct device *dev = ice_pf_to_dev(pf);
|
struct device *dev = ice_pf_to_dev(pf);
|
||||||
int status;
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = ice_check_sriov_allowed(pf);
|
err = ice_check_sriov_allowed(pf);
|
||||||
|
@ -2023,9 +2019,9 @@ int ice_sriov_configure(struct pci_dev *pdev, int num_vfs)
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = ice_mbx_init_snapshot(&pf->hw, num_vfs);
|
err = ice_mbx_init_snapshot(&pf->hw, num_vfs);
|
||||||
if (status)
|
if (err)
|
||||||
return status;
|
return err;
|
||||||
|
|
||||||
err = ice_pci_sriov_ena(pf, num_vfs);
|
err = ice_pci_sriov_ena(pf, num_vfs);
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -2898,7 +2894,6 @@ int ice_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool ena)
|
||||||
struct ice_vsi *vf_vsi;
|
struct ice_vsi *vf_vsi;
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
struct ice_vf *vf;
|
struct ice_vf *vf;
|
||||||
int status;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
dev = ice_pf_to_dev(pf);
|
dev = ice_pf_to_dev(pf);
|
||||||
|
@ -2946,11 +2941,10 @@ int ice_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool ena)
|
||||||
ICE_AQ_VSI_SEC_TX_PRUNE_ENA_S));
|
ICE_AQ_VSI_SEC_TX_PRUNE_ENA_S));
|
||||||
}
|
}
|
||||||
|
|
||||||
status = ice_update_vsi(&pf->hw, vf_vsi->idx, ctx, NULL);
|
ret = ice_update_vsi(&pf->hw, vf_vsi->idx, ctx, NULL);
|
||||||
if (status) {
|
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,
|
ena ? "en" : "dis", vf->vf_id, vf_vsi->vsi_num, ret);
|
||||||
status);
|
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -3786,8 +3780,7 @@ ice_vc_add_mac_addr(struct ice_vf *vf, struct ice_vsi *vsi,
|
||||||
{
|
{
|
||||||
struct device *dev = ice_pf_to_dev(vf->pf);
|
struct device *dev = ice_pf_to_dev(vf->pf);
|
||||||
u8 *mac_addr = vc_ether_addr->addr;
|
u8 *mac_addr = vc_ether_addr->addr;
|
||||||
int ret = 0;
|
int ret;
|
||||||
int status;
|
|
||||||
|
|
||||||
/* device MAC already added */
|
/* device MAC already added */
|
||||||
if (ether_addr_equal(mac_addr, vf->dev_lan_addr.addr))
|
if (ether_addr_equal(mac_addr, vf->dev_lan_addr.addr))
|
||||||
|
@ -3798,17 +3791,16 @@ ice_vc_add_mac_addr(struct ice_vf *vf, struct ice_vsi *vsi,
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = ice_fltr_add_mac(vsi, mac_addr, ICE_FWD_TO_VSI);
|
ret = ice_fltr_add_mac(vsi, mac_addr, ICE_FWD_TO_VSI);
|
||||||
if (status == -EEXIST) {
|
if (ret == -EEXIST) {
|
||||||
dev_dbg(dev, "MAC %pM already exists for VF %d\n", mac_addr,
|
dev_dbg(dev, "MAC %pM already exists for VF %d\n", mac_addr,
|
||||||
vf->vf_id);
|
vf->vf_id);
|
||||||
/* don't return since we might need to update
|
/* don't return since we might need to update
|
||||||
* the primary MAC in ice_vfhw_mac_add() below
|
* the primary MAC in ice_vfhw_mac_add() below
|
||||||
*/
|
*/
|
||||||
ret = -EEXIST;
|
} else if (ret) {
|
||||||
} else if (status) {
|
|
||||||
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, status);
|
mac_addr, vf->vf_id, ret);
|
||||||
return -EIO;
|
return -EIO;
|
||||||
} else {
|
} else {
|
||||||
vf->num_mac++;
|
vf->num_mac++;
|
||||||
|
|
Loading…
Add table
Reference in a new issue