lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+h21hon+QzS7tRytM2duVUvveSRY5BOGXkHtHOdTEwOSBcVAg@mail.gmail.com>
Date:   Mon, 14 Oct 2019 00:10:39 +0300
From:   Vladimir Oltean <olteanv@...il.com>
To:     Vinicius Costa Gomes <vinicius.gomes@...el.com>
Cc:     Murali Karicheri <m-karicheri2@...com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: taprio testing - Any help?

Hi Vinicius,

On Sat, 12 Oct 2019 at 00:28, Vinicius Costa Gomes
<vinicius.gomes@...el.com> wrote:
>
> Hi,
>
> Murali Karicheri <m-karicheri2@...com> writes:
>
> > Hi Vinicius,
> >
> > On 10/11/2019 04:12 PM, Vinicius Costa Gomes wrote:
> >> Hi Murali,
> >>
> >> Murali Karicheri <m-karicheri2@...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
>
> Hmm, taprio (or mqprio for that matter) doesn't support tc filter
> blocks, so this won't work for those qdiscs.
>
> I never thought about adding support for it, it looks very interesting.
> Thanks for pointing this out. I will add this to my todo list, but
> anyone should feel free to beat me to it :-)
>
>
> Cheers,
> --
> Vinicius

What do you mean taprio doesn't support tc filter blocks? What do you
think there is to do in taprio to support that?
I don't think Murali is asking for filter offloading, but merely for a
way to direct frames to a certain traffic class on xmit from Linux.
Something like this works perfectly fine:

sudo tc qdisc add dev swp2 root handle 1: taprio num_tc 2 map 0 1
queues 1@0 1@1 base-time 1000 sched-entry S 03 300000 flags 2
# Add the qdisc holding the classifiers
sudo tc qdisc add dev swp2 clsact
# Steer L2 PTP to TC 1 (see with "tc filter show dev swp2 egress")
sudo tc filter add dev swp2 egress prio 1 u32 match u16 0x88f7 0xffff
at -2 action skbedit priority 1

However, the clsact qdisc and tc u32 egress filter can be replaced
with proper use of the SO_PRIORITY API, which is preferable for new
applications IMO.

I'm trying to send a demo application to tools/testing/selftests/
which sends cyclic traffic through a raw L2 socket at a configurable
base-time and cycle-time, along with the accompanying scripts to set
up the receiver and bandwidth reservation on an in-between switch. But
I have some trouble getting the sender application to work reliably at
100 us cycle-time, so it may take a while until I figure out with
kernelshark what's going on.

Regards,
-Vladimir

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