linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ratheesh Kannoth <rkannoth@marvell.com>
To: <0x7f454c46@gmail.com>
Cc: Eric Dumazet <edumazet@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	David Ahern <dsahern@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Mohammad Nassiri <mnassiri@ciena.com>,
	Simon Horman <horms@kernel.org>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-trace-kernel@vger.kernel.org>, <linux-doc@vger.kernel.org>
Subject: Re: [PATCH net-next v2 1/6] net/tcp: Use static_branch_tcp_{md5,ao} to drop ifdefs
Date: Wed, 5 Jun 2024 10:14:41 +0530	[thread overview]
Message-ID: <20240605044441.GA3452034@maili.marvell.com> (raw)
In-Reply-To: <20240605-tcp_ao-tracepoints-v2-1-e91e161282ef@gmail.com>

On 2024-06-05 at 07:50:02, Dmitry Safonov via B4 Relay (devnull+0x7f454c46.gmail.com@kernel.org) wrote:
> From: Dmitry Safonov <0x7f454c46@gmail.com>
>
> It's possible to clean-up some ifdefs by hiding that
> tcp_{md5,ao}_needed static branch is defined and compiled only
> under related configs, since commit 4c8530dc7d7d ("net/tcp: Only produce
> AO/MD5 logs if there are any keys").
>
> Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com>
> ---
>  include/net/tcp.h   | 14 ++++----------
>  net/ipv4/tcp_ipv4.c |  8 ++------
>  2 files changed, 6 insertions(+), 16 deletions(-)
>
> diff --git a/include/net/tcp.h b/include/net/tcp.h
> index 08c3b99501cf..f6dd035e0fa9 100644
> --- a/include/net/tcp.h
> +++ b/include/net/tcp.h
> @@ -2386,21 +2386,15 @@ static inline void tcp_get_current_key(const struct sock *sk,
>
>  static inline bool tcp_key_is_md5(const struct tcp_key *key)
>  {
> -#ifdef CONFIG_TCP_MD5SIG
> -	if (static_branch_unlikely(&tcp_md5_needed.key) &&
> -	    key->type == TCP_KEY_MD5)
> -		return true;
> -#endif
> +	if (static_branch_tcp_md5())
Seems that we lost unlikely hint. Dont we add that as well-> unlikely()
> +		return key->type == TCP_KEY_MD5;
>  	return false;
>  }
>
>
>

  reply	other threads:[~2024-06-05  4:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-05  2:20 [PATCH net-next v2 0/6] net/tcp: TCP-AO and TCP-MD5 tracepoints Dmitry Safonov via B4 Relay
2024-06-05  2:20 ` [PATCH net-next v2 1/6] net/tcp: Use static_branch_tcp_{md5,ao} to drop ifdefs Dmitry Safonov via B4 Relay
2024-06-05  4:44   ` Ratheesh Kannoth [this message]
2024-06-05 17:29     ` Dmitry Safonov
2024-06-05  7:49   ` Eric Dumazet
2024-06-05  2:20 ` [PATCH net-next v2 2/6] net/tcp: Add a helper tcp_ao_hdr_maclen() Dmitry Safonov via B4 Relay
2024-06-05  2:20 ` [PATCH net-next v2 3/6] net/tcp: Move tcp_inbound_hash() from headers Dmitry Safonov via B4 Relay
2024-06-05  8:07   ` Eric Dumazet
2024-06-05 17:35     ` Dmitry Safonov
2024-06-05 17:37       ` Eric Dumazet
2024-06-06  1:05         ` Dmitry Safonov
2024-06-05  2:20 ` [PATCH net-next v2 4/6] net/tcp: Add tcp-md5 and tcp-ao tracepoints Dmitry Safonov via B4 Relay
2024-06-05  2:20 ` [PATCH net-next v2 5/6] net/tcp: Remove tcp_hash_fail() Dmitry Safonov via B4 Relay
2024-06-05  8:09   ` Eric Dumazet
2024-06-05  2:20 ` [PATCH net-next v2 6/6] Documentation/tcp-ao: Add a few lines on tracepoints Dmitry Safonov via B4 Relay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240605044441.GA3452034@maili.marvell.com \
    --to=rkannoth@marvell.com \
    --cc=0x7f454c46@gmail.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=mnassiri@ciena.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).