From: Pravin B Shelar Date: Thu, 1 Aug 2013 22:36:06 +0000 (-0700) Subject: datapath: Use parallel_ops genl. X-Git-Tag: sliver-openvswitch-2.0.90-1~27^2~32 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=14002a5984e97f0f2482acdbb445c45266e2c6a1 datapath: Use parallel_ops genl. OVS locking was recently changed to have private OVS lock which simplified overall locking. Therefore there is no need to have another global genl lock to protect OVS data structures. Following patch uses of parallel_ops genl family for OVS. This also allows more granual OVS locking using ovs_mutex for protecting OVS data structures, which gives more concurrencey. E.g multiple genl operations OVS_PACKET_CMD_EXECUTE can run in parallel, etc. Signed-off-by: Pravin B Shelar Acked-by: Jesse Gross --- diff --git a/acinclude.m4 b/acinclude.m4 index 6033bfa38..73ee5ce30 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -271,6 +271,7 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_GREP_IFELSE([$KSRC/include/net/checksum.h], [csum_replace4]) OVS_GREP_IFELSE([$KSRC/include/net/checksum.h], [csum_unfold]) + OVS_GREP_IFELSE([$KSRC/include/net/genetlink.h], [parallel_ops]) OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [NLA_NUL_STRING]) OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_get_be16]) OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_put_be16]) diff --git a/datapath/compat.h b/datapath/compat.h index 4dfd1926d..65734ff15 100644 --- a/datapath/compat.h +++ b/datapath/compat.h @@ -61,6 +61,13 @@ static inline void skb_clear_rxhash(struct sk_buff *skb) #define SET_NETNSOK .netnsok = true, #endif +#ifdef HAVE_PARALLEL_OPS +#define SET_PARALLEL_OPS .parallel_ops = true, +#else +#define SET_PARALLEL_OPS +#endif + + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) #ifdef CONFIG_NETFILTER static inline u32 skb_get_mark(struct sk_buff *skb) diff --git a/datapath/datapath.c b/datapath/datapath.c index 6b7cbc1cb..a6bf70ca9 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -280,6 +280,7 @@ static struct genl_family dp_packet_genl_family = { .version = OVS_PACKET_VERSION, .maxattr = OVS_PACKET_ATTR_MAX, SET_NETNSOK + SET_PARALLEL_OPS }; int ovs_dp_upcall(struct datapath *dp, struct sk_buff *skb, @@ -1010,6 +1011,7 @@ static struct genl_family dp_flow_genl_family = { .version = OVS_FLOW_VERSION, .maxattr = OVS_FLOW_ATTR_MAX, SET_NETNSOK + SET_PARALLEL_OPS }; static struct genl_multicast_group ovs_dp_flow_multicast_group = { @@ -1589,6 +1591,7 @@ static struct genl_family dp_datapath_genl_family = { .version = OVS_DATAPATH_VERSION, .maxattr = OVS_DP_ATTR_MAX, SET_NETNSOK + SET_PARALLEL_OPS }; static struct genl_multicast_group ovs_dp_datapath_multicast_group = { @@ -1968,6 +1971,7 @@ static struct genl_family dp_vport_genl_family = { .version = OVS_VPORT_VERSION, .maxattr = OVS_VPORT_ATTR_MAX, SET_NETNSOK + SET_PARALLEL_OPS }; struct genl_multicast_group ovs_dp_vport_multicast_group = {