There is no need to store the err string in hw->err_str. Simplify it and
use common helper. hw->err_str is still used for other purpouse.
It should be marked that previously for unknown error the numeric value
was passed as a string. Now the "LIBIE_AQ_RC_UNKNOWN" is used for such
cases.
Add libie_aminq module in i40e Kconfig.
Reviewed-by: Przemek Kitszel
Reviewed-by: Larysa Zaremba
Signed-off-by: Michal Swiatkowski
---
drivers/net/ethernet/intel/Kconfig| 1 +
.../net/ethernet/intel/i40e/i40e_prototype.h | 1 -
drivers/net/ethernet/intel/i40e/i40e_client.c | 7 +-
drivers/net/ethernet/intel/i40e/i40e_common.c | 52 -
drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c | 8 +-
.../net/ethernet/intel/i40e/i40e_ethtool.c| 22 +-
drivers/net/ethernet/intel/i40e/i40e_main.c | 209 +++---
drivers/net/ethernet/intel/i40e/i40e_nvm.c| 2 +-
.../ethernet/intel/i40e/i40e_virtchnl_pf.c| 27 +--
9 files changed, 105 insertions(+), 224 deletions(-)
diff --git a/drivers/net/ethernet/intel/Kconfig
b/drivers/net/ethernet/intel/Kconfig
index 29c03a9ce145..b05cc0d7a15d 100644
--- a/drivers/net/ethernet/intel/Kconfig
+++ b/drivers/net/ethernet/intel/Kconfig
@@ -231,6 +231,7 @@ config I40E
depends on PCI
select AUXILIARY_BUS
select LIBIE
+ select LIBIE_ADMINQ
select NET_DEVLINK
help
This driver supports Intel(R) Ethernet Controller XL710 Family of
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
index bd54f06b43cd..aef5de53ce3b 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
@@ -46,7 +46,6 @@ void i40e_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask
mask,
bool i40e_check_asq_alive(struct i40e_hw *hw);
int i40e_aq_queue_shutdown(struct i40e_hw *hw, bool unloading);
-const char *i40e_aq_str(struct i40e_hw *hw, enum libie_aq_err aq_err);
int i40e_aq_get_rss_lut(struct i40e_hw *hw, u16 seid,
bool pf_lut, u8 *lut, u16 lut_size);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c
b/drivers/net/ethernet/intel/i40e/i40e_client.c
index 59263551c383..5f1a405cbbf8 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_client.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_client.c
@@ -682,9 +682,7 @@ static int i40e_client_update_vsi_ctxt(struct i40e_info
*ldev,
if (err) {
dev_info(&pf->pdev->dev,
"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));
+ERR_PTR(err), libie_aq_str(pf->hw.aq.asq_last_status));
return -ENOENT;
}
@@ -711,8 +709,7 @@ static int i40e_client_update_vsi_ctxt(struct i40e_info
*ldev,
dev_info(&pf->pdev->dev,
"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));
+libie_aq_str(pf->hw.aq.asq_last_status));
}
}
return err;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c
b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 75074611285a..270e7e8cf9cf 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -68,58 +68,6 @@ int i40e_set_mac_type(struct i40e_hw *hw)
return status;
}
-/**
- * i40e_aq_str - convert AQ err code to a string
- * @hw: pointer to the HW structure
- * @aq_err: the AQ error code to convert
- **/
-const char *i40e_aq_str(struct i40e_hw *hw, enum libie_aq_err aq_err)
-{
- switch (aq_err) {
- case LIBIE_AQ_RC_OK:
- return "OK";
- case LIBIE_AQ_RC_EPERM:
- return "LIBIE_AQ_RC_EPERM";
- case LIBIE_AQ_RC_ENOENT:
- return "LIBIE_AQ_RC_ENOENT";
- case LIBIE_AQ_RC_ESRCH:
- return "LIBIE_AQ_RC_ESRCH";
- case LIBIE_AQ_RC_EIO:
- return "LIBIE_AQ_RC_EIO";
- case LIBIE_AQ_RC_EAGAIN:
- return "LIBIE_AQ_RC_EAGAIN";
- case LIBIE_AQ_RC_ENOMEM:
- return "LIBIE_AQ_RC_ENOMEM";
- case LIBIE_AQ_RC_EACCES:
- return "LIBIE_AQ_RC_EACCES";
- case LIBIE_AQ_RC_EBUSY:
- return "LIBIE_AQ_RC_EBUSY";
- case LIBIE_AQ_RC_EEXIST:
- return "LIBIE_AQ_RC_EEXIST";
- case LIBIE_AQ_RC_EINVAL:
- return "LIBIE_AQ_RC_EINVAL";
- case LIBIE_AQ_RC_ENOSPC:
- return "LIBIE_AQ_RC_ENOSPC";
- case LIBIE_AQ_RC_ENOSYS:
- return "LIBIE_AQ_RC_ENOSYS";
- case LIBIE_AQ_RC_EMODE:
- retu