DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wang, Yipeng1" <yipeng1.wang@intel.com>
To: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>,
	"Marohn, Byron" <byron.marohn@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "stable@dpdk.org" <stable@dpdk.org>
Subject: RE: [PATCH v2 1/2] test/efd: fix size of constant
Date: Thu, 24 Feb 2022 17:15:12 +0000	[thread overview]
Message-ID: <PH0PR11MB5173F5FF46FFA8354E0ECFB3C33D9@PH0PR11MB5173.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220224155759.819460-1-pablo.de.lara.guarch@intel.com>

> -----Original Message-----
> From: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Sent: Thursday, February 24, 2022 7:58 AM
> To: Wang, Yipeng1 <yipeng1.wang@intel.com>; Marohn, Byron
> <byron.marohn@intel.com>
> Cc: dev@dpdk.org; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>;
> stable@dpdk.org
> Subject: [PATCH v2 1/2] test/efd: fix size of constant
> 
> Constant value 1 has a size of 32 bits, and shifting it more than 32 bits to the
> left overflows. 1ULL is needed to be able to get a 64-bit value.
> 
> Coverity ID: 375846
> Fixes: 8751a7e9832b ("efd: allow more CPU sockets in table creation")
> Cc: pablo.de.lara.guarch@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> ---
>  app/test/test_efd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/app/test/test_efd.c b/app/test/test_efd.c index
> 7bea674086..fa29e8f97a 100644
> --- a/app/test/test_efd.c
> +++ b/app/test/test_efd.c
> @@ -107,7 +107,7 @@ static inline uint64_t
> efd_get_all_sockets_bitmask(void)
>  	unsigned int next_lcore = rte_get_main_lcore();
>  	const int val_true = 1, val_false = 0;
>  	for (i = 0; i < rte_lcore_count(); i++) {
> -		all_cpu_sockets_bitmask |= 1 <<
> rte_lcore_to_socket_id(next_lcore);
> +		all_cpu_sockets_bitmask |= 1ULL <<
> +rte_lcore_to_socket_id(next_lcore);
>  		next_lcore = rte_get_next_lcore(next_lcore, val_false,
> val_true);
>  	}
> 
> --
> 2.25.1
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>


  parent reply	other threads:[~2022-02-24 17:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-24 15:48 [PATCH " Pablo de Lara
2022-02-24 15:48 ` [PATCH 2/2] efd: fix uninitialized structure Pablo de Lara
2022-02-24 15:57 ` [PATCH v2 1/2] test/efd: fix size of constant Pablo de Lara
2022-02-24 15:57   ` [PATCH v2 2/2] efd: fix uninitialized structure Pablo de Lara
2022-02-24 17:14     ` Wang, Yipeng1
2022-02-24 17:15   ` Wang, Yipeng1 [this message]
2022-02-25  9:27   ` [PATCH v3 1/2] test/efd: fix size of constant Pablo de Lara
2022-02-25  9:27     ` [PATCH v3 2/2] efd: fix uninitialized structure Pablo de Lara
2022-02-27 17:59       ` Thomas Monjalon

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=PH0PR11MB5173F5FF46FFA8354E0ECFB3C33D9@PH0PR11MB5173.namprd11.prod.outlook.com \
    --to=yipeng1.wang@intel.com \
    --cc=byron.marohn@intel.com \
    --cc=dev@dpdk.org \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=stable@dpdk.org \
    /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;
as well as URLs for NNTP newsgroup(s).