From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f169.google.com (mail-pd0-f169.google.com [209.85.192.169]) by dpdk.org (Postfix) with ESMTP id 9DD718002 for ; Thu, 20 Nov 2014 09:57:22 +0100 (CET) Received: by mail-pd0-f169.google.com with SMTP id fp1so2674829pdb.28 for ; Thu, 20 Nov 2014 01:07:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=r4z9Vnkr4vJnwZP/5m3tk3QqdrkBXc+DN1doHzQpOaI=; b=bJ1LPE3kx+Aztm7rj+j/2ifdU3cPYu3XnDfflguoRpl5B8hXBTyQu7pU2YyUbYI1ed BenNHmCpYfzmsyRny+IexZ2EsxfNQrkqYGKs/qwLdZa/FDv9L2xZKqa0YodCbW7L715g olpqmBfAw7HKn51wXycPEFPSwpml8zKDzUFZ2cJ39uu/Zl4M+SVkvYVwghR3WFdiFdlg bExl29c1cWQgBx/hi9IfklTHPK0cdEAbasHTroXoQEADYN8ov5mAN9g5i7M2Z/HhpnX9 KvVonig23ylc9B6mzHkdVuEZP1aD2NUsrjRCbKnf0jeIIHgLJzollEGckQsQBCMdjElb EQ4Q== X-Gm-Message-State: ALoCoQlqxiJG9M8oanar+gc9vdo1a8S4bamf47g8iz9Jz3ojT7jPz3qlDZojRCKaFPQcIJGkLcrc X-Received: by 10.67.6.1 with SMTP id cq1mr25439356pad.23.1416474471471; Thu, 20 Nov 2014 01:07:51 -0800 (PST) Received: from localhost.localdomain (napt.igel.co.jp. [219.106.231.132]) by mx.google.com with ESMTPSA id a6sm1432407pbu.64.2014.11.20.01.07.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Nov 2014 01:07:50 -0800 (PST) From: Tetsuya Mukawa To: dev@dpdk.org Date: Thu, 20 Nov 2014 18:06:28 +0900 Message-Id: <1416474399-16851-15-git-send-email-mukawa@igel.co.jp> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1416474399-16851-1-git-send-email-mukawa@igel.co.jp> References: <1414572576-21371-1-git-send-email-mukawa@igel.co.jp> <1416474399-16851-1-git-send-email-mukawa@igel.co.jp> Cc: nakajima.yoshihiro@lab.ntt.co.jp, menrigh@brocade.com, masutani.hitoshi@lab.ntt.co.jp Subject: [dpdk-dev] [PATCH 14/25] eal/pci: Add rte_eal_devargs_remove X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 08:57:23 -0000 The function removes a specified devargs from devargs_list. Signed-off-by: Tetsuya Mukawa --- lib/librte_eal/common/eal_common_devargs.c | 13 +++++++++++++ lib/librte_eal/common/include/rte_devargs.h | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c index aaa6901..0916cf8 100644 --- a/lib/librte_eal/common/eal_common_devargs.c +++ b/lib/librte_eal/common/eal_common_devargs.c @@ -137,6 +137,19 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str) return 0; } +/* remove it from the devargs_list */ +void +rte_eal_devargs_remove(enum rte_devtype devtype, void *args) +{ + struct rte_devargs *devargs; + + devargs = rte_eal_devargs_find(devtype, args); + if (devargs == NULL) + return; + + TAILQ_REMOVE(&devargs_list, devargs, next); +} + /* count the number of devices of a specified type */ unsigned int rte_eal_devargs_type_count(enum rte_devtype devtype) diff --git a/lib/librte_eal/common/include/rte_devargs.h b/lib/librte_eal/common/include/rte_devargs.h index 9f9c98f..57842b3 100644 --- a/lib/librte_eal/common/include/rte_devargs.h +++ b/lib/librte_eal/common/include/rte_devargs.h @@ -123,6 +123,24 @@ extern struct rte_devargs_list devargs_list; int rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str); /** + * Remove a device form the user device list + * + * For PCI devices, the format of arguments string is "PCI_ADDR". It shouldn't + * involves parameters for the device. Example: "08:00.1". + * + * For virtual devices, the format of arguments string is "DRIVER_NAME*". It + * shouldn't involves parameters for the device. Example: "eth_ring". The + * validity of the driver name is not checked by this function, it is done + * when closing the drivers. + * + * @param devtype + * The type of the device. + * @param name + * The name of the device. + */ +void rte_eal_devargs_remove(enum rte_devtype devtype, void *args); + +/** * Count the number of user devices of a specified type * * @param devtype -- 1.9.1