From: "Huang, Joseph" <Joseph.Huang@garmin.com>
To: Nikolay Aleksandrov <nikolay@nvidia.com>,
Roopa Prabhu <roopa@nvidia.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
"bridge@lists.linux-foundation.org"
<bridge@lists.linux-foundation.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] bridge: Fix a deadlock when enabling multicast snooping
Date: Fri, 4 Dec 2020 22:30:22 +0000 [thread overview]
Message-ID: <977913cfd91b4c6d8fb2e25d8762aaee@garmin.com> (raw)
In-Reply-To: <f771d272-3146-2d8c-391d-87d1db8b8e76@nvidia.com>
> > + if (join_snoopers)
> > + br_multicast_join_snoopers(br);
> > + else if (leave_snoopers)
> > + br_multicast_leave_snoopers(br);
>
> If I'm not missing anything this can be just 1 bool like "change_snoopers" or
> something which if set to true will check BROPT_MULTICAST_ENABLED and
> act accordingly, i.e.
> if (change_snoopers) {
> if (br_opt_get(br, BROPT_MULTICAST_ENABLED))
> br_multicast_join_snoopers(br);
> else
> br_multicast_leave_snoopers(br); }
>
> This is not really something critical, just an observation. Up to your
> preference if you decide to leave it with 2 bools. :-)
>
> Cheers,
> Nik
I wasn't sure how expensive the call to br_opt_get is, so I used a bool for each.
I just checked and it seems that br_opt_get is probably just as cheap as a bool,
so I'll change it according to what you suggested here.
Thanks for your comments!!
Thanks,
Joseph
next prev parent reply other threads:[~2020-12-04 22:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-01 21:40 [PATCH] bridge: Fix a deadlock when enabling multicast snooping Joseph Huang
2020-12-03 18:28 ` Jakub Kicinski
2020-12-03 20:46 ` Nikolay Aleksandrov
2020-12-03 21:53 ` Huang, Joseph
2020-12-03 22:42 ` Huang, Joseph
2020-12-03 23:34 ` Nikolay Aleksandrov
2020-12-04 21:39 ` [PATCH v2] " Joseph Huang
2020-12-04 22:11 ` Nikolay Aleksandrov
2020-12-04 22:30 ` Huang, Joseph [this message]
2020-12-04 23:56 ` [PATCH v3] " Joseph Huang
2020-12-05 8:56 ` Nikolay Aleksandrov
2020-12-08 1:20 ` Jakub Kicinski
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=977913cfd91b4c6d8fb2e25d8762aaee@garmin.com \
--to=joseph.huang@garmin.com \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nikolay@nvidia.com \
--cc=roopa@nvidia.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