Re: [ovs-dev] attaching ebpf program to openvswitch vport driver

2020-01-03 Thread William Tu
Hi Nicolas, I was wrong. Actually with existing OVS internal device, the xdp generic mode works fine. Please see my test on kernel 5.3 below #!/bin/bash modprobe openvswitch ovs-dpctl add-dp br0 ip addr add dev br0 10.1.1.2/24 ip link set dev br0 up ip netns add at_ns0 ip link add p0 type veth

Re: [ovs-dev] attaching ebpf program to openvswitch vport driver

2019-12-17 Thread Nicolas Bouliane via dev
> > In function internal_dev_recv, currently it calls > netif_rx(skb) > and this skips the generic xdp code path. > > I wonder if it's ok to replace netif_rx with > netif_receive_skb(skb) > Then the generic xdp should work. > > Ohh, interesting, I'll check that ! cheers, Nick __

Re: [ovs-dev] attaching ebpf program to openvswitch vport driver

2019-12-17 Thread Nicolas Bouliane via dev
> > > because internal port is a loopback device, and packet > does not go through linux tc qdisc. So the attached ebpf > program through tc does not work. > Attach XDP program also does not work. > Oh I see ! > May I know your use case? > I'd like to attach an ebpf program to rate limit packets

Re: [ovs-dev] attaching ebpf program to openvswitch vport driver

2019-12-17 Thread William Tu
On Tue, Dec 17, 2019 at 07:59:42AM -0800, William Tu wrote: > On Tue, Dec 17, 2019 at 09:14:00AM -0500, Nicolas Bouliane wrote: > > > > > > > > > type of this port? > > > > > Internal > > > > We need to have an IP address set on the interface, which is why we use the > > internal type. > > > > >

Re: [ovs-dev] attaching ebpf program to openvswitch vport driver

2019-12-17 Thread William Tu
On Tue, Dec 17, 2019 at 09:14:00AM -0500, Nicolas Bouliane wrote: > > > > > > type of this port? > > > Internal > > We need to have an IP address set on the interface, which is why we use the > internal type. > > > > Can you share your "ovs-vsctl show" > > If meta0 is "type: internal", then it d

Re: [ovs-dev] attaching ebpf program to openvswitch vport driver

2019-12-17 Thread Nicolas Bouliane via dev
> > > type of this port? > Internal We need to have an IP address set on the interface, which is why we use the internal type. > Can you share your "ovs-vsctl show" > If meta0 is "type: internal", then it doesn't work. > Port "meta0" Interface "meta0" type: i

Re: [ovs-dev] attaching ebpf program to openvswitch vport driver

2019-12-13 Thread William Tu
On Fri, Dec 13, 2019 at 01:31:04PM -0500, Nicolas Bouliane via dev wrote: > Hi, > > I have a very simple ebpf program that just print something when a packet > goes through. When I attach the ebpf program to the TAP interface (tun > driver) of a virtual machine, I see the expected output as expect

[ovs-dev] attaching ebpf program to openvswitch vport driver

2019-12-13 Thread Nicolas Bouliane via dev
Hi, I have a very simple ebpf program that just print something when a packet goes through. When I attach the ebpf program to the TAP interface (tun driver) of a virtual machine, I see the expected output as expected. I'm monitoring with: cat /sys/kernel/debug/tracing/trace_pipe When I attach my