{
    "content": [
        {
            "type": "text",
            "text": "# TAPRIO (man)\n\n## NAME\n\nTAPRIO - Time Aware Priority Shaper\n\n## SYNOPSIS\n\ntc qdisc ... dev dev parent classid [ handle major: ] taprio numtc tcs\nmap P0 P1 P2 ...  queues count1@offset1 count2@offset2 ...\nbase-time base-time clockid clockid\nsched-entry <command 1> <gate mask 1> <interval 1>\nsched-entry <command 2> <gate mask 2> <interval 2>\nsched-entry <command 3> <gate mask 3> <interval 3>\nsched-entry <command N> <gate mask N> <interval N>\n\n## DESCRIPTION\n\nThe  TAPRIO  qdisc implements a simplified version of the scheduling state machine defined by\nIEEE 802.1Q-2018 Section 8.6.9, which allows configuration of  a  sequence  of  gate  states,\nwhere  each  gate  state  allows outgoing traffic for a subset (potentially empty) of traffic\nclasses.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **PARAMETERS**\n- **EXAMPLES**\n- **AUTHORS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "TAPRIO",
        "section": "",
        "mode": "man",
        "summary": "TAPRIO - Time Aware Priority Shaper",
        "synopsis": "tc qdisc ... dev dev parent classid [ handle major: ] taprio numtc tcs\nmap P0 P1 P2 ...  queues count1@offset1 count2@offset2 ...\nbase-time base-time clockid clockid\nsched-entry <command 1> <gate mask 1> <interval 1>\nsched-entry <command 2> <gate mask 2> <interval 2>\nsched-entry <command 3> <gate mask 3> <interval 3>\nsched-entry <command N> <gate mask N> <interval N>",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [
            "The following example shows how an traffic schedule with three traffic classes (\"numtc  3\"),",
            "which  are  separated different traffic classes, we are going to call these TC 0, TC 1 and TC",
            "2. We could read the \"map\" parameter below as: traffic with priority 3 is classified as TC 0,",
            "priority 2 is classified as TC 1 and the rest is classified as TC 2.",
            "The  schedule  will  start  at instant 1528743495910289987 using the reference CLOCKTAI. The",
            "schedule is composed of three entries each of 300us duration.",
            "# tc qdisc replace dev eth0 parent root handle 100 taprio \\",
            "numtc 3 \\",
            "map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \\",
            "queues 1@0 1@1 2@2 \\",
            "base-time 1528743495910289987 \\",
            "sched-entry S 01 300000 \\",
            "sched-entry S 02 300000 \\",
            "sched-entry S 04 300000 \\",
            "clockid CLOCKTAI",
            "Following is an example to enable the txtime offload mode in taprio. See etf(8) for more  in‐",
            "formation about configuring the ETF qdisc.",
            "# tc qdisc replace dev eth0 parent root handle 100 taprio \\",
            "numtc 3 \\",
            "map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \\",
            "queues 1@0 1@0 1@0 \\",
            "base-time 1528743495910289987 \\",
            "sched-entry S 01 300000 \\",
            "sched-entry S 02 300000 \\",
            "sched-entry S 04 400000 \\",
            "flags 0x1 \\",
            "txtime-delay 200000 \\",
            "clockid CLOCKTAI",
            "# tc qdisc replace dev $IFACE parent 100:1 etf skipskbcheck \\",
            "offload delta 200000 clockid CLOCKTAI",
            "The  following is a schedule in full offload mode. The base-time is 200 ns and the cycle-time",
            "is implicitly calculated as the sum of all sched-entry durations (i.e. 20 us + 20 us + 60  us",
            "=  100  us).  Although  the  base-time  is in the past, the hardware will start executing the",
            "schedule at a PTP time equal to the smallest integer multiple of 100 us, plus 200 ns, that is",
            "larger than the NIC's current PTP time.",
            "# tc qdisc add dev eth0 parent root taprio \\",
            "numtc 8 \\",
            "map 0 1 2 3 4 5 6 7 \\",
            "queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \\",
            "base-time 200 \\",
            "sched-entry S 80 20000 \\",
            "sched-entry S a0 20000 \\",
            "sched-entry S df 60000 \\",
            "flags 0x2"
        ],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "PARAMETERS",
                "lines": 69,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 53,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "TAPRIO - Time Aware Priority Shaper\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "tc qdisc ... dev dev parent classid [ handle major: ] taprio numtc tcs\nmap P0 P1 P2 ...  queues count1@offset1 count2@offset2 ...\nbase-time base-time clockid clockid\nsched-entry <command 1> <gate mask 1> <interval 1>\nsched-entry <command 2> <gate mask 2> <interval 2>\nsched-entry <command 3> <gate mask 3> <interval 3>\nsched-entry <command N> <gate mask N> <interval N>\n\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The  TAPRIO  qdisc implements a simplified version of the scheduling state machine defined by\nIEEE 802.1Q-2018 Section 8.6.9, which allows configuration of  a  sequence  of  gate  states,\nwhere  each  gate  state  allows outgoing traffic for a subset (potentially empty) of traffic\nclasses.\n\nHow traffic is mapped to different hardware queues is similar to mqprio(8) and so the map and\nqueues parameters have the same meaning.\n\nThe  other parameters specify the schedule, and at what point in time it should start (it can\nbehave as the schedule started in the past).\n\n",
                "subsections": []
            },
            "PARAMETERS": {
                "content": "numtc  Number of traffic classes to use. Up to 16 classes supported.\n\n\nmap\nThe priority to traffic class map. Maps priorities 0..15 to a specified traffic class.\nSee mqprio(8) for more details.\n\n\nqueues\nProvide  count  and  offset  of  queue  range  for  each traffic class. In the format,\ncount@offset.  Queue ranges for each traffic classes cannot overlap and must be a con‐\ntiguous range of queues.\n\n\nbase-time\nSpecifies  the  instant  in  nanoseconds, using the reference of clockid, defining the\ntime when the schedule starts. If 'base-time' is a time in the past, the schedule will\nstart at\n\nbase-time + (N * cycle-time)\n\nwhere  N is the smallest integer so the resulting time is greater than \"now\", and \"cy‐\ncle-time\" is the sum of all the intervals of the entries in the schedule;\n\n\nclockid\nSpecifies the clock to be used by qdisc's internal timer for measuring time and sched‐\nuling events. This argument must be omitted when using the full-offload feature (flags\n0x2), since in that case, the clockid is implicitly /dev/ptpN (where  N  is  given  by\nethtool  -T eth0 | grep 'PTP Hardware Clock' ), and therefore not necessarily synchro‐\nnized with the system's CLOCKTAI.\n\n\nsched-entry\nThere may multiple sched-entry parameters in a single schedule. Each one has the\n\nsched-entry <command> <gatemask> <interval>\n\nformat. The only supported <command> is \"S\", which  means  \"SetGateStates\",  following\nthe  IEEE  802.1Q-2018 definition (Table 8-7). <gate mask> is a bitmask where each bit\nis a associated with a traffic class, so bit 0 (the least significant bit) being  \"on\"\nmeans  that traffic class 0 is \"active\" for that schedule entry.  <interval> is a time\nduration, in nanoseconds, that specifies for how long that state defined by  <command>\nand <gate mask> should be held before moving to the next entry.\n\n\nflags\nThis is a bit mask which specifies different modes for taprio.\n\n0x1    Enables  the  txtime-assist feature. In this mode, taprio will set the transmit\ntimestamp depending on the interval in which the packet needs to  be  transmit‐\nted.  It  will then utililize the etf(8) qdisc to sort and transmit the packets\nat the right time. The second example can be used as a reference  to  configure\nthis mode.\n\n0x2    Enables  the full-offload feature. In this mode, taprio will pass the gate con‐\ntrol list to the NIC which will execute it cyclically in hardware.  When  using\nfull-offload, there is no need to specify the clockid argument.\n\nThe  txtime-assist and full-offload features are mutually exclusive, i.e.  set‐\nting flags to 0x3 is invalid.\n\n\ntxtime-delay\nThis parameter is specific to the txtime offload mode. It specifies the maximum time a\npacket  might  take  to reach the network card from the taprio qdisc. The value should\nalways be greater than the delta specified in the etf(8) qdisc.\n\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "The following example shows how an traffic schedule with three traffic classes (\"numtc  3\"),\nwhich  are  separated different traffic classes, we are going to call these TC 0, TC 1 and TC\n2. We could read the \"map\" parameter below as: traffic with priority 3 is classified as TC 0,\npriority 2 is classified as TC 1 and the rest is classified as TC 2.\n\nThe  schedule  will  start  at instant 1528743495910289987 using the reference CLOCKTAI. The\nschedule is composed of three entries each of 300us duration.\n\n# tc qdisc replace dev eth0 parent root handle 100 taprio \\\nnumtc 3 \\\nmap 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \\\nqueues 1@0 1@1 2@2 \\\nbase-time 1528743495910289987 \\\nsched-entry S 01 300000 \\\nsched-entry S 02 300000 \\\nsched-entry S 04 300000 \\\nclockid CLOCKTAI\n\nFollowing is an example to enable the txtime offload mode in taprio. See etf(8) for more  in‐\nformation about configuring the ETF qdisc.\n\n# tc qdisc replace dev eth0 parent root handle 100 taprio \\\nnumtc 3 \\\nmap 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \\\nqueues 1@0 1@0 1@0 \\\nbase-time 1528743495910289987 \\\nsched-entry S 01 300000 \\\nsched-entry S 02 300000 \\\nsched-entry S 04 400000 \\\nflags 0x1 \\\ntxtime-delay 200000 \\\nclockid CLOCKTAI\n\n# tc qdisc replace dev $IFACE parent 100:1 etf skipskbcheck \\\noffload delta 200000 clockid CLOCKTAI\n\nThe  following is a schedule in full offload mode. The base-time is 200 ns and the cycle-time\nis implicitly calculated as the sum of all sched-entry durations (i.e. 20 us + 20 us + 60  us\n=  100  us).  Although  the  base-time  is in the past, the hardware will start executing the\nschedule at a PTP time equal to the smallest integer multiple of 100 us, plus 200 ns, that is\nlarger than the NIC's current PTP time.\n\n# tc qdisc add dev eth0 parent root taprio \\\nnumtc 8 \\\nmap 0 1 2 3 4 5 6 7 \\\nqueues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \\\nbase-time 200 \\\nsched-entry S 80 20000 \\\nsched-entry S a0 20000 \\\nsched-entry S df 60000 \\\nflags 0x2\n\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "Vinicius Costa Gomes <vinicius.gomes@intel.com>\n\n\n\niproute2                                    25 Sept 2018                                   TAPRIO(8)",
                "subsections": []
            }
        }
    }
}