Various cleanups and preparation to the ice driver code for supporting SR-IOV live migration.
The logic for unpacking Rx queue context data is added. This is the inverse of the existing packing logic. Thanks to <linux/packing.h> this is trivial to add. Code to enable both reading and writing the Tx queue context for a queue over a shared hardware register interface is added. Thanks to ice_adapter, this is locked across all PFs that need to use it, preventing concurrency issues with multiple PFs. The RSS hash configuration requested by a VF is cached within the VF structure. This will be used to track and restore the same configuration during migration load. ice_sriov_set_msix_vec_count() is updated to use pci_iov_vf_id() instead of open-coding a worse equivalent, and checks to avoid rebuilding MSI-X if the current request is for the existing amount of vectors. A new ice_get_vf_by_dev() helper function is added to simplify accessing a VF from its PCI device structure. This will be used more heavily within the live migration code itself. REVIEW NOTES: This is the first eight patches of my full series to support live migration. The full series (based on net-next) is available at [1] for early preview if you want to see the changes in context. Some of these changes are not "used" until the live migration patches themselves. However, I felt they were sufficiently large and review-able on their own. Additionally, if I keep them included within the live migration series it is 15 patches which is at the limit of acceptable size for netdev. I'd prefer to merge these cleanups first in order to reduce the burden of review for the whole feature. Signed-off-by: Jacob Keller <[email protected]> Link: [1] https://github.com/jacob-keller/linux/tree/e810-live-migration/jk-migration-tlv --- Jacob Keller (8): ice: add support for reading and unpacking Rx queue context ice: add functions to get and set Tx queue context ice: save RSS hash configuration for migration ice: move ice_vsi_update_l2tsel to ice_lib.c ice: expose VF functions used by live migration ice: use pci_iov_vf_id() to get VF ID ice: avoid rebuilding if MSI-X vector count is unchanged ice: introduce ice_get_vf_by_dev() wrapper drivers/net/ethernet/intel/ice/ice_adapter.h | 2 + drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 14 +- drivers/net/ethernet/intel/ice/ice_common.h | 6 + drivers/net/ethernet/intel/ice/ice_hw_autogen.h | 12 ++ drivers/net/ethernet/intel/ice/ice_lib.h | 8 + drivers/net/ethernet/intel/ice/ice_sriov.h | 7 + drivers/net/ethernet/intel/ice/ice_vf_lib.h | 34 +++- drivers/net/ethernet/intel/ice/ice_virtchnl.h | 19 ++ drivers/net/ethernet/intel/ice/ice_adapter.c | 1 + drivers/net/ethernet/intel/ice/ice_common.c | 233 +++++++++++++++++++++++- drivers/net/ethernet/intel/ice/ice_lib.c | 35 ++++ drivers/net/ethernet/intel/ice/ice_sriov.c | 19 +- drivers/net/ethernet/intel/ice/ice_vf_lib.c | 3 + drivers/net/ethernet/intel/ice/ice_virtchnl.c | 59 +----- 14 files changed, 384 insertions(+), 68 deletions(-) --- base-commit: d16813402994bde9201030ef877c9d753227e6dd change-id: 20250618-e810-live-migration-jk-migration-prep-838d05344c47 Best regards, -- Jacob Keller <[email protected]>
