All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/3] net: bridge: add an option to disabe linklocal learning
@ 2018-11-24  2:34 ` Nikolay Aleksandrov
  0 siblings, 0 replies; 34+ messages in thread
From: Nikolay Aleksandrov @ 2018-11-24  2:34 UTC (permalink / raw)
  To: netdev; +Cc: roopa, andrew, davem, bridge, Nikolay Aleksandrov

Hi,
This set adds a new bridge option which can control learning from
link-local packets, by default learning is on to be consistent and avoid
breaking users expectations. If the new no_linklocal_learn option is
enabled then the bridge will stop learning from link-local packets.

In order to save space for future boolean options, patch 01 adds a new
bool option API that uses a bitmask to control boolean options. The
bridge is by far the largest netlink attr user and we keep adding simple
boolean options which waste nl attr ids and space. We're not directly
mapping these to the in-kernel bridge flags because some might require
more complex configuration changes (e.g. if we were to add the per port
vlan stats now, it'd require multiple checks before changing value).
Any new bool option needs to be handled by both br_boolopt_toggle and get
in order to be able to retrieve its state later. All such options are
automatically exported via netlink. The behaviour of setting such
options is consistent with netlink option handling when a missing
option is being set (silently ignored), e.g. when a newer iproute2 is used
on older kernel. All supported options are exported via bm's optmask
when dumping the new attribute.

v2: address Andrew Lunn's comments, squash a minor change into patch 01,
    export all supported options via optmask when dumping, add patch 03,
    pass down extack so options can return meaningful errors, add
    WARN_ON on unsupported options (should not happen)

Thanks,
 Nik

Nikolay Aleksandrov (3):
  net: bridge: add support for user-controlled bool options
  net: bridge: add no_linklocal_learn bool option
  net: bridge: export supported boolopts

 include/uapi/linux/if_bridge.h | 21 ++++++++++
 include/uapi/linux/if_link.h   |  1 +
 net/bridge/br.c                | 76 ++++++++++++++++++++++++++++++++++
 net/bridge/br_input.c          |  4 +-
 net/bridge/br_netlink.c        | 17 +++++++-
 net/bridge/br_private.h        |  9 ++++
 net/bridge/br_sysfs_br.c       | 22 ++++++++++
 net/core/rtnetlink.c           |  2 +-
 8 files changed, 149 insertions(+), 3 deletions(-)

-- 
2.17.2

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

* [Bridge] [PATCH net-next v2 0/3] net: bridge: add an option to disabe linklocal learning
@ 2018-11-24  2:34 ` Nikolay Aleksandrov
  0 siblings, 0 replies; 34+ messages in thread
From: Nikolay Aleksandrov @ 2018-11-24  2:34 UTC (permalink / raw)
  To: netdev; +Cc: Nikolay Aleksandrov, andrew, roopa, bridge, davem

Hi,
This set adds a new bridge option which can control learning from
link-local packets, by default learning is on to be consistent and avoid
breaking users expectations. If the new no_linklocal_learn option is
enabled then the bridge will stop learning from link-local packets.

In order to save space for future boolean options, patch 01 adds a new
bool option API that uses a bitmask to control boolean options. The
bridge is by far the largest netlink attr user and we keep adding simple
boolean options which waste nl attr ids and space. We're not directly
mapping these to the in-kernel bridge flags because some might require
more complex configuration changes (e.g. if we were to add the per port
vlan stats now, it'd require multiple checks before changing value).
Any new bool option needs to be handled by both br_boolopt_toggle and get
in order to be able to retrieve its state later. All such options are
automatically exported via netlink. The behaviour of setting such
options is consistent with netlink option handling when a missing
option is being set (silently ignored), e.g. when a newer iproute2 is used
on older kernel. All supported options are exported via bm's optmask
when dumping the new attribute.

v2: address Andrew Lunn's comments, squash a minor change into patch 01,
    export all supported options via optmask when dumping, add patch 03,
    pass down extack so options can return meaningful errors, add
    WARN_ON on unsupported options (should not happen)

Thanks,
 Nik

Nikolay Aleksandrov (3):
  net: bridge: add support for user-controlled bool options
  net: bridge: add no_linklocal_learn bool option
  net: bridge: export supported boolopts

 include/uapi/linux/if_bridge.h | 21 ++++++++++
 include/uapi/linux/if_link.h   |  1 +
 net/bridge/br.c                | 76 ++++++++++++++++++++++++++++++++++
 net/bridge/br_input.c          |  4 +-
 net/bridge/br_netlink.c        | 17 +++++++-
 net/bridge/br_private.h        |  9 ++++
 net/bridge/br_sysfs_br.c       | 22 ++++++++++
 net/core/rtnetlink.c           |  2 +-
 8 files changed, 149 insertions(+), 3 deletions(-)

-- 
2.17.2


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

* [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options
  2018-11-24  2:34 ` [Bridge] " Nikolay Aleksandrov
@ 2018-11-24  2:34   ` Nikolay Aleksandrov
  -1 siblings, 0 replies; 34+ messages in thread
From: Nikolay Aleksandrov @ 2018-11-24  2:34 UTC (permalink / raw)
  To: netdev; +Cc: roopa, andrew, davem, bridge, Nikolay Aleksandrov

We have been adding many new bridge options, a big number of which are
boolean but still take up netlink attribute ids and waste space in the skb.
Recently we discussed learning from link-local packets[1] and decided
yet another new boolean option will be needed, thus introducing this API
to save some bridge nl space.
The API supports changing the value of multiple boolean options at once
via the br_boolopt_multi struct which has an optmask (which options to
set, bit per opt) and optval (options' new values). Future boolean
options will only be added to the br_boolopt_id enum and then will have
to be handled in br_boolopt_toggle/get. The API will automatically
add the ability to change and export them via netlink, sysfs can use the
single boolopt function versions to do the same. The behaviour with
failing/succeeding is the same as with normal netlink option changing.

If an option requires mapping to internal kernel flag or needs special
configuration to be enabled then it should be handled in
br_boolopt_toggle. It should also be able to retrieve an option's current
state via br_boolopt_get.

v2: WARN_ON() on unsupported option as that shouldn't be possible and
    also will help catch people who add new options without handling
    them for both set and get. Pass down extack so if an option desires
    it could set it on error and be more user-friendly.

[1] https://www.spinics.net/lists/netdev/msg532698.html

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
 include/uapi/linux/if_bridge.h | 18 +++++++++
 include/uapi/linux/if_link.h   |  1 +
 net/bridge/br.c                | 71 ++++++++++++++++++++++++++++++++++
 net/bridge/br_netlink.c        | 17 +++++++-
 net/bridge/br_private.h        |  8 ++++
 net/core/rtnetlink.c           |  2 +-
 6 files changed, 115 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h
index e41eda3c71f1..6dc02c03bdf8 100644
--- a/include/uapi/linux/if_bridge.h
+++ b/include/uapi/linux/if_bridge.h
@@ -292,4 +292,22 @@ struct br_mcast_stats {
 	__u64 mcast_bytes[BR_MCAST_DIR_SIZE];
 	__u64 mcast_packets[BR_MCAST_DIR_SIZE];
 };
+
+/* bridge boolean options
+ * IMPORTANT: if adding a new option do not forget to handle
+ *            it in br_boolopt_toggle/get and bridge sysfs
+ */
+enum br_boolopt_id {
+	BR_BOOLOPT_MAX
+};
+
+/* struct br_boolopt_multi - change multiple bridge boolean options
+ *
+ * @optval: new option values (bit per option)
+ * @optmask: options to change (bit per option)
+ */
+struct br_boolopt_multi {
+	__u32 optval;
+	__u32 optmask;
+};
 #endif /* _UAPI_LINUX_IF_BRIDGE_H */
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index f42c069d81db..d6533828123a 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -288,6 +288,7 @@ enum {
 	IFLA_BR_MCAST_IGMP_VERSION,
 	IFLA_BR_MCAST_MLD_VERSION,
 	IFLA_BR_VLAN_STATS_PER_PORT,
+	IFLA_BR_MULTI_BOOLOPT,
 	__IFLA_BR_MAX,
 };
 
diff --git a/net/bridge/br.c b/net/bridge/br.c
index 360ad66c21e9..c527160c1975 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -175,6 +175,77 @@ static struct notifier_block br_switchdev_notifier = {
 	.notifier_call = br_switchdev_event,
 };
 
+/* br_boolopt_toggle - change user-controlled boolean option
+ *
+ * @br: bridge device
+ * @opt: id of the option to change
+ * @on: new option value
+ * @extack: extack for error messages
+ *
+ * Changes the value of the respective boolean option to @on taking care of
+ * any internal option value mapping and configuration.
+ */
+int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id opt, bool on,
+		      struct netlink_ext_ack *extack)
+{
+	switch (opt) {
+	default:
+		/* shouldn't be called with unsupported options */
+		WARN_ON(1);
+		break;
+	}
+
+	return 0;
+}
+
+int br_boolopt_get(const struct net_bridge *br, enum br_boolopt_id opt)
+{
+	switch (opt) {
+	default:
+		/* shouldn't be called with unsupported options */
+		WARN_ON(1);
+		break;
+	}
+
+	return 0;
+}
+
+int br_boolopt_multi_toggle(struct net_bridge *br,
+			    struct br_boolopt_multi *bm,
+			    struct netlink_ext_ack *extack)
+{
+	unsigned long bitmap = bm->optmask;
+	int err = 0;
+	int opt_id;
+
+	for_each_set_bit(opt_id, &bitmap, BR_BOOLOPT_MAX) {
+		bool on = !!(bm->optval & BIT(opt_id));
+
+		err = br_boolopt_toggle(br, opt_id, on, extack);
+		if (err) {
+			br_debug(br, "boolopt multi-toggle error: option: %d current: %d new: %d error: %d\n",
+				 opt_id, br_boolopt_get(br, opt_id), on, err);
+			break;
+		}
+	}
+
+	return err;
+}
+
+void br_boolopt_multi_get(const struct net_bridge *br,
+			  struct br_boolopt_multi *bm)
+{
+	u32 optval = 0;
+	int opt_id;
+
+	for (opt_id = 0; opt_id < BR_BOOLOPT_MAX; opt_id++)
+		optval |= (br_boolopt_get(br, opt_id) << opt_id);
+
+	bm->optval = optval;
+	bm->optmask = 0;
+}
+
+/* private bridge options, controlled by the kernel */
 void br_opt_toggle(struct net_bridge *br, enum net_bridge_opts opt, bool on)
 {
 	bool cur = !!br_opt_get(br, opt);
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 3345f1984542..13cd50326af2 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -1035,6 +1035,8 @@ static const struct nla_policy br_policy[IFLA_BR_MAX + 1] = {
 	[IFLA_BR_MCAST_IGMP_VERSION] = { .type = NLA_U8 },
 	[IFLA_BR_MCAST_MLD_VERSION] = { .type = NLA_U8 },
 	[IFLA_BR_VLAN_STATS_PER_PORT] = { .type = NLA_U8 },
+	[IFLA_BR_MULTI_BOOLOPT] = { .type = NLA_EXACT_LEN,
+				    .len = sizeof(struct br_boolopt_multi) },
 };
 
 static int br_changelink(struct net_device *brdev, struct nlattr *tb[],
@@ -1296,6 +1298,15 @@ static int br_changelink(struct net_device *brdev, struct nlattr *tb[],
 	}
 #endif
 
+	if (data[IFLA_BR_MULTI_BOOLOPT]) {
+		struct br_boolopt_multi *bm;
+
+		bm = nla_data(data[IFLA_BR_MULTI_BOOLOPT]);
+		err = br_boolopt_multi_toggle(br, bm, extack);
+		if (err)
+			return err;
+	}
+
 	return 0;
 }
 
@@ -1374,6 +1385,7 @@ static size_t br_get_size(const struct net_device *brdev)
 	       nla_total_size(sizeof(u8)) +     /* IFLA_BR_NF_CALL_IP6TABLES */
 	       nla_total_size(sizeof(u8)) +     /* IFLA_BR_NF_CALL_ARPTABLES */
 #endif
+	       nla_total_size(sizeof(struct br_boolopt_multi)) + /* IFLA_BR_MULTI_BOOLOPT */
 	       0;
 }
 
@@ -1387,6 +1399,7 @@ static int br_fill_info(struct sk_buff *skb, const struct net_device *brdev)
 	u32 stp_enabled = br->stp_enabled;
 	u16 priority = (br->bridge_id.prio[0] << 8) | br->bridge_id.prio[1];
 	u8 vlan_enabled = br_vlan_enabled(br->dev);
+	struct br_boolopt_multi bm;
 	u64 clockval;
 
 	clockval = br_timer_value(&br->hello_timer);
@@ -1403,6 +1416,7 @@ static int br_fill_info(struct sk_buff *skb, const struct net_device *brdev)
 	if (nla_put_u64_64bit(skb, IFLA_BR_GC_TIMER, clockval, IFLA_BR_PAD))
 		return -EMSGSIZE;
 
+	br_boolopt_multi_get(br, &bm);
 	if (nla_put_u32(skb, IFLA_BR_FORWARD_DELAY, forward_delay) ||
 	    nla_put_u32(skb, IFLA_BR_HELLO_TIME, hello_time) ||
 	    nla_put_u32(skb, IFLA_BR_MAX_AGE, age_time) ||
@@ -1420,7 +1434,8 @@ static int br_fill_info(struct sk_buff *skb, const struct net_device *brdev)
 	    nla_put_u8(skb, IFLA_BR_TOPOLOGY_CHANGE, br->topology_change) ||
 	    nla_put_u8(skb, IFLA_BR_TOPOLOGY_CHANGE_DETECTED,
 		       br->topology_change_detected) ||
-	    nla_put(skb, IFLA_BR_GROUP_ADDR, ETH_ALEN, br->group_addr))
+	    nla_put(skb, IFLA_BR_GROUP_ADDR, ETH_ALEN, br->group_addr) ||
+	    nla_put(skb, IFLA_BR_MULTI_BOOLOPT, sizeof(bm), &bm))
 		return -EMSGSIZE;
 
 #ifdef CONFIG_BRIDGE_VLAN_FILTERING
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index bc2653738fc3..6d4c208fbf08 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -507,6 +507,14 @@ static inline int br_opt_get(const struct net_bridge *br,
 	return test_bit(opt, &br->options);
 }
 
+int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id opt, bool on,
+		      struct netlink_ext_ack *extack);
+int br_boolopt_get(const struct net_bridge *br, enum br_boolopt_id opt);
+int br_boolopt_multi_toggle(struct net_bridge *br,
+			    struct br_boolopt_multi *bm,
+			    struct netlink_ext_ack *extack);
+void br_boolopt_multi_get(const struct net_bridge *br,
+			  struct br_boolopt_multi *bm);
 void br_opt_toggle(struct net_bridge *br, enum net_bridge_opts opt, bool on);
 
 /* br_device.c */
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 86f2d9cbdae3..a498bb41c9aa 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -59,7 +59,7 @@
 #include <net/rtnetlink.h>
 #include <net/net_namespace.h>
 
