diff options
author | Neerav Parikh <neerav.parikh@intel.com> | 2014-05-22 02:31:51 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2014-06-11 11:48:15 -0400 |
commit | 4d9b604353e65824e49a01ecf2b3f3bf329e6048 (patch) | |
tree | edf27d7532495753e169ad21af32b722e14d9dae | |
parent | ddf0b3a63e31ddc40712d151ea27ef86c5acb06a (diff) |
i40e: Separate out DCB capability and enabled flags
Currently if the firmware reports DCB capability the driver enables
I40E_FLAG_DCB_ENABLED flag. When this flag is enabled the driver
inserts a tag when transmitting a packet from the port even if there
are no DCB traffic classes configured at the port.
This patch adds a new flag I40E_FLAG_DCB_CAPABLE that will be set
when the DCB capability is present and the existing flag
I40E_FLAG_DCB_ENABLED will be set only if there are more than one
traffic classes configured at the port.
Change-ID: I24ccbf53ef293db2eba80c8a9772acf729795bd5
Signed-off-by: Neerav Parikh <neerav.parikh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_main.c | 30 |
3 files changed, 25 insertions, 10 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h index fc1bd1094397..5a8bbaafe500 100644 --- a/drivers/net/ethernet/intel/i40e/i40e.h +++ b/drivers/net/ethernet/intel/i40e/i40e.h | |||
@@ -264,6 +264,7 @@ struct i40e_pf { | |||
264 | #ifdef CONFIG_I40E_VXLAN | 264 | #ifdef CONFIG_I40E_VXLAN |
265 | #define I40E_FLAG_VXLAN_FILTER_SYNC (u64)(1 << 27) | 265 | #define I40E_FLAG_VXLAN_FILTER_SYNC (u64)(1 << 27) |
266 | #endif | 266 | #endif |
267 | #define I40E_FLAG_DCB_CAPABLE (u64)(1 << 29) | ||
267 | 268 | ||
268 | /* tracks features that get auto disabled by errors */ | 269 | /* tracks features that get auto disabled by errors */ |
269 | u64 auto_disable_flags; | 270 | u64 auto_disable_flags; |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c b/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c index 871831a535d0..00bc0cdb3a03 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c +++ b/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c | |||
@@ -302,8 +302,8 @@ void i40e_dcbnl_setup(struct i40e_vsi *vsi) | |||
302 | struct net_device *dev = vsi->netdev; | 302 | struct net_device *dev = vsi->netdev; |
303 | struct i40e_pf *pf = i40e_netdev_to_pf(dev); | 303 | struct i40e_pf *pf = i40e_netdev_to_pf(dev); |
304 | 304 | ||
305 | /* DCB not enabled */ | 305 | /* Not DCB capable */ |
306 | if (!(pf->flags & I40E_FLAG_DCB_ENABLED)) | 306 | if (!(pf->flags & I40E_FLAG_DCB_CAPABLE)) |
307 | return; | 307 | return; |
308 | 308 | ||
309 | /* Do not setup DCB NL ops for MFP mode */ | 309 | /* Do not setup DCB NL ops for MFP mode */ |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 145cb9fc1516..676bebb97f6e 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |||
@@ -4130,7 +4130,11 @@ static int i40e_init_pf_dcb(struct i40e_pf *pf) | |||
4130 | /* When status is not DISABLED then DCBX in FW */ | 4130 | /* When status is not DISABLED then DCBX in FW */ |
4131 | pf->dcbx_cap = DCB_CAP_DCBX_LLD_MANAGED | | 4131 | pf->dcbx_cap = DCB_CAP_DCBX_LLD_MANAGED | |
4132 | DCB_CAP_DCBX_VER_IEEE; | 4132 | DCB_CAP_DCBX_VER_IEEE; |
4133 | pf->flags |= I40E_FLAG_DCB_ENABLED; | 4133 | |
4134 | pf->flags |= I40E_FLAG_DCB_CAPABLE; | ||
4135 | /* Enable DCB tagging only when more than one TC */ | ||
4136 | if (i40e_dcb_get_num_tc(&hw->local_dcbx_config) > 1) | ||
4137 | pf->flags |= I40E_FLAG_DCB_ENABLED; | ||
4134 | } | 4138 | } |
4135 | } else { | 4139 | } else { |
4136 | dev_info(&pf->pdev->dev, "AQ Querying DCB configuration failed: %d\n", | 4140 | dev_info(&pf->pdev->dev, "AQ Querying DCB configuration failed: %d\n", |
@@ -4685,6 +4689,10 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf, | |||
4685 | int ret = 0; | 4689 | int ret = 0; |
4686 | u8 type; | 4690 | u8 type; |
4687 | 4691 | ||
4692 | /* Not DCB capable or capability disabled */ | ||
4693 | if (!(pf->flags & I40E_FLAG_DCB_CAPABLE)) | ||
4694 | return ret; | ||
4695 | |||
4688 | /* Ignore if event is not for Nearest Bridge */ | 4696 | /* Ignore if event is not for Nearest Bridge */ |
4689 | type = ((mib->type >> I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT) | 4697 | type = ((mib->type >> I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT) |
4690 | & I40E_AQ_LLDP_BRIDGE_TYPE_MASK); | 4698 | & I40E_AQ_LLDP_BRIDGE_TYPE_MASK); |
@@ -4726,6 +4734,12 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf, | |||
4726 | if (!need_reconfig) | 4734 | if (!need_reconfig) |
4727 | goto exit; | 4735 | goto exit; |
4728 | 4736 | ||
4737 | /* Enable DCB tagging only when more than one TC */ | ||
4738 | if (i40e_dcb_get_num_tc(dcbx_cfg) > 1) | ||
4739 | pf->flags |= I40E_FLAG_DCB_ENABLED; | ||
4740 | else | ||
4741 | pf->flags &= ~I40E_FLAG_DCB_ENABLED; | ||
4742 | |||
4729 | /* Reconfiguration needed quiesce all VSIs */ | 4743 | /* Reconfiguration needed quiesce all VSIs */ |
4730 | i40e_pf_quiesce_all_vsi(pf); | 4744 | i40e_pf_quiesce_all_vsi(pf); |
4731 | 4745 | ||
@@ -6365,7 +6379,7 @@ static void i40e_init_interrupt_scheme(struct i40e_pf *pf) | |||
6365 | if (err) { | 6379 | if (err) { |
6366 | pf->flags &= ~(I40E_FLAG_MSIX_ENABLED | | 6380 | pf->flags &= ~(I40E_FLAG_MSIX_ENABLED | |
6367 | I40E_FLAG_RSS_ENABLED | | 6381 | I40E_FLAG_RSS_ENABLED | |
6368 | I40E_FLAG_DCB_ENABLED | | 6382 | I40E_FLAG_DCB_CAPABLE | |
6369 | I40E_FLAG_SRIOV_ENABLED | | 6383 | I40E_FLAG_SRIOV_ENABLED | |
6370 | I40E_FLAG_FD_SB_ENABLED | | 6384 | I40E_FLAG_FD_SB_ENABLED | |
6371 | I40E_FLAG_FD_ATR_ENABLED | | 6385 | I40E_FLAG_FD_ATR_ENABLED | |
@@ -8187,13 +8201,13 @@ static void i40e_determine_queue_usage(struct i40e_pf *pf) | |||
8187 | pf->flags &= ~(I40E_FLAG_RSS_ENABLED | | 8201 | pf->flags &= ~(I40E_FLAG_RSS_ENABLED | |
8188 | I40E_FLAG_FD_SB_ENABLED | | 8202 | I40E_FLAG_FD_SB_ENABLED | |
8189 | I40E_FLAG_FD_ATR_ENABLED | | 8203 | I40E_FLAG_FD_ATR_ENABLED | |
8190 | I40E_FLAG_DCB_ENABLED | | 8204 | I40E_FLAG_DCB_CAPABLE | |
8191 | I40E_FLAG_SRIOV_ENABLED | | 8205 | I40E_FLAG_SRIOV_ENABLED | |
8192 | I40E_FLAG_VMDQ_ENABLED); | 8206 | I40E_FLAG_VMDQ_ENABLED); |
8193 | } else if (!(pf->flags & (I40E_FLAG_RSS_ENABLED | | 8207 | } else if (!(pf->flags & (I40E_FLAG_RSS_ENABLED | |
8194 | I40E_FLAG_FD_SB_ENABLED | | 8208 | I40E_FLAG_FD_SB_ENABLED | |
8195 | I40E_FLAG_FD_ATR_ENABLED | | 8209 | I40E_FLAG_FD_ATR_ENABLED | |
8196 | I40E_FLAG_DCB_ENABLED))) { | 8210 | I40E_FLAG_DCB_CAPABLE))) { |
8197 | /* one qp for PF */ | 8211 | /* one qp for PF */ |
8198 | pf->rss_size = pf->num_lan_qps = 1; | 8212 | pf->rss_size = pf->num_lan_qps = 1; |
8199 | queues_left -= pf->num_lan_qps; | 8213 | queues_left -= pf->num_lan_qps; |
@@ -8205,9 +8219,9 @@ static void i40e_determine_queue_usage(struct i40e_pf *pf) | |||
8205 | I40E_FLAG_VMDQ_ENABLED); | 8219 | I40E_FLAG_VMDQ_ENABLED); |
8206 | } else { | 8220 | } else { |
8207 | /* Not enough queues for all TCs */ | 8221 | /* Not enough queues for all TCs */ |
8208 | if ((pf->flags & I40E_FLAG_DCB_ENABLED) && | 8222 | if ((pf->flags & I40E_FLAG_DCB_CAPABLE) && |
8209 | (queues_left < I40E_MAX_TRAFFIC_CLASS)) { | 8223 | (queues_left < I40E_MAX_TRAFFIC_CLASS)) { |
8210 | pf->flags &= ~I40E_FLAG_DCB_ENABLED; | 8224 | pf->flags &= ~I40E_FLAG_DCB_CAPABLE; |
8211 | dev_info(&pf->pdev->dev, "not enough queues for DCB. DCB is disabled.\n"); | 8225 | dev_info(&pf->pdev->dev, "not enough queues for DCB. DCB is disabled.\n"); |
8212 | } | 8226 | } |
8213 | pf->num_lan_qps = pf->rss_size_max; | 8227 | pf->num_lan_qps = pf->rss_size_max; |
@@ -8300,7 +8314,7 @@ static void i40e_print_features(struct i40e_pf *pf) | |||
8300 | buf += sprintf(buf, "FD_SB "); | 8314 | buf += sprintf(buf, "FD_SB "); |
8301 | buf += sprintf(buf, "NTUPLE "); | 8315 | buf += sprintf(buf, "NTUPLE "); |
8302 | } | 8316 | } |
8303 | if (pf->flags & I40E_FLAG_DCB_ENABLED) | 8317 | if (pf->flags & I40E_FLAG_DCB_CAPABLE) |
8304 | buf += sprintf(buf, "DCB "); | 8318 | buf += sprintf(buf, "DCB "); |
8305 | if (pf->flags & I40E_FLAG_PTP) | 8319 | if (pf->flags & I40E_FLAG_PTP) |
8306 | buf += sprintf(buf, "PTP "); | 8320 | buf += sprintf(buf, "PTP "); |
@@ -8486,7 +8500,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
8486 | err = i40e_init_pf_dcb(pf); | 8500 | err = i40e_init_pf_dcb(pf); |
8487 | if (err) { | 8501 | if (err) { |
8488 | dev_info(&pdev->dev, "init_pf_dcb failed: %d\n", err); | 8502 | dev_info(&pdev->dev, "init_pf_dcb failed: %d\n", err); |
8489 | pf->flags &= ~I40E_FLAG_DCB_ENABLED; | 8503 | pf->flags &= ~I40E_FLAG_DCB_CAPABLE; |
8490 | /* Continue without DCB enabled */ | 8504 | /* Continue without DCB enabled */ |
8491 | } | 8505 | } |
8492 | #endif /* CONFIG_I40E_DCB */ | 8506 | #endif /* CONFIG_I40E_DCB */ |