From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f179.google.com (mail-wr0-f179.google.com [209.85.128.179]) by dpdk.org (Postfix) with ESMTP id 1B14B559A for ; Wed, 21 Jun 2017 01:36:26 +0200 (CEST) Received: by mail-wr0-f179.google.com with SMTP id c11so56128271wrc.3 for ; Tue, 20 Jun 2017 16:36:26 -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=HT33iaycQ8e0mm3tWd8qw03B9hFGfQGNUn8T3/sdUdU=; b=zyL2wrdCUrMKfxIeqml0sYS1HpQh4kSj9pu0U6qCtAQhQBKzeSnz140iAuH9ozmLpN Qbk7199bQv9eLmG/j9OE/benTN8GZNrw3Nw+8OzWKteYCnFiWY1wSy+pWsmohZ9/3fwU H4vnMV6IIck6G/orFpDAFf+Ca0z/YS/7vI+yR+3zHj58wYggCI2oZaqeHwkbZf2ov9lh k3lFYXyO6M4fFj/advOf8ABtTROoK86jFM4G/k7tL1svG3/tTzC1PGTzdxJY+tH2aFLN yNZAst9DCmT2lF06oRrgvEK76g289PVRzZ6KDRKZbOfOz/iWF7XQ7Ek1VMuiINUcPoR1 6b1Q== 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=HT33iaycQ8e0mm3tWd8qw03B9hFGfQGNUn8T3/sdUdU=; b=ddjtPoC3WFjxHcBWUC/RmociK8PiUgZ2kTpVPXxfzobUtd2PK70B2nHgJyRktZDLkW +aIsiB54znRZYnxIKvv/6kAt9RzgWg2f4or1+22TztI7ZYua6lcvN7rJyYss65oIT9dc OK99OLCfPeuj71cDsXNsU06g5m2+vwKMJdCPteOE/ATWUxf8JX/OSf7P8BTT5tYLZ76i 5+sHUOIBurp7XAsY1nb1pcP1RTAP/FVJNh0JwAj5q9wat+Gf2KOZWiRow8yZcAYvRj1N IDCI92em4ySFMTdhsTbf5YdqSO2YFhEHSCxpIbKvgwAW4/tGkSO4EKxRt3/o8/C8sPQj fOVg== X-Gm-Message-State: AKS2vOzo19HWqhKHIuqWhjoQcosam6XaCCNJKf8etElWpWmzX8bmMPNB 7WkzbBjr1CYnP6u93Cc= X-Received: by 10.28.207.133 with SMTP id f127mr4443463wmg.84.1498001785518; Tue, 20 Jun 2017 16:36:25 -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 f45sm6463684wrf.2.2017.06.20.16.36.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 16:36:24 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Wed, 21 Jun 2017 01:35:52 +0200 Message-Id: <473f81b88a9d1e33b33ae0816f59783c8a7686aa.1498001626.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v5 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: Tue, 20 Jun 2017 23:36:26 -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 10009fa..bbd57c5 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