Subject: Re: TSN - tc usage for a tbs setup

From: Vinicius Costa Gomes <[email-masked]>
Date: Thu, 25 Jul 2019 10:30:58 -0700

Hi,

Stéphane Ancelot <[email-masked]> writes:

> Hi,
>
> I am trying to setup my network queue for offline time based configuration.
>
> initial setup is :
>
> tc qdisc show dev eth1:
>
> qdisc mq 0: root
>
> qdisc pfifo_fast 0: parent :1 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 
> 1 1 1
>
>
> I won't need pfifo , I have to send one frame at a precise xmit time 
> (high prio), and then maybe some other frames (with low priority)
>
>
> I want to setup offload time based  xmit.
>
> /sbin/tc qdisc add dev eth1 root handle 100:1 etf delta 100000 clockid 
> CLOCK_REALTIME offload
>

Because the common (expected?) use case for ETF is using it on a system
that is running ptp4l (for example), and so, has the NIC PHC clock using
the TAI clock reference, we only accept the clockid to be CLOCK_TAI.
(Perhaps you are using an old version of iproute2, because a clearer
message should have been printed together with the error as well, anyway
there should be something in dmesg too)

That said, when I need to run some experiments with ETF, and do not care
about having the PHC clock is sync with anything else, I use phc2sys to
force the TAI offset to be zero. Something like this:

$ phc2sys -c $IFACE -s CLOCK_REALTIME -O 0 -m

And install ETF as "usual", something like this:

$ tc qdisc add dev $IFACE root handle 100:1 etf delta 100000 clockid CLOCK_TAI offload

Hope this helps.

Cheers,
--
Vinicius