Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/2] bridge: make setlink/dellink notifications more accurate
@ 2017-10-24 12:32 Nikolay Aleksandrov
  2017-10-24 12:32 ` [PATCH net-next v2 1/2] bridge: netlink: " Nikolay Aleksandrov
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Nikolay Aleksandrov @ 2017-10-24 12:32 UTC (permalink / raw)
  To: netdev; +Cc: roopa, dsa, mrv, stephen, bridge, Nikolay Aleksandrov

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, but we cannot use a specific error because the drivers
can return anything and we may mask it, also we'd need to update all places
that directly return the add result, thus to signal that a vlan was created
or updated and in order not to break overlapping vlan range add we pass
down the new boolean that tracks changes to the add functions to check
if anything was actually updated.

Can't say that I am happy with this change, but currently I don't see any
simpler way which doesn't affect user-space.

v2: pass changed down to vlan add instead of masking errors

Thanks,
 Nik

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

 net/bridge/br_netlink.c        | 51 ++++++++++++++++-----------
 net/bridge/br_netlink_tunnel.c | 14 +++++---
 net/bridge/br_private.h        |  6 ++--
 net/bridge/br_private_tunnel.h |  3 +-
 net/bridge/br_vlan.c           | 78 ++++++++++++++++++++++++++++++------------
 5 files changed, 102 insertions(+), 50 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-10-26 11:08 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-24 12:32 [PATCH net-next v2 0/2] bridge: make setlink/dellink notifications more accurate Nikolay Aleksandrov
2017-10-24 12:32 ` [PATCH net-next v2 1/2] bridge: netlink: " Nikolay Aleksandrov
2017-10-24 12:32 ` [PATCH net-next v2 2/2] bridge: vlan: signal if anything changed on vlan add Nikolay Aleksandrov
2017-10-25 20:51   ` kbuild test robot
2017-10-25 21:49 ` [PATCH net-next v2 0/2] bridge: make setlink/dellink notifications more accurate Nikolay Aleksandrov
2017-10-25 21:59   ` [PATCH net-next v3 " Nikolay Aleksandrov
2017-10-25 21:59     ` [PATCH net-next v3 1/2] bridge: netlink: " Nikolay Aleksandrov
2017-10-26  8:17       ` Stephen Hemminger
2017-10-26  8:25         ` Nikolay Aleksandrov
2017-10-25 21:59     ` [PATCH net-next v3 2/2] bridge: vlan: signal if anything changed on vlan add Nikolay Aleksandrov
2017-10-25 22:14     ` [PATCH net-next v3 0/2] bridge: make setlink/dellink notifications more accurate Nikolay Aleksandrov
2017-10-25 22:52       ` [PATCH net-next v4 " Nikolay Aleksandrov
2017-10-25 22:52         ` [PATCH net-next v4 1/2] bridge: netlink: " Nikolay Aleksandrov
2017-10-25 22:52         ` [PATCH net-next v4 2/2] bridge: vlan: signal if anything changed on vlan add Nikolay Aleksandrov
2017-10-26 10:16           ` Toshiaki Makita
2017-10-26 11:02             ` [Bridge] " Nikolay Aleksandrov
2017-10-26 11:08               ` Nikolay Aleksandrov
2017-10-26  1:12       ` [PATCH net-next v3 0/2] bridge: make setlink/dellink notifications more accurate David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox