Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/819026/?format=api
{ "id": 819026, "url": "http://patchwork.ozlabs.org/api/patches/819026/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1506500637-13881-4-git-send-email-jasowang@redhat.com/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api", "name": "Linux network development", "link_name": "netdev", "list_id": "netdev.vger.kernel.org", "list_email": "netdev@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1506500637-13881-4-git-send-email-jasowang@redhat.com>", "list_archive_url": null, "date": "2017-09-27T08:23:57", "name": "[net-next,3/3] tun: introduce cpu id based steering policy", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "8ab138562b5aace1872d78d5cf6fa9faf5a57dc4", "submitter": { "id": 5225, "url": "http://patchwork.ozlabs.org/api/people/5225/?format=api", "name": "Jason Wang", "email": "jasowang@redhat.com" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/1506500637-13881-4-git-send-email-jasowang@redhat.com/mbox/", "series": [ { "id": 5306, "url": "http://patchwork.ozlabs.org/api/series/5306/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=5306", "date": "2017-09-27T08:23:56", "name": "support changing steering policies in tuntap", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/5306/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/819026/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/819026/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com", "ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=jasowang@redhat.com" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y29qJ0Nscz9t3x\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 27 Sep 2017 18:25:00 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752530AbdI0IYa (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 27 Sep 2017 04:24:30 -0400", "from mx1.redhat.com ([209.132.183.28]:39102 \"EHLO mx1.redhat.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1752373AbdI0IYO (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tWed, 27 Sep 2017 04:24:14 -0400", "from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id CE540C0546D2;\n\tWed, 27 Sep 2017 08:24:13 +0000 (UTC)", "from jason-ThinkPad-T450s.redhat.com (ovpn-12-60.pek2.redhat.com\n\t[10.72.12.60])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id EA1BF77C95;\n\tWed, 27 Sep 2017 08:24:11 +0000 (UTC)" ], "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com CE540C0546D2", "From": "Jason Wang <jasowang@redhat.com>", "To": "netdev@vger.kernel.org, linux-kernel@vger.kernel.org", "Cc": "mst@redhat.com, Jason Wang <jasowang@redhat.com>", "Subject": "[PATCH net-next 3/3] tun: introduce cpu id based steering policy", "Date": "Wed, 27 Sep 2017 16:23:57 +0800", "Message-Id": "<1506500637-13881-4-git-send-email-jasowang@redhat.com>", "In-Reply-To": "<1506500637-13881-1-git-send-email-jasowang@redhat.com>", "References": "<1506500637-13881-1-git-send-email-jasowang@redhat.com>", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.15", "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.32]);\n\tWed, 27 Sep 2017 08:24:13 +0000 (UTC)", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "This patch introduces a simple queue selection policy which just\nchoose txq based on processor id. This maybe useful for connectless\nworkload or #queues is equal to #cpus.\n\nRedirect UDP packets generated by MoonGen between two virtio-net ports\nthrough xdp_redirect show 37.4% (from 0.8Mpps to 1.1Mpps) improvement\ncompared to automatic steering policy since the overhead of flow\ncaches/hasing was totally eliminated.\n\nSigned-off-by: Jason Wang <jasowang@redhat.com>\n---\n drivers/net/tun.c | 33 ++++++++++++++++++++++++++++++++-\n include/uapi/linux/if_tun.h | 1 +\n 2 files changed, 33 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/net/tun.c b/drivers/net/tun.c\nindex 1106521..03b4506 100644\n--- a/drivers/net/tun.c\n+++ b/drivers/net/tun.c\n@@ -190,6 +190,20 @@ struct tun_steering_ops {\n \t\t\t u32 data);\n };\n \n+void tun_steering_xmit_nop(struct tun_struct *tun, struct sk_buff *skb)\n+{\n+}\n+\n+u32 tun_steering_pre_rx_nop(struct tun_struct *tun, struct sk_buff *skb)\n+{\n+\treturn 0;\n+}\n+\n+void tun_steering_post_rx_nop(struct tun_struct *tun, struct tun_file *tfile,\n+\t\t\t u32 data)\n+{\n+}\n+\n struct tun_flow_entry {\n \tstruct hlist_node hash_link;\n \tstruct rcu_head rcu;\n@@ -571,6 +585,11 @@ static u16 tun_automq_select_queue(struct tun_struct *tun, struct sk_buff *skb)\n \treturn txq;\n }\n \n+static u16 tun_cpu_select_queue(struct tun_struct *tun, struct sk_buff *skb)\n+{\n+\treturn smp_processor_id() % tun->numqueues;\n+}\n+\n static u16 tun_select_queue(struct net_device *dev, struct sk_buff *skb,\n \t\t\t void *accel_priv, select_queue_fallback_t fallback)\n {\n@@ -2152,6 +2171,13 @@ static struct tun_steering_ops tun_automq_ops = {\n \t.post_rx = tun_automq_post_rx,\n };\n \n+static struct tun_steering_ops tun_cpu_ops = {\n+\t.select_queue = tun_cpu_select_queue,\n+\t.xmit = tun_steering_xmit_nop,\n+\t.pre_rx = tun_steering_pre_rx_nop,\n+\t.post_rx = tun_steering_post_rx_nop,\n+};\n+\n static int tun_flags(struct tun_struct *tun)\n {\n \treturn tun->flags & (TUN_FEATURES | IFF_PERSIST | IFF_TUN | IFF_TAP);\n@@ -2775,6 +2801,9 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,\n \t\tcase TUN_STEERING_AUTOMQ:\n \t\t\ttun->steering_ops = &tun_automq_ops;\n \t\t\tbreak;\n+\t\tcase TUN_STEERING_CPU:\n+\t\t\ttun->steering_ops = &tun_cpu_ops;\n+\t\t\tbreak;\n \t\tdefault:\n \t\t\tret = -EFAULT;\n \t\t}\n@@ -2784,6 +2813,8 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,\n \t\tret = 0;\n \t\tif (tun->steering_ops == &tun_automq_ops)\n \t\t\tsteering = TUN_STEERING_AUTOMQ;\n+\t\telse if (tun->steering_ops == &tun_cpu_ops)\n+\t\t\tsteering = TUN_STEERING_CPU;\n \t\telse\n \t\t\tBUG();\n \t\tif (copy_to_user(argp, &steering, sizeof(steering)))\n@@ -2792,7 +2823,7 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,\n \n \tcase TUNGETSTEERINGFEATURES:\n \t\tret = 0;\n-\t\tsteering = TUN_STEERING_AUTOMQ;\n+\t\tsteering = TUN_STEERING_AUTOMQ | TUN_STEERING_CPU;\n \t\tif (copy_to_user(argp, &steering, sizeof(steering)))\n \t\t\tret = -EFAULT;\n \t\tbreak;\ndiff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h\nindex 109760e..5f71d29 100644\n--- a/include/uapi/linux/if_tun.h\n+++ b/include/uapi/linux/if_tun.h\n@@ -112,5 +112,6 @@ struct tun_filter {\n };\n \n #define TUN_STEERING_AUTOMQ 0x01 /* Automatic flow steering */\n+#define TUN_STEERING_CPU 0x02 /* Processor id based flow steering */\n \n #endif /* _UAPI__IF_TUN_H */\n", "prefixes": [ "net-next", "3/3" ] }