On 03/03/2016 10:01 PM, Brenden Blanco wrote:
On Thu, Mar 3, 2016 at 11:31 AM, Daniel Borkmann <daniel@...>
On 03/03/2016 08:19 PM, Brenden Blanco via iovisor-dev wrote:Speaking of which, I just opened
On Thu, Mar 3, 2016 at 5:52 AM, O Mahony, Billy <billy.o.mahony@...[...]
#add a filter to accept all eth frame. Attach the bpf action? functionsPlus you may also want to try out cls_bpf with da (direct-action) mode.
to the filter?Yeah, it's a bit of black magic. it's basically creating a match-all rule
#I have no idea what the classid, target and keys parameters mean!
ip.tc("add-filter", "u32", ifindex_eth1, ":1", parent="ffff:",
ip.tc("add-filter", "u32", ifindex_eth3, ":1", parent="ffff:",
(match 0 bytes and offset 0 == true), with the matching action being the
bpf program. The classid and target aren't really meaningful with just one
action and filter, so it's ok to ignore for now.
The clsact qdisc added in 4.5 by Daniel Borkmann is a much better
abstraction for this, and I'll try to upstream some pyroute2 code to
That will save you the u32 match all classifier config and is faster.
https://github.com/svinota/pyroute2/pull/223 to add support in pyroute2
upstream. The docstring in that pull request shows an example usage, which
I'll also add to a testcase in bcc once it merges upstream.
I've done similar additions for go in
https://github.com/vishvananda/netlink/pull/94, if go is your thing.
That's awesome, thanks Brenden!