diff mbox series

[net,09/13] ice: remove DCBNL_DEVRESET bit from PF state

Message ID 20210226211932.46683-9-anthony.l.nguyen@intel.com
State Accepted
Delegated to: Anthony Nguyen
Headers show
Series [net,01/13] ice: Fix allowing VF to request more/less queues via virtchnl | expand

Commit Message

Tony Nguyen Feb. 26, 2021, 9:19 p.m. UTC
From: Dave Ertman <david.m.ertman@intel.com>

The original purpose of the ICE_DCBNL_DEVRESET was to protect
the driver during DCBNL device resets.  But, the flow for
DCBNL device resets now consists of only calls up the stack
such as dev_close() and dev_open() that will result in NDO calls
to the driver.  These will be handled with state changes from the
stack.  Also, there is a problem of the dev_close and dev_open
being blocked by checks for reset in progress also using the
ICE_DCBNL_DEVRESET bit.

Since the ICE_DCBNL_DEVRESET bit is not necessary for protecting
the driver from DCBNL device resets and it is actually blocking
changes coming form the DCBNL interface, remove the bit from the
PF state and don't block driver function based on DCBNL reset in
progress.

Fixes: b94b013eb626 ("ice: Implement DCBNL support")
Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
---
 drivers/net/ethernet/intel/ice/ice.h        | 1 -
 drivers/net/ethernet/intel/ice/ice_dcb_nl.c | 2 --
 drivers/net/ethernet/intel/ice/ice_lib.c    | 1 -
 3 files changed, 4 deletions(-)

Comments

Brelinski, TonyX March 22, 2021, 11:58 p.m. UTC | #1
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Tony Nguyen
> Sent: Friday, February 26, 2021 1:19 PM
> To: intel-wired-lan@lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH net 09/13] ice: remove DCBNL_DEVRESET
> bit from PF state
> 
> From: Dave Ertman <david.m.ertman@intel.com>
> 
> The original purpose of the ICE_DCBNL_DEVRESET was to protect the driver
> during DCBNL device resets.  But, the flow for DCBNL device resets now
> consists of only calls up the stack such as dev_close() and dev_open() that
> will result in NDO calls to the driver.  These will be handled with state changes
> from the stack.  Also, there is a problem of the dev_close and dev_open
> being blocked by checks for reset in progress also using the
> ICE_DCBNL_DEVRESET bit.
> 
> Since the ICE_DCBNL_DEVRESET bit is not necessary for protecting the driver
> from DCBNL device resets and it is actually blocking changes coming form the
> DCBNL interface, remove the bit from the PF state and don't block driver
> function based on DCBNL reset in progress.
> 
> Fixes: b94b013eb626 ("ice: Implement DCBNL support")
> Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice.h        | 1 -
>  drivers/net/ethernet/intel/ice/ice_dcb_nl.c | 2 --
>  drivers/net/ethernet/intel/ice/ice_lib.c    | 1 -
>  3 files changed, 4 deletions(-)

Tested-by: Tony Brelinski <tonyx.brelinski@intel.com> A Contingent Worker at Intel
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h
index ae1c3a3b0780..522c7aa61cc7 100644
--- a/drivers/net/ethernet/intel/ice/ice.h
+++ b/drivers/net/ethernet/intel/ice/ice.h
@@ -193,7 +193,6 @@  enum ice_state {
 	__ICE_NEEDS_RESTART,
 	__ICE_PREPARED_FOR_RESET,	/* set by driver when prepared */
 	__ICE_RESET_OICR_RECV,		/* set by driver after rcv reset OICR */
-	__ICE_DCBNL_DEVRESET,		/* set by dcbnl devreset */
 	__ICE_PFR_REQ,			/* set by driver and peers */
 	__ICE_CORER_REQ,		/* set by driver and peers */
 	__ICE_GLOBR_REQ,		/* set by driver and peers */
diff --git a/drivers/net/ethernet/intel/ice/ice_dcb_nl.c b/drivers/net/ethernet/intel/ice/ice_dcb_nl.c
index 468a63f7eff9..4180f1f35fb8 100644
--- a/drivers/net/ethernet/intel/ice/ice_dcb_nl.c
+++ b/drivers/net/ethernet/intel/ice/ice_dcb_nl.c
@@ -18,12 +18,10 @@  static void ice_dcbnl_devreset(struct net_device *netdev)
 	while (ice_is_reset_in_progress(pf->state))
 		usleep_range(1000, 2000);
 
-	set_bit(__ICE_DCBNL_DEVRESET, pf->state);
 	dev_close(netdev);
 	netdev_state_change(netdev);
 	dev_open(netdev, NULL);
 	netdev_state_change(netdev);
-	clear_bit(__ICE_DCBNL_DEVRESET, pf->state);
 }
 
 /**
diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
index 638304abef73..d5b9ac620b06 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -3080,7 +3080,6 @@  int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi)
 bool ice_is_reset_in_progress(unsigned long *state)
 {
 	return test_bit(__ICE_RESET_OICR_RECV, state) ||
-	       test_bit(__ICE_DCBNL_DEVRESET, state) ||
 	       test_bit(__ICE_PFR_REQ, state) ||
 	       test_bit(__ICE_CORER_REQ, state) ||
 	       test_bit(__ICE_GLOBR_REQ, state);