Skip to contentSkip to conversation

ice: remove msleep from reading PR stats

PATCH New Michal Swiatkowski 1 participant 1 message Aug 18, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ice: remove msleep from reading PR stats

Calling msleep in context of reading PR statistics in case of having maximum number on VFs on machine leads to strange call trace in rcu_note_context_switch.

msleep function is called in ice_check_vf_ready_for_cfg.

As waiting for reset isn't needed in case of getting stats, change this function to ice_is_vf_disabled to check if VF is running or not.

---
This commit should be squashed with "ice: Fix crash in switchdev mode during VFR"

 drivers/net/ethernet/intel/ice/ice_repr.c        | 2 +-
 drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 2 +-
 drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h | 7 +++++++
 3 files changed, 9 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/ice/ice_repr.c +1 -1
index 8fd90ac661b1..c49eeea7cb67 100644
@@ -52,7 +52,7 @@ ice_repr_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats)
 	struct ice_eth_stats *eth_stats;
 	struct ice_vsi *vsi;
 
-	if (ice_check_vf_ready_for_cfg(np->repr->vf))
+	if (ice_is_vf_disabled(np->repr->vf))
 		return;
 	vsi = np->repr->src_vsi;
 
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +1 -1
index 0ed7f1ec6172..0bb8b64d1c1c 100644
@@ -1533,7 +1533,7 @@ bool ice_reset_all_vfs(struct ice_pf *pf, bool is_vflr)
  *
  * Returns true if the PF or VF is disabled, false otherwise.
  */
-static bool ice_is_vf_disabled(struct ice_vf *vf)
+bool ice_is_vf_disabled(struct ice_vf *vf)
 {
 	struct ice_pf *pf = vf->pf;
 
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h +7 -0
index 9c2cad78231f..9de19cc97f48 100644
@@ -183,6 +183,8 @@ int ice_set_vf_link_state(struct net_device *netdev, int vf_id, int link_state);
 
 int ice_check_vf_ready_for_cfg(struct ice_vf *vf);
 
+bool ice_is_vf_disabled(struct ice_vf *vf);
+
 int ice_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool ena);
 
 int ice_calc_vf_reg_idx(struct ice_vf *vf, struct ice_q_vector *q_vector);
@@ -216,6 +218,11 @@ static inline int ice_check_vf_ready_for_cfg(struct ice_vf *vf)
 {
 	return -EOPNOTSUPP;
 }
+
+static inline bool ice_is_vf_disabled(struct ice_vf *vf)
+{
+	return true;
+}
 static inline void ice_vc_set_dflt_vf_ops(struct ice_vc_vf_ops *ops) { }
 static inline void ice_set_vf_state_qs_dis(struct ice_vf *vf) { }
 static inline
Signature · 1 line
2.31.1