Thread (24 messages) 24 messages, 4 authors, 2024-10-31

RE: [PATCH v4 net-next 14/14] net: sysctl: introduce sysctl SYSCTL_FIVE

From: Chia-Yu Chang (Nokia) <hidden>
Date: 2024-10-31 15:44:10
Also in: bpf, linux-fsdevel, netfilter-devel

Hi Paolo and Joel,

	We will remove this patch as we check this will be only used by tcp_ecn in the upcoming patch.

Brs,
Chia-Yu

-----Original Message-----
From: Joel Granados <joel.granados@kernel.org> 
Sent: Thursday, October 31, 2024 3:09 PM
To: Chia-Yu Chang (Nokia) <redacted>
Cc: netdev@vger.kernel.org; davem@davemloft.net; edumazet@google.com; kuba@kernel.org; pabeni@redhat.com; dsahern@kernel.org; netfilter-devel@vger.kernel.org; kadlec@netfilter.org; coreteam@netfilter.org; pablo@netfilter.org; bpf@vger.kernel.org; linux-fsdevel@vger.kernel.org; kees@kernel.org; mcgrof@kernel.org; ij@kernel.org; ncardwell@google.com; Koen De Schepper (Nokia) <redacted>; g.white@cablelabs.com; ingemar.s.johansson@ericsson.com; mirja.kuehlewind@ericsson.com; cheshire@apple.com; rs.ietf@gmx.at; Jason_Livingood@comcast.com; vidhi_goel@apple.com
Subject: Re: [PATCH v4 net-next 14/14] net: sysctl: introduce sysctl SYSCTL_FIVE

[Some people who received this message don't often get email from joel.granados@kernel.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

CAUTION: This is an external email. Please be very careful when clicking links or opening attachments. See the URL nok.it/ext for additional information.



On Mon, Oct 21, 2024 at 11:59:10PM +0200, chia-yu.chang@nokia-bell-labs.com wrote:
quoted hunk ↗ jump to hunk
From: Chia-Yu Chang <redacted>

Add SYSCTL_FIVE for new AccECN feedback modes of net.ipv4.tcp_ecn.

Signed-off-by: Chia-Yu Chang <redacted>
---
 include/linux/sysctl.h | 17 +++++++++--------
 kernel/sysctl.c        |  3 ++-
 2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 
aa4c6d44aaa0..37c95a70c10e 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -37,21 +37,22 @@ struct ctl_table_root;  struct ctl_table_header;  
struct ctl_dir;

-/* Keep the same order as in fs/proc/proc_sysctl.c */
+/* Keep the same order as in kernel/sysctl.c */
 #define SYSCTL_ZERO                  ((void *)&sysctl_vals[0])
 #define SYSCTL_ONE                   ((void *)&sysctl_vals[1])
 #define SYSCTL_TWO                   ((void *)&sysctl_vals[2])
 #define SYSCTL_THREE                 ((void *)&sysctl_vals[3])
 #define SYSCTL_FOUR                  ((void *)&sysctl_vals[4])
-#define SYSCTL_ONE_HUNDRED           ((void *)&sysctl_vals[5])
-#define SYSCTL_TWO_HUNDRED           ((void *)&sysctl_vals[6])
-#define SYSCTL_ONE_THOUSAND          ((void *)&sysctl_vals[7])
-#define SYSCTL_THREE_THOUSAND                ((void *)&sysctl_vals[8])
-#define SYSCTL_INT_MAX                       ((void *)&sysctl_vals[9])
+#define SYSCTL_FIVE                  ((void *)&sysctl_vals[5])
Is it necessary to insert the value instead of appending it to the end of sysctl_vals? I would actually consider Paolo Abeni's suggestion to just use a constant if you are using it only in one place.
quoted hunk ↗ jump to hunk
+#define SYSCTL_ONE_HUNDRED           ((void *)&sysctl_vals[6])
+#define SYSCTL_TWO_HUNDRED           ((void *)&sysctl_vals[7])
+#define SYSCTL_ONE_THOUSAND          ((void *)&sysctl_vals[8])
+#define SYSCTL_THREE_THOUSAND                ((void *)&sysctl_vals[9])
+#define SYSCTL_INT_MAX                       ((void *)&sysctl_vals[10])

 /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
-#define SYSCTL_MAXOLDUID             ((void *)&sysctl_vals[10])
-#define SYSCTL_NEG_ONE                       ((void *)&sysctl_vals[11])
+#define SYSCTL_MAXOLDUID             ((void *)&sysctl_vals[11])
+#define SYSCTL_NEG_ONE                       ((void *)&sysctl_vals[12])

 extern const int sysctl_vals[];
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 
79e6cb1d5c48..68b6ca67a0c6 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -82,7 +82,8 @@
 #endif

 /* shared constants to be used in various sysctls */ -const int 
sysctl_vals[] = { 0, 1, 2, 3, 4, 100, 200, 1000, 3000, INT_MAX, 65535, 
-1 };
+const int sysctl_vals[] = { 0, 1, 2, 3, 4, 5, 100, 200, 1000, 3000, INT_MAX,
+                        65535, -1 };
 EXPORT_SYMBOL(sysctl_vals);

 const unsigned long sysctl_long_vals[] = { 0, 1, LONG_MAX };
--
2.34.1
--

Joel Granados
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help