From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: Vipin P R <vipinp@vmware.com>
Cc: <dev@dpdk.org>, <stable@dpdk.org>
Subject: Re: [PATCH 2/2] Memory Allocation: Fixes ms_idx jump (lookbehind) during find_prev_n() in fb_array library
Date: Tue, 16 May 2023 15:20:12 +0100 [thread overview]
Message-ID: <3d6b794c-06ae-190d-1e1e-ed7bc8909b51@intel.com> (raw)
In-Reply-To: <1673615325-20624-3-git-send-email-vipinp@vmware.com>
Hi Vipin,
This commit should include a more detailed commit message, akin to one I
suggested for the first patch.
For the patch itself:
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
On 1/13/2023 1:08 PM, Vipin P R wrote:
> Cc: stable@dpdk.org
>
> Signed-off-by: Vipin P R <vipinp@vmware.com>
> Acked-by: Kumara Parameshwaran <kparameshwar@vmware.com>
> ---
> lib/eal/common/eal_common_fbarray.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c
> index 551bd87..90240e8 100644
> --- a/lib/eal/common/eal_common_fbarray.c
> +++ b/lib/eal/common/eal_common_fbarray.c
> @@ -511,7 +511,7 @@ find_prev_n(const struct rte_fbarray *arr, unsigned int start, unsigned int n,
> * as well, so skip that on next iteration.
> */
> ignore_msk = UINT64_MAX << need;
> - msk_idx = lookbehind_idx;
> + msk_idx = lookbehind_idx + 1;
> break;
> }
>
The unit test code you suggested does not cover this case. I've reduced
this bug to a minimal test case:
1. Allocate fbarray with 256 entries
2. Set idx 63 as used
3. Call rte_fbarray_find_prev_n_free() starting with index 64 and length
of 2
Returned value should be 61, but without the fix it returns -1.
--
Thanks,
Anatoly
prev parent reply other threads:[~2023-05-16 14:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1673615325-20624-1-git-send-email-vipinp@vmware.com>
[not found] ` <1673615325-20624-2-git-send-email-vipinp@vmware.com>
2023-05-16 13:49 ` [PATCH 1/2] Memory Allocation: Fixes ms_idx jump (lookahead) during find_next_n() " Burakov, Anatoly
[not found] ` <1673615325-20624-3-git-send-email-vipinp@vmware.com>
2023-05-16 14:20 ` Burakov, Anatoly [this message]
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=3d6b794c-06ae-190d-1e1e-ed7bc8909b51@intel.com \
--to=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
--cc=vipinp@vmware.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;
as well as URLs for NNTP newsgroup(s).