[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPhsuW48_Hd1Ei-NckYjitXqFV6D8P_uVW7bH5RgkD_4NXZ2jQ@mail.gmail.com>
Date: Tue, 25 Feb 2020 09:22:10 -0800
From: Song Liu <song@...nel.org>
To: Lorenz Bauer <lmb@...udflare.com>
Cc: Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
John Fastabend <john.fastabend@...il.com>,
Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
kernel-team@...udflare.com
Subject: Re: [PATCH bpf-next 2/7] bpf: sockmap: move generic sockmap hooks
from BPF TCP
On Tue, Feb 25, 2020 at 5:57 AM Lorenz Bauer <lmb@...udflare.com> 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 base
> and expose them.
>
> Signed-off-by: Lorenz Bauer <lmb@...udflare.com>
> ---
> include/linux/bpf.h | 4 ++-
> include/linux/skmsg.h | 28 ----------------
> net/core/sock_map.c | 77 +++++++++++++++++++++++++++++++++++++++++--
> net/ipv4/tcp_bpf.c | 55 ++-----------------------------
> 4 files changed, 79 insertions(+), 85 deletions(-)
>
> diff --git a/include/linux/bpf.h b/include/linux/bpf.h
> index 49b1a70e12c8..8422ab6a63d8 100644
> --- a/include/linux/bpf.h
> +++ b/include/linux/bpf.h
> @@ -1355,6 +1355,8 @@ static inline void bpf_map_offload_map_free(struct bpf_map *map)
> #if defined(CONFIG_BPF_STREAM_PARSER)
> int sock_map_prog_update(struct bpf_map *map, struct bpf_prog *prog, u32 which);
> int sock_map_get_from_fd(const union bpf_attr *attr, struct bpf_prog *prog);
> +void sock_map_unhash(struct sock *sk);
> +void sock_map_close(struct sock *sk, long timeout);
I think we still need dummy version of these two functions in the #else
cause?
Powered by blists - more mailing lists