From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Cc: netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org,
przemyslaw.kitszel@intel.com
Subject: Re: [Intel-wired-lan] [PATCH iwl-next v1 1/4] ice: implement num_msix field per VF
Date: Thu, 15 Jun 2023 16:22:35 +0200 [thread overview]
Message-ID: <ZIseq7r5alm5DctL@boxer> (raw)
In-Reply-To: <20230615123830.155927-2-michal.swiatkowski@linux.intel.com>
On Thu, Jun 15, 2023 at 02:38:27PM +0200, Michal Swiatkowski wrote:
> Store the amount of MSI-X per VF instead of storing it in pf struct. It
> is used to calculate number of q_vectors (and queues) for VF VSI.
>
> Calculate vector indexes based on this new field.
Can you explain why? From a standalone POV the reasoning is not clear.
>
> Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> ---
> drivers/net/ethernet/intel/ice/ice_lib.c | 2 +-
> drivers/net/ethernet/intel/ice/ice_sriov.c | 13 +++++++++----
> drivers/net/ethernet/intel/ice/ice_vf_lib.h | 4 +++-
> drivers/net/ethernet/intel/ice/ice_virtchnl.c | 2 +-
> 4 files changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
> index e8142bea2eb2..24a0bf403445 100644
> --- a/drivers/net/ethernet/intel/ice/ice_lib.c
> +++ b/drivers/net/ethernet/intel/ice/ice_lib.c
> @@ -229,7 +229,7 @@ static void ice_vsi_set_num_qs(struct ice_vsi *vsi)
> * of queues vectors, subtract 1 (ICE_NONQ_VECS_VF) from the
> * original vector count
> */
> - vsi->num_q_vectors = pf->vfs.num_msix_per - ICE_NONQ_VECS_VF;
> + vsi->num_q_vectors = vf->num_msix - ICE_NONQ_VECS_VF;
> break;
> case ICE_VSI_CTRL:
> vsi->alloc_txq = 1;
> diff --git a/drivers/net/ethernet/intel/ice/ice_sriov.c b/drivers/net/ethernet/intel/ice/ice_sriov.c
> index 2ea6d24977a6..3137e772a64b 100644
> --- a/drivers/net/ethernet/intel/ice/ice_sriov.c
> +++ b/drivers/net/ethernet/intel/ice/ice_sriov.c
> @@ -64,7 +64,7 @@ static void ice_free_vf_res(struct ice_vf *vf)
> vf->num_mac = 0;
> }
>
> - last_vector_idx = vf->first_vector_idx + pf->vfs.num_msix_per - 1;
> + last_vector_idx = vf->first_vector_idx + vf->num_msix - 1;
>
> /* clear VF MDD event information */
> memset(&vf->mdd_tx_events, 0, sizeof(vf->mdd_tx_events));
> @@ -102,7 +102,7 @@ static void ice_dis_vf_mappings(struct ice_vf *vf)
> wr32(hw, VPINT_ALLOC_PCI(vf->vf_id), 0);
>
> first = vf->first_vector_idx;
> - last = first + pf->vfs.num_msix_per - 1;
> + last = first + vf->num_msix - 1;
> for (v = first; v <= last; v++) {
> u32 reg;
>
> @@ -280,12 +280,12 @@ static void ice_ena_vf_msix_mappings(struct ice_vf *vf)
>
> hw = &pf->hw;
> pf_based_first_msix = vf->first_vector_idx;
> - pf_based_last_msix = (pf_based_first_msix + pf->vfs.num_msix_per) - 1;
> + pf_based_last_msix = (pf_based_first_msix + vf->num_msix) - 1;
>
> device_based_first_msix = pf_based_first_msix +
> pf->hw.func_caps.common_cap.msix_vector_first_id;
> device_based_last_msix =
> - (device_based_first_msix + pf->vfs.num_msix_per) - 1;
> + (device_based_first_msix + vf->num_msix) - 1;
> device_based_vf_id = vf->vf_id + hw->func_caps.vf_base_id;
>
> reg = (((device_based_first_msix << VPINT_ALLOC_FIRST_S) &
> @@ -814,6 +814,11 @@ static int ice_create_vf_entries(struct ice_pf *pf, u16 num_vfs)
>
> vf->vf_sw_id = pf->first_sw;
>
> + /* set default number of MSI-X */
> + vf->num_msix = pf->vfs.num_msix_per;
> + vf->num_vf_qs = pf->vfs.num_qps_per;
> + ice_vc_set_default_allowlist(vf);
> +
> hash_add_rcu(vfs->table, &vf->entry, vf_id);
> }
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.h b/drivers/net/ethernet/intel/ice/ice_vf_lib.h
> index 67172fdd9bc2..4dbfb7e26bfa 100644
> --- a/drivers/net/ethernet/intel/ice/ice_vf_lib.h
> +++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.h
> @@ -72,7 +72,7 @@ struct ice_vfs {
> struct mutex table_lock; /* Lock for protecting the hash table */
> u16 num_supported; /* max supported VFs on this PF */
> u16 num_qps_per; /* number of queue pairs per VF */
> - u16 num_msix_per; /* number of MSI-X vectors per VF */
> + u16 num_msix_per; /* default MSI-X vectors per VF */
> unsigned long last_printed_mdd_jiffies; /* MDD message rate limit */
> };
>
> @@ -133,6 +133,8 @@ struct ice_vf {
>
> /* devlink port data */
> struct devlink_port devlink_port;
> +
> + u16 num_msix; /* num of MSI-X configured on this VF */
> };
>
> /* Flags for controlling behavior of ice_reset_vf */
> diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl.c b/drivers/net/ethernet/intel/ice/ice_virtchnl.c
> index efbc2968a7bf..37b588774ac1 100644
> --- a/drivers/net/ethernet/intel/ice/ice_virtchnl.c
> +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl.c
> @@ -498,7 +498,7 @@ static int ice_vc_get_vf_res_msg(struct ice_vf *vf, u8 *msg)
> vfres->num_vsis = 1;
> /* Tx and Rx queue are equal for VF */
> vfres->num_queue_pairs = vsi->num_txq;
> - vfres->max_vectors = vf->pf->vfs.num_msix_per;
> + vfres->max_vectors = vf->num_msix;
> vfres->rss_key_size = ICE_VSIQF_HKEY_ARRAY_SIZE;
> vfres->rss_lut_size = ICE_VSIQF_HLUT_ARRAY_SIZE;
> vfres->max_mtu = ice_vc_get_max_frame_size(vf);
> --
> 2.40.1
>
> _______________________________________________
> Intel-wired-lan mailing list
> Intel-wired-lan@osuosl.org
> https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
WARNING: multiple messages have this Message-ID (diff)
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Cc: <intel-wired-lan@lists.osuosl.org>, <netdev@vger.kernel.org>,
<przemyslaw.kitszel@intel.com>
Subject: Re: [Intel-wired-lan] [PATCH iwl-next v1 1/4] ice: implement num_msix field per VF
Date: Thu, 15 Jun 2023 16:22:35 +0200 [thread overview]
Message-ID: <ZIseq7r5alm5DctL@boxer> (raw)
In-Reply-To: <20230615123830.155927-2-michal.swiatkowski@linux.intel.com>
On Thu, Jun 15, 2023 at 02:38:27PM +0200, Michal Swiatkowski wrote:
> Store the amount of MSI-X per VF instead of storing it in pf struct. It
> is used to calculate number of q_vectors (and queues) for VF VSI.
>
> Calculate vector indexes based on this new field.
Can you explain why? From a standalone POV the reasoning is not clear.
>
> Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> ---
> drivers/net/ethernet/intel/ice/ice_lib.c | 2 +-
> drivers/net/ethernet/intel/ice/ice_sriov.c | 13 +++++++++----
> drivers/net/ethernet/intel/ice/ice_vf_lib.h | 4 +++-
> drivers/net/ethernet/intel/ice/ice_virtchnl.c | 2 +-
> 4 files changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
> index e8142bea2eb2..24a0bf403445 100644
> --- a/drivers/net/ethernet/intel/ice/ice_lib.c
> +++ b/drivers/net/ethernet/intel/ice/ice_lib.c
> @@ -229,7 +229,7 @@ static void ice_vsi_set_num_qs(struct ice_vsi *vsi)
> * of queues vectors, subtract 1 (ICE_NONQ_VECS_VF) from the
> * original vector count
> */
> - vsi->num_q_vectors = pf->vfs.num_msix_per - ICE_NONQ_VECS_VF;
> + vsi->num_q_vectors = vf->num_msix - ICE_NONQ_VECS_VF;
> break;
> case ICE_VSI_CTRL:
> vsi->alloc_txq = 1;
> diff --git a/drivers/net/ethernet/intel/ice/ice_sriov.c b/drivers/net/ethernet/intel/ice/ice_sriov.c
> index 2ea6d24977a6..3137e772a64b 100644
> --- a/drivers/net/ethernet/intel/ice/ice_sriov.c
> +++ b/drivers/net/ethernet/intel/ice/ice_sriov.c
> @@ -64,7 +64,7 @@ static void ice_free_vf_res(struct ice_vf *vf)
> vf->num_mac = 0;
> }
>
> - last_vector_idx = vf->first_vector_idx + pf->vfs.num_msix_per - 1;
> + last_vector_idx = vf->first_vector_idx + vf->num_msix - 1;
>
> /* clear VF MDD event information */
> memset(&vf->mdd_tx_events, 0, sizeof(vf->mdd_tx_events));
> @@ -102,7 +102,7 @@ static void ice_dis_vf_mappings(struct ice_vf *vf)
> wr32(hw, VPINT_ALLOC_PCI(vf->vf_id), 0);
>
> first = vf->first_vector_idx;
> - last = first + pf->vfs.num_msix_per - 1;
> + last = first + vf->num_msix - 1;
> for (v = first; v <= last; v++) {
> u32 reg;
>
> @@ -280,12 +280,12 @@ static void ice_ena_vf_msix_mappings(struct ice_vf *vf)
>
> hw = &pf->hw;
> pf_based_first_msix = vf->first_vector_idx;
> - pf_based_last_msix = (pf_based_first_msix + pf->vfs.num_msix_per) - 1;
> + pf_based_last_msix = (pf_based_first_msix + vf->num_msix) - 1;
>
> device_based_first_msix = pf_based_first_msix +
> pf->hw.func_caps.common_cap.msix_vector_first_id;
> device_based_last_msix =
> - (device_based_first_msix + pf->vfs.num_msix_per) - 1;
> + (device_based_first_msix + vf->num_msix) - 1;
> device_based_vf_id = vf->vf_id + hw->func_caps.vf_base_id;
>
> reg = (((device_based_first_msix << VPINT_ALLOC_FIRST_S) &
> @@ -814,6 +814,11 @@ static int ice_create_vf_entries(struct ice_pf *pf, u16 num_vfs)
>
> vf->vf_sw_id = pf->first_sw;
>
> + /* set default number of MSI-X */
> + vf->num_msix = pf->vfs.num_msix_per;
> + vf->num_vf_qs = pf->vfs.num_qps_per;
> + ice_vc_set_default_allowlist(vf);
> +
> hash_add_rcu(vfs->table, &vf->entry, vf_id);
> }
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.h b/drivers/net/ethernet/intel/ice/ice_vf_lib.h
> index 67172fdd9bc2..4dbfb7e26bfa 100644
> --- a/drivers/net/ethernet/intel/ice/ice_vf_lib.h
> +++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.h
> @@ -72,7 +72,7 @@ struct ice_vfs {
> struct mutex table_lock; /* Lock for protecting the hash table */
> u16 num_supported; /* max supported VFs on this PF */
> u16 num_qps_per; /* number of queue pairs per VF */
> - u16 num_msix_per; /* number of MSI-X vectors per VF */
> + u16 num_msix_per; /* default MSI-X vectors per VF */
> unsigned long last_printed_mdd_jiffies; /* MDD message rate limit */
> };
>
> @@ -133,6 +133,8 @@ struct ice_vf {
>
> /* devlink port data */
> struct devlink_port devlink_port;
> +
> + u16 num_msix; /* num of MSI-X configured on this VF */
> };
>
> /* Flags for controlling behavior of ice_reset_vf */
> diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl.c b/drivers/net/ethernet/intel/ice/ice_virtchnl.c
> index efbc2968a7bf..37b588774ac1 100644
> --- a/drivers/net/ethernet/intel/ice/ice_virtchnl.c
> +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl.c
> @@ -498,7 +498,7 @@ static int ice_vc_get_vf_res_msg(struct ice_vf *vf, u8 *msg)
> vfres->num_vsis = 1;
> /* Tx and Rx queue are equal for VF */
> vfres->num_queue_pairs = vsi->num_txq;
> - vfres->max_vectors = vf->pf->vfs.num_msix_per;
> + vfres->max_vectors = vf->num_msix;
> vfres->rss_key_size = ICE_VSIQF_HKEY_ARRAY_SIZE;
> vfres->rss_lut_size = ICE_VSIQF_HLUT_ARRAY_SIZE;
> vfres->max_mtu = ice_vc_get_max_frame_size(vf);
> --
> 2.40.1
>
> _______________________________________________
> Intel-wired-lan mailing list
> Intel-wired-lan@osuosl.org
> https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
next prev parent reply other threads:[~2023-06-15 14:22 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-15 12:38 [Intel-wired-lan] [PATCH iwl-next v1 0/4] change MSI-X vectors per VF Michal Swiatkowski
2023-06-15 12:38 ` Michal Swiatkowski
2023-06-15 12:38 ` [Intel-wired-lan] [PATCH iwl-next v1 1/4] ice: implement num_msix field " Michal Swiatkowski
2023-06-15 12:38 ` Michal Swiatkowski
2023-06-15 14:22 ` Maciej Fijalkowski [this message]
2023-06-15 14:22 ` [Intel-wired-lan] " Maciej Fijalkowski
2023-06-15 14:43 ` Michal Swiatkowski
2023-06-15 14:43 ` Michal Swiatkowski
2023-06-15 12:38 ` [Intel-wired-lan] [PATCH iwl-next v1 2/4] ice: add bitmap to track VF MSI-X usage Michal Swiatkowski
2023-06-15 12:38 ` Michal Swiatkowski
2023-06-15 12:38 ` [Intel-wired-lan] [PATCH iwl-next v1 3/4] ice: set MSI-X vector count on VF Michal Swiatkowski
2023-06-15 12:38 ` Michal Swiatkowski
2023-06-15 12:38 ` [Intel-wired-lan] [PATCH iwl-next v1 4/4] ice: manage VFs MSI-X using resource tracking Michal Swiatkowski
2023-06-15 12:38 ` Michal Swiatkowski
2023-06-15 15:57 ` [Intel-wired-lan] " Keller, Jacob E
2023-06-15 15:57 ` Keller, Jacob E
2023-06-16 8:37 ` [Intel-wired-lan] " Michal Swiatkowski
2023-06-16 8:37 ` Michal Swiatkowski
2023-06-20 5:37 ` [Intel-wired-lan] " Keller, Jacob E
2023-06-20 5:37 ` Keller, Jacob E
2023-11-23 17:22 ` [Intel-wired-lan] " Romanowski, Rafal
2023-11-23 17:22 ` Romanowski, Rafal
2023-06-16 20:37 ` [Intel-wired-lan] [PATCH iwl-next v1 0/4] change MSI-X vectors per VF Tony Nguyen
2023-06-16 20:37 ` Tony Nguyen
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=ZIseq7r5alm5DctL@boxer \
--to=maciej.fijalkowski@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=michal.swiatkowski@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=przemyslaw.kitszel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.