From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id 190C87CCD for ; Thu, 8 Jun 2017 01:57:40 +0200 (CEST) Received: by mail-wm0-f46.google.com with SMTP id d73so20758864wma.0 for ; Wed, 07 Jun 2017 16:57:40 -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=L39d1+x1ocQaKlojobuBdWy6VooL1YtjS1I1JicCUVs=; b=pZ58kOvjWDscNVX4UeciCrnBrw8waXF/YFjC7oYr7Z9XVt7e9DTGyl9XZLH5PIkp0o n2IWa4Ib6TELvF1nvNglJ6akBHbnt0Um7DntcLqKxO8MkIVlW2WHcNJh92AuAconWHl0 PRt2thKy2bUaa9w0Id/WqZV6cxdtNyeQSBLffRvrr7i//ut4nkPTovg7pAtcVYl0vrhR IfPkVR/S4hh4JWqg2qLAeoWYYZfi3pjYomyyvVL+e0cv7uWfjjjH9ZwYXkGJK2pPZBf0 2CIhWtRieEq93bpsoD2/jBExBwcmcTI4YPrrpnxOeCjfXIC006ZKkTV6KdU8w1lsRLqQ kqNA== 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=L39d1+x1ocQaKlojobuBdWy6VooL1YtjS1I1JicCUVs=; b=b4YM56X8JsyGVLTv64gXdLBQxb0bUh9D4HHX1UfQs7mEz7ErL3FYsn2q7ddCHTI1Yd Q1KbU8+y9SWY1guMDtCgQQ1oQw4+bJk6GcU6m4pajymk6QqJy4RPeO9HvjKWeTpzGzX8 l7JHoEH+lfiFs0Y8+++viGm5YQNgC4KmlIOZtl5/WB0NpC/lwmhkyCY4wM/z6ahVQGlO CgsP/Gryq5v5IdPiBTy/Le3edrgjKlfxi4vi7RKm9S65JZo2ISKXKOZU55e+b1no/EcK YUTGNzkRbJFEqhiUyPfTHY3V1OHyoqGF92ThHmwhQgrf/Zw1VECoz64Da7FdZwbxhxtY xtwg== X-Gm-Message-State: AKS2vOxd3pPEjD2bh/A/u+pU4N8a6Sm+BNATSlAHDefvm68KShLkfNPZ Gz4/w2nNgUR4iHoetZ0= X-Received: by 10.28.55.69 with SMTP id e66mr1430014wma.16.1496879860195; Wed, 07 Jun 2017 16:57:40 -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 185sm22397056wmp.1.2017.06.07.16.57.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Jun 2017 16:57:39 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Thu, 8 Jun 2017 01:57:04 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v4 18/19] devargs: remove function 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: Wed, 07 Jun 2017 23:57:41 -0000 This function is now necessary due to the new unplug rte_bus API. Signed-off-by: Gaetan Rivet --- lib/librte_eal/bsdapp/eal/rte_eal_version.map | 1 + lib/librte_eal/common/eal_common_devargs.c | 18 ++++++++++++++++++ lib/librte_eal/common/include/rte_devargs.h | 14 ++++++++++++++ lib/librte_eal/linuxapp/eal/rte_eal_version.map | 1 + 4 files changed, 34 insertions(+) diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map index a506968..d069de0 100644 --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map @@ -204,5 +204,6 @@ DPDK_17.08 { rte_bus_from_name; rte_bus_from_dev; rte_eal_devargs_clone; + rte_eal_devargs_rmv; } DPDK_17.05; diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c index 07b89ef..1a6a67f 100644 --- a/lib/librte_eal/common/eal_common_devargs.c +++ b/lib/librte_eal/common/eal_common_devargs.c @@ -183,6 +183,24 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str) return -1; } +/* Remove and free an rte_devargs. */ +int +rte_eal_devargs_rmv(struct rte_devargs *da) +{ + struct rte_devargs *d; + void *tmp; + + TAILQ_FOREACH_SAFE(d, &devargs_list, next, tmp) { + if (d == da) { + TAILQ_REMOVE(&devargs_list, d, next); + free(d->args); + free(d); + return 0; + } + } + return 1; +} + /* Deep-copy of an rte_devargs. */ struct rte_devargs * rte_eal_devargs_clone(struct rte_devargs *da) diff --git a/lib/librte_eal/common/include/rte_devargs.h b/lib/librte_eal/common/include/rte_devargs.h index 892b035..f61707c 100644 --- a/lib/librte_eal/common/include/rte_devargs.h +++ b/lib/librte_eal/common/include/rte_devargs.h @@ -163,6 +163,20 @@ rte_eal_devargs_parse(const char *dev, int rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str); /** + * Remove a device from the user device list. + * The devargs is then freed. + * + * @param da + * devargs to remove. + * + * @return + * 0 on success. + * <0 on error. + * >0 if the devargs was not within the user device list. + */ +int rte_eal_devargs_rmv(struct rte_devargs *da); + +/** * Deep copy an rte_devargs. * * @param da diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map index 6e6638a..19eec05 100644 --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map @@ -208,5 +208,6 @@ DPDK_17.08 { rte_bus_from_name; rte_bus_from_dev; rte_eal_devargs_clone; + rte_eal_devargs_rmv; } DPDK_17.05; -- 2.1.4