All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Octavian Purdila <opurdila@ixiacom.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] net: factorize rt_do_flush for batch device unregistering
Date: Mon, 16 Nov 2009 23:15:25 +0100	[thread overview]
Message-ID: <4B01CEFD.4070908@gmail.com> (raw)
In-Reply-To: <200911170003.44099.opurdila@ixiacom.com>

Octavian Purdila a écrit :
> On Monday 16 November 2009 23:32:55 you wrote:
> 
>>> @@ -5374,6 +5395,9 @@ EXPORT_SYMBOL(unregister_netdevice_queue);
>>>   *	unregister_netdevice_many - unregister many devices
>>>   *	@head: list of devices
>>>   *
>>> + *	WARNING: This function modifies the list. It may change the order of
>>> the + *	elements in the list. However, you can assume it does not add or
>>> delete + *	elements to/from the list.
>> Sorry I dont understand this comment
>>
> 
> The  list passed to unregister_netdevice_many(), as the "head" parameter, may 
> be altered, e.g. order may change between the elements.
> 
> That is because we temporarily move the items from the list to the 
> rt_flush_list for the flush. When we add the items back they may not be added in 
> the same place.
> 

Ah, I got it now, confusion is that comment makes more sense for
rollback_registered_many() because when reading unregister_netdevice_many()
it is clear it doesnt change the list...

void unregister_netdevice_many(struct list_head *head)
{
        struct net_device *dev;

        if (!list_empty(head)) {
                rollback_registered_many(head);
                list_for_each_entry(dev, head, unreg_list)
                        net_set_todo(dev);
        }
}



      reply	other threads:[~2009-11-16 22:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-16 21:08 [PATCH] net: factorize rt_do_flush for batch device unregistering Octavian Purdila
2009-11-16 21:32 ` Eric Dumazet
2009-11-16 22:03   ` Octavian Purdila
2009-11-16 22:15     ` Eric Dumazet [this message]

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=4B01CEFD.4070908@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=opurdila@ixiacom.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.