DPDK patches and discussions
 help / color / mirror / Atom feed
From: Vipin P R <vipinp@vmware.com>
To: anatoly.burakov@intel.com
Cc: dev@dpdk.org, Vipin P R <vipinp@vmware.com>, stable@dpdk.org
Subject: [PATCH 1/2] Memory Allocation: Fixes ms_idx jump (lookahead) during find_next_n() in fb_array library
Date: Fri, 13 Jan 2023 13:08:44 +0000	[thread overview]
Message-ID: <1673615325-20624-2-git-send-email-vipinp@vmware.com> (raw)
In-Reply-To: <1673615325-20624-1-git-send-email-vipinp@vmware.com>

In the legacy mem mode, when the fb_array is being populated, if there are holes in between, the ms_idx could go backward and there will be an overlap of the region starting from the ms_idx returned later. i.e. it's being mapped to two different physical regions in PA space to a contiguous region in VA space. this would result in the allocator assuming that the memory is contiguous even though there is a hole in between. In legacy mem, allocator assumes that PA contiguous are VA contiguous as well.

Cc: stable@dpdk.org

Signed-off-by: Vipin P R <vipinp@vmware.com>
Acked-by: Kumara Parameshwaran <kparameshwar@vmware.com>
---
 .mailmap                            | 1 +
 lib/eal/common/eal_common_fbarray.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index 75884b6..3707bf5 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1391,6 +1391,7 @@ Vincent Guo <guopengfei160@163.com>
 Vincent Jardin <vincent.jardin@6wind.com>
 Vincent Li <vincent.mc.li@gmail.com>
 Vincent S. Cojot <vcojot@redhat.com>
+Vipin P R <vipinp@vmware.com> <vipinpadmamramesh@gmail.com>
 Vipin Varghese <vipin.varghese@amd.com> <vipin.varghese@intel.com>
 Vipul Ashri <vipul.ashri@oracle.com>
 Vishal Kulkarni <vishal@chelsio.com>
diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c
index f11f879..551bd87 100644
--- a/lib/eal/common/eal_common_fbarray.c
+++ b/lib/eal/common/eal_common_fbarray.c
@@ -236,7 +236,7 @@ find_next_n(const struct rte_fbarray *arr, unsigned int start, unsigned int n,
 				 * as well, so skip that on next iteration.
 				 */
 				ignore_msk = ~((1ULL << need) - 1);
-				msk_idx = lookahead_idx;
+				msk_idx = lookahead_idx - 1;
 				break;
 			}
 
-- 
2.7.4


  reply	other threads:[~2023-01-15 20:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-13 13:08 [PATCH 0/2] *** Memory Allocation: Fixes ms_idx jump in fb_array library *** Vipin P R
2023-01-13 13:08 ` Vipin P R [this message]
2023-05-16 13:49   ` [PATCH 1/2] Memory Allocation: Fixes ms_idx jump (lookahead) during find_next_n() in fb_array library Burakov, Anatoly
2023-01-13 13:08 ` [PATCH 2/2] Memory Allocation: Fixes ms_idx jump (lookbehind) during find_prev_n() " Vipin P R
2023-05-16 14:20   ` Burakov, Anatoly

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=1673615325-20624-2-git-send-email-vipinp@vmware.com \
    --to=vipinp@vmware.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --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).