[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEf4BzYV68OubcBFZWpMvkKsHhzb3uuMQ7HcMUgYgqigog4q0g@mail.gmail.com>
Date: Mon, 7 Oct 2019 09:41:44 -0700
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: "Daniel T. Lee" <danieltimlee@...il.com>
Cc: Yonghong Song <yhs@...com>, Song Liu <liu.song.a23@...il.com>,
Daniel Borkmann <daniel@...earbox.net>,
Alexei Starovoitov <ast@...nel.org>, bpf <bpf@...r.kernel.org>,
Networking <netdev@...r.kernel.org>
Subject: Re: [PATCH bpf-next v6] samples: bpf: add max_pckt_size option at xdp_adjust_tail
On Mon, Oct 7, 2019 at 9:06 AM Daniel T. Lee <danieltimlee@...il.com> wrote:
>
> Currently, at xdp_adjust_tail_kern.c, MAX_PCKT_SIZE is limited
> to 600. To make this size flexible, static global variable
> 'max_pcktsz' is added.
>
> By updating new packet size from the user space, xdp_adjust_tail_kern.o
> will use this value as a new max packet size.
>
> This static global variable can be accesible from .data section with
> bpf_object__find_map* from user space, since it is considered as
> internal map (accessible with .bss/.data/.rodata suffix).
>
> If no '-P <MAX_PCKT_SIZE>' option is used, the size of maximum packet
> will be 600 as a default.
>
> Changed the way to test prog_fd, map_fd from '!= 0' to '< 0',
> since fd could be 0 when stdin is closed.
>
> Signed-off-by: Daniel T. Lee <danieltimlee@...il.com>
>
> ---
> Changes in v6:
> - Remove redundant error message
> Changes in v5:
> - Change pcktsz map to static global variable
> Changes in v4:
> - make pckt_size no less than ICMP_TOOBIG_SIZE
> - Fix code style
> Changes in v2:
> - Change the helper to fetch map from 'bpf_map__next' to
> 'bpf_object__find_map_fd_by_name'.
This should go into commit message, that's netdev preference.
Otherwise looks good!
Acked-by: Andrii Nakryiko <andriin@...com>
>
> samples/bpf/xdp_adjust_tail_kern.c | 7 +++++--
> samples/bpf/xdp_adjust_tail_user.c | 29 ++++++++++++++++++++---------
> 2 files changed, 25 insertions(+), 11 deletions(-)
>
> diff --git a/samples/bpf/xdp_adjust_tail_kern.c b/samples/bpf/xdp_adjust_tail_kern.c
> index 411fdb21f8bc..c616508befb9 100644
> --- a/samples/bpf/xdp_adjust_tail_kern.c
> +++ b/samples/bpf/xdp_adjust_tail_kern.c
> @@ -25,6 +25,9 @@
> #define ICMP_TOOBIG_SIZE 98
> #define ICMP_TOOBIG_PAYLOAD_SIZE 92
>
[...]
Powered by blists - more mailing lists