Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/49760/?format=api
https://patches.dpdk.org/api/patches/49760/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190111203520.19944-7-stephen@networkplumber.org/", "project": { "id": 1, "url": "https://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": "<20190111203520.19944-7-stephen@networkplumber.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20190111203520.19944-7-stephen@networkplumber.org", "date": "2019-01-11T20:35:19", "name": "[v2,6/7] net/tap: get rid of global tuntap_name", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "fdfc2b4cb6f3fb5c191926f1059fd2ef2cf5186e", "submitter": { "id": 27, "url": "https://patches.dpdk.org/api/people/27/?format=api", "name": "Stephen Hemminger", "email": "stephen@networkplumber.org" }, "delegate": { "id": 319, "url": "https://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20190111203520.19944-7-stephen@networkplumber.org/mbox/", "series": [ { "id": 3139, "url": "https://patches.dpdk.org/api/series/3139/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=3139", "date": "2019-01-11T20:35:13", "name": "net/tap: fixes and cleanups", "version": 2, "mbox": "https://patches.dpdk.org/series/3139/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/49760/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/49760/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 D63AB1BBEE;\n\tFri, 11 Jan 2019 21:35:39 +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 C45F01BBDC\n\tfor <dev@dpdk.org>; Fri, 11 Jan 2019 21:35:36 +0100 (CET)", "by mail-pf1-f195.google.com with SMTP id 64so7459425pfr.9\n\tfor <dev@dpdk.org>; Fri, 11 Jan 2019 12:35:36 -0800 (PST)", "from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127])\n\tby smtp.gmail.com with ESMTPSA id\n\tf32sm96610438pgf.80.2019.01.11.12.35.33\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 11 Jan 2019 12:35:34 -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=gU7tWRWDcg78/QteNhNJDrakoTGeFzFmIYUxBmCVUek=;\n\tb=0a2+Yx+qNSAA808LtdY1G4vALGEQ1jnAs39S5PPkHSdBLqXikcC6UucplugJ4c23Yc\n\thzlCuKLPCzHgrX5E0eDAQiKytTUxYEy7rXpURv3vZ8k2yHgl4Efcxm3gJF4l4Akdu/cH\n\tRfiOnMpKkT5vcrumMA8n/85h62XsprZ9Si8R0QQzm4jQV3E1g9sEsbN4lksQw9Zv2Kb2\n\terlMDYHfWTdZyf+zagi0H8G98gwMDqbXuSkogp4TlnLmSXHwT5+slCqf9vYvZOteBL/Y\n\tZqT8On2BFMRTlGv9wIc26E5+ODxEghWILgOxu9FpLMKyL5Xh56/D8CbX37ije0AW+dh/\n\t6Vog==", "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=gU7tWRWDcg78/QteNhNJDrakoTGeFzFmIYUxBmCVUek=;\n\tb=K0Tb1w77NKSEeyr2FpOUV0zl4IG41MRZ+9lbZYBOwq0be3lTCL8iZlfvxvFdFy3MpH\n\tuYmi5URSQuo7pHhRA9yBBEU1Z8buhip7KNs/BqnIojgd7DVUOqoMxoPTGZpkzMOIryHg\n\tcWJobF/rbE1pbs0rKw5Lkr54xKQrPDK8z9IZNcLQYCuFvavPBJyFajaTyin3uaMoMGQe\n\tP37W4mU+oEGqiQ/7K77uI5sMnny2p49Yx10MKo5RxH/Cvbq7W1dCXOfhP43WrcFrgKzR\n\t4iZNWqa957wcnZ2XFJRgRBQFNtryziAdsLugBX6bJiDQJGd7joyf4TOqsaPDOF65Ezu/\n\to2qA==", "X-Gm-Message-State": "AJcUukcyYlmOuPcZB4f/2utHnCdsa9mHjoZwHal8h59QTYvW/OkuzdAj\n\tA/mEqe1kckzC6BJ2mfiYottyDw==", "X-Google-Smtp-Source": "ALg8bN4wEB+ACxs9MNTywLs+9xvA0X5DDcUbM7k6XPQvdaHAGiqGkQCP22E9JqHSgDH6NjjIkfR4Gg==", "X-Received": "by 2002:a62:6204:: with SMTP id w4mr16176921pfb.5.1547238935909; \n\tFri, 11 Jan 2019 12:35:35 -0800 (PST)", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "keith.wiles@intel.com", "Cc": "dev@dpdk.org,\n\tStephen Hemminger <stephen@networkplumber.org>", "Date": "Fri, 11 Jan 2019 12:35:19 -0800", "Message-Id": "<20190111203520.19944-7-stephen@networkplumber.org>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20190111203520.19944-1-stephen@networkplumber.org>", "References": "<20190111180659.5972-1-stephen@networkplumber.org>\n\t<20190111203520.19944-1-stephen@networkplumber.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v2 6/7] 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>\nAcked-by Keith Wiles <keith.wiles@intel.com>\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 ed8483cb96bc..705c90dadee5 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@@ -2016,8 +2017,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@@ -2182,8 +2181,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@@ -2266,8 +2263,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@@ -2316,8 +2313,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": [ "v2", "6/7" ] }{ "id": 49760, "url": "