-#define RTNL_MAX_TYPE		49
+#define RTNL_MAX_TYPE		50
 #define RTNL_SLAVE_MAX_TYPE	36
 
 struct rtnl_link {
-- 
2.17.2

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

* [Bridge] [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options
@ 2018-11-24  2:34   ` Nikolay Aleksandrov
  0 siblings, 0 replies; 34+ messages in thread
From: Nikolay Aleksandrov @ 2018-11-24  2:34 UTC (permalink / raw)
  To: netdev; +Cc: Nikolay Aleksandrov, andrew, roopa, bridge, davem

We have been adding many new bridge options, a big number of which are
boolean but still take up netlink attribute ids and waste space in the skb.
Recently we discussed learning from link-local packets[1] and decided
yet another new boolean option will be needed, thus introducing this API
to save some bridge nl space.
The API supports changing the value of multiple boolean options at once
via the br_boolopt_multi struct which has an optmask (which options to
set, bit per opt) and optval (options' new values). Future boolean
options will only be added to the br_boolopt_id enum and then will have
to be handled in br_boolopt_toggle/get. The API will automatically
add the ability to change and export them via netlink, sysfs can use the
single boolopt function versions to do the same. The behaviour with
failing/succeeding is the same as with normal netlink option changing.

If an option requires mapping to internal kernel flag or needs special
configuration to be enabled then it should be handled in
br_boolopt_toggle. It should also be able to retrieve an option's current
state via br_boolopt_get.

v2: WARN_ON() on unsupported option as that shouldn't be possible and
    also will help catch people who add new options without handling
    them for both set and get. Pass down extack so if an option desires
    it could set it on error and be more user-friendly.

[1] https://www.spinics.net/lists/netdev/msg532698.html

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
 include/uapi/linux/if_bridge.h | 18 +++++++++
 include/uapi/linux/if_link.h   |  1 +
 net/bridge/br.c                | 71 ++++++++++++++++++++++++++++++++++
 net/bridge/br_netlink.c        | 17 +++++++-
 net/bridge/br_private.h        |  8 ++++
 net/core/rtnetlink.c           |  2 +-
 6 files changed, 115 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h
index e41eda3c71f1..6dc02c03bdf8 100644
--- a/include/uapi/linux/if_bridge.h
+++ b/include/uapi/linux/if_bridge.h
@@ -292,4 +292,22 @@ struct br_mcast_stats {
 	__u64 mcast_bytes[BR_MCAST_DIR_SIZE];
 	__u64 mcast_packets[BR_MCAST_DIR_SIZE];
 };
+
+/* bridge boolean options
+ * IMPORTANT: if adding a new option do not forget to handle
+ *            it in br_boolopt_toggle/get and bridge sysfs
+ */
+enum br_boolopt_id {
+	BR_BOOLOPT_MAX
+};
+
+/* struct br_boolopt_multi - change multiple bridge boolean options
+ *
+ * @optval: new option values (bit per option)
+ * @optmask: options to change (bit per option)
+ */
+struct br_boolopt_multi {
+	__u32 optval;
+	__u32 optmask;
+};
 #endif /* _UAPI_LINUX_IF_BRIDGE_H */
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index f42c069d81db..d6533828123a 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -288,6 +288,7 @@ enum {
 	IFLA_BR_MCAST_IGMP_VERSION,
 	IFLA_BR_MCAST_MLD_VERSION,
 	IFLA_BR_VLAN_STATS_PER_PORT,
+	IFLA_BR_MULTI_BOOLOPT,
 	__IFLA_BR_MAX,
 };
 
diff --git a/net/bridge/br.c b/net/bridge/br.c
index 360ad66c21e9..c527160c1975 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -175,6 +175,77 @@ static struct notifier_block br_switchdev_notifier = {
 	.notifier_call = br_switchdev_event,
 };
 
+/* br_boolopt_toggle - change user-controlled boolean option
+ *
+ * @br: bridge device
+ * @opt: id of the option to change
+ * @on: new option value
+ * @extack: extack for error messages
+ *
+ * Changes the value of the respective boolean option to @on taking care of
+ * any internal option value mapping and configuration.
+ */
+int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id opt, bool on,
+		      struct netlink_ext_ack *extack)
+{
+	switch (opt) {
+	default:
+		/* shouldn't be called with unsupported options */
+		WARN_ON(1);
+		break;
+	}
+
+	return 0;
+}
+
+int br_boolopt_get(const struct net_bridge *br, enum br_boolopt_id opt)
+{
+	switch (opt) {
+	default:
+		/* shouldn't be called with unsupported options */
+		WARN_ON(1);
+		break;
+	}
+
+	return 0;
+}
+
+int br_boolopt_multi_toggle(struct net_bridge *br,
+			    struct br_boolopt_multi *bm,
+			    struct netlink_ext_ack *extack)
+{
+	unsigned long bitmap = bm->optmask;
+	int err = 0;
+	int opt_id;
+
+	for_each_set_bit(opt_id, &bitmap, BR_BOOLOPT_MAX) {
+		bool on = !!(bm->optval & BIT(opt_id));
+
+		err = br_boolopt_toggle(br, opt_id, on, extack);
+		if (err) {
+			br_debug(br, "boolopt multi-toggle error: option: %d current: %d new: %d error: %d\n",
+				 opt_id, br_boolopt_get(br, opt_id), on, err);
+			break;
+		}
+	}
+
+	return err;
+}
+
+void br_boolopt_multi_get(const struct net_bridge *br,
+			  struct br_boolopt_multi *bm)
+{
+	u32 optval = 0;
+	int opt_id;
+
+	for (opt_id = 0; opt_id < BR_BOOLOPT_MAX; opt_id++)
+		optval |= (br_boolopt_get(br, opt_id) << opt_id);
+
+	bm->optval = optval;
+	bm->optmask = 0;
+}
+
+/* private bridge options, controlled by the kernel */
 void br_opt_toggle(struct net_bridge *br, enum net_bridge_opts opt, bool on)
 {
 	bool cur = !!br_opt_get(br, opt);
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 3345f1984542..13cd50326af2 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -1035,6 +1035,8 @@ static const struct nla_policy br_policy[IFLA_BR_MAX + 1] = {
 	[IFLA_BR_MCAST_IGMP_VERSION] = { .type = NLA_U8 },
 	[IFLA_BR_MCAST_MLD_VERSION] = { .type = NLA_U8 },
 	[IFLA_BR_VLAN_STATS_PER_PORT] = { .type = NLA_U8 },
+	[IFLA_BR_MULTI_BOOLOPT] = { .type = NLA_EXACT_LEN,
+				    .len = sizeof(struct br_boolopt_multi) },
 };
 
 static int br_changelink(struct net_device *brdev, struct nlattr *tb[],
@@ -1296,6 +1298,15 @@ static int br_changelink(struct net_device *brdev, struct nlattr *tb[],
 	}
 #endif
 
+	if (data[IFLA_BR_MULTI_BOOLOPT]) {
+		struct br_boolopt_multi *bm;
+
+		bm = nla_data(data[IFLA_BR_MULTI_BOOLOPT]);
+		err = br_boolopt_multi_toggle(br, bm, extack);
+		if (err)
+			return err;
+	}
+
 	return 0;
 }
 
@@ -1374,6 +1385,7 @@ static size_t br_get_size(const struct net_device *brdev)
 	       nla_total_size(sizeof(u8)) +     /* IFLA_BR_NF_CALL_IP6TABLES */
 	       nla_total_size(sizeof(u8)) +     /* IFLA_BR_NF_CALL_ARPTABLES */
 #endif
+	       nla_total_size(sizeof(struct br_boolopt_multi)) + /* IFLA_BR_MULTI_BOOLOPT */
 	       0;
 }
 
@@ -1387,6 +1399,7 @@ static int br_fill_info(struct sk_buff *skb, const struct net_device *brdev)
 	u32 stp_enabled = br->stp_enabled;
 	u16 priority = (br->bridge_id.prio[0] << 8) | br->bridge_id.prio[1];
 	u8 vlan_enabled = br_vlan_enabled(br->dev);
+	struct br_boolopt_multi bm;
 	u64 clockval;
 
 	clockval = br_timer_value(&br->hello_timer);
@@ -1403,6 +1416,7 @@ static int br_fill_info(struct sk_buff *skb, const struct net_device *brdev)
 	if (nla_put_u64_64bit(skb, IFLA_BR_GC_TIMER, clockval, IFLA_BR_PAD))
 		return -EMSGSIZE;
 
+	br_boolopt_multi_get(br, &bm);
 	if (nla_put_u32(skb, IFLA_BR_FORWARD_DELAY, forward_delay) ||
 	    nla_put_u32(skb, IFLA_BR_HELLO_TIME, hello_time) ||
 	    nla_put_u32(skb, IFLA_BR_MAX_AGE, age_time) ||
@@ -1420,7 +1434,8 @@ static int br_fill_info(struct sk_buff *skb, const struct net_device *brdev)
 	    nla_put_u8(skb, IFLA_BR_TOPOLOGY_CHANGE, br->topology_change) ||
 	    nla_put_u8(skb, IFLA_BR_TOPOLOGY_CHANGE_DETECTED,
 		       br->topology_change_detected) ||
-	    nla_put(skb, IFLA_BR_GROUP_ADDR, ETH_ALEN, br->group_addr))
+	    nla_put(skb, IFLA_BR_GROUP_ADDR, ETH_ALEN, br->group_addr) ||
+	    nla_put(skb, IFLA_BR_MULTI_BOOLOPT, sizeof(bm), &bm))
 		return -EMSGSIZE;
 
 #ifdef CONFIG_BRIDGE_VLAN_FILTERING
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index bc2653738fc3..6d4c208fbf08 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -507,6 +507,14 @@ static inline int br_opt_get(const struct net_bridge *br,
 	return test_bit(opt, &br->options);
 }
 
+int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id opt, bool on,
+		      struct netlink_ext_ack *extack);
+int br_boolopt_get(const struct net_bridge *br, enum br_boolopt_id opt);
+int br_boolopt_multi_toggle(struct net_bridge *br,
+			    struct br_boolopt_multi *bm,
+			    struct netlink_ext_ack *extack);
+void br_boolopt_multi_get(const struct net_bridge *br,
+			  struct br_boolopt_multi *bm);
 void br_opt_toggle(struct net_bridge *br, enum net_bridge_opts opt, bool on);
 
 /* br_device.c */
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 86f2d9cbdae3..a498bb41c9aa 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -59,7 +59,7 @@
 #include <net/rtnetlink.h>
 #include <net/net_namespace.h>
 
-#define RTNL_MAX_TYPE		49
+#define RTNL_MAX_TYPE		50
 #define RTNL_SLAVE_MAX_TYPE	36
 
 struct rtnl_link {
-- 
2.17.2


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

* [PATCH net-next v2 2/3] net: bridge: add no_linklocal_learn bool option
  2018-11-24  2:34 ` [Bridge] " Nikolay Aleksandrov
@ 2018-11-24  2:34   ` Nikolay Aleksandrov
  -1 siblings, 0 replies; 34+ messages in thread
From: Nikolay Aleksandrov @ 2018-11-24  2:34 UTC (permalink / raw)
  To: netdev; +Cc: roopa, andrew, davem, bridge, Nikolay Aleksandrov

Use the new boolopt API to add an option which disables learning from
link-local packets. The default is kept as before and learning is
enabled. This is a simple map from a boolopt bit to a bridge private
flag that is tested before learning.

v2: pass NULL for extack via sysfs

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
 include/uapi/linux/if_bridge.h |  3 +++
 net/bridge/br.c                |  5 +++++
 net/bridge/br_input.c          |  4 +++-
 net/bridge/br_private.h        |  1 +
 net/bridge/br_sysfs_br.c       | 22 ++++++++++++++++++++++
 5 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h
index 6dc02c03bdf8..773e476a8e54 100644
--- a/include/uapi/linux/if_bridge.h
+++ b/include/uapi/linux/if_bridge.h
@@ -294,10 +294,13 @@ struct br_mcast_stats {
 };
 
 /* bridge boolean options
+ * BR_BOOLOPT_NO_LL_LEARN - disable learning from link-local packets
+ *
  * IMPORTANT: if adding a new option do not forget to handle
  *            it in br_boolopt_toggle/get and bridge sysfs
  */
 enum br_boolopt_id {
+	BR_BOOLOPT_NO_LL_LEARN,
 	BR_BOOLOPT_MAX
 };
 
diff --git a/net/bridge/br.c b/net/bridge/br.c
index c527160c1975..b4a51a053586 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -189,6 +189,9 @@ int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id opt, bool on,
 		      struct netlink_ext_ack *extack)
 {
 	switch (opt) {
+	case BR_BOOLOPT_NO_LL_LEARN:
+		br_opt_toggle(br, BROPT_NO_LL_LEARN, on);
+		break;
 	default:
 		/* shouldn't be called with unsupported options */
 		WARN_ON(1);
@@ -201,6 +204,8 @@ int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id opt, bool on,
 int br_boolopt_get(const struct net_bridge *br, enum br_boolopt_id opt)
 {
 	switch (opt) {
+	case BR_BOOLOPT_NO_LL_LEARN:
+		return br_opt_get(br, BROPT_NO_LL_LEARN);
 	default:
 		/* shouldn't be called with unsupported options */
 		WARN_ON(1);
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index 3ddca11f44c2..5ea7e56119c1 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -188,7 +188,9 @@ static void __br_handle_local_finish(struct sk_buff *skb)
 	u16 vid = 0;
 
 	/* check if vlan is allowed, to avoid spoofing */
-	if (p->flags & BR_LEARNING && br_should_learn(p, skb, &vid))
+	if ((p->flags & BR_LEARNING) &&
+	    !br_opt_get(p->br, BROPT_NO_LL_LEARN) &&
+	    br_should_learn(p, skb, &vid))
 		br_fdb_update(p->br, p, eth_hdr(skb)->h_source, vid, false);
 }
 
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 6d4c208fbf08..d29f837cd7a2 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -328,6 +328,7 @@ enum net_bridge_opts {
 	BROPT_NEIGH_SUPPRESS_ENABLED,
 	BROPT_MTU_SET_BY_USER,
 	BROPT_VLAN_STATS_PER_PORT,
+	BROPT_NO_LL_LEARN,
 };
 
 struct net_bridge {
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
index 60182bef6341..6a378a7e16ea 100644
--- a/net/bridge/br_sysfs_br.c
+++ b/net/bridge/br_sysfs_br.c
@@ -328,6 +328,27 @@ static ssize_t flush_store(struct device *d,
 }
 static DEVICE_ATTR_WO(flush);
 
+static ssize_t no_linklocal_learn_show(struct device *d,
+				       struct device_attribute *attr,
+				       char *buf)
+{
+	struct net_bridge *br = to_bridge(d);
+	return sprintf(buf, "%d\n", br_boolopt_get(br, BR_BOOLOPT_NO_LL_LEARN));
+}
+
+static int set_no_linklocal_learn(struct net_bridge *br, unsigned long val)
+{
+	return br_boolopt_toggle(br, BR_BOOLOPT_NO_LL_LEARN, !!val, NULL);
+}
+
+static ssize_t no_linklocal_learn_store(struct device *d,
+					struct device_attribute *attr,
+					const char *buf, size_t len)
+{
+	return store_bridge_parm(d, buf, len, set_no_linklocal_learn);
+}
+static DEVICE_ATTR_RW(no_linklocal_learn);
+
 #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
 static ssize_t multicast_router_show(struct device *d,
 				     struct device_attribute *attr, char *buf)
@@ -841,6 +862,7 @@ static struct attribute *bridge_attrs[] = {
 	&dev_attr_gc_timer.attr,
 	&dev_attr_group_addr.attr,
 	&dev_attr_flush.attr,
+	&dev_attr_no_linklocal_learn.attr,
 #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
 	&dev_attr_multicast_router.attr,
 	&dev_attr_multicast_snooping.attr,
-- 
2.17.2

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

* [Bridge] [PATCH net-next v2 2/3] net: bridge: add no_linklocal_learn bool option
@ 2018-11-24  2:34   ` Nikolay Aleksandrov
  0 siblings, 0 replies; 34+ messages in thread
From: Nikolay Aleksandrov @ 2018-11-24  2:34 UTC (permalink / raw)
  To: netdev; +Cc: Nikolay Aleksandrov, andrew, roopa, bridge, davem

Use the new boolopt API to add an option which disables learning from
link-local packets. The default is kept as before and learning is
enabled. This is a simple map from a boolopt bit to a bridge private
flag that is tested before learning.

v2: pass NULL for extack via sysfs

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
 include/uapi/linux/if_bridge.h |  3 +++
 net/bridge/br.c                |  5 +++++
 net/bridge/br_input.c          |  4 +++-
 net/bridge/br_private.h        |  1 +
 net/bridge/br_sysfs_br.c       | 22 ++++++++++++++++++++++
 5 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h
index 6dc02c03bdf8..773e476a8e54 100644
--- a/include/uapi/linux/if_bridge.h
+++ b/include/uapi/linux/if_bridge.h
@@ -294,10 +294,13 @@ struct br_mcast_stats {
 };
 
 /* bridge boolean options
+ * BR_BOOLOPT_NO_LL_LEARN - disable learning from link-local packets
+ *
  * IMPORTANT: if adding a new option do not forget to handle
  *            it in br_boolopt_toggle/get and bridge sysfs
  */
 enum br_boolopt_id {
+	BR_BOOLOPT_NO_LL_LEARN,
 	BR_BOOLOPT_MAX
 };
 
diff --git a/net/bridge/br.c b/net/bridge/br.c
index c527160c1975..b4a51a053586 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -189,6 +189,9 @@ int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id opt, bool on,
 		      struct netlink_ext_ack *extack)
 {
 	switch (opt) {
+	case BR_BOOLOPT_NO_LL_LEARN:
+		br_opt_toggle(br, BROPT_NO_LL_LEARN, on);
+		break;
 	default:
 		/* shouldn't be called with unsupported options */
 		WARN_ON(1);
@@ -201,6 +204,8 @@ int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id opt, bool on,
 int br_boolopt_get(const struct net_bridge *br, enum br_boolopt_id opt)
 {
 	switch (opt) {
+	case BR_BOOLOPT_NO_LL_LEARN:
+		return br_opt_get(br, BROPT_NO_LL_LEARN);
 	default:
 		/* shouldn't be called with unsupported options */
 		WARN_ON(1);
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index 3ddca11f44c2..5ea7e56119c1 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -188,7 +188,9 @@ static void __br_handle_local_finish(struct sk_buff *skb)
 	u16 vid = 0;
 
 	/* check if vlan is allowed, to avoid spoofing */
-	if (p->flags & BR_LEARNING && br_should_learn(p, skb, &vid))
+	if ((p->flags & BR_LEARNING) &&
+	    !br_opt_get(p->br, BROPT_NO_LL_LEARN) &&
+	    br_should_learn(p, skb, &vid))
 		br_fdb_update(p->br, p, eth_hdr(skb)->h_source, vid, false);
 }
 
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 6d4c208fbf08..d29f837cd7a2 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -328,6 +328,7 @@ enum net_bridge_opts {
 	BROPT_NEIGH_SUPPRESS_ENABLED,
 	BROPT_MTU_SET_BY_USER,
 	BROPT_VLAN_STATS_PER_PORT,
+	BROPT_NO_LL_LEARN,
 };
 
 struct net_bridge {
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
index 60182bef6341..6a378a7e16ea 100644
--- a/net/bridge/br_sysfs_br.c
+++ b/net/bridge/br_sysfs_br.c
@@ -328,6 +328,27 @@ static ssize_t flush_store(struct device *d,
 }
 static DEVICE_ATTR_WO(flush);
 
+static ssize_t no_linklocal_learn_show(struct device *d,
+				       struct device_attribute *attr,
+				       char *buf)
+{
+	struct net_bridge *br = to_bridge(d);
+	return sprintf(buf, "%d\n", br_boolopt_get(br, BR_BOOLOPT_NO_LL_LEARN));
+}
+
+static int set_no_linklocal_learn(struct net_bridge *br, unsigned long val)
+{
+	return br_boolopt_toggle(br, BR_BOOLOPT_NO_LL_LEARN, !!val, NULL);
+}
+
+static ssize_t no_linklocal_learn_store(struct device *d,
+					struct device_attribute *attr,
+					const char *buf, size_t len)
+{
+	return store_bridge_parm(d, buf, len, set_no_linklocal_learn);
+}
+static DEVICE_ATTR_RW(no_linklocal_learn);
+
 #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
 static ssize_t multicast_router_show(struct device *d,
 				     struct device_attribute *attr, char *buf)
@@ -841,6 +862,7 @@ static struct attribute *bridge_attrs[] = {
 	&dev_attr_gc_timer.attr,
 	&dev_attr_group_addr.attr,
 	&dev_attr_flush.attr,
+	&dev_attr_no_linklocal_learn.attr,
 #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
 	&dev_attr_multicast_router.attr,
 	&dev_attr_multicast_snooping.attr,
-- 
2.17.2


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

* [PATCH net-next v2 3/3] net: bridge: export supported boolopts
  2018-11-24  2:34 ` [Bridge] " Nikolay Aleksandrov
@ 2018-11-24  2:34   ` Nikolay Aleksandrov
  -1 siblings, 0 replies; 34+ messages in thread
From: Nikolay Aleksandrov @ 2018-11-24  2:34 UTC (permalink / raw)
  To: netdev; +Cc: roopa, andrew, davem, bridge, Nikolay Aleksandrov

Now that we have at least one bool option, we can export all of the
supported bool options via optmask when dumping them.

v2: new patch

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
 net/bridge/br.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bridge/br.c b/net/bridge/br.c
index b4a51a053586..4e7cd993ce94 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -247,7 +247,7 @@ void br_boolopt_multi_get(const struct net_bridge *br,
 		optval |= (br_boolopt_get(br, opt_id) << opt_id);
 
 	bm->optval = optval;
-	bm->optmask = 0;
+	bm->optmask = GENMASK((BR_BOOLOPT_MAX - 1), 0);
 }
 
 /* private bridge options, controlled by the kernel */
-- 
2.17.2

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

* [Bridge] [PATCH net-next v2 3/3] net: bridge: export supported boolopts
@ 2018-11-24  2:34   ` Nikolay Aleksandrov
  0 siblings, 0 replies; 34+ messages in thread
From: Nikolay Aleksandrov @ 2018-11-24  2:34 UTC (permalink / raw)
  To: netdev; +Cc: Nikolay Aleksandrov, andrew, roopa, bridge, davem

Now that we have at least one bool option, we can export all of the
supported bool options via optmask when dumping them.

v2: new patch

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
 net/bridge/br.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bridge/br.c b/net/bridge/br.c
index b4a51a053586..4e7cd993ce94 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -247,7 +247,7 @@ void br_boolopt_multi_get(const struct net_bridge *br,
 		optval |= (br_boolopt_get(br, opt_id) << opt_id);
 
 	bm->optval = optval;
-	bm->optmask = 0;
+	bm->optmask = GENMASK((BR_BOOLOPT_MAX - 1), 0);
 }
 
 /* private bridge options, controlled by the kernel */
-- 
2.17.2


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

* Re: [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options
  2018-11-24  2:34   ` [Bridge] " Nikolay Aleksandrov
@ 2018-11-24 16:10     ` Andrew Lunn
  -1 siblings, 0 replies; 34+ messages in thread
From: Andrew Lunn @ 2018-11-24 16:10 UTC (permalink / raw)
  To: Nikolay Aleksandrov; +Cc: netdev, roopa, bridge, davem

> +int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id opt, bool on,
> +		      struct netlink_ext_ack *extack)
> +{
> +	switch (opt) {
> +	default:
> +		/* shouldn't be called with unsupported options */
> +		WARN_ON(1);
> +		break;

So you return 0 here, meaning the br_debug() lower down will not
happen. Maybe return -EOPNOTSUPP?

> +	}
> +
> +	return 0;
> +}
> +

> +int br_boolopt_multi_toggle(struct net_bridge *br,
> +			    struct br_boolopt_multi *bm,
> +			    struct netlink_ext_ack *extack)
> +{
> +	unsigned long bitmap = bm->optmask;
> +	int err = 0;
> +	int opt_id;
> +
> +	for_each_set_bit(opt_id, &bitmap, BR_BOOLOPT_MAX) {
> +		bool on = !!(bm->optval & BIT(opt_id));
> +
> +		err = br_boolopt_toggle(br, opt_id, on, extack);
> +		if (err) {
> +			br_debug(br, "boolopt multi-toggle error: option: %d current: %d new: %d error: %d\n",
> +				 opt_id, br_boolopt_get(br, opt_id), on, err);
> +			break;
> +		}
> +	}

Does the semantics of extack allow you to return something even when
there is no error? If there are bits > BR_BOOLOPT_MAX you could return
0, but also add a warning in extack that some bits where not supported
by this kernel.

> +void br_boolopt_multi_get(const struct net_bridge *br,
> +			  struct br_boolopt_multi *bm)
> +{
> +	u32 optval = 0;
> +	int opt_id;
> +
> +	for (opt_id = 0; opt_id < BR_BOOLOPT_MAX; opt_id++)
> +		optval |= (br_boolopt_get(br, opt_id) << opt_id);
> +
> +	bm->optval = optval;
> +	bm->optmask = 0;

You liked the idea of setting optmask to indicate which bits this
kernel supports. Did you change your mind?

       Andrew

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

* Re: [Bridge] [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options
@ 2018-11-24 16:10     ` Andrew Lunn
  0 siblings, 0 replies; 34+ messages in thread
From: Andrew Lunn @ 2018-11-24 16:10 UTC (permalink / raw)
  To: Nikolay Aleksandrov; +Cc: netdev, roopa, bridge, davem

> +int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id opt, bool on,
> +		      struct netlink_ext_ack *extack)
> +{
> +	switch (opt) {
> +	default:
> +		/* shouldn't be called with unsupported options */
> +		WARN_ON(1);
> +		break;

So you return 0 here, meaning the br_debug() lower down will not
happen. Maybe return -EOPNOTSUPP?

> +	}
> +
> +	return 0;
> +}
> +

> +int br_boolopt_multi_toggle(struct net_bridge *br,
> +			    struct br_boolopt_multi *bm,
> +			    struct netlink_ext_ack *extack)
> +{
> +	unsigned long bitmap = bm->optmask;
> +	int err = 0;
> +	int opt_id;
> +
> +	for_each_set_bit(opt_id, &bitmap, BR_BOOLOPT_MAX) {
> +		bool on = !!(bm->optval & BIT(opt_id));
> +
> +		err = br_boolopt_toggle(br, opt_id, on, extack);
> +		if (err) {
> +			br_debug(br, "boolopt multi-toggle error: option: %d current: %d new: %d error: %d\n",
> +				 opt_id, br_boolopt_get(br, opt_id), on, err);
> +			break;
> +		}
> +	}

Does the semantics of extack allow you to return something even when
there is no error? If there are bits > BR_BOOLOPT_MAX you could return
0, but also add a warning in extack that some bits where not supported
by this kernel.

> +void br_boolopt_multi_get(const struct net_bridge *br,
> +			  struct br_boolopt_multi *bm)
> +{
> +	u32 optval = 0;
> +	int opt_id;
> +
> +	for (opt_id = 0; opt_id < BR_BOOLOPT_MAX; opt_id++)
> +		optval |= (br_boolopt_get(br, opt_id) << opt_id);
> +
> +	bm->optval = optval;
> +	bm->optmask = 0;

You liked the idea of setting optmask to indicate which bits this
kernel supports. Did you change your mind?

       Andrew

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

* Re: [PATCH net-next v2 3/3] net: bridge: export supported boolopts
  2018-11-24  2:34   ` [Bridge] " Nikolay Aleksandrov
@ 2018-11-24 16:16     ` Andrew Lunn
  -1 siblings, 0 replies; 34+ messages in thread
From: Andrew Lunn @ 2018-11-24 16:16 UTC (permalink / raw)
  To: Nikolay Aleksandrov; +Cc: netdev, roopa, davem, bridge

On Sat, Nov 24, 2018 at 04:34:22AM +0200, Nikolay Aleksandrov wrote:
> Now that we have at least one bool option, we can export all of the
> supported bool options via optmask when dumping them.
> 
Hi Nik

That answers my question then...

I'm assuming this means there is no easy way to generate a bitmask of
0? So you waited until there was at least one bit.

(1 << 2) - 1 = 3
(1 << 1) - 1 = 1
(1 << 0) - 1 = 0

So does 

GENMASK((BR_BOOLOPT_MAX - 1), 0);

really not do the right thing when BR_BOOLOPT_MAX = 1?

       Andrew

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

* Re: [Bridge] [PATCH net-next v2 3/3] net: bridge: export supported boolopts
@ 2018-11-24 16:16     ` Andrew Lunn
  0 siblings, 0 replies; 34+ messages in thread
From: Andrew Lunn @ 2018-11-24 16:16 UTC (permalink / raw)
  To: Nikolay Aleksandrov; +Cc: netdev, roopa, bridge, davem

On Sat, Nov 24, 2018 at 04:34:22AM +0200, Nikolay Aleksandrov wrote:
> Now that we have at least one bool option, we can export all of the
> supported bool options via optmask when dumping them.
> 
Hi Nik

That answers my question then...

I'm assuming this means there is no easy way to generate a bitmask of
0? So you waited until there was at least one bit.

(1 << 2) - 1 = 3
(1 << 1) - 1 = 1
(1 << 0) - 1 = 0

So does 

GENMASK((BR_BOOLOPT_MAX - 1), 0);

really not do the right thing when BR_BOOLOPT_MAX = 1?

       Andrew

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

* Re: [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options
  2018-11-24 16:10     ` [Bridge] " Andrew Lunn
@ 2018-11-24 16:18       ` nikolay
  -1 siblings, 0 replies; 34+ messages in thread
From: nikolay @ 2018-11-24 16:18 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: netdev, roopa, davem, bridge

On 24 November 2018 18:10:41 EET, Andrew Lunn <andrew@lunn.ch> wrote:
>> +int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id opt,
>bool on,
>> +		      struct netlink_ext_ack *extack)
>> +{
>> +	switch (opt) {
>> +	default:
>> +		/* shouldn't be called with unsupported options */
>> +		WARN_ON(1);
>> +		break;
>
>So you return 0 here, meaning the br_debug() lower down will not
>happen. Maybe return -EOPNOTSUPP?
>

No, the idea here is that some option in the future might return an error. 
This function cannot be called with unsupported option thus the warn. 

>> +	}
>> +
>> +	return 0;
>> +}
>> +
>
>> +int br_boolopt_multi_toggle(struct net_bridge *br,
>> +			    struct br_boolopt_multi *bm,
>> +			    struct netlink_ext_ack *extack)
>> +{
>> +	unsigned long bitmap = bm->optmask;
>> +	int err = 0;
>> +	int opt_id;
>> +
>> +	for_each_set_bit(opt_id, &bitmap, BR_BOOLOPT_MAX) {
>> +		bool on = !!(bm->optval & BIT(opt_id));
>> +
>> +		err = br_boolopt_toggle(br, opt_id, on, extack);
>> +		if (err) {
>> +			br_debug(br, "boolopt multi-toggle error: option: %d current: %d
>new: %d error: %d\n",
>> +				 opt_id, br_boolopt_get(br, opt_id), on, err);
>> +			break;
>> +		}
>> +	}
>
>Does the semantics of extack allow you to return something even when
>there is no error? If there are bits > BR_BOOLOPT_MAX you could return
>0, but also add a warning in extack that some bits where not supported
>by this kernel.

If we return 0 there's no reason to check extack. 

>> +void br_boolopt_multi_get(const struct net_bridge *br,
>> +			  struct br_boolopt_multi *bm)
>> +{
>> +	u32 optval = 0;
>> +	int opt_id;
>> +
>> +	for (opt_id = 0; opt_id < BR_BOOLOPT_MAX; opt_id++)
>> +		optval |= (br_boolopt_get(br, opt_id) << opt_id);
>> +
>> +	bm->optval = optval;
>> +	bm->optmask = 0;
>
>You liked the idea of setting optmask to indicate which bits this
>kernel supports. Did you change your mind?
>

Please see patch 03.

>       Andrew


-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

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

* Re: [Bridge] [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options
@ 2018-11-24 16:18       ` nikolay
  0 siblings, 0 replies; 34+ messages in thread
From: nikolay @ 2018-11-24 16:18 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: netdev, roopa, bridge, davem

On 24 November 2018 18:10:41 EET, Andrew Lunn <andrew@lunn.ch> wrote:
>> +int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id opt,
>bool on,
>> +		      struct netlink_ext_ack *extack)
>> +{
>> +	switch (opt) {
>> +	default:
>> +		/* shouldn't be called with unsupported options */
>> +		WARN_ON(1);
>> +		break;
>
>So you return 0 here, meaning the br_debug() lower down will not
>happen. Maybe return -EOPNOTSUPP?
>

No, the idea here is that some option in the future might return an error. 
This function cannot be called with unsupported option thus the warn. 

>> +	}
>> +
>> +	return 0;
>> +}
>> +
>
>> +int br_boolopt_multi_toggle(struct net_bridge *br,
>> +			    struct br_boolopt_multi *bm,
>> +			    struct netlink_ext_ack *extack)
>> +{
>> +	unsigned long bitmap = bm->optmask;
>> +	int err = 0;
>> +	int opt_id;
>> +
>> +	for_each_set_bit(opt_id, &bitmap, BR_BOOLOPT_MAX) {
>> +		bool on = !!(bm->optval & BIT(opt_id));
>> +
>> +		err = br_boolopt_toggle(br, opt_id, on, extack);
>> +		if (err) {
>> +			br_debug(br, "boolopt multi-toggle error: option: %d current: %d
>new: %d error: %d\n",
>> +				 opt_id, br_boolopt_get(br, opt_id), on, err);
>> +			break;
>> +		}
>> +	}
>
>Does the semantics of extack allow you to return something even when
>there is no error? If there are bits > BR_BOOLOPT_MAX you could return
>0, but also add a warning in extack that some bits where not supported
>by this kernel.

If we return 0 there's no reason to check extack. 

>> +void br_boolopt_multi_get(const struct net_bridge *br,
>> +			  struct br_boolopt_multi *bm)
>> +{
>> +	u32 optval = 0;
>> +	int opt_id;
>> +
>> +	for (opt_id = 0; opt_id < BR_BOOLOPT_MAX; opt_id++)
>> +		optval |= (br_boolopt_get(br, opt_id) << opt_id);
>> +
>> +	bm->optval = optval;
>> +	bm->optmask = 0;
>
>You liked the idea of setting optmask to indicate which bits this
>kernel supports. Did you change your mind?
>

Please see patch 03.

>       Andrew


-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

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

* Re: [PATCH net-next v2 3/3] net: bridge: export supported boolopts
  2018-11-24 16:16     ` [Bridge] " Andrew Lunn
@ 2018-11-24 16:20       ` nikolay
  -1 siblings, 0 replies; 34+ messages in thread
From: nikolay @ 2018-11-24 16:20 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: netdev, roopa, davem, bridge

On 24 November 2018 18:16:47 EET, Andrew Lunn <andrew@lunn.ch> wrote:
>On Sat, Nov 24, 2018 at 04:34:22AM +0200, Nikolay Aleksandrov wrote:
>> Now that we have at least one bool option, we can export all of the
>> supported bool options via optmask when dumping them.
>> 
>Hi Nik
>
>That answers my question then...
>
>I'm assuming this means there is no easy way to generate a bitmask of
>0? So you waited until there was at least one bit.
>
>(1 << 2) - 1 = 3
>(1 << 1) - 1 = 1
>(1 << 0) - 1 = 0
>
>So does 
>
>GENMASK((BR_BOOLOPT_MAX - 1), 0);
>
>really not do the right thing when BR_BOOLOPT_MAX = 1?
>

GENMASK(0, 0) = 1
the minus is done before the shift. 
Think of it of setting all bits from 0 to MAX - 1 inclusive. 

>       Andrew


-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

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

* Re: [Bridge] [PATCH net-next v2 3/3] net: bridge: export supported boolopts
@ 2018-11-24 16:20       ` nikolay
  0 siblings, 0 replies; 34+ messages in thread
From: nikolay @ 2018-11-24 16:20 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: netdev, roopa, bridge, davem

On 24 November 2018 18:16:47 EET, Andrew Lunn <andrew@lunn.ch> wrote:
>On Sat, Nov 24, 2018 at 04:34:22AM +0200, Nikolay Aleksandrov wrote:
>> Now that we have at least one bool option, we can export all of the
>> supported bool options via optmask when dumping them.
>> 
>Hi Nik
>
>That answers my question then...
>
>I'm assuming this means there is no easy way to generate a bitmask of
>0? So you waited until there was at least one bit.
>
>(1 << 2) - 1 = 3
>(1 << 1) - 1 = 1
>(1 << 0) - 1 = 0
>
>So does 
>
>GENMASK((BR_BOOLOPT_MAX - 1), 0);
>
>really not do the right thing when BR_BOOLOPT_MAX = 1?
>

GENMASK(0, 0) = 1
the minus is done before the shift. 
Think of it of setting all bits from 0 to MAX - 1 inclusive. 

>       Andrew


-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

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

* Re: [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options
  2018-11-24 16:18       ` [Bridge] " nikolay
@ 2018-11-24 16:25         ` Andrew Lunn
  -1 siblings, 0 replies; 34+ messages in thread
From: Andrew Lunn @ 2018-11-24 16:25 UTC (permalink / raw)
  To: nikolay; +Cc: netdev, roopa, davem, bridge

On Sat, Nov 24, 2018 at 06:18:33PM +0200, nikolay@cumulusnetworks.com wrote:
> On 24 November 2018 18:10:41 EET, Andrew Lunn <andrew@lunn.ch> wrote:
> >> +int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id opt,
> >bool on,
> >> +		      struct netlink_ext_ack *extack)
> >> +{
> >> +	switch (opt) {
> >> +	default:
> >> +		/* shouldn't be called with unsupported options */
> >> +		WARN_ON(1);
> >> +		break;
> >
> >So you return 0 here, meaning the br_debug() lower down will not
> >happen. Maybe return -EOPNOTSUPP?
> >
> 
> No, the idea here is that some option in the future might return an error. 
> This function cannot be called with unsupported option thus the warn. 

O.K, i was trying to make it easier to see which option caused it to
happen.

> >> +	}
> >> +
> >> +	return 0;
> >> +}
> >> +
> >
> >> +int br_boolopt_multi_toggle(struct net_bridge *br,
> >> +			    struct br_boolopt_multi *bm,
> >> +			    struct netlink_ext_ack *extack)
> >> +{
> >> +	unsigned long bitmap = bm->optmask;
> >> +	int err = 0;
> >> +	int opt_id;
> >> +
> >> +	for_each_set_bit(opt_id, &bitmap, BR_BOOLOPT_MAX) {
> >> +		bool on = !!(bm->optval & BIT(opt_id));
> >> +
> >> +		err = br_boolopt_toggle(br, opt_id, on, extack);
> >> +		if (err) {
> >> +			br_debug(br, "boolopt multi-toggle error: option: %d current: %d
> >new: %d error: %d\n",
> >> +				 opt_id, br_boolopt_get(br, opt_id), on, err);
> >> +			break;
> >> +		}
> >> +	}
> >
> >Does the semantics of extack allow you to return something even when
> >there is no error? If there are bits > BR_BOOLOPT_MAX you could return
> >0, but also add a warning in extack that some bits where not supported
> >by this kernel.
> 
> If we return 0 there's no reason to check extack. 

Well, the caller can check to see if extack is present, even on
success. This is extack, not extnack after all...

	 Andrew

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

* Re: [Bridge] [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options
@ 2018-11-24 16:25         ` Andrew Lunn
  0 siblings, 0 replies; 34+ messages in thread
From: Andrew Lunn @ 2018-11-24 16:25 UTC (permalink / raw)
  To: nikolay; +Cc: netdev, roopa, bridge, davem

On Sat, Nov 24, 2018 at 06:18:33PM +0200, nikolay@cumulusnetworks.com wrote:
> On 24 November 2018 18:10:41 EET, Andrew Lunn <andrew@lunn.ch> wrote:
> >> +int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id opt,
> >bool on,
> >> +		      struct netlink_ext_ack *extack)
> >> +{
> >> +	switch (opt) {
> >> +	default:
> >> +		/* shouldn't be called with unsupported options */
> >> +		WARN_ON(1);
> >> +		break;
> >
> >So you return 0 here, meaning the br_debug() lower down will not
> >happen. Maybe return -EOPNOTSUPP?
> >
> 
> No, the idea here is that some option in the future might return an error. 
> This function cannot be called with unsupported option thus the warn. 

O.K, i was trying to make it easier to see which option caused it to
happen.

> >> +	}
> >> +
> >> +	return 0;
> >> +}
> >> +
> >
> >> +int br_boolopt_multi_toggle(struct net_bridge *br,
> >> +			    struct br_boolopt_multi *bm,
> >> +			    struct netlink_ext_ack *extack)
> >> +{
> >> +	unsigned long bitmap = bm->optmask;
> >> +	int err = 0;
> >> +	int opt_id;
> >> +
> >> +	for_each_set_bit(opt_id, &bitmap, BR_BOOLOPT_MAX) {
> >> +		bool on = !!(bm->optval & BIT(opt_id));
> >> +
> >> +		err = br_boolopt_toggle(br, opt_id, on, extack);
> >> +		if (err) {
> >> +			br_debug(br, "boolopt multi-toggle error: option: %d current: %d
> >new: %d error: %d\n",
> >> +				 opt_id, br_boolopt_get(br, opt_id), on, err);
> >> +			break;
> >> +		}
> >> +	}
> >
> >Does the semantics of extack allow you to return something even when
> >there is no error? If there are bits > BR_BOOLOPT_MAX you could return
> >0, but also add a warning in extack that some bits where not supported
> >by this kernel.
> 
> If we return 0 there's no reason to check extack. 

Well, the caller can check to see if extack is present, even on
success. This is extack, not extnack after all...

	 Andrew

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

* Re: [PATCH net-next v2 3/3] net: bridge: export supported boolopts
  2018-11-24  2:34   ` [Bridge] " Nikolay Aleksandrov
@ 2018-11-24 16:26     ` Andrew Lunn
  -1 siblings, 0 replies; 34+ messages in thread
From: Andrew Lunn @ 2018-11-24 16:26 UTC (permalink / raw)
  To: Nikolay Aleksandrov; +Cc: netdev, roopa, davem, bridge

On Sat, Nov 24, 2018 at 04:34:22AM +0200, Nikolay Aleksandrov wrote:
> Now that we have at least one bool option, we can export all of the
> supported bool options via optmask when dumping them.
> 
> v2: new patch
> 
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [Bridge] [PATCH net-next v2 3/3] net: bridge: export supported boolopts
@ 2018-11-24 16:26     ` Andrew Lunn
  0 siblings, 0 replies; 34+ messages in thread
From: Andrew Lunn @ 2018-11-24 16:26 UTC (permalink / raw)
  To: Nikolay Aleksandrov; +Cc: netdev, roopa, bridge, davem

On Sat, Nov 24, 2018 at 04:34:22AM +0200, Nikolay Aleksandrov wrote:
> Now that we have at least one bool option, we can export all of the
> supported bool options via optmask when dumping them.
> 
> v2: new patch
> 
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH net-next v2 2/3] net: bridge: add no_linklocal_learn bool option
  2018-11-24  2:34   ` [Bridge] " Nikolay Aleksandrov
@ 2018-11-24 16:27     ` Andrew Lunn
  -1 siblings, 0 replies; 34+ messages in thread
From: Andrew Lunn @ 2018-11-24 16:27 UTC (permalink / raw)
  To: Nikolay Aleksandrov; +Cc: netdev, roopa, davem, bridge

On Sat, Nov 24, 2018 at 04:34:21AM +0200, Nikolay Aleksandrov wrote:
> Use the new boolopt API to add an option which disables learning from
> link-local packets. The default is kept as before and learning is
> enabled. This is a simple map from a boolopt bit to a bridge private
> flag that is tested before learning.
> 
> v2: pass NULL for extack via sysfs
> 
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [Bridge] [PATCH net-next v2 2/3] net: bridge: add no_linklocal_learn bool option
@ 2018-11-24 16:27     ` Andrew Lunn
  0 siblings, 0 replies; 34+ messages in thread
From: Andrew Lunn @ 2018-11-24 16:27 UTC (permalink / raw)
  To: Nikolay Aleksandrov; +Cc: netdev, roopa, bridge, davem

On Sat, Nov 24, 2018 at 04:34:21AM +0200, Nikolay Aleksandrov wrote:
> Use the new boolopt API to add an option which disables learning from
> link-local packets. The default is kept as before and learning is
> enabled. This is a simple map from a boolopt bit to a bridge private
> flag that is tested before learning.
> 
> v2: pass NULL for extack via sysfs
> 
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options
  2018-11-24 16:25         ` [Bridge] " Andrew Lunn
@ 2018-11-24 16:46           ` nikolay
  -1 siblings, 0 replies; 34+ messages in thread
From: nikolay @ 2018-11-24 16:46 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: netdev, roopa, bridge, davem

On 24 November 2018 18:25:41 EET, Andrew Lunn <andrew@lunn.ch> wrote:
>On Sat, Nov 24, 2018 at 06:18:33PM +0200, nikolay@cumulusnetworks.com
>wrote:
>> On 24 November 2018 18:10:41 EET, Andrew Lunn <andrew@lunn.ch> wrote:
>> >> +int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id
>opt,
>> >bool on,
>> >> +		      struct netlink_ext_ack *extack)
>> >> +{
>> >> +	switch (opt) {
>> >> +	default:
>> >> +		/* shouldn't be called with unsupported options */
>> >> +		WARN_ON(1);
>> >> +		break;
>> >
>> >So you return 0 here, meaning the br_debug() lower down will not
>> >happen. Maybe return -EOPNOTSUPP?
>> >
>> 
>> No, the idea here is that some option in the future might return an
>error. 
>> This function cannot be called with unsupported option thus the warn.
>
>
>O.K, i was trying to make it easier to see which option caused it to
>happen.
>
>> >> +	}
>> >> +
>> >> +	return 0;
>> >> +}
>> >> +
>> >
>> >> +int br_boolopt_multi_toggle(struct net_bridge *br,
>> >> +			    struct br_boolopt_multi *bm,
>> >> +			    struct netlink_ext_ack *extack)
>> >> +{
>> >> +	unsigned long bitmap = bm->optmask;
>> >> +	int err = 0;
>> >> +	int opt_id;
>> >> +
>> >> +	for_each_set_bit(opt_id, &bitmap, BR_BOOLOPT_MAX) {
>> >> +		bool on = !!(bm->optval & BIT(opt_id));
>> >> +
>> >> +		err = br_boolopt_toggle(br, opt_id, on, extack);
>> >> +		if (err) {
>> >> +			br_debug(br, "boolopt multi-toggle error: option: %d current:
>%d
>> >new: %d error: %d\n",
>> >> +				 opt_id, br_boolopt_get(br, opt_id), on, err);
>> >> +			break;
>> >> +		}
>> >> +	}
>> >
>> >Does the semantics of extack allow you to return something even when
>> >there is no error? If there are bits > BR_BOOLOPT_MAX you could
>return
>> >0, but also add a warning in extack that some bits where not
>supported
>> >by this kernel.
>> 
>> If we return 0 there's no reason to check extack. 
>
>Well, the caller can check to see if extack is present, even on
>success. This is extack, not extnack after all...
>

Evenif it's possible to return it without an error (I need to confirm that), the real problem is extack doesn't support
format strings, i. e. we can't say which bit is missing which makes it useless in this case IMO. 

>	 Andrew

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

* Re: [Bridge] [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options
@ 2018-11-24 16:46           ` nikolay
  0 siblings, 0 replies; 34+ messages in thread
From: nikolay @ 2018-11-24 16:46 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: netdev, roopa, bridge, davem

On 24 November 2018 18:25:41 EET, Andrew Lunn <andrew@lunn.ch> wrote:
>On Sat, Nov 24, 2018 at 06:18:33PM +0200, nikolay@cumulusnetworks.com
>wrote:
>> On 24 November 2018 18:10:41 EET, Andrew Lunn <andrew@lunn.ch> wrote:
>> >> +int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id
>opt,
>> >bool on,
>> >> +		      struct netlink_ext_ack *extack)
>> >> +{
>> >> +	switch (opt) {
>> >> +	default:
>> >> +		/* shouldn't be called with unsupported options */
>> >> +		WARN_ON(1);
>> >> +		break;
>> >
>> >So you return 0 here, meaning the br_debug() lower down will not
>> >happen. Maybe return -EOPNOTSUPP?
>> >
>> 
>> No, the idea here is that some option in the future might return an
>error. 
>> This function cannot be called with unsupported option thus the warn.
>
>
>O.K, i was trying to make it easier to see which option caused it to
>happen.
>
>> >> +	}
>> >> +
>> >> +	return 0;
>> >> +}
>> >> +
>> >
>> >> +int br_boolopt_multi_toggle(struct net_bridge *br,
>> >> +			    struct br_boolopt_multi *bm,
>> >> +			    struct netlink_ext_ack *extack)
>> >> +{
>> >> +	unsigned long bitmap = bm->optmask;
>> >> +	int err = 0;
>> >> +	int opt_id;
>> >> +
>> >> +	for_each_set_bit(opt_id, &bitmap, BR_BOOLOPT_MAX) {
>> >> +		bool on = !!(bm->optval & BIT(opt_id));
>> >> +
>> >> +		err = br_boolopt_toggle(br, opt_id, on, extack);
>> >> +		if (err) {
>> >> +			br_debug(br, "boolopt multi-toggle error: option: %d current:
>%d
>> >new: %d error: %d\n",
>> >> +				 opt_id, br_boolopt_get(br, opt_id), on, err);
>> >> +			break;
>> >> +		}
>> >> +	}
>> >
>> >Does the semantics of extack allow you to return something even when
>> >there is no error? If there are bits > BR_BOOLOPT_MAX you could
>return
>> >0, but also add a warning in extack that some bits where not
>supported
>> >by this kernel.
>> 
>> If we return 0 there's no reason to check extack. 
>
>Well, the caller can check to see if extack is present, even on
>success. This is extack, not extnack after all...
>

Evenif it's possible to return it without an error (I need to confirm that), the real problem is extack doesn't support
format strings, i. e. we can't say which bit is missing which makes it useless in this case IMO. 

>	 Andrew


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

* Re: [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options
  2018-11-24 16:46           ` [Bridge] " nikolay
@ 2018-11-25  8:12             ` Nikolay Aleksandrov
  -1 siblings, 0 replies; 34+ messages in thread
From: Nikolay Aleksandrov @ 2018-11-25  8:12 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: netdev, roopa, davem, bridge

On 24/11/2018 18:46, nikolay@cumulusnetworks.com wrote:
> On 24 November 2018 18:25:41 EET, Andrew Lunn <andrew@lunn.ch> wrote:
>> On Sat, Nov 24, 2018 at 06:18:33PM +0200, nikolay@cumulusnetworks.com
>> wrote:
>>> On 24 November 2018 18:10:41 EET, Andrew Lunn <andrew@lunn.ch> wrote:
>>>>> +int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id
>> opt,
>>>> bool on,
>>>>> +		      struct netlink_ext_ack *extack)
>>>>> +{
>>>>> +	switch (opt) {
>>>>> +	default:
>>>>> +		/* shouldn't be called with unsupported options */
>>>>> +		WARN_ON(1);
>>>>> +		break;
>>>>
>>>> So you return 0 here, meaning the br_debug() lower down will not
>>>> happen. Maybe return -EOPNOTSUPP?
>>>>
>>>
>>> No, the idea here is that some option in the future might return an
>> error. 
>>> This function cannot be called with unsupported option thus the warn.
>>
>>
>> O.K, i was trying to make it easier to see which option caused it to
>> happen.
>>
>>>>> +	}
>>>>> +
>>>>> +	return 0;
>>>>> +}
>>>>> +
>>>>
>>>>> +int br_boolopt_multi_toggle(struct net_bridge *br,
>>>>> +			    struct br_boolopt_multi *bm,
>>>>> +			    struct netlink_ext_ack *extack)
>>>>> +{
>>>>> +	unsigned long bitmap = bm->optmask;
>>>>> +	int err = 0;
>>>>> +	int opt_id;
>>>>> +
>>>>> +	for_each_set_bit(opt_id, &bitmap, BR_BOOLOPT_MAX) {
>>>>> +		bool on = !!(bm->optval & BIT(opt_id));
>>>>> +
>>>>> +		err = br_boolopt_toggle(br, opt_id, on, extack);
>>>>> +		if (err) {
>>>>> +			br_debug(br, "boolopt multi-toggle error: option: %d current:
>> %d
>>>> new: %d error: %d\n",
>>>>> +				 opt_id, br_boolopt_get(br, opt_id), on, err);
>>>>> +			break;
>>>>> +		}
>>>>> +	}
>>>>
>>>> Does the semantics of extack allow you to return something even when
>>>> there is no error? If there are bits > BR_BOOLOPT_MAX you could
>> return
>>>> 0, but also add a warning in extack that some bits where not
>> supported
>>>> by this kernel.
>>>
>>> If we return 0 there's no reason to check extack. 
>>
>> Well, the caller can check to see if extack is present, even on
>> success. This is extack, not extnack after all...
>>
> 
> Evenif it's possible to return it without an error (I need to confirm that), the real problem is extack doesn't support
> format strings, i. e. we can't say which bit is missing which makes it useless in this case IMO. 
> 

One more thing I forgot to mention is the case with newer iproute2 and older kernel without
these patches, then the whole boolopt option will be ignored without setting extact which
makes it inconsistent if user-space would rely on that to check if options were set.
I think the best way to go if one wants to check for support is to dump the boolopts
if they're present, then optmask could be used to see what will be set (or was set).
That would be reliable in all cases.


>> 	 Andrew
> 

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

* Re: [Bridge] [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options
@ 2018-11-25  8:12             ` Nikolay Aleksandrov
  0 siblings, 0 replies; 34+ messages in thread
From: Nikolay Aleksandrov @ 2018-11-25  8:12 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: netdev, roopa, bridge, davem

On 24/11/2018 18:46, nikolay@cumulusnetworks.com wrote:
> On 24 November 2018 18:25:41 EET, Andrew Lunn <andrew@lunn.ch> wrote:
>> On Sat, Nov 24, 2018 at 06:18:33PM +0200, nikolay@cumulusnetworks.com
>> wrote:
>>> On 24 November 2018 18:10:41 EET, Andrew Lunn <andrew@lunn.ch> wrote:
>>>>> +int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id
>> opt,
>>>> bool on,
>>>>> +		      struct netlink_ext_ack *extack)
>>>>> +{
>>>>> +	switch (opt) {
>>>>> +	default:
>>>>> +		/* shouldn't be called with unsupported options */
>>>>> +		WARN_ON(1);
>>>>> +		break;
>>>>
>>>> So you return 0 here, meaning the br_debug() lower down will not
>>>> happen. Maybe return -EOPNOTSUPP?
>>>>
>>>
>>> No, the idea here is that some option in the future might return an
>> error. 
>>> This function cannot be called with unsupported option thus the warn.
>>
>>
>> O.K, i was trying to make it easier to see which option caused it to
>> happen.
>>
>>>>> +	}
>>>>> +
>>>>> +	return 0;
>>>>> +}
>>>>> +
>>>>
>>>>> +int br_boolopt_multi_toggle(struct net_bridge *br,
>>>>> +			    struct br_boolopt_multi *bm,
>>>>> +			    struct netlink_ext_ack *extack)
>>>>> +{
>>>>> +	unsigned long bitmap = bm->optmask;
>>>>> +	int err = 0;
>>>>> +	int opt_id;
>>>>> +
>>>>> +	for_each_set_bit(opt_id, &bitmap, BR_BOOLOPT_MAX) {
>>>>> +		bool on = !!(bm->optval & BIT(opt_id));
>>>>> +
>>>>> +		err = br_boolopt_toggle(br, opt_id, on, extack);
>>>>> +		if (err) {
>>>>> +			br_debug(br, "boolopt multi-toggle error: option: %d current:
>> %d
>>>> new: %d error: %d\n",
>>>>> +				 opt_id, br_boolopt_get(br, opt_id), on, err);
>>>>> +			break;
>>>>> +		}
>>>>> +	}
>>>>
>>>> Does the semantics of extack allow you to return something even when
>>>> there is no error? If there are bits > BR_BOOLOPT_MAX you could
>> return
>>>> 0, but also add a warning in extack that some bits where not
>> supported
>>>> by this kernel.
>>>
>>> If we return 0 there's no reason to check extack. 
>>
>> Well, the caller can check to see if extack is present, even on
>> success. This is extack, not extnack after all...
>>
> 
> Evenif it's possible to return it without an error (I need to confirm that), the real problem is extack doesn't support
> format strings, i. e. we can't say which bit is missing which makes it useless in this case IMO. 
> 

One more thing I forgot to mention is the case with newer iproute2 and older kernel without
these patches, then the whole boolopt option will be ignored without setting extact which
makes it inconsistent if user-space would rely on that to check if options were set.
I think the best way to go if one wants to check for support is to dump the boolopts
if they're present, then optmask could be used to see what will be set (or was set).
That would be reliable in all cases.


>> 	 Andrew
> 


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

* Re: [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options
  2018-11-24  2:34   ` [Bridge] " Nikolay Aleksandrov
@ 2018-11-25 15:45     ` Andrew Lunn
  -1 siblings, 0 replies; 34+ messages in thread
From: Andrew Lunn @ 2018-11-25 15:45 UTC (permalink / raw)
  To: Nikolay Aleksandrov; +Cc: netdev, roopa, davem, bridge

On Sat, Nov 24, 2018 at 04:34:20AM +0200, Nikolay Aleksandrov wrote:
> We have been adding many new bridge options, a big number of which are
> boolean but still take up netlink attribute ids and waste space in the skb.
> Recently we discussed learning from link-local packets[1] and decided
> yet another new boolean option will be needed, thus introducing this API
> to save some bridge nl space.
> The API supports changing the value of multiple boolean options at once
> via the br_boolopt_multi struct which has an optmask (which options to
> set, bit per opt) and optval (options' new values). Future boolean
> options will only be added to the br_boolopt_id enum and then will have
> to be handled in br_boolopt_toggle/get. The API will automatically
> add the ability to change and export them via netlink, sysfs can use the
> single boolopt function versions to do the same. The behaviour with
> failing/succeeding is the same as with normal netlink option changing.
> 
> If an option requires mapping to internal kernel flag or needs special
> configuration to be enabled then it should be handled in
> br_boolopt_toggle. It should also be able to retrieve an option's current
> state via br_boolopt_get.
> 
> v2: WARN_ON() on unsupported option as that shouldn't be possible and
>     also will help catch people who add new options without handling
>     them for both set and get. Pass down extack so if an option desires
>     it could set it on error and be more user-friendly.
> 
> [1] https://www.spinics.net/lists/netdev/msg532698.html
> 
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [Bridge] [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options
@ 2018-11-25 15:45     ` Andrew Lunn
  0 siblings, 0 replies; 34+ messages in thread
From: Andrew Lunn @ 2018-11-25 15:45 UTC (permalink / raw)
  To: Nikolay Aleksandrov; +Cc: netdev, roopa, bridge, davem

On Sat, Nov 24, 2018 at 04:34:20AM +0200, Nikolay Aleksandrov wrote:
> We have been adding many new bridge options, a big number of which are
> boolean but still take up netlink attribute ids and waste space in the skb.
> Recently we discussed learning from link-local packets[1] and decided
> yet another new boolean option will be needed, thus introducing this API
> to save some bridge nl space.
> The API supports changing the value of multiple boolean options at once
> via the br_boolopt_multi struct which has an optmask (which options to
> set, bit per opt) and optval (options' new values). Future boolean
> options will only be added to the br_boolopt_id enum and then will have
> to be handled in br_boolopt_toggle/get. The API will automatically
> add the ability to change and export them via netlink, sysfs can use the
> single boolopt function versions to do the same. The behaviour with
> failing/succeeding is the same as with normal netlink option changing.
> 
> If an option requires mapping to internal kernel flag or needs special
> configuration to be enabled then it should be handled in
> br_boolopt_toggle. It should also be able to retrieve an option's current
> state via br_boolopt_get.
> 
> v2: WARN_ON() on unsupported option as that shouldn't be possible and
>     also will help catch people who add new options without handling
>     them for both set and get. Pass down extack so if an option desires
>     it could set it on error and be more user-friendly.
> 
> [1] https://www.spinics.net/lists/netdev/msg532698.html
> 
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options
  2018-11-25  8:12             ` [Bridge] " Nikolay Aleksandrov
@ 2018-11-26 17:39               ` Stephen Hemminger
  -1 siblings, 0 replies; 34+ messages in thread
From: Stephen Hemminger @ 2018-11-26 17:39 UTC (permalink / raw)
  To: Nikolay Aleksandrov; +Cc: Andrew Lunn, netdev, roopa, davem, bridge

On Sun, 25 Nov 2018 10:12:45 +0200
Nikolay Aleksandrov <nikolay@cumulusnetworks.com> wrote:

> On 24/11/2018 18:46, nikolay@cumulusnetworks.com wrote:
> > On 24 November 2018 18:25:41 EET, Andrew Lunn <andrew@lunn.ch> wrote:  
> >> On Sat, Nov 24, 2018 at 06:18:33PM +0200, nikolay@cumulusnetworks.com
> >> wrote:  
> >>> On 24 November 2018 18:10:41 EET, Andrew Lunn <andrew@lunn.ch> wrote:  
> >>>>> +int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id  
> >> opt,  
> >>>> bool on,  
> >>>>> +		      struct netlink_ext_ack *extack)
> >>>>> +{
> >>>>> +	switch (opt) {
> >>>>> +	default:
> >>>>> +		/* shouldn't be called with unsupported options */
> >>>>> +		WARN_ON(1);
> >>>>> +		break;  
> >>>>
> >>>> So you return 0 here, meaning the br_debug() lower down will not
> >>>> happen. Maybe return -EOPNOTSUPP?
> >>>>  
> >>>
> >>> No, the idea here is that some option in the future might return an  
> >> error.   
> >>> This function cannot be called with unsupported option thus the warn.  

> 

Please don't implement some part of the API until it is used (YAGNI).
If do this kind of "someday will come" design the code will end up
littered with dead ends.

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

* Re: [Bridge] [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options
@ 2018-11-26 17:39               ` Stephen Hemminger
  0 siblings, 0 replies; 34+ messages in thread
From: Stephen Hemminger @ 2018-11-26 17:39 UTC (permalink / raw)
  To: Nikolay Aleksandrov; +Cc: Andrew Lunn, roopa, bridge, davem, netdev

On Sun, 25 Nov 2018 10:12:45 +0200
Nikolay Aleksandrov <nikolay@cumulusnetworks.com> wrote:

> On 24/11/2018 18:46, nikolay@cumulusnetworks.com wrote:
> > On 24 November 2018 18:25:41 EET, Andrew Lunn <andrew@lunn.ch> wrote:  
> >> On Sat, Nov 24, 2018 at 06:18:33PM +0200, nikolay@cumulusnetworks.com
> >> wrote:  
> >>> On 24 November 2018 18:10:41 EET, Andrew Lunn <andrew@lunn.ch> wrote:  
> >>>>> +int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id  
> >> opt,  
> >>>> bool on,  
> >>>>> +		      struct netlink_ext_ack *extack)
> >>>>> +{
> >>>>> +	switch (opt) {
> >>>>> +	default:
> >>>>> +		/* shouldn't be called with unsupported options */
> >>>>> +		WARN_ON(1);
> >>>>> +		break;  
> >>>>
> >>>> So you return 0 here, meaning the br_debug() lower down will not
> >>>> happen. Maybe return -EOPNOTSUPP?
> >>>>  
> >>>
> >>> No, the idea here is that some option in the future might return an  
> >> error.   
> >>> This function cannot be called with unsupported option thus the warn.  

> 

Please don't implement some part of the API until it is used (YAGNI).
If do this kind of "someday will come" design the code will end up
littered with dead ends.

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

* Re: [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options
  2018-11-26 17:39               ` [Bridge] " Stephen Hemminger
@ 2018-11-26 17:41                 ` Nikolay Aleksandrov
  -1 siblings, 0 replies; 34+ messages in thread
From: Nikolay Aleksandrov @ 2018-11-26 17:41 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Andrew Lunn, netdev, roopa, davem, bridge

On 26/11/2018 19:39, Stephen Hemminger wrote:
> On Sun, 25 Nov 2018 10:12:45 +0200
> Nikolay Aleksandrov <nikolay@cumulusnetworks.com> wrote:
> 
>> On 24/11/2018 18:46, nikolay@cumulusnetworks.com wrote:
>>> On 24 November 2018 18:25:41 EET, Andrew Lunn <andrew@lunn.ch> wrote:  
>>>> On Sat, Nov 24, 2018 at 06:18:33PM +0200, nikolay@cumulusnetworks.com
>>>> wrote:  
>>>>> On 24 November 2018 18:10:41 EET, Andrew Lunn <andrew@lunn.ch> wrote:  
>>>>>>> +int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id  
>>>> opt,  
>>>>>> bool on,  
>>>>>>> +		      struct netlink_ext_ack *extack)
>>>>>>> +{
>>>>>>> +	switch (opt) {
>>>>>>> +	default:
>>>>>>> +		/* shouldn't be called with unsupported options */
>>>>>>> +		WARN_ON(1);
>>>>>>> +		break;  
>>>>>>
>>>>>> So you return 0 here, meaning the br_debug() lower down will not
>>>>>> happen. Maybe return -EOPNOTSUPP?
>>>>>>  
>>>>>
>>>>> No, the idea here is that some option in the future might return an  
>>>> error.   
>>>>> This function cannot be called with unsupported option thus the warn.  
> 
>>
> 
> Please don't implement some part of the API until it is used (YAGNI).
> If do this kind of "someday will come" design the code will end up
> littered with dead ends.
> 

Is there anything unused ? This is just a precaution to catch future
offenders which forget to handle options where they're expected.
All of the API is used.

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

* Re: [Bridge] [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options
@ 2018-11-26 17:41                 ` Nikolay Aleksandrov
  0 siblings, 0 replies; 34+ messages in thread
From: Nikolay Aleksandrov @ 2018-11-26 17:41 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Andrew Lunn, roopa, bridge, davem, netdev

On 26/11/2018 19:39, Stephen Hemminger wrote:
> On Sun, 25 Nov 2018 10:12:45 +0200
> Nikolay Aleksandrov <nikolay@cumulusnetworks.com> wrote:
> 
>> On 24/11/2018 18:46, nikolay@cumulusnetworks.com wrote:
>>> On 24 November 2018 18:25:41 EET, Andrew Lunn <andrew@lunn.ch> wrote:  
>>>> On Sat, Nov 24, 2018 at 06:18:33PM +0200, nikolay@cumulusnetworks.com
>>>> wrote:  
>>>>> On 24 November 2018 18:10:41 EET, Andrew Lunn <andrew@lunn.ch> wrote:  
>>>>>>> +int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id  
>>>> opt,  
>>>>>> bool on,  
>>>>>>> +		      struct netlink_ext_ack *extack)
>>>>>>> +{
>>>>>>> +	switch (opt) {
>>>>>>> +	default:
>>>>>>> +		/* shouldn't be called with unsupported options */
>>>>>>> +		WARN_ON(1);
>>>>>>> +		break;  
>>>>>>
>>>>>> So you return 0 here, meaning the br_debug() lower down will not
>>>>>> happen. Maybe return -EOPNOTSUPP?
>>>>>>  
>>>>>
>>>>> No, the idea here is that some option in the future might return an  
>>>> error.   
>>>>> This function cannot be called with unsupported option thus the warn.  
> 
>>
> 
> Please don't implement some part of the API until it is used (YAGNI).
> If do this kind of "someday will come" design the code will end up
> littered with dead ends.
> 

Is there anything unused ? This is just a precaution to catch future
offenders which forget to handle options where they're expected.
All of the API is used.


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

* Re: [PATCH net-next v2 0/3] net: bridge: add an option to disabe linklocal learning
  2018-11-24  2:34 ` [Bridge] " Nikolay Aleksandrov
@ 2018-11-27 23:04   ` David Miller
  -1 siblings, 0 replies; 34+ messages in thread
From: David Miller @ 2018-11-27 23:04 UTC (permalink / raw)
  To: nikolay; +Cc: netdev, roopa, andrew, bridge

From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Date: Sat, 24 Nov 2018 04:34:19 +0200

> This set adds a new bridge option which can control learning from
> link-local packets, by default learning is on to be consistent and avoid
> breaking users expectations. If the new no_linklocal_learn option is
> enabled then the bridge will stop learning from link-local packets.
> 
> In order to save space for future boolean options, patch 01 adds a new
> bool option API that uses a bitmask to control boolean options. The
> bridge is by far the largest netlink attr user and we keep adding simple
> boolean options which waste nl attr ids and space. We're not directly
> mapping these to the in-kernel bridge flags because some might require
> more complex configuration changes (e.g. if we were to add the per port
> vlan stats now, it'd require multiple checks before changing value).
> Any new bool option needs to be handled by both br_boolopt_toggle and get
> in order to be able to retrieve its state later. All such options are
> automatically exported via netlink. The behaviour of setting such
> options is consistent with netlink option handling when a missing
> option is being set (silently ignored), e.g. when a newer iproute2 is used
> on older kernel. All supported options are exported via bm's optmask
> when dumping the new attribute.
> 
> v2: address Andrew Lunn's comments, squash a minor change into patch 01,
>     export all supported options via optmask when dumping, add patch 03,
>     pass down extack so options can return meaningful errors, add
>     WARN_ON on unsupported options (should not happen)

Series applied, thanks Nikolay.

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

* Re: [Bridge] [PATCH net-next v2 0/3] net: bridge: add an option to disabe linklocal learning
@ 2018-11-27 23:04   ` David Miller
  0 siblings, 0 replies; 34+ messages in thread
From: David Miller @ 2018-11-27 23:04 UTC (permalink / raw)
  To: nikolay; +Cc: netdev, roopa, bridge, andrew

From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Date: Sat, 24 Nov 2018 04:34:19 +0200

> This set adds a new bridge option which can control learning from
> link-local packets, by default learning is on to be consistent and avoid
> breaking users expectations. If the new no_linklocal_learn option is
> enabled then the bridge will stop learning from link-local packets.
> 
> In order to save space for future boolean options, patch 01 adds a new
> bool option API that uses a bitmask to control boolean options. The
> bridge is by far the largest netlink attr user and we keep adding simple
> boolean options which waste nl attr ids and space. We're not directly
> mapping these to the in-kernel bridge flags because some might require
> more complex configuration changes (e.g. if we were to add the per port
> vlan stats now, it'd require multiple checks before changing value).
> Any new bool option needs to be handled by both br_boolopt_toggle and get
> in order to be able to retrieve its state later. All such options are
> automatically exported via netlink. The behaviour of setting such
> options is consistent with netlink option handling when a missing
> option is being set (silently ignored), e.g. when a newer iproute2 is used
> on older kernel. All supported options are exported via bm's optmask
> when dumping the new attribute.
> 
> v2: address Andrew Lunn's comments, squash a minor change into patch 01,
>     export all supported options via optmask when dumping, add patch 03,
>     pass down extack so options can return meaningful errors, add
>     WARN_ON on unsupported options (should not happen)

Series applied, thanks Nikolay.

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

end of thread, other threads:[~2018-11-28 10:04 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-24  2:34 [PATCH net-next v2 0/3] net: bridge: add an option to disabe linklocal learning Nikolay Aleksandrov
2018-11-24  2:34 ` [Bridge] " Nikolay Aleksandrov
2018-11-24  2:34 ` [PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options Nikolay Aleksandrov
2018-11-24  2:34   ` [Bridge] " Nikolay Aleksandrov
2018-11-24 16:10   ` Andrew Lunn
2018-11-24 16:10     ` [Bridge] " Andrew Lunn
2018-11-24 16:18     ` nikolay
2018-11-24 16:18       ` [Bridge] " nikolay
2018-11-24 16:25       ` Andrew Lunn
2018-11-24 16:25         ` [Bridge] " Andrew Lunn
2018-11-24 16:46         ` nikolay
2018-11-24 16:46           ` [Bridge] " nikolay
2018-11-25  8:12           ` Nikolay Aleksandrov
2018-11-25  8:12             ` [Bridge] " Nikolay Aleksandrov
2018-11-26 17:39             ` Stephen Hemminger
2018-11-26 17:39               ` [Bridge] " Stephen Hemminger
2018-11-26 17:41               ` Nikolay Aleksandrov
2018-11-26 17:41                 ` [Bridge] " Nikolay Aleksandrov
2018-11-25 15:45   ` Andrew Lunn
2018-11-25 15:45     ` [Bridge] " Andrew Lunn
2018-11-24  2:34 ` [PATCH net-next v2 2/3] net: bridge: add no_linklocal_learn bool option Nikolay Aleksandrov
2018-11-24  2:34   ` [Bridge] " Nikolay Aleksandrov
2018-11-24 16:27   ` Andrew Lunn
2018-11-24 16:27     ` [Bridge] " Andrew Lunn
2018-11-24  2:34 ` [PATCH net-next v2 3/3] net: bridge: export supported boolopts Nikolay Aleksandrov
2018-11-24  2:34   ` [Bridge] " Nikolay Aleksandrov
2018-11-24 16:16   ` Andrew Lunn
2018-11-24 16:16     ` [Bridge] " Andrew Lunn
2018-11-24 16:20     ` nikolay
2018-11-24 16:20       ` [Bridge] " nikolay
2018-11-24 16:26   ` Andrew Lunn
2018-11-24 16:26     ` [Bridge] " Andrew Lunn
2018-11-27 23:04 ` [PATCH net-next v2 0/3] net: bridge: add an option to disabe linklocal learning David Miller
2018-11-27 23:04   ` [Bridge] " David Miller

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.