Commit 1f615422 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Revert "udp_tunnel: GRO optimizations"

Revert "udp_tunnel: use static call for GRO hooks when possible"
This reverts commit 311b3657.

Revert "udp_tunnel: create a fastpath GRO lookup."
This reverts commit 8d4880db.

There are multiple small issues with the series. In the interest
of unblocking the merge window let's opt for a revert.

Link: https://lore.kernel.org/cover.1742557254.git.pabeni@redhat.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent aa3651cc
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -101,13 +101,6 @@ struct udp_sock {

	/* Cache friendly copy of sk->sk_peek_off >= 0 */
	bool		peeking_with_offset;

	/*
	 * Accounting for the tunnel GRO fastpath.
	 * Unprotected by compilers guard, as it uses space available in
	 * the last UDP socket cacheline.
	 */
	struct hlist_node	tunnel_list;
};

#define udp_test_bit(nr, sk)			\
@@ -226,13 +219,4 @@ static inline void udp_allow_gso(struct sock *sk)

#define IS_UDPLITE(__sk) (__sk->sk_protocol == IPPROTO_UDPLITE)

static inline struct sock *udp_tunnel_sk(const struct net *net, bool is_ipv6)
{
#if IS_ENABLED(CONFIG_NET_UDP_TUNNEL)
	return rcu_dereference(net->ipv4.udp_tunnel_gro[is_ipv6].sk);
#else
	return NULL;
#endif
}

#endif	/* _LINUX_UDP_H */
+0 −11
Original line number Diff line number Diff line
@@ -47,11 +47,6 @@ struct sysctl_fib_multipath_hash_seed {
};
#endif

struct udp_tunnel_gro {
	struct sock __rcu *sk;
	struct hlist_head list;
};

struct netns_ipv4 {
	/* Cacheline organization can be found documented in
	 * Documentation/networking/net_cachelines/netns_ipv4_sysctl.rst.
@@ -90,11 +85,6 @@ struct netns_ipv4 {
	struct inet_timewait_death_row tcp_death_row;
	struct udp_table *udp_table;

#if IS_ENABLED(CONFIG_NET_UDP_TUNNEL)
	/* Not in a pernet subsys because need to be available at GRO stage */
	struct udp_tunnel_gro udp_tunnel_gro[2];
#endif

#ifdef CONFIG_SYSCTL
	struct ctl_table_header	*forw_hdr;
	struct ctl_table_header	*frags_hdr;
@@ -287,5 +277,4 @@ struct netns_ipv4 {
	struct hlist_head	*inet_addr_lst;
	struct delayed_work	addr_chk_work;
};

#endif
+0 −1
Original line number Diff line number Diff line
@@ -290,7 +290,6 @@ static inline void udp_lib_init_sock(struct sock *sk)
	struct udp_sock *up = udp_sk(sk);

	skb_queue_head_init(&up->reader_queue);
	INIT_HLIST_NODE(&up->tunnel_list);
	up->forward_threshold = sk->sk_rcvbuf >> 2;
	set_bit(SOCK_CUSTOM_SOCKOPT, &sk->sk_socket->flags);
}
+0 −22
Original line number Diff line number Diff line
@@ -203,28 +203,6 @@ static inline void udp_tunnel_encap_enable(struct sock *sk)
	udp_encap_enable();
}

#if IS_ENABLED(CONFIG_NET_UDP_TUNNEL)
void udp_tunnel_update_gro_lookup(struct net *net, struct sock *sk, bool add);
void udp_tunnel_update_gro_rcv(struct sock *sk, bool add);
#else
static inline void udp_tunnel_update_gro_lookup(struct net *net,
						struct sock *sk, bool add) {}
static inline void udp_tunnel_update_gro_rcv(struct sock *sk, bool add) {}
#endif

static inline void udp_tunnel_cleanup_gro(struct sock *sk)
{
	struct udp_sock *up = udp_sk(sk);
	struct net *net = sock_net(sk);

	udp_tunnel_update_gro_rcv(sk, false);

	if (!up->tunnel_list.pprev)
		return;

	udp_tunnel_update_gro_lookup(net, sk, false);
}

#define UDP_TUNNEL_NIC_MAX_TABLES	4

enum udp_tunnel_nic_info_flags {
+1 −12
Original line number Diff line number Diff line
@@ -2891,10 +2891,8 @@ void udp_destroy_sock(struct sock *sk)
			if (encap_destroy)
				encap_destroy(sk);
		}
		if (udp_test_bit(ENCAP_ENABLED, sk)) {
		if (udp_test_bit(ENCAP_ENABLED, sk))
			static_branch_dec(&udp_encap_needed_key);
			udp_tunnel_cleanup_gro(sk);
		}
	}
}

@@ -3806,15 +3804,6 @@ static void __net_init udp_set_table(struct net *net)

static int __net_init udp_pernet_init(struct net *net)
{
#if IS_ENABLED(CONFIG_NET_UDP_TUNNEL)
	int i;

	/* No tunnel is configured */
	for (i = 0; i < ARRAY_SIZE(net->ipv4.udp_tunnel_gro); ++i) {
		INIT_HLIST_HEAD(&net->ipv4.udp_tunnel_gro[i].list);
		RCU_INIT_POINTER(net->ipv4.udp_tunnel_gro[i].sk, NULL);
	}
#endif
	udp_sysctl_init(net);
	udp_set_table(net);

Loading