patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Peng, ZhihongX" <zhihongx.peng@intel.com>
To: "Burakov, Anatoly" <anatoly.burakov@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] fbarray: fix incorrect overlap check
Date: Fri, 15 Jan 2021 02:47:27 +0000	[thread overview]
Message-ID: <d3283f52e9814b86919a62d6c34b77a0@intel.com> (raw)
In-Reply-To: <bd5da27cc0e2a5d1355c33c945333702f4a456b8.1610636561.git.anatoly.burakov@intel.com>

Tested-by: Peng, ZhihongX <zhihongx.peng@intel.com>

Regards,
Peng,Zhihong

-----Original Message-----
From: dev <dev-bounces@dpdk.org> On Behalf Of Anatoly Burakov
Sent: Thursday, January 14, 2021 11:03 PM
To: dev@dpdk.org
Cc: stable@dpdk.org
Subject: [dpdk-dev] [PATCH] fbarray: fix incorrect overlap check

When we're attaching fbarrays in secondary processes, we check for whether the intended memory address for the fbarray is already in use by some other, local fbarray. However, the check for end-overlap (i.e. to see if our memory area's end overlaps with some other fbarray) is incorrectly counting end offset as part of the overlap. Fix the check.

Fixes: 5b61c62cfd76 ("fbarray: add internal tailq for mapped areas")
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/common/eal_common_fbarray.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eal/common/eal_common_fbarray.c b/lib/librte_eal/common/eal_common_fbarray.c
index 1220e2bae9..d974f3dab7 100644
--- a/lib/librte_eal/common/eal_common_fbarray.c
+++ b/lib/librte_eal/common/eal_common_fbarray.c
@@ -110,7 +110,7 @@ overlap(const struct mem_area *ma, const void *start, size_t len)
 	if (start >= ma_start && start < ma_end)
 		return 1;
 	/* end overlap? */
-	if (end >= ma_start && end < ma_end)
+	if (end > ma_start && end < ma_end)
 		return 1;
 	return 0;
 }
--
2.25.1

  reply	other threads:[~2021-01-15  2:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-14 15:02 [dpdk-stable] " Anatoly Burakov
2021-01-15  2:47 ` Peng, ZhihongX [this message]
2021-01-19 12:15 ` [dpdk-stable] [dpdk-dev] " David Marchand

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=d3283f52e9814b86919a62d6c34b77a0@intel.com \
    --to=zhihongx.peng@intel.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).