From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
To: Vladimir Oltean <olteanv@gmail.com>, davem@davemloft.net
Cc: andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@gmail.com,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next] net: dsa: sja1105: offload the Credit-Based Shaper qdisc
Date: Wed, 27 May 2020 11:25:57 -0700 [thread overview]
Message-ID: <87v9khjkui.fsf@intel.com> (raw)
In-Reply-To: <20200527165527.1085151-1-olteanv@gmail.com>
Hi,
Vladimir Oltean <olteanv@gmail.com> writes:
> From: Vladimir Oltean <vladimir.oltean@nxp.com>
>
> SJA1105, being AVB/TSN switches, provide hardware assist for the
> Credit-Based Shaper as described in the IEEE 8021Q-2018 document.
>
> First generation has 10 shapers, freely assignable to any of the 4
> external ports and 8 traffic classes, and second generation has 16
> shapers.
>
> We also need to provide a dummy implementation of mqprio qdisc offload,
> since this seems to be necessary for shaping any traffic class other
> than zero.
>
> The Credit-Based Shaper tables are accessed through the dynamic
> reconfiguration interface, so we have to restore them manually after a
> switch reset. The tables are backed up by the static config only on
> P/Q/R/S, and we don't want to add custom code only for that family,
> since the procedure that is in place now works for both.
>
> Tested with the following commands:
>
> data_rate_kbps=34000
> port_transmit_rate_kbps=1000000
> idleslope=$data_rate_kbps
> sendslope=$(($idleslope - $port_transmit_rate_kbps))
> locredit=$((-0x7fffffff))
> hicredit=$((0x7fffffff))
> tc qdisc add dev sw1p3 root handle 1: mqprio num_tc 8
This (and implementing the dummy mqprio offload callback) seem a bit
hackish: I am reading this is more a way to bypass mqprio parameter
validation (the priority to queue mapping) than anything else.
And I don't think that accepting any parameters without doing any
validation is really what you want.
Question:
$ tc qdisc replace dev $IFACE parent root handle 100 mqprio \
num_tc 3 \
map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \
queues 1@0 1@1 1@2 \
hw 0
$ tc qdisc replace dev $IFACE handle 200 parent 100:1 cbs \
idleslope 100000 sendslope -900000 hicredit 150 locredit -1362 \
offload 1
Why doesn't something like this work for your hardware?
Cheers,
--
Vinicius
next prev parent reply other threads:[~2020-05-27 18:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-27 16:55 [PATCH net-next] net: dsa: sja1105: offload the Credit-Based Shaper qdisc Vladimir Oltean
2020-05-27 18:25 ` Vinicius Costa Gomes [this message]
2020-05-27 19:29 ` Vladimir Oltean
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87v9khjkui.fsf@intel.com \
--to=vinicius.gomes@intel.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=vivien.didelot@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.