Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/49749/?format=api
http://patches.dpdk.org/api/patches/49749/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190111180659.5972-7-stephen@networkplumber.org/", "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": "<20190111180659.5972-7-stephen@networkplumber.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20190111180659.5972-7-stephen@networkplumber.org", "date": "2019-01-11T18:06:59", "name": "[6/6] net/tap: get rid of global tuntap_name", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "fdfc2b4cb6f3fb5c191926f1059fd2ef2cf5186e", "submitter": { "id": 27, "url": "http://patches.dpdk.org/api/people/27/?format=api", "name": "Stephen Hemminger", "email": "stephen@networkplumber.org" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190111180659.5972-7-stephen@networkplumber.org/mbox/", "series": [ { "id": 3137, "url": "http://patches.dpdk.org/api/series/3137/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=3137", "date": "2019-01-11T18:06:53", "name": "net/tap: fixes and cleanups", "version": 1, "mbox": "http://patches.dpdk.org/series/3137/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/49749/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/49749/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 5475B1BB2A;\n\tFri, 11 Jan 2019 19:07:21 +0100 (CET)", "from mail-pf1-f195.google.com (mail-pf1-f195.google.com\n\t[209.85.210.195]) by dpdk.org (Postfix) with ESMTP id BA7B71BAB9\n\tfor <dev@dpdk.org>; Fri, 11 Jan 2019 19:07:14 +0100 (CET)", "by mail-pf1-f195.google.com with SMTP id 64so7288162pfr.9\n\tfor <dev@dpdk.org>; Fri, 11 Jan 2019 10:07:14 -0800 (PST)", "from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127])\n\tby smtp.gmail.com with ESMTPSA id\n\tn186sm107213303pfn.137.2019.01.11.10.07.12\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 11 Jan 2019 10:07:12 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=networkplumber-org.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=iSxJV+QCE/LVqCt2kIdQMbHRKpDI+jwjwC5QbRW/QO8=;\n\tb=LQ3hr7mnK6+T+op+y0vHRK7Ty4WaVmDim8ZB92qME4ZXJYCj+/z8dja7hH9OQic1lf\n\tNlM3qHI8NIs9ud7IWiLw+65nreC0dW+mGd2jTQ14EVSsyswDAy09PHcjzXZMLyYl6AC0\n\tvUyQhjTvC26zPL7DibNj81rvyWYLukkN5hWPzkVgHKUF+05RI1dcT+QBWRaN97Pr8uAJ\n\tXn1CmMY41K619CIR2htqfGjfixwP9CGyI42s3E6EIvfiCFTCBGRsnq5LrmbpkTmtgQsA\n\tJ+4lS73tw6rcmzE+pF9XVhYK+5g53q7JIzWKx/+PHCo63FHHKhxQTZ9Ig0p7YOlOhqrx\n\tudrQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=iSxJV+QCE/LVqCt2kIdQMbHRKpDI+jwjwC5QbRW/QO8=;\n\tb=XnDdCT9IiXVDCmEpuf4PO+rlaDqnZmJ4JTxKQ5jJ4AY9sNtY55PFIGwBrWEFs4Y2Lm\n\tzi/rJgICSuxSHVltArRPyOL1s2MxWWyFbTqtcEZcPtc91KfsvPgq28pG/tRWr+j8aztl\n\t0o5J/L3v925DOefSkCfSIasGvdIrh8Fl9dvxhx6QEcH2RKGNbkFBpbZtBWJH8KUlcNU8\n\tm7AlHNMiU3mEa6UpTTVnK+CyNAM0CeXM6ivobWYm96atoinIntJCdxCTsAUIg1Cg2ARw\n\tUZnt6URahGTriseowR5l91U6DrAJkLXbfj4dxSdfFTHloQ2Kog2XPPHiuCp4aemOsR8P\n\tC8FA==", "X-Gm-Message-State": "AJcUukfvQ/C7nSO50anBNr6tmDVhnZQU7EdQQQXO498r/I9NrXiKZNLB\n\t8LF8WdxYR/Uz8D43tvCVOJjBfoQezLg=", "X-Google-Smtp-Source": "ALg8bN4zL43e1CvRR1au5zS6cZ+F1br3OdBY2Ra2K/11aisUPjsyG2RmG8z5DsvjO83WtmLJcYK72g==", "X-Received": "by 2002:a63:4926:: with SMTP id\n\tw38mr13686616pga.353.1547230033677; \n\tFri, 11 Jan 2019 10:07:13 -0800 (PST)", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "dev@dpdk.org", "Cc": "Stephen Hemminger <stephen@networkplumber.org>", "Date": "Fri, 11 Jan 2019 10:06:59 -0800", "Message-Id": "<20190111180659.5972-7-stephen@networkplumber.org>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20190111180659.5972-1-stephen@networkplumber.org>", "References": "<20190111180659.5972-1-stephen@networkplumber.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH 6/6] net/tap: get rid of global tuntap_name", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Having a global variable which is set to \"TUN\" or \"TAP\" during\nprobe is a potential bug if probing is ever done in different\nprocesses or contexts. Let's fix it now by using existing enum\nthat has type of connection.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n drivers/net/tap/rte_eth_tap.c | 30 +++++++++++++-----------------\n 1 file changed, 13 insertions(+), 17 deletions(-)", "diff": "diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c\nindex b836c1ae3d4e..0069930819c2 100644\n--- a/drivers/net/tap/rte_eth_tap.c\n+++ b/drivers/net/tap/rte_eth_tap.c\n@@ -79,8 +79,6 @@ static const char *valid_arguments[] = {\n \tNULL\n };\n \n-static char tuntap_name[8];\n-\n static volatile uint32_t tap_trigger;\t/* Rx trigger */\n \n static struct rte_eth_link pmd_link = {\n@@ -150,18 +148,17 @@ tun_alloc(struct pmd_internals *pmd, int is_keepalive)\n \n \tfd = open(TUN_TAP_DEV_PATH, O_RDWR);\n \tif (fd < 0) {\n-\t\tTAP_LOG(ERR, \"Unable to create %s interface\", tuntap_name);\n+\t\tTAP_LOG(ERR, \"Unable to open %s interface\", TUN_TAP_DEV_PATH);\n \t\tgoto error;\n \t}\n \n #ifdef IFF_MULTI_QUEUE\n \t/* Grab the TUN features to verify we can work multi-queue */\n \tif (ioctl(fd, TUNGETFEATURES, &features) < 0) {\n-\t\tTAP_LOG(ERR, \"%s unable to get TUN/TAP features\",\n-\t\t\ttuntap_name);\n+\t\tTAP_LOG(ERR, \"unable to get TUN/TAP features\");\n \t\tgoto error;\n \t}\n-\tTAP_LOG(DEBUG, \"%s Features %08x\", tuntap_name, features);\n+\tTAP_LOG(DEBUG, \"%s Features %08x\", TUN_TAP_DEV_PATH, features);\n \n \tif (features & IFF_MULTI_QUEUE) {\n \t\tTAP_LOG(DEBUG, \" Multi-queue support for %d queues\",\n@@ -1668,8 +1665,12 @@ static const struct eth_dev_ops ops = {\n \t.filter_ctrl = tap_dev_filter_ctrl,\n };\n \n+static const char *tuntap_types[ETH_TUNTAP_TYPE_MAX] = {\n+\t\"UNKNOWN\", \"TUN\", \"TAP\"\n+};\n+\n static int\n-eth_dev_tap_create(struct rte_vdev_device *vdev, char *tap_name,\n+eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,\n \t\t char *remote_iface, struct ether_addr *mac_addr,\n \t\t enum rte_tuntap_type type)\n {\n@@ -1677,12 +1678,12 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, char *tap_name,\n \tstruct rte_eth_dev *dev;\n \tstruct pmd_internals *pmd;\n \tstruct pmd_process_private *process_private;\n+\tconst char *tuntap_name = tuntap_types[type];\n \tstruct rte_eth_dev_data *data;\n \tstruct ifreq ifr;\n \tint i;\n \n-\tTAP_LOG(DEBUG, \"%s device on numa %u\",\n-\t\t\ttuntap_name, rte_socket_id());\n+\tTAP_LOG(DEBUG, \"%s device on numa %u\", tuntap_name, rte_socket_id());\n \n \tdev = rte_eth_vdev_allocate(vdev, sizeof(*pmd));\n \tif (!dev) {\n@@ -2015,8 +2016,6 @@ rte_pmd_tun_probe(struct rte_vdev_device *dev)\n \tchar remote_iface[RTE_ETH_NAME_MAX_LEN];\n \tstruct rte_eth_dev *eth_dev;\n \n-\tstrcpy(tuntap_name, \"TUN\");\n-\n \tname = rte_vdev_device_name(dev);\n \tparams = rte_vdev_device_args(dev);\n \tmemset(remote_iface, 0, RTE_ETH_NAME_MAX_LEN);\n@@ -2181,8 +2180,6 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)\n \tstruct rte_eth_dev *eth_dev;\n \tint tap_devices_count_increased = 0;\n \n-\tstrcpy(tuntap_name, \"TAP\");\n-\n \tname = rte_vdev_device_name(dev);\n \tparams = rte_vdev_device_args(dev);\n \n@@ -2264,8 +2261,8 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)\n \tif (!tap_devices_count) {\n \t\tret = rte_mp_action_register(TAP_MP_KEY, tap_mp_sync_queues);\n \t\tif (ret < 0) {\n-\t\t\tTAP_LOG(ERR, \"%s: Failed to register IPC callback: %s\",\n-\t\t\t\ttuntap_name, strerror(rte_errno));\n+\t\t\tTAP_LOG(ERR, \"tap: Failed to register IPC callback: %s\",\n+\t\t\t\tstrerror(rte_errno));\n \t\t\tgoto leave;\n \t\t}\n \t}\n@@ -2314,8 +2311,7 @@ rte_pmd_tap_remove(struct rte_vdev_device *dev)\n \tprocess_private = eth_dev->process_private;\n \n \tTAP_LOG(DEBUG, \"Closing %s Ethernet device on numa %u\",\n-\t\t(internals->type == ETH_TUNTAP_TYPE_TAP) ? \"TAP\" : \"TUN\",\n-\t\trte_socket_id());\n+\t\ttuntap_types[internals->type], rte_socket_id());\n \n \tif (internals->nlsk_fd) {\n \t\ttap_flow_flush(eth_dev, NULL);\n", "prefixes": [ "6/6" ] }{ "id": 49749, "url": "