From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by dpdk.org (Postfix) with ESMTP id E447E7F74 for ; Tue, 4 Nov 2014 04:37:26 +0100 (CET) Received: by mail-pa0-f46.google.com with SMTP id lf10so13574807pab.33 for ; Mon, 03 Nov 2014 19:46:43 -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=Jij704CtOpWjrcYna1ePUusThXi3En5qvmlFO+ZG01vZnFTZAGJlIDKlWsjzh3nFDx GRM45agYMJcKKWqaRScYqkplT3Q/NxgJhGMV6a+fefMiE3L4Gn5q0sCcEECxIWAuwyxC +9v0GbrCuFjDsrh4ZyZ/GmmVHnlciDtR6yYK2aSgRNVSvd+8BBGx1GHXxUONhp3axWhe Oiq13rMnYRTZOTr9v5eLMzQIxbIvcI6sfD7k+gqCAZPrfUTCDRms/kvlXVVaQRzdRndx 1AGqcvBEWKPgi3HKFXrRhg97JCEVDX23sjG84/+ik71IfPhwmL6WRKS2mfSeat3U1Dy/ YBNA== X-Gm-Message-State: ALoCoQlbkw/dRBoqhmC9H3gCusWPfw+lJcrlVPNnoq599JSOFBZWbW3/X4BP/763+CZAZp/d8Eef X-Received: by 10.66.155.2 with SMTP id vs2mr5403563pab.135.1415072803077; Mon, 03 Nov 2014 19:46:43 -0800 (PST) Received: from localhost.localdomain (napt.igel.co.jp. [219.106.231.132]) by mx.google.com with ESMTPSA id jc3sm18430580pbb.49.2014.11.03.19.46.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Nov 2014 19:46:42 -0800 (PST) From: Tetsuya Mukawa To: dev@dpdk.org Date: Tue, 4 Nov 2014 12:45:34 +0900 Message-Id: <1415072748-31937-15-git-send-email-mukawa@igel.co.jp> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415072748-31937-1-git-send-email-mukawa@igel.co.jp> References: <1414572576-21371-1-git-send-email-mukawa@igel.co.jp> <1415072748-31937-1-git-send-email-mukawa@igel.co.jp> Cc: nakajima.yoshihiro@lab.ntt.co.jp, masutani.hitoshi@lab.ntt.co.jp Subject: [dpdk-dev] [RFC PATCH v2 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: , X-List-Received-Date: Tue, 04 Nov 2014 03:37:27 -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