Skip to contentSkip to conversation

ice: Do not get coalesce settings while in reset

PATCH Superseded Dawid Osuchowski 2 participants 3 messages May 6, 2024 – Jun 6, 2024

Subsystems (3)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 ice: Do not get coalesce settings while in reset

From: Ngai-Mint Kwan <[email protected]>

Getting coalesce settings while reset is in progress can cause NULL pointer deference bug.
If under reset, abort get coalesce for ethtool.

Fixes 67fe64d78c43 ("ice: Implement getting and setting ethtool coalesce")

---
Changes since v1:
* Added "Fixes:" tag
Changes since v2:
* Rebased over current IWL net branch
* Confirmed that the issue previously reported for this patch [1] by Himasekhar Reddy Pucha was caused by other, internally tracked issue Changes since v3:
* Using ice_wait_for_reset() instead of returning -EBUSY

[1] https://lore.kernel.org/netdev/BL0PR11MB3122D70ABDE6C2ACEE376073BD90A@BL0PR11MB3122.namprd11.prod.outlook.com/

---
 drivers/net/ethernet/intel/ice/ice_ethtool.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/net/ethernet/intel/ice/ice_ethtool.c +7 -0
index d91f41f61bce..4ff16fd2eb94 100644
@@ -3815,6 +3815,13 @@ __ice_get_coalesce(struct net_device *netdev, struct ethtool_coalesce *ec,
 	struct ice_netdev_priv *np = netdev_priv(netdev);
 	struct ice_vsi *vsi = np->vsi;
 
+	if (ice_is_reset_in_progress(vsi->back->state)) {
+		int err = ice_wait_for_reset(vsi->back, 10 * HZ);
+
+		if (err)
+			return err;
+	}
+
 	if (q_num < 0)
 		q_num = 0;
 
Signature · 1 line
2.44.0
maintainer
#1 lore raw
Quoted 13 lines · Dawid Osuchowski

From: Ngai-Mint Kwan <[email protected]>

Getting coalesce settings while reset is in progress can cause NULL pointer deference bug.
If under reset, abort get coalesce for ethtool.

Fixes 67fe64d78c43 ("ice: Implement getting and setting ethtool coalesce")
Quoted 9 lines

---
Changes since v1:
* Added "Fixes:" tag
Changes since v2:
* Rebased over current IWL net branch
* Confirmed that the issue previously reported for this patch [1] by Himasekhar Reddy Pucha was caused by other, internally tracked issue Changes since v3:
* Using ice_wait_for_reset() instead of returning -EBUSY

Seems like commit message, and probably title, need to get updated for this change?

Quoted 23 lines

[1] https://lore.kernel.org/netdev/BL0PR11MB3122D70ABDE6C2ACEE376073BD90A@BL0PR11MB3122.namprd11.prod.outlook.com/

---
  drivers/net/ethernet/intel/ice/ice_ethtool.c | 7 +++++++
  1 file changed, 7 insertions(+)
drivers/net/ethernet/intel/ice/ice_ethtool.c +7 -0
index d91f41f61bce..4ff16fd2eb94 100644
@@ -3815,6 +3815,13 @@ __ice_get_coalesce(struct net_device *netdev, struct ethtool_coalesce *ec,
  	struct ice_netdev_priv *np = netdev_priv(netdev);
  	struct ice_vsi *vsi = np->vsi;
 
+	if (ice_is_reset_in_progress(vsi->back->state)) {
+		int err = ice_wait_for_reset(vsi->back, 10 * HZ);
+
+		if (err)
+			return err;
+	}
+
  	if (q_num < 0)
  		q_num = 0;
 
#2 lore raw
Quoted 1 line · Tony Nguyen

Seems like commit message, and probably title, need to get updated for this change?

During testing of the change, it turns out at the current state our driver is in we have to use the approach with returning -EBUSY. Will update the description in v5 to account for this.

--Dawid