From: Wojciech Drewek <wojciech.drewek@intel.com>
To: Ivan Vecera <ivecera@redhat.com>, <netdev@vger.kernel.org>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
<intel-wired-lan@lists.osuosl.org>,
<linux-kernel@vger.kernel.org>,
Jacob Keller <jacob.e.keller@intel.com>
Subject: Re: [PATCH iwl-next 2/2] i40e: Move inline helpers to i40e_prototype.h
Date: Wed, 25 Oct 2023 12:44:42 +0200 [thread overview]
Message-ID: <1551303b-1936-4e87-9444-d991bf3474a1@intel.com> (raw)
In-Reply-To: <20231025103315.1149589-3-ivecera@redhat.com>
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/cdcd6b97-1138-4cd7-854f-b3faa1f475f8@intel.com/#t
>
> Cc: Wojciech Drewek <wojciech.drewek@intel.com>
> Cc: Jacob Keller <jacob.e.keller@intel.com>
> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
> ---
Thanks Ivan!
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
> .../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;
next prev parent reply other threads:[~2023-10-25 10:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-25 10:33 [PATCH iwl-next 0/2] Remove VF MAC types and move helpers from i40e_type.h Ivan Vecera
2023-10-25 10:33 ` [PATCH iwl-next 1/2] i40e: Remove VF MAC types Ivan Vecera
2023-10-25 10:48 ` Wojciech Drewek
2023-10-25 12:16 ` Jiri Pirko
2023-10-25 12:20 ` Jiri Pirko
2023-10-25 12:27 ` Wojciech Drewek
2023-10-25 17:43 ` Jacob Keller
2023-10-26 0:20 ` Jacob Keller
2023-10-25 14:39 ` Ivan Vecera
2023-10-25 17:44 ` Jacob Keller
2023-10-26 9:42 ` Wojciech Drewek
2023-10-30 9:09 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2023-10-25 10:33 ` [PATCH iwl-next 2/2] i40e: Move inline helpers to i40e_prototype.h Ivan Vecera
2023-10-25 10:44 ` Wojciech Drewek [this message]
2023-10-30 9:10 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1551303b-1936-4e87-9444-d991bf3474a1@intel.com \
--to=wojciech.drewek@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=ivecera@redhat.com \
--cc=jacob.e.keller@intel.com \
--cc=jesse.brandeburg@intel.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox