Blame man/man8/tc-etf.8

Packit d3f73b
.TH ETF 8 "05 Jul 2018" "iproute2" "Linux"
Packit d3f73b
.SH NAME
Packit d3f73b
ETF \- Earliest TxTime First (ETF) Qdisc
Packit d3f73b
.SH SYNOPSIS
Packit d3f73b
.B tc qdisc ... dev
Packit d3f73b
dev
Packit d3f73b
.B parent
Packit d3f73b
classid
Packit d3f73b
.B [ handle
Packit d3f73b
major:
Packit d3f73b
.B ] etf clockid
Packit d3f73b
clockid
Packit d3f73b
.B [ delta
Packit d3f73b
delta_nsecs
Packit d3f73b
.B ] [ deadline_mode ]
Packit d3f73b
.B [ offload ]
Packit d3f73b
Packit d3f73b
.SH DESCRIPTION
Packit d3f73b
The ETF (Earliest TxTime First) qdisc allows applications to control
Packit d3f73b
the instant when a packet should be dequeued from the traffic control
Packit d3f73b
layer into the netdevice. If
Packit d3f73b
.B offload
Packit d3f73b
is configured and supported by the network interface card, the it will
Packit d3f73b
also control when packets leave the network controller.
Packit d3f73b
Packit d3f73b
ETF achieves that by buffering packets until a configurable time
Packit d3f73b
before their transmission time (i.e. txtime, or deadline), which can
Packit d3f73b
be configured through the
Packit d3f73b
.B delta
Packit d3f73b
option.
Packit d3f73b
Packit d3f73b
The qdisc uses a rb-tree internally so packets are always 'ordered' by
Packit d3f73b
their txtime and will be dequeued following the (next) earliest txtime
Packit d3f73b
first.
Packit d3f73b
Packit d3f73b
It relies on the SO_TXTIME socket option and the SCM_TXTIME CMSG in
Packit d3f73b
each packet field to configure the behavior of time dependent sockets:
Packit d3f73b
the clockid to be used as a reference, if the expected mode of txtime
Packit d3f73b
for that socket is deadline or strict mode, and if packet drops should
Packit d3f73b
be reported on the socket's error queue. See
Packit d3f73b
.BR socket(7)
Packit d3f73b
for more information.
Packit d3f73b
Packit d3f73b
The etf qdisc will drop any packets with a txtime in the past, or if a
Packit d3f73b
packet expires while waiting for being dequeued.
Packit d3f73b
Packit d3f73b
This queueing discipline is intended to be used by TSN (Time Sensitive
Packit d3f73b
Networking) applications, and it exposes a traffic shaping functionality
Packit d3f73b
that is commonly documented as "Launch Time" or "Time-Based Scheduling"
Packit d3f73b
by vendors and the documentation of network interface controllers.
Packit d3f73b
Packit d3f73b
ETF is meant to be installed under another qdisc that maps packet flows
Packit d3f73b
to traffic classes, one example is
Packit d3f73b
.BR mqprio(8).
Packit d3f73b
Packit d3f73b
.SH PARAMETERS
Packit d3f73b
.TP
Packit d3f73b
clockid
Packit d3f73b
.br
Packit d3f73b
Specifies the clock to be used by qdisc's internal timer for measuring
Packit d3f73b
time and scheduling events. The qdisc expects that packets passing
Packit d3f73b
through it to be using this same
Packit d3f73b
.B clockid
Packit d3f73b
as the reference of their txtime timestamps. It will drop packets
Packit d3f73b
coming from sockets that do not comply with that.
Packit d3f73b
Packit d3f73b
For more information about time and clocks on Linux, please refer
Packit d3f73b
to
Packit d3f73b
.BR time(7)
Packit d3f73b
and
Packit d3f73b
.BR clock_gettime(3).
Packit d3f73b
Packit d3f73b
.TP
Packit d3f73b
delta
Packit d3f73b
.br
Packit d3f73b
After enqueueing or dequeueing a packet, the qdisc will schedule its
Packit d3f73b
next wake-up time for the next txtime minus this delta value.
Packit d3f73b
This means
Packit d3f73b
.B delta
Packit d3f73b
can be used as a fudge factor for the scheduler latency of a system.
Packit d3f73b
This value must be specified in nanoseconds.
Packit d3f73b
The default value is 0 nanoseconds.
Packit d3f73b
Packit d3f73b
.TP
Packit d3f73b
deadline_mode
Packit d3f73b
.br
Packit d3f73b
When
Packit d3f73b
.B deadline_mode
Packit d3f73b
is set, the qdisc will handle txtime with a different semantics,
Packit d3f73b
changed from a 'strict' transmission time to a deadline.
Packit d3f73b
In practice, this means during the dequeue flow
Packit d3f73b
.BR etf(8)
Packit d3f73b
will set the txtime of the packet being dequeued to 'now'.
Packit d3f73b
The default is for this option to be disabled.
Packit d3f73b
Packit d3f73b
.TP
Packit d3f73b
offload
Packit d3f73b
.br
Packit d3f73b
When
Packit d3f73b
.B offload
Packit d3f73b
is set,
Packit d3f73b
.BR etf(8)
Packit d3f73b
will try to configure the network interface so time-based transmission
Packit d3f73b
arbitration is enabled in the controller. This feature is commonly
Packit d3f73b
referred to as "Launch Time" or "Time-Based Scheduling" by the
Packit d3f73b
documentation of network interface controllers.
Packit d3f73b
The default is for this option to be disabled.
Packit d3f73b
Packit d3f73b
.SH EXAMPLES
Packit d3f73b
Packit d3f73b
ETF is used to enforce a Quality of Service. It controls when each
Packit d3f73b
packets should be dequeued and transmitted, and can be used for
Packit d3f73b
limiting the data rate of a traffic class. To separate packets into
Packit d3f73b
traffic classes the user may choose
Packit d3f73b
.BR mqprio(8),
Packit d3f73b
and configure it like this:
Packit d3f73b
Packit d3f73b
.EX
Packit d3f73b
# tc qdisc add dev eth0 handle 100: parent root mqprio num_tc 3 \\
Packit d3f73b
	map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \\
Packit d3f73b
	queues 1@0 1@1 2@2 \\
Packit d3f73b
	hw 0
Packit d3f73b
.EE
Packit d3f73b
.P
Packit d3f73b
To replace the current queueing discipline by ETF in traffic class
Packit d3f73b
number 0, issue:
Packit d3f73b
.P
Packit d3f73b
.EX
Packit d3f73b
# tc qdisc replace dev eth0 parent 100:1 etf \\
Packit d3f73b
	clockid CLOCK_TAI delta 300000 offload
Packit d3f73b
.EE
Packit d3f73b
Packit d3f73b
With the options above, etf will be configured to use CLOCK_TAI as
Packit d3f73b
its clockid_t, will schedule packets for 300 us before their txtime,
Packit d3f73b
and will enable the functionality on that in the network interface
Packit d3f73b
card. Deadline mode will not be configured for this mode.
Packit d3f73b
Packit d3f73b
.SH AUTHORS
Packit d3f73b
Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Packit d3f73b
.br
Packit d3f73b
Vinicius Costa Gomes <vinicius.gomes@intel.com>