Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tc qdisc taprio configuration problem. #34

Open
p4pe opened this issue Jan 10, 2023 · 1 comment
Open

tc qdisc taprio configuration problem. #34

p4pe opened this issue Jan 10, 2023 · 1 comment

Comments

@p4pe
Copy link

p4pe commented Jan 10, 2023

Currently, I am working on a TSN project and I am trying to implement a TSN scenario in a Ubuntu 20.04 VM.

I leverage on tc qdisc command:

tc qdisc replace dev gateway-eth0 parent root handle 100 taprio \ 
num_tc 8 \
map 0 1 2 3 4 5 6 7 1 1 1 1 1 1 1 1 \ 
queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \ 
base-time 1000 \

clockid CLOCK_TAI \ 

sched-entry S 10 300000 \ 
sched-entry S 32 500000 \
sched-entry S 128 200000 \

Στιγμιότυπο οθόνης_20230110_074459

And also mangle the iptables to classify the packets based on the dscp field.
Στιγμιότυπο οθόνης_20230110_020819
From what I have read, with this qdisc command I define:

i) 8 traffic classes
ii) map priority 0 to TC0, 1 to TC1 2 to TC2 etc.
iii) TC0 is mapped to one TX queue TX-0, TC1 to TX-1, TC2 to TX2 etc.

In the sched-entry part of the command, my goal is to open TC2 and TC5, and TC7 queues for different periods.

To test this I sent ping packets using ping -Q 0x40 <IP> (priority 5) in order to send packets to traffic class 5.
Στιγμιότυπο οθόνης_20230110_074819

It seems that the traffic went to the correct queue.

But when I use ping -Q 0x16 <IP> (priority 2) the traffic went through the last queue
Στιγμιότυπο οθόνης_20230110_075106

Are the sched-entries right?

Thank you.

@vcgomes
Copy link
Collaborator

vcgomes commented Jan 14, 2023

The issue is not the sched-entries, they only control if/when each traffic class is allowed to transmit.

The place to look is how each traffic class is assigned. One idea that might make it easier to test is to use mqprio instead of taprio, as mqprio has similar concepts of mapping traffic types to traffic classes and then to queues, but less moving parts.

Something like this might just work (not tested):

tc qdisc replace dev gateway-eth0 parent root handle 100 mqprio \ 
num_tc 8 \
map 0 1 2 3 4 5 6 7 1 1 1 1 1 1 1 1 \ 
queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \
hw 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants