PMD_DRV_LOG(ERR,
"Failed to init func table, err: %d, status: 0x%x, out size: 0x%x",
err, function_table.mgmt_msg_head.status, out_size);
- return -EFAULT;
+ return -EIO;
}
return 0;
PMD_DRV_LOG(ERR,
"Failed to get base qpn, err: %d, status: 0x%x, out size: 0x%x",
err, cmd_qpn.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
*global_qpn = cmd_qpn.base_qpn;
mac_info.mgmt_msg_head.status != HINIC_PF_SET_VF_ALREADY)) {
PMD_DRV_LOG(ERR, "Failed to set MAC, err: %d, status: 0x%x, out size: 0x%x",
err, mac_info.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
if (mac_info.mgmt_msg_head.status == HINIC_PF_SET_VF_ALREADY) {
mac_info.mgmt_msg_head.status != HINIC_PF_SET_VF_ALREADY)) {
PMD_DRV_LOG(ERR, "Failed to delete MAC, err: %d, status: 0x%x, out size: 0x%x",
err, mac_info.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
if (mac_info.mgmt_msg_head.status == HINIC_PF_SET_VF_ALREADY) {
PMD_DRV_LOG(WARNING, "PF has already set vf mac, Ignore delete operation.");
if (err || !out_size || mac_info.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR, "Failed to get mac, err: %d, status: 0x%x, out size: 0x%x",
err, mac_info.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
memmove(mac_addr, mac_info.mac, ETH_ALEN);
mac_info.mgmt_msg_head.status != HINIC_PF_SET_VF_ALREADY)) {
PMD_DRV_LOG(ERR, "Failed to update MAC, err: %d, status: 0x%x, out size: 0x%x",
err, mac_info.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
if (mac_info.mgmt_msg_head.status == HINIC_PF_SET_VF_ALREADY) {
PMD_DRV_LOG(WARNING, "PF has already set vf mac, Ignore update operation");
if (err || !out_size || mtu_info.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR, "Failed to set mtu, err: %d, status: 0x%x, out size: 0x%x",
err, mtu_info.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
return 0;
"Failed to %s vlan, err: %d, status: 0x%x, out size: 0x%x",
add ? "add" : "remove", err,
vlan_info.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
return 0;
"Failed to config vlan filter, vlan_filter_ctrl: 0x%x, err: %d, status: 0x%x, out size: 0x%x",
vlan_filter_ctrl, err,
vlan_filter.mgmt_msg_head.status, out_size);
- err = -EINVAL;
+ err = -EIO;
}
return err;
PMD_DRV_LOG(ERR,
"Failed to set rx vlan offload, err: %d, status: 0x%x, out size: 0x%x",
err, vlan_cfg.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
return 0;
if (err || !out_size || get_link.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR, "Failed to get link state, err: %d, status: 0x%x, out size: 0x%x",
err, get_link.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
*link_state = get_link.link_status;
if (err || !out_size || en_state.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR, "Failed to set vport state, err: %d, status: 0x%x, out size: 0x%x",
err, en_state.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
return 0;
if (err || !out_size || en_state.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR, "Failed to set phy port state, err: %d, status: 0x%x, out size: 0x%x",
err, en_state.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
return 0;
if (err || !out_size || pause_info.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR, "Failed to set pause info, err: %d, status: 0x%x, out size: 0x%x",
err, pause_info.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
return 0;
if (err || !out_size || pause_info.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR, "Failed to get pause info, err: %d, status: 0x%x, out size: 0x%x\n",
err, pause_info.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
nic_pause->auto_neg = pause_info.auto_neg;
PMD_DRV_LOG(ERR,
"Failed to set ets, err: %d, status: 0x%x, out size: 0x%x",
err, ets.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
return 0;
PMD_DRV_LOG(ERR,
"Get vport stats from fw failed, err: %d, status: 0x%x, out size: 0x%x",
err, vport_stats_rsp.mgmt_msg_head.status, out_size);
- return -EFAULT;
+ return -EIO;
}
memcpy(stats, &vport_stats_rsp.stats, sizeof(*stats));
PMD_DRV_LOG(ERR,
"Failed to get port statistics, err: %d, status: 0x%x, out size: 0x%x",
err, port_stats_rsp.mgmt_msg_head.status, out_size);
- return -EFAULT;
+ return -EIO;
}
memcpy(stats, &port_stats_rsp.stats, sizeof(*stats));
if (err || out_param != 0) {
PMD_DRV_LOG(ERR, "Failed to set rss context table");
- return -EFAULT;
+ return -EIO;
}
return 0;
PMD_DRV_LOG(ERR,
"Failed to get hash type, err: %d, status: 0x%x, out size: 0x%x",
err, ctx_tbl.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
rss_type->ipv4 = HINIC_RSS_TYPE_GET(ctx_tbl.context, IPV4);
PMD_DRV_LOG(ERR,
"Failed to set hash key, err: %d, status: 0x%x, out size: 0x%x",
err, temp_key.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
return 0;
if (err || !out_size || temp_key.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR, "Failed to get hash key, err: %d, status: 0x%x, out size: 0x%x",
err, temp_key.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
memcpy(temp, temp_key.key, HINIC_RSS_KEY_SIZE);
if (err || !out_size || hash_type.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR, "Failed to get hash engine, err: %d, status: 0x%x, out size: 0x%x",
err, hash_type.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
return 0;
cmd_buf, &out_param, 0);
if (err || out_param != 0) {
PMD_DRV_LOG(ERR, "Failed to set rss indir table");
- err = -EFAULT;
+ err = -EIO;
goto free_buf;
}
cmd_buf, &out_param, 0);
if (err || out_param != 0) {
PMD_DRV_LOG(ERR, "Failed to set rss indir table");
- err = -EFAULT;
+ err = -EIO;
}
free_buf:
if (err || !out_size || rss_cfg.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR, "Failed to get indir table, err: %d, status: 0x%x, out size: 0x%x",
err, rss_cfg.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
hinic_be32_to_cpu(rss_cfg.indir, HINIC_RSS_INDIR_SIZE);
if (err || !out_size || rss_cfg.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR, "Failed to set rss cfg, err: %d, status: 0x%x, out size: 0x%x",
err, rss_cfg.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
return 0;
if (err || !out_size || template_mgmt.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR, "Failed to alloc rss template, err: %d, status: 0x%x, out size: 0x%x",
err, template_mgmt.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
*tmpl_idx = template_mgmt.template_id;
if (err || !out_size || template_mgmt.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR, "Failed to free rss template, err: %d, status: 0x%x, out size: 0x%x",
err, template_mgmt.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
return 0;
if (err || !out_size || rx_mode_cfg.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR, "Failed to set rx mode, err: %d, status: 0x%x, out size: 0x%x",
err, rx_mode_cfg.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
return 0;
if (err || !out_size || fw_ver.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR, "Failed to get mgmt version, err: %d, status: 0x%x, out size: 0x%x\n",
err, fw_ver.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
snprintf(fw, HINIC_MGMT_VERSION_MAX_LEN, "%s", fw_ver.ver);
PMD_DRV_LOG(ERR,
"Failed to set rx csum offload, err: %d, status: 0x%x, out size: 0x%x",
err, rx_csum_cfg.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
return 0;
if (err || !out_size || lro_cfg.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR, "Failed to set lro offload, err: %d, status: 0x%x, out size: 0x%x",
err, lro_cfg.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
return 0;
PMD_DRV_LOG(ERR, "Can't %s port Anti-Attack rate limit, err: %d, status: 0x%x, out size: 0x%x",
(enable ? "enable" : "disable"), err,
rate.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
return 0;
if (err || !out_size || reset_cfg.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR, "Reset port link configure failed, err: %d, status: 0x%x, out size: 0x%x",
err, reset_cfg.mgmt_msg_head.status, out_size);
- return -EFAULT;
+ return -EIO;
}
return 0;
if (err || !out_size || clear_vport_stats.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR, "Failed to clear vport statistics, err: %d, status: 0x%x, out size: 0x%x",
err, clear_vport_stats.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
return 0;
PMD_DRV_LOG(ERR, "Failed to clear phy port statistics, err: %d, status: 0x%x, out size: 0x%x",
err, clear_phy_port_stats.mgmt_msg_head.status,
out_size);
- return -EINVAL;
+ return -EIO;
}
return 0;
PMD_DRV_LOG(ERR,
"Failed to set link status follow phy port status, err: %d, status: 0x%x, out size: 0x%x",
err, follow.mgmt_msg_head.status, out_size);
- return -EFAULT;
+ return -EIO;
}
return follow.mgmt_msg_head.status;
PMD_DRV_LOG(ERR,
"Failed to get link mode, err: %d, status: 0x%x, out size: 0x%x",
err, link_mode.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
*supported = link_mode.supported;
"Failed to %s port xsfp status, err: %d, status: 0x%x, out size: 0x%x\n",
enable ? "Disable" : "Enable", err,
xsfp_status.mgmt_msg_head.status, out_size);
- return -EFAULT;
+ return -EIO;
}
return 0;
if (err || !out_size || qp_res.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR, "Failed to clear sq resources, err: %d, status: 0x%x, out size: 0x%x",
err, qp_res.mgmt_msg_head.status, out_size);
- return -EINVAL;
+ return -EIO;
}
return 0;
" enable: 0x%x, qid: 0x%x, filter_type_enable: 0x%x\n",
err, port_filer_cmd.mgmt_msg_head.status, out_size,
filter_type, enable, qid, type_enable);
- return -EFAULT;
+ return -EIO;
}
return 0;
" enable: 0x%x, qid: 0x%x, normal_type_enable: 0x%x, key:0x%x\n",
err, port_filer_cmd.mgmt_msg_head.status, out_size,
flag, enable, qid, normal_type_enable, key);
- return -EFAULT;
+ return -EIO;
}
return 0;
if (err || !out_size || port_tcam_cmd.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR, "Set tcam table failed, err: %d, status: 0x%x, out size: 0x%x",
err, port_tcam_cmd.mgmt_msg_head.status, out_size);
- return -EFAULT;
+ return -EIO;
}
return 0;
if (err || !out_size || port_tcam_cmd.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR, "Clear tcam table failed, err: %d, status: 0x%x, out size: 0x%x",
err, port_tcam_cmd.mgmt_msg_head.status, out_size);
- return -EFAULT;
+ return -EIO;
}
return 0;
if (tcam_rule->index >= HINIC_MAX_TCAM_RULES_NUM) {
PMD_DRV_LOG(ERR, "Tcam rules num to add is invalid");
- return -EFAULT;
+ return -EINVAL;
}
memset(&tcam_cmd, 0, sizeof(struct tag_fdir_add_rule_cmd));
PMD_DRV_LOG(ERR,
"Add tcam rule failed, err: %d, status: 0x%x, out size: 0x%x",
err, tcam_cmd.mgmt_msg_head.status, out_size);
- return -EFAULT;
+ return -EIO;
}
return 0;
if (index >= HINIC_MAX_TCAM_RULES_NUM) {
PMD_DRV_LOG(ERR, "Tcam rules num to del is invalid");
- return -EFAULT;
+ return -EINVAL;
}
memset(&tcam_cmd, 0, sizeof(struct tag_fdir_del_rule_cmd));
PMD_DRV_LOG(ERR,
"Del tcam rule failed, err: %d, status: 0x%x, out size: 0x%x",
err, tcam_cmd.mgmt_msg_head.status, out_size);
- return -EFAULT;
+ return -EIO;
}
return 0;
PMD_DRV_LOG(ERR,
"Set tcam block failed, err: %d, status: 0x%x, out size: 0x%x",
err, tcam_block_info.mgmt_msg_head.status, out_size);
- return -EFAULT;
+ return -EIO;
}
if (alloc_en)
PMD_DRV_LOG(ERR,
"Flush tcam fdir rules failed, err: %d, status: 0x%x, out size: 0x%x",
err, tcam_flush.mgmt_msg_head.status, out_size);
- err = -EFAULT;
+ err = -EIO;
}
return err;
"status: 0x%x, out size: 0x%x, enable: 0x%x",
err, port_tcam_cmd.mgmt_msg_head.status, out_size,
enable);
- return -EFAULT;
+ return -EIO;
}
if (port_tcam_cmd.mgmt_msg_head.status == HINIC_MGMT_CMD_UNSUPPORTED) {