i40e: Fix configure TCs after initial DCB disable
Subsystems (2)
PATCH 1/1 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.
--- drivers/net/ethernet/intel/i40e/i40e.h | 1 + drivers/net/ethernet/intel/i40e/i40e_main.c | 31 ++++------------------------- 2 files changed, 5 insertions(+), 27 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +1 -0
@@ -92,6 +92,7 @@#define I40E_AQ_LEN 256#define I40E_AQ_WORK_LIMIT 66/* max number of VFs + a little */ #define I40E_MAX_USER_PRIORITY 8 +#define I40E_DEFAULT_TRAFFIC_CLASS BIT(0)#define I40E_DEFAULT_MSG_ENABLE 4#define I40E_QUEUE_WAIT_RETRY_LIMIT 10#define I40E_INT_NAME_STR_LEN (IFNAMSIZ + 16)
drivers/net/ethernet/intel/i40e/i40e_main.c +4 -27
@@ -4643,29 +4643,6 @@ static u8 i40e_pf_get_num_tc(struct i40e_pf *pf) }/** -* i40e_pf_get_default_tc - Get bitmap for first enabled TC -* @pf: PF being queried -* -* Return a bitmap for first enabled traffic class for this PF. -**/ -static u8 i40e_pf_get_default_tc (struct i40e_pf *pf) -{ -u8 enabled_tc = pf->hw.func_caps.enabled_tcmap; -u8 i =0 ; - -if (!enabled_tc) -return 0x1 ;/* TC0 */ - -/* Find the first enabled TC */ -for (i =0 ; i <I40E_MAX_TRAFFIC_CLASS ; i++) { -if (enabled_tc &BIT (i)) -break ; - } - -return BIT (i); -} - -/** * i40e_pf_get_pf_tc_map - Get bitmap for enabled traffic classes * @pf: PF being queried *
@@ -4675,7 +4652,7 @@ static u8 i40e_pf_get_tc_map(struct i40e_pf *pf) {/* If DCB is not enabled for this PF then just return default TC */ if (!(pf->flags &I40E_FLAG_DCB_ENABLED )) -return i40e_pf_get_default_tc (pf); +return I40E_DEFAULT_TRAFFIC_CLASS ;/* SFP mode we want PF to be enabled for all TCs */ if (!(pf->flags &I40E_FLAG_MFP_ENABLED ))
@@ -4685,7 +4662,7 @@ static u8 i40e_pf_get_tc_map(struct i40e_pf *pf)if (pf->hw.func_caps.iscsi)return i40e_get_iscsi_tc_map (pf);else -return i40e_pf_get_default_tc (pf); +return I40E_DEFAULT_TRAFFIC_CLASS ; }/**
@@ -5031,7 +5008,7 @@ static void i40e_dcb_reconfigure(struct i40e_pf *pf)if (v == pf->lan_vsi) tc_map =i40e_pf_get_tc_map (pf);else - tc_map =i40e_pf_get_default_tc (pf); + tc_map =I40E_DEFAULT_TRAFFIC_CLASS ;#ifdef I40E_FCOE if (pf->vsi[v]->type ==I40E_VSI_FCOE ) tc_map =i40e_get_fcoe_tc_map (pf);
@@ -5719,7 +5696,7 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf,u8 type;/* Not DCB capable or capability disabled */ -if (!(pf->flags &I40E_FLAG_DCB_ENABLED )) +if (!(pf->flags &I40E_FLAG_DCB_CAPABLE ))return ret;/* Ignore if event is not for Nearest Bridge */
Signature · 1 line
2.7.4
Bynoe
PATCH 1/1 i40e: Fix configure TCs after initial DCB disable
Quoted 16 lines · Dave Ertman
in commit
a036244c068612a43fa8c0f33a0eb4daa4d8dba0a 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_tcwas allowing for a default TC other than TC 0, and only TC 0 is supported as a default.This patch removes the
get_default_tcfunction and replaces it with a #define since there is only one TC supported as a default.
Quoted 7 lines
Change-Id I448371974e946386d0a7718d73668b450b7c72efSigned-off-by Dave Ertman <[email protected]>---
?drivers/net/ethernet/intel/i40e/i40e.h??????|??1 + ?drivers/net/ethernet/intel/i40e/i40e_main.c | 31 ++++---------------
----------
?2 files changed, 5 insertions(+), 27 deletions(-)