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