[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111023155051.GA2141@minipsycho.redhat.com>
Date: Sun, 23 Oct 2011 17:50:53 +0200
From: Jiri Pirko <jpirko@...hat.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net,
bhutchings@...arflare.com, shemminger@...tta.com, fubar@...ibm.com,
andy@...yhouse.net, tgraf@...radead.org, ebiederm@...ssion.com,
mirqus@...il.com, kaber@...sh.net, greearb@...delatech.com,
jesse@...ira.com, fbl@...hat.com, benjamin.poirier@...il.com,
jzupka@...hat.com
Subject: Re: [patch net-next V2] net: introduce ethernet teaming device
Sun, Oct 23, 2011 at 04:37:48PM CEST, eric.dumazet@...il.com wrote:
>Le dimanche 23 octobre 2011 à 14:51 +0200, Jiri Pirko a écrit :
>
>> Yes. And team->mode_ops.receive can change only after synchronize_rcu is
>> done. It's not possible it changes within the window you are talking about.
>
>If it was true, you would not need the synchronize_rcu() call you added
>in __team_change_mode() :
>
>
>----------------------------------------------------------------------
>
>static int __team_change_mode(struct team *team,
> const struct team_mode *new_mode)
>{
> /* Check if mode was previously set and do cleanup if so */
> if (team->mode_kind) {
> void (*exit_op)(struct team *team) = team->mode_ops.exit;
>
> /* Clear ops area so no callback is called any longer */
> team_mode_ops_clear(&team->mode_ops);
>
> synchronize_rcu();
>
> if (exit_op)
> exit_op(team);
>
>
>-----------------------------------------------------------------------
>
>So the question is : Why do you have this synchronize_rcu() call here ?
You are right. This call is redundant here. I'll remove it.
This also means I can use memset & memcpy for mode_ops after all.
I'll change that and add comment about this locking situation to avoid
confusion.
Thanks a lot Eric!
Jirka
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists