mbox series

[iwl-next,0/2] ice: minor cleanups for VF IRQ logic

Message ID 20240319203328.890350-1-jacob.e.keller@intel.com
Headers show
Series ice: minor cleanups for VF IRQ logic | expand

Message

Jacob Keller March 19, 2024, 8:33 p.m. UTC
While working on implementing Scalable IOV support for the ice driver, I
found a few minor gotchas in the VF logic where the existing code is not
ready to handle Scalable VFs.

First, the recent support to allow programming the VF MSI-X count
initialized some values in ice_sriov.c in the for loop for creating VFs
using the sriov_numvfs interface. We will need to initialize these values
for Scalable VFs as well, and this should belong in
ice_initialize_vf_entry().

Second, when programming the VF IRQs in response to virtchnl commands, the
current virtchnl logic hardcodes the assumption that hardware IRQ indexes
are VF relative. This is true for Single Root IOV, but is not true for
Scalable IOV where the interrupts come from the PF space. Cleanup the logic
to look up the IRQ index from the q_vector, making this flow more agnostic
of the VF functionality type.

Neither of these changes is critical for current SR-IOV support, but they do
prepare the way for Scalable IOV VF support. I'd rather have these cleanups
already taken care now instead of carrying them until the Scalable IOV code
is submitted.

Jacob Keller (2):
  ice: set vf->num_msix in ice_initialize_vf_entry()
  ice: look up VF MSI-X index from q_vector->irq.index

 drivers/net/ethernet/intel/ice/ice_base.c     |  6 ++++++
 drivers/net/ethernet/intel/ice/ice_sriov.c    |  5 -----
 drivers/net/ethernet/intel/ice/ice_vf_lib.c   |  5 ++++-
 drivers/net/ethernet/intel/ice/ice_virtchnl.c | 12 +++++-------
 4 files changed, 15 insertions(+), 13 deletions(-)


base-commit: 237bb5f7f7f55ec5f773469a974c61a49c298625

Comments

Jacob Keller March 19, 2024, 10:44 p.m. UTC | #1
On 3/19/2024 1:33 PM, Jacob Keller wrote:
> While working on implementing Scalable IOV support for the ice driver, I
> found a few minor gotchas in the VF logic where the existing code is not
> ready to handle Scalable VFs.
> 
> First, the recent support to allow programming the VF MSI-X count
> initialized some values in ice_sriov.c in the for loop for creating VFs
> using the sriov_numvfs interface. We will need to initialize these values
> for Scalable VFs as well, and this should belong in
> ice_initialize_vf_entry().
> 
> Second, when programming the VF IRQs in response to virtchnl commands, the
> current virtchnl logic hardcodes the assumption that hardware IRQ indexes
> are VF relative. This is true for Single Root IOV, but is not true for
> Scalable IOV where the interrupts come from the PF space. Cleanup the logic
> to look up the IRQ index from the q_vector, making this flow more agnostic
> of the VF functionality type.
> 
> Neither of these changes is critical for current SR-IOV support, but they do
> prepare the way for Scalable IOV VF support. I'd rather have these cleanups
> already taken care now instead of carrying them until the Scalable IOV code
> is submitted.
> 
> Jacob Keller (2):
>   ice: set vf->num_msix in ice_initialize_vf_entry()
>   ice: look up VF MSI-X index from q_vector->irq.index
> 

Please ignore for now. This has a conflict with the recent work to
refactor how MSI-X resources are tracked, and results in trying to free
a vector that was never allocated. It worked on an older driver, but
when I rebased to the next-queue it causes this:

[  492.930839] ice 0000:b8:00.0: Failed to get MSIX interrupt entry at
index 1
[  492.938804] ice 0000:b8:00.0: Failed to get MSIX interrupt entry at
index 2
[  492.946763] ice 0000:b8:00.0: Failed to get MSIX interrupt entry at
index 3
[  492.954722] ice 0000:b8:00.0: Failed to get MSIX interrupt entry at
index 4
[  492.962663] ice 0000:b8:00.0: Failed to get MSIX interrupt entry at
index 5
[  492.970582] ice 0000:b8:00.0: Failed to get MSIX interrupt entry at
index 6
[  492.978524] ice 0000:b8:00.0: Failed to get MSIX interrupt entry at
index 7
[  492.986463] ice 0000:b8:00.0: Failed to get MSIX interrupt entry at
index 8
[  492.994413] ice 0000:b8:00.0: Failed to get MSIX interrupt entry at
index 9
[  493.002361] ice 0000:b8:00.0: Failed to get MSIX interrupt entry at
index 10
[  493.010383] ice 0000:b8:00.0: Failed to get MSIX interrupt entry at
index 11
[  493.018416] ice 0000:b8:00.0: Failed to get MSIX interrupt entry at
index 12
[  493.026458] ice 0000:b8:00.0: Failed to get MSIX interrupt entry at
index 13
[  493.034988] ice 0000:b8:00.0: Failed to get MSIX interrupt entry at
index 14
[  493.043311] ice 0000:b8:00.0: Failed to get MSIX interrupt entry at
index 15
[  493.051543] ice 0000:b8:00.0: Failed to get MSIX interrupt entry at
index 16

I will need to re-evaluate how we can get the proper index here.

>  drivers/net/ethernet/intel/ice/ice_base.c     |  6 ++++++
>  drivers/net/ethernet/intel/ice/ice_sriov.c    |  5 -----
>  drivers/net/ethernet/intel/ice/ice_vf_lib.c   |  5 ++++-
>  drivers/net/ethernet/intel/ice/ice_virtchnl.c | 12 +++++-------
>  4 files changed, 15 insertions(+), 13 deletions(-)
> 
> 
> base-commit: 237bb5f7f7f55ec5f773469a974c61a49c298625