From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3978BC4332F for ; Thu, 3 Nov 2022 15:40:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231683AbiKCPk0 (ORCPT ); Thu, 3 Nov 2022 11:40:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231694AbiKCPkU (ORCPT ); Thu, 3 Nov 2022 11:40:20 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE92817592 for ; Thu, 3 Nov 2022 08:40:14 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id i5-20020a1c3b05000000b003cf47dcd316so3627200wma.4 for ; Thu, 03 Nov 2022 08:40:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=heCsF5+oksMkKllVhJuNqNh9mZu8ZtuLSZhGNPkuZUU=; b=awPwB40AqRzdI+kaKO27twDciZZUa4wRghMQ5H/0a2587mmwsT8ce5/+TwRPtir9qb Ue4YnZR0stUuot+GTLmCKAQphR/mSEXhy+ubpz8KJfPCEJzJVhMRNMXQCXLb6NJpUHTL UetbKMthucTcZE/68dqbYKFRtCiOee/L6nb3Ze3h2kWMdIE0zcxUoR/hGw/N9NFbiGxh pzv6WKvTAziZPBzbuivwaweJUDDVw3um7ka3zOz4dyEpmzTL/4Yn6NxxO0srkyX8p2W+ NS7wLNG8qRLep0Q7rjQQ9JHVAvJWTrOGOAAgfs6Ly7geOJFMcz0P1WxaVFbFyAgd1EZi CAPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=heCsF5+oksMkKllVhJuNqNh9mZu8ZtuLSZhGNPkuZUU=; b=hzTXLMWHFb712YaFOif9h+00pTPY7U95ei577QhoK8fQvLVs5mVH4XK10AkBxuw3/k yTxi7xejTQdRcXNunnkOURdR4fElvgKQpdnuBa/MR383ddX0i88za70abETit2E9wGdS r2u9Phkcz5trcy3AtOV6xhyhDKA3pQb+p9BHE9JVfhJRZUX0fI83HfLvQMxcJw7JGHqH XFI/9XESDkJRVjSa7aXZ3+7yABJqG74jbnv5BDVZ3rBD7/WivYN6ju1IEXeuxteMlL3o FPSQIVELv5BMZK0HMqdbq4ZS6s5lqbAD4FF7lt2m2JiPdyHQIVKwMyl6isiS5Gxyn4gL TR/g== X-Gm-Message-State: ACrzQf3jv2iH9OTFrhszpSfCeVDvhSogDnbVHjmmJfto8GsFRPCPHCXy DB58fMc3TXhSj2UZFOhqrjc7YQ== X-Google-Smtp-Source: AMsMyM5W3IK+XSPxncETUlmZfWRiaYwnj6m0Q7dFp4g0bufxPolS3y/IKY4/UkTiEiUWOM8xAdLSvw== X-Received: by 2002:a05:600c:35cf:b0:3c6:e957:b403 with SMTP id r15-20020a05600c35cf00b003c6e957b403mr31542271wmq.162.1667490013382; Thu, 03 Nov 2022 08:40:13 -0700 (PDT) Received: from [10.83.37.24] ([217.173.96.166]) by smtp.gmail.com with ESMTPSA id v20-20020adfa1d4000000b002238ea5750csm1459001wrv.72.2022.11.03.08.40.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Nov 2022 08:40:12 -0700 (PDT) Message-ID: Date: Thu, 3 Nov 2022 15:40:11 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH 2/2] net/tcp: Disable TCP-MD5 static key on tcp_md5sig_info destruction Content-Language: en-US To: Eric Dumazet Cc: linux-kernel@vger.kernel.org, David Ahern , Bob Gilligan , "David S. Miller" , Dmitry Safonov <0x7f454c46@gmail.com>, Francesco Ruggeri , Hideaki YOSHIFUJI , Jakub Kicinski , Paolo Abeni , Salam Noureddine , netdev@vger.kernel.org References: <20221102211350.625011-1-dima@arista.com> <20221102211350.625011-3-dima@arista.com> <483848f5-8807-fd97-babc-44740db96db4@arista.com> From: Dmitry Safonov In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/2/22 21:53, Eric Dumazet wrote: > On Wed, Nov 2, 2022 at 2:49 PM Eric Dumazet 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