> -----Original Message----- > From: Intel-wired-lan <[email protected]> On Behalf Of > Przemek Kitszel > Sent: 14 April 2025 18:43 > To: [email protected]; Nguyen, Anthony L > <[email protected]> > Cc: Jiri Pirko <[email protected]>; Temerkhanov, Sergey > <[email protected]>; [email protected]; Loktionov, Aleksandr > <[email protected]>; Kolacinski, Karol > <[email protected]>; Kubiak, > Michal <[email protected]>; > Simon Horman <[email protected]>; Kitszel, Przemyslaw > <[email protected]>; Keller, Jacob E <[email protected]>; > Jakub Kicinski <[email protected]> > Subject: [Intel-wired-lan] [PATCH iwl-net v4] ice: use DSN instead of PCI BDF > for ice_adapter index > > Use Device Serial Number instead of PCI bus/device/function for the index of > struct ice_adapter. > > Functions on the same physical device should point to the very same > ice_adapter instance, but with two PFs, when at least one of them is PCI-e > passed-through to a VM, it is no longer the case - PFs will get seemingly > random PCI BDF values, and thus indices, what finally leds to each of them > being on their own instance of ice_adapter. That causes them to don't attempt > any synchronization of the PTP HW clock usage, or any other future resources. > > DSN works nicely in place of the index, as it is "immutable" in terms of > virtualization. > > Fixes: 0e2bddf9e5f9 ("ice: add ice_adapter for shared data across PFs on the > same NIC") > Suggested-by: Jacob Keller <[email protected]> > Suggested-by: Jakub Kicinski <[email protected]> > Suggested-by: Jiri Pirko <[email protected]> > Reviewed-by: Aleksandr Loktionov <[email protected]> > Signed-off-by: Przemek Kitszel <[email protected]> > --- > CC: Karol Kolacinski <[email protected]> > CC: Grzegorz Nitka <[email protected]> > CC: Michal Schmidt <[email protected]> > CC: Sergey Temerkhanov <[email protected]> > CC: Michal Kubiak <[email protected]> > CC: Simon Horman <[email protected]> > > v4: > - Add fixes tag for real... (Simon) > - extend commit message (Simon) > - pass dsn to ice_adapter_new() to have simpler code > (I happened to do that as (local) followup) (me) > > v3: > https://lore.kernel.org/intel-wired-lan/[email protected]/ > - Add fixes tag (Michal K) > - add missing braces (lkp bot), turns out it's hard to purge C++ from your > mind > - (no changes in the collision handling on 32bit systems) > > v2: > https://lore.kernel.org/intel-wired-lan/[email protected]/ > - target to -net (Jiri) > - mix both halves of u64 DSN on 32bit systems (Jiri) > - (no changes in terms of fallbacks for pre-prod HW) > - warn when there is DSN collision after reducing to 32bit > > v1: > https://lore.kernel.org/netdev/[email protected] > --- > drivers/net/ethernet/intel/ice/ice_adapter.h | 6 ++- > drivers/net/ethernet/intel/ice/ice_adapter.c | 47 ++++++++------------ > 2 files changed, 22 insertions(+), 31 deletions(-) >
Tested-by: Rinitha S <[email protected]> (A Contingent worker at Intel)
