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 7CB3243CB2 for ; Thu, 14 Mar 2024 10:54:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7758542E5E; Thu, 14 Mar 2024 10:54:38 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) by mails.dpdk.org (Postfix) with ESMTP id 004CC400D5; Thu, 14 Mar 2024 10:54:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710410075; x=1741946075; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=U/9hDK+WemuwTzVaiO2ua2FU9uZ/uKlnzmoxOBfYsGs=; b=g9AVdc/alQxMBq3VVwdR6JdzBh1aJyiy5DikFNPb4De+NDMZyHhUl+yW 4MfSnBG/fSU8It1qqavcoy/D1/V5sk7MOuCckmAHuthpw5K+Q6T+Dk0h3 27FGOfI505f/uGAlvAYrapk7lcFCeIMsk/DfXhxQztscAEjtHej7Bbx1W zBu8SGdXCJfR4MMdQId6ncjbKL1a0obPTd1mRKCTjYhR5V+2PlSxDogHJ Z7nATQygNRh28KO1+0XdM3sRoteHCkB7jTnDJLrHGUzYrkzCSSu5H3BPw HTbxgLl4h3Kd9Jj7nFRhOO9dFWjlt3MNK2Ip5Zk6UlX8B5eiN/4TuxIG1 A==; X-IronPort-AV: E=McAfee;i="6600,9927,11012"; a="5339884" X-IronPort-AV: E=Sophos;i="6.07,125,1708416000"; d="scan'208";a="5339884" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2024 02:54:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,125,1708416000"; d="scan'208";a="12125201" Received: from unknown (HELO localhost.localdomain) ([10.239.252.253]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2024 02:54:33 -0700 From: Mingjin Ye To: dev@dpdk.org Cc: Mingjin Ye , stable@dpdk.org, Anatoly Burakov Subject: [PATCH 1/3] bus/vdev: revert fix devargs in secondary process Date: Thu, 14 Mar 2024 09:36:28 +0000 Message-Id: <20240314093630.1066948-2-mingjinx.ye@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240314093630.1066948-1-mingjinx.ye@intel.com> References: <20240314093630.1066948-1-mingjinx.ye@intel.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 The asan tool detected a memory leak in the vdev driver alloc_devargs. The previous commit was that when inserting a vdev device, the primary process alloc devargs and the secondary process looks for devargs. This causes the device to not be created if the secondary process does not initialise the vdev device. And, this is not the root cause. Therefore the following commit was reverted accordingly. Fixes: 6666628362c9 ("bus/vdev: fix devargs in secondary process") After restoring this commit, the memory leak still exists. A new patch has since fixed this issue. Fixes: 6666628362c9 ("bus/vdev: fix devargs in secondary process") Cc: stable@dpdk.org Signed-off-by: Mingjin Ye --- drivers/bus/vdev/vdev.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index 14cf856237..38d05a9fe9 100644 --- a/drivers/bus/vdev/vdev.c +++ b/drivers/bus/vdev/vdev.c @@ -263,22 +263,6 @@ alloc_devargs(const char *name, const char *args) return devargs; } -static struct rte_devargs * -vdev_devargs_lookup(const char *name) -{ - struct rte_devargs *devargs; - char dev_name[32]; - - RTE_EAL_DEVARGS_FOREACH("vdev", devargs) { - devargs->bus->parse(devargs->name, &dev_name); - if (strcmp(dev_name, name) == 0) { - VDEV_LOG(INFO, "devargs matched %s", dev_name); - return devargs; - } - } - return NULL; -} - static int insert_vdev(const char *name, const char *args, struct rte_vdev_device **p_dev, @@ -291,10 +275,7 @@ insert_vdev(const char *name, const char *args, if (name == NULL) return -EINVAL; - if (rte_eal_process_type() == RTE_PROC_PRIMARY) - devargs = alloc_devargs(name, args); - else - devargs = vdev_devargs_lookup(name); + devargs = alloc_devargs(name, args); if (!devargs) return -ENOMEM; -- 2.25.1