From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: <intel-wired-lan@lists.osuosl.org>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
<netdev@vger.kernel.org>, Jacob Keller <jacob.e.keller@intel.com>,
Jakub Kicinski <kuba@kernel.org>,
"Aleksandr Loktionov" <aleksandr.loktionov@intel.com>,
Karol Kolacinski <karol.kolacinski@intel.com>,
Grzegorz Nitka <grzegorz.nitka@intel.com>,
Michal Schmidt <mschmidt@redhat.com>,
Sergey Temerkhanov <sergey.temerkhanov@intel.com>
Subject: Re: [PATCH iwl-net v2] ice: use DSN instead of PCI BDF for ice_adapter index
Date: Mon, 7 Apr 2025 15:26:38 +0200 [thread overview]
Message-ID: <34b177b1-4be4-4888-a1d5-8b2b6f5f66f5@intel.com> (raw)
In-Reply-To: <umik2eecoutyaf666hy3h2g2bbbchvfb7veqwrcqkb6aevntxz@yhslcltafqxy>
>> struct ice_adapter {
>> refcount_t refcount;
>> /* For access to the GLTSYN_TIME register */
>> spinlock_t ptp_gltsyn_time_lock;
>>
>> struct ice_pf *ctrl_pf;
>> struct ice_port_list ports;
>> + u64 device_serial_number;
>> };
>>
>> + index = ice_adapter_index(dsn);
>> scoped_guard(mutex, &ice_adapters_mutex) {
>> err = xa_insert(&ice_adapters, index, NULL, GFP_KERNEL);
>> if (err == -EBUSY) {
>> adapter = xa_load(&ice_adapters, index);
>> refcount_inc(&adapter->refcount);
>> + WARN_ON_ONCE(adapter->device_serial_number != dsn);
>
> Warn and done? How unlikely is this? I mean, can this happen in real
> world? If yes, that's a bug.
Very unlikely, one would have to have weird NVM *and* also running
32bit mode, I don't like complicating the normal flow to be able to
run fine on misconfigured setups. One redundant field in the struct
and an unlikely() branch on the init path already is almost too much
for my liking, but human will get to know immediately.
next prev parent reply other threads:[~2025-04-07 13:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-07 11:20 [PATCH iwl-net v2] ice: use DSN instead of PCI BDF for ice_adapter index Przemek Kitszel
2025-04-07 11:42 ` Michal Kubiak
2025-04-07 13:30 ` Przemek Kitszel
2025-04-07 17:15 ` Tony Nguyen
2025-04-07 12:03 ` Jiri Pirko
2025-04-07 13:26 ` Przemek Kitszel [this message]
2025-04-07 20:39 ` kernel test robot
2025-04-08 1:18 ` kernel test robot
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=34b177b1-4be4-4888-a1d5-8b2b6f5f66f5@intel.com \
--to=przemyslaw.kitszel@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=grzegorz.nitka@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jacob.e.keller@intel.com \
--cc=jiri@resnulli.us \
--cc=karol.kolacinski@intel.com \
--cc=kuba@kernel.org \
--cc=mschmidt@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=sergey.temerkhanov@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox