Hi Vinicius,

On 10/11/2019 04:12 PM, Vinicius Costa Gomes wrote:
Hi Murali,

Murali Karicheri <m-kariche...@ti.com> writes:

Hi,

I am testing the taprio (802.1Q Time Aware Shaper) as part of my
pre-work to implement taprio hw offload and test.

I was able to configure tap prio on my board and looking to do
some traffic test and wondering how to play with the tc command
to direct traffic to a specfic queue. For example I have setup
taprio to create 5 traffic classes as shows below;-

Now I plan to create iperf streams to pass through different
gates. Now how do I use tc filters to mark the packets to
go through these gates/queues? I heard about skbedit action
in tc filter to change the priority field of SKB to allow
the above mapping to happen. Any example that some one can
point me to?

What I have been using for testing these kinds of use cases (like iperf)
is to use an iptables rule to set the priority for some kinds of traffic.

Something like this:

sudo iptables -t mangle -A POSTROUTING -p udp --dport 7788 -j CLASSIFY 
--set-class 0:3
Let me try this. Yes. This is what I was looking for. I was trying
something like this and I was getting an error

tc filter add dev eth0 parent 100: protocol ip prio 10 u32 match ip dport 10000 0xffff flowid 100:3
RTNETLINK answers: Operation not supported
We have an error talking to the kernel, -1

Not sure why the above throws an error for me. If I understand it
right, match rule will add a filter to the parent to send packet to
100:3 which is for TC3 or Q3.

My taprio configuration is as follows:-

root@am57xx-evm:~# tc qdisc show  dev eth0
qdisc taprio 100: root refcnt 9 tc 5 map 0 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2
queues offset 0 count 1 offset 1 count 1 offset 2 count 1 offset 3 count 1 offset 4 count 1 clockid TAI offload 0 base-time 0 cycle-time 0 cycle-time-extension 0 base-time 1564536613194451433 cycle-time 20000000 cycle-
time-extension 0
        index 0 cmd S gatemask 0x1 interval 4000000
        index 1 cmd S gatemask 0x2 interval 4000000
        index 2 cmd S gatemask 0x4 interval 4000000
        index 3 cmd S gatemask 0x8 interval 4000000
        index 4 cmd S gatemask 0x10 interval 4000000

qdisc pfifo 0: parent 100:5 limit 1000p
qdisc pfifo 0: parent 100:4 limit 1000p
qdisc pfifo 0: parent 100:3 limit 1000p
qdisc pfifo 0: parent 100:2 limit 1000p
qdisc pfifo 0: parent 100:1 limit 1000p

Thanks for your response!
This will set the skb->priority of UDP packets matching that rule to 3.

Another alternative is to create a net_prio cgroup, and the sockets
created under that hierarchy would have have that priority. I don't have
an example handy for this right now, sorry.

Is this what you were looking for?


Cheers,
--
Vinicius


Reply via email to