From patchwork Fri Oct 29 11:03:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 290152 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 o9TB46vk012815 for ; Fri, 29 Oct 2010 11:04:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761345Ab0J2LDx (ORCPT ); Fri, 29 Oct 2010 07:03:53 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:60455 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761341Ab0J2LDv (ORCPT ); Fri, 29 Oct 2010 07:03:51 -0400 Received: by wwe15 with SMTP id 15so3134239wwe.1 for ; Fri, 29 Oct 2010 04:03:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=5Cwy5Wlnt91YOQFJPake795qMFIALWG+Nd4hgyfTZpU=; b=RIqMYgXpUoGbujo9th6K2s4PcOHjy86o2qwzjnm1j3uab+6Zgh+jE9ABsdtaAVx4El gK4GDZtD2AsWcyFFG+Z0ab/FGvCK+N69S6vxmpE3b7h7NSRfUrSvaQqdi7ozK+eZxrXw 085cdNzjYHpn2LZ1Vw2h+ZHSh/x1a9Bj2o2IU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; b=gh8jp04j3KRtmJP9NbxdVLnorU6UpcAumQUn5wkD7WpjXUKAZIZspsjUbTaoGhCBNw F/Xf+ecxUEasRvRnCfggZ+jOSrBPhuub6FbANPLWiwYEzfQWwTbpl/OcmJfjqbKfiXRE j0W2KuXcyGZzktY86MqczhyoyXm/FNvaFz6ks= Received: by 10.216.167.205 with SMTP id i55mr1456347wel.17.1288350229663; Fri, 29 Oct 2010 04:03:49 -0700 (PDT) Received: from [10.150.51.216] (gw0.net.jmsp.net [212.23.165.14]) by mx.google.com with ESMTPS id f31sm1468590wej.15.2010.10.29.04.03.47 (version=SSLv3 cipher=RC4-MD5); Fri, 29 Oct 2010 04:03:48 -0700 (PDT) Subject: [PATCH] RDMA/addr: remove dev_base_lock use from rdma_translate_ip() From: Eric Dumazet To: David Miller Cc: netdev , Roland Dreier , Sean Hefty , Hal Rosenstock , linux-rdma@vger.kernel.org Date: Fri, 29 Oct 2010 13:03:46 +0200 Message-ID: <1288350226.2560.11.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]); Fri, 29 Oct 2010 11:04:06 +0000 (UTC) diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c index a5ea1bc..309b477 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 }