All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] taprio: Set the value of picos_per_byte before fill sched_entry
@ 2022-09-28  6:58 jianghaoran
  2022-09-30  2:18 ` Jakub Kicinski
                   ` (10 more replies)
  0 siblings, 11 replies; 23+ messages in thread
From: jianghaoran @ 2022-09-28  6:58 UTC (permalink / raw)
  To: vinicius.gomes
  Cc: jhs, xiyou.wangcong, jiri, davem, edumazet, kuba, pabeni, netdev,
	linux-kernel

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.
It will appear like commit b5b73b26b3ca ("taprio:
Fix allowing too small intervals") described problem.
Here is a further modification of this problem.

example:

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

Signed-off-by: jianghaoran <jianghaoran@kylinos.cn>
---
 net/sched/sch_taprio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c
index 86675a79da1e..d95ec2250f24 100644
--- a/net/sched/sch_taprio.c
+++ b/net/sched/sch_taprio.c
@@ -1507,6 +1507,8 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt,
 		goto free_sched;
 	}
 
+	taprio_set_picos_per_byte(dev, q);
+
 	err = parse_taprio_schedule(q, tb, new_admin, extack);
 	if (err < 0)
 		goto free_sched;
@@ -1521,8 +1523,6 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt,
 	if (err < 0)
 		goto free_sched;
 
-	taprio_set_picos_per_byte(dev, q);
-
 	if (mqprio) {
 		err = netdev_set_num_tc(dev, mqprio->num_tc);
 		if (err)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2022-10-08  0:58 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-28  6:58 [PATCH] taprio: Set the value of picos_per_byte before fill sched_entry jianghaoran
2022-09-30  2:18 ` Jakub Kicinski
2022-09-30 11:18   ` jianghaoran
2022-09-30 13:46   ` jianghaoran
2022-09-30 13:58   ` test jianghaoran
2022-09-30 14:16   ` [PATCH] taprio: Set the value of picos_per_byte before fill sched_entry jianghaoran
2022-10-01  0:42   ` jianghaoran
2022-10-01  0:44     ` jianghaoran
2022-10-01  0:49     ` jianghaoran
2022-10-01  0:57     ` jianghaoran
2022-10-01  0:59     ` jianghaoran
2022-10-01  1:10 ` jianghaoran
2022-10-01  1:17 ` jianghaoran
2022-10-01  1:23 ` jianghaoran
2022-10-01  7:48 ` [PATCH V2] " jianghaoran
2022-10-01  7:51 ` jianghaoran
2022-10-01  7:51 ` jianghaoran
2022-10-01  7:53 ` jianghaoran
2022-10-01  8:00 ` jianghaoran
2022-10-01  8:06 ` jianghaoran
2022-10-01 11:44   ` Vladimir Oltean
2022-10-03 15:08   ` Jakub Kicinski
2022-10-01  8:29 ` jianghaoran

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.