> -----Original Message----- > From: Intel-wired-lan <[email protected]> On Behalf Of > Jacob Keller > Sent: Friday, February 16, 2024 11:07 PM > To: Nguyen, Anthony L <[email protected]>; Intel Wired LAN > <[email protected]> > Cc: Keller, Jacob E <[email protected]>; Kitszel, Przemyslaw > <[email protected]> > Subject: [Intel-wired-lan] [PATCH iwl-next 3/4] ice: use relative VSI index > for > VFs instead of PF VSI number > > When initializing over virtchnl, the PF is required to pass a VSI ID to the > VF as > part of its capabilities exchange. The VF driver reports this value back to > the PF > in a variety of commands. The PF driver validates that this value matches the > value it sent to the VF. > > Some hardware families such as the E700 series could use this value when > reading RSS registers or communicating directly with firmware over the Admin > Queue. > > However, E800 series hardware does not support any of these interfaces and > the VF's only use for this value is to report it back to the PF. Thus, there > is no > requirement that this value be an actual VSI ID value of any kind. > > The PF driver already does not trust that the VF sends it a real VSI ID. > The VSI structure is always looked up from the VF structure. The PF does > validate that the VSI ID provided matches a VSI associated with the VF, but > otherwise does not use the VSI ID for any purpose. > > Instead of reporting the VSI number relative to the PF space, report a fixed > value of 1. When communicating with the VF over virtchnl, validate that the > VSI number is returned appropriately. > > This avoids leaking information about the firmware of the PF state. > Currently the ice driver only supplies a VF with a single VSI. However, it > appears that virtchnl has some support for allowing multiple VSIs. I did not > attempt to implement this. However, space is left open to allow further > relative > indexes if additional VSIs are provided in future feature development. For > this > reason, keep the ice_vc_isvalid_vsi_id function in place to allow extending > it for > multiple VSIs in the future. > > This change will also simplify handling of live migration in a future series. > Since > we no longer will provide a real VSI number to the VF, there will be no need > to > keep track of this number when migrating to a new host. > > Signed-off-by: Jacob Keller <[email protected]> > Reviewed-by: Przemek Kitszel <[email protected]> > --- > drivers/net/ethernet/intel/ice/ice_virtchnl.c | 9 ++------- > drivers/net/ethernet/intel/ice/ice_virtchnl.h | 9 +++++++++ > 2 files changed, 11 insertions(+), 7 deletions(-) > > diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl.c > b/drivers/net/ethernet/intel/ice/ice_virtchnl.c > index 29449030174f..1ff9818b4c84 100644 > --- a/drivers/net/ethernet/intel/ice/ice_virtchnl.c > +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl.c > @@ -499,7 +499,7 @@ static int ice_vc_get_vf_res_msg(struct ice_vf *vf, u8
Tested-by: Rafal Romanowski <[email protected]>
