Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2877/?format=api
http://patches.dpdk.org/api/patches/2877/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1422763322-13742-10-git-send-email-mukawa@igel.co.jp/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1422763322-13742-10-git-send-email-mukawa@igel.co.jp>", "list_archive_url": "https://inbox.dpdk.org/dev/1422763322-13742-10-git-send-email-mukawa@igel.co.jp", "date": "2015-02-01T04:01:56", "name": "[dpdk-dev,v6,09/13] eal/pci: Add a function to remove the entry of devargs list", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "1d85f6485efd1214995cc257f34f9d8fb4ff981c", "submitter": { "id": 64, "url": "http://patches.dpdk.org/api/people/64/?format=api", "name": "Tetsuya Mukawa", "email": "mukawa@igel.co.jp" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1422763322-13742-10-git-send-email-mukawa@igel.co.jp/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/2877/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/2877/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id C27055AD1;\n\tSun, 1 Feb 2015 05:02:51 +0100 (CET)", "from mail-pa0-f54.google.com (mail-pa0-f54.google.com\n\t[209.85.220.54]) by dpdk.org (Postfix) with ESMTP id 2C9765AB7\n\tfor <dev@dpdk.org>; Sun, 1 Feb 2015 05:02:41 +0100 (CET)", "by mail-pa0-f54.google.com with SMTP id eu11so68344973pac.13\n\tfor <dev@dpdk.org>; Sat, 31 Jan 2015 20:02:40 -0800 (PST)", "from localhost.localdomain (napt.igel.co.jp. [219.106.231.132])\n\tby mx.google.com with ESMTPSA id\n\thd4sm5369241pbc.86.2015.01.31.20.02.38\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tSat, 31 Jan 2015 20:02:39 -0800 (PST)" ], "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=IMIXoYw8USxaLQsnHod0VDfr4Ma7zHD2cMZA2moCSkA=;\n\tb=EX3E+A6mMOYgiATUDPnGc2qvCfsSpoprW9GSph0IT+OmCnmHllfgC12N63D8ND/YWH\n\tmUCNYofy/6AbVigrrvJRIdre05nQj/2fT0+4BiLhyGgNtqhVXIfVnMZvXxIYTiC97ZIg\n\tbWczuaa/dOreUKN5ch2wIVz51Nr3TkfNGjhT+DCGf+pG4Bn5pT5Q7IdLNxFWVvstz28z\n\tNVRqNWQa5+yx4G8hBL2P/7mFlzOtVz0VUP1fOqTDHyJkt3aa+POLKWOd61UsP5wgPZiC\n\teRNnW9LVZ+6HvSoS93c5OdvAVyxdwqYsBCYyAtuBcuMLE2RVZnDBs9vf4mWG/bXjfl29\n\tQrFg==", "X-Gm-Message-State": "ALoCoQkK/axM7glBdElLvxL2RT9fO7s4yKVhkVOGnVypCrOy7PoxquTwJOIgwe1uT9JdF6gS1BgK", "X-Received": "by 10.68.141.204 with SMTP id rq12mr19875750pbb.7.1422763360365; \n\tSat, 31 Jan 2015 20:02:40 -0800 (PST)", "From": "Tetsuya Mukawa <mukawa@igel.co.jp>", "To": "dev@dpdk.org", "Date": "Sun, 1 Feb 2015 13:01:56 +0900", "Message-Id": "<1422763322-13742-10-git-send-email-mukawa@igel.co.jp>", "X-Mailer": "git-send-email 1.9.1", "In-Reply-To": "<1422763322-13742-1-git-send-email-mukawa@igel.co.jp>", "References": "<1421664027-17971-9-git-send-email-mukawa@igel.co.jp>\n\t<1422763322-13742-1-git-send-email-mukawa@igel.co.jp>", "Subject": "[dpdk-dev] [PATCH v6 09/13] eal/pci: Add a function to remove the\n\tentry of devargs list", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "The function removes the specified devargs entry from devargs_list.\nAlso the patch adds sanity checking to rte_eal_devargs_add().\n\nv5:\n- Change function definition of rte_eal_devargs_remove().\nv4:\n- Fix sanity check code.\n\nSigned-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>\n---\n lib/librte_eal/common/eal_common_devargs.c | 60 +++++++++++++++++++++++++++++\n lib/librte_eal/common/include/rte_devargs.h | 21 ++++++++++\n 2 files changed, 81 insertions(+)", "diff": "diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c\nindex 4c7d11a..5b1ac8e 100644\n--- a/lib/librte_eal/common/eal_common_devargs.c\n+++ b/lib/librte_eal/common/eal_common_devargs.c\n@@ -44,6 +44,35 @@\n struct rte_devargs_list devargs_list =\n \tTAILQ_HEAD_INITIALIZER(devargs_list);\n \n+\n+/* find a entry specified by pci address or device name */\n+static struct rte_devargs *\n+rte_eal_devargs_find(enum rte_devtype devtype, void *args)\n+{\n+\tstruct rte_devargs *devargs;\n+\n+\tif (args == NULL)\n+\t\treturn NULL;\n+\n+\tTAILQ_FOREACH(devargs, &devargs_list, next) {\n+\t\tswitch (devtype) {\n+\t\tcase RTE_DEVTYPE_WHITELISTED_PCI:\n+\t\tcase RTE_DEVTYPE_BLACKLISTED_PCI:\n+\t\t\tif (eal_compare_pci_addr(&devargs->pci.addr, args) == 0)\n+\t\t\t\tgoto found;\n+\t\t\tbreak;\n+\t\tcase RTE_DEVTYPE_VIRTUAL:\n+\t\t\tif (memcmp(&devargs->virtual.drv_name, args,\n+\t\t\t strlen((char *)args)) == 0)\n+\t\t\t\tgoto found;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\treturn NULL;\n+found:\n+\treturn devargs;\n+}\n+\n /* store a whitelist parameter for later parsing */\n int\n rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str)\n@@ -87,6 +116,12 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str)\n \t\t\tfree(devargs);\n \t\t\treturn -1;\n \t\t}\n+\t\t/* make sure there is no same entry */\n+\t\tif (rte_eal_devargs_find(devtype, &devargs->pci.addr)) {\n+\t\t\tRTE_LOG(ERR, EAL,\n+\t\t\t\t\"device already registered: <%s>\\n\", buf);\n+\t\t\treturn -1;\n+\t\t}\n \t\tbreak;\n \tcase RTE_DEVTYPE_VIRTUAL:\n \t\t/* save driver name */\n@@ -98,6 +133,12 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str)\n \t\t\tfree(devargs);\n \t\t\treturn -1;\n \t\t}\n+\t\t/* make sure there is no same entry */\n+\t\tif (rte_eal_devargs_find(devtype, &devargs->virtual.drv_name)) {\n+\t\t\tRTE_LOG(ERR, EAL,\n+\t\t\t\t\"device already registered: <%s>\\n\", buf);\n+\t\t\treturn -1;\n+\t\t}\n \t\tbreak;\n \t}\n \n@@ -105,6 +146,25 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str)\n \treturn 0;\n }\n \n+/* remove it from the devargs_list */\n+int\n+rte_eal_devargs_remove(enum rte_devtype devtype, void *args)\n+{\n+\tstruct rte_devargs *devargs;\n+\n+\tif (args == NULL)\n+\t\treturn -EINVAL;\n+\n+\tdevargs = rte_eal_devargs_find(devtype, args);\n+\tif (devargs == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"device not found\\n\");\n+\t\treturn -ENODEV;\n+\t}\n+\n+\tTAILQ_REMOVE(&devargs_list, devargs, next);\n+\treturn 0;\n+}\n+\n /* count the number of devices of a specified type */\n unsigned int\n rte_eal_devargs_type_count(enum rte_devtype devtype)\ndiff --git a/lib/librte_eal/common/include/rte_devargs.h b/lib/librte_eal/common/include/rte_devargs.h\nindex 9f9c98f..b5ad4b3 100644\n--- a/lib/librte_eal/common/include/rte_devargs.h\n+++ b/lib/librte_eal/common/include/rte_devargs.h\n@@ -123,6 +123,27 @@ extern struct rte_devargs_list devargs_list;\n int rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str);\n \n /**\n+ * Remove a device from the user device list\n+ *\n+ * For PCI devices, the format of arguments string is \"PCI_ADDR\". It shouldn't\n+ * involves parameters for the device. Example: \"08:00.1\".\n+ *\n+ * For virtual devices, the format of arguments string is \"DRIVER_NAME*\". It\n+ * shouldn't involves parameters for the device. Example: \"eth_ring\". The\n+ * validity of the driver name is not checked by this function, it is done\n+ * when closing the drivers.\n+ *\n+ * @param devtype\n+ * The type of the device.\n+ * @param name\n+ * The name of the device.\n+ *\n+ * @return\n+ * - 0 on success, negative on error\n+ */\n+int rte_eal_devargs_remove(enum rte_devtype devtype, void *args);\n+\n+/**\n * Count the number of user devices of a specified type\n *\n * @param devtype\n", "prefixes": [ "dpdk-dev", "v6", "09/13" ] }{ "id": 2877, "url": "