ice: Fix spurious interrupt during removal of trusted VF
Subsystems (2)
PATCH 1/1 ice: Fix spurious interrupt during removal of trusted VF
From: Norbert Zulinski <[email protected]>
Previously, during removal of trusted VF when VF is down there was number of spurious interrupt equal to number of queues on VF.
Add check if VF already has inactive queues. If VF is disabled and has inactive rx queues then do not disable rx queues. Add check in ice_vsi_stop_tx_ring if it's VF's vsi and if VF is disabled.
--- drivers/net/ethernet/intel/ice/ice_base.c | 2 +- drivers/net/ethernet/intel/ice/ice_lib.c | 25 +++++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_lib.h | 1 + drivers/net/ethernet/intel/ice/ice_vf_lib.c | 5 ++++- 4 files changed, 31 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/ice/ice_base.c +1 -1
@@ -959,7 +959,7 @@ ice_vsi_stop_tx_ring(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src,* associated to the queue to schedule NAPI handler */ q_vector = ring->q_vector; -if (q_vector) +if (q_vector && !(vsi->vf &&ice_is_vf_disabled (vsi->vf)))ice_trigger_sw_intr (hw, q_vector); status = ice_dis_vsi_txq(vsi->port_info, txq_meta->vsi_idx,
drivers/net/ethernet/intel/ice/ice_lib.c +25 -0
@@ -2222,6 +2222,31 @@ int ice_vsi_stop_xdp_tx_rings(struct ice_vsi *vsi)return ice_vsi_stop_tx_rings (vsi,ICE_NO_RESET ,0 , vsi->xdp_rings, vsi->num_xdp_txq); } +/** +* ice_vsi_is_rx_queue_active +* @vsi: the VSI being configured +* +* Return true if at least one queue is active. +*/ +bool ice_vsi_is_rx_queue_active (struct ice_vsi *vsi) +{ +struct ice_pf *pf = vsi->back; +struct ice_hw *hw = &pf->hw; +int i =0 ; + +for (i =0 ; i < vsi->num_rxq; i++) { +int pf_q; +u32 rx_reg; + + pf_q = vsi->rxq_map[i]; + rx_reg =rd32 (hw,QRX_CTRL (pf_q)); +if (rx_reg &QRX_CTRL_QENA_STAT_M ) +return true; + } + +return false; +} +/** * ice_vsi_is_vlan_pruning_ena - check if VLAN pruning is enabled or not * @vsi: VSI to check whether or not VLAN pruning is enabled.
drivers/net/ethernet/intel/ice/ice_lib.h +1 -0
@@ -127,4 +127,5 @@ u16 ice_vsi_num_non_zero_vlans(struct ice_vsi *vsi);bool ice_is_feature_supported (struct ice_pf *pf,enum ice_feature f);void ice_clear_feature_support (struct ice_pf *pf,enum ice_feature f);void ice_init_feature_support (struct ice_pf *pf); +bool ice_vsi_is_rx_queue_active (struct ice_vsi *vsi);#endif /* !_ICE_LIB_H_ */
drivers/net/ethernet/intel/ice/ice_vf_lib.c +4 -1
@@ -576,7 +576,10 @@ int ice_reset_vf(struct ice_vf *vf, u32 flags)return -EINVAL ; }ice_vsi_stop_lan_tx_rings (vsi,ICE_NO_RESET , vf->vf_id); -ice_vsi_stop_all_rx_rings (vsi); + +if (ice_vsi_is_rx_queue_active (vsi)) +ice_vsi_stop_all_rx_rings (vsi); +dev_dbg (dev,"VF is already disabled, there is no need for resetting it, telling VM, all is fine %d\n" , vf->vf_id);return 0 ;
Signature · 6 lines
2.31.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Tony Nguyen
maintainerQuoted 42 lines · Mateusz Palczewski
From: Norbert Zulinski <[email protected]>
Previously, during removal of trusted VF when VF is down there was number of spurious interrupt equal to number of queues on VF.
Add check if VF already has inactive queues. If VF is disabled and has inactive rx queues then do not disable rx queues. Add check in
ice_vsi_stop_tx_ringif it's VF's vsi and if VF is disabled.Fixes efe41860008e ("ice: Fix memory corruption in VF driver")Signed-off-by Norbert Zulinski <[email protected]>Signed-off-by Mateusz Palczewski <[email protected]>--- drivers/net/ethernet/intel/ice/ice_base.c | 2 +- drivers/net/ethernet/intel/ice/ice_lib.c | 25 +++++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_lib.h | 1 + drivers/net/ethernet/intel/ice/ice_vf_lib.c | 5 ++++- 4 files changed, 31 insertions(+), 2 deletions(-)drivers/net/ethernet/intel/ice/ice_base.c +1
-1@@ -959,7 +959,7 @@ ice_vsi_stop_tx_ring(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src,* associated to the queue to schedule NAPI handler */ q_vector = ring->q_vector; -if (q_vector) +if (q_vector && !(vsi->vf &&ice_is_vf_disabled (vsi->vf)))ice_trigger_sw_intr (hw, q_vector); status = ice_dis_vsi_txq(vsi->port_info, txq_meta->vsi_idx,drivers/net/ethernet/intel/ice/ice_lib.c +1
-0@@ -2222,6 +2222,31 @@ int ice_vsi_stop_xdp_tx_rings(struct ice_vsi *vsi)return ice_vsi_stop_tx_rings (vsi,ICE_NO_RESET ,0 , vsi->xdp_rings, vsi->num_xdp_txq); } +/**
drivers/net/ethernet/intel/ice/ice_lib.c int ice_vsi_stop_xdp_tx_rings(struct ice_vsi *vsi) · line 2235
Quoted 10 lines
drivers/net/ethernet/intel/ice/ice_lib.c +10
-0+* ice_vsi_is_rx_queue_active +* @vsi: the VSI being configured +* +* Return true if at least one queue is active. +*/ +bool ice_vsi_is_rx_queue_active (struct ice_vsi *vsi) +{ +struct ice_pf *pf = vsi->back; +struct ice_hw *hw = &pf->hw; +int i =0 ;
This doesn't need to be initialized.
drivers/net/ethernet/intel/ice/ice_lib.c int ice_vsi_stop_xdp_tx_rings(struct ice_vsi *vsi) · line 2237
Quoted 2 lines
drivers/net/ethernet/intel/ice/ice_lib.c +2
-0+ +for (i =0 ; i < vsi->num_rxq; i++) {
ice_for_each_rxq can be used here
drivers/net/ethernet/intel/ice/ice_lib.c int ice_vsi_stop_xdp_tx_rings(struct ice_vsi *vsi) · line 2239
Quoted 2 lines
drivers/net/ethernet/intel/ice/ice_lib.c +2
-0+int pf_q; +u32 rx_reg;
RCT on these please.
Quoted 29 lines
drivers/net/ethernet/intel/ice/ice_lib.c +10
-0+ + pf_q = vsi->rxq_map[i]; + rx_reg =rd32 (hw,QRX_CTRL (pf_q)); +if (rx_reg &QRX_CTRL_QENA_STAT_M ) +return true; + } + +return false; +} +/** * ice_vsi_is_vlan_pruning_ena - check if VLAN pruning is enabled or not * @vsi: VSI to check whether or not VLAN pruning is enabled. drivers/net/ethernet/intel/ice/ice_lib.h +1
-0@@ -127,4 +127,5 @@ u16 ice_vsi_num_non_zero_vlans(struct ice_vsi *vsi);bool ice_is_feature_supported (struct ice_pf *pf,enum ice_feature f);void ice_clear_feature_support (struct ice_pf *pf,enum ice_feature f);void ice_init_feature_support (struct ice_pf *pf); +bool ice_vsi_is_rx_queue_active (struct ice_vsi *vsi);#endif /* !_ICE_LIB_H_ */ drivers/net/ethernet/intel/ice/ice_vf_lib.c +0
-0@@ -576,7 +576,10 @@ int ice_reset_vf(struct ice_vf *vf, u32 flags)return -EINVAL ;
drivers/net/ethernet/intel/ice/ice_vf_lib.c int ice_reset_vf(struct ice_vf *vf, u32 flags) · line 585
Quoted 10 lines
drivers/net/ethernet/intel/ice/ice_vf_lib.c +4
-1}ice_vsi_stop_lan_tx_rings (vsi,ICE_NO_RESET , vf->vf_id); -ice_vsi_stop_all_rx_rings (vsi); + +if (ice_vsi_is_rx_queue_active (vsi)) +ice_vsi_stop_all_rx_rings (vsi); +dev_dbg (dev,"VF is already disabled, there is no need for resetting it, telling VM, all is fine %d\n" , vf->vf_id);return 0 ;
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan