* [PATCH] RDMA/addr: remove dev_base_lock use from rdma_translate_ip()
@ 2010-10-29 11:03 Eric Dumazet
2010-11-24 13:47 ` [PATCH] infiniband: remove dev_base_lock use Eric Dumazet
0 siblings, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2010-10-29 11:03 UTC (permalink / raw)
To: David Miller
Cc: netdev, Roland Dreier, Sean Hefty, Hal Rosenstock, linux-rdma
dev_base_lock is the legacy way to lock the device list, and is planned
to disappear. (writers hold RTNL, readers hold RCU lock)
Convert rdma_translate_ip() to RCU locking.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
drivers/infiniband/core/addr.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
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
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] infiniband: remove dev_base_lock use
2010-10-29 11:03 [PATCH] RDMA/addr: remove dev_base_lock use from rdma_translate_ip() Eric Dumazet
@ 2010-11-24 13:47 ` Eric Dumazet
2010-11-24 17:06 ` Roland Dreier
0 siblings, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2010-11-24 13:47 UTC (permalink / raw)
To: David Miller
Cc: netdev, Roland Dreier, Sean Hefty, Hal Rosenstock,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
Le vendredi 29 octobre 2010 à 13:03 +0200, Eric Dumazet a écrit :
> dev_base_lock is the legacy way to lock the device list, and is planned
> to disappear. (writers hold RTNL, readers hold RCU lock)
>
> Convert rdma_translate_ip() to RCU locking.
>
> Signed-off-by: Eric Dumazet <eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> drivers/infiniband/core/addr.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> 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
> }
>
Here is a new version of patch.
David, it seems no infiniband guy commented this patch, could you take
it in your tree ?
Thanks
[PATCH] infiniband: remove dev_base_lock use
dev_base_lock is the legacy way to lock the device list, and is planned
to disappear. (writers hold RTNL, readers hold RCU lock)
Convert rdma_translate_ip() and update_ipv6_gids() to RCU locking.
Signed-off-by: Eric Dumazet <eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/infiniband/core/addr.c | 6 +++---
drivers/infiniband/hw/mlx4/main.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
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]) {
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] infiniband: remove dev_base_lock use
2010-11-24 13:47 ` [PATCH] infiniband: remove dev_base_lock use Eric Dumazet
@ 2010-11-24 17:06 ` Roland Dreier
[not found] ` <adalj4ihcsa.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Roland Dreier @ 2010-11-24 17:06 UTC (permalink / raw)
To: Eric Dumazet
Cc: David Miller, netdev, Roland Dreier, Sean Hefty, Hal Rosenstock,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
> David, it seems no infiniband guy commented this patch, could you take
> it in your tree ?
Sorry... in any case this looks fine. If all prerequisites are upstream
then I'm happy to take through my tree, but if Dave wants to take it:
Acked-by: Roland Dreier <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] infiniband: remove dev_base_lock use
[not found] ` <adalj4ihcsa.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
@ 2010-11-24 17:09 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2010-11-24 17:09 UTC (permalink / raw)
To: rdreier-FYB4Gu1CFyUAvxtiuMwx3w
Cc: eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w,
netdev-u79uwXL29TY76Z2rM5mHXA, rolandd-FYB4Gu1CFyUAvxtiuMwx3w,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
From: Roland Dreier <rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
Date: Wed, 24 Nov 2010 09:06:13 -0800
> > David, it seems no infiniband guy commented this patch, could you take
> > it in your tree ?
>
> Sorry... in any case this looks fine. If all prerequisites are upstream
> then I'm happy to take through my tree, but if Dave wants to take it:
>
> Acked-by: Roland Dreier <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
I'd rather take it because it opens up some further simplifications
Eric wants to perform.
So I'll apply this to net-next-2.6, thanks for the review Roland.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-11-24 17:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-29 11:03 [PATCH] RDMA/addr: remove dev_base_lock use from rdma_translate_ip() Eric Dumazet
2010-11-24 13:47 ` [PATCH] infiniband: remove dev_base_lock use Eric Dumazet
2010-11-24 17:06 ` Roland Dreier
[not found] ` <adalj4ihcsa.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-11-24 17:09 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).