All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Aleksandrov <nikolay@redhat.com>
To: Veaceslav Falico <vfalico@redhat.com>
Cc: netdev@vger.kernel.org, fubar@us.ibm.com, andy@greyhouse.net,
	davem@davemloft.net, kaber@trash.net
Subject: Re: [net-next,1/3] bonding: fix vlan 0 addition and removal
Date: Tue, 06 Aug 2013 11:07:30 +0200	[thread overview]
Message-ID: <5200BCD2.4090105@redhat.com> (raw)
In-Reply-To: <20130806085941.GM22756@redhat.com>

On 08/06/2013 10:59 AM, Veaceslav Falico wrote:
> On Tue, Aug 06, 2013 at 10:39:22AM +0200, Nikolay Aleksandrov wrote:
>>> From 1c89abefebe90568ed52d2df59fcfdd650bc4696 Mon Sep 17 00:00:00 2001
>>> From: Veaceslav Falico <vfalico@redhat.com>
>>> Date: Mon, 5 Aug 2013 23:29:12 +0200
>>> Subject: [PATCH] bonding: add vlan_uses_dev_rcu() and make bond_vlan_used()
>>> use it
>>>
>>> Currently, bond_vlan_used() looks for any vlan, including the pseudo-vlan
>>> id 0, and always returns true if 8021q is loaded. This creates several bad
>>> situations - some warnings in __bond_release_one() because it thinks that
>>> we still have vlans while removing, sending LB packets with vlan id 0 and,
>>> possibly, other caused by vlan id 0.
>>>
>>> Fix it by adding a new call, vlan_uses_dev_rcu(), which is the same as
>>> vlan_uses_dev(), but uses rcu_dereference() instead of rtnl, and thus we
>>> can use it in bond_vlan_used() wrapped in rcu_read_lock().
>>>
>>> Also, use the pure vlan_uses_dev() in __bond_release_one() cause the rtnl
>>> lock is held there.
>>>
>> Just 1 more note, you can't trust nr_vlan_devs under RCU.
> 
> Yes, you're right, however we actually don't care anyway if we race with
> (un)register_vlan_dev() - we'll end up either in using the (un)registered
> vlan or not, and in both cases it's ok. So I don't see a real problem here,
> tbh, though I'll look into this also.
You might have stale value in the cache, the implications don't stop there.
I'd like to avoid inconsistent behaviour if there's a way.
A solution that can be relied on and works always would be much more
preferable.

  reply	other threads:[~2013-08-06  9:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-05 13:28 [PATCH net-next 0/3] bonding: vlan handling changes Nikolay Aleksandrov
2013-08-05 13:28 ` [PATCH net-next 1/3] bonding: fix vlan 0 addition and removal Nikolay Aleksandrov
2013-08-05 21:51   ` [net-next,1/3] " Veaceslav Falico
2013-08-05 23:08     ` David Miller
2013-08-06  0:37       ` Veaceslav Falico
2013-08-06  8:16     ` Nikolay Aleksandrov
2013-08-06  8:51       ` Veaceslav Falico
2013-08-06  9:01         ` Nikolay Aleksandrov
2013-08-06  8:39     ` Nikolay Aleksandrov
2013-08-06  8:59       ` Veaceslav Falico
2013-08-06  9:07         ` Nikolay Aleksandrov [this message]
2013-08-06  9:10           ` Veaceslav Falico
2013-08-05 13:28 ` [PATCH net-next 2/3] bonding: change the bond's vlan syncing functions with the standard ones Nikolay Aleksandrov
2013-08-05 21:56   ` [net-next, " Veaceslav Falico
2013-08-05 13:28 ` [PATCH net-next 3/3] bonding: unwind on bond_add_vlan add failure Nikolay Aleksandrov
2013-08-05 21:59   ` [net-next,3/3] " Veaceslav Falico
2013-08-05 23:09     ` 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=5200BCD2.4090105@redhat.com \
    --to=nikolay@redhat.com \
    --cc=andy@greyhouse.net \
    --cc=davem@davemloft.net \
    --cc=fubar@us.ibm.com \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=vfalico@redhat.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.