Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1117471/?format=api
{ "id": 1117471, "url": "http://patchwork.ozlabs.org/api/patches/1117471/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1560799870-18956-7-git-send-email-vedang.patel@intel.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1560799870-18956-7-git-send-email-vedang.patel@intel.com>", "list_archive_url": null, "date": "2019-06-17T19:31:10", "name": "[net-next,v3,6/6] taprio: Adjust timestamps for TCP packets.", "commit_ref": null, "pull_url": null, "state": "awaiting-upstream", "archived": false, "hash": "863852c8717226c0d8d181334e29077b12a63224", "submitter": { "id": 76208, "url": "http://patchwork.ozlabs.org/api/people/76208/?format=api", "name": "Vedang Patel", "email": "vedang.patel@intel.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1560799870-18956-7-git-send-email-vedang.patel@intel.com/mbox/", "series": [ { "id": 114349, "url": "http://patchwork.ozlabs.org/api/series/114349/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=114349", "date": "2019-06-17T19:31:04", "name": "net/sched: Add txtime-assist support for taprio.", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/114349/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1117471/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1117471/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.137; helo=fraxinus.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com" ], "Received": [ "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 45SLtX0lSgz9sBr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 18 Jun 2019 05:31:32 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id ADC3885624;\n\tMon, 17 Jun 2019 19:31:30 +0000 (UTC)", "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id wjSEMBufdX6R; Mon, 17 Jun 2019 19:31:30 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 0A794855EF;\n\tMon, 17 Jun 2019 19:31:30 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id AC7011BF94B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 17 Jun 2019 19:31:27 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id A60BD85E14\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 17 Jun 2019 19:31:27 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id UeZmVr4y9WL0 for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 17 Jun 2019 19:31:27 +0000 (UTC)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 2143185899\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 17 Jun 2019 19:31:27 +0000 (UTC)", "from orsmga007.jf.intel.com ([10.7.209.58])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t17 Jun 2019 12:31:27 -0700", "from vpatel-desk.jf.intel.com (HELO localhost.localdomain)\n\t([10.7.159.52])\n\tby orsmga007.jf.intel.com with ESMTP; 17 Jun 2019 12:31:26 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "From": "Vedang Patel <vedang.patel@intel.com>", "To": "netdev@vger.kernel.org", "Date": "Mon, 17 Jun 2019 12:31:10 -0700", "Message-Id": "<1560799870-18956-7-git-send-email-vedang.patel@intel.com>", "X-Mailer": "git-send-email 2.7.3", "In-Reply-To": "<1560799870-18956-1-git-send-email-vedang.patel@intel.com>", "References": "<1560799870-18956-1-git-send-email-vedang.patel@intel.com>", "Subject": "[Intel-wired-lan] [PATCH net-next v3 6/6] taprio: Adjust timestamps\n\tfor TCP packets.", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>", "Cc": "jiri@resnulli.us, l@dorileo.org, jhs@mojatatu.com,\n\tintel-wired-lan@lists.osuosl.org, xiyou.wangcong@gmail.com,\n\tdavem@davemloft.net", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "When the taprio qdisc is running in \"txtime offload\" mode, it will\nset the launchtime value (in skb->tstamp) for all the packets which do\nnot have the SO_TXTIME socket option. But, the TCP packets already have\nthis value set and it indicates the earliest departure time represented\nin CLOCK_MONOTONIC clock.\n\nWe need to respect the timestamp set by the TCP subsystem. So, convert\nthis time to the clock which taprio is using and ensure that the packet\nis not transmitted before the deadline set by TCP.\n\nSigned-off-by: Vedang Patel <vedang.patel@intel.com>\n---\n net/sched/sch_taprio.c | 41 ++++++++++++++++++++++++++++++++++++++++-\n 1 file changed, 40 insertions(+), 1 deletion(-)", "diff": "diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c\nindex f63cc3a9e69a..ae261af16c13 100644\n--- a/net/sched/sch_taprio.c\n+++ b/net/sched/sch_taprio.c\n@@ -22,6 +22,7 @@\n #include <net/pkt_cls.h>\n #include <net/sch_generic.h>\n #include <net/sock.h>\n+#include <net/tcp.h>\n \n static LIST_HEAD(taprio_list);\n static DEFINE_SPINLOCK(taprio_list_lock);\n@@ -277,6 +278,41 @@ static inline ktime_t get_cycle_start(struct sched_gate_list *sched,\n \treturn ktime_sub(time, cycle_elapsed);\n }\n \n+/* This returns the tstamp value set by TCP in terms of the set clock. */\n+static ktime_t get_tcp_tstamp(struct taprio_sched *q, struct sk_buff *skb)\n+{\n+\tunsigned int offset = skb_network_offset(skb);\n+\tconst struct ipv6hdr *ipv6h;\n+\tconst struct iphdr *iph;\n+\tstruct ipv6hdr _ipv6h;\n+\n+\tipv6h = skb_header_pointer(skb, offset, sizeof(_ipv6h), &_ipv6h);\n+\tif (!ipv6h)\n+\t\treturn 0;\n+\n+\tif (ipv6h->version == 4) {\n+\t\tiph = (struct iphdr *)ipv6h;\n+\t\toffset += iph->ihl * 4;\n+\n+\t\t/* special-case 6in4 tunnelling, as that is a common way to get\n+\t\t * v6 connectivity in the home\n+\t\t */\n+\t\tif (iph->protocol == IPPROTO_IPV6) {\n+\t\t\tipv6h = skb_header_pointer(skb, offset,\n+\t\t\t\t\t\t sizeof(_ipv6h), &_ipv6h);\n+\n+\t\t\tif (!ipv6h || ipv6h->nexthdr != IPPROTO_TCP)\n+\t\t\t\treturn 0;\n+\t\t} else if (iph->protocol != IPPROTO_TCP) {\n+\t\t\treturn 0;\n+\t\t}\n+\t} else if (ipv6h->version == 6 && ipv6h->nexthdr != IPPROTO_TCP) {\n+\t\treturn 0;\n+\t}\n+\n+\treturn ktime_mono_to_any(skb->skb_mstamp_ns, q->tk_offset);\n+}\n+\n /* There are a few scenarios where we will have to modify the txtime from\n * what is read from next_txtime in sched_entry. They are:\n * 1. If txtime is in the past,\n@@ -294,7 +330,7 @@ static inline ktime_t get_cycle_start(struct sched_gate_list *sched,\n */\n static long get_packet_txtime(struct sk_buff *skb, struct Qdisc *sch)\n {\n-\tktime_t transmit_end_time, interval_end, interval_start;\n+\tktime_t transmit_end_time, interval_end, interval_start, tcp_tstamp;\n \tstruct taprio_sched *q = qdisc_priv(sch);\n \tstruct sched_gate_list *sched, *admin;\n \tktime_t minimum_time, now, txtime;\n@@ -305,6 +341,9 @@ static long get_packet_txtime(struct sk_buff *skb, struct Qdisc *sch)\n \tnow = taprio_get_time(q);\n \tminimum_time = ktime_add_ns(now, q->txtime_delay);\n \n+\ttcp_tstamp = get_tcp_tstamp(q, skb);\n+\tminimum_time = max_t(ktime_t, minimum_time, tcp_tstamp);\n+\n \trcu_read_lock();\n \tadmin = rcu_dereference(q->admin_sched);\n \tsched = rcu_dereference(q->oper_sched);\n", "prefixes": [ "net-next", "v3", "6/6" ] }