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 8B882A0562; Sat, 17 Apr 2021 17:16:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 18880161C7B; Sat, 17 Apr 2021 17:16:33 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by mails.dpdk.org (Postfix) with ESMTP id 379CA4068F for ; Sat, 17 Apr 2021 17:16:31 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from xuemingl@nvidia.com) with SMTP; 17 Apr 2021 18:16:30 +0300 Received: from nvidia.com ([172.27.8.62]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 13HFGSQC021857; Sat, 17 Apr 2021 18:16:28 +0300 From: Xueming Li To: Cc: dev@dpdk.org, xuemingl@nvidia.com, Harris James R , Gaetan Rivet , Ray Kinsella Date: Sat, 17 Apr 2021 23:15:32 +0800 Message-Id: <20210417151532.12628-1-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] devargs: backup entry when inserting duplicated item X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When insert devargs that already in list, existing one was reset and replaced completely by new once, the entry info was lost during copy. This patch backups entry info before copy. Fixes: 64051bb1f144 ("devargs: unify scratch buffer storage") Signed-off-by: Xueming Li --- lib/librte_eal/common/eal_common_devargs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c index e40b91ea66..96e0456d20 100644 --- a/lib/librte_eal/common/eal_common_devargs.c +++ b/lib/librte_eal/common/eal_common_devargs.c @@ -295,6 +295,7 @@ rte_devargs_insert(struct rte_devargs **da) if (strcmp(listed_da->bus->name, (*da)->bus->name) == 0 && strcmp(listed_da->name, (*da)->name) == 0) { /* device already in devargs list, must be updated */ + (*da)->next = listed_da->next; rte_devargs_reset(listed_da); *listed_da = **da; /* replace provided devargs with found one */ -- 2.25.1