[S24,v2,06/12] ice: Copy dcbx configuration only if mode is correct
diff mbox series

Message ID 20190729090454.5501-6-anthony.l.nguyen@intel.com
State Under Review
Delegated to: Jeff Kirsher
Headers show
Series
  • [S24,v2,01/12] ice: Allow egress control packets from PF_VSI
Related show

Commit Message

Tony Nguyen July 29, 2019, 9:04 a.m. UTC
From: Michal Swiatkowski <michal.swiatkowski@intel.com>

In rebuild DCB desired_dcbx_cfg was copy to local_dcbx_cfg, but
if DCBX mode is IEEE desired_dcbx_cfg is not initialized by DCBX
config from FW. Change logic to copy config value only if mode is
set to CEE.

If driver copy desired_dcbx_cfg to local_dcbx_cfg in IEEE mode there
is problem with globr. System is frozen after two or more globr.

Signed-off-by: Michal Swiatkowski <michal.swiatkowski@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Bowers, AndrewX July 31, 2019, 5:10 p.m. UTC | #1
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@osuosl.org] On
> Behalf Of Tony Nguyen
> Sent: Monday, July 29, 2019 2:05 AM
> To: intel-wired-lan@lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH S24 v2 06/12] ice: Copy dcbx configuration
> only if mode is correct
> 
> From: Michal Swiatkowski <michal.swiatkowski@intel.com>
> 
> In rebuild DCB desired_dcbx_cfg was copy to local_dcbx_cfg, but if DCBX
> mode is IEEE desired_dcbx_cfg is not initialized by DCBX config from FW.
> Change logic to copy config value only if mode is set to CEE.
> 
> If driver copy desired_dcbx_cfg to local_dcbx_cfg in IEEE mode there is
> problem with globr. System is frozen after two or more globr.
> 
> Signed-off-by: Michal Swiatkowski <michal.swiatkowski@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>

Patch
diff mbox series

diff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c
index 9ab9ec1ce19e..2a868eea2a37 100644
--- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c
@@ -339,8 +339,10 @@  void ice_dcb_rebuild(struct ice_pf *pf)
 	devm_kfree(&pf->pdev->dev, prev_cfg);
 
 	/* Set the local desired config */
-	memset(&pf->hw.port_info->local_dcbx_cfg, 0, sizeof(*local_dcbx_cfg));
-	memcpy(local_dcbx_cfg, desired_dcbx_cfg, sizeof(*local_dcbx_cfg));
+	if (local_dcbx_cfg->dcbx_mode == ICE_DCBX_MODE_CEE)
+		memcpy(local_dcbx_cfg, desired_dcbx_cfg,
+		       sizeof(*local_dcbx_cfg));
+
 	ice_cfg_etsrec_defaults(pf->hw.port_info);
 	ret = ice_set_dcb_cfg(pf->hw.port_info);
 	if (ret) {