From: Ed Cashin <ecashin@coraid.com>
To: shemminger@vyatta.com, karaluh@karaluh.pl, ecashin@coraid.com,
roel.kluin@gmail.com, harvey.harrison@gmail.com,
bzolnier@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH 04/10] AOE: use rcu to find network device
Date: Thu, 12 Nov 2009 09:33:16 -0500 [thread overview]
Message-ID: <e160a17e366ae2f676df822db1e62bc2@coraid.com> (raw)
In-Reply-To: <20091110155316.2c3d7b6e@nehalam>
Thanks again for providing this patch to help get things started.
It's very helpful. I appreciate the way it reflects and fits into the
rest of the driver, too.
In the patch, there's a loop around getif, ejectif inside the new
aoecmd_flushnet function:
void aoecmd_flushnet(struct aoedev *d, struct net_device *nd)
{
struct aoetgt **tt, **te;
tt = d->targets;
te = tt + NTARGETS;
for (; tt < te && *tt; tt++) {
struct aoetgt *t = *tt;
struct aoeif *ifp;
while ( (ifp = getif(t, nd)) )
ejectif(t, ifp);
}
}
... but an "if" seems appropriate, since duplicates are avoided when
network devices are added in aoecmd_cfg_rsp:
ifp = getif(t, skb->dev);
if (!ifp) {
ifp = addif(t, skb->dev);
If there's some other reason for it to be "while" in aoecmd_flushnet
that I'm missing, please let me know.
Regarding the new aoe_device_event function,
/* Callback on change of state of network device. */
static int aoe_device_event(struct notifier_block *unused,
unsigned long event, void *ptr)
{
struct net_device *nd = ptr;
if (is_aoe_netif(nd) && event == NETDEV_UNREGISTER)
aoedev_ejectnet(nd);
return NOTIFY_DONE;
}
... the is_aoe_netif function really answers the question, "Are we
allowed by the user to do AoE on this local network interface?" The
user can modify the list of allowable interfaces at runtime via sysfs,
as it's a module parameter. So I don't think we can use is_aoe_netif
in the new aoe_device_event function. We should eject a net_device in
this handler even if the user has decided not to use it for AoE.
Please let me know if I'm missing the point.
You said that,
> It needs to:
>
> 1. Get a device ref count when it remembers a device: (ie addif)
> 2. Install a notifier that looks for device removal events
> 3. In notifier, remove interface, including flushing all pending
> skb's for that device.
For 3, does the starter patch flush all pending skbs? Perhaps you
could elaborate on what you had in mind?
I am trying to find the best way for the aoe driver to handle the
situation where ther are no usable local network interfaces. It does
seem to me that the user would benefit from a notice letting them know
that they're trying to do AoE without any usable ethernet. I'm
thinking that doing something like a printk_once would be appropriate.
(But probably not printk_once itself, because if they add a local
interface and then it goes away later, they should be told again that
something's wrong.)
--
Ed Cashin <ecashin@coraid.com>
http://www.coraid.com/
http://noserose.net/e/
next prev parent reply other threads:[~2009-11-12 14:34 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-10 17:54 [PATCH 00/10] netdev: get rid of read_lock(&dev_base_lock) usages Stephen Hemminger
2009-11-10 17:54 ` [PATCH 01/10] netdev: add netdev_continue_rcu Stephen Hemminger
2009-11-10 18:19 ` Eric Dumazet
2009-11-11 6:47 ` David Miller
2009-11-10 19:39 ` Paul E. McKenney
2009-11-10 17:54 ` [PATCH 02/10] vlan: eliminate use of dev_base_lock Stephen Hemminger
2009-11-10 18:20 ` Eric Dumazet
2009-11-11 6:47 ` David Miller
2009-11-10 17:54 ` [PATCH 03/10] net: use rcu for network scheduler API Stephen Hemminger
2009-11-10 18:20 ` Eric Dumazet
2009-11-11 6:47 ` David Miller
2009-11-10 17:54 ` [PATCH 04/10] AOE: use rcu to find network device Stephen Hemminger
2009-11-10 18:23 ` Eric Dumazet
2009-11-10 20:01 ` Ed Cashin
2009-11-10 23:06 ` Stephen Hemminger
2009-11-10 23:53 ` Stephen Hemminger
2009-11-11 6:48 ` David Miller
2009-11-12 14:33 ` Ed Cashin [this message]
2009-11-12 17:10 ` Stephen Hemminger
2009-11-12 18:07 ` Ed Cashin
2009-11-12 19:09 ` Stephen Hemminger
2009-11-18 16:49 ` Ed Cashin
2009-11-11 14:22 ` Ed Cashin
2009-11-13 21:39 ` Ed Cashin
2009-11-13 22:24 ` Stephen Hemminger
2009-11-10 17:54 ` [PATCH 05/10] parisc: use RCU " Stephen Hemminger
2009-11-10 18:26 ` Eric Dumazet
2009-11-11 6:48 ` David Miller
2009-11-10 17:54 ` [PATCH 06/10] s390: use RCU to walk list of network devices Stephen Hemminger
2009-11-10 18:27 ` Eric Dumazet
2009-11-10 18:29 ` Stephen Hemminger
2009-11-10 18:40 ` Eric Dumazet
2009-11-11 6:49 ` David Miller
2009-11-10 17:54 ` [PATCH 07/10] decnet: use RCU to find " Stephen Hemminger
2009-11-10 18:43 ` Eric Dumazet
2009-11-10 18:50 ` Stephen Hemminger
2009-11-10 18:24 ` steve
2009-11-11 17:39 ` [PATCH 1/2] decnet: add RTNL lock when reading address list Stephen Hemminger
2009-11-11 17:40 ` [PATCH 2/2] decnet: convert dndev_lock to spinlock Stephen Hemminger
2009-11-12 3:56 ` David Miller
2009-11-12 3:56 ` [PATCH 1/2] decnet: add RTNL lock when reading address list David Miller
2009-11-10 19:25 ` [PATCH 07/10] decnet: use RCU to find network devices Eric Dumazet
2009-11-11 6:49 ` David Miller
2009-11-10 17:54 ` [PATCH 08/10] ipv6: use RCU to walk list of " Stephen Hemminger
2009-11-11 6:50 ` David Miller
2009-11-12 3:34 ` [PATCH net-next-2.6] " Eric Dumazet
2009-11-14 4:39 ` David Miller
2009-11-10 17:54 ` [PATCH 09/10] IPV4: use rcu to walk list of devices in IGMP Stephen Hemminger
2009-11-10 18:47 ` Eric Dumazet
2009-11-11 6:50 ` David Miller
2009-11-10 17:54 ` [PATCH 10/10] CAN: use dev_get_by_index_rcu Stephen Hemminger
2009-11-10 18:34 ` Eric Dumazet
2009-11-11 5:54 ` Oliver Hartkopp
2009-11-11 6:50 ` David Miller
2009-11-10 18:18 ` [PATCH 00/10] netdev: get rid of read_lock(&dev_base_lock) usages Eric Dumazet
2009-11-10 18:22 ` Stephen Hemminger
2009-11-10 18:24 ` Stephen Hemminger
2009-11-10 18:39 ` Eric Dumazet
2009-11-10 18:53 ` Stephen Hemminger
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=e160a17e366ae2f676df822db1e62bc2@coraid.com \
--to=ecashin@coraid.com \
--cc=bzolnier@gmail.com \
--cc=harvey.harrison@gmail.com \
--cc=karaluh@karaluh.pl \
--cc=netdev@vger.kernel.org \
--cc=roel.kluin@gmail.com \
--cc=shemminger@vyatta.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;
as well as URLs for NNTP newsgroup(s).