public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Lobakin <aleksander.lobakin@intel.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Junfeng Guo <junfeng.guo@intel.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	<kernel-janitors@vger.kernel.org>,
	Ahmed Zaki <ahmed.zaki@intel.com>, <linux-kernel@vger.kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Marcin Szycik <marcin.szycik@linux.intel.com>,
	"Tony Nguyen" <anthony.l.nguyen@intel.com>,
	Qi Zhang <qi.z.zhang@intel.com>,
	"Jakub Kicinski" <kuba@kernel.org>, <netdev@vger.kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	<intel-wired-lan@lists.osuosl.org>
Subject: Re: [Intel-wired-lan] [PATCH net-next] ice: Fix a 32bit bug
Date: Tue, 20 Aug 2024 15:47:22 +0200	[thread overview]
Message-ID: <6158bc09-842d-4e65-9983-d515ea76a000@intel.com> (raw)
In-Reply-To: <ddc231a8-89c1-4ff4-8704-9198bcb41f8d@stanley.mountain>

From: Dan Carpenter <dan.carpenter@linaro.org>
Date: Tue, 20 Aug 2024 16:43:46 +0300

> BIT() is unsigned long but ->pu.flg_msk and ->pu.flg_val are u64 type.
> On 32 bit systems, unsigned long is a u32 and the mismatch between u32
> and u64 will break things for the high 32 bits.
> 
> Fixes: 9a4c07aaa0f5 ("ice: add parser execution main loop")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>

> ---
>  drivers/net/ethernet/intel/ice/ice_parser_rt.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_parser_rt.c b/drivers/net/ethernet/intel/ice/ice_parser_rt.c
> index d5bcc266b01e..dedf5e854e4b 100644
> --- a/drivers/net/ethernet/intel/ice/ice_parser_rt.c
> +++ b/drivers/net/ethernet/intel/ice/ice_parser_rt.c
> @@ -377,11 +377,11 @@ static void ice_pg_exe(struct ice_parser_rt *rt)
>  
>  static void ice_flg_add(struct ice_parser_rt *rt, int idx, bool val)
>  {
> -	rt->pu.flg_msk |= BIT(idx);
> +	rt->pu.flg_msk |= BIT_ULL(idx);
>  	if (val)
> -		rt->pu.flg_val |= BIT(idx);
> +		rt->pu.flg_val |= BIT_ULL(idx);
>  	else
> -		rt->pu.flg_val &= ~BIT(idx);
> +		rt->pu.flg_val &= ~BIT_ULL(idx);
>  
>  	ice_debug(rt->psr->hw, ICE_DBG_PARSER, "Pending update for flag %d value %d\n",
>  		  idx, val);

Thanks,
Olek

  reply	other threads:[~2024-08-20 13:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-20 13:43 [PATCH net-next] ice: Fix a 32bit bug Dan Carpenter
2024-08-20 13:47 ` Alexander Lobakin [this message]
2024-08-22  0:40 ` patchwork-bot+netdevbpf

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=6158bc09-842d-4e65-9983-d515ea76a000@intel.com \
    --to=aleksander.lobakin@intel.com \
    --cc=ahmed.zaki@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=dan.carpenter@linaro.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=junfeng.guo@intel.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcin.szycik@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=qi.z.zhang@intel.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