From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f172.google.com (mail-pd0-f172.google.com [209.85.192.172]) by dpdk.org (Postfix) with ESMTP id 48E0A7FC6 for ; Wed, 29 Oct 2014 09:41:38 +0100 (CET) Received: by mail-pd0-f172.google.com with SMTP id r10so2563338pdi.17 for ; Wed, 29 Oct 2014 01:50:28 -0700 (PDT) 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=FRuJMYRhe4guN4r0MPChTLhmwuaGS5Frx5T9fVa8KUY8aln6HtnxOsJw9XaaYCs2JC RgLKIMzaXlrtdl9tTAYVukd56h4eQ2ckXHNYIaI2zsJzAJ1om8qOv+qgav9+rkIgvoH6 uwnevzRawwFOyVMYhT3uSdBV9g5WZ78RHD5Yl6YZgUHPaUL05doe3FuxvWQPFqUf1VqH G36bxrvj+5nrxco8xl1fbONMz5oCOzy2JTPXqfEZesjB5lHU0eb2JtbNtrmQst7eTz4b kk1qOpKm9Bvib2fXH/OJMLqZ4USSGK01NPyQSmhGEbjJ+erAX+8mrUN0J1ANI7aAOvJU bwpg== X-Gm-Message-State: ALoCoQmzjrGimDIz5Uytr69f9VVhCo9P3vr7DA1RfeClPmxcmr6IXZgElmY2TC6xDLZXC6SvoJsA X-Received: by 10.66.65.169 with SMTP id y9mr6229096pas.24.1414572628640; Wed, 29 Oct 2014 01:50:28 -0700 (PDT) Received: from eris.hq.igel.co.jp (napt.igel.co.jp. [219.106.231.132]) by mx.google.com with ESMTPSA id ky4sm3686872pbc.55.2014.10.29.01.50.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Oct 2014 01:50:28 -0700 (PDT) From: Tetsuya Mukawa To: dev@dpdk.org Date: Wed, 29 Oct 2014 17:49:25 +0900 Message-Id: <1414572576-21371-15-git-send-email-mukawa@igel.co.jp> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1414572576-21371-1-git-send-email-mukawa@igel.co.jp> References: <1414572576-21371-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 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: Wed, 29 Oct 2014 08:41:38 -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