Thread (7 messages) 7 messages, 4 authors, 2015-02-06

Re: [RFC: add openvswitch actions using BPF 7/9] ofproto-dpif: Add eBPF program loader and runtime infrasturcure.

flat view

From: Joe Stringer <hidden>
Date: 2015-02-06 18:49:56

On 4 February 2015 at 14:49, Andy Zhou [off-list ref] wrote:
Added a eBPF program loader in ofproto-dpif layer. It only loades
the OVS programs.

Signed-off-by: Andy Zhou <redacted>
---
A little more precise: It only loads BPF programs with sections that
begin with the 'ovs' prefix.

There's a few scattered OVS style things like using ovs_scan(),
removing commented lines.
+#define BPF_UNIXCTL_CHECK(conn) \
+    if (bpf_unixctl_check_enable(conn) == -1) return
It seems unusual for OVS code to skimp on some "if(foo()) return"
logic by using a macro.
+static int
+bpf_unixctl_check_enable(struct unixctl_conn *conn)
Another minor style thing here, I think "check_enable" is ambiguous.
It's actually checking for datapath support for the feature. (I
realise there are other places in OVS that we do this, and I've been
meaning to clean them up).
quoted hunk ↗ jump to hunk
diff --git a/vswitchd/automake.mk b/vswitchd/automake.mk
index 80affe9..a94720b 100644
--- a/vswitchd/automake.mk
+++ b/vswitchd/automake.mk
@@ -19,6 +19,11 @@ vswitchd_ovs_vswitchd_LDFLAGS = $(AM_LDFLAGS) $(DPDK_vswitchd_LDFLAGS)
 EXTRA_DIST += vswitchd/INTERNALS
 MAN_ROOTS += vswitchd/ovs-vswitchd.8.in

+if LINUX
+vswitchd_ovs_vswitchd_LDADD += lib/libbpf.la
+vswitchd_ovs_vswitchd_LDADD += -lelf
+endif
+
Do we perform a check for the libelf dev headers and library anywhere
in the build process?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help