Skip to content

Commit

Permalink
net/sched: taprio: dynamic max_sdu larger than the max_mtu is unlimited
Browse files Browse the repository at this point in the history
It makes no sense to keep randomly large max_sdu values, especially if
larger than the device's max_mtu. These are visible in "tc qdisc show".
Such a max_sdu is practically unlimited and will cause no packets for
that traffic class to be dropped on enqueue.

Just set max_sdu_dynamic to U32_MAX, which in the logic below causes
taprio to save a max_frm_len of U32_MAX and a max_sdu presented to user
space of 0 (unlimited).

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
vladimiroltean authored and Paolo Abeni committed Feb 20, 2023
1 parent bdf366b commit 64cb6aa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/sched/sch_taprio.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ static void taprio_update_queue_max_sdu(struct taprio_sched *q,
dev->hard_header_len + 1);
}
max_sdu_dynamic = max_frm_len - dev->hard_header_len;
if (max_sdu_dynamic > dev->max_mtu)
max_sdu_dynamic = U32_MAX;
}

max_sdu = min(max_sdu_dynamic, max_sdu_from_user);
Expand Down

0 comments on commit 64cb6aa

Please sign in to comment.