Cover Letter Detail
Show a cover letter.
GET /api/covers/808504/?format=api
{ "id": 808504, "url": "http://patchwork.ozlabs.org/api/covers/808504/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/cover/20170901012625.14838-1-vinicius.gomes@intel.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": "<20170901012625.14838-1-vinicius.gomes@intel.com>", "list_archive_url": null, "date": "2017-09-01T01:26:20", "name": "[RFC,net-next,0/5] TSN: Add qdisc-based config interfaces for traffic shapers", "submitter": { "id": 72272, "url": "http://patchwork.ozlabs.org/api/people/72272/?format=api", "name": "Vinicius Costa Gomes", "email": "vinicius.gomes@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/cover/20170901012625.14838-1-vinicius.gomes@intel.com/mbox/", "series": [ { "id": 935, "url": "http://patchwork.ozlabs.org/api/series/935/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=935", "date": "2017-09-01T01:26:20", "name": "TSN: Add qdisc-based config interfaces for traffic shapers", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/935/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/covers/808504/comments/", "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>)", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xk1mT1zY6z9s7M\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 1 Sep 2017 11:26:33 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751258AbdIAB0a (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 31 Aug 2017 21:26:30 -0400", "from mga02.intel.com ([134.134.136.20]:20239 \"EHLO mga02.intel.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1750952AbdIAB03 (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tThu, 31 Aug 2017 21:26:29 -0400", "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t31 Aug 2017 18:26:28 -0700", "from ellie.jf.intel.com (HELO localhost.localdomain)\n\t([10.24.8.207])\n\tby fmsmga006.fm.intel.com with ESMTP; 31 Aug 2017 18:26:27 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.41,456,1498546800\"; d=\"scan'208\";a=\"146934268\"", "From": "Vinicius Costa Gomes <vinicius.gomes@intel.com>", "To": "netdev@vger.kernel.org", "Cc": "Vinicius Costa Gomes <vinicius.gomes@intel.com>, jhs@mojatatu.com,\n\txiyou.wangcong@gmail.com, jiri@resnulli.us,\n\tintel-wired-lan@lists.osuosl.org, andre.guedes@intel.com,\n\tivan.briano@intel.com, jesus.sanchez-palencia@intel.com,\n\tboon.leong.ong@intel.com, richardcochran@gmail.com", "Subject": "[RFC net-next 0/5] TSN: Add qdisc-based config interfaces for\n\ttraffic shapers", "Date": "Thu, 31 Aug 2017 18:26:20 -0700", "Message-Id": "<20170901012625.14838-1-vinicius.gomes@intel.com>", "X-Mailer": "git-send-email 2.14.1", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "Hi,\n\nThis patchset is an RFC on a proposal of how the Traffic Control subsystem can\nbe used to offload the configuration of traffic shapers into network devices\nthat provide support for them in HW. Our goal here is to start upstreaming\nsupport for features related to the Time-Sensitive Networking (TSN) set of\nstandards into the kernel.\n\nAs part of this work, we've assessed previous public discussions related to TSN\nenabling: patches from Henrik Austad (Cisco), the presentation from Eric Mann\nat Linux Plumbers 2012, patches from Gangfeng Huang (National Instruments) and\nthe current state of the OpenAVNU project (https://github.com/AVnu/OpenAvnu/).\n\nPlease note that the patches provided as part of this RFC are implementing what\nis needed only for 802.1Qav (FQTSS) only, but we'd like to take advantage of\nthis discussion and share our WIP ideas for the 802.1Qbv and 802.1Qbu interfaces\nas well. The current patches are only providing support for HW offload of the\nconfigs.\n\n\nOverview\n========\n\nTime-sensitive Networking (TSN) is a set of standards that aim to address\nresources availability for providing bandwidth reservation and bounded latency\non Ethernet based LANs. The proposal described here aims to cover mainly what is\nneeded to enable the following standards: 802.1Qat, 802.1Qav, 802.1Qbv and\n802.1Qbu.\n\nThe initial target of this work is the Intel i210 NIC, but other controllers'\ndatasheet were also taken into account, like the Renesas RZ/A1H RZ/A1M group and\nthe Synopsis DesignWare Ethernet QoS controller.\n\n\nProposal\n========\n\nFeature-wise, what is covered here are configuration interfaces for HW\nimplementations of the Credit-Based shaper (CBS, 802.1Qav), Time-Aware shaper\n(802.1Qbv) and Frame Preemption (802.1Qbu). CBS is a per-queue shaper, while\nQbv and Qbu must be configured per port, with the configuration covering all\nqueues. Given that these features are related to traffic shaping, and that the\ntraffic control subsystem already provides a queueing discipline that offloads\nconfig into the device driver (i.e. mqprio), designing new qdiscs for the\nspecific purpose of offloading the config for each shaper seemed like a good\nfit.\n\nFor steering traffic into the correct queues, we use the socket option\nSO_PRIORITY and then a mechanism to map priority to traffic classes / Tx queues.\nThe qdisc mqprio is currently used in our tests.\n\nAs for the shapers config interface:\n\n * CBS (802.1Qav)\n\n This patchset is proposing a new qdisc called 'cbs'. Its 'tc' cmd line is:\n $ tc qdisc add dev IFACE parent ID cbs locredit N hicredit M sendslope S \\\n idleslope I\n\n Note that the parameters for this qdisc are the ones defined by the\n 802.1Q-2014 spec, so no hardware specific functionality is exposed here.\n\n\n * Time-aware shaper (802.1Qbv):\n\n The idea we are currently exploring is to add a \"time-aware\", priority based\n qdisc, that also exposes the Tx queues available and provides a mechanism for\n mapping priority <-> traffic class <-> Tx queues in a similar fashion as\n mqprio. We are calling this qdisc 'taprio', and its 'tc' cmd line would be:\n\n $ $ tc qdisc add dev ens4 parent root handle 100 taprio num_tc 4 \\\n \t map 2 2 1 0 3 3 3 3 3 3 3 3 3 3 3 3 \\\n\t queues 0 1 2 3 \\\n \t sched-file gates.sched [base-time <interval>] \\\n [cycle-time <interval>] [extension-time <interval>]\n\n <file> is multi-line, with each line being of the following format:\n <cmd> <gate mask> <interval in nanoseconds>\n\n Qbv only defines one <cmd>: \"S\" for 'SetGates'\n\n For example:\n\n S 0x01 300\n S 0x03 500\n\n This means that there are two intervals, the first will have the gate\n for traffic class 0 open for 300 nanoseconds, the second will have\n both traffic classes open for 500 nanoseconds.\n\n Additionally, an option to set just one entry of the gate control list will\n also be provided by 'taprio':\n\n $ tc qdisc (...) \\\n sched-row <row number> <cmd> <gate mask> <interval> \\\n [base-time <interval>] [cycle-time <interval>] \\\n [extension-time <interval>]\n\n\n * Frame Preemption (802.1Qbu):\n\n To control even further the latency, it may prove useful to signal which\n traffic classes are marked as preemptable. For that, 'taprio' provides the\n preemption command so you set each traffic class as preemptable or not:\n\n $ tc qdisc (...) \\\n preemption 0 1 1 1\n\n\n * Time-aware shaper + Preemption:\n\n As an example of how Qbv and Qbu can be used together, we may specify\n both the schedule and the preempt-mask, and this way we may also\n specify the Set-Gates-and-Hold and Set-Gates-and-Release commands as\n specified in the Qbu spec:\n\n $ tc qdisc add dev ens4 parent root handle 100 taprio num_tc 4 \\\n \t map 2 2 1 0 3 3 3 3 3 3 3 3 3 3 3 3 \\\n\t queues 0 1 2 3 \\\n \t preemption 0 1 1 1 \\\n\t sched-file preempt_gates.sched\n\n <file> is multi-line, with each line being of the following format:\n <cmd> <gate mask> <interval in nanoseconds>\n\n For this case, two new commands are introduced:\n\n \"H\" for 'set gates and hold'\n \"R\" for 'set gates and release'\n\n H 0x01 300\n R 0x03 500\n\n\n\nTesting this RFC\n================\n\nFor testing the patches of this RFC only, you can refer to the samples and\nhelper script being added to samples/tsn/ and the use the 'mqprio' qdisc to\nsetup the priorities to Tx queues mapping, together with the 'cbs' qdisc to\nconfigure the HW shaper of the i210 controller:\n\n1) Setup priorities to traffic classes to hardware queues mapping\n$ tc qdisc replace dev enp3s0 parent root mqprio num_tc 3 \\\n map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@1 2@2 hw 0\n\n2) Check scheme. You want to get the inner qdiscs ID from the bottom up\n$ tc -g class show dev enp3s0\n\nEx.:\n+---(802a:3) mqprio\n| +---(802a:6) mqprio\n| +---(802a:7) mqprio\n|\n+---(802a:2) mqprio\n| +---(802a:5) mqprio\n|\n+---(802a:1) mqprio\n +---(802a:4) mqprio\n\n * Here '802a:4' is Tx Queue #0 and '802a:5' is Tx Queue #1.\n\n3) Calculate CBS parameters for classes A and B. i.e. BW for A is 20Mbps and\n for B is 10Mbps:\n$ ./samples/tsn/calculate_cbs_params.py -A 20000 -a 1500 -B 10000 -b 1500\n\n4) Configure CBS for traffic class A (priority 3) as provided by the script:\n$ tc qdisc replace dev enp3s0 parent 802a:4 cbs locredit -1470 \\\n hicredit 30 sendslope -980000 idleslope 20000\n\n5) Configure CBS for traffic class B (priority 2):\n$ tc qdisc replace dev enp3s0 parent 802a:5 cbs \\\n locredit -1485 hicredit 31 sendslope -990000 idleslope 10000\n\n6) Run Listener, compiled from samples/tsn/listener.c\n$ ./listener -i enp3s0\n\n7) Run Talker for class A (prio 3 here), compiled from samples/tsn/talker.c\n$ ./talker -i enp3s0 -p 3\n\n * The bandwidth displayed on the listener output at this stage should be very\n close to the one configured for class A.\n\n8) You can also run a Talker for class B (prio 2 here)\n$ ./talker -i enp3s0 -p 2\n\n * The bandwidth displayed on the listener output now should increase to very\n close to the one configured for class A + class B.\n\nAuthors\n=======\n - Andre Guedes <andre.guedes@intel.com>\n - Ivan Briano <ivan.briano@intel.com>\n - Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>\n - Vinicius Gomes <vinicius.gomes@intel.com>\n\n\nAndre Guedes (2):\n igb: Add support for CBS offload\n samples/tsn: Add script for calculating CBS config\n\nJesus Sanchez-Palencia (1):\n sample: Add TSN Talker and Listener examples\n\nVinicius Costa Gomes (2):\n net/sched: Introduce the user API for the CBS shaper\n net/sched: Introduce Credit Based Shaper (CBS) qdisc\n\n drivers/net/ethernet/intel/igb/e1000_defines.h | 23 ++\n drivers/net/ethernet/intel/igb/e1000_regs.h | 8 +\n drivers/net/ethernet/intel/igb/igb.h | 6 +\n drivers/net/ethernet/intel/igb/igb_main.c | 349 +++++++++++++++++++++++++\n include/linux/netdevice.h | 1 +\n include/uapi/linux/pkt_sched.h | 29 ++\n net/sched/Kconfig | 11 +\n net/sched/Makefile | 1 +\n net/sched/sch_cbs.c | 286 ++++++++++++++++++++\n samples/tsn/calculate_cbs_params.py | 112 ++++++++\n samples/tsn/listener.c | 254 ++++++++++++++++++\n samples/tsn/talker.c | 136 ++++++++++\n 12 files changed, 1216 insertions(+)\n create mode 100644 net/sched/sch_cbs.c\n create mode 100755 samples/tsn/calculate_cbs_params.py\n create mode 100644 samples/tsn/listener.c\n create mode 100644 samples/tsn/talker.c\n\n--\n2.14.1" }