patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] fbarray: fix incorrect overlap check
@ 2021-01-14 15:02 Anatoly Burakov
  2021-01-15  2:47 ` [dpdk-stable] [dpdk-dev] " Peng, ZhihongX
  2021-01-19 12:15 ` David Marchand
  0 siblings, 2 replies; 3+ messages in thread
From: Anatoly Burakov @ 2021-01-14 15:02 UTC (permalink / raw)
  To: dev; +Cc: stable

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] fbarray: fix incorrect overlap check
  2021-01-14 15:02 [dpdk-stable] [PATCH] fbarray: fix incorrect overlap check Anatoly Burakov
@ 2021-01-15  2:47 ` Peng, ZhihongX
  2021-01-19 12:15 ` David Marchand
  1 sibling, 0 replies; 3+ messages in thread
From: Peng, ZhihongX @ 2021-01-15  2:47 UTC (permalink / raw)
  To: Burakov, Anatoly, dev; +Cc: stable

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] fbarray: fix incorrect overlap check
  2021-01-14 15:02 [dpdk-stable] [PATCH] fbarray: fix incorrect overlap check Anatoly Burakov
  2021-01-15  2:47 ` [dpdk-stable] [dpdk-dev] " Peng, ZhihongX
@ 2021-01-19 12:15 ` David Marchand
  1 sibling, 0 replies; 3+ messages in thread
From: David Marchand @ 2021-01-19 12:15 UTC (permalink / raw)
  To: Anatoly Burakov; +Cc: dev, dpdk stable

On Thu, Jan 14, 2021 at 4:03 PM Anatoly Burakov
<anatoly.burakov@intel.com> wrote:
>
> 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>
Tested-by: Zhihong Peng <zhihongx.peng@intel.com>

Applied.

-- 
David Marchand


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-19 12:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-14 15:02 [dpdk-stable] [PATCH] fbarray: fix incorrect overlap check Anatoly Burakov
2021-01-15  2:47 ` [dpdk-stable] [dpdk-dev] " Peng, ZhihongX
2021-01-19 12:15 ` David Marchand

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git