When NULL pointer accidentally passed to write_kprobe_events,
due to strlen(NULL), segmentation fault happens.
Changed code returns -1 to deal with this situation.
Bug issued with Smatch, static analysis.
Signed-off-by: Daniel T. Lee
---
samples/bpf/bpf_load.c | 4 +++-
1 file changed, 3
When NULL pointer accidentally passed to write_kprobe_events,
due to strlen(NULL), segmentation fault happens.
Changed code returns -1 to deal with this situation.
Bug issued with Smatch, static analysis.
Signed-off-by: Daniel T. Lee
---
samples/bpf/bpf_load.c | 4 +++-
1 file changed, 3
t be verified whether from child ps or system.
But using write() directly can verify the command failure,
and it will treat all error as -1.
So I suggest using write() directly to 'kprobe_events'
rather than calling system().
Signed-off-by: Daniel T. Lee
---
samples/bpf/bpf_load.c |
t be verified whether from child ps or system.
But using write() directly can verify the command failure,
and it will treat all error as -1.
So I suggest using write() directly to 'kprobe_events'
rather than calling system().
Signed-off-by: Daniel T. Lee
---
Changes in v2:
-
ure'.
This commit adds BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE entry to
prog_type_name enum, and will eventually fixes the segfault issue.
Signed-off-by: Daniel T. Lee
---
tools/bpf/bpftool/main.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/bpf/bpftool/main.h b/tools/bpf/bpfto
rt for XDP, through `net (un)load`,
bpftool can further support other prog attach types.
XDP (un)load tested on Netronome Agilio.
Daniel T. Lee (2):
tools: bpftool: add net load command to load XDP on interface
tools: bpftool: add net unload command to unload XDP on interface
tools/bpf/bpftool/
k_xdp_fd'.
Signed-off-by: Daniel T. Lee
---
tools/bpf/bpftool/net.c | 107 +++-
1 file changed, 106 insertions(+), 1 deletion(-)
diff --git a/tools/bpf/bpftool/net.c b/tools/bpf/bpftool/net.c
index 67e99c56bc88..d3a4f18b5b95 100644
--- a/tools/bpf/bpftool/net.c
By this commit, using `bpftool net unload`, the loaded XDP prog can
be unloaded. Unloading the BPF prog will be done through libbpf
'bpf_set_link_xdp_fd' with the progfd set to -1.
Signed-off-by: Daniel T. Lee
---
tools/bpf/bpftool/net.c | 55 +++
On Wed, Jul 31, 2019 at 7:08 PM Jesper Dangaard Brouer
wrote:
>
> On Wed, 31 Jul 2019 03:48:20 +0900
> "Daniel T. Lee" wrote:
>
> > By this commit, using `bpftool net load`, user can load XDP prog on
> > interface. New type of enum 'net_load_type'
this patch only contains support for XDP, through `net
attach/detach`, bpftool can further support other prog attach types.
XDP attach/detach tested on Mellanox ConnectX-4 and Netronome Agilio.
---
Changes in v2:
- command 'load/unload' changed to 'attach/detach' for the consis
set_link_xdp_fd'.
Signed-off-by: Daniel T. Lee
---
Changes in v2:
- command 'load' changed to 'attach' for the consistency
- 'NET_ATTACH_TYPE_XDP_DRIVE' changed to 'NET_ATTACH_TYPE_XDP_DRIVER'
tools/bpf/bpftool/net.c | 107 ++
By this commit, using `bpftool net detach`, the attached XDP prog can
be detached. Detaching the BPF prog will be done through libbpf
'bpf_set_link_xdp_fd' with the progfd set to -1.
Signed-off-by: Daniel T. Lee
---
Changes in v2:
- command 'unload' changed to 'de
On Fri, Aug 2, 2019 at 8:36 AM Jakub Kicinski
wrote:
>
> On Thu, 1 Aug 2019 17:11:32 +0900, Daniel T. Lee wrote:
> > By this commit, using `bpftool net attach`, user can attach XDP prog on
> > interface. New type of enum 'net_attach_type' has been made, as stated at
&
Thank you for letting me know.
I will add to next version of patch.
And, thank you for the detailed review. :)
On Fri, Aug 2, 2019 at 8:21 AM Jakub Kicinski
wrote:
>
> On Thu, 1 Aug 2019 17:11:31 +0900, Daniel T. Lee wrote:
> > Currently, bpftool net only supports dumping progs att
On Fri, Aug 2, 2019 at 3:26 PM Y Song wrote:
>
> On Thu, Aug 1, 2019 at 2:04 AM Daniel T. Lee wrote:
> >
> > By this commit, using `bpftool net detach`, the attached XDP prog can
> > be detached. Detaching the BPF prog will be done through libbpf
> > 'bpf_set_
On Fri, Aug 2, 2019 at 3:23 PM Y Song wrote:
>
> On Thu, Aug 1, 2019 at 2:04 AM Daniel T. Lee wrote:
> >
> > By this commit, using `bpftool net attach`, user can attach XDP prog on
> > interface. New type of enum 'net_attach_type' has been made, as stated a
On Sat, Aug 3, 2019 at 3:39 AM Jakub Kicinski
wrote:
>
> On Fri, 2 Aug 2019 14:02:29 +0900, Daniel T. Lee wrote:
> > On Fri, Aug 2, 2019 at 8:36 AM Jakub Kicinski wrote:
> > > On Thu, 1 Aug 2019 17:11:32 +0900, Daniel T. Lee wrote:
> > > > By this commit, usi
This commit adds bash-completion for new "net attach/detach"
subcommand for attaching XDP program on interface.
Signed-off-by: Daniel T. Lee
---
tools/bpf/bpftool/bash-completion/bpftool | 64 +++
1 file changed, 55 insertions(+), 9 deletions(-)
diff --git a
By this commit, using `bpftool net detach`, the attached XDP prog can
be detached. Detaching the BPF prog will be done through libbpf
'bpf_set_link_xdp_fd' with the progfd set to -1.
Signed-off-by: Daniel T. Lee
---
tools/bpf/bpftool/net.c | 42 +++
attached XDP program could be replaced.
Added new helper 'net_parse_dev' to parse the network device at argument.
BPF prog will be attached through libbpf 'bpf_set_link_xdp_fd'.
Signed-off-by: Daniel T. Lee
---
tools/bpf/bpftool/net.c | 141 ---
PE' comes first)
- add 'dev' keyword in front of
- added bash-completion and documentation
Changes in v2:
- command 'load/unload' changed to 'attach/detach' for the consistency
Daniel T. Lee (4):
tools: bpftool: add net attach command to attach XDP on int
Since, new sub-command 'net attach/detach' has been added for
attaching XDP program on interface,
this commit documents usage and sample output of `net attach/detach`.
Signed-off-by: Daniel T. Lee
---
.../bpf/bpftool/Documentation/bpftool-net.rst | 51 +--
1 file c
his commit fixes this logic by grep-ing the "Result:" string only when
the command is not for 'pg_ctrl'.
For clarity of an execution flow, 'errexit' flag has been set.
To cleanup pktgen on exit, trap has been added for EXIT signal.
Signed-off-by: Daniel T. Lee
---
existing variable name DST_MIN should be changed.
Variable names are matched to the exact keyword used with pg_ctrl.
Signed-off-by: Daniel T. Lee
---
.../pktgen_bench_xmit_mode_netif_receive.sh | 8
.../pktgen/pktgen_bench_xmit_mode_queue_xmit.sh | 8
samples/pk
This commit adds CIDR parsing and IP validate helper function to parse
single IP or range of IP with CIDR. (e.g. 198.18.0.0/15)
Validating the address should be preceded prior to the parsing.
Helpers will be used in prior to set target address in samples/pktgen.
Signed-off-by: Daniel T. Lee
.3000: UDP, length 16
05:14:18.083366 IP6 fe80::99.107 > fe80::22.3000: UDP, length 16
05:14:18.083585 IP6 fe80::99.97 > fe80::21.3000: UDP, length 16
Signed-off-by: Daniel T. Lee
---
Changes since v4:
* 'validate_addr' is called prior to 'parse_addr'
samples/
On Fri, Oct 4, 2019 at 9:52 PM Jesper Dangaard Brouer wrote:
>
>
> On Fri, 4 Oct 2019 10:32:58 +0900 "Daniel T. Lee"
> wrote:
>
> > [...]
>
Thanks for the review!
> A general comment, you forgot a cover letter for your patchset.
>
At first, I thought
On Fri, Oct 4, 2019 at 10:41 PM Jesper Dangaard Brouer
wrote:
>
> On Fri, 4 Oct 2019 22:28:26 +0900
> "Daniel T. Lee" wrote:
>
> > On Fri, Oct 4, 2019 at 9:52 PM Jesper Dangaard Brouer
> > wrote:
> > >
> > >
> > > On
On Fri, Oct 4, 2019 at 10:24 PM Jesper Dangaard Brouer
wrote:
>
> [...]
>
> Is this comment still relevant? You just excluded "pgctrl" from
> getting into this section.
>
Oops, will fix it right away.
> > +if [[ "$result" == "" ]]; then
> > +grep "Result:" $proc_ctrl >&2
>
> Mis
Currently, building the bpf samples isn't working.
Running make from the directory 'samples/bpf' will just shows following
result without compiling any samples.
$ make
make -C ../../ /git/linux/samples/bpf/ BPF_SAMPLES_PATH=/git/linux/samples/bpf
make[1]: Entering directory '/git/linux'
CALL
randomizing n-tuple.
This patchset fixes the problem with checking the command result on proc_cmd,
and add feature to allow destination IP range.
Daniel T. Lee (4):
samples: pktgen: make variable consistent with option
samples: pktgen: fix proc_cmd command result check logic
samples: pktgen: add
#x27;.
This commit fixes this logic by grep-ing the "Result:" string only when
the command is not for 'pg_ctrl'.
For clarity of an execution flow, 'errexit' flag has been set.
To cleanup pktgen on exit, trap has been added for EXIT signal.
Signed-off-by: Daniel T. Le
existing variable name DST_MIN should be changed.
Variable names are matched to the exact keyword used with pg_ctrl.
Signed-off-by: Daniel T. Lee
---
.../pktgen_bench_xmit_mode_netif_receive.sh | 8
.../pktgen/pktgen_bench_xmit_mode_queue_xmit.sh | 8
samples/pk
This commit adds CIDR parsing and IP validate helper function to parse
single IP or range of IP with CIDR. (e.g. 198.18.0.0/15)
Validating the address should be preceded prior to the parsing.
Helpers will be used in prior to set target address in samples/pktgen.
Signed-off-by: Daniel T. Lee
.3000: UDP, length 16
05:14:18.083366 IP6 fe80::99.107 > fe80::22.3000: UDP, length 16
05:14:18.083585 IP6 fe80::99.97 > fe80::21.3000: UDP, length 16
Signed-off-by: Daniel T. Lee
---
Changes since v4:
* 'validate_addr' is called prior to 'parse_addr'
samples/
ap_fd from '!= 0' to '< 0',
since fd could be 0 when stdin is closed.
Signed-off-by: Daniel T. Lee
---
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
On Mon, Oct 7, 2019 at 12:37 PM Andrii Nakryiko
wrote:
>
> On Sun, Oct 6, 2019 at 4:58 AM Daniel T. Lee 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
On Mon, Oct 7, 2019 at 5:15 PM Jesper Dangaard Brouer wrote:
>
> On Sat, 5 Oct 2019 17:25:07 +0900
> "Daniel T. Lee" wrote:
>
> > Currently, proc_cmd is used to dispatch command to 'pg_ctrl', 'pg_thread',
> > 'pg_set'. proc_c
ap_fd from '!= 0' to '< 0',
since fd could be 0 when stdin is closed.
Signed-off-by: Daniel T. Lee
---
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_TOO
On Tue, Oct 8, 2019 at 1:41 AM Andrii Nakryiko
wrote:
>
> On Mon, Oct 7, 2019 at 9:06 AM Daniel T. Lee 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
er to fetch map from 'bpf_map__next'
to 'bpf_object__find_map_fd_by_name'. Also, 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
---
Changes in v6:
- Remove redundant error
On Tue, Oct 8, 2019 at 12:24 PM Alexei Starovoitov
wrote:
>
> On Mon, Oct 7, 2019 at 10:21 AM Daniel T. Lee wrote:
> >
> > Currently, at xdp_adjust_tail_kern.c, MAX_PCKT_SIZE is limited
> > to 600. To make this size flexible, static global variable
> > 'max_pc
those two samples to fetch interface with it's name
without changing the original index interface fetching.
( fetching in the same way as xdp_sample_pkts_user.c does.)
Signed-off-by: Daniel T. Lee
---
samples/bpf/xdp_adjust_tail_user.c | 12 ++--
samples/bpf/xdp_tx_iptunnel_u
Will do right away! :)
On Tue, Jun 25, 2019 at 3:24 AM Toke Høiland-Jørgensen wrote:
>
> "Daniel T. Lee" writes:
>
> > Currently, each xdp samples are inconsistent in the use.
> > Most of the samples fetch the interface with it's name.
> > (ex. xdp1, x
mples to fetch interface with it's name
without changing the original index interface fetching.
( fetching in the same way as xdp_sample_pkts_user.c does.)
Signed-off-by: Daniel T. Lee
---
Changes in v2:
- added xdp_redirect_user.c, xdp_redirect_map_user.c
samples/bpf/xdp_adjust_tail_us
mples to fetch interface with it's name
without changing the original index interface fetching.
( fetching in the same way as xdp_sample_pkts_user.c does.)
Signed-off-by: Daniel T. Lee
---
Changes in v2:
- added xdp_redirect_user.c, xdp_redirect_map_user.c
samples/bpf/xdp_adjust_tail_us
script.
-p : ($DST_PORT) destination PORT range (e.g. 433-444) is also allowed
Signed-off-by: Daniel T. Lee
---
samples/pktgen/README.rst| 1 +
samples/pktgen/parameters.sh | 7 ++-
.../pktgen/pktgen_bench_xmit_mode_netif_re
This commit adds port parsing and port validate helper function to parse
single or range of port(s) from a given string. (e.g. 1234, 443-444)
Helpers will be used in prior to set target port(s) in samples/pktgen.
Signed-off-by: Daniel T. Lee
---
samples/pktgen/functions.sh | 34
9 22:33:58 +0900
> "Daniel T. Lee" wrote:
>
> > Currently, kernel pktgen has the feature to specify udp destination port
> > for sending packet. (e.g. pgset "udp_dst_min 9")
> >
> > But on samples, each of the scripts doesn't have any option to ac
ff-by: Daniel T. Lee
---
samples/bpf/Makefile | 2 +-
samples/bpf/xdp_monitor_user.c | 144 -
2 files changed, 108 insertions(+), 38 deletions(-)
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index 4f1ed0e3cf9f..0cee2aa8970f 100644
--- a/sample
o BTF-defined map.
Daniel T. Lee (3):
samples: bpf: Refactor xdp_monitor with libbpf
samples: bpf: Replace attach_tracepoint() to attach() in
xdp_redirect_cpu
samples: bpf: refactor XDP kern program maps with BTF-defined map
samples/bpf/Makefile| 4 +-
sample
, this commit removes the max_entries attribute at PERF_EVENT_ARRAY
map type. The libbpf's bpf_object__create_map() will automatically
set max_entries to the maximum configured number of CPUs on the host.
Signed-off-by: Daniel T. Lee
---
samples/bpf/xdp_monitor_kern.c
ethod. In addition, this refactors the logic of setting
the map FD to simplify the code. Also, the missing removal of
bpf_load.o in Makefile has been fixed.
Signed-off-by: Daniel T. Lee
---
samples/bpf/Makefile| 2 +-
samples/bpf/xdp_redirect_cpu_user.c | 138 +--
On Sat, Oct 10, 2020 at 3:17 AM Andrii Nakryiko
wrote:
>
> On Fri, Oct 9, 2020 at 9:04 AM Daniel T. Lee wrote:
> >
> > To avoid confusion caused by the increasing fragmentation of the BPF
> > Loader program, this commit would like to change to the libbpf loader
> >
On Sat, Oct 10, 2020 at 3:25 AM Andrii Nakryiko
wrote:
>
> On Fri, Oct 9, 2020 at 9:04 AM Daniel T. Lee wrote:
> >
> > Most of the samples were converted to use the new BTF-defined MAP as
> > they moved to libbpf, but some of the samples were missing.
> >
> &g
ethod. In addition, this refactors the logic of setting
the map FD to simplify the code. Also, the missing removal of
bpf_load.o in Makefile has been fixed.
Signed-off-by: Daniel T. Lee
---
Changes in v2:
- program section match with bpf_program__is_ instead of strncmp
- refactor pointer ar
inter array initialization
- error code cleanup
Daniel T. Lee (3):
samples: bpf: Refactor xdp_monitor with libbpf
samples: bpf: Replace attach_tracepoint() to attach() in
xdp_redirect_cpu
samples: bpf: refactor XDP kern program maps with BTF-defined map
samples/bpf/Mak
ethod. In addition, this refactors the logic of setting
the map FD to simplify the code. Also, the missing removal of
bpf_load.o in Makefile has been fixed.
Signed-off-by: Daniel T. Lee
---
Changes in v2:
- program section match with bpf_program__is_ instead of strncmp
- refactor pointer ar
On Sat, Oct 10, 2020 at 3:23 AM Andrii Nakryiko
wrote:
>
> On Fri, Oct 9, 2020 at 9:04 AM Daniel T. Lee wrote:
> >
> > From commit d7a18ea7e8b6 ("libbpf: Add generic bpf_program__attach()"),
> > for some BPF programs, it is now possible to attach BPF progr
On Sat, Oct 10, 2020 at 3:30 AM Andrii Nakryiko
wrote:
>
> On Fri, Oct 9, 2020 at 9:04 AM Daniel T. Lee wrote:
> >
> > To avoid confusion caused by the increasing fragmentation of the BPF
> > Loader program, this commit would like to convert the previous bpf_load
&g
, this commit removes the max_entries attribute at PERF_EVENT_ARRAY
map type. The libbpf's bpf_object__create_map() will automatically
set max_entries to the maximum configured number of CPUs on the host.
Signed-off-by: Daniel T. Lee
---
Changes in v2:
- revert BTF key/val type to defau
inter array initialization
- error code cleanup
Daniel T. Lee (3):
samples: bpf: Refactor xdp_monitor with libbpf
samples: bpf: Replace attach_tracepoint() to attach() in
xdp_redirect_cpu
samples: bpf: refactor XDP kern program maps with BTF-defined map
samples/bpf/Mak
ff-by: Daniel T. Lee
---
Changes in v2:
- added cleanup logic for bpf_link and bpf_object
- split increment into seperate satement
- refactor pointer array initialization
samples/bpf/Makefile | 2 +-
samples/bpf/xdp_monitor_user.c | 159 +
2 files changed
, this commit removes the max_entries attribute at PERF_EVENT_ARRAY
map type. The libbpf's bpf_object__create_map() will automatically
set max_entries to the maximum configured number of CPUs on the host.
Signed-off-by: Daniel T. Lee
---
Changes in v2:
- revert BTF key/val type to defau
ff-by: Daniel T. Lee
---
Changes in v2:
- added cleanup logic for bpf_link and bpf_object
- split increment into seperate satement
- refactor pointer array initialization
samples/bpf/Makefile | 2 +-
samples/bpf/xdp_monitor_user.c | 159 +
2 files changed
sys_connect event by
specifying the __sys_connect directly and this will bypass the
"__x64_" appending rule of bpf_load.
Fixes: 34745aed515c ("samples/bpf: fix kprobe attachment issue on x64")
Signed-off-by: Daniel T. Lee
---
samples/bpf/map_perf_test_kern.c
directive.
__array(values, struct inner_map)
This commit refactors map in map test program with libbpf by explicitly
defining inner map with BTF-defined format.
Signed-off-by: Daniel T. Lee
---
samples/bpf/Makefile | 2 +-
samples/bpf/test_map_in_map_kern.c | 85 +++-
Libbpf has its own helper function to check for errors in the bpf
data structure (pointer). And Some codes do not use this libbbpf
helper function and check the pointer's error directly.
This commit clean up the existing pointer error check logic with
libbpf.
Signed-off-by: Daniel T
Sorry for the late reply.
On Sat, Nov 21, 2020 at 11:34 AM Martin KaFai Lau wrote:
>
> On Thu, Nov 19, 2020 at 03:06:11PM +, Daniel T. Lee wrote:
> [ ... ]
>
> > static int run_bpf_prog(char *prog, int cg_id)
> > [ ... ]
> > if (!o
d variable
- change to destroy link even after link__pin()
- fix return error code on exit
- merge commit with changing Makefile
Changes in v3:
- cleanup bpf_link, bpf_object and cgroup fd both on success and error
Daniel T. Lee (7):
samples: bpf: refactor hbm program with libbpf
samples: bpf
oblem that
shell script cannot find the binary object from the current path,
relative path './' has been added in front of binary.
Fixes: 554ae6e792ef3 ("samples/bpf: add userspace example for prohibiting
sockets")
Signed-off-by: Daniel T. Lee
---
Changes in v2:
- cha
code, this commit
uses the number of available cpus with _SC_NPROCESSORS_ONLN.
Signed-off-by: Daniel T. Lee
Acked-by: Andrii Nakryiko
---
Changes in v2:
- add static at global variable and drop {}
samples/bpf/Makefile | 2 +-
samples/bpf/test_overhead_user.c | 82
not used on this program.
Signed-off-by: Daniel T. Lee
---
Changes in v2:
- add static at global variable and drop {}
- fix return error code on exit
samples/bpf/Makefile | 2 +-
samples/bpf/ibumad_kern.c | 26 +++---
samples/bpf/ibumad_user.c | 71
his commit add the executable permission to shell script
files.
Fixes: f74599f7c5309 ("bpf: Add tests and samples for LWT-BPF")
Signed-off-by: Daniel T. Lee
---
samples/bpf/lwt_len_hist.sh | 2 ++
samples/bpf/test_lwt_bpf.sh | 0
2 files changed, 2 insertions(+)
mode change 100644 =
probe events, O_TRUNC
flag has been used to clear 'uprobe_events' interface.
Signed-off-by: Daniel T. Lee
---
Changes in v2:
- add static at global variable and drop {}
- fix return error code on exit
- restore DEBUGFS macro to absolute string path
samples/bpf/Makefile
with the latest kernel BPF and causes confusion.
Also, this commit removes the unused trace_helper and bpf_load from
samples/bpf target objects from Makefile.
Signed-off-by: Daniel T. Lee
Acked-by: Jesper Dangaard Brouer
Acked-by: Andrii Nakryiko
---
Changes in v2:
- merge commit with changing
of BPF MAP definition.
But this commit solves the problem by fixing this from 'queue_stats' map
struct hvm_queue_stats -> hbm_queue_stats.
Fixes: 36b5d471135c ("selftests/bpf: samples/bpf: Split off legacy stuff from
bpf_helpers.h")
Signed-off-by: Daniel T. L
On Thu, Aug 8, 2019 at 5:42 AM Jakub Kicinski
wrote:
>
> On Wed, 7 Aug 2019 11:25:06 +0900, Daniel T. Lee wrote:
> > By this commit, using `bpftool net attach`, user can attach XDP prog on
> > interface. New type of enum 'net_attach_type' has been made, as stated at
&
On Fri, Aug 9, 2019 at 2:50 AM Jakub Kicinski
wrote:
>
> On Thu, 8 Aug 2019 07:15:22 +0900, Daniel T. Lee wrote:
> > > > + return -EINVAL;
> > > > + }
> > > > +
> > > > + NEXT_ARG();
> > >
> > > nit: the n
On Fri, Aug 9, 2019 at 1:48 AM Quentin Monnet
wrote:
>
> 2019-08-07 11:25 UTC+0900 ~ Daniel T. Lee
> > This commit adds bash-completion for new "net attach/detach"
> > subcommand for attaching XDP program on interface.
> >
> > Signed-off-by: Daniel T.
On Fri, Aug 9, 2019 at 1:48 AM Quentin Monnet
wrote:
>
> 2019-08-07 11:25 UTC+0900 ~ Daniel T. Lee
> > Since, new sub-command 'net attach/detach' has been added for
> > attaching XDP program on interface,
> > this commit documents usage and sample output of `
attached XDP program could be replaced.
Added new helper 'net_parse_dev' to parse the network device at argument.
BPF prog will be attached through libbpf 'bpf_set_link_xdp_fd'.
Signed-off-by: Daniel T. Lee
---
tools/bpf/bpftool/net.c | 136 +-
#x27; changed to 'attach/detach' for the consistency
Daniel T. Lee (4):
tools: bpftool: add net attach command to attach XDP on interface
tools: bpftool: add net detach command to detach XDP on interface
tools: bpftool: add bash-completion for net attach/detach
tools: bpftool: add doc
This commit adds bash-completion for new "net attach/detach"
subcommand for attaching XDP program on interface.
Signed-off-by: Daniel T. Lee
---
tools/bpf/bpftool/bash-completion/bpftool | 65 +++
1 file changed, 55 insertions(+), 10 deletions(-)
diff --git a
Since, new sub-command 'net attach/detach' has been added for
attaching XDP program on interface,
this commit documents usage and sample output of `net attach/detach`.
Signed-off-by: Daniel T. Lee
---
.../bpf/bpftool/Documentation/bpftool-net.rst | 57 ++-
1 file c
By this commit, using `bpftool net detach`, the attached XDP prog can
be detached. Detaching the BPF prog will be done through libbpf
'bpf_set_link_xdp_fd' with the progfd set to -1.
Signed-off-by: Daniel T. Lee
---
tools/bpf/bpftool/net.c | 42 +++
On Mon, Aug 12, 2019 at 9:27 AM Y Song wrote:
>
> On Fri, Aug 9, 2019 at 6:35 AM Daniel T. Lee wrote:
> >
> > By this commit, using `bpftool net attach`, user can attach XDP prog on
> > interface. New type of enum 'net_attach_type' has been made, as stated a
By this commit, using `bpftool net detach`, the attached XDP prog can
be detached. Detaching the BPF prog will be done through libbpf
'bpf_set_link_xdp_fd' with the progfd set to -1.
Acked-by: Yonghong Song
Signed-off-by: Daniel T. Lee
---
tools/bpf/bpftool/
h-completion and documentation
Changes in v2:
- command 'load/unload' changed to 'attach/detach' for the consistency
Daniel T. Lee (4):
tools: bpftool: add net attach command to attach XDP on interface
tools: bpftool: add net detach command to detach XDP on interface
This commit adds bash-completion for new "net attach/detach"
subcommand for attaching XDP program on interface.
Signed-off-by: Daniel T. Lee
---
tools/bpf/bpftool/bash-completion/bpftool | 65 +++
1 file changed, 55 insertions(+), 10 deletions(-)
diff --git a
Since, new sub-command 'net attach/detach' has been added for
attaching XDP program on interface,
this commit documents usage and sample output of `net attach/detach`.
Signed-off-by: Daniel T. Lee
---
.../bpf/bpftool/Documentation/bpftool-net.rst | 57 ++-
1 file c
attached XDP program could be replaced.
Added new helper 'net_parse_dev' to parse the network device at argument.
BPF prog will be attached through libbpf 'bpf_set_link_xdp_fd'.
Acked-by: Yonghong Song
Signed-off-by: Daniel T. Lee
---
tools/bpf/bpftool/net.c | 136 +++
On Wed, Aug 14, 2019 at 6:43 AM Jakub Kicinski
wrote:
>
> On Tue, 13 Aug 2019 11:46:17 +0900, Daniel T. Lee wrote:
> > Currently, bpftool net only supports dumping progs attached on the
> > interface. To attach XDP prog on interface, user must use other tool
> > (eg.
is used, the size of maximum packet
will be 600 as a default.
Signed-off-by: Daniel T. Lee
---
samples/bpf/xdp_adjust_tail_kern.c | 23 +++
samples/bpf/xdp_adjust_tail_user.c | 21 +++--
2 files changed, 38 insertions(+), 6 deletions(-)
diff
is used, the size of maximum packet
will be 600 as a default.
Signed-off-by: Daniel T. Lee
---
Changes in v2:
- Change the helper to fetch map from 'bpf_map__next' to
'bpf_object__find_map_fd_by_name'.
samples/bpf/xdp_adjust_tail_kern.c | 23 +++
On Tue, Aug 27, 2019 at 12:54 AM Maciej Fijalkowski
wrote:
>
> On Mon, 26 Aug 2019 18:57:22 +0900
> "Daniel T. Lee" wrote:
>
> > Currently, at xdp_adjust_tail_kern.c, MAX_PCKT_SIZE is limited
> > to 600. To make this size flexible, a new map 'pcktsz' i
, length 16
05:14:18.083366 IP6 fe80::99.107 > fe80::22.3000: UDP, length 16
05:14:18.083585 IP6 fe80::99.97 > fe80::21.3000: UDP, length 16
Signed-off-by: Daniel T. Lee
---
samples/pktgen/README.rst | 2 +-
samples/pktgen/parameters.sh
existing variable name DST_MIN should be changed.
Variable names are matched to the exact keyword used with pg_ctrl.
Signed-off-by: Daniel T. Lee
---
.../pktgen_bench_xmit_mode_netif_receive.sh | 8
.../pktgen/pktgen_bench_xmit_mode_queue_xmit.sh | 8
samples/pk
This commit adds CIDR parsing and IP validate helper function to parse
single IP or range of IP with CIDR. (e.g. 198.18.0.0/15)
Helpers will be used in prior to set target address in samples/pktgen.
Signed-off-by: Daniel T. Lee
---
samples/pktgen/functions.sh | 134
On Fri, Aug 30, 2019 at 5:42 AM Song Liu wrote:
>
> On Mon, Aug 26, 2019 at 9:52 AM Daniel T. Lee wrote:
> >
> > Currently, at xdp_adjust_tail_kern.c, MAX_PCKT_SIZE is limited
> > to 600. To make this size flexible, a new map 'pcktsz' is added.
> >
>
1 - 100 of 212 matches
Mail list logo