aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannu Nyman <hannu.nyman@iki.fi>2016-03-06 20:25:55 +0200
committerHannu Nyman <hannu.nyman@iki.fi>2016-03-06 20:25:55 +0200
commit48e134b6abbb945f601dc909511dc2d654da4e50 (patch)
tree45423e03abfa176b5ae8388643e081749586d636
parent56688f68fd0f49e14114ca16074cd2f647bf1deb (diff)
parent91f5e2dbf2ffd814c6042ce1980db5edb3c9b38a (diff)
Merge pull request #2457 from commodo/ovs-upgrade
openvswitch: pull released version 2.5.0
-rw-r--r--net/openvswitch/Makefile4
-rw-r--r--net/openvswitch/patches/0010-lib-ovs-thread-Ensure-that-thread-stacks-are-always-.patch74
2 files changed, 76 insertions, 2 deletions
diff --git a/net/openvswitch/Makefile b/net/openvswitch/Makefile
index fbefbdc25..636166b8b 100644
--- a/net/openvswitch/Makefile
+++ b/net/openvswitch/Makefile
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=openvswitch
-PKG_RELEASE:=4
+PKG_RELEASE:=5
PKG_VERSION:=2.5.0
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_LICENSE:=Apache-2.0
@@ -22,7 +22,7 @@ PKG_USE_MIPS16:=0
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/openvswitch/ovs
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=98b94d1e7002063ce2ea3c3221fe9234cac4e124
+PKG_SOURCE_VERSION:=22d4614ddf83988a3771fb379ea029e663b4455a
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_PARALLEL:=1
diff --git a/net/openvswitch/patches/0010-lib-ovs-thread-Ensure-that-thread-stacks-are-always-.patch b/net/openvswitch/patches/0010-lib-ovs-thread-Ensure-that-thread-stacks-are-always-.patch
new file mode 100644
index 000000000..4cd87fb1d
--- /dev/null
+++ b/net/openvswitch/patches/0010-lib-ovs-thread-Ensure-that-thread-stacks-are-always-.patch
@@ -0,0 +1,74 @@
+From 8147cec9ee8feea9440cf79365709ddc32ff57d5 Mon Sep 17 00:00:00 2001
+From: Alexandru Ardelean <ardeleanalex@gmail.com>
+Date: Thu, 4 Feb 2016 09:20:34 +0200
+Subject: [PATCH] lib/ovs-thread: Ensure that thread stacks are always at least
+ 512 kB.
+
+This makes a difference for libc implementations (such as musl libc) that
+have a really small default pthread stack size.
+
+Will reference this discussion:
+http://patchwork.ozlabs.org/patch/572340/
+
+Reported-by: Robert McKay <robert@mckay.com>
+Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
+[blp@ovn.org made style changes]
+Signed-off-by: Ben Pfaff <blp@ovn.org>
+---
+ lib/ovs-thread.c | 29 +++++++++++++++++++++++++++++
+ 1 file changed, 29 insertions(+)
+
+diff --git a/lib/ovs-thread.c b/lib/ovs-thread.c
+index 6ebda07..b0e10ee 100644
+--- a/lib/ovs-thread.c
++++ b/lib/ovs-thread.c
+@@ -340,6 +340,25 @@ ovsthread_wrapper(void *aux_)
+ return aux.start(aux.arg);
+ }
+
++static void
++set_min_stack_size(pthread_attr_t *attr, size_t min_stacksize)
++{
++ size_t stacksize;
++ int error;
++
++ error = pthread_attr_getstacksize(attr, &stacksize);
++ if (error) {
++ ovs_abort(error, "pthread_attr_getstacksize failed");
++ }
++
++ if (stacksize < min_stacksize) {
++ error = pthread_attr_setstacksize(attr, min_stacksize);
++ if (error) {
++ ovs_abort(error, "pthread_attr_setstacksize failed");
++ }
++ }
++}
++
+ /* Starts a thread that calls 'start(arg)'. Sets the thread's name to 'name'
+ * (suffixed by its ovsthread_id()). Returns the new thread's pthread_t. */
+ pthread_t
+@@ -358,10 +377,20 @@ ovs_thread_create(const char *name, void *(*start)(void *), void *arg)
+ aux->arg = arg;
+ ovs_strlcpy(aux->name, name, sizeof aux->name);
+
++ /* Some small systems use a default stack size as small as 80 kB, but OVS
++ * requires approximately 384 kB according to the following analysis:
++ * http://openvswitch.org/pipermail/dev/2016-January/065049.html
++ *
++ * We use 512 kB to give us some margin of error. */
++ pthread_attr_t attr;
++ pthread_attr_init(&attr);
++ set_min_stack_size(&attr, 512 * 1024);
++
+ error = pthread_create(&thread, NULL, ovsthread_wrapper, aux);
+ if (error) {
+ ovs_abort(error, "pthread_create failed");
+ }
++ pthread_attr_destroy(&attr);
+ return thread;
+ }
+
+--
+2.1.4
+