[PATCH bpf-next 2/2] samples: bpf: get ifindex from ifname

2018-10-18 Thread Matteo Croce
Find the ifindex via ioctl(SIOCGIFINDEX) instead of requiring the numeric ifindex. Signed-off-by: Matteo Croce --- samples/bpf/xdp1_user.c | 26 -- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/samples/bpf/xdp1_user.c b/samples/bpf/xdp1_user.c index 4f3d8

Re: [PATCH bpf-next 2/2] samples: bpf: get ifindex from ifname

2018-10-18 Thread John Fastabend
On 10/18/2018 01:47 PM, Matteo Croce wrote: > Find the ifindex via ioctl(SIOCGIFINDEX) instead of requiring the > numeric ifindex. > > Signed-off-by: Matteo Croce > --- I don't think there are any expectation that samples have to be stable as far as inputs over versions. And because I consistent

Re: [PATCH bpf-next 2/2] samples: bpf: get ifindex from ifname

2018-10-18 Thread Y Song
On Thu, Oct 18, 2018 at 1:48 PM Matteo Croce wrote: > > Find the ifindex via ioctl(SIOCGIFINDEX) instead of requiring the > numeric ifindex. Maybe use if_nametoindex which is simpler? > > Signed-off-by: Matteo Croce > --- > samples/bpf/xdp1_user.c | 26 -- > 1 file chan

Re: [PATCH bpf-next 2/2] samples: bpf: get ifindex from ifname

2018-10-19 Thread Matteo Croce
On Fri, Oct 19, 2018 at 5:35 AM Y Song wrote: > > On Thu, Oct 18, 2018 at 1:48 PM Matteo Croce wrote: > > > > Find the ifindex via ioctl(SIOCGIFINDEX) instead of requiring the > > numeric ifindex. > > Maybe use if_nametoindex which is simpler? > > > > > Signed-off-by: Matteo Croce > > --- > > s