DPDK patches and discussions
 help / color / mirror / Atom feed
From: Xueming Li <xuemingl@nvidia.com>
Cc: dev@dpdk.org, xuemingl@nvidia.com,
	Harris James R <james.r.harris@intel.com>,
	Gaetan Rivet <grive@u256.net>, Ray Kinsella <mdr@ashroe.eu>
Subject: [dpdk-dev] [PATCH] devargs: backup entry when inserting duplicated item
Date: Sat, 17 Apr 2021 23:15:32 +0800	[thread overview]
Message-ID: <20210417151532.12628-1-xuemingl@nvidia.com> (raw)

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 <xuemingl@nvidia.com>
---
 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


             reply	other threads:[~2021-04-17 15:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-17 15:15 Xueming Li [this message]
2021-04-19 16:15 ` Thomas Monjalon

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=20210417151532.12628-1-xuemingl@nvidia.com \
    --to=xuemingl@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=grive@u256.net \
    --cc=james.r.harris@intel.com \
    --cc=mdr@ashroe.eu \
    /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).