Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1117470/?format=api
{ "id": 1117470, "url": "http://patchwork.ozlabs.org/api/patches/1117470/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1560799870-18956-6-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-6-git-send-email-vedang.patel@intel.com>", "list_archive_url": null, "date": "2019-06-17T19:31:09", "name": "[net-next,v3,5/6] taprio: make clock reference conversions easier", "commit_ref": null, "pull_url": null, "state": "awaiting-upstream", "archived": false, "hash": "48d2d4d9502e61d8a3909b57a4faf9bb3560a39f", "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-6-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/1117470/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1117470/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.133; helo=hemlock.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 hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\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 45SLtW4QfQz9s9y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 18 Jun 2019 05:31:31 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 2D6EE82753;\n\tMon, 17 Jun 2019 19:31:30 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id nixnNg4dSbkz; Mon, 17 Jun 2019 19:31:28 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 3D10C823EC;\n\tMon, 17 Jun 2019 19:31:28 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 73E4F1BF94B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 17 Jun 2019 19:31:26 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 701E986096\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 17 Jun 2019 19:31:26 +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 L4gZ8OEEVoxB for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 17 Jun 2019 19:31:25 +0000 (UTC)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id BF9F185E14\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 17 Jun 2019 19:31:25 +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:25 -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:25 -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:09 -0700", "Message-Id": "<1560799870-18956-6-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 5/6] taprio: make clock\n\treference conversions easier", "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": "Later in this series we will need to transform from\nCLOCK_MONOTONIC (used in TCP) to the clock reference used in TAPRIO.\n\nSigned-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>\nSigned-off-by: Vedang Patel <vedang.patel@intel.com>\n---\n net/sched/sch_taprio.c | 30 ++++++++++++++++++++++--------\n 1 file changed, 22 insertions(+), 8 deletions(-)", "diff": "diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c\nindex ab6080013666..f63cc3a9e69a 100644\n--- a/net/sched/sch_taprio.c\n+++ b/net/sched/sch_taprio.c\n@@ -61,6 +61,7 @@ struct taprio_sched {\n \tstruct Qdisc **qdiscs;\n \tstruct Qdisc *root;\n \tu32 flags;\n+\tenum tk_offsets tk_offset;\n \tint clockid;\n \tatomic64_t picos_per_byte; /* Using picoseconds because for 10Gbps+\n \t\t\t\t * speeds it's sub-nanoseconds per byte\n@@ -71,7 +72,6 @@ struct taprio_sched {\n \tstruct sched_entry __rcu *current_entry;\n \tstruct sched_gate_list __rcu *oper_sched;\n \tstruct sched_gate_list __rcu *admin_sched;\n-\tktime_t (*get_time)(void);\n \tstruct hrtimer advance_timer;\n \tstruct list_head taprio_list;\n \tint txtime_delay;\n@@ -85,6 +85,20 @@ static ktime_t sched_base_time(const struct sched_gate_list *sched)\n \treturn ns_to_ktime(sched->base_time);\n }\n \n+static inline ktime_t taprio_get_time(struct taprio_sched *q)\n+{\n+\tktime_t mono = ktime_get();\n+\n+\tswitch (q->tk_offset) {\n+\tcase TK_OFFS_MAX:\n+\t\treturn mono;\n+\tdefault:\n+\t\treturn ktime_mono_to_any(mono, q->tk_offset);\n+\t}\n+\n+\treturn KTIME_MAX;\n+}\n+\n static void taprio_free_sched_cb(struct rcu_head *head)\n {\n \tstruct sched_gate_list *sched = container_of(head, struct sched_gate_list, rcu);\n@@ -288,7 +302,7 @@ static long get_packet_txtime(struct sk_buff *skb, struct Qdisc *sch)\n \tstruct sched_entry *entry;\n \tbool sched_changed;\n \n-\tnow = q->get_time();\n+\tnow = taprio_get_time(q);\n \tminimum_time = ktime_add_ns(now, q->txtime_delay);\n \n \trcu_read_lock();\n@@ -479,7 +493,7 @@ static struct sk_buff *taprio_dequeue(struct Qdisc *sch)\n \t\t\tcontinue;\n \n \t\tlen = qdisc_pkt_len(skb);\n-\t\tguard = ktime_add_ns(q->get_time(),\n+\t\tguard = ktime_add_ns(taprio_get_time(q),\n \t\t\t\t length_to_duration(q, len));\n \n \t\t/* In the case that there's no gate entry, there's no\n@@ -848,7 +862,7 @@ static int taprio_get_start_time(struct Qdisc *sch,\n \ts64 n;\n \n \tbase = sched_base_time(sched);\n-\tnow = q->get_time();\n+\tnow = taprio_get_time(q);\n \n \tif (ktime_after(base, now)) {\n \t\t*start = base;\n@@ -1094,16 +1108,16 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt,\n \n \tswitch (q->clockid) {\n \tcase CLOCK_REALTIME:\n-\t\tq->get_time = ktime_get_real;\n+\t\tq->tk_offset = TK_OFFS_REAL;\n \t\tbreak;\n \tcase CLOCK_MONOTONIC:\n-\t\tq->get_time = ktime_get;\n+\t\tq->tk_offset = TK_OFFS_MAX;\n \t\tbreak;\n \tcase CLOCK_BOOTTIME:\n-\t\tq->get_time = ktime_get_boottime;\n+\t\tq->tk_offset = TK_OFFS_BOOT;\n \t\tbreak;\n \tcase CLOCK_TAI:\n-\t\tq->get_time = ktime_get_clocktai;\n+\t\tq->tk_offset = TK_OFFS_TAI;\n \t\tbreak;\n \tdefault:\n \t\tNL_SET_ERR_MSG(extack, \"Invalid 'clockid'\");\n", "prefixes": [ "net-next", "v3", "5/6" ] }