From: Paul Menzel <pmenzel@molgen.mpg.de>
To: Jacob Keller <jacob.e.keller@intel.com>
Cc: Anthony Nguyen <anthony.l.nguyen@intel.com>,
intel-wired-lan@lists.osuosl.org
Subject: Re: [Intel-wired-lan] [PATCH net-next v2 11/13] ice: introduce clear_reset_state operation
Date: Thu, 19 Jan 2023 09:42:32 +0100 [thread overview]
Message-ID: <bbc7c427-ef33-d69f-125f-22dfd70be789@molgen.mpg.de> (raw)
In-Reply-To: <20230119011653.311675-12-jacob.e.keller@intel.com>
Dear Jacob,
Thank you for your patch.
Am 19.01.23 um 02:16 schrieb Jacob Keller:
> When hardware is reset, the VF relies on the VFGEN_RSTAT register to detect
> when the VF is finished resetting. This is a tri-state register where 0
> indicates a reset is in progress, 1 indicates the hardware is done
> resetting, and 2 indicates that the software is done resetting.
>
> Currently the PF driver relies on the device hardware resetting VFGEN_RSTAT
> when a global reset occurs. This works ok, but it does mean that the VF
> might not immediately notice a reset when the driver first detects that the
> global reset is occurring.
>
> This is also problematic for Scalable IOV, because there is no read/write
> equivalent VFGEN_RSTAT register for the Scalable VSI type. Instead, the
> Scalable IOV VFs will need to emulate this register.
>
> To support this, introduce a new VF operation, clear_reset_state, which is
> called when the PF driver first detects a global reset. The Single Root IOV
> implementation can just write to VFGEN_RSTAT to ensure its cleared
it’s
> immediately, without waiting for the actual hardware reset to begin. The
> Scalable IOV implementation will use this as part of its tracking of the
> reset status to allow properly reporting the emulated VFGEN_RSTAT to the VF
> driver.
Can this be tested somehow? If yes, it’d be great if you added the recipe.
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
> Changes since v1:
> * Add no-op version of ice_set_vf_state_dis for when CONFIG_PCI_IOV is
> disabled.
> * Make ice_set_state_qs_dis static since there are no callers outsice
outside
> ice_vf_lib.c
>
> drivers/net/ethernet/intel/ice/ice_main.c | 2 +-
> drivers/net/ethernet/intel/ice/ice_sriov.c | 16 ++++++++++++++++
> drivers/net/ethernet/intel/ice/ice_vf_lib.c | 12 +++++++++++-
> drivers/net/ethernet/intel/ice/ice_vf_lib.h | 5 +++--
> 4 files changed, 31 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
> index 3b98721fd9d8..5d890b6aa9d2 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> @@ -537,7 +537,7 @@ ice_prepare_for_reset(struct ice_pf *pf, enum ice_reset_req reset_type)
> /* Disable VFs until reset is completed */
> mutex_lock(&pf->vfs.table_lock);
> ice_for_each_vf(pf, bkt, vf)
> - ice_set_vf_state_qs_dis(vf);
> + ice_set_vf_state_dis(vf);
> mutex_unlock(&pf->vfs.table_lock);
>
> if (ice_is_eswitch_mode_switchdev(pf)) {
> diff --git a/drivers/net/ethernet/intel/ice/ice_sriov.c b/drivers/net/ethernet/intel/ice/ice_sriov.c
> index 46088c05d485..4d8930b83b35 100644
> --- a/drivers/net/ethernet/intel/ice/ice_sriov.c
> +++ b/drivers/net/ethernet/intel/ice/ice_sriov.c
> @@ -654,6 +654,21 @@ static void ice_sriov_free_vf(struct ice_vf *vf)
> kfree_rcu(vf, rcu);
> }
>
> +/**
> + * ice_sriov_clear_reset_state - clears VF Reset status register
> + * @vf: the vf to configure
> + */
> +static void ice_sriov_clear_reset_state(struct ice_vf *vf)
> +{
> + struct ice_hw *hw = &vf->pf->hw;
> +
> + /* Clear the reset status register so that VF immediately sees that
> + * the device is resetting, even if hardware hasn't yet gotten around
> + * to clearing VFGEN_RSTAT for us.
> + */
> + wr32(hw, VFGEN_RSTAT(vf->vf_id), VIRTCHNL_VFR_INPROGRESS);
> +}
> +
> /**
> * ice_sriov_clear_mbx_register - clears SRIOV VF's mailbox registers
> * @vf: the vf to configure
> @@ -787,6 +802,7 @@ static void ice_sriov_post_vsi_rebuild(struct ice_vf *vf)
> static const struct ice_vf_ops ice_sriov_vf_ops = {
> .reset_type = ICE_VF_RESET,
> .free = ice_sriov_free_vf,
> + .clear_reset_state = ice_sriov_clear_reset_state,
> .clear_mbx_register = ice_sriov_clear_mbx_register,
> .trigger_reset_register = ice_sriov_trigger_reset_register,
> .poll_reset_status = ice_sriov_poll_reset_status,
> diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.c b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> index 1a5d64454f99..2ea801ebb2ac 100644
> --- a/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> +++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> @@ -717,7 +717,7 @@ int ice_reset_vf(struct ice_vf *vf, u32 flags)
> * ice_set_vf_state_qs_dis - Set VF queues state to disabled
> * @vf: pointer to the VF structure
> */
> -void ice_set_vf_state_qs_dis(struct ice_vf *vf)
> +static void ice_set_vf_state_qs_dis(struct ice_vf *vf)
> {
> /* Clear Rx/Tx enabled queues flag */
> bitmap_zero(vf->txq_ena, ICE_MAX_RSS_QS_PER_VF);
> @@ -725,6 +725,16 @@ void ice_set_vf_state_qs_dis(struct ice_vf *vf)
> clear_bit(ICE_VF_STATE_QS_ENA, vf->vf_states);
> }
>
> +/**
> + * ice_set_vf_state_dis - Set VF state to disabled
> + * @vf: pointer to the VF structure
> + */
> +void ice_set_vf_state_dis(struct ice_vf *vf)
> +{
> + ice_set_vf_state_qs_dis(vf);
> + vf->vf_ops->clear_reset_state(vf);
> +}
> +
> /* Private functions only accessed from other virtualization files */
>
> /**
> diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.h b/drivers/net/ethernet/intel/ice/ice_vf_lib.h
> index e3d94f3ca40d..5bb75edb6cef 100644
> --- a/drivers/net/ethernet/intel/ice/ice_vf_lib.h
> +++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.h
> @@ -56,6 +56,7 @@ struct ice_mdd_vf_events {
> struct ice_vf_ops {
> enum ice_disq_rst_src reset_type;
> void (*free)(struct ice_vf *vf);
> + void (*clear_reset_state)(struct ice_vf *vf);
> void (*clear_mbx_register)(struct ice_vf *vf);
> void (*trigger_reset_register)(struct ice_vf *vf, bool is_vflr);
> bool (*poll_reset_status)(struct ice_vf *vf);
> @@ -213,7 +214,7 @@ u16 ice_get_num_vfs(struct ice_pf *pf);
> struct ice_vsi *ice_get_vf_vsi(struct ice_vf *vf);
> bool ice_is_vf_disabled(struct ice_vf *vf);
> int ice_check_vf_ready_for_cfg(struct ice_vf *vf);
> -void ice_set_vf_state_qs_dis(struct ice_vf *vf);
> +void ice_set_vf_state_dis(struct ice_vf *vf);
> bool ice_is_any_vf_in_unicast_promisc(struct ice_pf *pf);
> void
> ice_vf_get_promisc_masks(struct ice_vf *vf, struct ice_vsi *vsi,
> @@ -259,7 +260,7 @@ static inline int ice_check_vf_ready_for_cfg(struct ice_vf *vf)
> return -EOPNOTSUPP;
> }
>
> -static inline void ice_set_vf_state_qs_dis(struct ice_vf *vf)
> +static inline void ice_set_vf_state_dis(struct ice_vf *vf)
> {
> }
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Kind regards,
Paul
_______________________________________________
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-01-19 8:42 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-19 1:16 [Intel-wired-lan] [PATCH net-next v2 00/13] ice: various virtualization cleanups Jacob Keller
2023-01-19 1:16 ` [Intel-wired-lan] [PATCH net-next v2 01/13] ice: fix function comment referring to ice_vsi_alloc Jacob Keller
2023-01-19 1:16 ` [Intel-wired-lan] [PATCH net-next v2 02/13] ice: drop unnecessary VF parameter from several VSI functions Jacob Keller
2023-01-26 9:36 ` Szlosek, Marek
2023-01-19 1:16 ` [Intel-wired-lan] [PATCH net-next v2 03/13] ice: refactor VSI setup to use parameter structure Jacob Keller
2023-01-24 3:15 ` G, GurucharanX
2023-01-19 1:16 ` [Intel-wired-lan] [PATCH net-next v2 04/13] ice: move vsi_type assignment from ice_vsi_alloc to ice_vsi_cfg Jacob Keller
2023-01-24 3:16 ` G, GurucharanX
2023-01-19 1:16 ` [Intel-wired-lan] [PATCH net-next v2 05/13] ice: Fix RDMA latency issue by allowing write-combining Jacob Keller
2023-01-25 15:21 ` Andrysiak, Jakub
2023-01-30 10:03 ` Alexander Lobakin
2023-01-30 23:34 ` Keller, Jacob E
2023-01-31 0:26 ` Tony Nguyen
2023-01-31 22:57 ` Jacob Keller
2023-01-19 1:16 ` [Intel-wired-lan] [PATCH net-next v2 06/13] ice: move ice_vf_vsi_release into ice_vf_lib.c Jacob Keller
2023-01-26 9:36 ` Szlosek, Marek
2023-01-19 1:16 ` [Intel-wired-lan] [PATCH net-next v2 07/13] ice: Pull common tasks into ice_vf_post_vsi_rebuild Jacob Keller
2023-01-26 9:37 ` Szlosek, Marek
2023-01-19 1:16 ` [Intel-wired-lan] [PATCH net-next v2 08/13] ice: add a function to initialize vf entry Jacob Keller
2023-01-26 9:38 ` Szlosek, Marek
2023-01-19 1:16 ` [Intel-wired-lan] [PATCH net-next v2 09/13] ice: introduce ice_vf_init_host_cfg function Jacob Keller
2023-01-26 9:38 ` Szlosek, Marek
2023-01-19 1:16 ` [Intel-wired-lan] [PATCH net-next v2 10/13] ice: convert vf_ops .vsi_rebuild to .create_vsi Jacob Keller
2023-01-19 1:16 ` [Intel-wired-lan] [PATCH net-next v2 11/13] ice: introduce clear_reset_state operation Jacob Keller
2023-01-19 8:42 ` Paul Menzel [this message]
2023-01-19 19:18 ` Jacob Keller
2023-01-27 9:48 ` Szlosek, Marek
2023-01-19 1:16 ` [Intel-wired-lan] [PATCH net-next v2 12/13] ice: introduce .irq_close VF operation Jacob Keller
2023-01-27 9:48 ` Szlosek, Marek
2023-01-19 1:16 ` [Intel-wired-lan] [PATCH net-next v2 13/13] ice: remove unnecessary virtchnl_ether_addr struct use Jacob Keller
2023-01-27 9:49 ` Szlosek, Marek
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=bbc7c427-ef33-d69f-125f-22dfd70be789@molgen.mpg.de \
--to=pmenzel@molgen.mpg.de \
--cc=anthony.l.nguyen@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jacob.e.keller@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox