Re: [PATCH] taprio: Set the value of picos_per_byte before fill sched_entry

From: jianghaoran
Date: Fri Oct 07 2022 - 20:57:09 EST


On Wed, 28 Sep 2022 14:58:30 +0800 jianghaoran wrote:
If the value of picos_per_byte is set after fill sched_entry,
as a result, the min_duration calculated by length_to_duration is 0,
and the validity of the input interval cannot be judged,
too small intervals couldn't allow any packet to be transmitted.

Meaning an invalid configuration is accepted but no packets
can ever be transmitted? Could you make the user-visible
issue clearer?

Yes, It's possible that the user specifies an too small interval that couldn't allow any packet to be transmitted.According to the following example, the interval is set to 9, and the network port enp5s0f0 cannot send any data
It will appear like commit b5b73b26b3ca ("taprio:
Fix allowing too small intervals") described problem.
Here is a further modification of this problem.

example:

Here as well it seems worthwhile to mention what this is an example of.
e.g. "example configuration which will not be able to transmit packets"

tc qdisc replace dev enp5s0f0 parent root handle 100 taprio \
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 2@2 \
base-time 1528743495910289987 \
sched-entry S 01 9 \
sched-entry S 02 9 \
sched-entry S 04 9 \
clockid CLOCK_TAI

Please add a Fixes tag pointing to the first commit where the issue was
present, and CC Vladimir Oltean <vladimir.oltean@xxxxxxx> on the next
version.

Thank you for your suggestion. I will modify it as suggested