Patchwork [net-next,v2,2/2] openvswitch: Use lockless genl.

login
register
mail settings
Submitter Pravin B Shelar
Date April 18, 2013, 9:30 p.m.
Message ID <1366320653-16941-1-git-send-email-pshelar@nicira.com>
Download mbox | patch
Permalink /patch/237743/
State Rejected
Delegated to: David Miller
Headers show

Comments

Pravin B Shelar - April 18, 2013, 9:30 p.m.
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 lockless 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 <pshelar@nicira.com>
---
Updated commit msg according comment From Jesse.
---
 net/openvswitch/datapath.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
Jesse Gross - April 19, 2013, 12:25 a.m.
On Thu, Apr 18, 2013 at 2:30 PM, Pravin B Shelar <pshelar@nicira.com> wrote:
> 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 lockless 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 <pshelar@nicira.com>
> ---
> Updated commit msg according comment From Jesse.

Once the genl parts have been reviewed:
Acked-by: Jesse Gross <jesse@nicira.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index b7d0b7c..b2c966e 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -270,7 +270,8 @@  static struct genl_family dp_packet_genl_family = {
 	.name = OVS_PACKET_FAMILY,
 	.version = OVS_PACKET_VERSION,
 	.maxattr = OVS_PACKET_ATTR_MAX,
-	.netnsok = true
+	.netnsok = true,
+	.lockless = true,
 };
 
 int ovs_dp_upcall(struct datapath *dp, struct sk_buff *skb,
@@ -836,7 +837,8 @@  static struct genl_family dp_flow_genl_family = {
 	.name = OVS_FLOW_FAMILY,
 	.version = OVS_FLOW_VERSION,
 	.maxattr = OVS_FLOW_ATTR_MAX,
-	.netnsok = true
+	.netnsok = true,
+	.lockless = true,
 };
 
 static struct genl_multicast_group ovs_dp_flow_multicast_group = {
@@ -1269,7 +1271,8 @@  static struct genl_family dp_datapath_genl_family = {
 	.name = OVS_DATAPATH_FAMILY,
 	.version = OVS_DATAPATH_VERSION,
 	.maxattr = OVS_DP_ATTR_MAX,
-	.netnsok = true
+	.netnsok = true,
+	.lockless = true,
 };
 
 static struct genl_multicast_group ovs_dp_datapath_multicast_group = {
@@ -1623,7 +1626,8 @@  static struct genl_family dp_vport_genl_family = {
 	.name = OVS_VPORT_FAMILY,
 	.version = OVS_VPORT_VERSION,
 	.maxattr = OVS_VPORT_ATTR_MAX,
-	.netnsok = true
+	.netnsok = true,
+	.lockless = true,
 };
 
 struct genl_multicast_group ovs_dp_vport_multicast_group = {