From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f170.google.com (mail-wr0-f170.google.com [209.85.128.170]) by dpdk.org (Postfix) with ESMTP id 63AE37CAA for ; Tue, 11 Jul 2017 01:19:28 +0200 (CEST) Received: by mail-wr0-f170.google.com with SMTP id c11so159266437wrc.3 for ; Mon, 10 Jul 2017 16:19:28 -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=ZiSYggjmg4BbG3X7lfZ7o6snzW9upqp3rix+sgaYJlk=; b=z0q17a362zwU03jYxq7t4osDOu5VbbS/X9952OI23a9B3SFhYAVEJFSwb4/ejGsSfS KhVbN2AUc7ftCL56fg0fIqgzpQ8SXaarlLKxza/Hbh0oeHvkAhSkK95RCqhBihRSLXsg /JEUnU3J0CrpA6tmJuEfCfqLLR2ov4WF/sExRNCM5DRTxpsPIjje7tyzoVUqsqBwMcjr TDBXL7WqpOY89DXK7nQO4JnG6rbhxeAH/FTKYnS2UKrrjoubYEoR0KG7eNnNRJ34WzqW 3eWhW2m0+U7i17/k7FR44zkQN6S/bQihzAUuf0LNmLFHdOcPH6Plgb2dc0L08YeQ+h7j 1fQA== 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=ZiSYggjmg4BbG3X7lfZ7o6snzW9upqp3rix+sgaYJlk=; b=p9PjobwYJbwJzYgH96SL2AjBucpUzSYyjcpCym2kLEITlSSgsmbYY1KAohnV9tL7fl E7qZwVzZoCdv7CbD1iQc9BO8OtT3XcXynkcoM8D0jblWygdugMkp5otuMz1CPM4s97Rs Zoh7KryFTy9aQB1M/L686eEXWV+P/oQF/zcxhH49eYJoMP5vMY51Y9O1mTTmDYG299kO IeBF4lYkeEGYv8IGf0klLlfw4ffBD+HlYtViiQBu0rINfnZVUuxkFztlyF8pbW4WNObU 7l0t2uMD0caECk/eo/fHPFhay5ETtBVARXGO/EzSVEN7pdMB1B6TRLgXix5Blv5eiPca bwqQ== X-Gm-Message-State: AIVw111LQEpOOwW+ZBiPYFYs41uX4gXEoSNkzXTXuFiJyuzQXg8SXR8A 8dA2W/Yg9l6YOKTAslU= X-Received: by 10.223.162.219 with SMTP id t27mr9034024wra.68.1499728767554; Mon, 10 Jul 2017 16:19:27 -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 j190sm43773wmd.22.2017.07.10.16.19.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Jul 2017 16:19:26 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Tue, 11 Jul 2017 01:19:02 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 3/8] devargs: introduce insert 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: Mon, 10 Jul 2017 23:19:28 -0000 This new function expects a fully-formed rte_devargs, previously parsed and allocated. It does not check whether the new rte_devargs is compatible with current bus configuration, but will replace any eventual existing one for the same device. Signed-off-by: Gaetan Rivet --- lib/librte_eal/bsdapp/eal/rte_eal_version.map | 1 + lib/librte_eal/common/eal_common_devargs.c | 12 ++++++++++++ lib/librte_eal/common/include/rte_devargs.h | 13 +++++++++++++ lib/librte_eal/linuxapp/eal/rte_eal_version.map | 1 + 4 files changed, 27 insertions(+) diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map index 40cd523..8b24309 100644 --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map @@ -206,6 +206,7 @@ DPDK_17.08 { EXPERIMENTAL { global: + rte_eal_devargs_insert; rte_eal_devargs_parse; rte_eal_devargs_remove; rte_eal_hotplug_add; diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c index bcdee13..ff6c2a8 100644 --- a/lib/librte_eal/common/eal_common_devargs.c +++ b/lib/librte_eal/common/eal_common_devargs.c @@ -138,6 +138,18 @@ rte_eal_devargs_parse(const char *dev, struct rte_devargs *da) return 0; } +int +rte_eal_devargs_insert(struct rte_devargs *da) +{ + int ret; + + ret = rte_eal_devargs_remove(da->bus->name, da->name); + if (ret < 0) + return ret; + TAILQ_INSERT_TAIL(&devargs_list, da, next); + return 0; +} + /* store a whitelist parameter for later parsing */ int rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str) diff --git a/lib/librte_eal/common/include/rte_devargs.h b/lib/librte_eal/common/include/rte_devargs.h index 36453b6..7b63fa3 100644 --- a/lib/librte_eal/common/include/rte_devargs.h +++ b/lib/librte_eal/common/include/rte_devargs.h @@ -139,6 +139,19 @@ rte_eal_devargs_parse(const char *dev, struct rte_devargs *da); /** + * Insert an rte_devargs in the global list. + * + * @param da + * The devargs structure to insert. + * + * @return + * - 0 on success + * - Negative on error. + */ +int +rte_eal_devargs_insert(struct rte_devargs *da); + +/** * Add a device to the user device list * * For PCI devices, the format of arguments string is "PCI_ADDR" or diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map index a8ee349..81f6af3 100644 --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map @@ -211,6 +211,7 @@ DPDK_17.08 { EXPERIMENTAL { global: + rte_eal_devargs_insert; rte_eal_devargs_parse; rte_eal_devargs_remove; rte_eal_hotplug_add; -- 2.1.4