From: Leon Romanovsky <leon@kernel.org>
To: "Nikolova, Tatyana E" <tatyana.e.nikolova@intel.com>
Cc: "Czurylo, Krzysztof" <krzysztof.czurylo@intel.com>,
"jgg@nvidia.com" <jgg@nvidia.com>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>
Subject: Re: [for-next 02/12] RDMA/irdma: Fix data race on cqp_request->request_done
Date: Wed, 18 Mar 2026 12:19:50 +0200 [thread overview]
Message-ID: <20260318101950.GH61385@unreal> (raw)
In-Reply-To: <DS7PR11MB7740083B561AB5756A48DB6FCB41A@DS7PR11MB7740.namprd11.prod.outlook.com>
On Tue, Mar 17, 2026 at 07:27:47PM +0000, Nikolova, Tatyana E wrote:
>
>
> > -----Original Message-----
> > From: Leon Romanovsky <leon@kernel.org>
> > Sent: Tuesday, March 17, 2026 8:23 AM
> > To: Czurylo, Krzysztof <krzysztof.czurylo@intel.com>
> > Cc: jgg@nvidia.com; linux-rdma@vger.kernel.org; Nikolova, Tatyana E
> > <tatyana.e.nikolova@intel.com>
> > Subject: Re: [for-next 02/12] RDMA/irdma: Fix data race on cqp_request-
> > >request_done
> >
> > On Tue, Mar 17, 2026 at 12:14:21PM +0000, Czurylo, Krzysztof wrote:
> > >
> > >
> > > > -----Original Message-----
> > > > From: Leon Romanovsky <leon@kernel.org>
> > > > Sent: 17 March, 2026 12:13
> > > > To: Nikolova, Tatyana E <tatyana.e.nikolova@intel.com>
> > > > Cc: jgg@nvidia.com; linux-rdma@vger.kernel.org; Czurylo, Krzysztof
> > > > <krzysztof.czurylo@intel.com>
> > > > Subject: Re: [for-next 02/12] RDMA/irdma: Fix data race on cqp_request-
> > > > >request_done
> > > >
> > > > On Mon, Mar 16, 2026 at 01:39:39PM -0500, Tatyana Nikolova wrote:
> > > > > From: Krzysztof Czurylo <krzysztof.czurylo@intel.com>
> > > > >
> > > > > Changes type of request_done flag from bool to atomic_t to fix
> > > > > data race in irdma_complete_cqp_request / irdma_wait_event
> > > > > reported by KCSAN:
> > > >
> > > > Again, this fix is wrong too.
> > >
> > > Could you please elaborate on what is wrong with this fix?
> > > And/or suggest how to fix it properly?
> > >
> > > Please note 'request_done' is _not_ a bitfield and we only do simple
> > > load/store operations on it. There is no RMW.
> > > Despite this, KCSAN still reports a data race on it.
> > >
> > > Honestly, the original idea was just to change the type from
> > > 'bool' to 'u8'. This is enough to silence KCSAN, but it is
> > > not clear why. Perhaps it indicates a bug in KCSAN?
> >
> > Yes, both u8 and atomic_t behave the same, they can't be interrupted
> > during read/write. This is why KCSAN doesn't warn you.
> >
> > > I mean, maybe the report below is a false positive?
> >
> > Sounds like that.
>
> Leon,
>
> Are you okay taking the rest of the patches in the series (they apply without the two KCSAN related patches) or you prefer that I resubmit the series?
Sure, let's me to pick them now.
>
> For this specific patch, are you okay with dropping all atomic changes, but making request_done u8 (currently bool) to silence the KCSAN warning?
In general, I don't like changing code just to silence a tool, but in this
case it is justified. Switching to u8 not only quiets the warning, it also
reduces the size of struct irdma_cqp_request, just run pahole on it.
Thanks
next prev parent reply other threads:[~2026-03-18 10:19 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-16 18:39 [for-next 00/12] RDMA/irdma: A few fixes for irdma Tatyana Nikolova
2026-03-16 18:39 ` [for-next 01/12] RDMA/irdma: Initialize free_qp completion before using it Tatyana Nikolova
2026-03-16 18:39 ` [for-next 02/12] RDMA/irdma: Fix data race on cqp_request->request_done Tatyana Nikolova
2026-03-17 11:12 ` Leon Romanovsky
2026-03-17 12:14 ` Czurylo, Krzysztof
2026-03-17 13:22 ` Leon Romanovsky
2026-03-17 19:27 ` Nikolova, Tatyana E
2026-03-18 10:19 ` Leon Romanovsky [this message]
2026-03-16 18:39 ` [for-next 03/12] RDMA/irdma: Change ah_valid type to atomic Tatyana Nikolova
2026-03-17 11:11 ` Leon Romanovsky
2026-03-16 18:39 ` [for-next 04/12] RDMA/irdma: Update ibqp state to error if QP is already in error state Tatyana Nikolova
2026-03-16 18:39 ` [for-next 05/12] RDMA/irdma: Remove a NOP wait_event() in irdma_modify_qp_roce() Tatyana Nikolova
2026-03-16 18:39 ` [for-next 06/12] RDMA/irdma: Clean up unnecessary dereference of event->cm_node Tatyana Nikolova
2026-03-16 18:39 ` [for-next 07/12] RDMA/irdma: Remove reset check from irdma_modify_qp_to_err() Tatyana Nikolova
2026-03-16 18:39 ` [for-next 08/12] RDMA/irdma: Fix deadlock during netdev reset with active connections Tatyana Nikolova
2026-03-16 18:39 ` [for-next 09/12] RDMA/irdma: Return EINVAL for invalid arp index error Tatyana Nikolova
2026-03-16 18:39 ` [for-next 10/12] RDMA/irdma: Harden depth calculation functions Tatyana Nikolova
2026-03-16 18:39 ` [for-next 11/12] RDMA/irdma: Provide scratch buffers to firmware for internal use Tatyana Nikolova
2026-03-16 18:39 ` [for-next 12/12] RDMA/irdma: Add support for GEN4 hardware Tatyana Nikolova
2026-03-18 10:24 ` (subset) [for-next 00/12] RDMA/irdma: A few fixes for irdma Leon Romanovsky
2026-03-18 10:25 ` Leon Romanovsky
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=20260318101950.GH61385@unreal \
--to=leon@kernel.org \
--cc=jgg@nvidia.com \
--cc=krzysztof.czurylo@intel.com \
--cc=linux-rdma@vger.kernel.org \
--cc=tatyana.e.nikolova@intel.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.