Remove VF MAC types and move helpers from i40e_type.h
Subsystems (3)
cover Remove VF MAC types and move helpers from i40e_type.h
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(-)
Signature · 1 line
2.41.0
PATCH 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.
--- 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(-)
drivers/net/ethernet/intel/i40e/i40e_adminq.c +10 -23
@@ -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 ; }/**
drivers/net/ethernet/intel/i40e/i40e_type.h +0 -8
@@ -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
Signature · 1 line
2.41.0
Re: [PATCH iwl-next 1/2] i40e: Remove VF MAC types
Quoted 19 lines · Ivan Vecera
The i40e_hw.mac.type cannot to be equal to
I40E_MAC_VForI40E_MAC_X722_VFso remove helperi40e_is_vf(), simplifyi40e_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(-)drivers/net/ethernet/intel/i40e/i40e_adminq.c +0
-1@@ -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)) {
drivers/net/ethernet/intel/i40e/i40e_adminq.c static void i40e_resume_aq(struct i40e_hw *hw); · line 30
Quoted 10 lines
drivers/net/ethernet/intel/i40e/i40e_adminq.c +0
-10- 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?
Quoted 52 lines
drivers/net/ethernet/intel/i40e/i40e_adminq.c +10
-12- }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 ; }/** drivers/net/ethernet/intel/i40e/i40e_type.h +0
-8@@ -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
Re: [PATCH iwl-next 1/2] i40e: Remove VF MAC types
Quoted 27 lines · Wed, Oct 25, 2023 at 12:48:37PM CEST, [email protected] wrote:
Quoted 24 lines · Ivan Vecera
The i40e_hw.mac.type cannot to be equal to
I40E_MAC_VForI40E_MAC_X722_VFso remove helperi40e_is_vf(), simplifyi40e_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(-)drivers/net/ethernet/intel/i40e/i40e_adminq.c +0
-6@@ -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 ;
Quoted 8 lines
drivers/net/ethernet/intel/i40e/i40e_adminq.c static void i40e_resume_aq(struct i40e_hw *hw); · line 30
Quoted 5 lines
drivers/net/ethernet/intel/i40e/i40e_adminq.c +0
-5- 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 :)
Quoted 54 lines
Quoted 53 lines
drivers/net/ethernet/intel/i40e/i40e_adminq.c +10
-12- }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 ; }/** drivers/net/ethernet/intel/i40e/i40e_type.h +0
-8@@ -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
Re: [PATCH iwl-next 1/2] i40e: Remove VF MAC types
Quoted 37 lines · Wed, Oct 25, 2023 at 02:16:39PM CEST, [email protected] wrote:
Quoted 27 lines · Wed, Oct 25, 2023 at 12:48:37PM CEST, [email protected] wrote:
Quoted 24 lines · Ivan Vecera
The i40e_hw.mac.type cannot to be equal to
I40E_MAC_VForI40E_MAC_X722_VFso remove helperi40e_is_vf(), simplifyi40e_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(-)drivers/net/ethernet/intel/i40e/i40e_adminq.c +0
-6@@ -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 ;Quoted 8 lines
drivers/net/ethernet/intel/i40e/i40e_adminq.c static void i40e_resume_aq(struct i40e_hw *hw); · line 30
Quoted 5 lines
drivers/net/ethernet/intel/i40e/i40e_adminq.c +0
-5- 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?
Quoted 2 lines
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.
Quoted 56 lines
Quoted 56 lines
Quoted 55 lines
drivers/net/ethernet/intel/i40e/i40e_adminq.c +10
-12- }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 ; }/** drivers/net/ethernet/intel/i40e/i40e_type.h +0
-8@@ -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
Re: [PATCH iwl-next 1/2] i40e: Remove VF MAC types
Quoted 38 lines · Jiri Pirko
Quoted 37 lines · Wed, Oct 25, 2023 at 02:16:39PM CEST, [email protected] wrote:
Quoted 35 lines · Wed, Oct 25, 2023 at 12:48:37PM CEST, [email protected] wrote:
Quoted 19 lines · Ivan Vecera
The i40e_hw.mac.type cannot to be equal to
I40E_MAC_VForI40E_MAC_X722_VFso remove helperi40e_is_vf(), simplifyi40e_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(-)drivers/net/ethernet/intel/i40e/i40e_adminq.c +0
-1@@ -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)) {drivers/net/ethernet/intel/i40e/i40e_adminq.c static void i40e_resume_aq(struct i40e_hw *hw); · line 30
Quoted 10 lines
drivers/net/ethernet/intel/i40e/i40e_adminq.c +0
-10- 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?
Quoted 5 lines
Quoted 2 lines
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.
Quoted 59 lines
Quoted 59 lines
Quoted 59 lines
Quoted 58 lines
drivers/net/ethernet/intel/i40e/i40e_adminq.c +10
-12- }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 ; }/** drivers/net/ethernet/intel/i40e/i40e_type.h +0
-8@@ -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
Re: [PATCH iwl-next 1/2] i40e: Remove VF MAC types
Quoted 41 lines · Wojciech Drewek
Quoted 38 lines · Jiri Pirko
Quoted 37 lines · Wed, Oct 25, 2023 at 02:16:39PM CEST, [email protected] wrote:
Quoted 35 lines · Wed, Oct 25, 2023 at 12:48:37PM CEST, [email protected] wrote:
Quoted 19 lines · Ivan Vecera
The i40e_hw.mac.type cannot to be equal to
I40E_MAC_VForI40E_MAC_X722_VFso remove helperi40e_is_vf(), simplifyi40e_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(-)drivers/net/ethernet/intel/i40e/i40e_adminq.c +0
-1@@ -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)) {drivers/net/ethernet/intel/i40e/i40e_adminq.c static void i40e_resume_aq(struct i40e_hw *hw); · line 30
Quoted 10 lines
drivers/net/ethernet/intel/i40e/i40e_adminq.c +0
-10- 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?
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
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.
Re: [PATCH iwl-next 1/2] i40e: Remove VF MAC types
In reply to Jiri PirkoQuoted 38 lines · Jiri Pirko
Quoted 37 lines · Wed, Oct 25, 2023 at 02:16:39PM CEST, [email protected] wrote:
Quoted 35 lines · Wed, Oct 25, 2023 at 12:48:37PM CEST, [email protected] wrote:
Quoted 19 lines · Ivan Vecera
The i40e_hw.mac.type cannot to be equal to
I40E_MAC_VForI40E_MAC_X722_VFso remove helperi40e_is_vf(), simplifyi40e_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(-)drivers/net/ethernet/intel/i40e/i40e_adminq.c +0
-1@@ -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)) {drivers/net/ethernet/intel/i40e/i40e_adminq.c static void i40e_resume_aq(struct i40e_hw *hw); · line 30
Quoted 10 lines
drivers/net/ethernet/intel/i40e/i40e_adminq.c +0
-10- 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?
Quoted 6 lines
Quoted 2 lines
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.
Re: [PATCH iwl-next 1/2] i40e: Remove VF MAC types
In reply to Wojciech DrewekQuoted 25 lines · Wojciech Drewek
Quoted 23 lines · Ivan Vecera
The i40e_hw.mac.type cannot to be equal to
I40E_MAC_VForI40E_MAC_X722_VFso remove helperi40e_is_vf(), simplifyi40e_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(-)drivers/net/ethernet/intel/i40e/i40e_adminq.c +0
-5@@ -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 ;
Quoted 8 lines
drivers/net/ethernet/intel/i40e/i40e_adminq.c static void i40e_resume_aq(struct i40e_hw *hw); · line 30
Quoted 6 lines
drivers/net/ethernet/intel/i40e/i40e_adminq.c +0
-6- 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
Re: [PATCH iwl-next 1/2] i40e: Remove VF MAC types
Quoted 37 lines · Ivan Vecera
Quoted 25 lines · Wojciech Drewek
Quoted 23 lines · Ivan Vecera
The i40e_hw.mac.type cannot to be equal to
I40E_MAC_VForI40E_MAC_X722_VFso remove helperi40e_is_vf(), simplifyi40e_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(-)drivers/net/ethernet/intel/i40e/i40e_adminq.c +0
-5@@ -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 ;Quoted 8 lines
drivers/net/ethernet/intel/i40e/i40e_adminq.c static void i40e_resume_aq(struct i40e_hw *hw); · line 30
Quoted 6 lines
drivers/net/ethernet/intel/i40e/i40e_adminq.c +0
-6- 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?
Quoted 5 lines
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
Re: [PATCH iwl-next 1/2] i40e: Remove VF MAC types
Quoted 40 lines · Jacob Keller
Quoted 37 lines · Ivan Vecera
Quoted 33 lines · Wojciech Drewek
Quoted 19 lines · Ivan Vecera
The i40e_hw.mac.type cannot to be equal to
I40E_MAC_VForI40E_MAC_X722_VFso remove helperi40e_is_vf(), simplifyi40e_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(-)drivers/net/ethernet/intel/i40e/i40e_adminq.c +0
-1@@ -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)) {drivers/net/ethernet/intel/i40e/i40e_adminq.c static void i40e_resume_aq(struct i40e_hw *hw); · line 30
Quoted 10 lines
drivers/net/ethernet/intel/i40e/i40e_adminq.c +0
-10- 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?
Quoted 7 lines
Quoted 5 lines
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
Quoted 3 lines
Thanks,
Jake
RE: [Intel-wired-lan] [PATCH iwl-next 1/2] i40e: Remove VF MAC types
In reply to Ivan VeceraQuoted 11 lines
-----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 typesThe i40e_hw.mac.type cannot to be equal to
I40E_MAC_VForI40E_MAC_X722_VFso remove helperi40e_is_vf(), simplifyi40e_adminq_init_regs()and remove enums for these VF MAC types.
Quoted 6 lines
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(-)
PATCH 2/2 i40e: Move inline helpers to i40e_prototype.h
In reply to Ivan VeceraMove 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
--- .../net/ethernet/intel/i40e/i40e_prototype.h | 70 +++++++++++++++++++ drivers/net/ethernet/intel/i40e/i40e_type.h | 68 ------------------ 2 files changed, 70 insertions(+), 68 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_prototype.h +70 -0
@@ -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_ */
drivers/net/ethernet/intel/i40e/i40e_type.h +0 -68
74 lines not on this page · raw message
Signature · 1 line
2.41.0
Re: [PATCH iwl-next 2/2] i40e: Move inline helpers to i40e_prototype.h
Quoted 9 lines · Ivan Vecera
Move version check helper functions from
i40e_type.htoi40e_prototype.has 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!
Quoted 162 lines
.../net/ethernet/intel/i40e/i40e_prototype.h | 70 +++++++++++++++++++ drivers/net/ethernet/intel/i40e/i40e_type.h | 68 ------------------ 2 files changed, 70 insertions(+), 68 deletions(-)drivers/net/ethernet/intel/i40e/i40e_prototype.h +70
-0@@ -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_ */ drivers/net/ethernet/intel/i40e/i40e_type.h +0
-68@@ -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;
RE: [Intel-wired-lan] [PATCH iwl-next 2/2] i40e: Move inline helpers to i40e_prototype.h
In reply to Ivan VeceraQuoted 12 lines
-----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 toi40e_prototype.hMove version check helper functions from
i40e_type.htoi40e_prototype.has per discussion [1].
Quoted 8 lines
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(-)