Netdev List
 help / color / mirror / Atom feed
* [RFC: add openvswitch actions using BPF 0/2]
@ 2015-02-04 22:48 Andy Zhou
       [not found] ` <1423090122-19807-1-git-send-email-azhou-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Andy Zhou @ 2015-02-04 22:48 UTC (permalink / raw)
  To: dev-yBygre7rU0SM8Zsap4Y0gw; +Cc: netdev-u79uwXL29TY76Z2rM5mHXA

Joe and I have been experimenting with BPF and its application for OVS.
This patch shows our attempt to implement ovs actions using eBPF.

The kernel changes are against the 'net-next'. The corresponding
user space changes will be post next.

This patch set implements an BPF action, that has the same interface
as current OVS output action. Instead of sending out a packet, it
only generates a kernel message.

This feature is neither complete nor useful as is.  We are mostly
interested in comments on: The infrastructure changes to support
and running BPF functions, and suggestions on extensions beyond
those patches.

Andy Zhou (2):
  BPF: add a new BPF program type BPF_PROG_TYPE_OPENVSWITCH
  openvswitch: implements the BPF_PROG action in datapath

 include/linux/bpf.h              |  2 +-
 include/uapi/linux/bpf.h         |  1 +
 include/uapi/linux/openvswitch.h | 29 ++++++++++++-
 net/Makefile                     |  4 +-
 net/openvswitch/Makefile         |  2 +
 net/openvswitch/actions.c        | 30 +++++++++++++
 net/openvswitch/bpf.c            | 87 +++++++++++++++++++++++++++++++++++++
 net/openvswitch/datapath.c       |  6 ++-
 net/openvswitch/flow_netlink.c   | 92 +++++++++++++++++++++++++++++++++++++++-
 net/openvswitch/flow_netlink.h   |  8 ++++
 10 files changed, 254 insertions(+), 7 deletions(-)
 create mode 100644 net/openvswitch/bpf.c

-- 
1.9.1

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [ovs-dev] [RFC: add openvswitch actions using BPF 2/2] openvswitch: implements the BPF_PROG action in datapath
@ 2015-02-05 20:49 Alexei Starovoitov
  0 siblings, 0 replies; 8+ messages in thread
From: Alexei Starovoitov @ 2015-02-05 20:49 UTC (permalink / raw)
  To: Andy Zhou; +Cc: Thomas Graf, dev@openvswitch.com, netdev@vger.kernel.org

On Thu, Feb 5, 2015 at 11:34 AM, Andy Zhou <azhou@nicira.com> wrote:
>>
>> I think it should be doable with BPF to have the verifier accept if
>> a helper is called with less args than expected, to initialize those
>> to 0. This would allow for helpers to support additional arguments.
> I am not sure it is fundamentally better than V2, v3...   On the other hand,
> I agree this looks technically possible.

yes. kinda.
the easiest is just have a flag-like argument in your helper
and as part of the program always pass zero to it initially.
Later when helper function becomes more advanced it will
start interpreting flag argument differently.
pretty much the same concept used everywhere else.

The helper functions need to be thought through
just like any other user interface.

>> It seems very doable to also allow for a BPF prog to be registered
>> upon flow table miss.
> Yes, this is possible, but at the cost of flow set up rate. It may
> still be practical
> with some optimization, such as caching action lists so we don't
> regenerate or download
> the same program.

Loading the program as soon as user space got a notification
on flow miss is definitely not efficient and not scalable.
Whereas having already loaded program to be called when
flow-miss happens makes a lot of sense.
In program-as-action proposal there are potentially N number
of programs for N flow rules (unless the same program
is used as action for all rules)
In program-after-flow-miss proposal, there is 1 program per
datapath or may be per-vport (so packets from different VMs
can be processed by different programs)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-02-05 20:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-04 22:48 [RFC: add openvswitch actions using BPF 0/2] Andy Zhou
     [not found] ` <1423090122-19807-1-git-send-email-azhou-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
2015-02-04 22:48   ` [RFC: add openvswitch actions using BPF 1/2] BPF: add a new BPF program type BPF_PROG_TYPE_OPENVSWITCH Andy Zhou
2015-02-05 14:48     ` [ovs-dev] " Thomas Graf
2015-02-05 19:47       ` Andy Zhou
2015-02-04 22:48   ` [RFC: add openvswitch actions using BPF 2/2] openvswitch: implements the BPF_PROG action in datapath Andy Zhou
2015-02-05 15:07     ` [ovs-dev] " Thomas Graf
2015-02-05 19:34       ` Andy Zhou
  -- strict thread matches above, loose matches on Subject: below --
2015-02-05 20:49 Alexei Starovoitov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox