Skip to content

Commit a3d91b2

Browse files
vladimirolteandavem330
authored andcommitted
net/sched: taprio: warn about missing size table
Vinicius intended taprio to take the L1 overhead into account when estimating packet transmission time through user input, specifically through the qdisc size table (man tc-stab). Something like this: tc qdisc replace dev $eth root stab overhead 24 taprio \ num_tc 8 \ map 0 1 2 3 4 5 6 7 \ queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \ base-time 0 \ sched-entry S 0x7e 9000000 \ sched-entry S 0x82 1000000 \ max-sdu 0 0 0 0 0 0 0 200 \ flags 0x0 clockid CLOCK_TAI Without the overhead being specified, transmission times will be underestimated and will cause late transmissions. For an offloading driver, it might even cause TX hangs if there is no open gate large enough to send the maximum sized packets for that TC (including L1 overhead). Properly knowing the L1 overhead will ensure that we are able to auto-calculate the queueMaxSDU per traffic class just right, and avoid these hangs due to head-of-line blocking. We can't make the stab mandatory due to existing setups, but we can warn the user that it's important with a warning netlink extack. Link: https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/ Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Kurt Kanzenbach <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1f62879 commit a3d91b2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

net/sched/sch_taprio.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,6 +1690,7 @@ static int taprio_new_flags(const struct nlattr *attr, u32 old,
16901690
static int taprio_change(struct Qdisc *sch, struct nlattr *opt,
16911691
struct netlink_ext_ack *extack)
16921692
{
1693+
struct qdisc_size_table *stab = rtnl_dereference(sch->stab);
16931694
struct nlattr *tb[TCA_TAPRIO_ATTR_MAX + 1] = { };
16941695
struct sched_gate_list *oper, *admin, *new_admin;
16951696
struct taprio_sched *q = qdisc_priv(sch);
@@ -1842,6 +1843,10 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt,
18421843
new_admin = NULL;
18431844
err = 0;
18441845

1846+
if (!stab)
1847+
NL_SET_ERR_MSG_MOD(extack,
1848+
"Size table not specified, frame length estimations may be inaccurate");
1849+
18451850
unlock:
18461851
spin_unlock_bh(qdisc_lock(sch));
18471852

0 commit comments

Comments
 (0)