Re: [PATCH 2/2] net/tcp: Disable TCP-MD5 static key on tcp_md5sig_info destruction

From: Dmitry Safonov
Date: Thu Nov 03 2022 - 11:40:28 EST


On 11/2/22 21:53, Eric Dumazet wrote:
> On Wed, Nov 2, 2022 at 2:49 PM Eric Dumazet <edumazet@xxxxxxxxxx> wrote:
>
>>
>> Are you sure ?
>>
>> static_branch_inc() is what we want here, it is a nice wrapper around
>> the correct internal details,
>> and ultimately boils to an atomic_inc(). It is safe for all contexts.
>>
>> But if/when jump labels get refcount_t one day, we will not have to
>> change TCP stack because
>> it made some implementation assumptions.
>
> Oh, I think I understand this better now.
>
> Please provide a helper like
>
> static inline void static_key_fast_inc(struct static_key *key)
> {
> atomic_inc(&key->enabled);
> }
>
> Something like that.

Sure, that sounds like a better thing to do, rather than the hack I had.

Thanks, will send v2 soon,
Dmitry