aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/ice_common.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_common.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_common.c')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_common.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c
index 3730daf1bc1a..2937c6be1aee 100644
--- a/drivers/net/ethernet/intel/ice/ice_common.c
+++ b/drivers/net/ethernet/intel/ice/ice_common.c
@@ -3106,3 +3106,28 @@ ice_stat_update32(struct ice_hw *hw, u32 reg, bool prev_stat_loaded,
3106 /* to manage the potential roll-over */ 3106 /* to manage the potential roll-over */
3107 *cur_stat = (new_data + BIT_ULL(32)) - *prev_stat; 3107 *cur_stat = (new_data + BIT_ULL(32)) - *prev_stat;
3108} 3108}
3109
3110/**
3111 * ice_sched_query_elem - query element information from HW
3112 * @hw: pointer to the HW struct
3113 * @node_teid: node TEID to be queried
3114 * @buf: buffer to element information
3115 *
3116 * This function queries HW element information
3117 */
3118enum ice_status
3119ice_sched_query_elem(struct ice_hw *hw, u32 node_teid,
3120 struct ice_aqc_get_elem *buf)
3121{
3122 u16 buf_size, num_elem_ret = 0;
3123 enum ice_status status;
3124
3125 buf_size = sizeof(*buf);
3126 memset(buf, 0, buf_size);
3127 buf->generic[0].node_teid = cpu_to_le32(node_teid);
3128 status = ice_aq_query_sched_elems(hw, 1, buf, buf_size, &num_elem_ret,
3129 NULL);
3130 if (status || num_elem_ret != 1)
3131 ice_debug(hw, ICE_DBG_SCHED, "query element failed\n");
3132 return status;
3133}