[Cake] cake srchost/dsthost stopped working?

Toke Høiland-Jørgensen toke at toke.dk
Wed Aug 4 15:29:16 EDT 2021


Jonathan Morton <chromatix99 at gmail.com> writes:

> On Wed, 4 Aug 2021 at 14:14, Toke Høiland-Jørgensen via Cake
> <cake at lists.bufferbloat.net> wrote:
>>
>> Pete Heist <pete at heistp.net> writes:
>>
>> > One more tip, reverting this commit seems to fix it:
>> >
>> > https://github.com/torvalds/linux/commit/b0c19ed6088ab41dd2a727b60594b7297c15d6ce
>>
>> Ah, I think I see what the problem is; could you please try the patch
>> below?
>>
>> -Toke
>>
>> diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
>> index 951542843cab..a83c4d4326da 100644
>> --- a/net/sched/sch_cake.c
>> +++ b/net/sched/sch_cake.c
>> @@ -720,7 +720,7 @@ static u32 cake_hash(struct cake_tin_data *q, const struct sk_buff *skb,
>>  skip_hash:
>>         if (flow_override)
>>                 flow_hash = flow_override - 1;
>> -       else if (use_skbhash)
>> +       else if (use_skbhash && flow_mode & CAKE_FLOW_FLOWS)
>>                 flow_hash = skb->hash;
>>         if (host_override) {
>>                 dsthost_hash = host_override - 1;
>
> Good catch - I was going to have to wade in and remind myself how this
> lump of code worked.  But shouldn't the masking operation be in
> brackets, to make the precedence explicit?

Well, seeing as I introduced the bug, I think it's only fair that I fix
it as well ;)

I don't mind adding parenthesis; can do so when submitting a patch,
after Pete confirms that this fixes the issue...

-Toke


More information about the Cake mailing list