aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e.h1
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c9
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_main.c15
3 files changed, 14 insertions, 11 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index e4e963af28b5..27d1d92b2ce4 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -726,6 +726,7 @@ void i40e_fcoe_handle_status(struct i40e_ring *rx_ring,
726void i40e_vlan_stripping_enable(struct i40e_vsi *vsi); 726void i40e_vlan_stripping_enable(struct i40e_vsi *vsi);
727#ifdef CONFIG_I40E_DCB 727#ifdef CONFIG_I40E_DCB
728void i40e_dcbnl_flush_apps(struct i40e_pf *pf, 728void i40e_dcbnl_flush_apps(struct i40e_pf *pf,
729 struct i40e_dcbx_config *old_cfg,
729 struct i40e_dcbx_config *new_cfg); 730 struct i40e_dcbx_config *new_cfg);
730void i40e_dcbnl_set_all(struct i40e_vsi *vsi); 731void i40e_dcbnl_set_all(struct i40e_vsi *vsi);
731void i40e_dcbnl_setup(struct i40e_vsi *vsi); 732void i40e_dcbnl_setup(struct i40e_vsi *vsi);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c b/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c
index 183dcb63ce98..f4070b5d33d6 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c
@@ -269,22 +269,21 @@ static bool i40e_dcbnl_find_app(struct i40e_dcbx_config *cfg,
269/** 269/**
270 * i40e_dcbnl_flush_apps - Delete all removed APPs 270 * i40e_dcbnl_flush_apps - Delete all removed APPs
271 * @pf: the corresponding pf 271 * @pf: the corresponding pf
272 * @old_cfg: old DCBX configuration data
272 * @new_cfg: new DCBX configuration data 273 * @new_cfg: new DCBX configuration data
273 * 274 *
274 * Find and delete all APPs that are not present in the passed 275 * Find and delete all APPs that are not present in the passed
275 * DCB configuration 276 * DCB configuration
276 **/ 277 **/
277void i40e_dcbnl_flush_apps(struct i40e_pf *pf, 278void i40e_dcbnl_flush_apps(struct i40e_pf *pf,
279 struct i40e_dcbx_config *old_cfg,
278 struct i40e_dcbx_config *new_cfg) 280 struct i40e_dcbx_config *new_cfg)
279{ 281{
280 struct i40e_dcb_app_priority_table app; 282 struct i40e_dcb_app_priority_table app;
281 struct i40e_dcbx_config *dcbxcfg;
282 struct i40e_hw *hw = &pf->hw;
283 int i; 283 int i;
284 284
285 dcbxcfg = &hw->local_dcbx_config; 285 for (i = 0; i < old_cfg->numapps; i++) {
286 for (i = 0; i < dcbxcfg->numapps; i++) { 286 app = old_cfg->app[i];
287 app = dcbxcfg->app[i];
288 /* The APP is not available anymore delete it */ 287 /* The APP is not available anymore delete it */
289 if (!i40e_dcbnl_find_app(new_cfg, &app)) 288 if (!i40e_dcbnl_find_app(new_cfg, &app))
290 i40e_dcbnl_del_app(pf, &app); 289 i40e_dcbnl_del_app(pf, &app);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 4fb05b4c02b3..fae83ac8c822 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -5166,7 +5166,6 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf,
5166 struct i40e_aqc_lldp_get_mib *mib = 5166 struct i40e_aqc_lldp_get_mib *mib =
5167 (struct i40e_aqc_lldp_get_mib *)&e->desc.params.raw; 5167 (struct i40e_aqc_lldp_get_mib *)&e->desc.params.raw;
5168 struct i40e_hw *hw = &pf->hw; 5168 struct i40e_hw *hw = &pf->hw;
5169 struct i40e_dcbx_config *dcbx_cfg = &hw->local_dcbx_config;
5170 struct i40e_dcbx_config tmp_dcbx_cfg; 5169 struct i40e_dcbx_config tmp_dcbx_cfg;
5171 bool need_reconfig = false; 5170 bool need_reconfig = false;
5172 int ret = 0; 5171 int ret = 0;
@@ -5199,8 +5198,10 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf,
5199 5198
5200 memset(&tmp_dcbx_cfg, 0, sizeof(tmp_dcbx_cfg)); 5199 memset(&tmp_dcbx_cfg, 0, sizeof(tmp_dcbx_cfg));
5201 /* Store the old configuration */ 5200 /* Store the old configuration */
5202 tmp_dcbx_cfg = *dcbx_cfg; 5201 memcpy(&tmp_dcbx_cfg, &hw->local_dcbx_config, sizeof(tmp_dcbx_cfg));
5203 5202
5203 /* Reset the old DCBx configuration data */
5204 memset(&hw->local_dcbx_config, 0, sizeof(hw->local_dcbx_config));
5204 /* Get updated DCBX data from firmware */ 5205 /* Get updated DCBX data from firmware */
5205 ret = i40e_get_dcb_config(&pf->hw); 5206 ret = i40e_get_dcb_config(&pf->hw);
5206 if (ret) { 5207 if (ret) {
@@ -5209,20 +5210,22 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf,
5209 } 5210 }
5210 5211
5211 /* No change detected in DCBX configs */ 5212 /* No change detected in DCBX configs */
5212 if (!memcmp(&tmp_dcbx_cfg, dcbx_cfg, sizeof(tmp_dcbx_cfg))) { 5213 if (!memcmp(&tmp_dcbx_cfg, &hw->local_dcbx_config,
5214 sizeof(tmp_dcbx_cfg))) {
5213 dev_dbg(&pf->pdev->dev, "No change detected in DCBX configuration.\n"); 5215 dev_dbg(&pf->pdev->dev, "No change detected in DCBX configuration.\n");
5214 goto exit; 5216 goto exit;
5215 } 5217 }
5216 5218
5217 need_reconfig = i40e_dcb_need_reconfig(pf, &tmp_dcbx_cfg, dcbx_cfg); 5219 need_reconfig = i40e_dcb_need_reconfig(pf, &tmp_dcbx_cfg,
5220 &hw->local_dcbx_config);
5218 5221
5219 i40e_dcbnl_flush_apps(pf, dcbx_cfg); 5222 i40e_dcbnl_flush_apps(pf, &tmp_dcbx_cfg, &hw->local_dcbx_config);
5220 5223
5221 if (!need_reconfig) 5224 if (!need_reconfig)
5222 goto exit; 5225 goto exit;
5223 5226
5224 /* Enable DCB tagging only when more than one TC */ 5227 /* Enable DCB tagging only when more than one TC */
5225 if (i40e_dcb_get_num_tc(dcbx_cfg) > 1) 5228 if (i40e_dcb_get_num_tc(&hw->local_dcbx_config) > 1)
5226 pf->flags |= I40E_FLAG_DCB_ENABLED; 5229 pf->flags |= I40E_FLAG_DCB_ENABLED;
5227 else 5230 else
5228 pf->flags &= ~I40E_FLAG_DCB_ENABLED; 5231 pf->flags &= ~I40E_FLAG_DCB_ENABLED;