All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
To: Nithin Dabilpuram <ndabilpuram@marvell.com>
Cc: "jerinj@marvell.com" <jerinj@marvell.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 2/2] bitmap: fix bitmap not empty API for 128B cacheline
Date: Mon, 4 Jan 2021 11:09:31 +0000	[thread overview]
Message-ID: <CY4PR11MB1702D5633050909F9157C57CEBD20@CY4PR11MB1702.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20201214102835.19980-2-ndabilpuram@marvell.com>



> -----Original Message-----
> From: Nithin Dabilpuram <ndabilpuram@marvell.com>
> Sent: Monday, December 14, 2020 10:29 AM
> To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> Cc: jerinj@marvell.com; dev@dpdk.org; Nithin Dabilpuram
> <ndabilpuram@marvell.com>
> Subject: [PATCH 2/2] bitmap: fix bitmap not empty API for 128B cacheline
> 
> Currently bitmap line not empty check API assumes cache line
> of 64B and only checks 8 slabs. Since in 128B cacheline, we
> have 16 slabs per cacheline, plt_bitmap_clear() will mark
> complete line as empty as soon as 8 slabs are full thereby
> breaking bitmap scan functionality. Fix it by defining new
> __plt_bitmap_line_not_empty() for 128B cacheline platform.
> 
> Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
> ---
>  lib/librte_eal/include/rte_bitmap.h | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/lib/librte_eal/include/rte_bitmap.h
> b/lib/librte_eal/include/rte_bitmap.h
> index 7c90ef3..d9a1b54 100644
> --- a/lib/librte_eal/include/rte_bitmap.h
> +++ b/lib/librte_eal/include/rte_bitmap.h
> @@ -417,6 +417,7 @@ rte_bitmap_set_slab(struct rte_bitmap *bmp,
> uint32_t pos, uint64_t slab)
>  	*slab1 |= 1llu << offset1;
>  }
> 
> +#if RTE_BITMAP_CL_SLAB_SIZE == 8
>  static inline uint64_t
>  __rte_bitmap_line_not_empty(uint64_t *slab2)
>  {
> @@ -432,6 +433,30 @@ __rte_bitmap_line_not_empty(uint64_t *slab2)
>  	return v1 | v3;
>  }
> 
> +#elif RTE_BITMAP_CL_SLAB_SIZE == 16
> +static inline uint64_t
> +__rte_bitmap_line_not_empty(uint64_t *slab2)
> +{
> +	uint64_t v1, v2, v3, v4, v5, v6, v7, v8;
> +
> +	v1 = slab2[0] | slab2[1];
> +	v2 = slab2[2] | slab2[3];
> +	v3 = slab2[4] | slab2[5];
> +	v4 = slab2[6] | slab2[7];
> +	v5 = slab2[8] | slab2[9];
> +	v6 = slab2[10] | slab2[11];
> +	v7 = slab2[12] | slab2[13];
> +	v8 = slab2[14] | slab2[15];
> +	v1 |= v2;
> +	v3 |= v4;
> +	v5 |= v6;
> +	v7 |= v8;
> +
> +	return v1 | v3 | v5 | v7;
> +}
> +
> +#endif
> +
>  /**
>   * Bitmap bit clear
>   *
> --
> 2.8.4

Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>


  reply	other threads:[~2021-01-04 11:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-14 10:28 [dpdk-dev] [PATCH 1/2] test/bitmap: add test case to scan after half cline is cleared Nithin Dabilpuram
2020-12-14 10:28 ` [dpdk-dev] [PATCH 2/2] bitmap: fix bitmap not empty API for 128B cacheline Nithin Dabilpuram
2021-01-04 11:09   ` Dumitrescu, Cristian [this message]
2021-01-05  8:57 ` [dpdk-dev] [PATCH v2 1/2] test/bitmap: test scan after half cline is cleared Nithin Dabilpuram
2021-01-05  8:57   ` [dpdk-dev] [PATCH v2 2/2] bitmap: modify bitmap not empty API for 128B cacheline Nithin Dabilpuram
2021-01-17 21:48     ` 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=CY4PR11MB1702D5633050909F9157C57CEBD20@CY4PR11MB1702.namprd11.prod.outlook.com \
    --to=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=ndabilpuram@marvell.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.