Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1120491/?format=api
{ "id": 1120491, "url": "http://patchwork.ozlabs.org/api/patches/1120491/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1561138108-12943-4-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": "<1561138108-12943-4-git-send-email-vedang.patel@intel.com>", "list_archive_url": null, "date": "2019-06-21T17:28:24", "name": "[net-next,v5,3/7] taprio: calculate cycle_time when schedule is installed", "commit_ref": null, "pull_url": null, "state": "awaiting-upstream", "archived": false, "hash": "db5e27dc124e49359092a9c4f10931f8213a36ac", "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/1561138108-12943-4-git-send-email-vedang.patel@intel.com/mbox/", "series": [ { "id": 115440, "url": "http://patchwork.ozlabs.org/api/series/115440/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=115440", "date": "2019-06-21T17:28:21", "name": "net/sched: Add txtime-assist support for taprio.", "version": 5, "mbox": "http://patchwork.ozlabs.org/series/115440/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1120491/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1120491/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.138; helo=whitealder.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 whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\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 45VrVd49dkz9s7h\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 22 Jun 2019 06:52:57 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id AFCB98758D;\n\tFri, 21 Jun 2019 20:52:55 +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 M6zGEozDyH7X; Fri, 21 Jun 2019 20:52:53 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 19D238650D;\n\tFri, 21 Jun 2019 20:52:53 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 74C631BF473\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 21 Jun 2019 17:28:50 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 65E15203C9\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 21 Jun 2019 17:28:50 +0000 (UTC)", "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id YcWMSW+QR2sZ for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 21 Jun 2019 17:28:49 +0000 (UTC)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby silver.osuosl.org (Postfix) with ESMTPS id C189F203F9\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 21 Jun 2019 17:28:49 +0000 (UTC)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t21 Jun 2019 10:28:49 -0700", "from vpatel-desk.jf.intel.com (HELO localhost.localdomain)\n\t([10.7.159.52])\n\tby orsmga002.jf.intel.com with ESMTP; 21 Jun 2019 10:28:49 -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", "X-IronPort-AV": "E=Sophos;i=\"5.63,401,1557212400\"; d=\"scan'208\";a=\"171282973\"", "From": "Vedang Patel <vedang.patel@intel.com>", "To": "netdev@vger.kernel.org", "Date": "Fri, 21 Jun 2019 10:28:24 -0700", "Message-Id": "<1561138108-12943-4-git-send-email-vedang.patel@intel.com>", "X-Mailer": "git-send-email 2.7.3", "In-Reply-To": "<1561138108-12943-1-git-send-email-vedang.patel@intel.com>", "References": "<1561138108-12943-1-git-send-email-vedang.patel@intel.com>", "X-Mailman-Approved-At": "Fri, 21 Jun 2019 20:52:49 +0000", "Subject": "[Intel-wired-lan] [PATCH net-next v5 3/7] taprio: calculate\n\tcycle_time when schedule is installed", "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, sergei.shtylyov@cogentembedded.com,\n\tjakub.kicinski@netronome.com, jhs@mojatatu.com, m-karicheri2@ti.com, \n\tintel-wired-lan@lists.osuosl.org, xiyou.wangcong@gmail.com,\n\teric.dumazet@gmail.com, davem@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": "cycle time for a particular schedule is calculated only when it is first\ninstalled. So, it makes sense to just calculate it once right after the\n'cycle_time' parameter has been parsed and store it in cycle_time.\n\nSigned-off-by: Vedang Patel <vedang.patel@intel.com>\n---\n net/sched/sch_taprio.c | 29 +++++++++++------------------\n 1 file changed, 11 insertions(+), 18 deletions(-)", "diff": "diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c\nindex 9ecfb8f5902a..a41d7d4434ee 100644\n--- a/net/sched/sch_taprio.c\n+++ b/net/sched/sch_taprio.c\n@@ -108,22 +108,6 @@ static void switch_schedules(struct taprio_sched *q,\n \t*admin = NULL;\n }\n \n-static ktime_t get_cycle_time(struct sched_gate_list *sched)\n-{\n-\tstruct sched_entry *entry;\n-\tktime_t cycle = 0;\n-\n-\tif (sched->cycle_time != 0)\n-\t\treturn sched->cycle_time;\n-\n-\tlist_for_each_entry(entry, &sched->entries, list)\n-\t\tcycle = ktime_add_ns(cycle, entry->interval);\n-\n-\tsched->cycle_time = cycle;\n-\n-\treturn cycle;\n-}\n-\n static int taprio_enqueue(struct sk_buff *skb, struct Qdisc *sch,\n \t\t\t struct sk_buff **to_free)\n {\n@@ -524,6 +508,15 @@ static int parse_taprio_schedule(struct nlattr **tb,\n \tif (err < 0)\n \t\treturn err;\n \n+\tif (!new->cycle_time) {\n+\t\tstruct sched_entry *entry;\n+\t\tktime_t cycle = 0;\n+\n+\t\tlist_for_each_entry(entry, &new->entries, list)\n+\t\t\tcycle = ktime_add_ns(cycle, entry->interval);\n+\t\tnew->cycle_time = cycle;\n+\t}\n+\n \treturn 0;\n }\n \n@@ -605,7 +598,7 @@ static int taprio_get_start_time(struct Qdisc *sch,\n \t\treturn 0;\n \t}\n \n-\tcycle = get_cycle_time(sched);\n+\tcycle = sched->cycle_time;\n \n \t/* The qdisc is expected to have at least one sched_entry. Moreover,\n \t * any entry must have 'interval' > 0. Thus if the cycle time is zero,\n@@ -632,7 +625,7 @@ static void setup_first_close_time(struct taprio_sched *q,\n \tfirst = list_first_entry(&sched->entries,\n \t\t\t\t struct sched_entry, list);\n \n-\tcycle = get_cycle_time(sched);\n+\tcycle = sched->cycle_time;\n \n \t/* FIXME: find a better place to do this */\n \tsched->cycle_close_time = ktime_add_ns(base, cycle);\n", "prefixes": [ "net-next", "v5", "3/7" ] }