From patchwork Wed Mar 31 17:52:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 12175873 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 033EBC433B4 for ; Wed, 31 Mar 2021 17:52:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CB7E560FE3 for ; Wed, 31 Mar 2021 17:52:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234670AbhCaRwW (ORCPT ); Wed, 31 Mar 2021 13:52:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234526AbhCaRwS (ORCPT ); Wed, 31 Mar 2021 13:52:18 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADE65C061574 for ; Wed, 31 Mar 2021 10:52:18 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id cl21-20020a17090af695b02900c61ac0f0e9so3369781pjb.1 for ; Wed, 31 Mar 2021 10:52:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Q9aJ/VK0rM/yTCrq/7HYUan28YvSVxEkpw9slVa2TMQ=; b=qPe+pB8yPiMjltpEcsMTl/H8g7d/Q5cZtma7uAb/HIf5jFCNuHyx5jXvK0740ttIxd VxgRZr8uZdGQI/quSbU2l+qMHgLal+DmwO2Fee0yoEFu5zZK2wvCdmfUCjFoEaGYjxon mlcxoawu7tUkSEqQmAIJx8gXiYBTjjkvoHP+ed1Fv3dLpmUtDDStLV5YpJdfapSSiwjp cqfEvWMvspkZltcc6ZzFS/yazVljv/GdfgUZB423+MgDfPCxZtKLJnqRAzZSYEu5n2e3 OFBoe4qdx62J8wcdseqjIiCqOXfI/VWIbmJK2cMIG/F6GaCGXjugvlCLLCN7QUuLNQK/ xzrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Q9aJ/VK0rM/yTCrq/7HYUan28YvSVxEkpw9slVa2TMQ=; b=OnLKQXM6hrPUZhsyruwVObkoS8KnBosxfr3q5IO/eF1sVBrT8CdLy8zFyXi3f0Yimo +8MoI6V/8/ehiJJk13/iCNeziPn6Nim8QGamdFbI04SIf3j1NmRZMfoMTPEXSYwJCzEN 2U+ggWP9cXgQ18HsUh5069Nr9tCLQci5Qh+SLk6LuMfOzfu+u5LbYv4RPPjSHiYhK6U4 7H24R5wghiKKo8Jo6d6W1H6P5NEvrTjsSJVEUfX6t35Zd/LBX4w3lItkLgcH7YkLvvx4 q6lJOr1ER4Pbx4VVtDv3gkMvmJMaiAZdXwp/UrJXJtqFeGHar+iZBeg/BhsfOokki+mG 2Wtg== X-Gm-Message-State: AOAM532fh9O/EkNYovLm1Tm1+IRcO5UR7jaSSytIaBibZMEgt4M1413E CyLP9zakSzo35gOPNY4jaqk= X-Google-Smtp-Source: ABdhPJx6Mn98eisuIHatw0Pf+d4TSn9OWAxJuH50vP3FRLlm8Ry0cdHW963eiP/vpPZLJURg0g9DdQ== X-Received: by 2002:a17:90a:670a:: with SMTP id n10mr4560300pjj.101.1617213138342; Wed, 31 Mar 2021 10:52:18 -0700 (PDT) Received: from edumazet1.svl.corp.google.com ([2620:15c:2c4:201:9107:b184:4a71:45d0]) by smtp.gmail.com with ESMTPSA id q17sm3319028pfq.171.2021.03.31.10.52.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Mar 2021 10:52:18 -0700 (PDT) From: Eric Dumazet To: "David S . Miller" , Jakub Kicinski Cc: netdev , Eric Dumazet , Eric Dumazet Subject: [PATCH net-next 1/9] inet: shrink inet_timewait_death_row by 48 bytes Date: Wed, 31 Mar 2021 10:52:05 -0700 Message-Id: <20210331175213.691460-2-eric.dumazet@gmail.com> X-Mailer: git-send-email 2.31.0.291.g576ba9dcdaf-goog In-Reply-To: <20210331175213.691460-1-eric.dumazet@gmail.com> References: <20210331175213.691460-1-eric.dumazet@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Eric Dumazet struct inet_timewait_death_row uses two cache lines, because we want tw_count to use a full cache line to avoid false sharing. Rework its definition and placement in netns_ipv4 so that: 1) We add 60 bytes of padding after tw_count to avoid false sharing, knowing that tcp_death_row will have ____cacheline_aligned_in_smp attribute. 2) We do not risk padding before tcp_death_row, because we move it at the beginning of netns_ipv4, even if new fields are added later. 3) We do not waste 48 bytes of padding after it. Note that I have not changed dccp. pahole result for struct netns_ipv4 before/after the patch : /* size: 832, cachelines: 13, members: 139 */ /* sum members: 721, holes: 12, sum holes: 95 */ /* padding: 16 */ /* paddings: 2, sum paddings: 55 */ -> /* size: 768, cachelines: 12, members: 139 */ /* sum members: 673, holes: 11, sum holes: 39 */ /* padding: 56 */ /* paddings: 2, sum paddings: 7 */ /* forced alignments: 1 */ Signed-off-by: Eric Dumazet --- include/net/netns/ipv4.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 9c8dd424d79b1d1100b6cbaa64d9fda9352a0b3a..1085ed4e0788d7cd432dfc7e5604ef3cd66dc337 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h @@ -32,14 +32,18 @@ struct inet_hashinfo; struct inet_timewait_death_row { atomic_t tw_count; + char tw_pad[L1_CACHE_BYTES - sizeof(atomic_t)]; - struct inet_hashinfo *hashinfo ____cacheline_aligned_in_smp; + struct inet_hashinfo *hashinfo; int sysctl_max_tw_buckets; }; struct tcp_fastopen_context; struct netns_ipv4 { + /* Please keep tcp_death_row at first field in netns_ipv4 */ + struct inet_timewait_death_row tcp_death_row ____cacheline_aligned_in_smp; + #ifdef CONFIG_SYSCTL struct ctl_table_header *forw_hdr; struct ctl_table_header *frags_hdr; @@ -175,7 +179,6 @@ struct netns_ipv4 { int sysctl_tcp_comp_sack_nr; unsigned long sysctl_tcp_comp_sack_delay_ns; unsigned long sysctl_tcp_comp_sack_slack_ns; - struct inet_timewait_death_row tcp_death_row; int sysctl_max_syn_backlog; int sysctl_tcp_fastopen; const struct tcp_congestion_ops __rcu *tcp_congestion_control; From patchwork Wed Mar 31 17:52:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 12175877 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D825C43462 for ; Wed, 31 Mar 2021 17:53:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5FC8E60FDA for ; Wed, 31 Mar 2021 17:53:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234694AbhCaRw4 (ORCPT ); Wed, 31 Mar 2021 13:52:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234530AbhCaRwU (ORCPT ); Wed, 31 Mar 2021 13:52:20 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C4ADC061574 for ; Wed, 31 Mar 2021 10:52:20 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id y2so8291330plg.5 for ; Wed, 31 Mar 2021 10:52:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8UO2Ozxm1SXKOD6S8TvYVA153uE4XwXKbER1KSQTCbM=; b=r6rBG+8YeWAzuMBEQDW9nxNelToIFlTtA8smGIROx9TXxCOu3qTcEjjMMY3x8nbhVu rhHbqsvozpQD59H3agUAozaHg+1vVKCuR1Ls8hSmAH/AcslKtyfrXsZ/KuZ9uqLqDTc1 b2RJmToADVg4ybtLcZp6mWq1amwymG1CXYCDgCAOqDSPtQzaMpLqN9PPYmyfXakROWcC 7lLdZS9PZQjgznDTNM49wSqdR3wnD1IyC/kiSKN+49c+PVizVtq23TxwwGyR4YkqLFV3 UFNbW3OqMwtc8LpZN3kdg+Yk5mNjsO2XnomXJ9l/dq5S/3t0PooSedoA71VxmBtpUWGh lnvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8UO2Ozxm1SXKOD6S8TvYVA153uE4XwXKbER1KSQTCbM=; b=WMDDgfFhzfE3eRXzMNMDb1dwcxrQSy9syrJ0/RMCajeRoAxAAmUZx4xLQXgl5qpozB lSb7jxsLuUqarOBfv1mwvntvuN/SQKAn0Wu/1MH8J3AWciovlZXXgqRrzTTORL10ZWL7 Qcw2QFpk9IZNtIuLSuytxf+lRhF+Uq0ASuGLQ4I2fkLcTntvIHKYXuGsjo2ltEqTstvz LrUD8VrX4MFAn9XIIjQQzP0oFLvDSo7AizkFQgCP+ri7wSCnsEbsRi3zK973cQsoSQMb 8EdSACEOrJeVoK/32xh8QeA1X/f/675hYJ+6JmQPHOPeS9QK7FHrRKR1v0Mz8TCF8H13 S6Lg== X-Gm-Message-State: AOAM5330vFBe2sRhYod3pqa2GJSE/iY4QeKtGKcrxm1BkXqyWZkqzxio 2a7YMOWdWg7aEONKlMAQqUA= X-Google-Smtp-Source: ABdhPJxptNEjIbqvQ71NnFYMm0lMLU5fBIXc7Xue+KhYkeO1Dq5l7tNrOQDf4Hm/EtcW9vIb+F3vhA== X-Received: by 2002:a17:90a:bd09:: with SMTP id y9mr4501105pjr.179.1617213140074; Wed, 31 Mar 2021 10:52:20 -0700 (PDT) Received: from edumazet1.svl.corp.google.com ([2620:15c:2c4:201:9107:b184:4a71:45d0]) by smtp.gmail.com with ESMTPSA id q17sm3319028pfq.171.2021.03.31.10.52.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Mar 2021 10:52:19 -0700 (PDT) From: Eric Dumazet To: "David S . Miller" , Jakub Kicinski Cc: netdev , Eric Dumazet , Eric Dumazet Subject: [PATCH net-next 2/9] inet: shrink netns_ipv4 by another cache line Date: Wed, 31 Mar 2021 10:52:06 -0700 Message-Id: <20210331175213.691460-3-eric.dumazet@gmail.com> X-Mailer: git-send-email 2.31.0.291.g576ba9dcdaf-goog In-Reply-To: <20210331175213.691460-1-eric.dumazet@gmail.com> References: <20210331175213.691460-1-eric.dumazet@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Eric Dumazet By shuffling around some fields to remove 8 bytes of hole, we can save one cache line. pahole result before/after the patch : /* size: 768, cachelines: 12, members: 139 */ /* sum members: 673, holes: 11, sum holes: 39 */ /* padding: 56 */ /* paddings: 2, sum paddings: 7 */ /* forced alignments: 1 */ -> /* size: 704, cachelines: 11, members: 139 */ /* sum members: 673, holes: 10, sum holes: 31 */ /* paddings: 2, sum paddings: 7 */ /* forced alignments: 1 */ Signed-off-by: Eric Dumazet --- include/net/netns/ipv4.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 1085ed4e0788d7cd432dfc7e5604ef3cd66dc337..538ed69919dc4d51acfd43c7d6d1fca611fcb003 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h @@ -57,17 +57,17 @@ struct netns_ipv4 { struct mutex ra_mutex; #ifdef CONFIG_IP_MULTIPLE_TABLES struct fib_rules_ops *rules_ops; - bool fib_has_custom_rules; - unsigned int fib_rules_require_fldissect; struct fib_table __rcu *fib_main; struct fib_table __rcu *fib_default; + unsigned int fib_rules_require_fldissect; + bool fib_has_custom_rules; #endif bool fib_has_custom_local_routes; + bool fib_offload_disabled; #ifdef CONFIG_IP_ROUTE_CLASSID int fib_num_tclassid_users; #endif struct hlist_head *fib_table_hash; - bool fib_offload_disabled; struct sock *fibnl; struct sock * __percpu *icmp_sk; From patchwork Wed Mar 31 17:52:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 12175875 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95742C43470 for ; Wed, 31 Mar 2021 17:53:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 70A4361002 for ; Wed, 31 Mar 2021 17:53:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234713AbhCaRw5 (ORCPT ); Wed, 31 Mar 2021 13:52:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234662AbhCaRwW (ORCPT ); Wed, 31 Mar 2021 13:52:22 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4E85C061574 for ; Wed, 31 Mar 2021 10:52:21 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id m11so15077688pfc.11 for ; Wed, 31 Mar 2021 10:52:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M542lfMcaoG0xPmGsnq9ggsaGj5JrxyHQu8s+vU2Zis=; b=eSN9uxaDH74vEVvqV9+7jcShXJS7Yk7VqUS8MwPsXG2MoF2VrDInOqK8722PmTwSa/ mFW/kPKzJKeDDMn8phTOk7S88uf96nndxs+sS1ysJI1GD82eUSevC/gNyvIrt4FXZqeO tP3MkMawK+zkTE2jjFxHDoZOYyIkzhPq0Rvgf4KyjRWZi9+DeE4eRg4JkT5bQHRDTy8R wZq4XUwes87w+kDBzI5LbGShCeleH0nySNQGzaNPranDc2w3Qwsyng2yPPX3fsvTwjmk CoQdTyEJYw02uWnuysT5vWdchAHuerl709j1E1S8lKqGZL8JCUt3HlMpAFdfRYTEjuAy oFqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=M542lfMcaoG0xPmGsnq9ggsaGj5JrxyHQu8s+vU2Zis=; b=Fva9YvE0/EO/KbRvZIOv/8DRmI9aSqtOppRlrkYo89QmXpS1z+454Rc31ZfY3l5nm0 gAJhRwK2/H4DiXxWQl1s7d/8MU3Hx/ecLHNqfJE/6RT85d2Y9wOrn0haVZPMMG8sbu07 yXNcchDKdZMLcA6ErpssRERIEmnworiUX4yNwDtKvymKwQ9ze6LLGLzFYAeS6LrWLTXX UBGp3AQqkrbPxfPQfEAIiZCxTLKVtgTpMoVxACR5xPQFa2Qu3c/uJiQifwEz+JPQ+C/d TN35KdXfiVpnpcGcsTbmFGxpDMjDT3J+ePRBBILY0U0D1cfEIxLxRAdJKrraiBStmHoQ ArtQ== X-Gm-Message-State: AOAM532mrAyVKw51ParYbZmDHkwNMrVIX6UySynjWP2Xpq5E5hEQKRJG deCdCQSGuI5B6ODDX0OprpI= X-Google-Smtp-Source: ABdhPJykndZ2sY5iRCJwwNz/Rg4SjT5YolI9Lo9q2GiEgFZ2CnQilao2fQyhgXOZwyVN4u6zKIlbUA== X-Received: by 2002:a63:6f8a:: with SMTP id k132mr4405472pgc.59.1617213141433; Wed, 31 Mar 2021 10:52:21 -0700 (PDT) Received: from edumazet1.svl.corp.google.com ([2620:15c:2c4:201:9107:b184:4a71:45d0]) by smtp.gmail.com with ESMTPSA id q17sm3319028pfq.171.2021.03.31.10.52.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Mar 2021 10:52:21 -0700 (PDT) From: Eric Dumazet To: "David S . Miller" , Jakub Kicinski Cc: netdev , Eric Dumazet , Eric Dumazet Subject: [PATCH net-next 3/9] ipv4: convert fib_notify_on_flag_change sysctl to u8 Date: Wed, 31 Mar 2021 10:52:07 -0700 Message-Id: <20210331175213.691460-4-eric.dumazet@gmail.com> X-Mailer: git-send-email 2.31.0.291.g576ba9dcdaf-goog In-Reply-To: <20210331175213.691460-1-eric.dumazet@gmail.com> References: <20210331175213.691460-1-eric.dumazet@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Eric Dumazet Reduce footprint of sysctls. Signed-off-by: Eric Dumazet --- include/net/netns/ipv4.h | 2 +- net/ipv4/sysctl_net_ipv4.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 538ed69919dc4d51acfd43c7d6d1fca611fcb003..b187ac597b8ce33376070bcd42c8c935b9c287eb 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h @@ -191,7 +191,7 @@ struct netns_ipv4 { int sysctl_udp_wmem_min; int sysctl_udp_rmem_min; - int sysctl_fib_notify_on_flag_change; + u8 sysctl_fib_notify_on_flag_change; #ifdef CONFIG_NET_L3_MASTER_DEV int sysctl_udp_l3mdev_accept; diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index 9199f507a005efc3f57ca0225d3898bfa5d01c53..a2352d8d88cc9956ac0ddcaf351cbc996fa10add 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c @@ -1364,9 +1364,9 @@ static struct ctl_table ipv4_net_table[] = { { .procname = "fib_notify_on_flag_change", .data = &init_net.ipv4.sysctl_fib_notify_on_flag_change, - .maxlen = sizeof(int), + .maxlen = sizeof(u8), .mode = 0644, - .proc_handler = proc_dointvec_minmax, + .proc_handler = proc_dou8vec_minmax, .extra1 = SYSCTL_ZERO, .extra2 = &two, }, From patchwork Wed Mar 31 17:52:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 12175881 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9688FC43600 for ; Wed, 31 Mar 2021 17:53:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 81C0061041 for ; Wed, 31 Mar 2021 17:53:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234726AbhCaRw6 (ORCPT ); Wed, 31 Mar 2021 13:52:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234680AbhCaRwX (ORCPT ); Wed, 31 Mar 2021 13:52:23 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 386B6C061574 for ; Wed, 31 Mar 2021 10:52:23 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id m7so14706583pgj.8 for ; Wed, 31 Mar 2021 10:52:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pkzDn6X0RCGFonrmehfqTb80AWvyr1DUQQBDfugKISM=; b=NZKPRxQIVIOp7te0u2ckXwQXt8ohwB82XQhxD8A+H3+HhCwQRj38koqyWACXv+USug j4m5voj8LZ2WWWR2s9/8FZXxSHXCUx5P/wHupHEVar6PlhEf6DjhDBNu6DAquIfRzjMb 8YeKgXeDJyu6oDFW4aEsFTNxmObgf/wBynrLrlJnwMRffkT/ZHsXVrwxC9i5/FrUQlx/ wZ0h5GCrjJzCVMIzyGJEqdEHsj5NpgYT90btsGT/QQTe8MmTNhw7bAaTbHWNPmC3W1YN 14yYAH9sX4a5aZc1GFRuBUmNvtzL/xF/4fAwk/IOWE9udQ8tnLfh1hdcDrCuOvw3BBdN PlBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pkzDn6X0RCGFonrmehfqTb80AWvyr1DUQQBDfugKISM=; b=tXWUpF7J+3cCy3O9pChu6zAPN1ot4//XZBF5iwZfyj/Dy2s25Ve/8O8Or1ecO7RKar UNoUFkQR501CZMJ9pM4JRzvRHf469IznX+pHW4LcUdQNxwzaqury1paxwOObOdUujV/s qNqaGjlAvsIifyLW7l8tw/QsSxXS6Mmd2qsKG9UQeOycpbCaBL7wA4u2cQUU3sL8++53 h18dCqAecvpdxK80FRtC9h6b9SkJLJU7s5XpuYAbqf/XD27azaL4hIbh6OOQsrubdmhA iig8DLgz+dLPgU854CKfcsEPDIe8K6C73pKdvVvh4IsGxTBsXU779Iq7ZJhmRKxC7txA ibXQ== X-Gm-Message-State: AOAM530Zb+gVW+VhDybAHHa4YUnOi0q3txgpHvuoSu3yOP2vBeKRrc2g 138zy0KstX/7vIWXBAJx9m4= X-Google-Smtp-Source: ABdhPJw76a/KMbSn6MCmtxbkMqdiXu4ito6yGg6ZrKi3o0Gc9bm/2pn+Uo3Qrj8R8v27JkWJ0rGdbg== X-Received: by 2002:aa7:96f0:0:b029:1f3:97a4:19d2 with SMTP id i16-20020aa796f00000b02901f397a419d2mr3975657pfq.73.1617213142862; Wed, 31 Mar 2021 10:52:22 -0700 (PDT) Received: from edumazet1.svl.corp.google.com ([2620:15c:2c4:201:9107:b184:4a71:45d0]) by smtp.gmail.com with ESMTPSA id q17sm3319028pfq.171.2021.03.31.10.52.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Mar 2021 10:52:22 -0700 (PDT) From: Eric Dumazet To: "David S . Miller" , Jakub Kicinski Cc: netdev , Eric Dumazet , Eric Dumazet Subject: [PATCH net-next 4/9] ipv4: convert udp_l3mdev_accept sysctl to u8 Date: Wed, 31 Mar 2021 10:52:08 -0700 Message-Id: <20210331175213.691460-5-eric.dumazet@gmail.com> X-Mailer: git-send-email 2.31.0.291.g576ba9dcdaf-goog In-Reply-To: <20210331175213.691460-1-eric.dumazet@gmail.com> References: <20210331175213.691460-1-eric.dumazet@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Eric Dumazet Reduce footprint of sysctls. Signed-off-by: Eric Dumazet --- include/net/netns/ipv4.h | 2 +- net/ipv4/sysctl_net_ipv4.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index b187ac597b8ce33376070bcd42c8c935b9c287eb..d309b1b897158c564ac8e07e4ed6826fa6e7c7b7 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h @@ -194,7 +194,7 @@ struct netns_ipv4 { u8 sysctl_fib_notify_on_flag_change; #ifdef CONFIG_NET_L3_MASTER_DEV - int sysctl_udp_l3mdev_accept; + u8 sysctl_udp_l3mdev_accept; #endif int sysctl_igmp_max_memberships; diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index a2352d8d88cc9956ac0ddcaf351cbc996fa10add..1b6ce649a433c6614d9b1ac28d6c6c3daa01a525 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c @@ -1065,9 +1065,9 @@ static struct ctl_table ipv4_net_table[] = { { .procname = "udp_l3mdev_accept", .data = &init_net.ipv4.sysctl_udp_l3mdev_accept, - .maxlen = sizeof(int), + .maxlen = sizeof(u8), .mode = 0644, - .proc_handler = proc_dointvec_minmax, + .proc_handler = proc_dou8vec_minmax, .extra1 = SYSCTL_ZERO, .extra2 = SYSCTL_ONE, }, From patchwork Wed Mar 31 17:52:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 12175883 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5FF6C4360C for ; Wed, 31 Mar 2021 17:53:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A1D8C610A2 for ; Wed, 31 Mar 2021 17:53:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234751AbhCaRw7 (ORCPT ); Wed, 31 Mar 2021 13:52:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234692AbhCaRwY (ORCPT ); Wed, 31 Mar 2021 13:52:24 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A2BDC061574 for ; Wed, 31 Mar 2021 10:52:24 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id m7so14706633pgj.8 for ; Wed, 31 Mar 2021 10:52:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R0IHSRMOjGG2b7EQy7oiUAwODG+2km7NuDei/NzPfLM=; b=IuFDwgO2QU7KptJMfIfnew2rdEHwk/fVIyy5vaTkLd/OuTLzE8rVINrYJR0AMAdNph uSO6r+dLs1o/q4Y5haHSDvBGdPBDwa8catpi43ucYTb9XvtY1TGpiO08DNEEzSNP79IW h7mADR5cHX7I9hndSfmbEQSOYX44jVb7XYpVMnaFZkTcwfEJu1iGY9t4AH3+QNzQPcVH zX+uXWTagtdZVg/A3CzWV3ohm/qYBFZxO8gFwGiaHioT+jAUJ6lmtzQFdD/KgysxZ06Q uy7jWefB33hIcoBgmp6MCA1y4aq8uvHeClWWqDjznxfg1asOF4ellk3P9+rUFU3aaYW8 krPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=R0IHSRMOjGG2b7EQy7oiUAwODG+2km7NuDei/NzPfLM=; b=R99H4G4rSoE/fIPNsLlW2u/pvwr0C6NwKI8RoR8Gwdkb6HQcgfc7SolcNKvUiNgTUH LDpe5JxndE45hG/jShMvJy3NBTxIWOiQZ/7OMHzZtIfsZ3KBrjKiGTu2J2oa+HczYaTc q89H7+JY231+dSGXYJP0N+YiORz0AlFTlGrNdlM4mbNoKygzkiqNWnuhcr8KprCQ46Ub a8LzTFiQPZ2xAm1CSdTK6YKpuFfSOLZssWYcqvJYBd3rswqOSa/JPFFqAINy8o9H8kAA rIy3VZJc6PwJVQanQeXmIsuJ7gvlwE+WukTCp5/Zd37S7rKnBxkPgBKkXSPTbVrp/Iph 5sCQ== X-Gm-Message-State: AOAM532/gP/G4d/inm6/zM3SvaaysgkOe7WAJ4GHrlmCBsUY9D9bBy3X lROERLolD6x6ZKWY4TkdGlT+8abeLUo= X-Google-Smtp-Source: ABdhPJytyi0hLz3zni0I0w9Woct1a+55eWRzxroPBkHOb961tCxlOV8RgRXuCRCkWVALt3lsQgck9w== X-Received: by 2002:a62:800c:0:b029:203:6990:78e2 with SMTP id j12-20020a62800c0000b0290203699078e2mr4045857pfd.3.1617213144245; Wed, 31 Mar 2021 10:52:24 -0700 (PDT) Received: from edumazet1.svl.corp.google.com ([2620:15c:2c4:201:9107:b184:4a71:45d0]) by smtp.gmail.com with ESMTPSA id q17sm3319028pfq.171.2021.03.31.10.52.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Mar 2021 10:52:23 -0700 (PDT) From: Eric Dumazet To: "David S . Miller" , Jakub Kicinski Cc: netdev , Eric Dumazet , Eric Dumazet Subject: [PATCH net-next 5/9] ipv4: convert fib_multipath_{use_neigh|hash_policy} sysctls to u8 Date: Wed, 31 Mar 2021 10:52:09 -0700 Message-Id: <20210331175213.691460-6-eric.dumazet@gmail.com> X-Mailer: git-send-email 2.31.0.291.g576ba9dcdaf-goog In-Reply-To: <20210331175213.691460-1-eric.dumazet@gmail.com> References: <20210331175213.691460-1-eric.dumazet@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Eric Dumazet Make room for better packing of netns_ipv4 Signed-off-by: Eric Dumazet --- include/net/netns/ipv4.h | 4 ++-- net/ipv4/sysctl_net_ipv4.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index d309b1b897158c564ac8e07e4ed6826fa6e7c7b7..eb6ca07d3b0f5a3e0e90eee3e3049c0a0cc31d3d 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h @@ -220,8 +220,8 @@ struct netns_ipv4 { #endif #endif #ifdef CONFIG_IP_ROUTE_MULTIPATH - int sysctl_fib_multipath_use_neigh; - int sysctl_fib_multipath_hash_policy; + u8 sysctl_fib_multipath_use_neigh; + u8 sysctl_fib_multipath_hash_policy; #endif struct fib_notifier_ops *notifier_ops; diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index 1b6ce649a433c6614d9b1ac28d6c6c3daa01a525..ad75d6bb2df7f60afda5c4a4f6524885a8b982c2 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c @@ -456,7 +456,7 @@ static int proc_fib_multipath_hash_policy(struct ctl_table *table, int write, ipv4.sysctl_fib_multipath_hash_policy); int ret; - ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos); + ret = proc_dou8vec_minmax(table, write, buffer, lenp, ppos); if (write && ret == 0) call_netevent_notifiers(NETEVENT_IPV4_MPATH_HASH_UPDATE, net); @@ -1038,16 +1038,16 @@ static struct ctl_table ipv4_net_table[] = { { .procname = "fib_multipath_use_neigh", .data = &init_net.ipv4.sysctl_fib_multipath_use_neigh, - .maxlen = sizeof(int), + .maxlen = sizeof(u8), .mode = 0644, - .proc_handler = proc_dointvec_minmax, + .proc_handler = proc_dou8vec_minmax, .extra1 = SYSCTL_ZERO, .extra2 = SYSCTL_ONE, }, { .procname = "fib_multipath_hash_policy", .data = &init_net.ipv4.sysctl_fib_multipath_hash_policy, - .maxlen = sizeof(int), + .maxlen = sizeof(u8), .mode = 0644, .proc_handler = proc_fib_multipath_hash_policy, .extra1 = SYSCTL_ZERO, From patchwork Wed Mar 31 17:52:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 12175879 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A74A8C43460 for ; Wed, 31 Mar 2021 17:53:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9166860FEA for ; Wed, 31 Mar 2021 17:53:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234772AbhCaRxA (ORCPT ); Wed, 31 Mar 2021 13:53:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233888AbhCaRw0 (ORCPT ); Wed, 31 Mar 2021 13:52:26 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00336C061574 for ; Wed, 31 Mar 2021 10:52:25 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id v23so8296333ple.9 for ; Wed, 31 Mar 2021 10:52:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=q4TBqce8mY6AR+OZQk4qDXOtNAhlIQrUCVWXl872Sls=; b=gm0nOM7Yj+OvFRgkqor3Dm9ylksZJAggFbABomC0kw5GWEqytBNmSrSLWAYdBH8oSG +yIC/cBU6r8zNLkTR/W5llgoBjGdraEiz9zcfEyoiJaWWl++McEK/Dmj+KwdhEMHn01p zcdvieFkXMGHWRVD8bZd6qEq4BWHKDm2qU9dzi2LpqA1dVAswdzBrs5Pul14ifuikpgQ Ysea/KQSI78dOXr7+dgqMU1zDEHaJ3OOt0B44Vp0FXBsz7PW+dp044trLHB3SXlLWNIu HmgZbeWtO/zHM6R064vt79DiBpM0Wc8e8C5TJKXIz5+sFF6rpvlVibAj+bAU2Cy/g7xS xwgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=q4TBqce8mY6AR+OZQk4qDXOtNAhlIQrUCVWXl872Sls=; b=Jf43FoyCx72TVf1RUSKU79v5nwd2oGOK2oU5rRuQJN0hSZyC+Z79bk2ugIpLnPteEZ 1Yksn2OytEiGibnnCP8XXtq7la9CFt7lUErnfE32w1MoOufqCGHQOAL3FBTmIeiztK4x ZPFySmhpyZadbxxL18sLjw7yb2+RLIDofBHdx03HswPawYZKb1GBnk/DqQN+p4+wpJEE Te5weEp8LvWsn6wD0uutqCFLkPp3EPfqKo/ERRSR4NYCooSwTnVhdTBPK7H/p+epclHh rgykGIupiwrLUmGElZhJXXOzc9DzjkknenjhMk1btgUv98h1PmTldiIjj1cIbl9nq1Rw s37w== X-Gm-Message-State: AOAM531qTyGOEJbFpumQ+SU0Lz4mOsrufs+7CPMe/xJe43KE7ag5nPeh ULp2vqXAYh/xPdNm3ZKLFI+nbAWJJIw= X-Google-Smtp-Source: ABdhPJzHAdNnjAbzmF708o83TpjQpA9AQUtbjAkH7Ft0v6t1ilvk6jlDcEyRHP9xNq7aj3sIgBmolQ== X-Received: by 2002:a17:90a:ad87:: with SMTP id s7mr4735739pjq.20.1617213145596; Wed, 31 Mar 2021 10:52:25 -0700 (PDT) Received: from edumazet1.svl.corp.google.com ([2620:15c:2c4:201:9107:b184:4a71:45d0]) by smtp.gmail.com with ESMTPSA id q17sm3319028pfq.171.2021.03.31.10.52.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Mar 2021 10:52:25 -0700 (PDT) From: Eric Dumazet To: "David S . Miller" , Jakub Kicinski Cc: netdev , Eric Dumazet , Eric Dumazet Subject: [PATCH net-next 6/9] ipv4: convert igmp_link_local_mcast_reports sysctl to u8 Date: Wed, 31 Mar 2021 10:52:10 -0700 Message-Id: <20210331175213.691460-7-eric.dumazet@gmail.com> X-Mailer: git-send-email 2.31.0.291.g576ba9dcdaf-goog In-Reply-To: <20210331175213.691460-1-eric.dumazet@gmail.com> References: <20210331175213.691460-1-eric.dumazet@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Eric Dumazet This sysctl is a bool, can use less storage. Signed-off-by: Eric Dumazet --- include/net/netns/ipv4.h | 2 +- net/ipv4/sysctl_net_ipv4.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index eb6ca07d3b0f5a3e0e90eee3e3049c0a0cc31d3d..fafcedf643832d80ebbd3d1c7c0fd8ac0866b99a 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h @@ -197,9 +197,9 @@ struct netns_ipv4 { u8 sysctl_udp_l3mdev_accept; #endif + u8 sysctl_igmp_llm_reports; int sysctl_igmp_max_memberships; int sysctl_igmp_max_msf; - int sysctl_igmp_llm_reports; int sysctl_igmp_qrv; struct ping_group_range ping_group_range; diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index ad75d6bb2df7f60afda5c4a4f6524885a8b982c2..fd2b35065bb21195f65b80d7a815221320f08eb3 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c @@ -848,9 +848,9 @@ static struct ctl_table ipv4_net_table[] = { { .procname = "igmp_link_local_mcast_reports", .data = &init_net.ipv4.sysctl_igmp_llm_reports, - .maxlen = sizeof(int), + .maxlen = sizeof(u8), .mode = 0644, - .proc_handler = proc_dointvec + .proc_handler = proc_dou8vec_minmax, }, { .procname = "igmp_max_memberships", From patchwork Wed Mar 31 17:52:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 12175889 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFBCBC43616 for ; Wed, 31 Mar 2021 17:53:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CEB1561078 for ; Wed, 31 Mar 2021 17:53:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234783AbhCaRxB (ORCPT ); Wed, 31 Mar 2021 13:53:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234035AbhCaRw1 (ORCPT ); Wed, 31 Mar 2021 13:52:27 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D151C061574 for ; Wed, 31 Mar 2021 10:52:27 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id w10so10376668pgh.5 for ; Wed, 31 Mar 2021 10:52:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KcS93CN9ibocXNm9sNE5yWBWRwjFdOh6LiJjZnpXdhI=; b=VT2A0AchhL8mx3MeN8IzzGSvB4x5r8gFLJOFGTU26He6uixfI29hBX4yftlDF0MA0f nfZF3DKHn3lIqJWr7coXlTekQiRd8b3LEe0iDxkhDMv0fL8aIBpZol5FiTu3W6Ay9XSm OS3BEHo1r/MfJwRmJuWHBB3wKjftqOpDcaLXb9PvmDwOGbRMTLGujs5wSRTIsiBSwk/D z979zxQrJV80o2BMHpyziJFQTJZgH+mdqsqHDCFPhvywfA4PyAjJv+lN22A529TlQbCu ILDiZBt8OAmx/hoD3rqizIGcgzRsXANBjC0vZXF0hqouW04YG06LSpE48S25Gzl9n6ZC bi+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KcS93CN9ibocXNm9sNE5yWBWRwjFdOh6LiJjZnpXdhI=; b=lj30gAdSeK/4budUDngi1/iI7viU5qlFXS+2pE8wZQh3LfASi9v4eF5q8WJDu4Im5x ZrNy8b/MRbngdkKM+7fW+D5SDg0JPZFRM6RSenB5BeUK7KbOATXtuO7wbsTg2x8SidQ5 FfjYH2eutYNgj5S4hPCcB/xp2LzO0y/pLGxCcTksVnZ5jIqZKqqin2mkkpXnvdb5Uifq PIBlxFdV+mwsksP2fL/vQJof06ukFK+4gIg2fvIZOd3rQU/lrlPig9I6s5aSNv4uSkCb b8nkpPtLunFPTCKoUXJ+f2ZJ/oydaQpVpjm8YLe/RhGrq8Har7o1/Gs1jZGiy6+OsRiY 1CWg== X-Gm-Message-State: AOAM5302JNNVxrU2Pqk8U+fBZSx8XCJnrIhQVTmVXXJn83h35lBoJbg0 fAAod2IFLEVAxSL82LPM3kg= X-Google-Smtp-Source: ABdhPJyX4y0VZElRQPRz6x+apQ3QItevJNdhs4JTb3RSfUqz/4RE09doPqU/RJWGD5ugZHHjd0gK2g== X-Received: by 2002:a05:6a00:214d:b029:218:4f9:d5ba with SMTP id o13-20020a056a00214db029021804f9d5bamr4008361pfk.3.1617213147264; Wed, 31 Mar 2021 10:52:27 -0700 (PDT) Received: from edumazet1.svl.corp.google.com ([2620:15c:2c4:201:9107:b184:4a71:45d0]) by smtp.gmail.com with ESMTPSA id q17sm3319028pfq.171.2021.03.31.10.52.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Mar 2021 10:52:26 -0700 (PDT) From: Eric Dumazet To: "David S . Miller" , Jakub Kicinski Cc: netdev , Eric Dumazet , Eric Dumazet Subject: [PATCH net-next 7/9] tcp: convert tcp_comp_sack_nr sysctl to u8 Date: Wed, 31 Mar 2021 10:52:11 -0700 Message-Id: <20210331175213.691460-8-eric.dumazet@gmail.com> X-Mailer: git-send-email 2.31.0.291.g576ba9dcdaf-goog In-Reply-To: <20210331175213.691460-1-eric.dumazet@gmail.com> References: <20210331175213.691460-1-eric.dumazet@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Eric Dumazet tcp_comp_sack_nr max value was already 255. Signed-off-by: Eric Dumazet --- include/net/netns/ipv4.h | 2 +- net/ipv4/sysctl_net_ipv4.c | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index fafcedf643832d80ebbd3d1c7c0fd8ac0866b99a..87e1612497eae2fb2c893c6c64d14ad373862f43 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h @@ -171,12 +171,12 @@ struct netns_ipv4 { u8 sysctl_tcp_min_tso_segs; u8 sysctl_tcp_autocorking; u8 sysctl_tcp_reflect_tos; + u8 sysctl_tcp_comp_sack_nr; int sysctl_tcp_invalid_ratelimit; int sysctl_tcp_pacing_ss_ratio; int sysctl_tcp_pacing_ca_ratio; int sysctl_tcp_wmem[3]; int sysctl_tcp_rmem[3]; - int sysctl_tcp_comp_sack_nr; unsigned long sysctl_tcp_comp_sack_delay_ns; unsigned long sysctl_tcp_comp_sack_slack_ns; int sysctl_max_syn_backlog; diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index fd2b35065bb21195f65b80d7a815221320f08eb3..a09e466ce11d04201bb4014e6895243c3bb2abdb 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c @@ -46,7 +46,6 @@ static int tcp_syn_retries_min = 1; static int tcp_syn_retries_max = MAX_TCP_SYNCNT; static int ip_ping_group_range_min[] = { 0, 0 }; static int ip_ping_group_range_max[] = { GID_T_MAX, GID_T_MAX }; -static int comp_sack_nr_max = 255; static u32 u32_max_div_HZ = UINT_MAX / HZ; static int one_day_secs = 24 * 3600; @@ -1330,11 +1329,10 @@ static struct ctl_table ipv4_net_table[] = { { .procname = "tcp_comp_sack_nr", .data = &init_net.ipv4.sysctl_tcp_comp_sack_nr, - .maxlen = sizeof(int), + .maxlen = sizeof(u8), .mode = 0644, - .proc_handler = proc_dointvec_minmax, + .proc_handler = proc_dou8vec_minmax, .extra1 = SYSCTL_ZERO, - .extra2 = &comp_sack_nr_max, }, { .procname = "tcp_reflect_tos", From patchwork Wed Mar 31 17:52:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 12175887 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6883C43603 for ; Wed, 31 Mar 2021 17:53:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B347C60FEA for ; Wed, 31 Mar 2021 17:53:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234798AbhCaRxC (ORCPT ); Wed, 31 Mar 2021 13:53:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234446AbhCaRw3 (ORCPT ); Wed, 31 Mar 2021 13:52:29 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA0E2C061574 for ; Wed, 31 Mar 2021 10:52:28 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id o2so8292948plg.1 for ; Wed, 31 Mar 2021 10:52:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=y2RxIdxDZ1xmeocPl/Q5cWxZLlyOTTwyKQrmeMR1ZsU=; b=B/TM8kmBYMt+t5sqjZUM5xZNCuhdGpMB/JqS4P2iEY5YZqOXRL0HHpGGo/JXVN7P7y gATFDHZWUAa5VAWgh+xA4Zitf4Cb1IC8g/Kh1ClKfj1H+3iA+TPtuIlyXQj8K2DbFuD1 /Q+iUZCG/xf6LPHjRI4BVkP3XC9P0Dgdn6Us+c3OmWk2MGYSLUDAla6nrqbRy+J3smWZ qUARb/1Oo8dPwiesDpKLqppZpsAvQUd2NX96OlIOtz7Ca0zkTj62k5YDtxm862qSwkRm su+rWXvh4p8R9VBUD45OiAjETiIOeBEk5DhNeLYpzuVxjIX/+Qum9MzBPUwU/5MDOcLe rRlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=y2RxIdxDZ1xmeocPl/Q5cWxZLlyOTTwyKQrmeMR1ZsU=; b=Og9+RBrUh93NxV2W8f2jZV+JuxdviEsGUVk5aoxdtptnuG7iH33c4woAO60wnymEJO U9FrkJ7mnHmhUgf11MLXY/QLZYdCRdypyxu7MQ2eo2O98Z+9w0MM76YmGCdrAimQDXKl Ac9PIMZPMgg7y6z4ljNnyRhnFdlZrFhYTIWmkTE7LJ8kq5MqYQv0JsTqKNxU6miUKg6H WKFNppWPNLwflq2ubLODCebrnrPnuCzm95PwTIWwyEyUV6cyhhXxhfavG3iBxLxblUzU 3L0g+EvxkJ+Fpt0FHgCSQ1fjfkwDXdCfLdXaq/GZKn6LAf//Nkapf98eGt9nwD6vBl0g I+2A== X-Gm-Message-State: AOAM533uRzdKApbq4QOMf7eJD9WJXgcarJk5n4NraCOf6GANjbXB4Mpz Zcrl+2vrjFSYmXc/bItRgGE4s5SW1zA= X-Google-Smtp-Source: ABdhPJwFDk3D15Z/xECXiZjh+rerRnQd4UmkHszxZA/MebJcsBU2FDt4rQWoYQny8/d1xFIPmBoMpQ== X-Received: by 2002:a17:90b:244:: with SMTP id fz4mr4514424pjb.137.1617213148511; Wed, 31 Mar 2021 10:52:28 -0700 (PDT) Received: from edumazet1.svl.corp.google.com ([2620:15c:2c4:201:9107:b184:4a71:45d0]) by smtp.gmail.com with ESMTPSA id q17sm3319028pfq.171.2021.03.31.10.52.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Mar 2021 10:52:28 -0700 (PDT) From: Eric Dumazet To: "David S . Miller" , Jakub Kicinski Cc: netdev , Eric Dumazet , Eric Dumazet Subject: [PATCH net-next 8/9] ipv6: convert elligible sysctls to u8 Date: Wed, 31 Mar 2021 10:52:12 -0700 Message-Id: <20210331175213.691460-9-eric.dumazet@gmail.com> X-Mailer: git-send-email 2.31.0.291.g576ba9dcdaf-goog In-Reply-To: <20210331175213.691460-1-eric.dumazet@gmail.com> References: <20210331175213.691460-1-eric.dumazet@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Eric Dumazet Convert most sysctls that can fit in a byte. Signed-off-by: Eric Dumazet --- include/net/netns/ipv6.h | 24 ++++++++++++------------ net/ipv6/icmp.c | 12 ++++++------ net/ipv6/sysctl_net_ipv6.c | 38 ++++++++++++++++++-------------------- 3 files changed, 36 insertions(+), 38 deletions(-) diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h index 21c0debbd39ee34fb029746b0920961747dc41fa..84f4a8bec397dc5a15d84fae118cda33d87671bb 100644 --- a/include/net/netns/ipv6.h +++ b/include/net/netns/ipv6.h @@ -20,7 +20,6 @@ struct netns_sysctl_ipv6 { struct ctl_table_header *frags_hdr; struct ctl_table_header *xfrm6_hdr; #endif - int bindv6only; int flush_delay; int ip6_rt_max_size; int ip6_rt_gc_min_interval; @@ -29,21 +28,22 @@ struct netns_sysctl_ipv6 { int ip6_rt_gc_elasticity; int ip6_rt_mtu_expires; int ip6_rt_min_advmss; - int multipath_hash_policy; - int flowlabel_consistency; - int auto_flowlabels; + u8 bindv6only; + u8 multipath_hash_policy; + u8 flowlabel_consistency; + u8 auto_flowlabels; int icmpv6_time; - int icmpv6_echo_ignore_all; - int icmpv6_echo_ignore_multicast; - int icmpv6_echo_ignore_anycast; + u8 icmpv6_echo_ignore_all; + u8 icmpv6_echo_ignore_multicast; + u8 icmpv6_echo_ignore_anycast; DECLARE_BITMAP(icmpv6_ratemask, ICMPV6_MSG_MAX + 1); unsigned long *icmpv6_ratemask_ptr; - int anycast_src_echo_reply; - int ip_nonlocal_bind; - int fwmark_reflect; + u8 anycast_src_echo_reply; + u8 ip_nonlocal_bind; + u8 fwmark_reflect; + u8 flowlabel_state_ranges; int idgen_retries; int idgen_delay; - int flowlabel_state_ranges; int flowlabel_reflect; int max_dst_opts_cnt; int max_hbh_opts_cnt; @@ -51,7 +51,7 @@ struct netns_sysctl_ipv6 { int max_hbh_opts_len; int seg6_flowlabel; bool skip_notify_on_dev_down; - int fib_notify_on_flag_change; + u8 fib_notify_on_flag_change; }; struct netns_ipv6 { diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index 29d38d6b55fb3c6587d3813c606c3813d789ad62..1bca2b09d77e64e4dd6177afe4765c53d3b18c05 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c @@ -1169,23 +1169,23 @@ static struct ctl_table ipv6_icmp_table_template[] = { { .procname = "echo_ignore_all", .data = &init_net.ipv6.sysctl.icmpv6_echo_ignore_all, - .maxlen = sizeof(int), + .maxlen = sizeof(u8), .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_dou8vec_minmax, }, { .procname = "echo_ignore_multicast", .data = &init_net.ipv6.sysctl.icmpv6_echo_ignore_multicast, - .maxlen = sizeof(int), + .maxlen = sizeof(u8), .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_dou8vec_minmax, }, { .procname = "echo_ignore_anycast", .data = &init_net.ipv6.sysctl.icmpv6_echo_ignore_anycast, - .maxlen = sizeof(int), + .maxlen = sizeof(u8), .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_dou8vec_minmax, }, { .procname = "ratemask", diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c index 263ab43ed06bc964431235df8ff524ce74be5922..27102c3d6e1da00c194b43259d6db5b38234833a 100644 --- a/net/ipv6/sysctl_net_ipv6.c +++ b/net/ipv6/sysctl_net_ipv6.c @@ -23,7 +23,6 @@ static int two = 2; static int flowlabel_reflect_max = 0x7; -static int auto_flowlabels_min; static int auto_flowlabels_max = IP6_AUTO_FLOW_LABEL_MAX; static int proc_rt6_multipath_hash_policy(struct ctl_table *table, int write, @@ -34,7 +33,7 @@ static int proc_rt6_multipath_hash_policy(struct ctl_table *table, int write, net = container_of(table->data, struct net, ipv6.sysctl.multipath_hash_policy); - ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos); + ret = proc_dou8vec_minmax(table, write, buffer, lenp, ppos); if (write && ret == 0) call_netevent_notifiers(NETEVENT_IPV6_MPATH_HASH_UPDATE, net); @@ -45,39 +44,38 @@ static struct ctl_table ipv6_table_template[] = { { .procname = "bindv6only", .data = &init_net.ipv6.sysctl.bindv6only, - .maxlen = sizeof(int), + .maxlen = sizeof(u8), .mode = 0644, - .proc_handler = proc_dointvec + .proc_handler = proc_dou8vec_minmax, }, { .procname = "anycast_src_echo_reply", .data = &init_net.ipv6.sysctl.anycast_src_echo_reply, - .maxlen = sizeof(int), + .maxlen = sizeof(u8), .mode = 0644, - .proc_handler = proc_dointvec + .proc_handler = proc_dou8vec_minmax, }, { .procname = "flowlabel_consistency", .data = &init_net.ipv6.sysctl.flowlabel_consistency, - .maxlen = sizeof(int), + .maxlen = sizeof(u8), .mode = 0644, - .proc_handler = proc_dointvec + .proc_handler = proc_dou8vec_minmax, }, { .procname = "auto_flowlabels", .data = &init_net.ipv6.sysctl.auto_flowlabels, - .maxlen = sizeof(int), + .maxlen = sizeof(u8), .mode = 0644, - .proc_handler = proc_dointvec_minmax, - .extra1 = &auto_flowlabels_min, + .proc_handler = proc_dou8vec_minmax, .extra2 = &auto_flowlabels_max }, { .procname = "fwmark_reflect", .data = &init_net.ipv6.sysctl.fwmark_reflect, - .maxlen = sizeof(int), + .maxlen = sizeof(u8), .mode = 0644, - .proc_handler = proc_dointvec + .proc_handler = proc_dou8vec_minmax, }, { .procname = "idgen_retries", @@ -96,16 +94,16 @@ static struct ctl_table ipv6_table_template[] = { { .procname = "flowlabel_state_ranges", .data = &init_net.ipv6.sysctl.flowlabel_state_ranges, - .maxlen = sizeof(int), + .maxlen = sizeof(u8), .mode = 0644, - .proc_handler = proc_dointvec + .proc_handler = proc_dou8vec_minmax, }, { .procname = "ip_nonlocal_bind", .data = &init_net.ipv6.sysctl.ip_nonlocal_bind, - .maxlen = sizeof(int), + .maxlen = sizeof(u8), .mode = 0644, - .proc_handler = proc_dointvec + .proc_handler = proc_dou8vec_minmax, }, { .procname = "flowlabel_reflect", @@ -147,7 +145,7 @@ static struct ctl_table ipv6_table_template[] = { { .procname = "fib_multipath_hash_policy", .data = &init_net.ipv6.sysctl.multipath_hash_policy, - .maxlen = sizeof(int), + .maxlen = sizeof(u8), .mode = 0644, .proc_handler = proc_rt6_multipath_hash_policy, .extra1 = SYSCTL_ZERO, @@ -163,9 +161,9 @@ static struct ctl_table ipv6_table_template[] = { { .procname = "fib_notify_on_flag_change", .data = &init_net.ipv6.sysctl.fib_notify_on_flag_change, - .maxlen = sizeof(int), + .maxlen = sizeof(u8), .mode = 0644, - .proc_handler = proc_dointvec_minmax, + .proc_handler = proc_dou8vec_minmax, .extra1 = SYSCTL_ZERO, .extra2 = &two, }, From patchwork Wed Mar 31 17:52:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 12175885 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19652C43611 for ; Wed, 31 Mar 2021 17:53:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E51056108B for ; Wed, 31 Mar 2021 17:53:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234817AbhCaRxD (ORCPT ); Wed, 31 Mar 2021 13:53:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234514AbhCaRwa (ORCPT ); Wed, 31 Mar 2021 13:52:30 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3721DC061574 for ; Wed, 31 Mar 2021 10:52:30 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id x7-20020a17090a2b07b02900c0ea793940so1581502pjc.2 for ; Wed, 31 Mar 2021 10:52:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5uLhSHaWYKzXQJcTFkj0+rCG5g90ufvbrRzEZYu+vmg=; b=Y+zp9ECcLwjZOpO+YSq7Fy/0pQpiG8QSEyC4aCLixHYxvsXqQKGOD2HRElDUHaktk+ PmnUQMcmh1FHnTT8nXGQVQBFfY7tL53vJpZaArZfMKWz5xcZjc9Ji0V2YkvnoTCPIvHp 1WRtdJVbbCegXt/Q2pLs0WPs4DO1p8x5NLDwo+/rd3/ysh7tYjGMXz99R8/a4UxY/UYD g3yKDiP+yxLpu5vo93FGgs8fYWS5GVVhA+Dt109I9NgivstQGQ/+LPhj/Ofq5L7JBTne 1NLpmtr4jC6zVo9lvDR+eYPynq5lNyfWYp/AkUI2SH+wvIFlyzFuq5Q0zIWL/gtR2Z+0 HJCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5uLhSHaWYKzXQJcTFkj0+rCG5g90ufvbrRzEZYu+vmg=; b=AVVT/GVxLyHyvIunlBjEppDWjF+3hk7MiBrtWk5jv/HQ9w7zpGqV6kleTzL0Mr/FYZ 7OtlXvFrQG/177L5X9eA244zAaRBo4HbE+KChRPKh0f+lbIk1Bc2yASQzzjEFxqcnt+e G9NoP92Mhpa3rsb0e3x9do+SCvsbqf77bdQHFRYJy9aj5fzEsTWtWU5XLEke7SOsnchV adrpg+npM0c9xs5/HhUESWlIQg0UCMfx0/8Ag0xVzYJNtj1tecMxt5rws3Reu2I3yhV6 stMc7Tg1s3UxxdH+udLTXyhdhex6fhk3AmDv4sQAnQhAMFOPUmJdjSumEGX1Sukn4a3x mLTg== X-Gm-Message-State: AOAM530HX+Ie6ZxnFkJF6hoM4tWfsyNowpBeeU3g1KHkMXiek4wpeimx /dLEXhGqIn7yJfGetO6uUgE= X-Google-Smtp-Source: ABdhPJzHYLnm/eiTEXMIOlnskACHKtqqWqpkWvtwUG4gICsZX1y9q3BKNz+y+Lmj+xsF9Zh+lyKPIA== X-Received: by 2002:a17:90b:608:: with SMTP id gb8mr4549363pjb.121.1617213149868; Wed, 31 Mar 2021 10:52:29 -0700 (PDT) Received: from edumazet1.svl.corp.google.com ([2620:15c:2c4:201:9107:b184:4a71:45d0]) by smtp.gmail.com with ESMTPSA id q17sm3319028pfq.171.2021.03.31.10.52.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Mar 2021 10:52:29 -0700 (PDT) From: Eric Dumazet To: "David S . Miller" , Jakub Kicinski Cc: netdev , Eric Dumazet , Eric Dumazet Subject: [PATCH net-next 9/9] ipv6: move ip6_dst_ops first in netns_ipv6 Date: Wed, 31 Mar 2021 10:52:13 -0700 Message-Id: <20210331175213.691460-10-eric.dumazet@gmail.com> X-Mailer: git-send-email 2.31.0.291.g576ba9dcdaf-goog In-Reply-To: <20210331175213.691460-1-eric.dumazet@gmail.com> References: <20210331175213.691460-1-eric.dumazet@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Eric Dumazet ip6_dst_ops have cache line alignement. Moving it at beginning of netns_ipv6 removes a 48 byte hole, and shrinks netns_ipv6 from 12 to 11 cache lines. Signed-off-by: Eric Dumazet --- include/net/netns/ipv6.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h index 84f4a8bec397dc5a15d84fae118cda33d87671bb..808f0f79ea9c9b9094dc94b71e295e26a9202ad1 100644 --- a/include/net/netns/ipv6.h +++ b/include/net/netns/ipv6.h @@ -55,6 +55,9 @@ struct netns_sysctl_ipv6 { }; struct netns_ipv6 { + /* Keep ip6_dst_ops at the beginning of netns_sysctl_ipv6 */ + struct dst_ops ip6_dst_ops; + struct netns_sysctl_ipv6 sysctl; struct ipv6_devconf *devconf_all; struct ipv6_devconf *devconf_dflt; @@ -76,7 +79,6 @@ struct netns_ipv6 { struct hlist_head *fib_table_hash; struct fib6_table *fib6_main_tbl; struct list_head fib6_walkers; - struct dst_ops ip6_dst_ops; rwlock_t fib6_walker_lock; spinlock_t fib6_gc_lock; unsigned int ip6_rt_gc_expire;