From patchwork Wed Nov 24 13:47:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 353051 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAODm0Qc021398 for ; Wed, 24 Nov 2010 13:48:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753839Ab0KXNr7 (ORCPT ); Wed, 24 Nov 2010 08:47:59 -0500 Received: from mail-vw0-f46.google.com ([209.85.212.46]:57888 "EHLO mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750845Ab0KXNr6 (ORCPT ); Wed, 24 Nov 2010 08:47:58 -0500 Received: by vws4 with SMTP id 4so124809vws.19 for ; Wed, 24 Nov 2010 05:47:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=kpStD3TLtkh/GKLgcIqbY0r5PEWT+TPv7qXhHfU+Pmk=; b=i9FwEtkqavB8uVbsbPYWopkjVQxI+s62eZ2O9rAvkFi1icrDDfXJIyb/e/yk9mKtuF Tli3AfYDQJcabxpvzbOmvGJeqR6hnJ2AdxDAi/Pidt5OfqGl82kYXsGjPzBzwTkD2dAE MsLOC6whhGahNRaa8Iqwl+T9BYpN4Ku5zoH+I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=NOxIxUluXEJT64xHlPvL04Xyx/IPZvO4NOgZBwCMuchMA9tj6G2oipcJSY5IByOgBF E/3XrhoVPPcOLBbjnhYvHTlPWzs+MZnY3Z3MJcRu+42PLsZSyiQqKTfs/ujA52zdlVnk mwoA/tDsKU/3kYoVNaAb0w8hmun9v+8U2POHw= Received: by 10.216.30.67 with SMTP id j45mr2340433wea.99.1290606476556; Wed, 24 Nov 2010 05:47:56 -0800 (PST) Received: from [10.150.51.211] (gw0.net.jmsp.net [212.23.165.14]) by mx.google.com with ESMTPS id p4sm3464823wej.28.2010.11.24.05.47.50 (version=SSLv3 cipher=RC4-MD5); Wed, 24 Nov 2010 05:47:51 -0800 (PST) Subject: [PATCH] infiniband: remove dev_base_lock use From: Eric Dumazet To: David Miller Cc: netdev , Roland Dreier , Sean Hefty , Hal Rosenstock , linux-rdma@vger.kernel.org In-Reply-To: <1288350226.2560.11.camel@edumazet-laptop> References: <1288350226.2560.11.camel@edumazet-laptop> Date: Wed, 24 Nov 2010 14:47:48 +0100 Message-ID: <1290606468.3464.38.camel@edumazet-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 24 Nov 2010 13:48:01 +0000 (UTC) diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c index c15fd2e..8aba0ba 100644 --- a/drivers/infiniband/core/addr.c +++ b/drivers/infiniband/core/addr.c @@ -130,8 +130,8 @@ int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr) #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) case AF_INET6: - read_lock(&dev_base_lock); - for_each_netdev(&init_net, dev) { + rcu_read_lock(); + for_each_netdev_rcu(&init_net, dev) { if (ipv6_chk_addr(&init_net, &((struct sockaddr_in6 *) addr)->sin6_addr, dev, 1)) { @@ -139,7 +139,7 @@ int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr) break; } } - read_unlock(&dev_base_lock); + rcu_read_unlock(); break; #endif } diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index bf3e20c..4e55a28 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c @@ -848,8 +848,8 @@ static int update_ipv6_gids(struct mlx4_ib_dev *dev, int port, int clear) goto out; } - read_lock(&dev_base_lock); - for_each_netdev(&init_net, tmp) { + rcu_read_lock(); + for_each_netdev_rcu(&init_net, tmp) { if (ndev && (tmp == ndev || rdma_vlan_dev_real_dev(tmp) == ndev)) { gid.global.subnet_prefix = cpu_to_be64(0xfe80000000000000LL); vid = rdma_vlan_dev_vlan_id(tmp); @@ -884,7 +884,7 @@ static int update_ipv6_gids(struct mlx4_ib_dev *dev, int port, int clear) } } } - read_unlock(&dev_base_lock); + rcu_read_unlock(); for (i = 0; i < 128; ++i) if (!hits[i]) {