Skip to content

Commit

Permalink
i40e: use ERR_PTR error print in i40e messages
Browse files Browse the repository at this point in the history
[ Upstream commit d5ba184 ]

In i40e_status removal patches, i40e_status conversion
to strings was removed in order to easily refactor
the code to use standard errornums. This however made it
more difficult for read error logs.

Use %pe formatter to print error messages in human-readable
format.

Signed-off-by: Jan Sokolowski <jan.sokolowski@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Stable-dep-of: 4e20655 ("i40e: Fix adding unsupported cloud filters")
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
JanJSokolowski authored and gregkh committed Dec 3, 2023
1 parent 27f5dd2 commit f7f3e69
Show file tree
Hide file tree
Showing 6 changed files with 198 additions and 197 deletions.
8 changes: 4 additions & 4 deletions drivers/net/ethernet/intel/i40e/i40e_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,8 +686,8 @@ static int i40e_client_update_vsi_ctxt(struct i40e_info *ldev,
ctxt.flags = I40E_AQ_VSI_TYPE_PF;
if (err) {
dev_info(&pf->pdev->dev,
"couldn't get PF vsi config, err %d aq_err %s\n",
err,
"couldn't get PF vsi config, err %pe aq_err %s\n",
ERR_PTR(err),
i40e_aq_str(&pf->hw,
pf->hw.aq.asq_last_status));
return -ENOENT;
Expand All @@ -714,8 +714,8 @@ static int i40e_client_update_vsi_ctxt(struct i40e_info *ldev,
err = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL);
if (err) {
dev_info(&pf->pdev->dev,
"update VSI ctxt for PE failed, err %d aq_err %s\n",
err,
"update VSI ctxt for PE failed, err %pe aq_err %s\n",
ERR_PTR(err),
i40e_aq_str(&pf->hw,
pf->hw.aq.asq_last_status));
}
Expand Down
16 changes: 8 additions & 8 deletions drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ static int i40e_dcbnl_ieee_setets(struct net_device *netdev,
ret = i40e_hw_dcb_config(pf, &pf->tmp_cfg);
if (ret) {
dev_info(&pf->pdev->dev,
"Failed setting DCB ETS configuration err %d aq_err %s\n",
ret,
"Failed setting DCB ETS configuration err %pe aq_err %s\n",
ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
return -EINVAL;
}
Expand Down Expand Up @@ -174,8 +174,8 @@ static int i40e_dcbnl_ieee_setpfc(struct net_device *netdev,
ret = i40e_hw_dcb_config(pf, &pf->tmp_cfg);
if (ret) {
dev_info(&pf->pdev->dev,
"Failed setting DCB PFC configuration err %d aq_err %s\n",
ret,
"Failed setting DCB PFC configuration err %pe aq_err %s\n",
ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
return -EINVAL;
}
Expand Down Expand Up @@ -225,8 +225,8 @@ static int i40e_dcbnl_ieee_setapp(struct net_device *netdev,
ret = i40e_hw_dcb_config(pf, &pf->tmp_cfg);
if (ret) {
dev_info(&pf->pdev->dev,
"Failed setting DCB configuration err %d aq_err %s\n",
ret,
"Failed setting DCB configuration err %pe aq_err %s\n",
ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
return -EINVAL;
}
Expand Down Expand Up @@ -290,8 +290,8 @@ static int i40e_dcbnl_ieee_delapp(struct net_device *netdev,
ret = i40e_hw_dcb_config(pf, &pf->tmp_cfg);
if (ret) {
dev_info(&pf->pdev->dev,
"Failed setting DCB configuration err %d aq_err %s\n",
ret,
"Failed setting DCB configuration err %pe aq_err %s\n",
ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
return -EINVAL;
}
Expand Down
40 changes: 20 additions & 20 deletions drivers/net/ethernet/intel/i40e/i40e_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1453,8 +1453,8 @@ static int i40e_set_link_ksettings(struct net_device *netdev,
status = i40e_aq_set_phy_config(hw, &config, NULL);
if (status) {
netdev_info(netdev,
"Set phy config failed, err %d aq_err %s\n",
status,
"Set phy config failed, err %pe aq_err %s\n",
ERR_PTR(status),
i40e_aq_str(hw, hw->aq.asq_last_status));
err = -EAGAIN;
goto done;
Expand All @@ -1463,8 +1463,8 @@ static int i40e_set_link_ksettings(struct net_device *netdev,
status = i40e_update_link_info(hw);
if (status)
netdev_dbg(netdev,
"Updating link info failed with err %d aq_err %s\n",
status,
"Updating link info failed with err %pe aq_err %s\n",
ERR_PTR(status),
i40e_aq_str(hw, hw->aq.asq_last_status));

} else {
Expand Down Expand Up @@ -1515,8 +1515,8 @@ static int i40e_set_fec_cfg(struct net_device *netdev, u8 fec_cfg)
status = i40e_aq_set_phy_config(hw, &config, NULL);
if (status) {
netdev_info(netdev,
"Set phy config failed, err %d aq_err %s\n",
status,
"Set phy config failed, err %pe aq_err %s\n",
ERR_PTR(status),
i40e_aq_str(hw, hw->aq.asq_last_status));
err = -EAGAIN;
goto done;
Expand All @@ -1529,8 +1529,8 @@ static int i40e_set_fec_cfg(struct net_device *netdev, u8 fec_cfg)
* (e.g. no physical connection etc.)
*/
netdev_dbg(netdev,
"Updating link info failed with err %d aq_err %s\n",
status,
"Updating link info failed with err %pe aq_err %s\n",
ERR_PTR(status),
i40e_aq_str(hw, hw->aq.asq_last_status));
}

Expand Down Expand Up @@ -1636,8 +1636,8 @@ static int i40e_nway_reset(struct net_device *netdev)

ret = i40e_aq_set_link_restart_an(hw, link_up, NULL);
if (ret) {
netdev_info(netdev, "link restart failed, err %d aq_err %s\n",
ret,
netdev_info(netdev, "link restart failed, err %pe aq_err %s\n",
ERR_PTR(ret),
i40e_aq_str(hw, hw->aq.asq_last_status));
return -EIO;
}
Expand Down Expand Up @@ -1753,20 +1753,20 @@ static int i40e_set_pauseparam(struct net_device *netdev,
status = i40e_set_fc(hw, &aq_failures, link_up);

if (aq_failures & I40E_SET_FC_AQ_FAIL_GET) {
netdev_info(netdev, "Set fc failed on the get_phy_capabilities call with err %d aq_err %s\n",
status,
netdev_info(netdev, "Set fc failed on the get_phy_capabilities call with err %pe aq_err %s\n",
ERR_PTR(status),
i40e_aq_str(hw, hw->aq.asq_last_status));
err = -EAGAIN;
}
if (aq_failures & I40E_SET_FC_AQ_FAIL_SET) {
netdev_info(netdev, "Set fc failed on the set_phy_config call with err %d aq_err %s\n",
status,
netdev_info(netdev, "Set fc failed on the set_phy_config call with err %pe aq_err %s\n",
ERR_PTR(status),
i40e_aq_str(hw, hw->aq.asq_last_status));
err = -EAGAIN;
}
if (aq_failures & I40E_SET_FC_AQ_FAIL_UPDATE) {
netdev_info(netdev, "Set fc failed on the get_link_info call with err %d aq_err %s\n",
status,
netdev_info(netdev, "Set fc failed on the get_link_info call with err %pe aq_err %s\n",
ERR_PTR(status),
i40e_aq_str(hw, hw->aq.asq_last_status));
err = -EAGAIN;
}
Expand Down Expand Up @@ -5360,8 +5360,8 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)
0, NULL);
if (ret && pf->hw.aq.asq_last_status != I40E_AQ_RC_ESRCH) {
dev_info(&pf->pdev->dev,
"couldn't set switch config bits, err %d aq_err %s\n",
ret,
"couldn't set switch config bits, err %pe aq_err %s\n",
ERR_PTR(ret),
i40e_aq_str(&pf->hw,
pf->hw.aq.asq_last_status));
/* not a fatal problem, just keep going */
Expand Down Expand Up @@ -5433,8 +5433,8 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)
return -EBUSY;
default:
dev_warn(&pf->pdev->dev,
"Starting FW LLDP agent failed: error: %d, %s\n",
status,
"Starting FW LLDP agent failed: error: %pe, %s\n",
ERR_PTR(status),
i40e_aq_str(&pf->hw,
adq_err));
return -EINVAL;
Expand Down

0 comments on commit f7f3e69

Please sign in to comment.