diff options
author | David Ertman <david.m.ertman@intel.com> | 2016-09-20 10:10:50 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2016-10-27 17:08:56 -0400 |
commit | ea6acb7ef78960e4b6f1cd8c4162a5e490e83dcd (patch) | |
tree | e28fb1e880691eb96cec0824f59ebf1a82edda61 | |
parent | a3b8cb1f84a0de95323902c76bab245675d6d218 (diff) |
i40e: Fix configure TCs after initial DCB disable
in commit a036244c068612a43fa8c0f33a0eb4daa4d8dba0 a fix
was put into place to avoid a kernel panic when a non-
supported traffic class configuration was put into place
and then lldp was enabled/disabled on the link partner
switch. This fix caused it to be necessary to
unload/reload the driver to reenable DCB once a supported
TC config was in place.
The root cause of the original panic was that the function
i40e_pf_get_default_tc was allowing for a default TC other
than TC 0, and only TC 0 is supported as a default.
This patch removes the get_default_tc function and replaces
it with a #define since there is only one TC supported as
a default.
Change-Id: I448371974e946386d0a7718d73668b450b7c72ef
Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
Tested-by: Ronald Bynoe <ronald.j.bynoe@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_main.c | 31 |
2 files changed, 5 insertions, 27 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h index 2030d7c1dc94..6d61e443bdf8 100644 --- a/drivers/net/ethernet/intel/i40e/i40e.h +++ b/drivers/net/ethernet/intel/i40e/i40e.h | |||
@@ -92,6 +92,7 @@ | |||
92 | #define I40E_AQ_LEN 256 | 92 | #define I40E_AQ_LEN 256 |
93 | #define I40E_AQ_WORK_LIMIT 66 /* max number of VFs + a little */ | 93 | #define I40E_AQ_WORK_LIMIT 66 /* max number of VFs + a little */ |
94 | #define I40E_MAX_USER_PRIORITY 8 | 94 | #define I40E_MAX_USER_PRIORITY 8 |
95 | #define I40E_DEFAULT_TRAFFIC_CLASS BIT(0) | ||
95 | #define I40E_DEFAULT_MSG_ENABLE 4 | 96 | #define I40E_DEFAULT_MSG_ENABLE 4 |
96 | #define I40E_QUEUE_WAIT_RETRY_LIMIT 10 | 97 | #define I40E_QUEUE_WAIT_RETRY_LIMIT 10 |
97 | #define I40E_INT_NAME_STR_LEN (IFNAMSIZ + 16) | 98 | #define I40E_INT_NAME_STR_LEN (IFNAMSIZ + 16) |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index ac1faee2a5b8..050d005d2ede 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |||
@@ -4641,29 +4641,6 @@ static u8 i40e_pf_get_num_tc(struct i40e_pf *pf) | |||
4641 | } | 4641 | } |
4642 | 4642 | ||
4643 | /** | 4643 | /** |
4644 | * i40e_pf_get_default_tc - Get bitmap for first enabled TC | ||
4645 | * @pf: PF being queried | ||
4646 | * | ||
4647 | * Return a bitmap for first enabled traffic class for this PF. | ||
4648 | **/ | ||
4649 | static u8 i40e_pf_get_default_tc(struct i40e_pf *pf) | ||
4650 | { | ||
4651 | u8 enabled_tc = pf->hw.func_caps.enabled_tcmap; | ||
4652 | u8 i = 0; | ||
4653 | |||
4654 | if (!enabled_tc) | ||
4655 | return 0x1; /* TC0 */ | ||
4656 | |||
4657 | /* Find the first enabled TC */ | ||
4658 | for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) { | ||
4659 | if (enabled_tc & BIT(i)) | ||
4660 | break; | ||
4661 | } | ||
4662 | |||
4663 | return BIT(i); | ||
4664 | } | ||
4665 | |||
4666 | /** | ||
4667 | * i40e_pf_get_pf_tc_map - Get bitmap for enabled traffic classes | 4644 | * i40e_pf_get_pf_tc_map - Get bitmap for enabled traffic classes |
4668 | * @pf: PF being queried | 4645 | * @pf: PF being queried |
4669 | * | 4646 | * |
@@ -4673,7 +4650,7 @@ static u8 i40e_pf_get_tc_map(struct i40e_pf *pf) | |||
4673 | { | 4650 | { |
4674 | /* If DCB is not enabled for this PF then just return default TC */ | 4651 | /* If DCB is not enabled for this PF then just return default TC */ |
4675 | if (!(pf->flags & I40E_FLAG_DCB_ENABLED)) | 4652 | if (!(pf->flags & I40E_FLAG_DCB_ENABLED)) |
4676 | return i40e_pf_get_default_tc(pf); | 4653 | return I40E_DEFAULT_TRAFFIC_CLASS; |
4677 | 4654 | ||
4678 | /* SFP mode we want PF to be enabled for all TCs */ | 4655 | /* SFP mode we want PF to be enabled for all TCs */ |
4679 | if (!(pf->flags & I40E_FLAG_MFP_ENABLED)) | 4656 | if (!(pf->flags & I40E_FLAG_MFP_ENABLED)) |
@@ -4683,7 +4660,7 @@ static u8 i40e_pf_get_tc_map(struct i40e_pf *pf) | |||
4683 | if (pf->hw.func_caps.iscsi) | 4660 | if (pf->hw.func_caps.iscsi) |
4684 | return i40e_get_iscsi_tc_map(pf); | 4661 | return i40e_get_iscsi_tc_map(pf); |
4685 | else | 4662 | else |
4686 | return i40e_pf_get_default_tc(pf); | 4663 | return I40E_DEFAULT_TRAFFIC_CLASS; |
4687 | } | 4664 | } |
4688 | 4665 | ||
4689 | /** | 4666 | /** |
@@ -5029,7 +5006,7 @@ static void i40e_dcb_reconfigure(struct i40e_pf *pf) | |||
5029 | if (v == pf->lan_vsi) | 5006 | if (v == pf->lan_vsi) |
5030 | tc_map = i40e_pf_get_tc_map(pf); | 5007 | tc_map = i40e_pf_get_tc_map(pf); |
5031 | else | 5008 | else |
5032 | tc_map = i40e_pf_get_default_tc(pf); | 5009 | tc_map = I40E_DEFAULT_TRAFFIC_CLASS; |
5033 | #ifdef I40E_FCOE | 5010 | #ifdef I40E_FCOE |
5034 | if (pf->vsi[v]->type == I40E_VSI_FCOE) | 5011 | if (pf->vsi[v]->type == I40E_VSI_FCOE) |
5035 | tc_map = i40e_get_fcoe_tc_map(pf); | 5012 | tc_map = i40e_get_fcoe_tc_map(pf); |
@@ -5717,7 +5694,7 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf, | |||
5717 | u8 type; | 5694 | u8 type; |
5718 | 5695 | ||
5719 | /* Not DCB capable or capability disabled */ | 5696 | /* Not DCB capable or capability disabled */ |
5720 | if (!(pf->flags & I40E_FLAG_DCB_ENABLED)) | 5697 | if (!(pf->flags & I40E_FLAG_DCB_CAPABLE)) |
5721 | return ret; | 5698 | return ret; |
5722 | 5699 | ||
5723 | /* Ignore if event is not for Nearest Bridge */ | 5700 | /* Ignore if event is not for Nearest Bridge */ |