diff options
| author | Victor Raj <victor.raj@intel.com> | 2019-02-26 16:35:13 -0800 | 
|---|---|---|
| committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2019-03-22 08:19:17 -0700 | 
| commit | e1ca65a3cceacc94dd9cde388016422ca2e15a54 (patch) | |
| tree | 0f0b96c1940ffef75408903b599cdb4b32c2ec79 /drivers/net/ethernet/intel/ice/ice_sched.c | |
| parent | eb86b0949183c5005ed33e57788d05d90bb72a5a (diff) | |
ice: code cleanup in ice_sched.c
This patch does some clean up in the Tx scheduler code:
1. Adjust the stack variable usage
2. Modify the debug prints to display the FW error
3. Add additional debug prints while adding/removing VSIs
Signed-off-by: Victor Raj <victor.raj@intel.com>
Reviewed-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_sched.c')
| -rw-r--r-- | drivers/net/ethernet/intel/ice/ice_sched.c | 17 | 
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_sched.c b/drivers/net/ethernet/intel/ice/ice_sched.c index 086a4c7254c5..cf1142ec16ee 100644 --- a/drivers/net/ethernet/intel/ice/ice_sched.c +++ b/drivers/net/ethernet/intel/ice/ice_sched.c @@ -276,7 +276,8 @@ ice_sched_remove_elems(struct ice_hw *hw, struct ice_sched_node *parent,  	status = ice_aq_delete_sched_elems(hw, 1, buf, buf_size,  					   &num_groups_removed, NULL);  	if (status || num_groups_removed != 1) -		ice_debug(hw, ICE_DBG_SCHED, "remove elements failed\n"); +		ice_debug(hw, ICE_DBG_SCHED, "remove node failed FW error %d\n", +			  hw->adminq.sq_last_status);  	devm_kfree(ice_hw_to_dev(hw), buf);  	return status; @@ -360,12 +361,8 @@ void ice_free_sched_node(struct ice_port_info *pi, struct ice_sched_node *node)  	    node->info.data.elem_type != ICE_AQC_ELEM_TYPE_ROOT_PORT &&  	    node->info.data.elem_type != ICE_AQC_ELEM_TYPE_LEAF) {  		u32 teid = le32_to_cpu(node->info.node_teid); -		enum ice_status status; -		status = ice_sched_remove_elems(hw, node->parent, 1, &teid); -		if (status) -			ice_debug(hw, ICE_DBG_SCHED, -				  "remove element failed %d\n", status); +		ice_sched_remove_elems(hw, node->parent, 1, &teid);  	}  	parent = node->parent;  	/* root has no parent */ @@ -697,7 +694,8 @@ ice_sched_add_elems(struct ice_port_info *pi, struct ice_sched_node *tc_node,  	status = ice_aq_add_sched_elems(hw, 1, buf, buf_size,  					&num_groups_added, NULL);  	if (status || num_groups_added != 1) { -		ice_debug(hw, ICE_DBG_SCHED, "add elements failed\n"); +		ice_debug(hw, ICE_DBG_SCHED, "add node failed FW Error %d\n", +			  hw->adminq.sq_last_status);  		devm_kfree(ice_hw_to_dev(hw), buf);  		return ICE_ERR_CFG;  	} @@ -1527,6 +1525,7 @@ ice_sched_cfg_vsi(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 maxqs,  	enum ice_status status = 0;  	struct ice_hw *hw = pi->hw; +	ice_debug(pi->hw, ICE_DBG_SCHED, "add/config VSI %d\n", vsi_handle);  	tc_node = ice_sched_get_tc_node(pi, tc);  	if (!tc_node)  		return ICE_ERR_PARAM; @@ -1646,8 +1645,9 @@ ice_sched_rm_vsi_cfg(struct ice_port_info *pi, u16 vsi_handle, u8 owner)  {  	enum ice_status status = ICE_ERR_PARAM;  	struct ice_vsi_ctx *vsi_ctx; -	u8 i, j = 0; +	u8 i; +	ice_debug(pi->hw, ICE_DBG_SCHED, "removing VSI %d\n", vsi_handle);  	if (!ice_is_vsi_valid(pi->hw, vsi_handle))  		return status;  	mutex_lock(&pi->sched_lock); @@ -1657,6 +1657,7 @@ ice_sched_rm_vsi_cfg(struct ice_port_info *pi, u16 vsi_handle, u8 owner)  	for (i = 0; i < ICE_MAX_TRAFFIC_CLASS; i++) {  		struct ice_sched_node *vsi_node, *tc_node; +		u8 j = 0;  		tc_node = ice_sched_get_tc_node(pi, i);  		if (!tc_node)  | 
