Re: [PATCH bpf-next v2 3/9] bpf: sockmap: move generic sockmap hooks from BPF TCP

From: Martin KaFai Lau
Date: Tue Mar 03 2020 - 13:09:47 EST


On Fri, Feb 28, 2020 at 11:53:38AM +0000, Lorenz Bauer wrote:
> The close, unhash and clone handlers from TCP sockmap are actually generic,
> and can be reused by UDP sockmap. Move the helpers into the sockmap code
Is clone reused in UDP?

> base and expose them. This requires tcp_bpf_(re)init and tcp_bpf_clone to
> be conditional on BPF_STREAM_PARSER.
>

[ ... ]

> @@ -707,3 +659,4 @@ void tcp_bpf_clone(const struct sock *sk, struct sock *newsk)
> if (prot == &tcp_bpf_prots[family][TCP_BPF_BASE])
> newsk->sk_prot = sk->sk_prot_creator;
> }
> +#endif /* CONFIG_BPF_STREAM_PARSER */
>