man-pages/man8/tc-etf.8.html
2021-03-31 01:06:50 +01:00

216 lines
6.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of ETF</TITLE>
</HEAD><BODY>
<H1>ETF</H1>
Section: Linux (8)<BR>Updated: 05 Jul 2018<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
ETF - Earliest TxTime First (ETF) Qdisc
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>tc qdisc ... dev</B>
dev
<B>parent</B>
classid
<B>[ handle</B>
major:
<B>] etf clockid</B>
clockid
<B>[ delta</B>
delta_nsecs
<B>] [ deadline_mode ]</B>
<B>[ offload ]</B>
<P>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
The ETF (Earliest TxTime First) qdisc allows applications to control
the instant when a packet should be dequeued from the traffic control
layer into the netdevice. If
<B>offload</B>
is configured and supported by the network interface card, the it will
also control when packets leave the network controller.
<P>
ETF achieves that by buffering packets until a configurable time
before their transmission time (i.e. txtime, or deadline), which can
be configured through the
<B>delta</B>
option.
<P>
The qdisc uses a rb-tree internally so packets are always 'ordered' by
their txtime and will be dequeued following the (next) earliest txtime
first.
<P>
It relies on the SO_TXTIME socket option and the SCM_TXTIME CMSG in
each packet field to configure the behavior of time dependent sockets:
the clockid to be used as a reference, if the expected mode of txtime
for that socket is deadline or strict mode, and if packet drops should
be reported on the socket's error queue. See
<B><A HREF="/cgi-bin/man/man2html?7+socket">socket</A>(7)</B>
for more information.
<P>
The etf qdisc will drop any packets with a txtime in the past, or if a
packet expires while waiting for being dequeued.
<P>
This queueing discipline is intended to be used by TSN (Time Sensitive
Networking) applications, and it exposes a traffic shaping functionality
that is commonly documented as &quot;Launch Time&quot; or &quot;Time-Based Scheduling&quot;
by vendors and the documentation of network interface controllers.
<P>
ETF is meant to be installed under another qdisc that maps packet flows
to traffic classes, one example is
<B><A HREF="/cgi-bin/man/man2html?8+mqprio">mqprio</A>(8).</B>
<P>
<A NAME="lbAE">&nbsp;</A>
<H2>PARAMETERS</H2>
<DL COMPACT>
<DT id="1">clockid<DD>
<BR>
Specifies the clock to be used by qdisc's internal timer for measuring
time and scheduling events. The qdisc expects that packets passing
through it to be using this same
<B>clockid</B>
as the reference of their txtime timestamps. It will drop packets
coming from sockets that do not comply with that.
<P>
For more information about time and clocks on Linux, please refer
to
<B><A HREF="/cgi-bin/man/man2html?7+time">time</A>(7)</B>
and
<B><A HREF="/cgi-bin/man/man2html?3+clock_gettime">clock_gettime</A>(3).</B>
<P>
<DT id="2">delta<DD>
<BR>
After enqueueing or dequeueing a packet, the qdisc will schedule its
next wake-up time for the next txtime minus this delta value.
This means
<B>delta</B>
can be used as a fudge factor for the scheduler latency of a system.
This value must be specified in nanoseconds.
The default value is 0 nanoseconds.
<P>
<DT id="3">deadline_mode<DD>
<BR>
When
<B>deadline_mode</B>
is set, the qdisc will handle txtime with a different semantics,
changed from a 'strict' transmission time to a deadline.
In practice, this means during the dequeue flow
<B><A HREF="/cgi-bin/man/man2html?8+etf">etf</A>(8)</B>
will set the txtime of the packet being dequeued to 'now'.
The default is for this option to be disabled.
<P>
<DT id="4">offload<DD>
<BR>
When
<B>offload</B>
is set,
<B><A HREF="/cgi-bin/man/man2html?8+etf">etf</A>(8)</B>
will try to configure the network interface so time-based transmission
arbitration is enabled in the controller. This feature is commonly
referred to as &quot;Launch Time&quot; or &quot;Time-Based Scheduling&quot; by the
documentation of network interface controllers.
The default is for this option to be disabled.
<P>
<DT id="5">skip_sock_check<DD>
<BR>
<B><A HREF="/cgi-bin/man/man2html?8+etf">etf</A>(8)</B>
currently drops any packet which does not have a socket associated with it or
if the socket does not have SO_TXTIME socket option set. But, this will not
work if the launchtime is set by another entity inside the kernel (e.g. some
other Qdisc). Setting the skip_sock_check will skip checking for a socket
associated with the packet.
<P>
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>EXAMPLES</H2>
<P>
ETF is used to enforce a Quality of Service. It controls when each
packets should be dequeued and transmitted, and can be used for
limiting the data rate of a traffic class. To separate packets into
traffic classes the user may choose
<B><A HREF="/cgi-bin/man/man2html?8+mqprio">mqprio</A>(8),</B>
and configure it like this:
<P>
# tc qdisc add dev eth0 handle 100: parent root mqprio num_tc 3 \
<TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TT>map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \<BR>
<TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TT>queues 1@0 1@1 2@2 \<BR>
<TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TT>hw 0<BR>
<P>
To replace the current queueing discipline by ETF in traffic class
number 0, issue:
<P>
# tc qdisc replace dev eth0 parent 100:1 etf \
<TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TT>clockid CLOCK_TAI delta 300000 offload<BR>
<P>
With the options above, etf will be configured to use CLOCK_TAI as
its clockid_t, will schedule packets for 300 us before their txtime,
and will enable the functionality on that in the network interface
card. Deadline mode will not be configured for this mode.
<P>
<A NAME="lbAG">&nbsp;</A>
<H2>AUTHORS</H2>
Jesus Sanchez-Palencia &lt;<A HREF="mailto:jesus.sanchez-palencia@intel.com">jesus.sanchez-palencia@intel.com</A>&gt;
<BR>
Vinicius Costa Gomes &lt;<A HREF="mailto:vinicius.gomes@intel.com">vinicius.gomes@intel.com</A>&gt;
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="6"><A HREF="#lbAB">NAME</A><DD>
<DT id="7"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="8"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="9"><A HREF="#lbAE">PARAMETERS</A><DD>
<DT id="10"><A HREF="#lbAF">EXAMPLES</A><DD>
<DT id="11"><A HREF="#lbAG">AUTHORS</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:06:17 GMT, March 31, 2021
</BODY>
</HTML>