From: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
nirranjan@chelsio.com, vishal@chelsio.com, dt@chelsio.com
Subject: Re: [PATCH net-next 1/3] cxgb4: add mirror action to TC-MATCHALL offload
Date: Sat, 27 Jun 2020 12:18:56 +0530 [thread overview]
Message-ID: <20200627064855.GB24993@chelsio.com> (raw)
In-Reply-To: <20200626211844.40ed466c@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
On Friday, June 06/26/20, 2020 at 21:18:44 -0700, Jakub Kicinski wrote:
> On Thu, 25 Jun 2020 17:28:41 +0530 Rahul Lakkireddy wrote:
> > + if (refcount_read(&pi->vi_mirror_refcnt) > 1) {
> > + refcount_dec(&pi->vi_mirror_refcnt);
> > + return;
> > + }
>
> FWIW this looks very dodgy. If you know nothing changes the count
> between the read and the dec here, you probably don't need atomic
> refcounts at all..
Currently, all the callers accessing this refcount and its related
data is having the RTNL lock held by the stack. Perhaps this is a
false sense of security, especially if the stack API may change in
the future.
I'll add a proper lock to protect this data in v2 to be on the safer
side.
Thanks,
Rahul
next prev parent reply other threads:[~2020-06-27 7:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-25 11:58 [PATCH net-next 0/3] cxgb4: add mirror action support for TC-MATCHALL Rahul Lakkireddy
2020-06-25 11:58 ` [PATCH net-next 1/3] cxgb4: add mirror action to TC-MATCHALL offload Rahul Lakkireddy
2020-06-27 4:18 ` Jakub Kicinski
2020-06-27 6:48 ` Rahul Lakkireddy [this message]
2020-06-25 11:58 ` [PATCH net-next 2/3] cxgb4: add support for mirror Rxqs Rahul Lakkireddy
2020-06-25 11:58 ` [PATCH net-next 3/3] cxgb4: add main VI to mirror VI config replication Rahul Lakkireddy
2020-06-25 22:55 ` [PATCH net-next 0/3] cxgb4: add mirror action support for TC-MATCHALL Jakub Kicinski
2020-06-26 10:06 ` Rahul Lakkireddy
2020-06-26 16:55 ` Jakub Kicinski
2020-06-26 20:50 ` Rahul Lakkireddy
2020-06-27 4:17 ` Jakub Kicinski
2020-06-27 6:44 ` Rahul Lakkireddy
2020-06-29 22:53 ` 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=20200627064855.GB24993@chelsio.com \
--to=rahul.lakkireddy@chelsio.com \
--cc=davem@davemloft.net \
--cc=dt@chelsio.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nirranjan@chelsio.com \
--cc=vishal@chelsio.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).