From patchwork Fri Nov 15 21:26:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 13877123 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BC2ED68BDD for ; Fri, 15 Nov 2024 21:26:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BC4978D0003; Fri, 15 Nov 2024 16:26:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B2C5E8D0005; Fri, 15 Nov 2024 16:26:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9993C8D0003; Fri, 15 Nov 2024 16:26:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 7E5348D0001 for ; Fri, 15 Nov 2024 16:26:44 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 360ADAC5FD for ; Fri, 15 Nov 2024 21:26:44 +0000 (UTC) X-FDA: 82789612836.05.56DE263 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by imf14.hostedemail.com (Postfix) with ESMTP id 69C82100006 for ; Fri, 15 Nov 2024 21:25:51 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=linux.microsoft.com header.s=default header.b=qqVpjOTp; dmarc=pass (policy=none) header.from=linux.microsoft.com; spf=pass (imf14.hostedemail.com: domain of eahariha@linux.microsoft.com designates 13.77.154.182 as permitted sender) smtp.mailfrom=eahariha@linux.microsoft.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731705938; a=rsa-sha256; cv=none; b=RsSzsd4ZZlH+4WN7I6LxN20hXoCDH3XeSCK5g/JOQ9RONVKhXkMpbMrWS5OPToLNXNI7tR iReIoPE1x/A73j0Z7W8ut/wqGozOBqIsbWnuVOLvSPpFKwvvnsa7kqq1+QI/v5647AQpVn 18FPUFDWYuWdYfdpv1t//EMBaFKLn6o= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=linux.microsoft.com header.s=default header.b=qqVpjOTp; dmarc=pass (policy=none) header.from=linux.microsoft.com; spf=pass (imf14.hostedemail.com: domain of eahariha@linux.microsoft.com designates 13.77.154.182 as permitted sender) smtp.mailfrom=eahariha@linux.microsoft.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731705938; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Q64Lap8gGilYnZS8wBYuXVtg6CkDWFgIDR5hpRb/qKY=; b=zIgCOYFe/SVW4mFju01dLh44vfPDgOh923nR6It+JEw7kqI8EsQAZ69cO6rP7Kw5N76XQn jEErDoMZe0oHFrIzNhX7rqYiJON+zr0KL83X4WDgI55ZMMxrfgI1ENVZS8eTVEFzXCAR7P CkxMW0boOsSOx/3dP/DTag3Vx2dXrpg= Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id 33C45206BCF3; Fri, 15 Nov 2024 13:26:41 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 33C45206BCF3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1731706001; bh=Q64Lap8gGilYnZS8wBYuXVtg6CkDWFgIDR5hpRb/qKY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qqVpjOTpvUDnqKvyg0F7x8y5V/QTgKE0vrlMSYSCNCLw1VcBjI0/Vl0G6Q39TTHHt DRDU50XbhfXe3YX2edjYJBIv3SoKO3DsasrlEzDNkcD4CPzZrQ2JNzKwdnMxBZK6Fj EbvBkDXPncjur9W0Dtl4dgGCI1NPWNvWmxFYJQrY= From: Easwar Hariharan Date: Fri, 15 Nov 2024 21:26:18 +0000 Subject: [PATCH v2 01/21] netfilter: conntrack: Cleanup timeout definitions MIME-Version: 1.0 Message-Id: <20241115-converge-secs-to-jiffies-v2-1-911fb7595e79@linux.microsoft.com> References: <20241115-converge-secs-to-jiffies-v2-0-911fb7595e79@linux.microsoft.com> In-Reply-To: <20241115-converge-secs-to-jiffies-v2-0-911fb7595e79@linux.microsoft.com> To: Pablo Neira Ayuso , Jozsef Kadlecsik , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Julia Lawall , Nicolas Palix , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Ofir Bitton , Oded Gabbay , Lucas De Marchi , =?utf-8?q?Thomas_Hellstr=C3=B6?= =?utf-8?q?m?= , Rodrigo Vivi , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Jeroen de Borst , Praveen Kaligineedi , Shailend Chand , Andrew Lunn , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , =?utf-8?q?Roger_Pau_Mon?= =?utf-8?q?n=C3=A9?= , Jens Axboe , Kalle Valo , Jeff Johnson , Catalin Marinas , Andrew Morton , Jack Wang , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Greg Kroah-Hartman , Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Xiubo Li , Ilya Dryomov , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , Jaroslav Kysela , Takashi Iwai , Lucas Stach , Russell King , Christian Gmeiner , Louis Peens , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , Madhavan Srinivasan Cc: netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, cocci@inria.fr, linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org, dri-devel@lists.freedesktop.org, intel-xe@lists.freedesktop.org, linux-scsi@vger.kernel.org, xen-devel@lists.xenproject.org, linux-block@vger.kernel.org, linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, linux-mm@kvack.org, linux-bluetooth@vger.kernel.org, linux-staging@lists.linux.dev, linux-rpi-kernel@lists.infradead.org, ceph-devel@vger.kernel.org, live-patching@vger.kernel.org, linux-sound@vger.kernel.org, etnaviv@lists.freedesktop.org, oss-drivers@corigine.com, linuxppc-dev@lists.ozlabs.org, Anna-Maria Behnsen , Easwar Hariharan X-Mailer: b4 0.14.2 X-Rspam-User: X-Rspamd-Queue-Id: 69C82100006 X-Rspamd-Server: rspam11 X-Stat-Signature: 8m4rrifpyhqup8t9rm5zsw5g68mgzfk8 X-HE-Tag: 1731705951-658479 X-HE-Meta: U2FsdGVkX1+BipNua70AkuHoJ3Q+CWls856dYB6CkSepcBdzyZruEKyMTILEPzaJzABiK3Nr/nT0jusRKg+jucarZJX6OgUk5hELNjKJMMycn6ClR3zcB99bv2LJZn3sa1qdQ6mJox6iLxKHUHVLxLVBYZWe456QdCw/r2joH/bvJ5clcMTc2dAar00l20X9NZZTQzsi7NieJ6D/khoUJwvsBsMH97QLXloyVqXfZIDfLI2uajZ2xj37ZtdiWenZAZuPlHP6GeYKn/xNrUKiBVzM9ZqF6Debs1fEG0T84CA7e0tv4UKA9KCJZQLEvVcZy26gwbOAUMU4d7PGuq1CT34hb2qh/h+tChMioCwXgoy9ICMefkfuUZ3lqAGP7M31j3G+OQjWbUi/4GGf9y92Gtkohqghj4mQKFremqca2NF4NqS0AuuSloAJR0hacOAuV1d64tUPrF3XKqcpcWrH7gkx0NR05oSwyQJ+1A3CKXEkGuTz+zVwbSRQNzfz2zuTVSclD6o+v9vB7FydGut+9mqEIrzmJOcwgPGX6jhn30Onh9EHlSHV4m/A2y8KeU7Q2swHloVrVBT1jDytZGj3q/WufU+Yz3UVNwlFpDrPVpyav6aHCEgAHiyPPHxvUkl1CvN14E1zpMGsUyrsqI4FZx40xv2EH0rRGT6k361QlC2rilT2ECMbXBve50yJucdxpKAAJUfgye9ARR/olkQ941bLNjx/d0goT2NPwMjoGuiporaOCUuKwADWTfeflbVb3zwRn0l0JqyddcR0ddMHxJq6b7HE9z7edNL3YFb+Hvfm1gA7cPiZtLSBR/AIgfjJw3zzzMZ+5TqI59LG77hu7pIZC7XMTQhaP0DIit0FT39DYJjb5q+HgTJG9FZ1HTvYSY2YgnUrjgqOkdgrvxJc722RtU7cEfmnWMjw+viPy+1yha2hGgVXqnSAJj1rnwEI5th/6fAjZc+I8Gv1kpX mySfvdJg UFOgw2SHttWzIz3hcu1oa7jkvsYJ1bi2Va8acqEMpjdp+WSIhV9LJwoHYMIArow4b8OXGIWjNmS7+UZZ3hJMsczkp+IOGYeemCTvmHy7o0680NhMaPHoPV0nWZ566u/a802F4mP6ecVwEaKRqzz3cAi2axKdaQwJVH9VUZtvuKoSc4QB3SJHUFfv9kTHvaNM64SRFbYMcmhk4rxC5NnRYFPvSyc8w6ICF0jDosXjH2VsN0AcgXAWwa7OLtxw0EVGVdtou60VQ8jWMANodOb6ibh0s766xGWUwAfAOe/XOTAjKZvJO0M1GQuR+IsKfFumG/ljb8L9nOGa5PWVgKOPXLuN3wOL+wCoeQ2/EmUKReMPcFtTn0YaR5Uu9/9e9MCghGNExfKL4JnDhvtI= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: None of the higher order definitions are used anymore, so remove definitions for minutes, hours, and days timeouts. Convert the seconds denominated timeouts to secs_to_jiffies() Signed-off-by: Easwar Hariharan --- net/netfilter/nf_conntrack_proto_sctp.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c index 4cc97f971264ed779434ab4597dd0162586b3736..6c95ac96fa42a39acafb5b88a7cf8898010e911c 100644 --- a/net/netfilter/nf_conntrack_proto_sctp.c +++ b/net/netfilter/nf_conntrack_proto_sctp.c @@ -39,20 +39,15 @@ static const char *const sctp_conntrack_names[] = { [SCTP_CONNTRACK_HEARTBEAT_SENT] = "HEARTBEAT_SENT", }; -#define SECS * HZ -#define MINS * 60 SECS -#define HOURS * 60 MINS -#define DAYS * 24 HOURS - static const unsigned int sctp_timeouts[SCTP_CONNTRACK_MAX] = { - [SCTP_CONNTRACK_CLOSED] = 10 SECS, - [SCTP_CONNTRACK_COOKIE_WAIT] = 3 SECS, - [SCTP_CONNTRACK_COOKIE_ECHOED] = 3 SECS, - [SCTP_CONNTRACK_ESTABLISHED] = 210 SECS, - [SCTP_CONNTRACK_SHUTDOWN_SENT] = 3 SECS, - [SCTP_CONNTRACK_SHUTDOWN_RECD] = 3 SECS, - [SCTP_CONNTRACK_SHUTDOWN_ACK_SENT] = 3 SECS, - [SCTP_CONNTRACK_HEARTBEAT_SENT] = 30 SECS, + [SCTP_CONNTRACK_CLOSED] = secs_to_jiffies(10), + [SCTP_CONNTRACK_COOKIE_WAIT] = secs_to_jiffies(3), + [SCTP_CONNTRACK_COOKIE_ECHOED] = secs_to_jiffies(3), + [SCTP_CONNTRACK_ESTABLISHED] = secs_to_jiffies(210), + [SCTP_CONNTRACK_SHUTDOWN_SENT] = secs_to_jiffies(3), + [SCTP_CONNTRACK_SHUTDOWN_RECD] = secs_to_jiffies(3), + [SCTP_CONNTRACK_SHUTDOWN_ACK_SENT] = secs_to_jiffies(3), + [SCTP_CONNTRACK_HEARTBEAT_SENT] = secs_to_jiffies(3), }; #define SCTP_FLAG_HEARTBEAT_VTAG_FAILED 1