bpf: Refactor sock_ops_convert_ctx_access
authorMartin KaFai Lau <kafai@fb.com>
Sun, 10 Feb 2019 07:22:23 +0000 (23:22 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 11 Feb 2019 03:46:17 +0000 (19:46 -0800)
commit9b1f3d6e5af295a72deb5e3f04db07a6a58be72e
treeed930951a91c0ebc2d278c6f50e19955cee9d714
parentaa65d6960a98fc15a96ce361b26e9fd55c9bccc5
bpf: Refactor sock_ops_convert_ctx_access

The next patch will introduce a new "struct bpf_tcp_sock" which
exposes the same tcp_sock's fields already exposed in
"struct bpf_sock_ops".

This patch refactor the existing convert_ctx_access() codes for
"struct bpf_sock_ops" to get them ready to be reused for
"struct bpf_tcp_sock".  The "rtt_min" is not refactored
in this patch because its handling is different from other
fields.

The SOCK_OPS_GET_TCP_SOCK_FIELD is new. All other SOCK_OPS_XXX_FIELD
changes are code move only.

Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
net/core/filter.c