lkml.org 
[lkml]   [2023]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH bpf-next v1] bpf: Remove the unnecessary insn buffer comparison
From
On 01/08, Haiyue Wang wrote:
> The variable 'insn' is initialized to 'insn_buf' without being changed,
> only some helper macros are defined, so the insn buffer comparison is
> unnecessary, just remove it.

> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>

Acked-by: Stanislav Fomichev <sdf@google.com>

Looks like these should have been removed as part of commit 2377b81de527
("bpf: split shared bpf_tcp_sock and bpf_sock_ops implementation").

> ---
> net/core/filter.c | 6 ------
> 1 file changed, 6 deletions(-)

> diff --git a/net/core/filter.c b/net/core/filter.c
> index ab811293ae5d..d9befa6ba04e 100644
> --- a/net/core/filter.c
> +++ b/net/core/filter.c
> @@ -6847,9 +6847,6 @@ u32 bpf_tcp_sock_convert_ctx_access(enum
> bpf_access_type type,
> FIELD)); \
> } while (0)

> - if (insn > insn_buf)
> - return insn - insn_buf;
> -
> switch (si->off) {
> case offsetof(struct bpf_tcp_sock, rtt_min):
> BUILD_BUG_ON(sizeof_field(struct tcp_sock, rtt_min) !=
> @@ -10147,9 +10144,6 @@ static u32 sock_ops_convert_ctx_access(enum
> bpf_access_type type,
> SOCK_OPS_GET_FIELD(BPF_FIELD, OBJ_FIELD, OBJ); \
> } while (0)

> - if (insn > insn_buf)
> - return insn - insn_buf;
> -
> switch (si->off) {
> case offsetof(struct bpf_sock_ops, op):
> *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct bpf_sock_ops_kern,
> --
> 2.39.0

\
 
 \ /
  Last update: 2023-03-26 23:33    [W:0.093 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site