Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: Intel Wired LAN <intel-wired-lan@lists.osuosl.org>
Cc: Anthony Nguyen <anthony.l.nguyen@intel.com>
Subject: [Intel-wired-lan] [PATCH net-next v2 07/13] ice: Pull common tasks into ice_vf_post_vsi_rebuild
Date: Wed, 18 Jan 2023 17:16:47 -0800	[thread overview]
Message-ID: <20230119011653.311675-8-jacob.e.keller@intel.com> (raw)
In-Reply-To: <20230119011653.311675-1-jacob.e.keller@intel.com>

The Single Root IOV implementation of .post_vsi_rebuild performs some tasks
that will ultimately need to be shared with the Scalable IOV implementation
such as rebuilding the host configuration.

Refactor by introducing a new wrapper function, ice_vf_post_vsi_rebuild
which performs the tasks that will be shared between SR-IOV and Scalable
IOV. Move the ice_vf_rebuild_host_cfg and ice_vf_set_initialized calls into
this wrapper. Then call the implementation specific post_vsi_rebuild
handler afterwards.

This ensures that we will properly re-initialize filters and expected
settings for both SR-IOV and Scalable IOV.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
No Changes since v1.

 drivers/net/ethernet/intel/ice/ice_sriov.c  |  2 --
 drivers/net/ethernet/intel/ice/ice_vf_lib.c | 19 +++++++++++++++++--
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_sriov.c b/drivers/net/ethernet/intel/ice/ice_sriov.c
index de20e50623d7..6ff29be974c5 100644
--- a/drivers/net/ethernet/intel/ice/ice_sriov.c
+++ b/drivers/net/ethernet/intel/ice/ice_sriov.c
@@ -816,8 +816,6 @@ static int ice_sriov_vsi_rebuild(struct ice_vf *vf)
  */
 static void ice_sriov_post_vsi_rebuild(struct ice_vf *vf)
 {
-	ice_vf_rebuild_host_cfg(vf);
-	ice_vf_set_initialized(vf);
 	ice_ena_vf_mappings(vf);
 	wr32(&vf->pf->hw, VFGEN_RSTAT(vf->vf_id), VIRTCHNL_VFR_VFACTIVE);
 }
diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.c b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
index 5fecbec55f54..624c7de8b205 100644
--- a/drivers/net/ethernet/intel/ice/ice_vf_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
@@ -270,6 +270,21 @@ static int ice_vf_rebuild_vsi(struct ice_vf *vf)
 	return 0;
 }
 
+/**
+ * ice_vf_post_vsi_rebuild - Reset tasks that occur after VSI rebuild
+ * @vf: the VF being reset
+ *
+ * Perform reset tasks which must occur after the VSI has been re-created or
+ * rebuilt during a VF reset.
+ */
+static void ice_vf_post_vsi_rebuild(struct ice_vf *vf)
+{
+	ice_vf_rebuild_host_cfg(vf);
+	ice_vf_set_initialized(vf);
+
+	vf->vf_ops->post_vsi_rebuild(vf);
+}
+
 /**
  * ice_is_any_vf_in_unicast_promisc - check if any VF(s)
  * are in unicast promiscuous mode
@@ -495,7 +510,7 @@ void ice_reset_all_vfs(struct ice_pf *pf)
 
 		ice_vf_pre_vsi_rebuild(vf);
 		ice_vf_rebuild_vsi(vf);
-		vf->vf_ops->post_vsi_rebuild(vf);
+		ice_vf_post_vsi_rebuild(vf);
 
 		mutex_unlock(&vf->cfg_lock);
 	}
@@ -646,7 +661,7 @@ int ice_reset_vf(struct ice_vf *vf, u32 flags)
 		goto out_unlock;
 	}
 
-	vf->vf_ops->post_vsi_rebuild(vf);
+	ice_vf_post_vsi_rebuild(vf);
 	vsi = ice_get_vf_vsi(vf);
 	if (WARN_ON(!vsi)) {
 		err = -EINVAL;
-- 
2.39.1.405.gd4c25cc71f83

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

  parent reply	other threads:[~2023-01-19  1:17 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 ` Jacob Keller [this message]
2023-01-26  9:37   ` [Intel-wired-lan] [PATCH net-next v2 07/13] ice: Pull common tasks into ice_vf_post_vsi_rebuild 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
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=20230119011653.311675-8-jacob.e.keller@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    /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