From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id D8D56A0524;
	Mon, 19 Apr 2021 13:48:02 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 6266341295;
	Mon, 19 Apr 2021 13:48:01 +0200 (CEST)
Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com
 [64.147.123.24])
 by mails.dpdk.org (Postfix) with ESMTP id F0CC74123B;
 Mon, 19 Apr 2021 13:47:59 +0200 (CEST)
Received: from compute2.internal (compute2.nyi.internal [10.202.2.42])
 by mailout.west.internal (Postfix) with ESMTP id 1E1E7B09;
 Mon, 19 Apr 2021 07:47:58 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute2.internal (MEProxy); Mon, 19 Apr 2021 07:47:58 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding:content-type; s=fm1; bh=
 mQi56b/so1ztWSGTqCUtYqDT+3Wa4TSXNgA/mkar758=; b=HOdNu7IlJwRPmlZg
 1k8cNCGu9utXqaYqdKchx1MYOcT8IOd5C+6K3qnVZ8Dcl+vxykdMnZ0j0s7CVnTU
 ykDn6leRz7Ryfqwdu3u2CO9b3McMRTCihwLrsprLWB6YjWNUcrFJe6XuS8PcdCm7
 dvTQH4d73PfnuzByPRM/I7Kat1tnhuY1FdmCP4nt7AP9uAabx9QJbUq6u7H6z0D9
 8KvUCFG7od86Sl9d8lXusZchO3T5cOj+izTVUiPwjVgsv+1D9BxPGSz1ycZUPhao
 Hv3srTcFb9mhXztmvbbAECUc7QbiDk0HeRp0o4/5tXVsxahqYYavtnVmVH+CMo54
 Xcxz7Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :date:from:in-reply-to:message-id:mime-version:references
 :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
 :x-sasl-enc; s=fm2; bh=mQi56b/so1ztWSGTqCUtYqDT+3Wa4TSXNgA/mkar7
 58=; b=jtLZSeIm4P4pTV7IOJLeFFNx/T30wm4Lw1yGiuIQFPMpS3KBwcKjKzgzJ
 guOQ/Cfti/Ppe0ZhnvzIxob3v2b+uo7NdjOMFdrrVGyTKO5g9PEPODtKSlzdeGW+
 rXIcbSCvhk+9/HDFZ8dqGdoLEiXRr0OI1N6LcjAKevz1q4HUUPALddwRuM9ce+zA
 rWfrLAyRgNEixg0MISF5SWCT16k867nQ2bM1jUJhzeg+rvX+0Ub8l7+9D23dvtQU
 AgFupq8l/31VmKNhC2k0TKkrmo4BHFEtrJcTQMrr4oOnunkIeJj+Uz54X0MxcKlD
 406tVG4xe6iIAh8MhY57xMXs1LaQA==
X-ME-Sender: <xms:7W19YK85U_Sr-kZ2m9JgjqetcOeJofQUoW_jzTJ1Y18Nv4negauZkA>
 <xme:7W19YKpKDCUgfSRTZNlAf6q2oh1wP9PwiDvjRpCdlrDa8aQluQi3APKxf05svLUPK
 uLXHpQa3rJFvqfGOw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddtgedggeehucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr
 shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg
 ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu
 ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf
 hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl
 ohhnrdhnvght
X-ME-Proxy: <xmx:7W19YM57LbN87IAdOSeJPjbe85gO1px6OV0FZ7YQ-gVWeHzOjwi0kg>
 <xmx:7W19YKO3K68uGEdOZ5v8ZFTi_DjFWG3MXo6mHFTzeq_n5K4wcFbpBQ>
 <xmx:7W19YOOr3I8qg8gl4E_lAQsUivofTqrL65oS5ki9zY2udyGfhQCRAg>
 <xmx:7W19YHxGlhCSTbPbAnZtb1eSZ9L77i5L8qu4G0Mx_WfnSaVzWd3Fqg>
Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184])
 by mail.messagingengine.com (Postfix) with ESMTPA id 3C421108005C;
 Mon, 19 Apr 2021 07:47:56 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: wangyunjian <wangyunjian@huawei.com>
Cc: dev@dpdk.org, stable@dpdk.org, david.marchand@redhat.com,
 anatoly.burakov@intel.com, ktraynor@redhat.com, dingxiaoxiong@huawei.com,
 Yunjian Wang <wangyunjian@huawei.com>
Date: Mon, 19 Apr 2021 13:47:54 +0200
Message-ID: <3999835.CjcHxTCJUi@thomas>
In-Reply-To: <1618047477-22368-1-git-send-email-wangyunjian@huawei.com>
References: <1602840525-8848-1-git-send-email-wangyunjian@huawei.com>
 <1618047477-22368-1-git-send-email-wangyunjian@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v5] eal: fix create user mem
 map repeatedly when it exists
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

10/04/2021 11:37, wangyunjian:
> From: Yunjian Wang <wangyunjian@huawei.com>
> 
> Currently, new user mem maps are checked if they are adjacent to
> an existing mem map and if so, the mem map entries are merged.
> 
> It doesn't check for duplicate mem maps, so if the API is called

As Kevin suggested, it should be in the past tense: "didn't".

> with the same mem map multiple times, they will occupy multiple
> mem map entries. This will reduce the amount of entries available
> for unique mem maps.
> 
> So check for duplicate mem maps and merge them into one mem map
> entry if any found.
> 
> Fixes: 0cbce3a167f1 ("vfio: skip DMA map failure if already mapped")
> Cc: stable@dpdk.org
> 
> Suggested-by: Kevin Traynor <ktraynor@redhat.com>
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied, thanks.