From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id 37559E07 for ; Tue, 24 Apr 2018 01:55:17 +0200 (CEST) Received: by mail-wr0-f193.google.com with SMTP id u18-v6so18473838wrg.3 for ; Mon, 23 Apr 2018 16:55:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=qzlerdt3N0LemCjMHwoy1B6ZZffe+Ngc9fkLwgCenSQ=; b=iijHjW6k2gNakJRnZ8Z6zmYxg4COYS7/yZlKArlPGxd/70X+e3w4mlaWDpDUiHAQQE 4iiVaSgf3ZrhQh94GVwSpx8Vhj5Zx0yluMVkS+ybCYU2EnIURudqPvBRADjs7Ba82YwQ OyIDufuj9Sc8cUePaCHaPtqTx+lZ+VA+xt4rTZl0W/nerd37xVcQta/mCCJR0sHHYGMF Tz/Gb6WSaJM5pHMWM6ZOsRsxH9oOznn6NVRvX6UfN19NRFthcXo2mvtcV/d0Ai4mKoWv t1Yai7weZfm5lcdOKx+XMU6WWXrB5lqGmrh5Eh8gRIxfXgjR4gn5IWUCSIATD6lAr3SK blZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=qzlerdt3N0LemCjMHwoy1B6ZZffe+Ngc9fkLwgCenSQ=; b=qCD8BIlG0Xe9wWMx138l5MOd5gh27HjgDY4ZpI2/xvoThJBe/u987pp6jhl2WGetEP DS76CU3T3jMh1SIBWcao5ymooo8dDlQQdrC5yGKqHVVylfTzX/vuUliCI5qDNxvNgAPQ XESnyo9gEFf9SsaGM8+uUUo6lTuS3td0V2cJwM7g528CJ6UP+z02+lEOupxtPGofE9HZ qQ+oAd9SZW/T/fsMmemlXUD2H+liP/PCtYVKG5vI6P03lq4gX1XIlXbUr3EUuXLCQ5t1 4FV4xPuWLc6brpZOJAfdgzp6mmZSfs4bmHXBuGU9jJKtOkIhle1GuxqhqeZLldvUFqvl O+rA== X-Gm-Message-State: ALQs6tBIwDoKlGuEJMrP6td4Vnkug5IlAk47rKyo9RXV1AHISWkTam4S e8kBtjBHrOwHQ9yiXvmb3OijZDPq X-Google-Smtp-Source: AIpwx4/G4UCPh1EKgDcUWHjPK+okzTVVCyR9DSwy1JpqpnQLv8YaODV8mWO2N98fu9jPEkxTnpXGcQ== X-Received: by 2002:adf:b004:: with SMTP id f4-v6mr18894755wra.75.1524527716587; Mon, 23 Apr 2018 16:55:16 -0700 (PDT) Received: from bidouze.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 55-v6sm28922279wrw.52.2018.04.23.16.55.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Apr 2018 16:55:15 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Tue, 24 Apr 2018 01:54:44 +0200 Message-Id: <2420e07aaeeb3e56e03a6a34a52ff5ea795b730f.1524527213.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v5 02/10] bus/vdev: do not reference devargs list X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 23:55:17 -0000 This list should not be operated upon by drivers. Use the public API to achieve the same functionalities. Signed-off-by: Gaetan Rivet Acked-by: Jianfeng Tan Acked-by: Thomas Monjalon --- drivers/bus/vdev/Makefile | 1 + drivers/bus/vdev/vdev.c | 11 +++-------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/bus/vdev/Makefile b/drivers/bus/vdev/Makefile index 24d424a38..bd0bb8955 100644 --- a/drivers/bus/vdev/Makefile +++ b/drivers/bus/vdev/Makefile @@ -10,6 +10,7 @@ LIB = librte_bus_vdev.a CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API # versioning export map EXPORT_MAP := rte_bus_vdev_version.map diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index f8dd1f5e6..d100f3232 100644 --- a/drivers/bus/vdev/vdev.c +++ b/drivers/bus/vdev/vdev.c @@ -228,7 +228,7 @@ rte_vdev_init(const char *name, const char *args) goto fail; } - TAILQ_INSERT_TAIL(&devargs_list, devargs, next); + rte_eal_devargs_insert(devargs); TAILQ_INSERT_TAIL(&vdev_device_list, dev, next); return 0; @@ -278,10 +278,8 @@ rte_vdev_uninit(const char *name) TAILQ_REMOVE(&vdev_device_list, dev, next); - TAILQ_REMOVE(&devargs_list, devargs, next); + rte_eal_devargs_remove(devargs->bus->name, devargs->name); - free(devargs->args); - free(devargs); free(dev); return 0; } @@ -309,10 +307,7 @@ vdev_scan(void) rte_spinlock_unlock(&vdev_custom_scan_lock); /* for virtual devices we scan the devargs_list populated via cmdline */ - TAILQ_FOREACH(devargs, &devargs_list, next) { - - if (devargs->bus != &rte_vdev_bus) - continue; + RTE_EAL_DEVARGS_FOREACH("vdev", devargs) { dev = find_vdev(devargs->name); if (dev) -- 2.11.0