From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AA4F8A0A03 for ; Fri, 15 Jan 2021 03:47:37 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9BD19140EAE; Fri, 15 Jan 2021 03:47:37 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id C5160140EA5; Fri, 15 Jan 2021 03:47:34 +0100 (CET) IronPort-SDR: V65UHaQGMl9N9yqeFFB8s3L+xJ/mtZG92NnRYWhlksMUhzdscPyLk+l8YaEJBgbxjyk+NaPDNe zMHIfK6n0iUg== X-IronPort-AV: E=McAfee;i="6000,8403,9864"; a="158260423" X-IronPort-AV: E=Sophos;i="5.79,347,1602572400"; d="scan'208";a="158260423" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jan 2021 18:47:33 -0800 IronPort-SDR: VS+Ka94jkCX1Rf0LANBq3H449xH4F4GfFs7mS/X1qdge9Ac3jRlYuBbY4fR6giV0osSegfziZN 3s56eygdKTmg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,347,1602572400"; d="scan'208";a="354130980" Received: from irsmsx602.ger.corp.intel.com ([163.33.146.8]) by fmsmga008.fm.intel.com with ESMTP; 14 Jan 2021 18:47:33 -0800 Received: from shsmsx604.ccr.corp.intel.com (10.109.6.214) by irsmsx602.ger.corp.intel.com (163.33.146.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 15 Jan 2021 02:47:30 +0000 Received: from shsmsx604.ccr.corp.intel.com ([10.109.6.214]) by SHSMSX604.ccr.corp.intel.com ([10.109.6.214]) with mapi id 15.01.1713.004; Fri, 15 Jan 2021 10:47:27 +0800 From: "Peng, ZhihongX" To: "Burakov, Anatoly" , "dev@dpdk.org" CC: "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] fbarray: fix incorrect overlap check Thread-Index: AQHW6oZZIvtO81vj80OPGQxsfToBhqon+89g Date: Fri, 15 Jan 2021 02:47:27 +0000 Message-ID: References: In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] fbarray: fix incorrect overlap check X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Tested-by: Peng, ZhihongX Regards, Peng,Zhihong -----Original Message----- From: dev 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 mem= ory area's end overlaps with some other fbarray) is incorrectly counting en= d 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 --- 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/co= mmon/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, s= ize_t len) if (start >=3D ma_start && start < ma_end) return 1; /* end overlap? */ - if (end >=3D ma_start && end < ma_end) + if (end > ma_start && end < ma_end) return 1; return 0; } -- 2.25.1