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>
This commit is contained in:
committed by
Jeff Kirsher
parent
0ebd3ff13c
commit
7b9ffc76bf
@@ -3106,3 +3106,28 @@ ice_stat_update32(struct ice_hw *hw, u32 reg, bool prev_stat_loaded,
|
||||
/* to manage the potential roll-over */
|
||||
*cur_stat = (new_data + BIT_ULL(32)) - *prev_stat;
|
||||
}
|
||||
|
||||
/**
|
||||
* ice_sched_query_elem - query element information from HW
|
||||
* @hw: pointer to the HW struct
|
||||
* @node_teid: node TEID to be queried
|
||||
* @buf: buffer to element information
|
||||
*
|
||||
* This function queries HW element information
|
||||
*/
|
||||
enum ice_status
|
||||
ice_sched_query_elem(struct ice_hw *hw, u32 node_teid,
|
||||
struct ice_aqc_get_elem *buf)
|
||||
{
|
||||
u16 buf_size, num_elem_ret = 0;
|
||||
enum ice_status status;
|
||||
|
||||
buf_size = sizeof(*buf);
|
||||
memset(buf, 0, buf_size);
|
||||
buf->generic[0].node_teid = cpu_to_le32(node_teid);
|
||||
status = ice_aq_query_sched_elems(hw, 1, buf, buf_size, &num_elem_ret,
|
||||
NULL);
|
||||
if (status || num_elem_ret != 1)
|
||||
ice_debug(hw, ICE_DBG_SCHED, "query element failed\n");
|
||||
return status;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user