From patchwork Thu Apr 18 21:30:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pravin B Shelar X-Patchwork-Id: 237743 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 5A4802C0207 for ; Fri, 19 Apr 2013 07:31:01 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752689Ab3DRVa6 (ORCPT ); Thu, 18 Apr 2013 17:30:58 -0400 Received: from na3sys009aog130.obsmtp.com ([74.125.149.143]:34339 "HELO na3sys009aog130.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751781Ab3DRVa5 (ORCPT ); Thu, 18 Apr 2013 17:30:57 -0400 Received: from mail-ob0-f199.google.com ([209.85.214.199]) (using TLSv1) by na3sys009aob130.postini.com ([74.125.148.12]) with SMTP ID DSNKUXBmEM74rwBH4CMnEbqn5CPC4qBeMN/U@postini.com; Thu, 18 Apr 2013 14:30:57 PDT Received: by mail-ob0-f199.google.com with SMTP id va7so17593507obc.6 for ; Thu, 18 Apr 2013 14:30:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=/WswVEQoK9Zb3c0MLlk90g5vYoJvLX6LfFDrDo67thU=; b=U/SznxEQufTOyL/G7IiqU75t16xvRHgUidWsOzC2UN6ovb/X2VaMbBXxZZ43Tbr7o3 jmnTh2oLftOZq8qltUzlzLH52Pgmcc5cSddJ0RIj7LPDsFmMuJvA3aC9+AuxCHc+AwL2 aXhP/sVENwq8vL+I7eJxgpghUztn8mxiVw4x53QVj44vUDt67k6FGrB5mHoEkKKC98U0 W406X3LPz6x9vwiUAzVRtzLCzXR6cKwoh0ECIUKlkWkLo1yuvIvFrhdkdbSY8Y8nUi18 Bp3GOxWexkvUfsgN/BF2Tui0OM0sCHj/frlLWiumeEVZwPXR4cZ1mHitXjklSH0YyWB/ ToMA== X-Received: by 10.182.112.202 with SMTP id is10mr6339036obb.8.1366320656681; Thu, 18 Apr 2013 14:30:56 -0700 (PDT) X-Received: by 10.182.112.202 with SMTP id is10mr6339027obb.8.1366320656588; Thu, 18 Apr 2013 14:30:56 -0700 (PDT) Received: from localhost ([75.98.92.113]) by mx.google.com with ESMTPS id s8sm4978576obf.2.2013.04.18.14.30.55 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Thu, 18 Apr 2013 14:30:56 -0700 (PDT) From: Pravin B Shelar To: netdev@vger.kernel.org Cc: dev@openvswitch.org, jesse@nicira.com, Pravin B Shelar Subject: [PATCH net-next v2 2/2] openvswitch: Use lockless genl. Date: Thu, 18 Apr 2013 14:30:53 -0700 Message-Id: <1366320653-16941-1-git-send-email-pshelar@nicira.com> X-Mailer: git-send-email 1.8.2.135.g7b592fa X-Gm-Message-State: ALoCoQmPz+rAWGs7ofRjIL6ZpwgBVGImi0zDMPD8zx2V+QS+HoDPfEh/SB1Is71YLzfmhtToaLq35bGSFT5NlQrG9NcihDaQ2nk360qMq0AKcA066P4fkn9Yvw0e30e6SSSmux2wgkV8H0W9tap21wTrcvl6PNdGHS1wuIXEI4lDFPDbN/RzorU= Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Acked-by: Jesse Gross --- Updated commit msg according comment From Jesse. --- net/openvswitch/datapath.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) 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 = {