From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id B9948A69 for ; Tue, 24 Apr 2018 00:41:38 +0200 (CEST) Received: by mail-wr0-f195.google.com with SMTP id u18-v6so18183698wrg.3 for ; Mon, 23 Apr 2018 15:41:38 -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=YdEWmwhqlLbRUm6fI6REsGHGJ8HUNAPCas+0KkNqCl4=; b=rW9IgbGZpkcExbUYqcd1HgXpkztK0R9DIzJfeutzObmdwjGYD5xFsa4rySy5UXr9qA I9c5OZuLyGUItsY64axA/2PBeEf08/fSgQ77NnI5nhi0uI2c+cT998v8FXZHVmCLfECh yRIs1DgQOh9IA0QwXY6tfNrlNLcGHVvHL07tITC8U40O3wGW4kWfFk7i9BPxMvIUPGkq oAo6zTrqI/N/0nJsKhn66xj9HNvkmEGcOYayuL+ZlcCIMe+pFkKZC1ZLZw3AsNtT3JWb Cu9U+ZWCrh3kOeJM2JKWr116zun/lR6xMz736A43yJ4x4wkKb/kkoD+VR4zFy/FG44ap Ls9w== 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=YdEWmwhqlLbRUm6fI6REsGHGJ8HUNAPCas+0KkNqCl4=; b=Kfqbq5qpTQV3tCn+1bhQCCe9u8T7WjbOcvzRnKiboONq7PrSMIVMjjtSsqykURJgnE hREx1RA0Hdusu3y2GKZvThfHW0keaGdCq/chzZiAoAUpHFc7TDowjBtVMZ74cmXdsC9b Cr+j0zU2WtLn9uQ16gD2zMOTs514aKRtkz92IkrX34kNH8QdFdcL4sCZ2UnPyKroZJUM gHbcED9dzukhQnS1w/hpxtnlPeIi49hR7a4E38pn0k2/lMo9fJmbQLiFY/uHVd3hanM0 JBZDgegmW8XgOEPq131oTeb43jgV5dQKwJMsH6hGCMn9f13n4C3D5tHogBcqZwhKqWeE qNIQ== X-Gm-Message-State: ALQs6tDH8W1Zt/V8QwP+2JO7BWl+DcLUVagQD62wfMBk8I+6TuAeM/jC dPWIizLRrer1j6Hk+Et9dJGFZYRk X-Google-Smtp-Source: AB8JxZrYCkrcw8BbG2lRlnVpmPtIr6jMkojwGwBEtZYrcNbFcIUnPOZOEySz1oWSe7M0qvIwOsCk2w== X-Received: by 10.28.74.133 with SMTP id n5mr11324995wmi.31.1524523297975; Mon, 23 Apr 2018 15:41:37 -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 x189sm1590705wmg.0.2018.04.23.15.41.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Apr 2018 15:41:36 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Tue, 24 Apr 2018 00:41:03 +0200 Message-Id: <6ef90e088aaf0c63cbdef01f3cc7ca360b9d2750.1524522515.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 v4 03/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 22:41:39 -0000 This list should not be operated upon by drivers. Use the public API to achieve the same functionalities. Signed-off-by: Gaetan Rivet --- 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