Skip to contentSkip to conversation

iavf: Fix error when changing ring parameters on ice PF

PATCH Superseded Michal Maloszewski 3 participants 3 messages Mar 31, 2022 – Apr 12, 2022

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iavf: Fix error when changing ring parameters on ice PF

Reset is triggered when ring parameters are being changed through ethtool and queues are reconfigured for VF's VSI. If ring is changed again immediately, then the next reset could be executed before queues could be properly reinitialized on VF's VSI. It caused ice PF to mess up the VSI resource tree.

Add a check in iavf_set_ringparam for adapter and VF's queue state. If VF is currently resetting or queues are disabled for the VF return with EAGAIN error.

Fixes d732a1844507 ("i40evf: fix crash when changing ring sizes")
---
 drivers/net/ethernet/intel/iavf/iavf_ethtool.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/ethernet/intel/iavf/iavf_ethtool.c +5 -0
index 3bb56714beb0..8213bf3f8dfc 100644
@@ -631,6 +631,11 @@ static int iavf_set_ringparam(struct net_device *netdev,
 	if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
 		return -EINVAL;
 
+	if ((adapter->state == __IAVF_RESETTING) ||
+	    ((adapter->state == __IAVF_RUNNING) &&
+	     (adapter->flags & IAVF_FLAG_QUEUES_DISABLED)))
+		return -EAGAIN;
+
 	if (ring->tx_pending > IAVF_MAX_TXD ||
 	    ring->tx_pending < IAVF_MIN_TXD ||
 	    ring->rx_pending > IAVF_MAX_RXD ||
Signature · 1 line
2.27.0
maintainer
#1 lore raw

PATCH 1/1 iavf: Fix error when changing ring parameters on ice PF

Quoted 9 lines · Michal Maloszewski

Reset is triggered when ring parameters are being changed through ethtool and queues are reconfigured for VF's VSI. If ring is changed again immediately, then the next reset could be executed before queues could be properly reinitialized on VF's VSI. It caused ice PF to mess up the VSI resource tree.

Add a check in iavf_set_ringparam for adapter and VF's queue state. If VF is currently resetting or queues are disabled for the VF return with EAGAIN error.

You've sent this three times as all v1. For the future, please increment the version and document the changes between them.

https://patchwork.ozlabs.org/project/intel-wired-lan/patch/20220331111526.1333801-1-michal.maloszewski at intel.com/

https://patchwork.ozlabs.org/project/intel-wired-lan/patch/20220330200551.1319989-1-michal.maloszewski at intel.com/

https://patchwork.ozlabs.org/project/intel-wired-lan/patch/20220330195036.1319631-1-michal.maloszewski at intel.com/

#2 lore raw

PATCH 1/1 iavf: Fix error when changing ring parameters on ice PF

In reply to Michal Maloszewski

drivers/net/ethernet/intel/iavf/iavf_ethtool.c static int iavf_set_ringparam(struct net_device

Quoted 35 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Michal Maloszewski
Sent: Thursday, March 31, 2022 1:15 PM
To: intel-wired-lan at lists.osuosl.org
Cc: Sylwester Dziedziuch <[email protected]>; Maloszewski, Michal <[email protected]>
Subject: [Intel-wired-lan] [PATCH net v1] iavf: Fix error when changing ring parameters on ice PF

Reset is triggered when ring parameters are being changed through ethtool and queues are reconfigured for VF's VSI. If ring is changed again immediately, then the next reset could be executed before queues could be properly reinitialized on VF's VSI. It caused ice PF to mess up the VSI resource tree.

Add a check in iavf_set_ringparam for adapter and VF's queue state. If VF is currently resetting or queues are disabled for the VF return with EAGAIN error.

Fixes d732a1844507 ("i40evf: fix crash when changing ring sizes")
---
 drivers/net/ethernet/intel/iavf/iavf_ethtool.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/ethernet/intel/iavf/iavf_ethtool.c +0 -0
index 3bb56714beb0..8213bf3f8dfc 100644
@@ -631,6 +631,11 @@ static int iavf_set_ringparam(struct net_device