From: Andrew Lunn <andrew@lunn.ch>
To: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Cc: netdev@vger.kernel.org, roopa@cumulusnetworks.com,
davem@davemloft.net, bridge@lists.linux-foundation.org
Subject: Re: [PATCH net-next 2/2] net: bridge: add no_linklocal_learn bool option
Date: Thu, 22 Nov 2018 17:04:35 +0100 [thread overview]
Message-ID: <20181122160435.GI15403@lunn.ch> (raw)
In-Reply-To: <20181122042925.8878-3-nikolay@cumulusnetworks.com>
> int br_boolopt_get(const struct net_bridge *br, enum br_boolopt_id opt)
> {
> - int optval = 0;
> -
> switch (opt) {
> + case BR_BOOLOPT_NO_LL_LEARN:
> + return br_opt_get(br, BROPT_NO_LL_LEARN);
> default:
> break;
> }
>
> - return optval;
> + return 0;
> }
It seems like 1/2 of that change belongs in the previous patch.
> --- 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);
> +}
> +
> +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);
I thought we where trying to move away from sysfs? Do we need to add
new options here? It seems like forcing people to use iproute2 for
newer options is a good way to get people to convert to iproute2.
Andrew
next prev parent reply other threads:[~2018-11-23 2:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-22 4:29 [PATCH net-next 0/2] net: bridge: add an option to disabe linklocal learning Nikolay Aleksandrov
2018-11-22 4:29 ` [PATCH net-next 1/2] net: bridge: add support for user-controlled bool options Nikolay Aleksandrov
2018-11-22 15:35 ` Andrew Lunn
2018-11-22 16:01 ` Nikolay Aleksandrov
2018-11-22 19:37 ` Stephen Hemminger
2018-11-22 15:49 ` Andrew Lunn
2018-11-22 16:13 ` Nikolay Aleksandrov
2018-11-23 1:55 ` Nikolay Aleksandrov
2018-11-22 15:52 ` Andrew Lunn
2018-11-22 16:07 ` Nikolay Aleksandrov
2018-11-22 4:29 ` [PATCH net-next 2/2] net: bridge: add no_linklocal_learn bool option Nikolay Aleksandrov
2018-11-22 16:04 ` Andrew Lunn [this message]
2018-11-22 16:06 ` Nikolay Aleksandrov
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=20181122160435.GI15403@lunn.ch \
--to=andrew@lunn.ch \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=nikolay@cumulusnetworks.com \
--cc=roopa@cumulusnetworks.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).