All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH net-next v2] iavf: Fix error when changing ring parameters on ice PF
@ 2022-04-26 20:37 Michal Maloszewski
  2022-04-26 20:38 ` Tony Nguyen
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Maloszewski @ 2022-04-26 20:37 UTC (permalink / raw)
  To: intel-wired-lan

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")
Signed-off-by: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
Signed-off-by: Michal Maloszewski <michal.maloszewski@intel.com>
---
v2: Changed unnecessary parentheses
--
---
 drivers/net/ethernet/intel/iavf/iavf_ethtool.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
index 3bb56714beb0..a27df8af5cff 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
@@ -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 ||
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] iavf: Fix error when changing ring parameters on ice PF
  2022-04-26 20:37 [Intel-wired-lan] [PATCH net-next v2] iavf: Fix error when changing ring parameters on ice PF Michal Maloszewski
@ 2022-04-26 20:38 ` Tony Nguyen
  2022-04-27  9:23   ` Maloszewski, Michal
  0 siblings, 1 reply; 3+ messages in thread
From: Tony Nguyen @ 2022-04-26 20:38 UTC (permalink / raw)
  To: intel-wired-lan


On 4/26/2022 1:37 PM, Michal Maloszewski wrote:
> 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")
> Signed-off-by: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
> Signed-off-by: Michal Maloszewski <michal.maloszewski@intel.com>
> ---
> 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/


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] iavf: Fix error when changing ring parameters on ice PF
  2022-04-26 20:38 ` Tony Nguyen
@ 2022-04-27  9:23   ` Maloszewski, Michal
  0 siblings, 0 replies; 3+ messages in thread
From: Maloszewski, Michal @ 2022-04-27  9:23 UTC (permalink / raw)
  To: intel-wired-lan

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 <anthony.l.nguyen@intel.com> 
Sent: Tuesday, April 26, 2022 10:39 PM
To: Maloszewski, Michal <michal.maloszewski@intel.com>; intel-wired-lan at lists.osuosl.org
Cc: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
Subject: Re: [Intel-wired-lan] [PATCH net-next v2] iavf: Fix error when changing ring parameters on ice PF


On 4/26/2022 1:37 PM, Michal Maloszewski wrote:
> 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")
> Signed-off-by: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
> Signed-off-by: Michal Maloszewski <michal.maloszewski@intel.com>
> ---
> 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/


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-27  9:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26 20:37 [Intel-wired-lan] [PATCH net-next v2] iavf: Fix error when changing ring parameters on ice PF Michal Maloszewski
2022-04-26 20:38 ` Tony Nguyen
2022-04-27  9:23   ` Maloszewski, Michal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.