Netdev List
 help / color / mirror / Atom feed
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
To: netdev@vger.kernel.org
Cc: roopa@cumulusnetworks.com, dsa@cumulusnetworks.com,
	mrv@mojatatu.com, stephen@networkplumber.org,
	bridge@lists.linux-foundation.org,
	Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Subject: [PATCH net-next 0/2] bridge: make setlink/dellink notifications more accurate
Date: Thu, 19 Oct 2017 18:54:57 +0300	[thread overview]
Message-ID: <1508428499-32355-1-git-send-email-nikolay@cumulusnetworks.com> (raw)

Hi,
Before this set the bridge would generate a notification on vlan add or del
even if they didn't actually do any changes, which confuses listeners and
is generally not preferred. We could also lose notifications on actual
changes if one adds a range of vlans and there's an error in the middle.
The problem with just breaking and returning an error is that we could
break existing user-space scripts which rely on the vlan delete to clear
all existing entries in the specified range and ignore the non-existing
errors (typically used to clear the current vlan config).
So in order to make the notifications more accurate while keeping backwards
compatibility we add a boolean that tracks if anything actually changed
during the config calls.

The vlan add is more difficult to fix because it always returns 0 even if
nothing changed, so we use EEXIST to signal that and in order not to break
overlapping vlan range add or script return expectations we clear it on
return, the functions used by vlan add are not expected to return EEXIST.

Thanks,
 Nik

Nikolay Aleksandrov (2):
  bridge: netlink: make setlink/dellink notifications more accurate
  bridge: vlan: return EEXIST on add if nothing changed

 net/bridge/br_netlink.c        | 49 ++++++++++++++++++++++++++----------------
 net/bridge/br_netlink_tunnel.c | 14 +++++++-----
 net/bridge/br_private_tunnel.h |  3 ++-
 net/bridge/br_vlan.c           | 38 +++++++++++++++++++++-----------
 4 files changed, 68 insertions(+), 36 deletions(-)

-- 
2.1.4

             reply	other threads:[~2017-10-19 15:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19 15:54 Nikolay Aleksandrov [this message]
2017-10-19 15:54 ` [PATCH net-next 1/2] bridge: netlink: make setlink/dellink notifications more accurate Nikolay Aleksandrov
2017-10-19 15:54 ` [PATCH net-next 2/2] bridge: vlan: return EEXIST on add if nothing changed Nikolay Aleksandrov
2017-10-19 16:10 ` [PATCH net-next 0/2] bridge: make setlink/dellink notifications more accurate Nikolay Aleksandrov
2017-10-22  0:45   ` 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=1508428499-32355-1-git-send-email-nikolay@cumulusnetworks.com \
    --to=nikolay@cumulusnetworks.com \
    --cc=bridge@lists.linux-foundation.org \
    --cc=dsa@cumulusnetworks.com \
    --cc=mrv@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --cc=roopa@cumulusnetworks.com \
    --cc=stephen@networkplumber.org \
    /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