From patchwork Tue Dec 9 06:30:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tetsuya Mukawa X-Patchwork-Id: 1870 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 1767680A7; Tue, 9 Dec 2014 07:31:22 +0100 (CET) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by dpdk.org (Postfix) with ESMTP id 0EDDD80A6 for ; Tue, 9 Dec 2014 07:31:20 +0100 (CET) Received: by mail-pa0-f46.google.com with SMTP id lj1so6758819pab.19 for ; Mon, 08 Dec 2014 22:31:19 -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=YolLVy1otHuOCIzrDJJ8JMu0VCo0/sLoldJYL10C95Y=; b=RamowYjDDuPmfbsow05qSVMW7gahE/k36ubA4yy0LKISHPTSnNP+emgxc07kYRBhv9 79C+F2mWBw97mEMVQDUT8rfNMclEdXPSC52MI4iKW+ojFk1M+fGX8DiYkvuNiIPt91ef GNJnb2hQFaiTIIoOUau8q/aTmfMgwHqOMlhrBufKIyDxaZtju/tNCdGK9ai6zcsYccEc DiiqSG1jxYIm8D3OZRiqgjyfnLe8z3KQNZZDPSbZYWlIex0/6C0TbRDpFJyfbKXwQKF2 jCwXfSce4D/VlpZbOKm6bNFyvQOzoqLctfKsLKK/KiqBjEgfDz2ZRgEHCvYZrJF6Qf5i Vhew== X-Gm-Message-State: ALoCoQnLk1po+pV6LarGV9qSR+byS+fxLf+/yQHRwURBGinjxVd2R9s46mFI5puUI5u34dv7vgul X-Received: by 10.68.68.237 with SMTP id z13mr2132208pbt.151.1418106679456; Mon, 08 Dec 2014 22:31:19 -0800 (PST) Received: from eris.hq.igel.co.jp (napt.igel.co.jp. [219.106.231.132]) by mx.google.com with ESMTPSA id f12sm403088pat.43.2014.12.08.22.31.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Dec 2014 22:31:18 -0800 (PST) From: Tetsuya Mukawa To: dev@dpdk.org Date: Tue, 9 Dec 2014 15:30:15 +0900 Message-Id: <1418106629-22227-15-git-send-email-mukawa@igel.co.jp> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1418106629-22227-1-git-send-email-mukawa@igel.co.jp> References: <1416474399-16851-1-git-send-email-mukawa@igel.co.jp> <1418106629-22227-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 v3 14/28] 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The function removes a specified devargs from devargs_list. Signed-off-by: Tetsuya Mukawa --- lib/librte_eal/common/eal_common_devargs.c | 16 ++++++++++++++++ lib/librte_eal/common/include/rte_devargs.h | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c index f95a12d..5fd2a2c 100644 --- a/lib/librte_eal/common/eal_common_devargs.c +++ b/lib/librte_eal/common/eal_common_devargs.c @@ -140,6 +140,22 @@ 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; + + if (args == NULL) + return; + + 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..1066efd 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 from 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