Re: [PATCH net-next] tcp: Fix tcp_syn_flood_action() if CONFIG_IPV6=n

From: Jakub Kicinski
Date: Wed Nov 16 2022 - 17:15:30 EST


On Thu, 17 Nov 2022 08:39:43 +1100 Jamie Bainbridge wrote:
> > if (v6) {
> > #ifdef v6
> > expensive_call6();
> > #endif
> > } else {
> > expensive_call6();
> > }
>
> These should work, but I expect they cause a comparison which can't be
> optimised out at compile time. This is probably why the first style
> exists.
>
> In this SYN flood codepath optimisation doesn't matter because we're
> doing ratelimited logging anyway. But if we're breaking with existing
> style, then wouldn't the others also have to change to this style? I
> haven't reviewed all the other usage to tell if they're in an oft-used
> fastpath where such a thing might matter.

I think the word style already implies subjectivity.