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

From: Eric Dumazet
Date: Wed Nov 02 2022 - 17:53:59 EST


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.