[Cake] [PATCH 3/4] sch_api: Allow reducing queue backlog by a negative value

Toke Høiland-Jørgensen toke at toke.dk
Tue Jan 8 04:55:51 EST 2019


Eric Dumazet <eric.dumazet at gmail.com> writes:

> On 01/07/2019 11:47 AM, Toke Høiland-Jørgensen wrote:
>> From: Toke Høiland-Jørgensen <toke at redhat.com>
>> 
>> With GSO splitting in sch_cake, we can decrease as well as increase the
>> qlen. To make it possible to signal this up the qdisc tree, change
>> qdisc_tree_reduce_backlog() to accept signed integer values as the number
>> of packets and bytes to reduce the backlog by.
>
>
> Not sure why this patch is needed, given we use u32 integers
> for q.qlen & qstats.backlog
>
> 0xFFFFFFFF for n is really -1 once folded...
>
> sch->q.qlen -= n;
> sch->qstats.backlog -= len;

Sure, it works without the patch, but changing to int properly
communicates the intent (that negative values are allowed) rather than
rely on overflow behaviour...

-Toke


More information about the Cake mailing list