From: Joachim Wiberg <troglobit@gmail.com>
To: Nikolay Aleksandrov <razor@blackwall.org>,
Roopa Prabhu <roopa@nvidia.com>
Cc: netdev@vger.kernel.org, bridge@lists.linux-foundation.org,
Vladimir Oltean <vladimir.oltean@nxp.com>,
Jakub Kicinski <kuba@kernel.org>,
"David S . Miller" <davem@davemloft.net>,
Tobias Waldekranz <tobias@waldekranz.com>
Subject: Re: [Bridge] [PATCH RFC net-next 04/13] net: bridge: netlink support for controlling BUM flooding to bridge
Date: Wed, 13 Apr 2022 12:04:09 +0200 [thread overview]
Message-ID: <87h76x9u5i.fsf@gmail.com> (raw)
In-Reply-To: <37bb2846-6371-1e49-9a7e-7c27a7a8b9c4@blackwall.org>
On Tue, Apr 12, 2022 at 21:24, Nikolay Aleksandrov <razor@blackwall.org> wrote:
> On 11/04/2022 16:38, Joachim Wiberg wrote:
>> The messy part is in br_setport(), which re-indents a large block of
>> code for the port settings. To reduce code duplication a few new
>> variables have been added; new_flags and dev. The latter is used for
>> the recently renamed br_switchdev_set_dev_flag(), which can now be used
>> by underlying switching fabric drivers as another source of information
>> when controlling flooding of unknown BUM traffic to the CPU port.
> Absolutely not. This is just wrong on a few levels and way too hacky.
> Please separate the bridge handling altogether and make it clean.
> No need to integrate it with the port handling,
OK, I'll have a go at it.
> also I think you've missed a few things about bool options, more
> below...
>
> For boolopts examples you can check BR_BOOLOPT_NO_LL_LEARN,
> BR_BOOLOPT_MCAST_VLAN_SNOOPING and BR_BOOLOPT_MST_ENABLE.
Ah yes, will read up on those, thanks!
>> + if (nla_put_u8(skb, IFLA_BRPORT_UNICAST_FLOOD,
>> + br_opt_get(br, BROPT_UNICAST_FLOOD)) ||
>> + nla_put_u8(skb, IFLA_BRPORT_MCAST_FLOOD,
>> + br_opt_get(br, BROPT_MCAST_FLOOD)) ||
>> + nla_put_u8(skb, IFLA_BRPORT_BCAST_FLOOD,
>> + br_opt_get(br, BROPT_BCAST_FLOOD)))
>> + return -EMSGSIZE;
> No. Bool opts are already exposed through IFLA_BR_MULTI_BOOLOPT.
Aha, there it is, awesome!
>> +static void br_set_bropt(struct net_bridge *br, struct nlattr *tb[],
>> + int attrtype, enum net_bridge_opts opt)
>> +{
>> + if (!tb[attrtype])
>> + return;
>> +
>> + br_opt_toggle(br, opt, !!nla_get_u8(tb[attrtype]));
>> +}
> These must be controlled via the boolopt api and attributes, not through
> additional nl attributes.
Understood.
>> @@ -1058,9 +1144,9 @@ int br_setlink(struct net_device *dev, struct nlmsghdr *nlh, u16 flags,
>> return err;
>>
>> spin_lock_bh(&br->lock);
>> - err = br_setport(p, tb, extack);
>> + err = br_setport(br, p, tb, extack);
> setport is for *port* only...
A-firm.
Thank you for the honest review. Netlink is still much of a mystery in
many ways to me.
Best regards
/Joachim
WARNING: multiple messages have this Message-ID (diff)
From: Joachim Wiberg <troglobit@gmail.com>
To: Nikolay Aleksandrov <razor@blackwall.org>,
Roopa Prabhu <roopa@nvidia.com>
Cc: netdev@vger.kernel.org, bridge@lists.linux-foundation.org,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Tobias Waldekranz <tobias@waldekranz.com>,
Vladimir Oltean <vladimir.oltean@nxp.com>
Subject: Re: [PATCH RFC net-next 04/13] net: bridge: netlink support for controlling BUM flooding to bridge
Date: Wed, 13 Apr 2022 12:04:09 +0200 [thread overview]
Message-ID: <87h76x9u5i.fsf@gmail.com> (raw)
In-Reply-To: <37bb2846-6371-1e49-9a7e-7c27a7a8b9c4@blackwall.org>
On Tue, Apr 12, 2022 at 21:24, Nikolay Aleksandrov <razor@blackwall.org> wrote:
> On 11/04/2022 16:38, Joachim Wiberg wrote:
>> The messy part is in br_setport(), which re-indents a large block of
>> code for the port settings. To reduce code duplication a few new
>> variables have been added; new_flags and dev. The latter is used for
>> the recently renamed br_switchdev_set_dev_flag(), which can now be used
>> by underlying switching fabric drivers as another source of information
>> when controlling flooding of unknown BUM traffic to the CPU port.
> Absolutely not. This is just wrong on a few levels and way too hacky.
> Please separate the bridge handling altogether and make it clean.
> No need to integrate it with the port handling,
OK, I'll have a go at it.
> also I think you've missed a few things about bool options, more
> below...
>
> For boolopts examples you can check BR_BOOLOPT_NO_LL_LEARN,
> BR_BOOLOPT_MCAST_VLAN_SNOOPING and BR_BOOLOPT_MST_ENABLE.
Ah yes, will read up on those, thanks!
>> + if (nla_put_u8(skb, IFLA_BRPORT_UNICAST_FLOOD,
>> + br_opt_get(br, BROPT_UNICAST_FLOOD)) ||
>> + nla_put_u8(skb, IFLA_BRPORT_MCAST_FLOOD,
>> + br_opt_get(br, BROPT_MCAST_FLOOD)) ||
>> + nla_put_u8(skb, IFLA_BRPORT_BCAST_FLOOD,
>> + br_opt_get(br, BROPT_BCAST_FLOOD)))
>> + return -EMSGSIZE;
> No. Bool opts are already exposed through IFLA_BR_MULTI_BOOLOPT.
Aha, there it is, awesome!
>> +static void br_set_bropt(struct net_bridge *br, struct nlattr *tb[],
>> + int attrtype, enum net_bridge_opts opt)
>> +{
>> + if (!tb[attrtype])
>> + return;
>> +
>> + br_opt_toggle(br, opt, !!nla_get_u8(tb[attrtype]));
>> +}
> These must be controlled via the boolopt api and attributes, not through
> additional nl attributes.
Understood.
>> @@ -1058,9 +1144,9 @@ int br_setlink(struct net_device *dev, struct nlmsghdr *nlh, u16 flags,
>> return err;
>>
>> spin_lock_bh(&br->lock);
>> - err = br_setport(p, tb, extack);
>> + err = br_setport(br, p, tb, extack);
> setport is for *port* only...
A-firm.
Thank you for the honest review. Netlink is still much of a mystery in
many ways to me.
Best regards
/Joachim
next prev parent reply other threads:[~2022-04-13 10:04 UTC|newest]
Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-11 13:38 [Bridge] [PATCH RFC net-next 00/13] net: bridge: forwarding of unknown IPv4/IPv6/MAC BUM traffic Joachim Wiberg
2022-04-11 13:38 ` Joachim Wiberg
2022-04-11 13:38 ` [Bridge] [PATCH RFC net-next 01/13] net: bridge: add control of bum flooding to bridge itself Joachim Wiberg
2022-04-11 13:38 ` Joachim Wiberg
2022-04-12 18:27 ` [Bridge] " Nikolay Aleksandrov
2022-04-12 18:27 ` Nikolay Aleksandrov
2022-04-12 20:29 ` [Bridge] " Nikolay Aleksandrov
2022-04-12 20:29 ` Nikolay Aleksandrov
2022-04-13 9:51 ` [Bridge] " Joachim Wiberg
2022-04-13 9:51 ` Joachim Wiberg
2022-04-13 9:58 ` [Bridge] " Nikolay Aleksandrov
2022-04-13 9:58 ` Nikolay Aleksandrov
2022-04-13 10:09 ` [Bridge] " Joachim Wiberg
2022-04-13 10:09 ` Joachim Wiberg
2022-04-11 13:38 ` [Bridge] [PATCH RFC net-next 02/13] net: bridge: rename br_switchdev_set_port_flag() to .._dev_flag() Joachim Wiberg
2022-04-11 13:38 ` Joachim Wiberg
2022-04-11 13:38 ` [Bridge] [PATCH RFC net-next 03/13] net: bridge: minor refactor of br_setlink() for readability Joachim Wiberg
2022-04-11 13:38 ` Joachim Wiberg
2022-04-12 18:36 ` [Bridge] " Nikolay Aleksandrov
2022-04-12 18:36 ` Nikolay Aleksandrov
2022-04-13 9:22 ` [Bridge] " Joachim Wiberg
2022-04-13 9:22 ` Joachim Wiberg
2022-04-11 13:38 ` [Bridge] [PATCH RFC net-next 04/13] net: bridge: netlink support for controlling BUM flooding to bridge Joachim Wiberg
2022-04-11 13:38 ` Joachim Wiberg
2022-04-12 18:24 ` [Bridge] " Nikolay Aleksandrov
2022-04-12 18:24 ` Nikolay Aleksandrov
2022-04-13 10:04 ` Joachim Wiberg [this message]
2022-04-13 10:04 ` Joachim Wiberg
2022-04-11 13:38 ` [Bridge] [PATCH RFC net-next 05/13] selftests: forwarding: add TCPDUMP_EXTRA_FLAGS to lib.sh Joachim Wiberg
2022-04-11 13:38 ` Joachim Wiberg
2022-04-11 17:20 ` [Bridge] " Vladimir Oltean
2022-04-11 17:20 ` Vladimir Oltean
2022-04-12 7:39 ` [Bridge] " Joachim Wiberg
2022-04-12 7:39 ` Joachim Wiberg
2022-04-11 13:38 ` [Bridge] [PATCH RFC net-next 06/13] selftests: forwarding: multiple instances in tcpdump helper Joachim Wiberg
2022-04-11 13:38 ` Joachim Wiberg
2022-04-11 17:26 ` [Bridge] " Vladimir Oltean
2022-04-11 17:26 ` Vladimir Oltean
2022-04-11 13:38 ` [Bridge] [PATCH RFC net-next 07/13] selftests: forwarding: new test, verify bridge flood flags Joachim Wiberg
2022-04-11 13:38 ` Joachim Wiberg
2022-04-11 20:21 ` [Bridge] " Vladimir Oltean
2022-04-11 20:21 ` Vladimir Oltean
2022-04-12 7:55 ` [Bridge] " Joachim Wiberg
2022-04-12 7:55 ` Joachim Wiberg
2022-04-12 13:40 ` [Bridge] " Vladimir Oltean
2022-04-12 13:40 ` Vladimir Oltean
2022-04-11 13:38 ` [Bridge] [PATCH RFC net-next 08/13] net: bridge: avoid classifying unknown multicast as mrouters_only Joachim Wiberg
2022-04-11 13:38 ` Joachim Wiberg
2022-04-12 13:59 ` [Bridge] " Nikolay Aleksandrov
2022-04-12 13:59 ` Nikolay Aleksandrov
2022-04-12 17:27 ` [Bridge] " Joachim Wiberg
2022-04-12 17:27 ` Joachim Wiberg
2022-04-12 17:37 ` [Bridge] " Nikolay Aleksandrov
2022-04-12 17:37 ` Nikolay Aleksandrov
2022-04-13 8:51 ` [Bridge] " Joachim Wiberg
2022-04-13 8:51 ` Joachim Wiberg
2022-04-13 8:55 ` [Bridge] " Nikolay Aleksandrov
2022-04-13 8:55 ` Nikolay Aleksandrov
2022-04-13 9:00 ` [Bridge] " Nikolay Aleksandrov
2022-04-13 9:00 ` Nikolay Aleksandrov
2022-04-13 10:12 ` [Bridge] " Joachim Wiberg
2022-04-13 10:12 ` Joachim Wiberg
2022-04-11 13:38 ` [Bridge] [PATCH RFC net-next 09/13] selftests: forwarding: rename test groups for next bridge mdb tests Joachim Wiberg
2022-04-11 13:38 ` Joachim Wiberg
2022-04-11 20:23 ` [Bridge] " Vladimir Oltean
2022-04-11 20:23 ` Vladimir Oltean
2022-04-12 7:57 ` [Bridge] " Joachim Wiberg
2022-04-12 7:57 ` Joachim Wiberg
2022-04-11 13:38 ` [Bridge] [PATCH RFC net-next 10/13] selftests: forwarding: verify flooding of unknown multicast Joachim Wiberg
2022-04-11 13:38 ` Joachim Wiberg
2022-04-11 13:38 ` [Bridge] [PATCH RFC net-next 11/13] selftests: forwarding: verify strict mdb fwd of known multicast Joachim Wiberg
2022-04-11 13:38 ` Joachim Wiberg
2022-04-11 13:38 ` [Bridge] [PATCH RFC net-next 12/13] selftests: forwarding: verify strict filtering doesn't leak Joachim Wiberg
2022-04-11 13:38 ` Joachim Wiberg
2022-04-11 13:38 ` [Bridge] [PATCH RFC net-next 13/13] selftests: forwarding: verify flood of known mc on mcast_router port Joachim Wiberg
2022-04-11 13:38 ` Joachim Wiberg
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=87h76x9u5i.fsf@gmail.com \
--to=troglobit@gmail.com \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=razor@blackwall.org \
--cc=roopa@nvidia.com \
--cc=tobias@waldekranz.com \
--cc=vladimir.oltean@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.