public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Sachin Sant <sachinp@in.ibm.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	linux-s390@vger.kernel.org, linux-next@vger.kernel.org,
	ursula.braun@de.ibm.com
Subject: Re: [Patch -next] Adapt s390 qeth & lcs driver code to use RCU
Date: Thu, 18 Nov 2010 10:33:14 +0100	[thread overview]
Message-ID: <1290072794.2781.10.camel@edumazet-laptop> (raw)
In-Reply-To: <20101118091846.26534.38865.sendpatchset@localhost.localdomain>

Le jeudi 18 novembre 2010 à 14:48 +0530, Sachin Sant a écrit :
> Commit 1d7138de878d1d4210727c1200193e69596f93b3
> igmp: RCU conversion of in_dev->mc_list
> 
> converted rwlock to RCU.
> 
> Update the s390 network drivers(qeth & lcs) code to adapt to this change.
> 
> Signed-off-by : Sachin Sant <sachinp@in.ibm.com>
> ---
> 
> Only compile tested.
> 

Hmm, sorry but this wont work.

> diff -Narup linux-2.6-next/drivers/s390/net/lcs.c linux-2.6-next-new/drivers/s390/net/lcs.c
> --- linux-2.6-next/drivers/s390/net/lcs.c	2010-11-17 11:38:25.000000000 +0530
> +++ linux-2.6-next-new/drivers/s390/net/lcs.c	2010-11-18 11:59:46.000000000 +0530
> @@ -1269,10 +1269,10 @@ lcs_register_mc_addresses(void *data)
>  	in4_dev = in_dev_get(card->dev);
>  	if (in4_dev == NULL)
>  		goto out;
> -	read_lock(&in4_dev->mc_list_lock);
> +	rcu_read_lock();

If you use rcu_read_lock(), then you also need to 
use the rcu list iterators in lcs_remove_mc_addresses() and
lcs_set_mc_addresses()

Then, its strange this driver is not protected by RTNL at this stage.

Ah yes, it uses a kthread from its ndo_set_multicast_list() handler.

This seems not safe at all.


>  	lcs_remove_mc_addresses(card,in4_dev);
>  	lcs_set_mc_addresses(card, in4_dev);
> -	read_unlock(&in4_dev->mc_list_lock);
> +	rcu_read_unlock();
>  	in_dev_put(in4_dev);
>  
>  	netif_carrier_off(card->dev);
> diff -Narup linux-2.6-next/drivers/s390/net/qeth_l3_main.c linux-2.6-next-new/drivers/s390/net/qeth_l3_main.c
> --- linux-2.6-next/drivers/s390/net/qeth_l3_main.c	2010-10-30 12:54:22.000000000 +0530
> +++ linux-2.6-next-new/drivers/s390/net/qeth_l3_main.c	2010-11-18 11:59:13.000000000 +0530
> @@ -1828,9 +1828,9 @@ static void qeth_l3_add_vlan_mc(struct q
>  		in_dev = in_dev_get(netdev);
>  		if (!in_dev)
>  			continue;
> -		read_lock(&in_dev->mc_list_lock);
> +		rcu_read_lock();
>  		qeth_l3_add_mc(card, in_dev);
> -		read_unlock(&in_dev->mc_list_lock);
> +		rcu_read_unlock();
>  		in_dev_put(in_dev);
>  	}
>  }
> @@ -1843,10 +1843,10 @@ static void qeth_l3_add_multicast_ipv4(s
>  	in4_dev = in_dev_get(card->dev);
>  	if (in4_dev == NULL)
>  		return;
> -	read_lock(&in4_dev->mc_list_lock);
> +	rcu_read_lock();
>  	qeth_l3_add_mc(card, in4_dev);
>  	qeth_l3_add_vlan_mc(card);
> -	read_unlock(&in4_dev->mc_list_lock);
> +	rcu_read_unlock();
>  	in_dev_put(in4_dev);
>  }
>  

  reply	other threads:[~2010-11-18  9:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-18  9:18 [Patch -next] Adapt s390 qeth & lcs driver code to use RCU Sachin Sant
2010-11-18  9:33 ` Eric Dumazet [this message]
2010-11-18  9:43   ` Eric Dumazet
2010-11-18 10:26     ` [PATCH net-2.6] bonding: fix a race in IGMP handling Eric Dumazet
2010-11-18 10:49       ` [PATCH net-next-2.6] bonding: IGMP handling cleanup Eric Dumazet
2010-11-18 17:33         ` David Miller
2010-11-18 17:31       ` [PATCH net-2.6] bonding: fix a race in IGMP handling David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1290072794.2781.10.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-next@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sachinp@in.ibm.com \
    --cc=ursula.braun@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox