summaryrefslogtreecommitdiffstats
path: root/recipes-networking/openvswitchdpdk/files
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-networking/openvswitchdpdk/files')
-rw-r--r--recipes-networking/openvswitchdpdk/files/0001-openvswitchdpdk-enabled-ptest.patch380
-rw-r--r--recipes-networking/openvswitchdpdk/files/configure-fix.patch12
-rw-r--r--recipes-networking/openvswitchdpdk/files/makefile-install-rule.patch22
-rwxr-xr-xrecipes-networking/openvswitchdpdk/files/openvswitchdpdk-controller279
-rw-r--r--recipes-networking/openvswitchdpdk/files/openvswitchdpdk-controller-setup29
-rw-r--r--recipes-networking/openvswitchdpdk/files/openvswitchdpdk-switch110
-rw-r--r--recipes-networking/openvswitchdpdk/files/openvswitchdpdk-switch-setup16
-rw-r--r--recipes-networking/openvswitchdpdk/files/ovs-ctl-dpdk.patch123
-rw-r--r--recipes-networking/openvswitchdpdk/files/qemu-makefile.patch26
-rw-r--r--recipes-networking/openvswitchdpdk/files/qemu-options-hx.patch30
-rw-r--r--recipes-networking/openvswitchdpdk/files/qemu-pixman-config.patch26
-rw-r--r--recipes-networking/openvswitchdpdk/files/run-ptest8
12 files changed, 1061 insertions, 0 deletions
diff --git a/recipes-networking/openvswitchdpdk/files/0001-openvswitchdpdk-enabled-ptest.patch b/recipes-networking/openvswitchdpdk/files/0001-openvswitchdpdk-enabled-ptest.patch
new file mode 100644
index 0000000..10f0df8
--- /dev/null
+++ b/recipes-networking/openvswitchdpdk/files/0001-openvswitchdpdk-enabled-ptest.patch
@@ -0,0 +1,380 @@
1From 1ea34b3e5bf1d386b9931f11dee89bc03f224852 Mon Sep 17 00:00:00 2001
2From: Radu Patriu <radu.patriu@enea.com>
3Date: Tue, 6 May 2014 13:02:10 +0000
4Subject: [PATCH] openvswitchdpdk: enabled ptest
5
6Signed-off-by: Radu Patriu <radu.patriu@enea.com>
7---
8 openvswitch/Makefile.am | 1 +
9 openvswitch/test.mk | 47 ++++++++++++++++++++++++++++++++++++
10 openvswitch/tests/dpdk-datapath.at | 48 ++++++++++++++++++-------------------
11 openvswitch/tests/dpdk-link.at | 2 +-
12 openvswitch/tests/dpif-dpdk.at | 30 +++++++++++------------
13 openvswitch/tests/flowgen.pl | 0
14 openvswitch/tests/netdev-dpdk.at | 2 +-
15 openvswitch/tests/ofproto-macros.at | 2 +-
16 openvswitch/tests/ovs-vport.at | 10 ++++----
17 9 files changed, 95 insertions(+), 47 deletions(-)
18 create mode 100644 openvswitch/test.mk
19 mode change 100644 => 100755 openvswitch/tests/flowgen.pl
20
21diff --git a/openvswitch/Makefile.am b/openvswitch/Makefile.am
22index d0edfa2..107ca89 100644
23--- a/openvswitch/Makefile.am
24+++ b/openvswitch/Makefile.am
25@@ -311,3 +311,4 @@ include xenserver/automake.mk
26 include python/automake.mk
27 include python/compat/automake.mk
28 include tutorial/automake.mk
29+include test.mk
30\ No newline at end of file
31diff --git a/openvswitch/test.mk b/openvswitch/test.mk
32new file mode 100644
33index 0000000..10f3629
34--- /dev/null
35+++ b/openvswitch/test.mk
36@@ -0,0 +1,47 @@
37+TEST_DEST ?= ${prefix}/lib/openvswitchdpdk/ptest
38+TEST_ROOT ?= ${prefix}/lib/openvswitchdpdk/ptest
39+TEST_DEPEND =
40+
41+if HAVE_OPENSSL
42+TEST_DEPEND += $(TESTPKI_FILES)
43+endif
44+
45+test-install: $(TEST_DEPEND)
46+ @list='$(noinst_PROGRAMS) $(EXTRA_DIST) $(dist_check_SCRIPTS) $(TEST_DEPEND) tests/atlocal tests/atconfig' ;\
47+ install -d $(TEST_DEST)/tests ;\
48+ install -d $(TEST_DEST)/python ;\
49+ install -d $(TEST_DEST)/python/ovs ;\
50+ install -d $(TEST_DEST)/python/ovs/db ;\
51+ install -d $(TEST_DEST)/python/ovs/unixctl ;\
52+ install -d $(TEST_DEST)/vswitchd ;\
53+ install vswitchd/vswitch.ovsschema $(TEST_DEST)/vswitchd ;\
54+ install -d $(TEST_DEST)/debian ;\
55+ install debian/ovs-monitor-ipsec $(TEST_DEST)/debian ;\
56+ install -d $(TEST_DEST)/build-aux ;\
57+ install build-aux/check-structs $(TEST_DEST)/build-aux ;\
58+ install -d $(TEST_DEST)/xenserver ;\
59+ install xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync $(TEST_DEST)/xenserver ;\
60+ install xenserver/opt_xensource_libexec_interface-reconfigure $(TEST_DEST)/xenserver ;\
61+ install xenserver/opt_xensource_libexec_InterfaceReconfigure.py $(TEST_DEST)/xenserver ;\
62+ install xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py $(TEST_DEST)/xenserver ;\
63+ install xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py $(TEST_DEST)/xenserver ;\
64+ for p in $$list ; do \
65+ echo $$p ;\
66+ p=$${p#./} ;\
67+ pre=$${p#tests\/} ;\
68+ if test $$pre != $$p ; then \
69+ echo installing $$p to $(TEST_DEST)/tests/$$pre ;\
70+ install $$p $(TEST_DEST)/tests/$$pre ;\
71+ continue ;\
72+ fi ;\
73+ pre=$${p#python\/ovs\/} ;\
74+ if test $$pre != $$p ; then \
75+ echo installing $$p to $(TEST_DEST)/python/ovs/$$pre ;\
76+ install $$p $(TEST_DEST)/python/ovs/$$pre ;\
77+ continue ;\
78+ fi; \
79+ done ;\
80+ sed -i 's|abs_builddir=.*|abs_builddir='"'"'$(TEST_ROOT)/tests'"'"'|g' $(TEST_DEST)/tests/atconfig
81+ sed -i 's|abs_srcdir=.*|abs_srcdir='"'"'$(TEST_ROOT)/tests'"'"'|g' $(TEST_DEST)/tests/atconfig
82+ sed -i 's|abs_top_srcdir=.*|abs_top_srcdir='"'"'$(TEST_ROOT)'"'"'|g' $(TEST_DEST)/tests/atconfig
83+ sed -i 's|abs_top_builddir=.*|abs_top_builddir='"'"'$(TEST_ROOT)'"'"'|g' $(TEST_DEST)/tests/atconfig
84diff --git a/openvswitch/tests/dpdk-datapath.at b/openvswitch/tests/dpdk-datapath.at
85index 5472ae3..16c5f3d 100644
86--- a/openvswitch/tests/dpdk-datapath.at
87+++ b/openvswitch/tests/dpdk-datapath.at
88@@ -28,47 +28,47 @@
89 m4_define([OVDK_CHECK_ACTION_EXECUTE],
90 [AT_BANNER([action_execute unit tests - dpdk datapath])
91 AT_SETUP([execute an output action])
92-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- action_execute_output], [0], [ignore], [])
93+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- action_execute_output], [0], [ignore], [])
94 AT_CLEANUP
95
96 AT_SETUP([execute an output action with invalid parameters])
97-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- action_execute_output__invalid_params], [0], [ignore], [])
98+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- action_execute_output__invalid_params], [0], [ignore], [])
99 AT_CLEANUP
100
101 AT_SETUP([execute a corrupt action])
102-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- action_execute_output__corrupt_action], [0], [ignore], [])
103+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- action_execute_output__corrupt_action], [0], [ignore], [])
104 AT_CLEANUP
105
106 AT_SETUP([execute a drop action])
107-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- action_execute_drop], [0], [ignore], [])
108+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- action_execute_drop], [0], [ignore], [])
109 AT_CLEANUP
110
111 AT_SETUP([execute a pop VLAN action])
112-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- action_execute_pop_vlan], [0], [ignore], [])
113+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- action_execute_pop_vlan], [0], [ignore], [])
114 AT_CLEANUP
115
116 AT_SETUP([execute a set ethernet action])
117-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- action_execute_set_ethernet], [0], [ignore], [])
118+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- action_execute_set_ethernet], [0], [ignore], [])
119 AT_CLEANUP
120
121 AT_SETUP([execute a set ipv4 action])
122-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- action_execute_set_ipv4], [0], [ignore], [])
123+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- action_execute_set_ipv4], [0], [ignore], [])
124 AT_CLEANUP
125
126 AT_SETUP([execute a push VLAN vid action])
127-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- action_execute_push_vlan__vid], [0], [ignore], [])
128+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- action_execute_push_vlan__vid], [0], [ignore], [])
129 AT_CLEANUP
130
131 AT_SETUP([execute a push VLAN pcp action])
132-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- action_execute_push_vlan__pcp], [0], [ignore], [])
133+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- action_execute_push_vlan__pcp], [0], [ignore], [])
134 AT_CLEANUP
135
136 AT_SETUP([execute multiple actions with three output actions])
137-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- action_execute_multiple_actions__three_output], [0], [ignore], [])
138+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- action_execute_multiple_actions__three_output], [0], [ignore], [])
139 AT_CLEANUP
140
141 AT_SETUP([execute multiple actions with a pop vlan and output action])
142-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- action_execute_multiple_actions__pop_vlan_and_output], [0], [ignore], [])
143+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- action_execute_multiple_actions__pop_vlan_and_output], [0], [ignore], [])
144 AT_CLEANUP
145 ])
146
147@@ -77,31 +77,31 @@ AT_CLEANUP
148 m4_define([OVDK_CHECK_FLOW_TABLE],
149 [AT_BANNER([flow table unit tests - dpdk datapath])
150 AT_SETUP([add a flow to the flow table])
151-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- flow_table_add_flow], [0], [ignore], [])
152+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- flow_table_add_flow], [0], [ignore], [])
153 AT_CLEANUP
154
155 AT_SETUP([delete a flow from the flow table])
156-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- flow_table_del_flow], [0], [ignore], [])
157+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- flow_table_del_flow], [0], [ignore], [])
158 AT_CLEANUP
159
160 AT_SETUP([delete all flows from the flow table])
161-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- flow_table_del_all], [0], [ignore], [])
162+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- flow_table_del_all], [0], [ignore], [])
163 AT_CLEANUP
164
165 AT_SETUP([get a flow from the flow table])
166-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- flow_table_get_flow], [0], [ignore], [])
167+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- flow_table_get_flow], [0], [ignore], [])
168 AT_CLEANUP
169
170 AT_SETUP([modify a flow in the flow table])
171-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- flow_table_mod_flow], [0], [ignore], [])
172+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- flow_table_mod_flow], [0], [ignore], [])
173 AT_CLEANUP
174
175 AT_SETUP([get the first flow from the flow table])
176-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- flow_table_get_first_flow], [0], [ignore], [])
177+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- flow_table_get_first_flow], [0], [ignore], [])
178 AT_CLEANUP
179
180 AT_SETUP([get the next flow from the flow table])
181-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- flow_table_get_next_flow], [0], [ignore], [])
182+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- flow_table_get_next_flow], [0], [ignore], [])
183 AT_CLEANUP
184 ])
185
186@@ -110,27 +110,27 @@ AT_CLEANUP
187 m4_define([OVDK_CHECK_STATS],
188 [AT_BANNER([stats unit tests - dpdk datapath])
189 AT_SETUP([increment stats for all vports])
190-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- stats_vport_xxx_increment], [0], [ignore], [])
191+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- stats_vport_xxx_increment], [0], [ignore], [])
192 AT_CLEANUP
193
194 AT_SETUP([get stats for all vports])
195-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- stats_vport_xxx_get], [0], [ignore], [])
196+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- stats_vport_xxx_get], [0], [ignore], [])
197 AT_CLEANUP
198
199 AT_SETUP([clear stats for all vports])
200-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- stats_vport_xxx_clear], [0], [ignore], [])
201+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- stats_vport_xxx_clear], [0], [ignore], [])
202 AT_CLEANUP
203
204 AT_SETUP([increment stats for the vswitch])
205-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- stats_vswitch_increment], [0], [ignore], [])
206+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- stats_vswitch_increment], [0], [ignore], [])
207 AT_CLEANUP
208
209 AT_SETUP([get stats for the vswitch])
210-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- stats_vswitch_get], [0], [ignore], [])
211+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- stats_vswitch_get], [0], [ignore], [])
212 AT_CLEANUP
213
214 AT_SETUP([clear stats for the vswitch])
215-AT_CHECK([sudo -E $srcdir/dpdk/test-datapath -c 1 -n 4 -- stats_vswitch_clear], [0], [ignore], [])
216+AT_CHECK([$srcdir/dpdk/test-datapath -c 1 -n 4 -- stats_vswitch_clear], [0], [ignore], [])
217 AT_CLEANUP
218 ])
219
220diff --git a/openvswitch/tests/dpdk-link.at b/openvswitch/tests/dpdk-link.at
221index accfde9..c119668 100644
222--- a/openvswitch/tests/dpdk-link.at
223+++ b/openvswitch/tests/dpdk-link.at
224@@ -29,7 +29,7 @@
225 m4_define([CHECK_DPDK_LINK],
226 [AT_BANNER([dpdk-link tests])
227 AT_SETUP([Check negative cases for dpdk-link.c])
228-AT_CHECK([sudo -E $srcdir/test-dpdk-link -c 1 -n 4], [0], [ignore], [])
229+AT_CHECK([$srcdir/test-dpdk-link -c 1 -n 4], [0], [ignore], [])
230 AT_CLEANUP
231 ])
232
233diff --git a/openvswitch/tests/dpif-dpdk.at b/openvswitch/tests/dpif-dpdk.at
234index 55b3505..b62d146 100644
235--- a/openvswitch/tests/dpif-dpdk.at
236+++ b/openvswitch/tests/dpif-dpdk.at
237@@ -2,63 +2,63 @@ m4_define([CHECK_DPIF_DPDK],
238
239 [AT_BANNER([Test dpif-dpdk.c ])
240 AT_SETUP([Test dpif_dpdk_get_stats])
241-AT_CHECK([sudo -E $srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_get_stats], [0], [ignore], [])
242+AT_CHECK([$srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_get_stats], [0], [ignore], [])
243 AT_CLEANUP
244
245 AT_SETUP([Test dpif_dpdk_port_add])
246-AT_CHECK([sudo -E $srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_port_add], [0], [ignore], [ignore])
247+AT_CHECK([$srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_port_add], [0], [ignore], [ignore])
248 AT_CLEANUP
249
250 AT_SETUP([Test dpif_dpdk_port_del])
251-AT_CHECK([sudo -E $srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_port_del], [0], [ignore], [])
252+AT_CHECK([$srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_port_del], [0], [ignore], [])
253 AT_CLEANUP
254
255 AT_SETUP([Test dpif_dpdk_port_query_by_number])
256-AT_CHECK([sudo -E $srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_port_query_by_number], [0], [ignore], [ignore])
257+AT_CHECK([$srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_port_query_by_number], [0], [ignore], [ignore])
258 AT_CLEANUP
259
260 AT_SETUP([Test dpif_dpdk_port_query_by_name])
261-AT_CHECK([sudo -E $srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_port_query_by_name], [0], [ignore], [ignore])
262+AT_CHECK([$srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_port_query_by_name], [0], [ignore], [ignore])
263 AT_CLEANUP
264
265 AT_SETUP([Test dpif_dpdk_get_max_ports])
266-AT_CHECK([sudo -E $srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_get_max_ports], [0], [ignore], [])
267+AT_CHECK([$srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_get_max_ports], [0], [ignore], [])
268 AT_CLEANUP
269
270 AT_SETUP([Test dpif_dpdk_port_dump_start])
271-AT_CHECK([sudo -E $srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_port_dump_start], [0], [ignore], [])
272+AT_CHECK([$srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_port_dump_start], [0], [ignore], [])
273 AT_CLEANUP
274
275 AT_SETUP([Test dpif_dpdk_port_dump_next])
276-AT_CHECK([sudo -E $srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_port_dump_next], [0], [ignore], [])
277+AT_CHECK([$srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_port_dump_next], [0], [ignore], [])
278 AT_CLEANUP
279
280 AT_SETUP([Test dpif_dpdk_port_dump_done])
281-AT_CHECK([sudo -E $srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_port_dump_done], [0], [ignore], [])
282+AT_CHECK([$srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_port_dump_done], [0], [ignore], [])
283 AT_CLEANUP
284
285 AT_SETUP([Test dpif_dpdk_port_poll])
286-AT_CHECK([sudo -E $srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_port_poll], [0], [ignore], [])
287+AT_CHECK([$srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_port_poll], [0], [ignore], [])
288 AT_CLEANUP
289
290 AT_SETUP([Test dpif_dpdk_port_poll_wait])
291-AT_CHECK([sudo -E $srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_port_poll_wait], [0], [ignore], [])
292+AT_CHECK([$srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_port_poll_wait], [0], [ignore], [])
293 AT_CLEANUP
294
295 AT_SETUP([Test dpif_dpdk_flow_put])
296-AT_CHECK([sudo -E $srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_flow_put], [0], [ignore], [])
297+AT_CHECK([$srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_flow_put], [0], [ignore], [])
298 AT_CLEANUP
299
300 AT_SETUP([Test dpif_dpdk_flow_del])
301-AT_CHECK([sudo -E $srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_flow_del], [0], [ignore], [])
302+AT_CHECK([$srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_flow_del], [0], [ignore], [])
303 AT_CLEANUP
304
305 AT_SETUP([Test dpif_dpdk_flow_dump_start])
306-AT_CHECK([sudo -E $srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_flow_dump_start], [0], [ignore], [])
307+AT_CHECK([$srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_flow_dump_start], [0], [ignore], [])
308 AT_CLEANUP
309
310 AT_SETUP([Test dpif_dpdk_flow_dump_next])
311-AT_CHECK([sudo -E $srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_flow_dump_next], [0], [ignore], [])
312+AT_CHECK([$srcdir/test-dpif-dpdk -c 1 -n 4 -- --dpif_dpdk_flow_dump_next], [0], [ignore], [])
313 AT_CLEANUP
314 ])
315 CHECK_DPIF_DPDK([])
316diff --git a/openvswitch/tests/flowgen.pl b/openvswitch/tests/flowgen.pl
317old mode 100644
318new mode 100755
319diff --git a/openvswitch/tests/netdev-dpdk.at b/openvswitch/tests/netdev-dpdk.at
320index df4cd89..d314e3c 100644
321--- a/openvswitch/tests/netdev-dpdk.at
322+++ b/openvswitch/tests/netdev-dpdk.at
323@@ -3,7 +3,7 @@ m4_define([CHECK_DPIF_DPDK],
324 [AT_BANNER([Test netdev-dpdk.c ])
325
326 AT_SETUP([Test netdev_dpdk_change_seq])
327-AT_CHECK([sudo -E $srcdir/test-netdev-dpdk --netdev_dpdk_test_change_seq], [0], [ignore], [])
328+AT_CHECK([$srcdir/test-netdev-dpdk --netdev_dpdk_test_change_seq], [0], [ignore], [])
329 AT_CLEANUP
330
331 ])
332diff --git a/openvswitch/tests/ofproto-macros.at b/openvswitch/tests/ofproto-macros.at
333index 839d41f..ef291dd 100644
334--- a/openvswitch/tests/ofproto-macros.at
335+++ b/openvswitch/tests/ofproto-macros.at
336@@ -73,7 +73,7 @@ m4_define([OVS_VSWITCHD_START],
337 AT_CHECK([ovs-vsctl --no-wait init])
338
339 dnl Start ovs-vswitchd.
340- AT_CHECK([ovs-vswitchd --detach --no-chdir --pidfile --enable-dummy$3 --disable-system --log-file -vvconn -vofproto_dpif], [0], [], [stderr])
341+ AT_CHECK([ovs-vswitchd -c 1 -n 4 -- --detach --no-chdir --pidfile --enable-dummy$3 --disable-system --log-file -vvconn -vofproto_dpif], [0], [ignore], [stderr])
342 AT_CAPTURE_FILE([ovs-vswitchd.log])
343 AT_CHECK([[sed < stderr '
344 /vlog|INFO|opened log file/d
345diff --git a/openvswitch/tests/ovs-vport.at b/openvswitch/tests/ovs-vport.at
346index 5f6857c..19d87cc 100644
347--- a/openvswitch/tests/ovs-vport.at
348+++ b/openvswitch/tests/ovs-vport.at
349@@ -6,23 +6,23 @@ m4_define([OVDK_CHECK_LIBVPORT],
350 [AT_BANNER([libvport/ovs-vport unit tests - dpdk datapath])
351
352 AT_SETUP([check vports are valid])
353-AT_CHECK([sudo -E $srcdir/dpdk/test-ovs-vport -c 1 -n 4 -- valid_vport], [0], [ignore], [])
354+AT_CHECK([$srcdir/dpdk/test-ovs-vport -c 1 -n 4 -- valid_vport], [0], [ignore], [])
355 AT_CLEANUP
356
357 AT_SETUP([check client rings are found])
358-AT_CHECK([sudo -E $srcdir/dpdk/test-ovs-vport -c 1 -n 4 -- vport_client_lookup], [0], [ignore], [])
359+AT_CHECK([$srcdir/dpdk/test-ovs-vport -c 1 -n 4 -- vport_client_lookup], [0], [ignore], [])
360 AT_CLEANUP
361
362 AT_SETUP([check kni fifos are found])
363-AT_CHECK([sudo -E $srcdir/dpdk/test-ovs-vport -c 1 -n 4 -- vport_kni_lookup], [0], [ignore], [])
364+AT_CHECK([$srcdir/dpdk/test-ovs-vport -c 1 -n 4 -- vport_kni_lookup], [0], [ignore], [])
365 AT_CLEANUP
366
367 AT_SETUP([check packet mempool is found])
368-AT_CHECK([sudo -E $srcdir/dpdk/test-ovs-vport -c 1 -n 4 -- lookup_packet_mempool], [0], [ignore], [])
369+AT_CHECK([$srcdir/dpdk/test-ovs-vport -c 1 -n 4 -- lookup_packet_mempool], [0], [ignore], [])
370 AT_CLEANUP
371
372 AT_SETUP([check port names are valid])
373-AT_CHECK([sudo -E $srcdir/dpdk/test-ovs-vport -c 1 -n 4 -- is_vport_name_valid], [0], [ignore], [])
374+AT_CHECK([$srcdir/dpdk/test-ovs-vport -c 1 -n 4 -- is_vport_name_valid], [0], [ignore], [])
375 AT_CLEANUP
376
377 ])
378--
3791.8.5.2
380
diff --git a/recipes-networking/openvswitchdpdk/files/configure-fix.patch b/recipes-networking/openvswitchdpdk/files/configure-fix.patch
new file mode 100644
index 0000000..187e8a0
--- /dev/null
+++ b/recipes-networking/openvswitchdpdk/files/configure-fix.patch
@@ -0,0 +1,12 @@
1Index: files/configure.ac
2===================================================================
3--- files.orig/openvswitch/configure.ac 2014-03-26 16:49:44.000000000 +0200
4+++ files/openvswitch/configure.ac 2014-04-18 16:47:28.163114309 +0300
5@@ -47,6 +47,7 @@
6 AC_SEARCH_LIBS([clock_gettime], [rt])
7 AC_SEARCH_LIBS([timer_create], [rt])
8 AC_SEARCH_LIBS([pthread_sigmask], [pthread])
9+AC_SEARCH_LIBS([dlopen], [dl])
10 AC_FUNC_STRERROR_R
11
12 OVS_CHECK_ESX
diff --git a/recipes-networking/openvswitchdpdk/files/makefile-install-rule.patch b/recipes-networking/openvswitchdpdk/files/makefile-install-rule.patch
new file mode 100644
index 0000000..2609870
--- /dev/null
+++ b/recipes-networking/openvswitchdpdk/files/makefile-install-rule.patch
@@ -0,0 +1,22 @@
1Index: dpdk-ovs/openvswitch/datapath/dpdk/Makefile
2===================================================================
3--- dpdk-ovs.orig/openvswitch/datapath/dpdk/Makefile 2014-04-18 14:06:01.219379540 +0300
4+++ dpdk-ovs/openvswitch/datapath/dpdk/Makefile 2014-04-22 16:24:27.009689498 +0300
5@@ -77,3 +77,6 @@
6
7 clean-vport_ut:
8 $(MAKE) -f Makefile.vport_ut clean
9+
10+install:
11+
12Index: dpdk-ovs/openvswitch/datapath/dpdk/fd_link/Makefile
13===================================================================
14--- dpdk-ovs.orig/openvswitch/datapath/dpdk/fd_link/Makefile 2014-04-18 14:06:01.219379540 +0300
15+++ dpdk-ovs/openvswitch/datapath/dpdk/fd_link/Makefile 2014-04-22 16:24:24.185689575 +0300
16@@ -53,3 +53,6 @@
17
18 check-recursive:
19 $(warning "This target is not implemented")
20+
21+install:
22+
diff --git a/recipes-networking/openvswitchdpdk/files/openvswitchdpdk-controller b/recipes-networking/openvswitchdpdk/files/openvswitchdpdk-controller
new file mode 100755
index 0000000..fdd5a46
--- /dev/null
+++ b/recipes-networking/openvswitchdpdk/files/openvswitchdpdk-controller
@@ -0,0 +1,279 @@
1#!/bin/sh
2#
3# Copyright (c) 2011 Nicira Networks Inc.
4# Copyright (c) 2007, 2009 Javier Fernandez-Sanguino <jfs@debian.org>
5#
6# This is free software; you may redistribute it and/or modify
7# it under the terms of the GNU General Public License as
8# published by the Free Software Foundation; either version 2,
9# or (at your option) any later version.
10#
11# This is distributed in the hope that it will be useful, but
12# WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License with
17# the Debian operating system, in /usr/share/common-licenses/GPL; if
18# not, write to the Free Software Foundation, Inc., 59 Temple Place,
19# Suite 330, Boston, MA 02111-1307 USA
20#
21### BEGIN INIT INFO
22# Provides: openvswitch-controller
23# Required-Start: $network $local_fs $remote_fs
24# Required-Stop: $remote_fs
25# Should-Start: $named
26# Should-Stop:
27# Default-Start: 2 3 4 5
28# Default-Stop: 0 1 6
29# Short-Description: Open vSwitch controller
30### END INIT INFO
31
32INSTALLPREFIX=
33
34if [ -n "$INSTALLPREFIX" ]
35then
36 PATH=$INSTALLPREFIX/sbin:$INSTALLPREFIX/bin:$PATH
37fi
38
39DAEMON=$INSTALLPREFIX/bin/ovs-controller # Introduce the server's location here
40NAME=ovs-controller # Introduce the short server's name here
41DESC=ovs-controller # Introduce a short description here
42LOGDIR=$INSTALLPREFIX/var/log/openvswitch # Log directory to use
43
44PIDFILE=$INSTALLPREFIX/var/run/openvswitch/$NAME.pid
45
46test -x $DAEMON || exit 0
47
48. /lib/lsb/init-functions
49
50# Default options, these can be overriden by the information
51# at /etc/default/openvswitchdpdk-controller
52DAEMON_OPTS="" # Additional options given to the server
53
54DODTIME=10 # Time to wait for the server to die, in seconds
55 # If this value is set too low you might not
56 # let some servers to die gracefully and
57 # 'restart' will not work
58
59LOGFILE=$LOGDIR/$NAME.log # Server logfile
60#DAEMONUSER= # User to run the daemons as. If this value
61 # is set start-stop-daemon will chuid the server
62
63# Include defaults if available
64default=/etc/default/openvswitchdpdk-controller
65if [ -f $default ] ; then
66 . $default
67fi
68
69# Check that the user exists (if we set a user)
70# Does the user exist?
71if [ -n "$DAEMONUSER" ] ; then
72 if getent passwd | grep -q "^$DAEMONUSER:"; then
73 # Obtain the uid and gid
74 DAEMONUID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $3}'`
75 DAEMONGID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $4}'`
76 else
77 log_failure_msg "The user $DAEMONUSER, required to run $NAME does not exist."
78 exit 1
79 fi
80fi
81
82
83set -e
84
85running_pid() {
86# Check if a given process pid's cmdline matches a given name
87 pid=$1
88 name=$2
89 [ -z "$pid" ] && return 1
90 [ ! -d /proc/$pid ] && return 1
91 cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1`
92 # Is this the expected server
93 [ "$cmd" != "$name" ] && return 1
94 return 0
95}
96
97running() {
98# Check if the process is running looking at /proc
99# (works for all users)
100
101 # No pidfile, probably no daemon present
102 [ ! -f "$PIDFILE" ] && return 1
103 pid=`cat $PIDFILE`
104 running_pid $pid $DAEMON || return 1
105 return 0
106}
107
108start_server() {
109 if [ -z "$LISTEN" ]; then
110 echo "$default: No connection methods configured, controller disabled" >&2
111 exit 0
112 fi
113
114 if [ ! -d $INSTALLPREFIX/var/run/openvswitch ]; then
115 install -d -m 755 -o root -g root $INSTALLPREFIX/var/run/openvswitch
116 fi
117
118 SSL_OPTS=
119 case $LISTEN in
120 *ssl*)
121 : ${PRIVKEY:=$INSTALLPREFIX/etc/openvswitch-controller/privkey.pem}
122 : ${CERT:=$INSTALLPREFIX/etc/openvswitch-controller/cert.pem}
123 : ${CACERT:=$INSTALLPREFIX/etc/openvswitch-controller/cacert.pem}
124 if test ! -e "$PRIVKEY" || test ! -e "$CERT" ||
125 test ! -e "$CACERT"; then
126 if test ! -e "$PRIVKEY"; then
127 echo "$PRIVKEY: private key missing" >&2
128 fi
129 if test ! -e "$CERT"; then
130 echo "$CERT: certificate for private key missing" >&2
131 fi
132 if test ! -e "$CACERT"; then
133 echo "$CACERT: CA certificate missing" >&2
134 fi
135 exit 1
136 fi
137 SSL_OPTS="--private-key=$PRIVKEY --certificate=$CERT --ca-cert=$CACERT"
138 ;;
139 esac
140
141# Start the process using the wrapper
142 if [ -z "$DAEMONUSER" ] ; then
143 start-stop-daemon --start --pidfile $PIDFILE \
144 --exec $DAEMON -- --detach --pidfile=$PIDFILE \
145 $LISTEN $DAEMON_OPTS $SSL_OPTS
146 errcode=$?
147 else
148# if we are using a daemonuser then change the user id
149 start-stop-daemon --start --quiet --pidfile $PIDFILE \
150 --chuid $DAEMONUSER --exec $DAEMON -- \
151 --detach --pidfile=$PIDFILE $LISTEN $DAEMON_OPTS \
152 $SSL_OPTS
153 errcode=$?
154 fi
155 return $errcode
156}
157
158stop_server() {
159# Stop the process using the wrapper
160 if [ -z "$DAEMONUSER" ] ; then
161 start-stop-daemon --stop --quiet --pidfile $PIDFILE \
162 --exec $DAEMON
163 errcode=$?
164 else
165# if we are using a daemonuser then look for process that match
166 start-stop-daemon --stop --quiet --pidfile $PIDFILE \
167 --user $DAEMONUSER --exec $DAEMON
168 errcode=$?
169 fi
170
171 return $errcode
172}
173
174reload_server() {
175 [ ! -f "$PIDFILE" ] && return 1
176 pid=`cat $PIDFILE` # This is the daemon's pid
177 # Send a SIGHUP
178 kill -1 $pid
179 return $?
180}
181
182force_stop() {
183# Force the process to die killing it manually
184 [ ! -e "$PIDFILE" ] && return
185 if running ; then
186 kill -15 $pid
187 # Is it really dead?
188 sleep "$DODTIME"
189 if running ; then
190 kill -9 $pid
191 sleep "$DODTIME"
192 if running ; then
193 echo "Cannot kill $NAME (pid=$pid)!"
194 exit 1
195 fi
196 fi
197 fi
198 rm -f $PIDFILE
199}
200
201
202case "$1" in
203 start)
204 log_begin_msg "Starting $DESC " "$NAME"
205 # Check if it's running first
206 if running ; then
207 log_warning_msg "apparently already running"
208 log_end_msg 0
209 exit 0
210 fi
211 if start_server && running ; then
212 # It's ok, the server started and is running
213 log_end_msg 0
214 else
215 # Either we could not start it or it is not running
216 # after we did
217 # NOTE: Some servers might die some time after they start,
218 # this code does not try to detect this and might give
219 # a false positive (use 'status' for that)
220 log_end_msg 1
221 fi
222 ;;
223 stop)
224 log_begin_msg "Stopping $DESC" "$NAME"
225 if running ; then
226 # Only stop the server if we see it running
227 stop_server
228 log_end_msg $?
229 else
230 # If it's not running don't do anything
231 log_warning_msg "apparently not running"
232 log_end_msg 0
233 exit 0
234 fi
235 ;;
236 force-stop)
237 # First try to stop gracefully the program
238 $0 stop
239 if running; then
240 # If it's still running try to kill it more forcefully
241 log_begin_msg "Stopping (force) $DESC" "$NAME"
242 force_stop
243 log_end_msg $?
244 fi
245 ;;
246 restart|force-reload)
247 log_begin_msg "Restarting $DESC" "$NAME"
248 stop_server
249 # Wait some sensible amount, some server need this
250 [ -n "$DODTIME" ] && sleep $DODTIME
251 start_server
252 running
253 log_end_msg $?
254 ;;
255 status)
256
257 log_begin_msg "Checking status of $DESC" "$NAME"
258 if running ; then
259 log_begin_msg "running"
260 log_end_msg 0
261 else
262 log_warning_msg "apparently not running"
263 log_end_msg 1
264 exit 1
265 fi
266 ;;
267 # Use this if the daemon cannot reload
268 reload)
269 log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon"
270 log_warning_msg "cannot re-read the config file (use restart)."
271 ;;
272 *)
273 N=/etc/init.d/openvswitchdpdk-controller
274 echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2
275 exit 1
276 ;;
277esac
278
279exit 0
diff --git a/recipes-networking/openvswitchdpdk/files/openvswitchdpdk-controller-setup b/recipes-networking/openvswitchdpdk/files/openvswitchdpdk-controller-setup
new file mode 100644
index 0000000..507a85e
--- /dev/null
+++ b/recipes-networking/openvswitchdpdk/files/openvswitchdpdk-controller-setup
@@ -0,0 +1,29 @@
1# This is a POSIX shell fragment -*- sh -*-
2
3# LISTEN: What OpenFlow connection methods should the controller listen on?
4#
5# This is a space-delimited list of connection methods:
6#
7# * "pssl:[PORT]": Listen for SSL connections on the specified PORT
8# (default: 6633). The private key, certificate, and CA certificate
9# must be specified below.
10#
11# * "ptcp:[PORT]": Listen for TCP connections on the specified PORT
12# (default: 6633). Not recommended for security reasons.
13#
14LISTEN="ptcp:"
15
16# PRIVKEY: Name of file containing controller's private key.
17# Required if SSL enabled.
18PRIVKEY=$INSTALLPREFIX/etc/openvswitch-controller/privkey.pem
19
20# CERT: Name of file containing certificate for private key.
21# Required if SSL enabled.
22CERT=$INSTALLPREFIX/etc/openvswitch-controller/cert.pem
23
24# CACERT: Name of file containing switch CA certificate.
25# Required if SSL enabled.
26CACERT=$INSTALLPREFIX/etc/openvswitch-controller/cacert.pem
27
28# Additional options to pass to controller, e.g. "--hub"
29DAEMON_OPTS=""
diff --git a/recipes-networking/openvswitchdpdk/files/openvswitchdpdk-switch b/recipes-networking/openvswitchdpdk/files/openvswitchdpdk-switch
new file mode 100644
index 0000000..051d4d7
--- /dev/null
+++ b/recipes-networking/openvswitchdpdk/files/openvswitchdpdk-switch
@@ -0,0 +1,110 @@
1#! /bin/sh
2#
3# Copyright (C) 2011 Nicira Networks, Inc.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at:
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17### BEGIN INIT INFO
18# Provides: openvswitch-switch
19# Required-Start: $network $named $remote_fs $syslog
20# Required-Stop: $remote_fs
21# Default-Start: 2 3 4 5
22# Default-Stop: 0 1 6
23# Short-Description: Open vSwitch switch
24### END INIT INFO
25
26
27INSTALLPREFIX=
28
29if [ -n "$INSTALLPREFIX" ]
30then
31 PATH=$INSTALLPREFIX/sbin:$INSTALLPREFIX/bin:$PATH
32fi
33
34(test -x $INSTALLPREFIX/sbin/ovs-vswitchd && test -x $INSTALLPREFIX/sbin/ovsdb-server) || exit 0
35
36. $INSTALLPREFIX/share/openvswitch/scripts/ovs-lib
37test -e /etc/default/openvswitchdpdk-switch && . /etc/default/openvswitchdpdk-switch
38
39if test X"$BRCOMPAT" = Xyes && test ! -x $INSTALLPREFIX/sbin/ovs-brcompatd; then
40 BRCOMPAT=no
41 log_warning_msg "ovs-brcompatd missing, disabling bridge compatibility"
42fi
43
44ovs_ctl () {
45 set $INSTALLPREFIX/share/openvswitch/scripts/ovs-ctl "$@"
46 if test X"$BRCOMPAT" = Xyes; then
47 set "$@" --brcompat
48 fi
49 "$@"
50}
51
52load_kmod () {
53 ovs_ctl load-kmod || exit $?
54}
55
56start () {
57 if ovs_ctl load-kmod; then
58 :
59 else
60 echo "Module has probably not been built for this kernel."
61 if ! test -d $INSTALLPREFIX/share/doc/openvswitch-datapath-source; then
62 echo "Install the openvswitch-datapath-source package, then read"
63 else
64 echo "For instructions, read"
65 fi
66 echo "$INSTALLPREFIX/share/doc/openvswitch-datapath-source/README.Debian"
67 fi
68 set ovs_ctl ${1-start} --system-id=random
69 if test X"$FORCE_COREFILES" != X; then
70 set "$@" --force-corefiles="$FORCE_COREFILES"
71 fi
72 "$@" || exit $?
73
74 ovs_ctl --protocol=gre enable-protocol
75}
76
77stop () {
78 ovs_ctl stop
79}
80
81case $1 in
82 start)
83 start
84 ;;
85 stop | force-stop)
86 stop
87 ;;
88 reload | force-reload)
89 # The OVS daemons keep up-to-date.
90 ;;
91 restart)
92 stop
93 start
94 ;;
95 status)
96 ovs_ctl status
97 ;;
98 force-reload-kmod)
99 start force-reload-kmod
100 ;;
101 load-kmod)
102 load_kmod
103 ;;
104 *)
105 echo "Usage: $0 {start|stop|restart|force-reload|status|force-stop|force-reload-kmod|load-kmod}" >&2
106 exit 1
107 ;;
108esac
109
110exit 0
diff --git a/recipes-networking/openvswitchdpdk/files/openvswitchdpdk-switch-setup b/recipes-networking/openvswitchdpdk/files/openvswitchdpdk-switch-setup
new file mode 100644
index 0000000..84cea1f
--- /dev/null
+++ b/recipes-networking/openvswitchdpdk/files/openvswitchdpdk-switch-setup
@@ -0,0 +1,16 @@
1# This is a POSIX shell fragment -*- sh -*-
2
3# FORCE_COREFILES: If 'yes' then core files will be enabled.
4# FORCE_COREFILES=yes
5
6# BRCOMPAT: If 'yes' and the openvswitch-brcompat package is installed, then
7# Linux bridge compatibility will be enabled.
8# BRCOMPAT=yes
9
10#modify according to platform
11export OVS_DPDK_PARAMS=${OVS_DPDK_PARAMS:-"@OVS_DPDK_PARAMS_DEFAULT"}
12export OVS_VSWITCHD_PARAMS=${OVS_VSWITCHD_PARAMS:-"@OVS_VSWITCHD_PARAMS_DEFAULT"}
13#for debugging redirect to a regular file - this should be done temporary
14#if permanent logging is required a service like logrotate is recommended to limit the size of the log file
15export OVS_DPDK_LOG=${OVS_DPDK_LOG:-"@OVS_DPDK_LOG_DEFAULT"}
16
diff --git a/recipes-networking/openvswitchdpdk/files/ovs-ctl-dpdk.patch b/recipes-networking/openvswitchdpdk/files/ovs-ctl-dpdk.patch
new file mode 100644
index 0000000..bbe7a32
--- /dev/null
+++ b/recipes-networking/openvswitchdpdk/files/ovs-ctl-dpdk.patch
@@ -0,0 +1,123 @@
1Add ovs-vswitchd dpdk parameters and ovs_dpdk daemon calls.
2
3Signed-off-by: Radu Patriu <radu.patriu@enea.com>
4Upstream-Status: Pending
5
6Index: git/openvswitch/utilities/ovs-ctl.in
7===================================================================
8--- git.orig/openvswitch/utilities/ovs-ctl.in 2014-05-22 14:48:48.505319435 +0300
9+++ git/openvswitch/utilities/ovs-ctl.in 2014-05-22 15:05:46.437302665 +0300
10@@ -13,6 +13,15 @@
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14+#OVS_DPDK_PARAMS_DEFAULT to be replaced by install script
15+OVS_DPDK_PARAMS=${OVS_DPDK_PARAMS:-"@OVS_DPDK_PARAMS_DEFAULT"}
16+
17+#OVS_VSWITCHD_PARAMS_DEFAULT to be replaced by install script
18+OVS_VSWITCHD_PARAMS=${OVS_VSWITCHD_PARAMS:-"@OVS_VSWITCHD_PARAMS_DEFAULT"}
19+
20+#OVS_DPDK_LOG_DEFAULT to be replaced by install script
21+OVS_DPDK_LOG=${OVS_DPDK_LOG:-"@OVS_DPDK_LOG_DEFAULT"}
22+
23 case $0 in
24 */*) dir0=`echo "$0" | sed 's,/[^/]*$,,'` ;;
25 *) dir0=./ ;;
26@@ -106,7 +115,7 @@
27 set_system_ids () {
28 set ovs_vsctl set Open_vSwitch .
29
30- OVS_VERSION=`ovs-vswitchd --version | sed 's/.*) //;1q'`
31+ OVS_VERSION=`ovs-vswitchd -c 0x01 -n 4 --proc-type=auto -m 4 -- --version | sed -n 's/ovs-vswitchd (Open vSwitch) \(.*\)/\1/p'`
32 set "$@" ovs-version="$OVS_VERSION"
33
34 case $SYSTEM_ID in
35@@ -215,9 +224,39 @@
36 db:Open_vSwitch,Open_vSwitch,manager_options
37 }
38
39+start_dpdk () {
40+ if daemon_is_running ovs_dpdk; then
41+ log_success_msg "ovs_dpdk is already running"
42+ else
43+ modprobe uio
44+ test -e /sys/module/igb_uio || insmod $datadir/../openvswitchdpdk/kmod/igb_uio.ko
45+ test -e /sys/module/rte_kni || insmod $datadir/../openvswitchdpdk/kmod/rte_kni.ko
46+ rm -f $rundir/ovs_dpdk.pid
47+ start-stop-daemon --start --quiet --background --make-pidfile --pidfile $rundir/ovs_dpdk.pid --exec /bin/sh -- -c "exec ovs_dpdk $OVS_DPDK_PARAMS >> $OVS_DPDK_LOG 2>&1"
48+ #wait for ovs_dpdk to initialize before starting ovs-vswitchd
49+ sleep 10
50+ fi
51+}
52+
53+stop_dpdk () {
54+ pid=`cat "$rundir/ovs_dpdk.pid"`
55+ rtemaps=`test -e /proc/$pid/maps && cat /proc/$pid/maps | grep -o '/.*rtemap_.*$'`
56+
57+ stop_daemon ovs_dpdk
58+
59+ #try to clean
60+ for rtemap in $rtemaps
61+ do
62+ rm -f $rtemap
63+ done
64+ rm -f $rundir/ovs_dpdk.pid
65+}
66+
67 start_forwarding () {
68 check_force_cores
69
70+ start_dpdk
71+
72 insert_mod_if_required || return 1
73
74 if daemon_is_running ovs-vswitchd; then
75@@ -230,9 +269,9 @@
76 ulimit -n 7500
77
78 # Start ovs-vswitchd.
79- set ovs-vswitchd unix:"$DB_SOCK"
80+ set ovs-vswitchd $OVS_VSWITCHD_PARAMS -- unix:"$DB_SOCK"
81 set "$@" -vconsole:emer -vsyslog:err -vfile:info
82- if test X"$MLOCKALL" != Xno; then
83+ if test -"$MLOCKALL" != Xno; then
84 set "$@" --mlockall
85 fi
86 start_daemon "$OVS_VSWITCHD_PRIORITY" "$OVS_VSWITCHD_WRAPPER" "$@"
87@@ -249,6 +288,7 @@
88
89 stop_forwarding () {
90 stop_daemon ovs-vswitchd
91+ stop_dpdk
92 }
93
94 ## ----------------- ##
95@@ -505,8 +545,10 @@
96 MLOCKALL=yes
97 OVSDB_SERVER_PRIORITY=-10
98 OVS_VSWITCHD_PRIORITY=-10
99+ OVS_DPDK_PRIORITY=-10
100 OVSDB_SERVER_WRAPPER=
101 OVS_VSWITCHD_WRAPPER=
102+ OVS_DPDK_WRAPPER=
103
104 DB_FILE=$dbdir/conf.db
105 DB_SOCK=$rundir/db.sock
106@@ -601,6 +643,8 @@
107 data files: @pkgdatadir@ (--pkgdatadir, OVS_PKGDATADIR)
108 user binaries: @bindir@ (--bindir, OVS_BINDIR)
109 system binaries: @sbindir@ (--sbindir, OVS_SBINDIR)
110+ ovs_dpdk params: OVS_DPDK_PARAMS (env only)
111+ ovs-vswitchd dpdk params: OVS_VSWITCHD_PARAMS (env only)
112
113 Please report bugs to bugs@openvswitch.org (see REPORTING-BUGS for details).
114 EOF
115@@ -622,7 +666,7 @@
116 }
117
118 daemons () {
119- echo ovsdb-server ovs-vswitchd
120+ echo ovsdb-server ovs-vswitchd ovs_dpdk
121 }
122
123 set_defaults
diff --git a/recipes-networking/openvswitchdpdk/files/qemu-makefile.patch b/recipes-networking/openvswitchdpdk/files/qemu-makefile.patch
new file mode 100644
index 0000000..0ef50da
--- /dev/null
+++ b/recipes-networking/openvswitchdpdk/files/qemu-makefile.patch
@@ -0,0 +1,26 @@
1From 7f073eec0d100bddaba59c693505713974a2d4bb Mon Sep 17 00:00:00 2001
2From: Huimin She <huimin.she@enea.com>
3Date: Tue, 22 Apr 2014 22:58:11 +0200
4Subject: [PATCH] Add -ldl to qemu Makefile
5
6Signed-off-by: Huimin She <huimin.she@enea.com>
7---
8 qemu/Makefile.target | 2 +-
9 1 file changed, 1 insertion(+), 1 deletion(-)
10
11diff --git a/qemu/Makefile.target b/qemu/Makefile.target
12index 760da1e..72b58d7 100644
13--- a/qemu/Makefile.target
14+++ b/qemu/Makefile.target
15@@ -117,7 +117,7 @@ obj-$(CONFIG_HAVE_GET_MEMORY_MAPPING) += memory_mapping.o
16 obj-$(CONFIG_HAVE_CORE_DUMP) += dump.o
17 obj-$(CONFIG_NO_GET_MEMORY_MAPPING) += memory_mapping-stub.o
18 obj-$(CONFIG_NO_CORE_DUMP) += dump-stub.o
19-LIBS+=-lz
20+LIBS+=-lz -ldl
21
22 # xen support
23 obj-$(CONFIG_XEN) += xen-all.o xen-mapcache.o
24--
251.8.3.2
26
diff --git a/recipes-networking/openvswitchdpdk/files/qemu-options-hx.patch b/recipes-networking/openvswitchdpdk/files/qemu-options-hx.patch
new file mode 100644
index 0000000..d847d9e
--- /dev/null
+++ b/recipes-networking/openvswitchdpdk/files/qemu-options-hx.patch
@@ -0,0 +1,30 @@
1diff --git a/qemu/qemu-options.hx b/qemu/qemu-options.hx
2index 9d7131a..1000d49 100644
3--- a/qemu/qemu-options.hx
4+++ b/qemu/qemu-options.hx
5@@ -2075,18 +2075,13 @@ QEMU supports using either local sheepdog devices or remote networked
6 devices.
7
8 Syntax for specifying a sheepdog device
9-@table @list
10-``sheepdog:<vdiname>''
11-
12-``sheepdog:<vdiname>:<snapid>''
13-
14-``sheepdog:<vdiname>:<tag>''
15-
16-``sheepdog:<host>:<port>:<vdiname>''
17-
18-``sheepdog:<host>:<port>:<vdiname>:<snapid>''
19-
20-``sheepdog:<host>:<port>:<vdiname>:<tag>''
21+@table @code
22+@item sheepdog:<vdiname>
23+@item sheepdog:<vdiname>:<snapid>
24+@item sheepdog:<vdiname>:<tag>
25+@item sheepdog:<host>:<port>:<vdiname>
26+@item sheepdog:<host>:<port>:<vdiname>:<snapid>
27+@item sheepdog:<host>:<port>:<vdiname>:<tag>
28 @end table
29
30 Example
diff --git a/recipes-networking/openvswitchdpdk/files/qemu-pixman-config.patch b/recipes-networking/openvswitchdpdk/files/qemu-pixman-config.patch
new file mode 100644
index 0000000..266b42a
--- /dev/null
+++ b/recipes-networking/openvswitchdpdk/files/qemu-pixman-config.patch
@@ -0,0 +1,26 @@
1From 1976f44e3b14653421f67d7d050586348f3d3fa1 Mon Sep 17 00:00:00 2001
2From: Huimin She <huimin.she@enea.com>
3Date: Tue, 29 Apr 2014 10:00:30 +0200
4Subject: [PATCH] Add --host for qemu/pixman configure
5
6Signed-off-by: Huimin She <huimin.she@enea.com>
7---
8 qemu/Makefile | 2 +-
9 1 file changed, 1 insertion(+), 1 deletion(-)
10
11diff --git a/qemu/Makefile b/qemu/Makefile
12index 0d9099a..88b470f 100644
13--- a/qemu/Makefile
14+++ b/qemu/Makefile
15@@ -131,7 +131,7 @@ subdir-pixman: pixman/Makefile
16 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pixman V="$(V)" all,)
17
18 pixman/Makefile: $(SRC_PATH)/pixman/configure
19- (cd pixman; CFLAGS="$(CFLAGS) -fPIC $(extra_cflags) $(extra_ldflags)" $(SRC_PATH)/pixman/configure $(AUTOCONF_HOST) --disable-gtk --disable-shared --enable-static)
20+ (cd pixman; CFLAGS="$(CFLAGS) -fPIC $(extra_cflags) $(extra_ldflags)" $(SRC_PATH)/pixman/configure $(AUTOCONF_HOST) --disable-gtk --disable-shared --enable-static --host $(HOST_SYS))
21
22 $(SRC_PATH)/pixman/configure:
23 (cd $(SRC_PATH)/pixman; autoreconf -v --install)
24--
251.8.3.2
26
diff --git a/recipes-networking/openvswitchdpdk/files/run-ptest b/recipes-networking/openvswitchdpdk/files/run-ptest
new file mode 100644
index 0000000..3bf83b6
--- /dev/null
+++ b/recipes-networking/openvswitchdpdk/files/run-ptest
@@ -0,0 +1,8 @@
1#!/bin/sh
2
3INSTALLPREFIX=
4
5PATH=$INSTALLPREFIX/sbin:$INSTALLPREFIX/bin:$PATH
6
7./tests/testsuite --am-fmt -C tests AUTOTEST_PATH=utilities:vswitchd:ovsdb:tests
8