The series removes MAC types for VF functions and moves inline helper
functions from i40e_type.h to i40e_prototype.h
Ivan Vecera (2):
i40e: Remove VF MAC types
i40e: Move inline helpers to i40e_prototype.h
drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 +++-----
.../net/ethernet/intel/i40e/i40e_prototype.h | 70 +++++++++++++++++
drivers/net/ethernet/intel/i40e/i40e_type.h | 76 -------------------
3 files changed, 80 insertions(+), 99 deletions(-)
--
2.41.0
Move version check helper functions from i40e_type.h to
i40e_prototype.h as per discussion [1].
[1] https://lore.kernel.org/all/[email protected]/#t
Cc: Wojciech Drewek <[email protected]>
Cc: Jacob Keller <[email protected]>
Signed-off-by: Ivan Vecera <[email protected]>
---
.../net/ethernet/intel/i40e/i40e_prototype.h | 70 +++++++++++++++++++
drivers/net/ethernet/intel/i40e/i40e_type.h | 68 ------------------
2 files changed, 70 insertions(+), 68 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
index 001162042050..af4269330581 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
@@ -501,4 +501,74 @@ i40e_add_pinfo_to_list(struct i40e_hw *hw,
/* i40e_ddp */
int i40e_ddp_flash(struct net_device *netdev, struct ethtool_flash *flash);
+/* Firmware and AdminQ version check helpers */
+
+/**
+ * i40e_is_aq_api_ver_ge
+ * @hw: pointer to i40e_hw structure
+ * @maj: API major value to compare
+ * @min: API minor value to compare
+ *
+ * Assert whether current HW API version is greater/equal than provided.
+ **/
+static inline bool i40e_is_aq_api_ver_ge(struct i40e_hw *hw, u16 maj, u16 min)
+{
+ return (hw->aq.api_maj_ver > maj ||
+ (hw->aq.api_maj_ver == maj && hw->aq.api_min_ver >= min));
+}
+
+/**
+ * i40e_is_aq_api_ver_lt
+ * @hw: pointer to i40e_hw structure
+ * @maj: API major value to compare
+ * @min: API minor value to compare
+ *
+ * Assert whether current HW API version is less than provided.
+ **/
+static inline bool i40e_is_aq_api_ver_lt(struct i40e_hw *hw, u16 maj, u16 min)
+{
+ return !i40e_is_aq_api_ver_ge(hw, maj, min);
+}
+
+/**
+ * i40e_is_fw_ver_ge
+ * @hw: pointer to i40e_hw structure
+ * @maj: API major value to compare
+ * @min: API minor value to compare
+ *
+ * Assert whether current firmware version is greater/equal than provided.
+ **/
+static inline bool i40e_is_fw_ver_ge(struct i40e_hw *hw, u16 maj, u16 min)
+{
+ return (hw->aq.fw_maj_ver > maj ||
+ (hw->aq.fw_maj_ver == maj && hw->aq.fw_min_ver >= min));
+}
+
+/**
+ * i40e_is_fw_ver_lt
+ * @hw: pointer to i40e_hw structure
+ * @maj: API major value to compare
+ * @min: API minor value to compare
+ *
+ * Assert whether current firmware version is less than provided.
+ **/
+static inline bool i40e_is_fw_ver_lt(struct i40e_hw *hw, u16 maj, u16 min)
+{
+ return !i40e_is_fw_ver_ge(hw, maj, min);
+}
+
+/**
+ * i40e_is_fw_ver_eq
+ * @hw: pointer to i40e_hw structure
+ * @maj: API major value to compare
+ * @min: API minor value to compare
+ *
+ * Assert whether current firmware version is equal to provided.
+ **/
+static inline bool i40e_is_fw_ver_eq(struct i40e_hw *hw, u16 maj, u16 min)
+{
+ return (hw->aq.fw_maj_ver > maj ||
+ (hw->aq.fw_maj_ver == maj && hw->aq.fw_min_ver == min));
+}
+
#endif /* _I40E_PROTOTYPE_H_ */
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index 7eaf8b013125..e3d40630f689 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -586,74 +586,6 @@ struct i40e_hw {
char err_str[16];
};
-/**
- * i40e_is_aq_api_ver_ge
- * @hw: pointer to i40e_hw structure
- * @maj: API major value to compare
- * @min: API minor value to compare
- *
- * Assert whether current HW API version is greater/equal than provided.
- **/
-static inline bool i40e_is_aq_api_ver_ge(struct i40e_hw *hw, u16 maj, u16 min)
-{
- return (hw->aq.api_maj_ver > maj ||
- (hw->aq.api_maj_ver == maj && hw->aq.api_min_ver >= min));
-}
-
-/**
- * i40e_is_aq_api_ver_lt
- * @hw: pointer to i40e_hw structure
- * @maj: API major value to compare
- * @min: API minor value to compare
- *
- * Assert whether current HW API version is less than provided.
- **/
-static inline bool i40e_is_aq_api_ver_lt(struct i40e_hw *hw, u16 maj, u16 min)
-{
- return !i40e_is_aq_api_ver_ge(hw, maj, min);
-}
-
-/**
- * i40e_is_fw_ver_ge
- * @hw: pointer to i40e_hw structure
- * @maj: API major value to compare
- * @min: API minor value to compare
- *
- * Assert whether current firmware version is greater/equal than provided.
- **/
-static inline bool i40e_is_fw_ver_ge(struct i40e_hw *hw, u16 maj, u16 min)
-{
- return (hw->aq.fw_maj_ver > maj ||
- (hw->aq.fw_maj_ver == maj && hw->aq.fw_min_ver >= min));
-}
-
-/**
- * i40e_is_fw_ver_lt
- * @hw: pointer to i40e_hw structure
- * @maj: API major value to compare
- * @min: API minor value to compare
- *
- * Assert whether current firmware version is less than provided.
- **/
-static inline bool i40e_is_fw_ver_lt(struct i40e_hw *hw, u16 maj, u16 min)
-{
- return !i40e_is_fw_ver_ge(hw, maj, min);
-}
-
-/**
- * i40e_is_fw_ver_eq
- * @hw: pointer to i40e_hw structure
- * @maj: API major value to compare
- * @min: API minor value to compare
- *
- * Assert whether current firmware version is equal to provided.
- **/
-static inline bool i40e_is_fw_ver_eq(struct i40e_hw *hw, u16 maj, u16 min)
-{
- return (hw->aq.fw_maj_ver > maj ||
- (hw->aq.fw_maj_ver == maj && hw->aq.fw_min_ver == min));
-}
-
struct i40e_driver_version {
u8 major_version;
u8 minor_version;
--
2.41.0
The i40e_hw.mac.type cannot to be equal to I40E_MAC_VF or
I40E_MAC_X722_VF so remove helper i40e_is_vf(), simplify
i40e_adminq_init_regs() and remove enums for these VF MAC types.
Signed-off-by: Ivan Vecera <[email protected]>
---
drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 ++++++-------------
drivers/net/ethernet/intel/i40e/i40e_type.h | 8 -----
2 files changed, 10 insertions(+), 31 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
index 29fc46abf690..896c43905309 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
@@ -17,29 +17,16 @@ static void i40e_resume_aq(struct i40e_hw *hw);
static void i40e_adminq_init_regs(struct i40e_hw *hw)
{
/* set head and tail registers in our local struct */
- if (i40e_is_vf(hw)) {
- hw->aq.asq.tail = I40E_VF_ATQT1;
- hw->aq.asq.head = I40E_VF_ATQH1;
- hw->aq.asq.len = I40E_VF_ATQLEN1;
- hw->aq.asq.bal = I40E_VF_ATQBAL1;
- hw->aq.asq.bah = I40E_VF_ATQBAH1;
- hw->aq.arq.tail = I40E_VF_ARQT1;
- hw->aq.arq.head = I40E_VF_ARQH1;
- hw->aq.arq.len = I40E_VF_ARQLEN1;
- hw->aq.arq.bal = I40E_VF_ARQBAL1;
- hw->aq.arq.bah = I40E_VF_ARQBAH1;
- } else {
- hw->aq.asq.tail = I40E_PF_ATQT;
- hw->aq.asq.head = I40E_PF_ATQH;
- hw->aq.asq.len = I40E_PF_ATQLEN;
- hw->aq.asq.bal = I40E_PF_ATQBAL;
- hw->aq.asq.bah = I40E_PF_ATQBAH;
- hw->aq.arq.tail = I40E_PF_ARQT;
- hw->aq.arq.head = I40E_PF_ARQH;
- hw->aq.arq.len = I40E_PF_ARQLEN;
- hw->aq.arq.bal = I40E_PF_ARQBAL;
- hw->aq.arq.bah = I40E_PF_ARQBAH;
- }
+ hw->aq.asq.tail = I40E_PF_ATQT;
+ hw->aq.asq.head = I40E_PF_ATQH;
+ hw->aq.asq.len = I40E_PF_ATQLEN;
+ hw->aq.asq.bal = I40E_PF_ATQBAL;
+ hw->aq.asq.bah = I40E_PF_ATQBAH;
+ hw->aq.arq.tail = I40E_PF_ARQT;
+ hw->aq.arq.head = I40E_PF_ARQH;
+ hw->aq.arq.len = I40E_PF_ARQLEN;
+ hw->aq.arq.bal = I40E_PF_ARQBAL;
+ hw->aq.arq.bah = I40E_PF_ARQBAH;
}
/**
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index 9fda0cb6bdbe..7eaf8b013125 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -64,9 +64,7 @@ typedef void (*I40E_ADMINQ_CALLBACK)(struct i40e_hw *, struct i40e_aq_desc *);
enum i40e_mac_type {
I40E_MAC_UNKNOWN = 0,
I40E_MAC_XL710,
- I40E_MAC_VF,
I40E_MAC_X722,
- I40E_MAC_X722_VF,
I40E_MAC_GENERIC,
};
@@ -588,12 +586,6 @@ struct i40e_hw {
char err_str[16];
};
-static inline bool i40e_is_vf(struct i40e_hw *hw)
-{
- return (hw->mac.type == I40E_MAC_VF ||
- hw->mac.type == I40E_MAC_X722_VF);
-}
-
/**
* i40e_is_aq_api_ver_ge
* @hw: pointer to i40e_hw structure
--
2.41.0
On 25.10.2023 12:33, Ivan Vecera wrote:
> Move version check helper functions from i40e_type.h to
> i40e_prototype.h as per discussion [1].
>
> [1] https://lore.kernel.org/all/[email protected]/#t
>
> Cc: Wojciech Drewek <[email protected]>
> Cc: Jacob Keller <[email protected]>
> Signed-off-by: Ivan Vecera <[email protected]>
> ---
Thanks Ivan!
Reviewed-by: Wojciech Drewek <[email protected]>
> .../net/ethernet/intel/i40e/i40e_prototype.h | 70 +++++++++++++++++++
> drivers/net/ethernet/intel/i40e/i40e_type.h | 68 ------------------
> 2 files changed, 70 insertions(+), 68 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
> index 001162042050..af4269330581 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
> +++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
> @@ -501,4 +501,74 @@ i40e_add_pinfo_to_list(struct i40e_hw *hw,
> /* i40e_ddp */
> int i40e_ddp_flash(struct net_device *netdev, struct ethtool_flash *flash);
>
> +/* Firmware and AdminQ version check helpers */
> +
> +/**
> + * i40e_is_aq_api_ver_ge
> + * @hw: pointer to i40e_hw structure
> + * @maj: API major value to compare
> + * @min: API minor value to compare
> + *
> + * Assert whether current HW API version is greater/equal than provided.
> + **/
> +static inline bool i40e_is_aq_api_ver_ge(struct i40e_hw *hw, u16 maj, u16 min)
> +{
> + return (hw->aq.api_maj_ver > maj ||
> + (hw->aq.api_maj_ver == maj && hw->aq.api_min_ver >= min));
> +}
> +
> +/**
> + * i40e_is_aq_api_ver_lt
> + * @hw: pointer to i40e_hw structure
> + * @maj: API major value to compare
> + * @min: API minor value to compare
> + *
> + * Assert whether current HW API version is less than provided.
> + **/
> +static inline bool i40e_is_aq_api_ver_lt(struct i40e_hw *hw, u16 maj, u16 min)
> +{
> + return !i40e_is_aq_api_ver_ge(hw, maj, min);
> +}
> +
> +/**
> + * i40e_is_fw_ver_ge
> + * @hw: pointer to i40e_hw structure
> + * @maj: API major value to compare
> + * @min: API minor value to compare
> + *
> + * Assert whether current firmware version is greater/equal than provided.
> + **/
> +static inline bool i40e_is_fw_ver_ge(struct i40e_hw *hw, u16 maj, u16 min)
> +{
> + return (hw->aq.fw_maj_ver > maj ||
> + (hw->aq.fw_maj_ver == maj && hw->aq.fw_min_ver >= min));
> +}
> +
> +/**
> + * i40e_is_fw_ver_lt
> + * @hw: pointer to i40e_hw structure
> + * @maj: API major value to compare
> + * @min: API minor value to compare
> + *
> + * Assert whether current firmware version is less than provided.
> + **/
> +static inline bool i40e_is_fw_ver_lt(struct i40e_hw *hw, u16 maj, u16 min)
> +{
> + return !i40e_is_fw_ver_ge(hw, maj, min);
> +}
> +
> +/**
> + * i40e_is_fw_ver_eq
> + * @hw: pointer to i40e_hw structure
> + * @maj: API major value to compare
> + * @min: API minor value to compare
> + *
> + * Assert whether current firmware version is equal to provided.
> + **/
> +static inline bool i40e_is_fw_ver_eq(struct i40e_hw *hw, u16 maj, u16 min)
> +{
> + return (hw->aq.fw_maj_ver > maj ||
> + (hw->aq.fw_maj_ver == maj && hw->aq.fw_min_ver == min));
> +}
> +
> #endif /* _I40E_PROTOTYPE_H_ */
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
> index 7eaf8b013125..e3d40630f689 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_type.h
> +++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
> @@ -586,74 +586,6 @@ struct i40e_hw {
> char err_str[16];
> };
>
> -/**
> - * i40e_is_aq_api_ver_ge
> - * @hw: pointer to i40e_hw structure
> - * @maj: API major value to compare
> - * @min: API minor value to compare
> - *
> - * Assert whether current HW API version is greater/equal than provided.
> - **/
> -static inline bool i40e_is_aq_api_ver_ge(struct i40e_hw *hw, u16 maj, u16 min)
> -{
> - return (hw->aq.api_maj_ver > maj ||
> - (hw->aq.api_maj_ver == maj && hw->aq.api_min_ver >= min));
> -}
> -
> -/**
> - * i40e_is_aq_api_ver_lt
> - * @hw: pointer to i40e_hw structure
> - * @maj: API major value to compare
> - * @min: API minor value to compare
> - *
> - * Assert whether current HW API version is less than provided.
> - **/
> -static inline bool i40e_is_aq_api_ver_lt(struct i40e_hw *hw, u16 maj, u16 min)
> -{
> - return !i40e_is_aq_api_ver_ge(hw, maj, min);
> -}
> -
> -/**
> - * i40e_is_fw_ver_ge
> - * @hw: pointer to i40e_hw structure
> - * @maj: API major value to compare
> - * @min: API minor value to compare
> - *
> - * Assert whether current firmware version is greater/equal than provided.
> - **/
> -static inline bool i40e_is_fw_ver_ge(struct i40e_hw *hw, u16 maj, u16 min)
> -{
> - return (hw->aq.fw_maj_ver > maj ||
> - (hw->aq.fw_maj_ver == maj && hw->aq.fw_min_ver >= min));
> -}
> -
> -/**
> - * i40e_is_fw_ver_lt
> - * @hw: pointer to i40e_hw structure
> - * @maj: API major value to compare
> - * @min: API minor value to compare
> - *
> - * Assert whether current firmware version is less than provided.
> - **/
> -static inline bool i40e_is_fw_ver_lt(struct i40e_hw *hw, u16 maj, u16 min)
> -{
> - return !i40e_is_fw_ver_ge(hw, maj, min);
> -}
> -
> -/**
> - * i40e_is_fw_ver_eq
> - * @hw: pointer to i40e_hw structure
> - * @maj: API major value to compare
> - * @min: API minor value to compare
> - *
> - * Assert whether current firmware version is equal to provided.
> - **/
> -static inline bool i40e_is_fw_ver_eq(struct i40e_hw *hw, u16 maj, u16 min)
> -{
> - return (hw->aq.fw_maj_ver > maj ||
> - (hw->aq.fw_maj_ver == maj && hw->aq.fw_min_ver == min));
> -}
> -
> struct i40e_driver_version {
> u8 major_version;
> u8 minor_version;
On 25.10.2023 12:33, Ivan Vecera wrote:
> The i40e_hw.mac.type cannot to be equal to I40E_MAC_VF or
> I40E_MAC_X722_VF so remove helper i40e_is_vf(), simplify
> i40e_adminq_init_regs() and remove enums for these VF MAC types.
>
> Signed-off-by: Ivan Vecera <[email protected]>
> ---
> drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 ++++++-------------
> drivers/net/ethernet/intel/i40e/i40e_type.h | 8 -----
> 2 files changed, 10 insertions(+), 31 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
> index 29fc46abf690..896c43905309 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
> @@ -17,29 +17,16 @@ static void i40e_resume_aq(struct i40e_hw *hw);
> static void i40e_adminq_init_regs(struct i40e_hw *hw)
> {
> /* set head and tail registers in our local struct */
> - if (i40e_is_vf(hw)) {
> - hw->aq.asq.tail = I40E_VF_ATQT1;
> - hw->aq.asq.head = I40E_VF_ATQH1;
> - hw->aq.asq.len = I40E_VF_ATQLEN1;
> - hw->aq.asq.bal = I40E_VF_ATQBAL1;
> - hw->aq.asq.bah = I40E_VF_ATQBAH1;
> - hw->aq.arq.tail = I40E_VF_ARQT1;
> - hw->aq.arq.head = I40E_VF_ARQH1;
> - hw->aq.arq.len = I40E_VF_ARQLEN1;
> - hw->aq.arq.bal = I40E_VF_ARQBAL1;
> - hw->aq.arq.bah = I40E_VF_ARQBAH1;
What about removing those I40E_VF_* defines?
This is their only usage here, right?
> - } else {
> - hw->aq.asq.tail = I40E_PF_ATQT;
> - hw->aq.asq.head = I40E_PF_ATQH;
> - hw->aq.asq.len = I40E_PF_ATQLEN;
> - hw->aq.asq.bal = I40E_PF_ATQBAL;
> - hw->aq.asq.bah = I40E_PF_ATQBAH;
> - hw->aq.arq.tail = I40E_PF_ARQT;
> - hw->aq.arq.head = I40E_PF_ARQH;
> - hw->aq.arq.len = I40E_PF_ARQLEN;
> - hw->aq.arq.bal = I40E_PF_ARQBAL;
> - hw->aq.arq.bah = I40E_PF_ARQBAH;
> - }
> + hw->aq.asq.tail = I40E_PF_ATQT;
> + hw->aq.asq.head = I40E_PF_ATQH;
> + hw->aq.asq.len = I40E_PF_ATQLEN;
> + hw->aq.asq.bal = I40E_PF_ATQBAL;
> + hw->aq.asq.bah = I40E_PF_ATQBAH;
> + hw->aq.arq.tail = I40E_PF_ARQT;
> + hw->aq.arq.head = I40E_PF_ARQH;
> + hw->aq.arq.len = I40E_PF_ARQLEN;
> + hw->aq.arq.bal = I40E_PF_ARQBAL;
> + hw->aq.arq.bah = I40E_PF_ARQBAH;
> }
>
> /**
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
> index 9fda0cb6bdbe..7eaf8b013125 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_type.h
> +++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
> @@ -64,9 +64,7 @@ typedef void (*I40E_ADMINQ_CALLBACK)(struct i40e_hw *, struct i40e_aq_desc *);
> enum i40e_mac_type {
> I40E_MAC_UNKNOWN = 0,
> I40E_MAC_XL710,
> - I40E_MAC_VF,
> I40E_MAC_X722,
> - I40E_MAC_X722_VF,
> I40E_MAC_GENERIC,
> };
>
> @@ -588,12 +586,6 @@ struct i40e_hw {
> char err_str[16];
> };
>
> -static inline bool i40e_is_vf(struct i40e_hw *hw)
> -{
> - return (hw->mac.type == I40E_MAC_VF ||
> - hw->mac.type == I40E_MAC_X722_VF);
> -}
> -
> /**
> * i40e_is_aq_api_ver_ge
> * @hw: pointer to i40e_hw structure
Wed, Oct 25, 2023 at 12:48:37PM CEST, [email protected] wrote:
>
>
>On 25.10.2023 12:33, Ivan Vecera wrote:
>> The i40e_hw.mac.type cannot to be equal to I40E_MAC_VF or
>> I40E_MAC_X722_VF so remove helper i40e_is_vf(), simplify
>> i40e_adminq_init_regs() and remove enums for these VF MAC types.
>>
>> Signed-off-by: Ivan Vecera <[email protected]>
>> ---
>> drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 ++++++-------------
>> drivers/net/ethernet/intel/i40e/i40e_type.h | 8 -----
>> 2 files changed, 10 insertions(+), 31 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>> index 29fc46abf690..896c43905309 100644
>> --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>> +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>> @@ -17,29 +17,16 @@ static void i40e_resume_aq(struct i40e_hw *hw);
>> static void i40e_adminq_init_regs(struct i40e_hw *hw)
>> {
>> /* set head and tail registers in our local struct */
>> - if (i40e_is_vf(hw)) {
>> - hw->aq.asq.tail = I40E_VF_ATQT1;
>> - hw->aq.asq.head = I40E_VF_ATQH1;
>> - hw->aq.asq.len = I40E_VF_ATQLEN1;
>> - hw->aq.asq.bal = I40E_VF_ATQBAL1;
>> - hw->aq.asq.bah = I40E_VF_ATQBAH1;
>> - hw->aq.arq.tail = I40E_VF_ARQT1;
>> - hw->aq.arq.head = I40E_VF_ARQH1;
>> - hw->aq.arq.len = I40E_VF_ARQLEN1;
>> - hw->aq.arq.bal = I40E_VF_ARQBAL1;
>> - hw->aq.arq.bah = I40E_VF_ARQBAH1;
>
>What about removing those I40E_VF_* defines?
>This is their only usage here, right?
Wait, do you suggest to use the values directly? That would be
wild even for i40e :)
>
>> - } else {
>> - hw->aq.asq.tail = I40E_PF_ATQT;
>> - hw->aq.asq.head = I40E_PF_ATQH;
>> - hw->aq.asq.len = I40E_PF_ATQLEN;
>> - hw->aq.asq.bal = I40E_PF_ATQBAL;
>> - hw->aq.asq.bah = I40E_PF_ATQBAH;
>> - hw->aq.arq.tail = I40E_PF_ARQT;
>> - hw->aq.arq.head = I40E_PF_ARQH;
>> - hw->aq.arq.len = I40E_PF_ARQLEN;
>> - hw->aq.arq.bal = I40E_PF_ARQBAL;
>> - hw->aq.arq.bah = I40E_PF_ARQBAH;
>> - }
>> + hw->aq.asq.tail = I40E_PF_ATQT;
>> + hw->aq.asq.head = I40E_PF_ATQH;
>> + hw->aq.asq.len = I40E_PF_ATQLEN;
>> + hw->aq.asq.bal = I40E_PF_ATQBAL;
>> + hw->aq.asq.bah = I40E_PF_ATQBAH;
>> + hw->aq.arq.tail = I40E_PF_ARQT;
>> + hw->aq.arq.head = I40E_PF_ARQH;
>> + hw->aq.arq.len = I40E_PF_ARQLEN;
>> + hw->aq.arq.bal = I40E_PF_ARQBAL;
>> + hw->aq.arq.bah = I40E_PF_ARQBAH;
>> }
>>
>> /**
>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
>> index 9fda0cb6bdbe..7eaf8b013125 100644
>> --- a/drivers/net/ethernet/intel/i40e/i40e_type.h
>> +++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
>> @@ -64,9 +64,7 @@ typedef void (*I40E_ADMINQ_CALLBACK)(struct i40e_hw *, struct i40e_aq_desc *);
>> enum i40e_mac_type {
>> I40E_MAC_UNKNOWN = 0,
>> I40E_MAC_XL710,
>> - I40E_MAC_VF,
>> I40E_MAC_X722,
>> - I40E_MAC_X722_VF,
>> I40E_MAC_GENERIC,
>> };
>>
>> @@ -588,12 +586,6 @@ struct i40e_hw {
>> char err_str[16];
>> };
>>
>> -static inline bool i40e_is_vf(struct i40e_hw *hw)
>> -{
>> - return (hw->mac.type == I40E_MAC_VF ||
>> - hw->mac.type == I40E_MAC_X722_VF);
>> -}
>> -
>> /**
>> * i40e_is_aq_api_ver_ge
>> * @hw: pointer to i40e_hw structure
>
Wed, Oct 25, 2023 at 02:16:39PM CEST, [email protected] wrote:
>Wed, Oct 25, 2023 at 12:48:37PM CEST, [email protected] wrote:
>>
>>
>>On 25.10.2023 12:33, Ivan Vecera wrote:
>>> The i40e_hw.mac.type cannot to be equal to I40E_MAC_VF or
>>> I40E_MAC_X722_VF so remove helper i40e_is_vf(), simplify
>>> i40e_adminq_init_regs() and remove enums for these VF MAC types.
>>>
>>> Signed-off-by: Ivan Vecera <[email protected]>
>>> ---
>>> drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 ++++++-------------
>>> drivers/net/ethernet/intel/i40e/i40e_type.h | 8 -----
>>> 2 files changed, 10 insertions(+), 31 deletions(-)
>>>
>>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>>> index 29fc46abf690..896c43905309 100644
>>> --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>>> +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>>> @@ -17,29 +17,16 @@ static void i40e_resume_aq(struct i40e_hw *hw);
>>> static void i40e_adminq_init_regs(struct i40e_hw *hw)
>>> {
>>> /* set head and tail registers in our local struct */
>>> - if (i40e_is_vf(hw)) {
>>> - hw->aq.asq.tail = I40E_VF_ATQT1;
>>> - hw->aq.asq.head = I40E_VF_ATQH1;
>>> - hw->aq.asq.len = I40E_VF_ATQLEN1;
>>> - hw->aq.asq.bal = I40E_VF_ATQBAL1;
>>> - hw->aq.asq.bah = I40E_VF_ATQBAH1;
>>> - hw->aq.arq.tail = I40E_VF_ARQT1;
>>> - hw->aq.arq.head = I40E_VF_ARQH1;
>>> - hw->aq.arq.len = I40E_VF_ARQLEN1;
>>> - hw->aq.arq.bal = I40E_VF_ARQBAL1;
>>> - hw->aq.arq.bah = I40E_VF_ARQBAH1;
>>
>>What about removing those I40E_VF_* defines?
>>This is their only usage here, right?
>
>Wait, do you suggest to use the values directly? That would be
>wild even for i40e :)
Ah, sec. This is duplicated in
drivers/net/ethernet/intel/iavf/iavf_register.h. That confused me.
>
>
>>
>>> - } else {
>>> - hw->aq.asq.tail = I40E_PF_ATQT;
>>> - hw->aq.asq.head = I40E_PF_ATQH;
>>> - hw->aq.asq.len = I40E_PF_ATQLEN;
>>> - hw->aq.asq.bal = I40E_PF_ATQBAL;
>>> - hw->aq.asq.bah = I40E_PF_ATQBAH;
>>> - hw->aq.arq.tail = I40E_PF_ARQT;
>>> - hw->aq.arq.head = I40E_PF_ARQH;
>>> - hw->aq.arq.len = I40E_PF_ARQLEN;
>>> - hw->aq.arq.bal = I40E_PF_ARQBAL;
>>> - hw->aq.arq.bah = I40E_PF_ARQBAH;
>>> - }
>>> + hw->aq.asq.tail = I40E_PF_ATQT;
>>> + hw->aq.asq.head = I40E_PF_ATQH;
>>> + hw->aq.asq.len = I40E_PF_ATQLEN;
>>> + hw->aq.asq.bal = I40E_PF_ATQBAL;
>>> + hw->aq.asq.bah = I40E_PF_ATQBAH;
>>> + hw->aq.arq.tail = I40E_PF_ARQT;
>>> + hw->aq.arq.head = I40E_PF_ARQH;
>>> + hw->aq.arq.len = I40E_PF_ARQLEN;
>>> + hw->aq.arq.bal = I40E_PF_ARQBAL;
>>> + hw->aq.arq.bah = I40E_PF_ARQBAH;
>>> }
>>>
>>> /**
>>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
>>> index 9fda0cb6bdbe..7eaf8b013125 100644
>>> --- a/drivers/net/ethernet/intel/i40e/i40e_type.h
>>> +++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
>>> @@ -64,9 +64,7 @@ typedef void (*I40E_ADMINQ_CALLBACK)(struct i40e_hw *, struct i40e_aq_desc *);
>>> enum i40e_mac_type {
>>> I40E_MAC_UNKNOWN = 0,
>>> I40E_MAC_XL710,
>>> - I40E_MAC_VF,
>>> I40E_MAC_X722,
>>> - I40E_MAC_X722_VF,
>>> I40E_MAC_GENERIC,
>>> };
>>>
>>> @@ -588,12 +586,6 @@ struct i40e_hw {
>>> char err_str[16];
>>> };
>>>
>>> -static inline bool i40e_is_vf(struct i40e_hw *hw)
>>> -{
>>> - return (hw->mac.type == I40E_MAC_VF ||
>>> - hw->mac.type == I40E_MAC_X722_VF);
>>> -}
>>> -
>>> /**
>>> * i40e_is_aq_api_ver_ge
>>> * @hw: pointer to i40e_hw structure
>>
On 25.10.2023 14:20, Jiri Pirko wrote:
> Wed, Oct 25, 2023 at 02:16:39PM CEST, [email protected] wrote:
>> Wed, Oct 25, 2023 at 12:48:37PM CEST, [email protected] wrote:
>>>
>>>
>>> On 25.10.2023 12:33, Ivan Vecera wrote:
>>>> The i40e_hw.mac.type cannot to be equal to I40E_MAC_VF or
>>>> I40E_MAC_X722_VF so remove helper i40e_is_vf(), simplify
>>>> i40e_adminq_init_regs() and remove enums for these VF MAC types.
>>>>
>>>> Signed-off-by: Ivan Vecera <[email protected]>
>>>> ---
>>>> drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 ++++++-------------
>>>> drivers/net/ethernet/intel/i40e/i40e_type.h | 8 -----
>>>> 2 files changed, 10 insertions(+), 31 deletions(-)
>>>>
>>>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>>>> index 29fc46abf690..896c43905309 100644
>>>> --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>>>> +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>>>> @@ -17,29 +17,16 @@ static void i40e_resume_aq(struct i40e_hw *hw);
>>>> static void i40e_adminq_init_regs(struct i40e_hw *hw)
>>>> {
>>>> /* set head and tail registers in our local struct */
>>>> - if (i40e_is_vf(hw)) {
>>>> - hw->aq.asq.tail = I40E_VF_ATQT1;
>>>> - hw->aq.asq.head = I40E_VF_ATQH1;
>>>> - hw->aq.asq.len = I40E_VF_ATQLEN1;
>>>> - hw->aq.asq.bal = I40E_VF_ATQBAL1;
>>>> - hw->aq.asq.bah = I40E_VF_ATQBAH1;
>>>> - hw->aq.arq.tail = I40E_VF_ARQT1;
>>>> - hw->aq.arq.head = I40E_VF_ARQH1;
>>>> - hw->aq.arq.len = I40E_VF_ARQLEN1;
>>>> - hw->aq.arq.bal = I40E_VF_ARQBAL1;
>>>> - hw->aq.arq.bah = I40E_VF_ARQBAH1;
>>>
>>> What about removing those I40E_VF_* defines?
>>> This is their only usage here, right?
>>
>> Wait, do you suggest to use the values directly? That would be
>> wild even for i40e :)
>
> Ah, sec. This is duplicated in
> drivers/net/ethernet/intel/iavf/iavf_register.h. That confused me.
Indeed, in case of i40e they're going be unused after this patch so
there is no point in keeping them, I think.
>
>
>
>>
>>
>>>
>>>> - } else {
>>>> - hw->aq.asq.tail = I40E_PF_ATQT;
>>>> - hw->aq.asq.head = I40E_PF_ATQH;
>>>> - hw->aq.asq.len = I40E_PF_ATQLEN;
>>>> - hw->aq.asq.bal = I40E_PF_ATQBAL;
>>>> - hw->aq.asq.bah = I40E_PF_ATQBAH;
>>>> - hw->aq.arq.tail = I40E_PF_ARQT;
>>>> - hw->aq.arq.head = I40E_PF_ARQH;
>>>> - hw->aq.arq.len = I40E_PF_ARQLEN;
>>>> - hw->aq.arq.bal = I40E_PF_ARQBAL;
>>>> - hw->aq.arq.bah = I40E_PF_ARQBAH;
>>>> - }
>>>> + hw->aq.asq.tail = I40E_PF_ATQT;
>>>> + hw->aq.asq.head = I40E_PF_ATQH;
>>>> + hw->aq.asq.len = I40E_PF_ATQLEN;
>>>> + hw->aq.asq.bal = I40E_PF_ATQBAL;
>>>> + hw->aq.asq.bah = I40E_PF_ATQBAH;
>>>> + hw->aq.arq.tail = I40E_PF_ARQT;
>>>> + hw->aq.arq.head = I40E_PF_ARQH;
>>>> + hw->aq.arq.len = I40E_PF_ARQLEN;
>>>> + hw->aq.arq.bal = I40E_PF_ARQBAL;
>>>> + hw->aq.arq.bah = I40E_PF_ARQBAH;
>>>> }
>>>>
>>>> /**
>>>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
>>>> index 9fda0cb6bdbe..7eaf8b013125 100644
>>>> --- a/drivers/net/ethernet/intel/i40e/i40e_type.h
>>>> +++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
>>>> @@ -64,9 +64,7 @@ typedef void (*I40E_ADMINQ_CALLBACK)(struct i40e_hw *, struct i40e_aq_desc *);
>>>> enum i40e_mac_type {
>>>> I40E_MAC_UNKNOWN = 0,
>>>> I40E_MAC_XL710,
>>>> - I40E_MAC_VF,
>>>> I40E_MAC_X722,
>>>> - I40E_MAC_X722_VF,
>>>> I40E_MAC_GENERIC,
>>>> };
>>>>
>>>> @@ -588,12 +586,6 @@ struct i40e_hw {
>>>> char err_str[16];
>>>> };
>>>>
>>>> -static inline bool i40e_is_vf(struct i40e_hw *hw)
>>>> -{
>>>> - return (hw->mac.type == I40E_MAC_VF ||
>>>> - hw->mac.type == I40E_MAC_X722_VF);
>>>> -}
>>>> -
>>>> /**
>>>> * i40e_is_aq_api_ver_ge
>>>> * @hw: pointer to i40e_hw structure
>>>
On 25. 10. 23 12:48, Wojciech Drewek wrote:
>
> On 25.10.2023 12:33, Ivan Vecera wrote:
>> The i40e_hw.mac.type cannot to be equal to I40E_MAC_VF or
>> I40E_MAC_X722_VF so remove helper i40e_is_vf(), simplify
>> i40e_adminq_init_regs() and remove enums for these VF MAC types.
>>
>> Signed-off-by: Ivan Vecera<[email protected]>
>> ---
>> drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 ++++++-------------
>> drivers/net/ethernet/intel/i40e/i40e_type.h | 8 -----
>> 2 files changed, 10 insertions(+), 31 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>> index 29fc46abf690..896c43905309 100644
>> --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>> +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>> @@ -17,29 +17,16 @@ static void i40e_resume_aq(struct i40e_hw *hw);
>> static void i40e_adminq_init_regs(struct i40e_hw *hw)
>> {
>> /* set head and tail registers in our local struct */
>> - if (i40e_is_vf(hw)) {
>> - hw->aq.asq.tail = I40E_VF_ATQT1;
>> - hw->aq.asq.head = I40E_VF_ATQH1;
>> - hw->aq.asq.len = I40E_VF_ATQLEN1;
>> - hw->aq.asq.bal = I40E_VF_ATQBAL1;
>> - hw->aq.asq.bah = I40E_VF_ATQBAH1;
>> - hw->aq.arq.tail = I40E_VF_ARQT1;
>> - hw->aq.arq.head = I40E_VF_ARQH1;
>> - hw->aq.arq.len = I40E_VF_ARQLEN1;
>> - hw->aq.arq.bal = I40E_VF_ARQBAL1;
>> - hw->aq.arq.bah = I40E_VF_ARQBAH1;
> What about removing those I40E_VF_* defines?
> This is their only usage here, right?
Yes, do you want to remove them in this patch? Or follow-up is sufficient?
Ivan
On 10/25/2023 7:39 AM, Ivan Vecera wrote:
>
>
> On 25. 10. 23 12:48, Wojciech Drewek wrote:
>>
>> On 25.10.2023 12:33, Ivan Vecera wrote:
>>> The i40e_hw.mac.type cannot to be equal to I40E_MAC_VF or
>>> I40E_MAC_X722_VF so remove helper i40e_is_vf(), simplify
>>> i40e_adminq_init_regs() and remove enums for these VF MAC types.
>>>
>>> Signed-off-by: Ivan Vecera<[email protected]>
>>> ---
>>> drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 ++++++-------------
>>> drivers/net/ethernet/intel/i40e/i40e_type.h | 8 -----
>>> 2 files changed, 10 insertions(+), 31 deletions(-)
>>>
>>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>>> index 29fc46abf690..896c43905309 100644
>>> --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>>> +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>>> @@ -17,29 +17,16 @@ static void i40e_resume_aq(struct i40e_hw *hw);
>>> static void i40e_adminq_init_regs(struct i40e_hw *hw)
>>> {
>>> /* set head and tail registers in our local struct */
>>> - if (i40e_is_vf(hw)) {
>>> - hw->aq.asq.tail = I40E_VF_ATQT1;
>>> - hw->aq.asq.head = I40E_VF_ATQH1;
>>> - hw->aq.asq.len = I40E_VF_ATQLEN1;
>>> - hw->aq.asq.bal = I40E_VF_ATQBAL1;
>>> - hw->aq.asq.bah = I40E_VF_ATQBAH1;
>>> - hw->aq.arq.tail = I40E_VF_ARQT1;
>>> - hw->aq.arq.head = I40E_VF_ARQH1;
>>> - hw->aq.arq.len = I40E_VF_ARQLEN1;
>>> - hw->aq.arq.bal = I40E_VF_ARQBAL1;
>>> - hw->aq.arq.bah = I40E_VF_ARQBAH1;
>> What about removing those I40E_VF_* defines?
>> This is their only usage here, right?
>
> Yes, do you want to remove them in this patch? Or follow-up is sufficient?
>
> Ivan
>
>
I'm fine with a follow up.
Thanks,
Jake
On 10/25/2023 5:27 AM, Wojciech Drewek wrote:
>
>
> On 25.10.2023 14:20, Jiri Pirko wrote:
>> Wed, Oct 25, 2023 at 02:16:39PM CEST, [email protected] wrote:
>>> Wed, Oct 25, 2023 at 12:48:37PM CEST, [email protected] wrote:
>>>>
>>>>
>>>> On 25.10.2023 12:33, Ivan Vecera wrote:
>>>>> The i40e_hw.mac.type cannot to be equal to I40E_MAC_VF or
>>>>> I40E_MAC_X722_VF so remove helper i40e_is_vf(), simplify
>>>>> i40e_adminq_init_regs() and remove enums for these VF MAC types.
>>>>>
>>>>> Signed-off-by: Ivan Vecera <[email protected]>
>>>>> ---
>>>>> drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 ++++++-------------
>>>>> drivers/net/ethernet/intel/i40e/i40e_type.h | 8 -----
>>>>> 2 files changed, 10 insertions(+), 31 deletions(-)
>>>>>
>>>>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>>>>> index 29fc46abf690..896c43905309 100644
>>>>> --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>>>>> +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>>>>> @@ -17,29 +17,16 @@ static void i40e_resume_aq(struct i40e_hw *hw);
>>>>> static void i40e_adminq_init_regs(struct i40e_hw *hw)
>>>>> {
>>>>> /* set head and tail registers in our local struct */
>>>>> - if (i40e_is_vf(hw)) {
>>>>> - hw->aq.asq.tail = I40E_VF_ATQT1;
>>>>> - hw->aq.asq.head = I40E_VF_ATQH1;
>>>>> - hw->aq.asq.len = I40E_VF_ATQLEN1;
>>>>> - hw->aq.asq.bal = I40E_VF_ATQBAL1;
>>>>> - hw->aq.asq.bah = I40E_VF_ATQBAH1;
>>>>> - hw->aq.arq.tail = I40E_VF_ARQT1;
>>>>> - hw->aq.arq.head = I40E_VF_ARQH1;
>>>>> - hw->aq.arq.len = I40E_VF_ARQLEN1;
>>>>> - hw->aq.arq.bal = I40E_VF_ARQBAL1;
>>>>> - hw->aq.arq.bah = I40E_VF_ARQBAH1;
>>>>
>>>> What about removing those I40E_VF_* defines?
>>>> This is their only usage here, right?
>>>
>>> Wait, do you suggest to use the values directly? That would be
>>> wild even for i40e :)
>>
>> Ah, sec. This is duplicated in
>> drivers/net/ethernet/intel/iavf/iavf_register.h. That confused me.
>
> Indeed, in case of i40e they're going be unused after this patch so
> there is no point in keeping them, I think.
>
Ya, this is all a relic from early days when i40e planned to share code
with i40evf.
On 10/25/2023 5:20 AM, Jiri Pirko wrote:
> Wed, Oct 25, 2023 at 02:16:39PM CEST, [email protected] wrote:
>> Wed, Oct 25, 2023 at 12:48:37PM CEST, [email protected] wrote:
>>>
>>>
>>> On 25.10.2023 12:33, Ivan Vecera wrote:
>>>> The i40e_hw.mac.type cannot to be equal to I40E_MAC_VF or
>>>> I40E_MAC_X722_VF so remove helper i40e_is_vf(), simplify
>>>> i40e_adminq_init_regs() and remove enums for these VF MAC types.
>>>>
>>>> Signed-off-by: Ivan Vecera <[email protected]>
>>>> ---
>>>> drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 ++++++-------------
>>>> drivers/net/ethernet/intel/i40e/i40e_type.h | 8 -----
>>>> 2 files changed, 10 insertions(+), 31 deletions(-)
>>>>
>>>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>>>> index 29fc46abf690..896c43905309 100644
>>>> --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>>>> +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>>>> @@ -17,29 +17,16 @@ static void i40e_resume_aq(struct i40e_hw *hw);
>>>> static void i40e_adminq_init_regs(struct i40e_hw *hw)
>>>> {
>>>> /* set head and tail registers in our local struct */
>>>> - if (i40e_is_vf(hw)) {
>>>> - hw->aq.asq.tail = I40E_VF_ATQT1;
>>>> - hw->aq.asq.head = I40E_VF_ATQH1;
>>>> - hw->aq.asq.len = I40E_VF_ATQLEN1;
>>>> - hw->aq.asq.bal = I40E_VF_ATQBAL1;
>>>> - hw->aq.asq.bah = I40E_VF_ATQBAH1;
>>>> - hw->aq.arq.tail = I40E_VF_ARQT1;
>>>> - hw->aq.arq.head = I40E_VF_ARQH1;
>>>> - hw->aq.arq.len = I40E_VF_ARQLEN1;
>>>> - hw->aq.arq.bal = I40E_VF_ARQBAL1;
>>>> - hw->aq.arq.bah = I40E_VF_ARQBAH1;
>>>
>>> What about removing those I40E_VF_* defines?
>>> This is their only usage here, right?
>>
>> Wait, do you suggest to use the values directly? That would be
>> wild even for i40e :)
>
> Ah, sec. This is duplicated in
> drivers/net/ethernet/intel/iavf/iavf_register.h. That confused me.
>
Its possible the iAVF code could be cleaned up too... Historically the
i40e and i40evf duplicated quite some code.
On 25.10.2023 19:44, Jacob Keller wrote:
>
>
> On 10/25/2023 7:39 AM, Ivan Vecera wrote:
>>
>>
>> On 25. 10. 23 12:48, Wojciech Drewek wrote:
>>>
>>> On 25.10.2023 12:33, Ivan Vecera wrote:
>>>> The i40e_hw.mac.type cannot to be equal to I40E_MAC_VF or
>>>> I40E_MAC_X722_VF so remove helper i40e_is_vf(), simplify
>>>> i40e_adminq_init_regs() and remove enums for these VF MAC types.
>>>>
>>>> Signed-off-by: Ivan Vecera<[email protected]>
>>>> ---
>>>> drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 ++++++-------------
>>>> drivers/net/ethernet/intel/i40e/i40e_type.h | 8 -----
>>>> 2 files changed, 10 insertions(+), 31 deletions(-)
>>>>
>>>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>>>> index 29fc46abf690..896c43905309 100644
>>>> --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>>>> +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
>>>> @@ -17,29 +17,16 @@ static void i40e_resume_aq(struct i40e_hw *hw);
>>>> static void i40e_adminq_init_regs(struct i40e_hw *hw)
>>>> {
>>>> /* set head and tail registers in our local struct */
>>>> - if (i40e_is_vf(hw)) {
>>>> - hw->aq.asq.tail = I40E_VF_ATQT1;
>>>> - hw->aq.asq.head = I40E_VF_ATQH1;
>>>> - hw->aq.asq.len = I40E_VF_ATQLEN1;
>>>> - hw->aq.asq.bal = I40E_VF_ATQBAL1;
>>>> - hw->aq.asq.bah = I40E_VF_ATQBAH1;
>>>> - hw->aq.arq.tail = I40E_VF_ARQT1;
>>>> - hw->aq.arq.head = I40E_VF_ARQH1;
>>>> - hw->aq.arq.len = I40E_VF_ARQLEN1;
>>>> - hw->aq.arq.bal = I40E_VF_ARQBAL1;
>>>> - hw->aq.arq.bah = I40E_VF_ARQBAH1;
>>> What about removing those I40E_VF_* defines?
>>> This is their only usage here, right?
>>
>> Yes, do you want to remove them in this patch? Or follow-up is sufficient?
>>
>> Ivan
>>
>>
>
> I'm fine with a follow up.
Me too
>
> Thanks,
> Jake
> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf Of Ivan Vecera
> Sent: Wednesday, October 25, 2023 4:03 PM
> To: [email protected]
> Cc: [email protected]; Brandeburg, Jesse <[email protected]>; [email protected]; Eric Dumazet <[email protected]>; Nguyen, Anthony L <[email protected]>; Keller, Jacob E <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; David S. Miller <[email protected]>
> Subject: [Intel-wired-lan] [PATCH iwl-next 1/2] i40e: Remove VF MAC types
>
> The i40e_hw.mac.type cannot to be equal to I40E_MAC_VF or
> I40E_MAC_X722_VF so remove helper i40e_is_vf(), simplify
> i40e_adminq_init_regs() and remove enums for these VF MAC types.
>
> Signed-off-by: Ivan Vecera <[email protected]>
> ---
> drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 ++++++-------------
> drivers/net/ethernet/intel/i40e/i40e_type.h | 8 -----
> 2 files changed, 10 insertions(+), 31 deletions(-)
>
Tested-by: Pucha Himasekhar Reddy <[email protected]> (A Contingent worker at Intel)
> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf Of Ivan Vecera
> Sent: Wednesday, October 25, 2023 4:03 PM
> To: [email protected]
> Cc: Drewek, Wojciech <[email protected]>; [email protected]; Brandeburg, Jesse <[email protected]>; [email protected]; Eric Dumazet <[email protected]>; Nguyen, Anthony L <[email protected]>; Keller, Jacob E <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; David S. Miller <[email protected]>
> Subject: [Intel-wired-lan] [PATCH iwl-next 2/2] i40e: Move inline helpers to i40e_prototype.h
>
> Move version check helper functions from i40e_type.h to
> i40e_prototype.h as per discussion [1].
>
> [1] https://lore.kernel.org/all/[email protected]/#t
>
> Cc: Wojciech Drewek <[email protected]>
> Cc: Jacob Keller <[email protected]>
> Signed-off-by: Ivan Vecera <[email protected]>
> ---
> .../net/ethernet/intel/i40e/i40e_prototype.h | 70 +++++++++++++++++++
> drivers/net/ethernet/intel/i40e/i40e_type.h | 68 ------------------
> 2 files changed, 70 insertions(+), 68 deletions(-)
>
Tested-by: Pucha Himasekhar Reddy <[email protected]> (A Contingent worker at Intel)