Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp70884lqr; Tue, 4 Jun 2024 21:51:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXm0/ztxQboYQM1mY2DU6UvdGYvB9x8ytSFPRJVHJDHI6g1BAvisokyiN3Qff9CMOomkCvAMbE7k9hO7P5lCosnD3A9vFJwwCBqKZFeVA== X-Google-Smtp-Source: AGHT+IFvuZwnEwxiI0RBEcJr2MiePy7b6VYRT0lI+EWhCsOehCwohsj1aiEBnPEkZlCb6z9Ba+t2 X-Received: by 2002:a17:906:cd04:b0:a69:15b7:c156 with SMTP id a640c23a62f3a-a699fdfe850mr82887866b.71.1717563082298; Tue, 04 Jun 2024 21:51:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717563082; cv=pass; d=google.com; s=arc-20160816; b=p90t4NhSSHdhClXLg7SMKjzkCt02+Ork6LicqjPhv8iRUMamrUAXRvKoGGMMbi/oGX 0FjGZXeupr1FmIU3aUsVRVKTm00LtpsDGw5nSZunEr/6FISjgscujgGhiwPjYEQTDOxJ pQUPALsQAA4BqPNnvzBKpFHhQVua4FdBzyUNuFw+prPBdmgy/SVuFLdsatA9C7Wbmo5n DtcqlS4kkLgB4mrZmuwHt/doQEJQDYpfWeBjZA1ACbCwzv+i6qVjFbcFMmzLFByQf+Oz NhlDy2ZLy6qviBnTIcFom/B2wKxZxAjnypfYX5TnIdhNQwp231lZftIAHrHzsjzQm1iU OY3A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=OKNIK6PQn1SUEDYPQ/4MC5ygMmYXQNZukQIA+FsOkDc=; fh=kgyQdYzSdgaK6QMhT2BfJ0lI803GemC4iKWKB7W2we8=; b=b0qhQt09Uosylwg1BPTCr2ORFprk4ufwBpskIaR5r3qVps4PqEzr+RXsOJlIEsimZJ GTsb0zfVFr+RpLLI6kjUZr2UohAIzQk0okyFFvjcAeH5iKK1zX8g1TNDZcgiL4YHB2Cp nbRcqa75Lpn1Q4xsy+DUOVUk6hoIudPyDfgk0daWe32dVHx4uTt+S7H/mCkWBkGYSjVJ d5KlcJtIi6tpkkg4y58ol370kgP/tB3fq7NViDFl3Axn7hHePhKCsOXa1iSFpM54Tc4Y 82Sow+hjnRTlNrkIMj4LZyMf+ibkOwpTe2IPuxMwZJTCbOcOfinUgUQAYc9rbkcWjnBt vsKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=kwrZnMqW; arc=pass (i=1 spf=pass spfdomain=marvell.com dkim=pass dkdomain=marvell.com dmarc=pass fromdomain=marvell.com); spf=pass (google.com: domain of linux-kernel+bounces-201753-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201753-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a68f811094csi311251666b.29.2024.06.04.21.51.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 21:51:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201753-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=kwrZnMqW; arc=pass (i=1 spf=pass spfdomain=marvell.com dkim=pass dkdomain=marvell.com dmarc=pass fromdomain=marvell.com); spf=pass (google.com: domain of linux-kernel+bounces-201753-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201753-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E988B1F23093 for ; Wed, 5 Jun 2024 04:51:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4A0FF1384B3; Wed, 5 Jun 2024 04:51:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="kwrZnMqW" Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D98861FC6; Wed, 5 Jun 2024 04:51:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.156.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717563071; cv=none; b=HxqK/jhO5IUyOR4j3xLM8+KNh94PKRpex8KTVVC/dm8mqfFIeYhim1BYS6N/SefcDh/DIimSAiS11ysKjsahwaHu9U90Z5ksVqUjpU483+IusFfATyGepjQ0XKRhG/7EkHOMS5a6Fiq9kaIf5dZIimIn6c0KNLSs+N3FYHXEOtU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717563071; c=relaxed/simple; bh=IDc6ujVuOTHOaHdN/xtBa1iDkOFL97kXwy4RC0H8QRQ=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oHui0dFnMVP2moD1ATOFIqM3yax95kI/zFN8lrkDx9AQRQSnf/tabPQvwvHVGE5J4wiRlmc5bPSoKNee5Fgjte/4r+8tu7XW2cTbLFxPMaCOJAkaRJe7PTpT7SwXImLe3GFuUpLWqtrW2Hv/Abh1b0+IXTOl9zbhJZYBOOZcXSc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=pass smtp.mailfrom=marvell.com; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b=kwrZnMqW; arc=none smtp.client-ip=67.231.156.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marvell.com Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 454KXfJ9003930; Tue, 4 Jun 2024 21:44:49 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=pfpt0220; bh=OKNIK6PQn1SUEDYPQ/4MC5ygM mYXQNZukQIA+FsOkDc=; b=kwrZnMqWrvwVKrucKc6RKSWiZfEU9gx4dyqkPN9rJ 5aXlgh7Ub43U16sepdDCYwm7WiaQyLgNvlludMmNgSReH27HtRp8pv6Fvj47WDu5 N/xy8R5CymSRAK4DdRm/6C+FO10qgU9mL45YaWfuHmc8AgbFrUYsBaFMiel3y5i5 v8OcaH4Vwg6egSl/QEAY5o5S26+hGDMmGHHfDY60kIkLAYRyUedV635AT97LLymZ QuRyM0uHZD/uo6OcA5Qzt434M0paVA7az1h0R/i3KgEUsIOCQCqtBBJYWdSlVxmZ dAqSob5466SHHAh/xL51oqOz+KSlvV0PMgpN19lxMrajQ== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3yj167bw8k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Jun 2024 21:44:48 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 4 Jun 2024 21:44:47 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 4 Jun 2024 21:44:47 -0700 Received: from maili.marvell.com (unknown [10.28.36.165]) by maili.marvell.com (Postfix) with SMTP id EE0DB3F7040; Tue, 4 Jun 2024 21:44:42 -0700 (PDT) Date: Wed, 5 Jun 2024 10:14:41 +0530 From: Ratheesh Kannoth To: <0x7f454c46@gmail.com> CC: Eric Dumazet , "David S. Miller" , Jakub Kicinski , Paolo Abeni , David Ahern , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Jonathan Corbet , Mohammad Nassiri , Simon Horman , , , , Subject: Re: [PATCH net-next v2 1/6] net/tcp: Use static_branch_tcp_{md5,ao} to drop ifdefs Message-ID: <20240605044441.GA3452034@maili.marvell.com> References: <20240605-tcp_ao-tracepoints-v2-0-e91e161282ef@gmail.com> <20240605-tcp_ao-tracepoints-v2-1-e91e161282ef@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20240605-tcp_ao-tracepoints-v2-1-e91e161282ef@gmail.com> X-Proofpoint-ORIG-GUID: gFkNoHKrv-1PWaojsDgW1P09mPHzPUGV X-Proofpoint-GUID: gFkNoHKrv-1PWaojsDgW1P09mPHzPUGV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_11,2024-06-04_02,2024-05-17_01 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; > } > > >