aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/ice_sched.c
diff options
context:
space:
mode:
authorAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>2019-02-28 18:24:24 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2019-04-18 11:38:47 -0400
commit7b9ffc76bf5998aad8feaa26d9d3fcb65ec7a21b (patch)
tree9935f6c7b53786d7f9ce06d804aa4a42ce541ec4 /drivers/net/ethernet/intel/ice/ice_sched.c
parent0ebd3ff13ccad2940516ba522ca8d21cea4f56f6 (diff)
ice: Add code for DCB initialization part 3/4
This patch adds a new function ice_pf_dcb_cfg (and related helpers) which applies the DCB configuration obtained from the firmware. As part of this, VSIs/netdevs are updated with traffic class information. This patch requires a bit of a refactor of existing code. 1. For a MIB change event, the associated VSI is closed and brought up again. The gap between closing and opening the VSI can cause a race condition. Fix this by grabbing the rtnl_lock prior to closing the VSI and then only free it after re-opening the VSI during a MIB change event. 2. ice_sched_query_elem is used in ice_sched.c and with this patch, in ice_dcb.c as well. However, ice_dcb.c is not built when CONFIG_DCB is unset. This results in namespace warnings (ice_sched.o: Externally defined symbols with no external references) when CONFIG_DCB is unset. To avoid this move ice_sched_query_elem from ice_sched.c to ice_common.c. 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.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_sched.c b/drivers/net/ethernet/intel/ice/ice_sched.c
index 3d1c941a938e..124feaf0e730 100644
--- a/drivers/net/ethernet/intel/ice/ice_sched.c
+++ b/drivers/net/ethernet/intel/ice/ice_sched.c
@@ -127,7 +127,7 @@ ice_aqc_send_sched_elem_cmd(struct ice_hw *hw, enum ice_adminq_opc cmd_opc,
127 * 127 *
128 * Query scheduling elements (0x0404) 128 * Query scheduling elements (0x0404)
129 */ 129 */
130static enum ice_status 130enum ice_status
131ice_aq_query_sched_elems(struct ice_hw *hw, u16 elems_req, 131ice_aq_query_sched_elems(struct ice_hw *hw, u16 elems_req,
132 struct ice_aqc_get_elem *buf, u16 buf_size, 132 struct ice_aqc_get_elem *buf, u16 buf_size,
133 u16 *elems_ret, struct ice_sq_cd *cd) 133 u16 *elems_ret, struct ice_sq_cd *cd)
@@ -138,31 +138,6 @@ ice_aq_query_sched_elems(struct ice_hw *hw, u16 elems_req,
138} 138}
139 139
140/** 140/**
141 * ice_sched_query_elem - query element information from HW
142 * @hw: pointer to the HW struct
143 * @node_teid: node TEID to be queried
144 * @buf: buffer to element information
145 *
146 * This function queries HW element information
147 */
148static enum ice_status
149ice_sched_query_elem(struct ice_hw *hw, u32 node_teid,
150 struct ice_aqc_get_elem *buf)
151{
152 u16 buf_size, num_elem_ret = 0;
153 enum ice_status status;
154
155 buf_size = sizeof(*buf);
156 memset(buf, 0, buf_size);
157 buf->generic[0].node_teid = cpu_to_le32(node_teid);
158 status = ice_aq_query_sched_elems(hw, 1, buf, buf_size, &num_elem_ret,
159 NULL);
160 if (status || num_elem_ret != 1)
161 ice_debug(hw, ICE_DBG_SCHED, "query element failed\n");
162 return status;
163}
164
165/**
166 * ice_sched_add_node - Insert the Tx scheduler node in SW DB 141 * ice_sched_add_node - Insert the Tx scheduler node in SW DB
167 * @pi: port information structure 142 * @pi: port information structure
168 * @layer: Scheduler layer of the node 143 * @layer: Scheduler layer of the node