lkml.org 
[lkml]   [2020]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 net] net: udp: fix Fast/frag0 UDP GRO
From: Jakub Kicinski <kuba@kernel.org>

From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: Wed, 11 Nov 2020 12:28:21 -0500

> On Wed, Nov 11, 2020 at 11:27 AM Jakub Kicinski <kuba@kernel.org> wrote:
>>
>> On Wed, 11 Nov 2020 11:29:06 +0000 Alexander Lobakin wrote:
>>>>>> + sk = static_branch_unlikely(&udp_encap_needed_key) ?
>>>>>> + udp4_gro_lookup_skb(skb, uh->source, uh->dest) :
>>>>>> + NULL;
>>>>
>>>> Does this indentation pass checkpatch?
>>>
>>> Sure, I always check my changes with checkpatch --strict.
>>>
>>>> Else, the line limit is no longer strict,a and this only shortens the
>>>> line, so a single line is fine.
>>>
>>> These single lines is about 120 chars, don't find them eye-pleasant.
>>> But, as with "u32" above, they're pure cosmetics and can be changed.
>>
>> let me chime in on the perhaps least important aspect of the patch :)
>>
>> Is there are reason to use a ternary operator here at all?
>> Isn't this cleaner when written with an if statement?
>>
>> sk = NULL;
>> if (static_branch_unlikely(&udp_encap_needed_key))
>> sk = udp4_gro_lookup_skb(skb, uh->source, uh->dest);

This idea came to me right after I submitted the last version
actually. Sure, there's absolutely no need to use a split ternary.

> Ah indeed :)
>
> One other thing I missed before. The socket lookup is actually an
> independent issue, introduced on commit a6024562ffd7 ("udp: Add GRO
> functions to UDP socket"). Should be a separate Fixes tag, perhaps
> even a separate patch.

Seems reasonable. I'll convert v5 to a pair.

Thanks,
Al

\
 
 \ /
  Last update: 2020-11-11 20:27    [W:0.037 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site