[v1,27/30] net/i40e/base: change time variables from 64 bit to 32 bit

Message ID b89920bacbf39803c9eef08a260f41418576b5e2.1725270827.git.anatoly.burakov@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Bruce Richardson
Headers
Series Update net/i40e base driver |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Anatoly Burakov Sept. 2, 2024, 9:54 a.m. UTC
From: Jaroslaw Ilgiewicz <jaroslaw.ilgiewicz@intel.com>

Time variables were designed for 32 bit and 64 bit variables are not
necessary. Changed all to 32 bit.

Signed-off-by: Jaroslaw Ilgiewicz <jaroslaw.ilgiewicz@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/i40e/base/i40e_common.c    | 2 +-
 drivers/net/i40e/base/i40e_nvm.c       | 6 +++---
 drivers/net/i40e/base/i40e_prototype.h | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
  

Comments

David Marchand Oct. 17, 2024, 11:43 a.m. UTC | #1
On Mon, Sep 2, 2024 at 11:58 AM Anatoly Burakov
<anatoly.burakov@intel.com> wrote:
>
> From: Jaroslaw Ilgiewicz <jaroslaw.ilgiewicz@intel.com>
>
> Time variables were designed for 32 bit and 64 bit variables are not
> necessary. Changed all to 32 bit.
>
> Signed-off-by: Jaroslaw Ilgiewicz <jaroslaw.ilgiewicz@intel.com>
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
>  drivers/net/i40e/base/i40e_common.c    | 2 +-
>  drivers/net/i40e/base/i40e_nvm.c       | 6 +++---
>  drivers/net/i40e/base/i40e_prototype.h | 2 +-
>  3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c
> index 07e18deaea..a2cfafeda9 100644
> --- a/drivers/net/i40e/base/i40e_common.c
> +++ b/drivers/net/i40e/base/i40e_common.c
> @@ -3596,7 +3596,7 @@ enum i40e_status_code i40e_aq_debug_write_register(struct i40e_hw *hw,
>  enum i40e_status_code i40e_aq_request_resource(struct i40e_hw *hw,
>                                 enum i40e_aq_resources_ids resource,
>                                 enum i40e_aq_resource_access_type access,
> -                               u8 sdp_number, u64 *timeout,
> +                               u8 sdp_number, u32 *timeout,
>                                 struct i40e_asq_cmd_details *cmd_details)
>  {
>         struct i40e_aq_desc desc;
> diff --git a/drivers/net/i40e/base/i40e_nvm.c b/drivers/net/i40e/base/i40e_nvm.c
> index 2f6cd9eda5..185af67817 100644
> --- a/drivers/net/i40e/base/i40e_nvm.c
> +++ b/drivers/net/i40e/base/i40e_nvm.c
> @@ -62,7 +62,7 @@ enum i40e_status_code i40e_acquire_nvm(struct i40e_hw *hw,
>  {
>         enum i40e_status_code ret_code = I40E_SUCCESS;
>         u32 gtime, timeout;
> -       u64 time_left = 0;
> +       u32 time_left = 0;

Some logs (a few lines below) needs updating:

                i40e_debug(hw, I40E_DEBUG_NVM,
                           "NVM acquire type %d failed time_left=%"
PRIu64 " ret=%d aq_err=%d\n",
                           access, time_left, ret_code,
hw->aq.asq_last_status);

And
                        i40e_debug(hw, I40E_DEBUG_NVM,
                                   "NVM acquire timed out, wait %"
PRIu64 " ms before trying again. status=%d aq_err=%d\n",
                                   time_left, ret_code,
hw->aq.asq_last_status);

Afaiu, it should be PRIu32.

This was raised by OBS CI:
https://build.opensuse.org/package/live_build_log/home:bluca:dpdk/dpdk/Debian_12/x86_64
  
David Marchand Oct. 25, 2024, 11:45 a.m. UTC | #2
On Thu, Oct 17, 2024 at 1:43 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Mon, Sep 2, 2024 at 11:58 AM Anatoly Burakov
> <anatoly.burakov@intel.com> wrote:
> >
> > From: Jaroslaw Ilgiewicz <jaroslaw.ilgiewicz@intel.com>
> >
> > Time variables were designed for 32 bit and 64 bit variables are not
> > necessary. Changed all to 32 bit.
> >
> > Signed-off-by: Jaroslaw Ilgiewicz <jaroslaw.ilgiewicz@intel.com>
> > Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> > ---
> >  drivers/net/i40e/base/i40e_common.c    | 2 +-
> >  drivers/net/i40e/base/i40e_nvm.c       | 6 +++---
> >  drivers/net/i40e/base/i40e_prototype.h | 2 +-
> >  3 files changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c
> > index 07e18deaea..a2cfafeda9 100644
> > --- a/drivers/net/i40e/base/i40e_common.c
> > +++ b/drivers/net/i40e/base/i40e_common.c
> > @@ -3596,7 +3596,7 @@ enum i40e_status_code i40e_aq_debug_write_register(struct i40e_hw *hw,
> >  enum i40e_status_code i40e_aq_request_resource(struct i40e_hw *hw,
> >                                 enum i40e_aq_resources_ids resource,
> >                                 enum i40e_aq_resource_access_type access,
> > -                               u8 sdp_number, u64 *timeout,
> > +                               u8 sdp_number, u32 *timeout,
> >                                 struct i40e_asq_cmd_details *cmd_details)
> >  {
> >         struct i40e_aq_desc desc;
> > diff --git a/drivers/net/i40e/base/i40e_nvm.c b/drivers/net/i40e/base/i40e_nvm.c
> > index 2f6cd9eda5..185af67817 100644
> > --- a/drivers/net/i40e/base/i40e_nvm.c
> > +++ b/drivers/net/i40e/base/i40e_nvm.c
> > @@ -62,7 +62,7 @@ enum i40e_status_code i40e_acquire_nvm(struct i40e_hw *hw,
> >  {
> >         enum i40e_status_code ret_code = I40E_SUCCESS;
> >         u32 gtime, timeout;
> > -       u64 time_left = 0;
> > +       u32 time_left = 0;
>
> Some logs (a few lines below) needs updating:
>
>                 i40e_debug(hw, I40E_DEBUG_NVM,
>                            "NVM acquire type %d failed time_left=%"
> PRIu64 " ret=%d aq_err=%d\n",
>                            access, time_left, ret_code,
> hw->aq.asq_last_status);
>
> And
>                         i40e_debug(hw, I40E_DEBUG_NVM,
>                                    "NVM acquire timed out, wait %"
> PRIu64 " ms before trying again. status=%d aq_err=%d\n",
>                                    time_left, ret_code,
> hw->aq.asq_last_status);
>
> Afaiu, it should be PRIu32.
>
> This was raised by OBS CI:
> https://build.opensuse.org/package/live_build_log/home:bluca:dpdk/dpdk/Debian_12/x86_64

Reminder, this was mentionned during the maintainers call yesterday.
Please send a fix.


Thanks.
  
Jaroslaw Ilgiewicz Oct. 28, 2024, 3:21 p.m. UTC | #3
We will send the fix once we sync internally hopefully tomorrow.
Sorry for the delay.
Jaroslaw Ilgiewicz
________________________________
From: David Marchand <david.marchand@redhat.com>
Sent: Friday, October 25, 2024 1:45 PM
To: Burakov, Anatoly <anatoly.burakov@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>; Ilgiewicz, Jaroslaw <jaroslaw.ilgiewicz@intel.com>
Cc: dev@dpdk.org <dev@dpdk.org>; Thomas Monjalon <thomas@monjalon.net>; Luca Boccassi <bluca@debian.org>
Subject: Re: [PATCH v1 27/30] net/i40e/base: change time variables from 64 bit to 32 bit

On Thu, Oct 17, 2024 at 1:43 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Mon, Sep 2, 2024 at 11:58 AM Anatoly Burakov
> <anatoly.burakov@intel.com> wrote:
> >
> > From: Jaroslaw Ilgiewicz <jaroslaw.ilgiewicz@intel.com>
> >
> > Time variables were designed for 32 bit and 64 bit variables are not
> > necessary. Changed all to 32 bit.
> >
> > Signed-off-by: Jaroslaw Ilgiewicz <jaroslaw.ilgiewicz@intel.com>
> > Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> > ---
> >  drivers/net/i40e/base/i40e_common.c    | 2 +-
> >  drivers/net/i40e/base/i40e_nvm.c       | 6 +++---
> >  drivers/net/i40e/base/i40e_prototype.h | 2 +-
> >  3 files changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c
> > index 07e18deaea..a2cfafeda9 100644
> > --- a/drivers/net/i40e/base/i40e_common.c
> > +++ b/drivers/net/i40e/base/i40e_common.c
> > @@ -3596,7 +3596,7 @@ enum i40e_status_code i40e_aq_debug_write_register(struct i40e_hw *hw,
> >  enum i40e_status_code i40e_aq_request_resource(struct i40e_hw *hw,
> >                                 enum i40e_aq_resources_ids resource,
> >                                 enum i40e_aq_resource_access_type access,
> > -                               u8 sdp_number, u64 *timeout,
> > +                               u8 sdp_number, u32 *timeout,
> >                                 struct i40e_asq_cmd_details *cmd_details)
> >  {
> >         struct i40e_aq_desc desc;
> > diff --git a/drivers/net/i40e/base/i40e_nvm.c b/drivers/net/i40e/base/i40e_nvm.c
> > index 2f6cd9eda5..185af67817 100644
> > --- a/drivers/net/i40e/base/i40e_nvm.c
> > +++ b/drivers/net/i40e/base/i40e_nvm.c
> > @@ -62,7 +62,7 @@ enum i40e_status_code i40e_acquire_nvm(struct i40e_hw *hw,
> >  {
> >         enum i40e_status_code ret_code = I40E_SUCCESS;
> >         u32 gtime, timeout;
> > -       u64 time_left = 0;
> > +       u32 time_left = 0;
>
> Some logs (a few lines below) needs updating:
>
>                 i40e_debug(hw, I40E_DEBUG_NVM,
>                            "NVM acquire type %d failed time_left=%"
> PRIu64 " ret=%d aq_err=%d\n",
>                            access, time_left, ret_code,
> hw->aq.asq_last_status);
>
> And
>                         i40e_debug(hw, I40E_DEBUG_NVM,
>                                    "NVM acquire timed out, wait %"
> PRIu64 " ms before trying again. status=%d aq_err=%d\n",
>                                    time_left, ret_code,
> hw->aq.asq_last_status);
>
> Afaiu, it should be PRIu32.
>
> This was raised by OBS CI:
> https://build.opensuse.org/package/live_build_log/home:bluca:dpdk/dpdk/Debian_12/x86_64

Reminder, this was mentionned during the maintainers call yesterday.
Please send a fix.


Thanks.

--
David Marchand

---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
  

Patch

diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c
index 07e18deaea..a2cfafeda9 100644
--- a/drivers/net/i40e/base/i40e_common.c
+++ b/drivers/net/i40e/base/i40e_common.c
@@ -3596,7 +3596,7 @@  enum i40e_status_code i40e_aq_debug_write_register(struct i40e_hw *hw,
 enum i40e_status_code i40e_aq_request_resource(struct i40e_hw *hw,
 				enum i40e_aq_resources_ids resource,
 				enum i40e_aq_resource_access_type access,
-				u8 sdp_number, u64 *timeout,
+				u8 sdp_number, u32 *timeout,
 				struct i40e_asq_cmd_details *cmd_details)
 {
 	struct i40e_aq_desc desc;
diff --git a/drivers/net/i40e/base/i40e_nvm.c b/drivers/net/i40e/base/i40e_nvm.c
index 2f6cd9eda5..185af67817 100644
--- a/drivers/net/i40e/base/i40e_nvm.c
+++ b/drivers/net/i40e/base/i40e_nvm.c
@@ -62,7 +62,7 @@  enum i40e_status_code i40e_acquire_nvm(struct i40e_hw *hw,
 {
 	enum i40e_status_code ret_code = I40E_SUCCESS;
 	u32 gtime, timeout;
-	u64 time_left = 0;
+	u32 time_left = 0;
 
 	DEBUGFUNC("i40e_acquire_nvm");
 
@@ -127,8 +127,8 @@  enum i40e_status_code i40e_acquire_nvm_ex(struct i40e_hw *hw,
 					   u32 custom_timeout)
 {
 	enum i40e_status_code ret_code = I40E_SUCCESS;
-	u64 gtime, timeout;
-	u64 time_left = 0;
+	u32 gtime, timeout;
+	u32 time_left = 0;
 
 	DEBUGFUNC("i40e_acquire_nvm");
 
diff --git a/drivers/net/i40e/base/i40e_prototype.h b/drivers/net/i40e/base/i40e_prototype.h
index 440e713a28..e7e6d4c427 100644
--- a/drivers/net/i40e/base/i40e_prototype.h
+++ b/drivers/net/i40e/base/i40e_prototype.h
@@ -233,7 +233,7 @@  enum i40e_status_code i40e_aq_set_switch_config(struct i40e_hw *hw,
 enum i40e_status_code i40e_aq_request_resource(struct i40e_hw *hw,
 				enum i40e_aq_resources_ids resource,
 				enum i40e_aq_resource_access_type access,
-				u8 sdp_number, u64 *timeout,
+				u8 sdp_number, u32 *timeout,
 				struct i40e_asq_cmd_details *cmd_details);
 enum i40e_status_code i40e_aq_release_resource(struct i40e_hw *hw,
 				enum i40e_aq_resources_ids resource,