iavf: Fix error when changing ring parameters on ice PF
Subsystems (2)
PATCH v2 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.
---
v2: Changed unnecessary parentheses
--
--- drivers/net/ethernet/intel/iavf/iavf_ethtool.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ethernet/intel/iavf/iavf_ethtool.c +5 -0
@@ -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
Tony Nguyen
maintainerPATCH v2 1/1 iavf: Fix error when changing ring parameters on ice PF
Quoted 10 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_ringparamfor adapter and VF's queue state. If VF is currently resetting or queues are disabled for the VF return with EAGAIN error.
Quoted 5 lines
Fixes d732a1844507 ("i40evf: fix crash when changing ring sizes")Signed-off-by Sylwester Dziedziuch <[email protected]>Signed-off-by Michal Maloszewski <[email protected]>---
v2: Changed unnecessary parentheses
This does not address any of the comments on the netdev patch [1]. If you're making changes, it would be good acknowledge that on the netdev patch.
Also, why the change from net to net-next?
Thanks,
Tony
[1] https://lore.kernel.org/netdev/20220422154752.1fab6496 at kernel.org/
Maloszewski
PATCH v2 1/1 iavf: Fix error when changing ring parameters on ice PF
Please discard these changes. I accidentally used net-next in git patch format, that's why it has been sent to next-net instead of net. I will correct it asap.
Thanks,
Micha? Ma?oszewski
-----Original Message-----
From: Nguyen, Anthony L <[email protected]>
Sent: Tuesday, April 26, 2022 10:39 PM
To: Maloszewski, Michal <[email protected]>; intel-wired-lan at lists.osuosl.org
Cc: Sylwester Dziedziuch <[email protected]>
Subject: Re: [Intel-wired-lan] [PATCH net-next v2] iavf: Fix error when changing ring parameters on ice PF
Quoted 10 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_ringparamfor adapter and VF's queue state. If VF is currently resetting or queues are disabled for the VF return with EAGAIN error.
Quoted 5 lines
Fixes d732a1844507 ("i40evf: fix crash when changing ring sizes")Signed-off-by Sylwester Dziedziuch <[email protected]>Signed-off-by Michal Maloszewski <[email protected]>---
v2: Changed unnecessary parentheses
This does not address any of the comments on the netdev patch [1]. If you're making changes, it would be good acknowledge that on the netdev patch.
Also, why the change from net to net-next?
Thanks,
Tony
[1] https://lore.kernel.org/netdev/20220422154752.1fab6496 at kernel.org/