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 873B74569C for ; Wed, 24 Jul 2024 13:35:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 81EF4433CC; Wed, 24 Jul 2024 13:35:04 +0200 (CEST) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mails.dpdk.org (Postfix) with ESMTP id 56C71433BE for ; Wed, 24 Jul 2024 13:35:03 +0200 (CEST) Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-3687f91af40so3656924f8f.0 for ; Wed, 24 Jul 2024 04:35:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721820903; x=1722425703; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=K0JF1Tun+rjkVltK9YYRzgGYk3w3VkMKd0jmuG65f3g=; b=ODhURlqjGlQk0xDhHSXSTSfCDeyj+S6TklH2T/OjDyLiWvqhdnE5wnZIUwGahLFV6s efyYoyYijUJzExiOGbUjfNE3VEFuDjjPAsnz8yTrXjpqa5wNPseP+KcBlmMDH67I1n9A N3uxa3ctWmtpgq7FBAIAvId/lmKwXyvxKxZ6ebqM8bLAh+pMeTQJxa5nFKFWeURx3XpN 94s1Xu8tvVSmilmXKuNf4xdjh2JN1fUzhpCCxbGhwQpq5tbKWRZ6kyyKlnGxDmi/fekW M9ILEHBaOubSJf1qNg3sIcfAD3xKLBvtEIGarMa0qazrG2YKBgyckkifFX6MTKWwoGnl rgFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721820903; x=1722425703; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K0JF1Tun+rjkVltK9YYRzgGYk3w3VkMKd0jmuG65f3g=; b=fqLryt4/4edavMimS2m4EAMSuaZuUZIVgFqzQHZnBJC1oKnSyCa5O/0myggi26i4j1 W/jB9ZX6nr0nbQHpKp0WEPbOUhptfcd3QpdmnylTaikqPMDPoiz5iQIVars2FZkqS5at 10SMByaebfHOUKAdTFORJhTQmnSXqZRf6/l9IqPophZYPfDIWKld/wTrxNcX+lWzDl6/ 9kyiWM4w0++NTj0I5i5ZxvXD3+Ji64dKTnwIRlMkF1nlFHKtW40MZalQx1tm4rzeds8k DVxBWrCH9zppalU6NGv3GQ1w4uzxKOJHHHMNknzfPyLHYQZJBE5Keu9WRLQIrhLMGdjb DBIw== X-Forwarded-Encrypted: i=1; AJvYcCWVs/1An1WaKUIXkntZVTy0O7GuPkQ2A+aptyUpS1FYRMnMpKFzo/othEfAas6UvNtgWau7zeYMNKHIoqvKKmM= X-Gm-Message-State: AOJu0Yyt4p2dc2MCsF8ioqqvdcAmwidtTlE5qC2ate2viQU/NmgSTSLp 7M2I44u2GyGktabwAUjTZOagSd7uFDCs58RzAG5AtS7xauXlrPpUdDNOAyjy X-Google-Smtp-Source: AGHT+IF8ECXuUtVVdWDk0HaNxjcnWNB6r1sgs4l7lCD0O0PEONhPKgYWoY/mslnCwVOJWPFYeOjxkw== X-Received: by 2002:adf:cd8e:0:b0:368:4def:921f with SMTP id ffacd0b85a97d-369f5b15f21mr1133027f8f.11.1721820902767; Wed, 24 Jul 2024 04:35:02 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:7aef:1aaa:3dff:d546]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36878694a4dsm14148959f8f.59.2024.07.24.04.35.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jul 2024 04:35:02 -0700 (PDT) From: luca.boccassi@gmail.com To: Mingjin Ye Cc: Anatoly Burakov , dpdk stable Subject: patch 'bus/vdev: fix device reinitialization' has been queued to stable release 22.11.6 Date: Wed, 24 Jul 2024 12:33:10 +0100 Message-Id: <20240724113318.616754-32-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240724113318.616754-1-luca.boccassi@gmail.com> References: <20240715152704.2229503-86-luca.boccassi@gmail.com> <20240724113318.616754-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Hi, FYI, your patch has been queued to stable release 22.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/26/24. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/3682872558ec345a9762218eb8f117886bddaab4 Thanks. Luca Boccassi --- >From 3682872558ec345a9762218eb8f117886bddaab4 Mon Sep 17 00:00:00 2001 From: Mingjin Ye Date: Tue, 16 Jul 2024 09:53:28 +0000 Subject: [PATCH] bus/vdev: fix device reinitialization [ upstream commit 1bd1ab6fd010837773473d821f9284369b37264c ] In secondary processes, insert_vdev() may be called multiple times on the same device due to multi-process hot-plugging of the vdev bus and EAL parameters to add the same vdev. In this case, when rte_devargs_insert() is called, the devargs->name reference will be invalidated because rte_devargs_insert() destroys the just-allocated devargs and replaces the pointer from the devargs list. As a result, the reference to devargs->name stored in dev->device.name will be invalid. This patch fixes the issue by setting the device name after calling rte_devargs_insert(). Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel") Signed-off-by: Mingjin Ye Reviewed-by: Anatoly Burakov --- drivers/bus/vdev/vdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index 38d05a9fe9..ec7abe7cda 100644 --- a/drivers/bus/vdev/vdev.c +++ b/drivers/bus/vdev/vdev.c @@ -288,7 +288,6 @@ insert_vdev(const char *name, const char *args, dev->device.bus = &rte_vdev_bus; dev->device.numa_node = SOCKET_ID_ANY; - dev->device.name = devargs->name; if (find_vdev(name)) { /* @@ -303,6 +302,7 @@ insert_vdev(const char *name, const char *args, if (init) rte_devargs_insert(&devargs); dev->device.devargs = devargs; + dev->device.name = devargs->name; TAILQ_INSERT_TAIL(&vdev_device_list, dev, next); if (p_dev) -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-07-24 12:29:23.053065682 +0100 +++ 0032-bus-vdev-fix-device-reinitialization.patch 2024-07-24 12:29:20.803026775 +0100 @@ -1 +1 @@ -From 1bd1ab6fd010837773473d821f9284369b37264c Mon Sep 17 00:00:00 2001 +From 3682872558ec345a9762218eb8f117886bddaab4 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 1bd1ab6fd010837773473d821f9284369b37264c ] + @@ -20 +21,0 @@ -Cc: stable@dpdk.org