public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli•us>
To: "Keller, Jacob E" <jacob.e.keller@intel•com>
Cc: "netdev@vger•kernel.org" <netdev@vger•kernel.org>,
	"davem@davemloft•net" <davem@davemloft•net>,
	"kuba@kernel•org" <kuba@kernel•org>,
	"idosch@nvidia•com" <idosch@nvidia•com>,
	"petrm@nvidia•com" <petrm@nvidia•com>,
	"pabeni@redhat•com" <pabeni@redhat•com>,
	"edumazet@google•com" <edumazet@google•com>,
	"mlxsw@nvidia•com" <mlxsw@nvidia•com>,
	"saeedm@nvidia•com" <saeedm@nvidia•com>,
	"snelson@pensando•io" <snelson@pensando•io>
Subject: Re: [patch net-next v3 01/11] net: devlink: make sure that devlink_try_get() works with valid pointer during xarray iteration
Date: Fri, 22 Jul 2022 08:15:55 +0200	[thread overview]
Message-ID: <YtpAm245yK9pfQ+d@nanopsycho> (raw)
In-Reply-To: <SA2PR11MB5100CD9D0CBCDB2D0F76271CD6919@SA2PR11MB5100.namprd11.prod.outlook.com>

Thu, Jul 21, 2022 at 08:55:04PM CEST, jacob.e.keller@intel•com wrote:
>
>
>> -----Original Message-----
>> From: Jiri Pirko <jiri@resnulli•us>
>> Sent: Wednesday, July 20, 2022 10:45 PM
>> To: Keller, Jacob E <jacob.e.keller@intel•com>
>> Cc: netdev@vger•kernel.org; davem@davemloft•net; kuba@kernel•org;
>> idosch@nvidia•com; petrm@nvidia•com; pabeni@redhat•com;
>> edumazet@google•com; mlxsw@nvidia•com; saeedm@nvidia•com;
>> snelson@pensando•io
>> Subject: Re: [patch net-next v3 01/11] net: devlink: make sure that
>> devlink_try_get() works with valid pointer during xarray iteration
>> 
>> >Is it safe to rcu_read_unlock here while we're still in the middle of the array
>> processing? What happens if something else updates the xarray? is the
>> for_each_marked safe?
>> 
>> Sure, you don't need to hold rcu_read_lock during call to xa_for_each_marked.
>> The consistency of xarray is itself guaranteed. The only reason to take
>> rcu_read_lock outside is that the devlink pointer which is
>> rcu_dereference_check()'ed inside xa_for_each_marked() is still valid
>> once we devlink_try_get() it.
>> 
>
>Excellent, ok. Basically we need the RCU for protecting just the pointer until we get a reference to it separately.

Yep.


>
>Thanks!
>
>In that case:
>
>Reviewed-by: Jacob Keller <jacob.e.keller@intel•com>

Thanks. I will send v4 soon wrapping this up into helper as Jakub
requested.


  reply	other threads:[~2022-07-22  6:16 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-20 15:12 [patch net-next v3 00/11] mlxsw: Implement dev info and dev flash for line cards Jiri Pirko
2022-07-20 15:12 ` [patch net-next v3 01/11] net: devlink: make sure that devlink_try_get() works with valid pointer during xarray iteration Jiri Pirko
2022-07-20 22:25   ` Keller, Jacob E
2022-07-21  5:45     ` Jiri Pirko
2022-07-21 18:55       ` Keller, Jacob E
2022-07-22  6:15         ` Jiri Pirko [this message]
2022-07-21  0:49   ` Jakub Kicinski
2022-07-21  5:51     ` Jiri Pirko
2022-07-21  6:22       ` Jakub Kicinski
2022-07-21 12:04         ` Jiri Pirko
2022-07-22  6:15     ` Jiri Pirko
2022-07-22 15:50     ` Jiri Pirko
2022-07-22 18:23       ` Jakub Kicinski
2022-07-23 15:41         ` Jiri Pirko
2022-07-25  8:17           ` Jiri Pirko
2022-07-20 15:12 ` [patch net-next v3 02/11] net: devlink: introduce nested devlink entity for line card Jiri Pirko
2022-07-20 15:12 ` [patch net-next v3 03/11] mlxsw: core_linecards: Introduce per line card auxiliary device Jiri Pirko
2022-07-21  8:04   ` Ido Schimmel
2022-07-20 15:12 ` [patch net-next v3 04/11] mlxsw: core_linecards: Expose HW revision and INI version Jiri Pirko
2022-07-21  8:05   ` Ido Schimmel
2022-07-20 15:12 ` [patch net-next v3 05/11] mlxsw: reg: Extend MDDQ by device_info Jiri Pirko
2022-07-20 15:12 ` [patch net-next v3 06/11] mlxsw: core_linecards: Probe provisioned line cards for devices and expose FW version Jiri Pirko
2022-07-21  8:11   ` Ido Schimmel
2022-07-21 16:01     ` Jiri Pirko
2022-07-20 15:12 ` [patch net-next v3 07/11] mlxsw: reg: Add Management DownStream Device Tunneling Register Jiri Pirko
2022-07-20 15:12 ` [patch net-next v3 08/11] mlxsw: core_linecards: Expose device PSID over device info Jiri Pirko
2022-07-21  8:13   ` Ido Schimmel
2022-07-20 15:12 ` [patch net-next v3 09/11] mlxsw: core_linecards: Implement line card device flashing Jiri Pirko
2022-07-21  8:25   ` Ido Schimmel
2022-07-21 16:01     ` Jiri Pirko
2022-07-20 15:12 ` [patch net-next v3 10/11] selftests: mlxsw: Check line card info on provisioned line card Jiri Pirko
2022-07-20 15:12 ` [patch net-next v3 11/11] selftests: mlxsw: Check line card info on activated " Jiri Pirko

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=YtpAm245yK9pfQ+d@nanopsycho \
    --to=jiri@resnulli$(echo .)us \
    --cc=davem@davemloft$(echo .)net \
    --cc=edumazet@google$(echo .)com \
    --cc=idosch@nvidia$(echo .)com \
    --cc=jacob.e.keller@intel$(echo .)com \
    --cc=kuba@kernel$(echo .)org \
    --cc=mlxsw@nvidia$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    --cc=petrm@nvidia$(echo .)com \
    --cc=saeedm@nvidia$(echo .)com \
    --cc=snelson@pensando$(echo .)io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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