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>,
	Jesse Brandeburg <jesse.brandeburg@intel.com>
Subject: [Intel-wired-lan] [intel-next PATCH 05/14] ice: remove ice_mbx_deinit_snapshot
Date: Wed, 22 Feb 2023 09:09:11 -0800	[thread overview]
Message-ID: <20230222170920.1629293-6-jacob.e.keller@intel.com> (raw)
In-Reply-To: <20230222170920.1629293-1-jacob.e.keller@intel.com>

The ice_mbx_deinit_snapshot function's only remaining job is to clear the
previous snapshot data. This snapshot data is initialized when SR-IOV adds
VFs, so it is not necessary to clear this data when removing VFs. Since no
allocation occurs we no longer need to free anything and we can safely
remove this function.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
---
 drivers/net/ethernet/intel/ice/ice_sriov.c  |  5 +----
 drivers/net/ethernet/intel/ice/ice_vf_mbx.c | 14 --------------
 drivers/net/ethernet/intel/ice/ice_vf_mbx.h |  1 -
 3 files changed, 1 insertion(+), 19 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_sriov.c b/drivers/net/ethernet/intel/ice/ice_sriov.c
index 8820f269bfdf..b65025b51526 100644
--- a/drivers/net/ethernet/intel/ice/ice_sriov.c
+++ b/drivers/net/ethernet/intel/ice/ice_sriov.c
@@ -1014,7 +1014,6 @@ int ice_sriov_configure(struct pci_dev *pdev, int num_vfs)
 	if (!num_vfs) {
 		if (!pci_vfs_assigned(pdev)) {
 			ice_free_vfs(pf);
-			ice_mbx_deinit_snapshot(&pf->hw);
 			if (pf->lag)
 				ice_enable_lag(pf->lag);
 			return 0;
@@ -1027,10 +1026,8 @@ int ice_sriov_configure(struct pci_dev *pdev, int num_vfs)
 	ice_mbx_init_snapshot(&pf->hw);
 
 	err = ice_pci_sriov_ena(pf, num_vfs);
-	if (err) {
-		ice_mbx_deinit_snapshot(&pf->hw);
+	if (err)
 		return err;
-	}
 
 	if (pf->lag)
 		ice_disable_lag(pf->lag);
diff --git a/drivers/net/ethernet/intel/ice/ice_vf_mbx.c b/drivers/net/ethernet/intel/ice/ice_vf_mbx.c
index 4bfed5fb3a88..1f332ab43b00 100644
--- a/drivers/net/ethernet/intel/ice/ice_vf_mbx.c
+++ b/drivers/net/ethernet/intel/ice/ice_vf_mbx.c
@@ -399,17 +399,3 @@ void ice_mbx_init_snapshot(struct ice_hw *hw)
 	INIT_LIST_HEAD(&snap->mbx_vf);
 	ice_mbx_reset_snapshot(snap);
 }
-
-/**
- * ice_mbx_deinit_snapshot - Free mailbox snapshot structure
- * @hw: pointer to the hardware structure
- *
- * Clear the mailbox snapshot structure and free the VF counter array.
- */
-void ice_mbx_deinit_snapshot(struct ice_hw *hw)
-{
-	struct ice_mbx_snapshot *snap = &hw->mbx_snapshot;
-
-	/* Clear mbx_buf in the mailbox snaphot structure */
-	memset(&snap->mbx_buf, 0, sizeof(snap->mbx_buf));
-}
diff --git a/drivers/net/ethernet/intel/ice/ice_vf_mbx.h b/drivers/net/ethernet/intel/ice/ice_vf_mbx.h
index a6d42f467dc5..e4bdd93ccef1 100644
--- a/drivers/net/ethernet/intel/ice/ice_vf_mbx.h
+++ b/drivers/net/ethernet/intel/ice/ice_vf_mbx.h
@@ -25,7 +25,6 @@ ice_mbx_vf_state_handler(struct ice_hw *hw, struct ice_mbx_data *mbx_data,
 void ice_mbx_clear_malvf(struct ice_mbx_vf_info *vf_info);
 void ice_mbx_init_vf_info(struct ice_hw *hw, struct ice_mbx_vf_info *vf_info);
 void ice_mbx_init_snapshot(struct ice_hw *hw);
-void ice_mbx_deinit_snapshot(struct ice_hw *hw);
 int
 ice_mbx_report_malvf(struct ice_hw *hw, struct ice_mbx_vf_info *vf_info,
 		     bool *report_malvf);
-- 
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-02-22 17:16 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-22 17:09 [Intel-wired-lan] [intel-next PATCH 00/14] ice: refactor mailbox overflow detection Jacob Keller
2023-02-22 17:09 ` [Intel-wired-lan] [intel-next PATCH 01/14] ice: re-order ice_mbx_reset_snapshot function Jacob Keller
2023-03-10 13:15   ` Szlosek, Marek
2023-02-22 17:09 ` [Intel-wired-lan] [intel-next PATCH 02/14] ice: convert ice_mbx_clear_malvf to void and use WARN Jacob Keller
2023-03-10 13:15   ` Szlosek, Marek
2023-02-22 17:09 ` [Intel-wired-lan] [intel-next PATCH 03/14] ice: track malicious VFs in new ice_mbx_vf_info structure Jacob Keller
2023-03-10 13:15   ` Szlosek, Marek
2023-02-22 17:09 ` [Intel-wired-lan] [intel-next PATCH 04/14] ice: move VF overflow message count into struct ice_mbx_vf_info Jacob Keller
2023-03-10 13:16   ` Szlosek, Marek
2023-02-22 17:09 ` Jacob Keller [this message]
2023-03-10 13:16   ` [Intel-wired-lan] [intel-next PATCH 05/14] ice: remove ice_mbx_deinit_snapshot Szlosek, Marek
2023-02-22 17:09 ` [Intel-wired-lan] [intel-next PATCH 06/14] ice: merge ice_mbx_report_malvf with ice_mbx_vf_state_handler Jacob Keller
2023-03-10 13:17   ` Szlosek, Marek
2023-02-22 17:09 ` [Intel-wired-lan] [intel-next PATCH 07/14] ice: initialize mailbox snapshot earlier in PF init Jacob Keller
2023-03-10 13:17   ` Szlosek, Marek
2023-02-22 17:09 ` [Intel-wired-lan] [intel-next PATCH 08/14] ice: declare ice_vc_process_vf_msg in ice_virtchnl.h Jacob Keller
2023-03-10 13:17   ` Szlosek, Marek
2023-02-22 17:09 ` [Intel-wired-lan] [intel-next PATCH 09/14] ice: always report VF overflowing mailbox even without PF VSI Jacob Keller
2023-03-10 13:17   ` Szlosek, Marek
2023-02-22 17:09 ` [Intel-wired-lan] [intel-next PATCH 10/14] ice: remove unnecessary &array[0] and just use array Jacob Keller
2023-03-10 13:18   ` Szlosek, Marek
2023-02-22 17:09 ` [Intel-wired-lan] [intel-next PATCH 11/14] ice: pass mbxdata to ice_is_malicious_vf() Jacob Keller
2023-03-10 13:18   ` Szlosek, Marek
2023-02-22 17:09 ` [Intel-wired-lan] [intel-next PATCH 12/14] ice: print message if ice_mbx_vf_state_handler returns an error Jacob Keller
2023-03-10 13:18   ` Szlosek, Marek
2023-02-22 17:09 ` [Intel-wired-lan] [intel-next PATCH 13/14] ice: move ice_is_malicious_vf() to ice_virtchnl.c Jacob Keller
2023-03-10 13:19   ` Szlosek, Marek
2023-02-22 17:09 ` [Intel-wired-lan] [intel-next PATCH 14/14] ice: call ice_is_malicious_vf() from ice_vc_process_vf_msg() Jacob Keller
2023-03-10 13:19   ` 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=20230222170920.1629293-6-jacob.e.keller@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jesse.brandeburg@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