summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--acinclude.m44
-rw-r--r--datapath/datapath.c18
-rw-r--r--datapath/linux/Modules.mk1
-rw-r--r--datapath/linux/compat/include/linux/cache.h10
-rw-r--r--datapath/linux/compat/include/linux/genetlink.h4
5 files changed, 26 insertions, 11 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index c4f331cf9..866e4373b 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -134,10 +134,10 @@ AC_DEFUN([OVS_CHECK_LINUX], [
AC_MSG_RESULT([$kversion])
if test "$version" -ge 4; then
- if test "$version" = 4 && test "$patchlevel" -le 8; then
+ if test "$version" = 4 && test "$patchlevel" -le 9; then
: # Linux 4.x
else
- AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 4.8.x is not supported (please refer to the FAQ for advice)])
+ AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 4.9.x is not supported (please refer to the FAQ for advice)])
fi
elif test "$version" = 3 && test "$patchlevel" -ge 10; then
: # Linux 3.x
diff --git a/datapath/datapath.c b/datapath/datapath.c
index 382212926..ce2364a98 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -682,8 +682,7 @@ static struct genl_ops dp_packet_genl_ops[] = {
}
};
-static struct genl_family dp_packet_genl_family = {
- .id = GENL_ID_GENERATE,
+static struct genl_family dp_packet_genl_family __ro_after_init = {
.hdrsize = sizeof(struct ovs_header),
.name = OVS_PACKET_FAMILY,
.version = OVS_PACKET_VERSION,
@@ -692,6 +691,7 @@ static struct genl_family dp_packet_genl_family = {
.parallel_ops = true,
.ops = dp_packet_genl_ops,
.n_ops = ARRAY_SIZE(dp_packet_genl_ops),
+ .module = THIS_MODULE,
};
static void get_dp_stats(const struct datapath *dp, struct ovs_dp_stats *stats,
@@ -1447,8 +1447,7 @@ static struct genl_ops dp_flow_genl_ops[] = {
},
};
-static struct genl_family dp_flow_genl_family = {
- .id = GENL_ID_GENERATE,
+static struct genl_family dp_flow_genl_family __ro_after_init = {
.hdrsize = sizeof(struct ovs_header),
.name = OVS_FLOW_FAMILY,
.version = OVS_FLOW_VERSION,
@@ -1459,6 +1458,7 @@ static struct genl_family dp_flow_genl_family = {
.n_ops = ARRAY_SIZE(dp_flow_genl_ops),
.mcgrps = &ovs_dp_flow_multicast_group,
.n_mcgrps = 1,
+ .module = THIS_MODULE,
};
static size_t ovs_dp_cmd_msg_size(void)
@@ -1832,8 +1832,7 @@ static struct genl_ops dp_datapath_genl_ops[] = {
},
};
-static struct genl_family dp_datapath_genl_family = {
- .id = GENL_ID_GENERATE,
+static struct genl_family dp_datapath_genl_family __ro_after_init = {
.hdrsize = sizeof(struct ovs_header),
.name = OVS_DATAPATH_FAMILY,
.version = OVS_DATAPATH_VERSION,
@@ -1844,6 +1843,7 @@ static struct genl_family dp_datapath_genl_family = {
.n_ops = ARRAY_SIZE(dp_datapath_genl_ops),
.mcgrps = &ovs_dp_datapath_multicast_group,
.n_mcgrps = 1,
+ .module = THIS_MODULE,
};
/* Called with ovs_mutex or RCU read lock. */
@@ -2254,8 +2254,7 @@ static struct genl_ops dp_vport_genl_ops[] = {
},
};
-struct genl_family dp_vport_genl_family = {
- .id = GENL_ID_GENERATE,
+struct genl_family dp_vport_genl_family __ro_after_init = {
.hdrsize = sizeof(struct ovs_header),
.name = OVS_VPORT_FAMILY,
.version = OVS_VPORT_VERSION,
@@ -2266,6 +2265,7 @@ struct genl_family dp_vport_genl_family = {
.n_ops = ARRAY_SIZE(dp_vport_genl_ops),
.mcgrps = &ovs_dp_vport_multicast_group,
.n_mcgrps = 1,
+ .module = THIS_MODULE,
};
static struct genl_family *dp_genl_families[] = {
@@ -2283,7 +2283,7 @@ static void dp_unregister_genl(int n_families)
genl_unregister_family(dp_genl_families[i]);
}
-static int dp_register_genl(void)
+static int __init dp_register_genl(void)
{
int err;
int i;
diff --git a/datapath/linux/Modules.mk b/datapath/linux/Modules.mk
index 26f6d2249..985ffed45 100644
--- a/datapath/linux/Modules.mk
+++ b/datapath/linux/Modules.mk
@@ -29,6 +29,7 @@ openvswitch_headers += \
linux/compat/gso.h \
linux/compat/include/linux/percpu.h \
linux/compat/include/linux/bug.h \
+ linux/compat/include/linux/cache.h \
linux/compat/include/linux/compiler.h \
linux/compat/include/linux/compiler-gcc.h \
linux/compat/include/linux/cpumask.h \
diff --git a/datapath/linux/compat/include/linux/cache.h b/datapath/linux/compat/include/linux/cache.h
new file mode 100644
index 000000000..917defad7
--- /dev/null
+++ b/datapath/linux/compat/include/linux/cache.h
@@ -0,0 +1,10 @@
+#ifndef __LINUX_CACHE_WRAPPER_H
+#define __LINUX_CACHE_WRAPPER_H 1
+
+#include_next <linux/cache.h>
+
+#ifndef __ro_after_init
+#define __ro_after_init
+#endif
+
+#endif
diff --git a/datapath/linux/compat/include/linux/genetlink.h b/datapath/linux/compat/include/linux/genetlink.h
index de55e4017..909f62a16 100644
--- a/datapath/linux/compat/include/linux/genetlink.h
+++ b/datapath/linux/compat/include/linux/genetlink.h
@@ -7,4 +7,8 @@
#define GENL_UNS_ADMIN_PERM GENL_ADMIN_PERM
#endif
+#ifdef GENL_ID_GENERATE
+compiletime_assert(GENL_ID_GENERATE == 0, "GENL_ID_GENERATE is assumed to be zero")
+#endif
+
#endif