* [PATCH net-next] tcp: move sysctl_tcp_l3mdev_accept to netns_ipv4_read_rx
@ 2024-10-09 15:05 Eric Dumazet
2024-10-09 15:12 ` David Ahern
2024-10-10 2:58 ` Jakub Kicinski
0 siblings, 2 replies; 4+ messages in thread
From: Eric Dumazet @ 2024-10-09 15:05 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: David Ahern, netdev, eric.dumazet, Eric Dumazet, Wei Wang,
Coco Li
sysctl_tcp_l3mdev_accept is read from TCP receive fast path from
tcp_v6_early_demux(),
__inet6_lookup_established,
inet_request_bound_dev_if().
Move it to netns_ipv4_read_rx.
Remove the '#ifdef CONFIG_NET_L3_MASTER_DEV' that was guarding
its definition.
Note this adds a hole of three bytes that could be filled later.
Fixes: 18fd64d25422 ("netns-ipv4: reorganize netns_ipv4 fast path variables")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Wei Wang <weiwan@google.com>
Cc: Coco Li <lixiaoyan@google.com>
---
.../networking/net_cachelines/netns_ipv4_sysctl.rst | 2 +-
include/net/netns/ipv4.h | 5 ++---
net/core/net_namespace.c | 4 +++-
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/Documentation/networking/net_cachelines/netns_ipv4_sysctl.rst b/Documentation/networking/net_cachelines/netns_ipv4_sysctl.rst
index 9b87089a84c61eddaa4e048da6cbb68c5e934ad6..b9855d95fc0d189db65aebae92564336ddeae7bd 100644
--- a/Documentation/networking/net_cachelines/netns_ipv4_sysctl.rst
+++ b/Documentation/networking/net_cachelines/netns_ipv4_sysctl.rst
@@ -58,7 +58,7 @@ u8 sysctl_udp_early_demux
u8 sysctl_nexthop_compat_mode - -
u8 sysctl_fwmark_reflect - -
u8 sysctl_tcp_fwmark_accept - -
-u8 sysctl_tcp_l3mdev_accept - -
+u8 sysctl_tcp_l3mdev_accept - read_mostly __inet6_lookup_established/inet_request_bound_dev_if
u8 sysctl_tcp_mtu_probing - -
int sysctl_tcp_mtu_probe_floor - -
int sysctl_tcp_base_mss - -
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index 276f622f3516871c438be27bafe61c039445b335..42866649901e36fbdd4e9f55645b22bdb6f86891 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -76,6 +76,8 @@ struct netns_ipv4 {
__cacheline_group_begin(netns_ipv4_read_rx);
u8 sysctl_ip_early_demux;
u8 sysctl_tcp_early_demux;
+ u8 sysctl_tcp_l3mdev_accept;
+ /* 3 bytes hole, try to pack */
int sysctl_tcp_reordering;
int sysctl_tcp_rmem[3];
__cacheline_group_end(netns_ipv4_read_rx);
@@ -151,9 +153,6 @@ struct netns_ipv4 {
u8 sysctl_fwmark_reflect;
u8 sysctl_tcp_fwmark_accept;
-#ifdef CONFIG_NET_L3_MASTER_DEV
- u8 sysctl_tcp_l3mdev_accept;
-#endif
u8 sysctl_tcp_mtu_probing;
int sysctl_tcp_mtu_probe_floor;
int sysctl_tcp_base_mss;
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index a5bc1fd8b0341f401b6b48ea7c26b2ac07d1ddb6..0a86aff17f512bbeaa2795ab56748d8bb3b3fb71 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -1159,11 +1159,13 @@ static void __init netns_ipv4_struct_check(void)
sysctl_ip_early_demux);
CACHELINE_ASSERT_GROUP_MEMBER(struct netns_ipv4, netns_ipv4_read_rx,
sysctl_tcp_early_demux);
+ CACHELINE_ASSERT_GROUP_MEMBER(struct netns_ipv4, netns_ipv4_read_rx,
+ sysctl_tcp_l3mdev_accept);
CACHELINE_ASSERT_GROUP_MEMBER(struct netns_ipv4, netns_ipv4_read_rx,
sysctl_tcp_reordering);
CACHELINE_ASSERT_GROUP_MEMBER(struct netns_ipv4, netns_ipv4_read_rx,
sysctl_tcp_rmem);
- CACHELINE_ASSERT_GROUP_SIZE(struct netns_ipv4, netns_ipv4_read_rx, 18);
+ CACHELINE_ASSERT_GROUP_SIZE(struct netns_ipv4, netns_ipv4_read_rx, 22);
}
#endif
--
2.47.0.rc0.187.ge670bccf7e-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] tcp: move sysctl_tcp_l3mdev_accept to netns_ipv4_read_rx
2024-10-09 15:05 [PATCH net-next] tcp: move sysctl_tcp_l3mdev_accept to netns_ipv4_read_rx Eric Dumazet
@ 2024-10-09 15:12 ` David Ahern
2024-10-10 2:58 ` Jakub Kicinski
1 sibling, 0 replies; 4+ messages in thread
From: David Ahern @ 2024-10-09 15:12 UTC (permalink / raw)
To: Eric Dumazet, David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: netdev, eric.dumazet, Wei Wang, Coco Li
On 10/9/24 9:05 AM, Eric Dumazet wrote:
> sysctl_tcp_l3mdev_accept is read from TCP receive fast path from
> tcp_v6_early_demux(),
> __inet6_lookup_established,
> inet_request_bound_dev_if().
>
> Move it to netns_ipv4_read_rx.
>
> Remove the '#ifdef CONFIG_NET_L3_MASTER_DEV' that was guarding
> its definition.
>
> Note this adds a hole of three bytes that could be filled later.
>
> Fixes: 18fd64d25422 ("netns-ipv4: reorganize netns_ipv4 fast path variables")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Wei Wang <weiwan@google.com>
> Cc: Coco Li <lixiaoyan@google.com>
> ---
> .../networking/net_cachelines/netns_ipv4_sysctl.rst | 2 +-
> include/net/netns/ipv4.h | 5 ++---
> net/core/net_namespace.c | 4 +++-
> 3 files changed, 6 insertions(+), 5 deletions(-)
>
Reviewed-by: David Ahern <dsahern@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] tcp: move sysctl_tcp_l3mdev_accept to netns_ipv4_read_rx
2024-10-09 15:05 [PATCH net-next] tcp: move sysctl_tcp_l3mdev_accept to netns_ipv4_read_rx Eric Dumazet
2024-10-09 15:12 ` David Ahern
@ 2024-10-10 2:58 ` Jakub Kicinski
2024-10-10 3:33 ` Eric Dumazet
1 sibling, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2024-10-10 2:58 UTC (permalink / raw)
To: Eric Dumazet
Cc: David S . Miller, Paolo Abeni, David Ahern, netdev, eric.dumazet,
Wei Wang, Coco Li
On Wed, 9 Oct 2024 15:05:04 +0000 Eric Dumazet wrote:
> .../networking/net_cachelines/netns_ipv4_sysctl.rst | 2 +-
This will need a respin, I applied the formatting changes from Donald.
--
pw-bot: cr
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] tcp: move sysctl_tcp_l3mdev_accept to netns_ipv4_read_rx
2024-10-10 2:58 ` Jakub Kicinski
@ 2024-10-10 3:33 ` Eric Dumazet
0 siblings, 0 replies; 4+ messages in thread
From: Eric Dumazet @ 2024-10-10 3:33 UTC (permalink / raw)
To: Jakub Kicinski
Cc: David S . Miller, Paolo Abeni, David Ahern, netdev, eric.dumazet,
Wei Wang, Coco Li
On Thu, Oct 10, 2024 at 4:58 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Wed, 9 Oct 2024 15:05:04 +0000 Eric Dumazet wrote:
> > .../networking/net_cachelines/netns_ipv4_sysctl.rst | 2 +-
>
> This will need a respin, I applied the formatting changes from Donald.
Thanks Jakub, I will respin.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-10-10 3:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-09 15:05 [PATCH net-next] tcp: move sysctl_tcp_l3mdev_accept to netns_ipv4_read_rx Eric Dumazet
2024-10-09 15:12 ` David Ahern
2024-10-10 2:58 ` Jakub Kicinski
2024-10-10 3:33 ` Eric Dumazet
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).