Re: [v3,2/4] tools: bpftool: add net detach command to detach XDP on interface

2019-08-08 Thread Jakub Kicinski
On Thu, 8 Aug 2019 12:52:11 -0700, Y Song wrote: > > Ah ok. In this scenario if driver has a native xdp support we would be > > invoking > > its ndo_bpf even if there's no prog currently attached and it wouldn't > > return > > error value. > > > > Looking at dev_xdp_uninstall, setting driver's pr

Re: [v3,2/4] tools: bpftool: add net detach command to detach XDP on interface

2019-08-08 Thread Y Song
On Wed, Aug 7, 2019 at 1:40 PM Maciej Fijalkowski wrote: > > On Wed, 7 Aug 2019 13:12:17 -0700 > Y Song wrote: > > > On Wed, Aug 7, 2019 at 11:30 AM Maciej Fijalkowski > > wrote: > > > > > > On Wed, 7 Aug 2019 10:02:04 -0700 > > > Y Song wrote: > > > > > > > On Tue, Aug 6, 2019 at 7:25 PM Danie

Re: [v3,2/4] tools: bpftool: add net detach command to detach XDP on interface

2019-08-07 Thread Maciej Fijalkowski
On Wed, 7 Aug 2019 13:12:17 -0700 Y Song wrote: > On Wed, Aug 7, 2019 at 11:30 AM Maciej Fijalkowski > wrote: > > > > On Wed, 7 Aug 2019 10:02:04 -0700 > > Y Song wrote: > > > > > On Tue, Aug 6, 2019 at 7:25 PM Daniel T. Lee > > > wrote: > > > > > > > > By this commit, using `bpftool net

Re: [v3,2/4] tools: bpftool: add net detach command to detach XDP on interface

2019-08-07 Thread Y Song
On Wed, Aug 7, 2019 at 11:30 AM Maciej Fijalkowski wrote: > > On Wed, 7 Aug 2019 10:02:04 -0700 > Y Song wrote: > > > On Tue, Aug 6, 2019 at 7:25 PM Daniel T. Lee wrote: > > > > > > By this commit, using `bpftool net detach`, the attached XDP prog can > > > be detached. Detaching the BPF prog wi

Re: [v3,2/4] tools: bpftool: add net detach command to detach XDP on interface

2019-08-07 Thread Jakub Kicinski
On Wed, 7 Aug 2019 10:02:04 -0700, Y Song wrote: > -bash-4.4$ sudo ./bpftool net detach x dev v2 > -bash-4.4$ sudo ./bpftool net > xdp: > v1(4) driver id 1172 > > tc: > eth0(2) clsact/ingress fbflow_icmp id 29 act [] > eth0(2) clsact/egress cls_fg_dscp_section id 27 act [] > eth0(2) clsact/egress

Re: [v3,2/4] tools: bpftool: add net detach command to detach XDP on interface

2019-08-07 Thread Maciej Fijalkowski
On Wed, 7 Aug 2019 10:02:04 -0700 Y Song wrote: > On Tue, Aug 6, 2019 at 7:25 PM 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_link_xdp_fd' with the progfd set to

Re: [v3,2/4] tools: bpftool: add net detach command to detach XDP on interface

2019-08-07 Thread Y Song
On Tue, Aug 6, 2019 at 7:25 PM 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_link_xdp_fd' with the progfd set to -1. > > Signed-off-by: Daniel T. Lee > --- > tools/bpf/bp

[v3,2/4] tools: bpftool: add net detach command to detach XDP on interface

2019-08-06 Thread Daniel T. Lee
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 - 1 file c