net/ice: base code update for RC2
cover net/ice: base code update for RC2
A number of small fixes and other changes to enable Tx scheduler enhancements to our DPDK driver have been added to the base code. Upstream these changes for 24.11 RC2. Most have previously been submitted as part of the scheduler changes [1]
[1] https://patches.dpdk.org/project/dpdk/list/?series=32758&state=*
Bruce Richardson (6):
net/ice/base: remove 255 limit on sched child nodes net/ice/base: set VSI index on newly created nodes net/ice/base: optimize subtree searches net/ice/base: remove flag checks before topology upload net/ice/base: allow init without TC class sched nodes net/ice/base: read VSI layer info from VSI
Dave Ertman (1):
net/ice/base: fix VLAN replay after reset
Fabio Pricoco (1):
net/ice/base: add bounds check
Jacob Keller (1):
net/ice/base: re-enable bypass mode for E822
drivers/net/ice/base/ice_controlq.c | 23 +++++- drivers/net/ice/base/ice_dcb.c | 3 +- drivers/net/ice/base/ice_ddp.c | 33 -------- drivers/net/ice/base/ice_ptp_hw.c | 117 ++++++++++++++++++++++++++-- drivers/net/ice/base/ice_ptp_hw.h | 2 +- drivers/net/ice/base/ice_sched.c | 59 +++++++------- drivers/net/ice/base/ice_switch.c | 2 - drivers/net/ice/base/ice_type.h | 3 +- drivers/net/ice/ice_ethdev.c | 2 +- 9 files changed, 168 insertions(+), 76 deletions(-)
--
2.43.0
PATCH 1/9 net/ice/base: re-enable bypass mode for E822
From: Jacob Keller <[email protected]>
When removing bypass mode, the code for E822 bypass was completely removed in error. This code should be maintained in DPDK so re-add the necessary functions.
--- drivers/net/ice/base/ice_ptp_hw.c | 117 ++++++++++++++++++++++++++++-- drivers/net/ice/base/ice_ptp_hw.h | 2 +- drivers/net/ice/ice_ethdev.c | 2 +- 3 files changed, 113 insertions(+), 8 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +111 -6
@@ -4468,18 +4468,103 @@ ice_stop_phy_timer_e822(struct ice_hw *hw, u8 port, bool soft_reset)return 0 ; } +/** +* ice_phy_cfg_fixed_tx_offset_e822 - Configure Tx offset for bypass mode +* @hw: pointer to the HW struct +* @port: the PHY port to configure +* +* Calculate and program the fixed Tx offset, and indicate that the offset is +* ready. This can be used when operating in bypass mode. +*/ +static int ice_phy_cfg_fixed_tx_offset_e822 (struct ice_hw *hw,u8 port) +{ +enum ice_ptp_link_spd link_spd; +enum ice_ptp_fec_mode fec_mode; +u64 total_offset; +int err; + + err =ice_phy_get_speed_and_fec_e822 (hw, port, &link_spd, &fec_mode); +if (err) +return err; + + total_offset =ice_calc_fixed_tx_offset_e822 (hw, link_spd); + +/* Program the fixed Tx offset into the P_REG_TOTAL_TX_OFFSET_L +* register, then indicate that the Tx offset is ready. After this, +* timestamps will be enabled. +* +* Note that this skips including the more precise offsets generated +* by the Vernier calibration. +*/ + + err =ice_write_64b_phy_reg_e822 (hw, port,P_REG_TOTAL_TX_OFFSET_L , + total_offset); +if (err) +return err; + + err =ice_write_phy_reg_e822 (hw, port,P_REG_TX_OR ,1 ); +if (err) +return err; + +return ICE_SUCCESS ; +} + +/** +* ice_phy_cfg_rx_offset_e822 - Configure fixed Rx offset for bypass mode +* @hw: pointer to the HW struct +* @port: the PHY port to configure +* +* Calculate and program the fixed Rx offset, and indicate that the offset is +* ready. This can be used when operating in bypass mode. +*/ +static int ice_phy_cfg_fixed_rx_offset_e822 (struct ice_hw *hw,u8 port) +{ +enum ice_ptp_link_spd link_spd; +enum ice_ptp_fec_mode fec_mode; +u64 total_offset; +int err; + + err =ice_phy_get_speed_and_fec_e822 (hw, port, &link_spd, &fec_mode); +if (err) +return err; + + total_offset =ice_calc_fixed_rx_offset_e822 (hw, link_spd); + +/* Program the fixed Rx offset into the P_REG_TOTAL_RX_OFFSET_L +* register, then indicate that the Rx offset is ready. After this, +* timestamps will be enabled. +* +* Note that this skips including the more precise offsets generated +* by Vernier calibration. +*/ + err =ice_write_64b_phy_reg_e822 (hw, port,P_REG_TOTAL_RX_OFFSET_L , + total_offset); +if (err) +return err; + + err =ice_write_phy_reg_e822 (hw, port,P_REG_RX_OR ,1 ); +if (err) +return err; + +return ICE_SUCCESS ; +} +/** * ice_start_phy_timer_e822 - Start the PHY clock timer * @hw: pointer to the HW struct * @port: the PHY port to start +* @bypass: if true, start the PHY in bypass mode * * Start the clock of a PHY port. This must be done as part of the flow to * re-calibrate Tx and Rx timestamping offsets whenever the clock time is * initialized or when link speed changes. * -* Hardware will take Vernier measurements on Tx or Rx of packets. +* Bypass mode enables timestamps immediately without waiting for Vernier +* calibration to complete. Hardware will still continue taking Vernier +* measurements on Tx or Rx of packets, but they will not be applied to +* timestamps. */ -int ice_start_phy_timer_e822 (struct ice_hw *hw,u8 port) +int ice_start_phy_timer_e822 (struct ice_hw *hw,u8 port,bool bypass) {u32 lo, hi, val;u64 incval;
@@ -4544,15 +4629,35 @@ int ice_start_phy_timer_e822(struct ice_hw *hw, u8 port)ice_ptp_exec_tmr_cmd (hw); +if (bypass) { +/* Enter BYPASS mode, enabling timestamps immediately. */ + val |=P_REG_PS_BYPASS_MODE_M ; + err =ice_write_phy_reg_e822 (hw, port,P_REG_PS , val); +if (err) +return err; + } + val |=P_REG_PS_ENA_CLK_M ; err =ice_write_phy_reg_e822 (hw, port,P_REG_PS , val);if (err)return err; - val |=P_REG_PS_LOAD_OFFSET_M ; - err =ice_write_phy_reg_e822 (hw, port,P_REG_PS , val); -if (err) -return err; +if (bypass) { +/* Program the fixed Tx offset */ + err =ice_phy_cfg_fixed_tx_offset_e822 (hw, port); +if (err) +return err; + +/* Program the fixed Rx offset */ + err =ice_phy_cfg_fixed_rx_offset_e822 (hw, port); +if (err) +return err; + }else { + val |=P_REG_PS_LOAD_OFFSET_M ; + err =ice_write_phy_reg_e822 (hw, port,P_REG_PS , val); +if (err) +return err; + }ice_ptp_exec_tmr_cmd (hw);
drivers/net/ice/base/ice_ptp_hw.h +1 -1
@@ -277,7 +277,7 @@ ice_phy_get_speed_and_fec_e822(struct ice_hw *hw, u8 port,void ice_phy_cfg_lane_e822 (struct ice_hw *hw,u8 port);int ice_stop_phy_timer_e822 (struct ice_hw *hw,u8 port,bool soft_reset); -int ice_start_phy_timer_e822 (struct ice_hw *hw,u8 port); +int ice_start_phy_timer_e822 (struct ice_hw *hw,u8 port,bool bypass);int ice_phy_cfg_tx_offset_e822 (struct ice_hw *hw,u8 port);int ice_phy_cfg_rx_offset_e822 (struct ice_hw *hw,u8 port);int
drivers/net/ice/ice_ethdev.c +1 -1
@@ -2540,7 +2540,7 @@ ice_dev_init(struct rte_eth_dev *dev)ice_ptp_init_phy_model (hw);if (hw->phy_model ==ICE_PHY_E822 ) { - ret =ice_start_phy_timer_e822 (hw, hw->pf_id); + ret =ice_start_phy_timer_e822 (hw, hw->pf_id, true);if (ret)PMD_INIT_LOG (ERR ,"Failed to start phy timer" ); }
Signature · 1 line
2.43.0
PATCH 2/9 net/ice/base: add bounds check
In reply to Bruce RichardsonFrom: Fabio Pricoco <[email protected]>
Refactor while loop to add a check that the values read are in the correct range.
--- drivers/net/ice/base/ice_controlq.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
drivers/net/ice/base/ice_controlq.c +21 -2
@@ -839,16 +839,35 @@ static u16 ice_clean_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)struct ice_ctl_q_ring *sq = &cq->sq;u16 ntc = sq->next_to_clean;struct ice_aq_desc *desc; +u32 head; desc =ICE_CTL_Q_DESC (*sq, ntc); -while (rd32 (hw, cq->sq.head) != ntc) { -ice_debug (hw,ICE_DBG_AQ_MSG ,"ntc %d head %d.\n" , ntc,rd32 (hw, cq->sq.head)); + head =rd32 (hw, sq->head); +if (head >= sq->count) { +ice_debug (hw,ICE_DBG_AQ_MSG , +"Read head value (%d) exceeds allowed range.\n" , + head); +return 0 ; + } + +while (head != ntc) { +ice_debug (hw,ICE_DBG_AQ_MSG , +"ntc %d head %d.\n" , + ntc, head);ice_memset (desc,0 ,sizeof (*desc),ICE_DMA_MEM ); ntc++;if (ntc == sq->count) ntc =0 ; desc =ICE_CTL_Q_DESC (*sq, ntc); + + head =rd32 (hw, sq->head); +if (head >= sq->count) { +ice_debug (hw,ICE_DBG_AQ_MSG , +"Read head value (%d) exceeds allowed range.\n" , + head); +return 0 ; + } } sq->next_to_clean = ntc;
Signature · 1 line
2.43.0
PATCH 3/9 net/ice/base: fix VLAN replay after reset
In reply to Bruce RichardsonFrom: Dave Ertman <[email protected]>
If there is more than one VLAN defined when any reset that affects the PF is initiated, after the reset rebuild, no traffic will pass on any VLAN but the last one created.
This is caused by the iteration though the VLANs during replay each clearing the vsi_map bitmap of the VSI that is being replayed. The problem is that during the replay, the pointer to the vsi_map bitmap is used by each successive vlan to determine if it should be replayed on this VSI.
The logic was that the replay of the VLAN would replace the bit in the map before the next VLAN would iterate through. But, since the replay copies the old bitmap pointer to filt_replay_rules and creates a new one for the recreated VLANS, it does not do this, and leaves the old bitmap broken to be used to replay the remaining VLANs.
Since the old bitmap will be cleaned up in post replay cleanup, there is no need to alter it and break following VLAN replay, so don't clear the bit.
--- drivers/net/ice/base/ice_switch.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/ice/base/ice_switch.c +0 -2
@@ -10110,8 +10110,6 @@ ice_replay_vsi_fltr(struct ice_hw *hw, struct ice_port_info *pi,if (!itr->vsi_list_info || !ice_is_bit_set (itr->vsi_list_info->vsi_map, vsi_handle))continue ; -/* Clearing it so that the logic can add it back */ -ice_clear_bit (vsi_handle, itr->vsi_list_info->vsi_map); f_entry.fltr_info.vsi_handle = vsi_handle; f_entry.fltr_info.fltr_act =ICE_FWD_TO_VSI ;/* update the src in case it is VSI num */
--
2.43.0
PATCH 4/9 net/ice/base: remove 255 limit on sched child nodes
In reply to Bruce RichardsonThe Tx scheduler in the ice driver can be configured to have large numbers of child nodes at a given layer, but the driver code implicitly limited the number of nodes to 255 by using a u8 datatype for the number of children. Increase this to a 16-bit value throughout the code.
--- drivers/net/ice/base/ice_dcb.c | 3 ++- drivers/net/ice/base/ice_sched.c | 23 +++++++++++++---------- drivers/net/ice/base/ice_type.h | 2 +- 3 files changed, 16 insertions(+), 12 deletions(-)
drivers/net/ice/base/ice_dcb.c +2 -1
@@ -1585,7 +1585,8 @@ ice_update_port_tc_tree_cfg(struct ice_port_info *pi,struct ice_aqc_txsched_elem_data elem;u32 teid1, teid2;int status =0 ; -u8 i, j; +u16 i; +u8 j;if (!pi)return ICE_ERR_PARAM ;
drivers/net/ice/base/ice_sched.c +13 -10
@@ -288,7 +288,7 @@ ice_sched_get_first_node(struct ice_port_info *pi,*/ struct ice_sched_node *ice_sched_get_tc_node (struct ice_port_info *pi,u8 tc) { -u8 i; +u16 i;if (!pi || !pi->root)return NULL ;
@@ -311,7 +311,7 @@ void ice_free_sched_node(struct ice_port_info *pi, struct ice_sched_node *node) {struct ice_sched_node *parent;struct ice_hw *hw = pi->hw; -u8 i, j; +u16 i, j;/* Free the children before freeing up the parent node * The parent array is updated below and that shifts the nodes
@@ -1503,7 +1503,7 @@ ice_sched_get_free_qgrp(struct ice_port_info *pi, struct ice_sched_node *qgrp_node, u8 owner) {struct ice_sched_node *min_qgrp; -u8 min_children; +u16 min_children;if (!qgrp_node)return qgrp_node;
@@ -2063,7 +2063,7 @@ static void ice_sched_rm_agg_vsi_info(struct ice_port_info *pi, u16 vsi_handle)*/ static bool ice_sched_is_leaf_node_present (struct ice_sched_node *node) { -u8 i; +u16 i;for (i =0 ; i < node->num_children; i++)if (ice_sched_is_leaf_node_present (node->children[i]))
@@ -2098,7 +2098,7 @@ ice_sched_rm_vsi_cfg(struct ice_port_info *pi, u16 vsi_handle, u8 owner)ice_for_each_traffic_class (i) {struct ice_sched_node *vsi_node, *tc_node; -u8 j =0 ; +u16 j =0 ; tc_node =ice_sched_get_tc_node (pi, i);if (!tc_node)
@@ -2166,7 +2166,7 @@ int ice_rm_vsi_lan_cfg(struct ice_port_info *pi, u16 vsi_handle)*/ bool ice_sched_is_tree_balanced (struct ice_hw *hw,struct ice_sched_node *node) { -u8 i; +u16 i;/* start from the leaf node */ for (i =0 ; i < node->num_children; i++)
@@ -2240,7 +2240,8 @@ ice_sched_get_free_vsi_parent(struct ice_hw *hw, struct ice_sched_node *node, u16 *num_nodes) {u8 l = node->tx_sched_layer; -u8 vsil, i; +u8 vsil; +u16 i; vsil =ice_sched_get_vsi_layer (hw);
@@ -2282,7 +2283,7 @@ ice_sched_update_parent(struct ice_sched_node *new_parent, struct ice_sched_node *node) {struct ice_sched_node *old_parent; -u8 i, j; +u16 i, j; old_parent = node->parent;
@@ -2382,8 +2383,9 @@ ice_sched_move_vsi_to_agg(struct ice_port_info *pi, u16 vsi_handle, u32 agg_id,u16 num_nodes[ICE_AQC_TOPO_MAX_LEVEL_NUM ] = {0 };u32 first_node_teid, vsi_teid;u16 num_nodes_added; -u8 aggl, vsil, i; +u8 aggl, vsil;int status; +u16 i; tc_node =ice_sched_get_tc_node (pi, tc);if (!tc_node)
@@ -2498,7 +2500,8 @@ ice_move_all_vsi_to_dflt_agg(struct ice_port_info *pi,static bool ice_sched_is_agg_inuse (struct ice_port_info *pi,struct ice_sched_node *node) { -u8 vsil, i; +u8 vsil; +u16 i; vsil =ice_sched_get_vsi_layer (pi->hw);if (node->tx_sched_layer < vsil -1 ) {
drivers/net/ice/base/ice_type.h +1 -1
@@ -1030,9 +1030,9 @@ struct ice_sched_node {struct ice_aqc_txsched_elem_data info;u32 agg_id;/* aggregator group ID */ u16 vsi_handle; +u16 num_children;u8 in_use;/* suspended or in use */ u8 tx_sched_layer;/* Logical Layer (1-9) */ -u8 num_children;u8 tc_num;u8 owner;#define ICE_SCHED_NODE_OWNER_LAN 0
Signature · 1 line
2.43.0
PATCH 5/9 net/ice/base: set VSI index on newly created nodes
In reply to Bruce RichardsonThe ice_sched_node type has got a field for the vsi to which the node belongs. This field was not getting set in "ice_sched_add_node", so add a line configuring this field for each node from its parent node. Similarly, when searching for a qgroup node, we can check for each node that the VSI information is correct.
--- drivers/net/ice/base/ice_sched.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_sched.c +2 -1
@@ -200,6 +200,7 @@ ice_sched_add_node(struct ice_port_info *pi, u8 layer, node->in_use = true; node->parent = parent; node->tx_sched_layer = layer; + node->vsi_handle = parent->vsi_handle; parent->children[parent->num_children++] = node; node->info = elem;return 0 ;
@@ -1575,7 +1576,7 @@ ice_sched_get_free_qparent(struct ice_port_info *pi, u16 vsi_handle, u8 tc,/* make sure the qgroup node is part of the VSI subtree */ if (ice_sched_find_node_in_subtree (pi->hw, vsi_node, qgrp_node))if (qgrp_node->num_children < max_children && - qgrp_node->owner == owner) + qgrp_node->owner == owner && qgrp_node->vsi_handle == vsi_handle)break ; qgrp_node = qgrp_node->sibling; }
Signature · 1 line
2.43.0
PATCH 6/9 net/ice/base: optimize subtree searches
In reply to Bruce RichardsonIn a number of places throughout the driver code, we want to confirm that a scheduler node is indeed a child of another node. Currently, this is confirmed by searching down the tree from the base until the desired node is hit, a search which may hit many irrelevant tree nodes when recursing down wrong branches. By switching the direction of search, to check upwards from the node to the parent, we can avoid any incorrect paths, and so speed up processing.
--- drivers/net/ice/base/ice_sched.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-)
drivers/net/ice/base/ice_sched.c +7 -16
@@ -1464,25 +1464,16 @@ void ice_sched_get_psm_clk_freq(struct ice_hw *hw)* subtree or not */ bool -ice_sched_find_node_in_subtree (struct ice_hw *hw,struct ice_sched_node *base, +ice_sched_find_node_in_subtree(struct ice_hw __ALWAYS_UNUSED *hw, +struct ice_sched_node *base,struct ice_sched_node *node) { -u8 i; - -for (i =0 ; i < base->num_children; i++) { -struct ice_sched_node *child = base->children[i]; - -if (node == child) -return true; - -if (child->tx_sched_layer > node->tx_sched_layer) -return false; - -/* this recursion is intentional, and wouldn't -* go more than 8 calls -*/ -if (ice_sched_find_node_in_subtree (hw, child, node)) +if (base == node) +return true; +while (node->tx_sched_layer !=0 && node->parent !=NULL ) { +if (node->parent == base)return true; + node = node->parent; }return false; }
Signature · 1 line
2.43.0
PATCH 7/9 net/ice/base: remove flag checks before topology upload
In reply to Bruce RichardsonDPDK should support more than just 9-level or 5-level topologies, so remove the checks for those particular settings.
--- drivers/net/ice/base/ice_ddp.c | 33 --------------------------------- 1 file changed, 33 deletions(-)
drivers/net/ice/base/ice_ddp.c +0 -33
@@ -2384,38 +2384,6 @@ int ice_cfg_tx_topo(struct ice_hw *hw, u8 *buf, u32 len)return status; } -/* Is default topology already applied ? */ -if (!(flags &ICE_AQC_TX_TOPO_FLAGS_LOAD_NEW ) && - hw->num_tx_sched_layers ==9 ) { -ice_debug (hw,ICE_DBG_INIT ,"Loaded default topology\n" ); -/* Already default topology is loaded */ -return ICE_ERR_ALREADY_EXISTS ; - } - -/* Is new topology already applied ? */ -if ((flags &ICE_AQC_TX_TOPO_FLAGS_LOAD_NEW ) && - hw->num_tx_sched_layers ==5 ) { -ice_debug (hw,ICE_DBG_INIT ,"Loaded new topology\n" ); -/* Already new topology is loaded */ -return ICE_ERR_ALREADY_EXISTS ; - } - -/* Is set topology issued already ? */ -if (flags &ICE_AQC_TX_TOPO_FLAGS_ISSUED ) { -ice_debug (hw,ICE_DBG_INIT ,"Update tx topology was done by another PF\n" ); -/* add a small delay before exiting */ -for (i =0 ; i <20 ; i++) -ice_msec_delay (100 , true); -return ICE_ERR_ALREADY_EXISTS ; - } - -/* Change the topology from new to default (5 to 9) */ -if (!(flags &ICE_AQC_TX_TOPO_FLAGS_LOAD_NEW ) && - hw->num_tx_sched_layers ==5 ) { -ice_debug (hw,ICE_DBG_INIT ,"Change topology from 5 to 9 layers\n" ); - goto update_topo; - } - pkg_hdr = (struct ice_pkg_hdr *)buf; state =ice_verify_pkg (pkg_hdr, len);if (state) {
@@ -2462,7 +2430,6 @@ int ice_cfg_tx_topo(struct ice_hw *hw, u8 *buf, u32 len)/* Get the new topology buffer */ new_topo = ((u8 *)section) + offset; -update_topo:/* acquire global lock to make sure that set topology issued * by one PF */
Signature · 1 line
2.43.0
PATCH 8/9 net/ice/base: allow init without TC class sched nodes
In reply to Bruce RichardsonIf DCB support is disabled via DDP image, there will not be any traffic class (TC) nodes in the scheduler tree immediately above the root level. To allow the driver to work with this scenario, we allow use of the root node as a dummy TC0 node in case where there are no TC nodes in the tree. For use of any other TC other than 0 (used by default in the driver), existing behaviour of returning NULL pointer is maintained.
--- drivers/net/ice/base/ice_sched.c | 8 +++++++- drivers/net/ice/base/ice_type.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_sched.c +7 -1
@@ -293,6 +293,10 @@ struct ice_sched_node *ice_sched_get_tc_node(struct ice_port_info *pi, u8 tc)if (!pi || !pi->root)return NULL ; +/* if no TC nodes, use root as TC node 0 */ +if (!pi->has_tc) +return tc ==0 ? pi->root :NULL ; +for (i =0 ; i < pi->root->num_children; i++)if (pi->root->children[i]->tc_num == tc)return pi->root->children[i];
@@ -1306,7 +1310,9 @@ int ice_sched_init_port(struct ice_port_info *pi)if (buf[0 ].generic[j].data.elem_type ==ICE_AQC_ELEM_TYPE_ENTRY_POINT ) hw->sw_entry_point_layer = j; - +else if (buf[0 ].generic[j].data.elem_type == +ICE_AQC_ELEM_TYPE_TC ) + pi->has_tc =1 ; status =ice_sched_add_node (pi, j, &buf[i].generic[j],NULL );if (status) goto err_init_port;
drivers/net/ice/base/ice_type.h +1 -0
@@ -1260,6 +1260,7 @@ struct ice_port_info {struct ice_qos_cfg qos_cfg; u8 is_vf:1; u8 is_custom_tx_enabled:1; + u8 has_tc:1; };struct ice_switch_info {
Signature · 1 line
2.43.0
PATCH 9/9 net/ice/base: read VSI layer info from VSI
In reply to Bruce RichardsonRather than computing from the number of HW layers the layer of the VSI, we can instead just read that info from the VSI node itself. This allows the layer to be changed at runtime.
--- drivers/net/ice/base/ice_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ice/base/ice_sched.c +1 -1
@@ -1550,7 +1550,6 @@ ice_sched_get_free_qparent(struct ice_port_info *pi, u16 vsi_handle, u8 tc,u16 max_children; qgrp_layer =ice_sched_get_qgrp_layer (pi->hw); - vsi_layer =ice_sched_get_vsi_layer (pi->hw); max_children = pi->hw->max_children[qgrp_layer]; vsi_ctx =ice_get_vsi_ctx (pi->hw, vsi_handle);
@@ -1560,6 +1559,7 @@ ice_sched_get_free_qparent(struct ice_port_info *pi, u16 vsi_handle, u8 tc,/* validate invalid VSI ID */ if (!vsi_node)return NULL ; + vsi_layer = vsi_node->tx_sched_layer;/* If the queue group and vsi layer are same then queues * are all attached directly to VSI
Signature · 1 line
2.43.0
v2 cover net/ice: base code update for RC2
In reply to Bruce RichardsonA number of small fixes and other changes to enable Tx scheduler enhancements to our DPDK driver have been added to the base code. Upstream these changes for 24.11 RC2. Most have previously been submitted as part of the scheduler changes [1]
[1] https://patches.dpdk.org/project/dpdk/list/?series=32758&state=*
v2: include README file update
Bruce Richardson (7):
net/ice/base: remove 255 limit on sched child nodes net/ice/base: set VSI index on newly created nodes net/ice/base: optimize subtree searches net/ice/base: remove flag checks before topology upload net/ice/base: allow init without TC class sched nodes net/ice/base: read VSI layer info from VSI net/ice/base: update README
Dave Ertman (1):
net/ice/base: fix VLAN replay after reset
Fabio Pricoco (1):
net/ice/base: add bounds check
Jacob Keller (1):
net/ice/base: re-enable bypass mode for E822
drivers/net/ice/base/README | 2 +- drivers/net/ice/base/ice_controlq.c | 23 +++++- drivers/net/ice/base/ice_dcb.c | 3 +- drivers/net/ice/base/ice_ddp.c | 33 -------- drivers/net/ice/base/ice_ptp_hw.c | 117 ++++++++++++++++++++++++++-- drivers/net/ice/base/ice_ptp_hw.h | 2 +- drivers/net/ice/base/ice_sched.c | 59 +++++++------- drivers/net/ice/base/ice_switch.c | 2 - drivers/net/ice/base/ice_type.h | 3 +- drivers/net/ice/ice_ethdev.c | 2 +- 10 files changed, 169 insertions(+), 77 deletions(-)
--
2.43.0
PATCH v2 1/10 net/ice/base: re-enable bypass mode for E822
From: Jacob Keller <[email protected]>
When removing bypass mode, the code for E822 bypass was completely removed in error. This code should be maintained in DPDK so re-add the necessary functions.
--- drivers/net/ice/base/ice_ptp_hw.c | 117 ++++++++++++++++++++++++++++-- drivers/net/ice/base/ice_ptp_hw.h | 2 +- drivers/net/ice/ice_ethdev.c | 2 +- 3 files changed, 113 insertions(+), 8 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +111 -6
@@ -4468,18 +4468,103 @@ ice_stop_phy_timer_e822(struct ice_hw *hw, u8 port, bool soft_reset)return 0 ; } +/** +* ice_phy_cfg_fixed_tx_offset_e822 - Configure Tx offset for bypass mode +* @hw: pointer to the HW struct +* @port: the PHY port to configure +* +* Calculate and program the fixed Tx offset, and indicate that the offset is +* ready. This can be used when operating in bypass mode. +*/ +static int ice_phy_cfg_fixed_tx_offset_e822 (struct ice_hw *hw,u8 port) +{ +enum ice_ptp_link_spd link_spd; +enum ice_ptp_fec_mode fec_mode; +u64 total_offset; +int err; + + err =ice_phy_get_speed_and_fec_e822 (hw, port, &link_spd, &fec_mode); +if (err) +return err; + + total_offset =ice_calc_fixed_tx_offset_e822 (hw, link_spd); + +/* Program the fixed Tx offset into the P_REG_TOTAL_TX_OFFSET_L +* register, then indicate that the Tx offset is ready. After this, +* timestamps will be enabled. +* +* Note that this skips including the more precise offsets generated +* by the Vernier calibration. +*/ + + err =ice_write_64b_phy_reg_e822 (hw, port,P_REG_TOTAL_TX_OFFSET_L , + total_offset); +if (err) +return err; + + err =ice_write_phy_reg_e822 (hw, port,P_REG_TX_OR ,1 ); +if (err) +return err; + +return ICE_SUCCESS ; +} + +/** +* ice_phy_cfg_rx_offset_e822 - Configure fixed Rx offset for bypass mode +* @hw: pointer to the HW struct +* @port: the PHY port to configure +* +* Calculate and program the fixed Rx offset, and indicate that the offset is +* ready. This can be used when operating in bypass mode. +*/ +static int ice_phy_cfg_fixed_rx_offset_e822 (struct ice_hw *hw,u8 port) +{ +enum ice_ptp_link_spd link_spd; +enum ice_ptp_fec_mode fec_mode; +u64 total_offset; +int err; + + err =ice_phy_get_speed_and_fec_e822 (hw, port, &link_spd, &fec_mode); +if (err) +return err; + + total_offset =ice_calc_fixed_rx_offset_e822 (hw, link_spd); + +/* Program the fixed Rx offset into the P_REG_TOTAL_RX_OFFSET_L +* register, then indicate that the Rx offset is ready. After this, +* timestamps will be enabled. +* +* Note that this skips including the more precise offsets generated +* by Vernier calibration. +*/ + err =ice_write_64b_phy_reg_e822 (hw, port,P_REG_TOTAL_RX_OFFSET_L , + total_offset); +if (err) +return err; + + err =ice_write_phy_reg_e822 (hw, port,P_REG_RX_OR ,1 ); +if (err) +return err; + +return ICE_SUCCESS ; +} +/** * ice_start_phy_timer_e822 - Start the PHY clock timer * @hw: pointer to the HW struct * @port: the PHY port to start +* @bypass: if true, start the PHY in bypass mode * * Start the clock of a PHY port. This must be done as part of the flow to * re-calibrate Tx and Rx timestamping offsets whenever the clock time is * initialized or when link speed changes. * -* Hardware will take Vernier measurements on Tx or Rx of packets. +* Bypass mode enables timestamps immediately without waiting for Vernier +* calibration to complete. Hardware will still continue taking Vernier +* measurements on Tx or Rx of packets, but they will not be applied to +* timestamps. */ -int ice_start_phy_timer_e822 (struct ice_hw *hw,u8 port) +int ice_start_phy_timer_e822 (struct ice_hw *hw,u8 port,bool bypass) {u32 lo, hi, val;u64 incval;
@@ -4544,15 +4629,35 @@ int ice_start_phy_timer_e822(struct ice_hw *hw, u8 port)ice_ptp_exec_tmr_cmd (hw); +if (bypass) { +/* Enter BYPASS mode, enabling timestamps immediately. */ + val |=P_REG_PS_BYPASS_MODE_M ; + err =ice_write_phy_reg_e822 (hw, port,P_REG_PS , val); +if (err) +return err; + } + val |=P_REG_PS_ENA_CLK_M ; err =ice_write_phy_reg_e822 (hw, port,P_REG_PS , val);if (err)return err; - val |=P_REG_PS_LOAD_OFFSET_M ; - err =ice_write_phy_reg_e822 (hw, port,P_REG_PS , val); -if (err) -return err; +if (bypass) { +/* Program the fixed Tx offset */ + err =ice_phy_cfg_fixed_tx_offset_e822 (hw, port); +if (err) +return err; + +/* Program the fixed Rx offset */ + err =ice_phy_cfg_fixed_rx_offset_e822 (hw, port); +if (err) +return err; + }else { + val |=P_REG_PS_LOAD_OFFSET_M ; + err =ice_write_phy_reg_e822 (hw, port,P_REG_PS , val); +if (err) +return err; + }ice_ptp_exec_tmr_cmd (hw);
drivers/net/ice/base/ice_ptp_hw.h +1 -1
@@ -277,7 +277,7 @@ ice_phy_get_speed_and_fec_e822(struct ice_hw *hw, u8 port,void ice_phy_cfg_lane_e822 (struct ice_hw *hw,u8 port);int ice_stop_phy_timer_e822 (struct ice_hw *hw,u8 port,bool soft_reset); -int ice_start_phy_timer_e822 (struct ice_hw *hw,u8 port); +int ice_start_phy_timer_e822 (struct ice_hw *hw,u8 port,bool bypass);int ice_phy_cfg_tx_offset_e822 (struct ice_hw *hw,u8 port);int ice_phy_cfg_rx_offset_e822 (struct ice_hw *hw,u8 port);int
drivers/net/ice/ice_ethdev.c +1 -1
@@ -2540,7 +2540,7 @@ ice_dev_init(struct rte_eth_dev *dev)ice_ptp_init_phy_model (hw);if (hw->phy_model ==ICE_PHY_E822 ) { - ret =ice_start_phy_timer_e822 (hw, hw->pf_id); + ret =ice_start_phy_timer_e822 (hw, hw->pf_id, true);if (ret)PMD_INIT_LOG (ERR ,"Failed to start phy timer" ); }
Signature · 1 line
2.43.0
PATCH v2 2/10 net/ice/base: add bounds check
In reply to Bruce RichardsonFrom: Fabio Pricoco <[email protected]>
Refactor while loop to add a check that the values read are in the correct range.
--- drivers/net/ice/base/ice_controlq.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
drivers/net/ice/base/ice_controlq.c +21 -2
@@ -839,16 +839,35 @@ static u16 ice_clean_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)struct ice_ctl_q_ring *sq = &cq->sq;u16 ntc = sq->next_to_clean;struct ice_aq_desc *desc; +u32 head; desc =ICE_CTL_Q_DESC (*sq, ntc); -while (rd32 (hw, cq->sq.head) != ntc) { -ice_debug (hw,ICE_DBG_AQ_MSG ,"ntc %d head %d.\n" , ntc,rd32 (hw, cq->sq.head)); + head =rd32 (hw, sq->head); +if (head >= sq->count) { +ice_debug (hw,ICE_DBG_AQ_MSG , +"Read head value (%d) exceeds allowed range.\n" , + head); +return 0 ; + } + +while (head != ntc) { +ice_debug (hw,ICE_DBG_AQ_MSG , +"ntc %d head %d.\n" , + ntc, head);ice_memset (desc,0 ,sizeof (*desc),ICE_DMA_MEM ); ntc++;if (ntc == sq->count) ntc =0 ; desc =ICE_CTL_Q_DESC (*sq, ntc); + + head =rd32 (hw, sq->head); +if (head >= sq->count) { +ice_debug (hw,ICE_DBG_AQ_MSG , +"Read head value (%d) exceeds allowed range.\n" , + head); +return 0 ; + } } sq->next_to_clean = ntc;
Signature · 1 line
2.43.0
PATCH v2 3/10 net/ice/base: fix VLAN replay after reset
In reply to Bruce RichardsonFrom: Dave Ertman <[email protected]>
If there is more than one VLAN defined when any reset that affects the PF is initiated, after the reset rebuild, no traffic will pass on any VLAN but the last one created.
This is caused by the iteration though the VLANs during replay each clearing the vsi_map bitmap of the VSI that is being replayed. The problem is that during the replay, the pointer to the vsi_map bitmap is used by each successive vlan to determine if it should be replayed on this VSI.
The logic was that the replay of the VLAN would replace the bit in the map before the next VLAN would iterate through. But, since the replay copies the old bitmap pointer to filt_replay_rules and creates a new one for the recreated VLANS, it does not do this, and leaves the old bitmap broken to be used to replay the remaining VLANs.
Since the old bitmap will be cleaned up in post replay cleanup, there is no need to alter it and break following VLAN replay, so don't clear the bit.
--- drivers/net/ice/base/ice_switch.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/ice/base/ice_switch.c +0 -2
@@ -10110,8 +10110,6 @@ ice_replay_vsi_fltr(struct ice_hw *hw, struct ice_port_info *pi,if (!itr->vsi_list_info || !ice_is_bit_set (itr->vsi_list_info->vsi_map, vsi_handle))continue ; -/* Clearing it so that the logic can add it back */ -ice_clear_bit (vsi_handle, itr->vsi_list_info->vsi_map); f_entry.fltr_info.vsi_handle = vsi_handle; f_entry.fltr_info.fltr_act =ICE_FWD_TO_VSI ;/* update the src in case it is VSI num */
Signature · 1 line
2.43.0
PATCH v2 4/10 net/ice/base: remove 255 limit on sched child nodes
In reply to Bruce RichardsonThe Tx scheduler in the ice driver can be configured to have large numbers of child nodes at a given layer, but the driver code implicitly limited the number of nodes to 255 by using a u8 datatype for the number of children. Increase this to a 16-bit value throughout the code.
--- drivers/net/ice/base/ice_dcb.c | 3 ++- drivers/net/ice/base/ice_sched.c | 23 +++++++++++++---------- drivers/net/ice/base/ice_type.h | 2 +- 3 files changed, 16 insertions(+), 12 deletions(-)
drivers/net/ice/base/ice_dcb.c +2 -1
@@ -1585,7 +1585,8 @@ ice_update_port_tc_tree_cfg(struct ice_port_info *pi,struct ice_aqc_txsched_elem_data elem;u32 teid1, teid2;int status =0 ; -u8 i, j; +u16 i; +u8 j;if (!pi)return ICE_ERR_PARAM ;
drivers/net/ice/base/ice_sched.c +13 -10
@@ -288,7 +288,7 @@ ice_sched_get_first_node(struct ice_port_info *pi,*/ struct ice_sched_node *ice_sched_get_tc_node (struct ice_port_info *pi,u8 tc) { -u8 i; +u16 i;if (!pi || !pi->root)return NULL ;
@@ -311,7 +311,7 @@ void ice_free_sched_node(struct ice_port_info *pi, struct ice_sched_node *node) {struct ice_sched_node *parent;struct ice_hw *hw = pi->hw; -u8 i, j; +u16 i, j;/* Free the children before freeing up the parent node * The parent array is updated below and that shifts the nodes
@@ -1503,7 +1503,7 @@ ice_sched_get_free_qgrp(struct ice_port_info *pi, struct ice_sched_node *qgrp_node, u8 owner) {struct ice_sched_node *min_qgrp; -u8 min_children; +u16 min_children;if (!qgrp_node)return qgrp_node;
@@ -2063,7 +2063,7 @@ static void ice_sched_rm_agg_vsi_info(struct ice_port_info *pi, u16 vsi_handle)*/ static bool ice_sched_is_leaf_node_present (struct ice_sched_node *node) { -u8 i; +u16 i;for (i =0 ; i < node->num_children; i++)if (ice_sched_is_leaf_node_present (node->children[i]))
@@ -2098,7 +2098,7 @@ ice_sched_rm_vsi_cfg(struct ice_port_info *pi, u16 vsi_handle, u8 owner)ice_for_each_traffic_class (i) {struct ice_sched_node *vsi_node, *tc_node; -u8 j =0 ; +u16 j =0 ; tc_node =ice_sched_get_tc_node (pi, i);if (!tc_node)
@@ -2166,7 +2166,7 @@ int ice_rm_vsi_lan_cfg(struct ice_port_info *pi, u16 vsi_handle)*/ bool ice_sched_is_tree_balanced (struct ice_hw *hw,struct ice_sched_node *node) { -u8 i; +u16 i;/* start from the leaf node */ for (i =0 ; i < node->num_children; i++)
@@ -2240,7 +2240,8 @@ ice_sched_get_free_vsi_parent(struct ice_hw *hw, struct ice_sched_node *node, u16 *num_nodes) {u8 l = node->tx_sched_layer; -u8 vsil, i; +u8 vsil; +u16 i; vsil =ice_sched_get_vsi_layer (hw);
@@ -2282,7 +2283,7 @@ ice_sched_update_parent(struct ice_sched_node *new_parent, struct ice_sched_node *node) {struct ice_sched_node *old_parent; -u8 i, j; +u16 i, j; old_parent = node->parent;
@@ -2382,8 +2383,9 @@ ice_sched_move_vsi_to_agg(struct ice_port_info *pi, u16 vsi_handle, u32 agg_id,u16 num_nodes[ICE_AQC_TOPO_MAX_LEVEL_NUM ] = {0 };u32 first_node_teid, vsi_teid;u16 num_nodes_added; -u8 aggl, vsil, i; +u8 aggl, vsil;int status; +u16 i; tc_node =ice_sched_get_tc_node (pi, tc);if (!tc_node)
@@ -2498,7 +2500,8 @@ ice_move_all_vsi_to_dflt_agg(struct ice_port_info *pi,static bool ice_sched_is_agg_inuse (struct ice_port_info *pi,struct ice_sched_node *node) { -u8 vsil, i; +u8 vsil; +u16 i; vsil =ice_sched_get_vsi_layer (pi->hw);if (node->tx_sched_layer < vsil -1 ) {
drivers/net/ice/base/ice_type.h +1 -1
@@ -1030,9 +1030,9 @@ struct ice_sched_node {struct ice_aqc_txsched_elem_data info;u32 agg_id;/* aggregator group ID */ u16 vsi_handle; +u16 num_children;u8 in_use;/* suspended or in use */ u8 tx_sched_layer;/* Logical Layer (1-9) */ -u8 num_children;u8 tc_num;u8 owner;#define ICE_SCHED_NODE_OWNER_LAN 0
Signature · 1 line
2.43.0
PATCH v2 5/10 net/ice/base: set VSI index on newly created nodes
In reply to Bruce RichardsonThe ice_sched_node type has got a field for the vsi to which the node belongs. This field was not getting set in "ice_sched_add_node", so add a line configuring this field for each node from its parent node. Similarly, when searching for a qgroup node, we can check for each node that the VSI information is correct.
--- drivers/net/ice/base/ice_sched.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_sched.c +2 -1
@@ -200,6 +200,7 @@ ice_sched_add_node(struct ice_port_info *pi, u8 layer, node->in_use = true; node->parent = parent; node->tx_sched_layer = layer; + node->vsi_handle = parent->vsi_handle; parent->children[parent->num_children++] = node; node->info = elem;return 0 ;
@@ -1575,7 +1576,7 @@ ice_sched_get_free_qparent(struct ice_port_info *pi, u16 vsi_handle, u8 tc,/* make sure the qgroup node is part of the VSI subtree */ if (ice_sched_find_node_in_subtree (pi->hw, vsi_node, qgrp_node))if (qgrp_node->num_children < max_children && - qgrp_node->owner == owner) + qgrp_node->owner == owner && qgrp_node->vsi_handle == vsi_handle)break ; qgrp_node = qgrp_node->sibling; }
Signature · 1 line
2.43.0
PATCH v2 6/10 net/ice/base: optimize subtree searches
In reply to Bruce RichardsonIn a number of places throughout the driver code, we want to confirm that a scheduler node is indeed a child of another node. Currently, this is confirmed by searching down the tree from the base until the desired node is hit, a search which may hit many irrelevant tree nodes when recursing down wrong branches. By switching the direction of search, to check upwards from the node to the parent, we can avoid any incorrect paths, and so speed up processing.
--- drivers/net/ice/base/ice_sched.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-)
drivers/net/ice/base/ice_sched.c +7 -16
@@ -1464,25 +1464,16 @@ void ice_sched_get_psm_clk_freq(struct ice_hw *hw)* subtree or not */ bool -ice_sched_find_node_in_subtree (struct ice_hw *hw,struct ice_sched_node *base, +ice_sched_find_node_in_subtree(struct ice_hw __ALWAYS_UNUSED *hw, +struct ice_sched_node *base,struct ice_sched_node *node) { -u8 i; - -for (i =0 ; i < base->num_children; i++) { -struct ice_sched_node *child = base->children[i]; - -if (node == child) -return true; - -if (child->tx_sched_layer > node->tx_sched_layer) -return false; - -/* this recursion is intentional, and wouldn't -* go more than 8 calls -*/ -if (ice_sched_find_node_in_subtree (hw, child, node)) +if (base == node) +return true; +while (node->tx_sched_layer !=0 && node->parent !=NULL ) { +if (node->parent == base)return true; + node = node->parent; }return false; }
Signature · 1 line
2.43.0
PATCH v2 7/10 net/ice/base: remove flag checks before topology upload
In reply to Bruce RichardsonDPDK should support more than just 9-level or 5-level topologies, so remove the checks for those particular settings.
--- drivers/net/ice/base/ice_ddp.c | 33 --------------------------------- 1 file changed, 33 deletions(-)
drivers/net/ice/base/ice_ddp.c +0 -33
@@ -2384,38 +2384,6 @@ int ice_cfg_tx_topo(struct ice_hw *hw, u8 *buf, u32 len)return status; } -/* Is default topology already applied ? */ -if (!(flags &ICE_AQC_TX_TOPO_FLAGS_LOAD_NEW ) && - hw->num_tx_sched_layers ==9 ) { -ice_debug (hw,ICE_DBG_INIT ,"Loaded default topology\n" ); -/* Already default topology is loaded */ -return ICE_ERR_ALREADY_EXISTS ; - } - -/* Is new topology already applied ? */ -if ((flags &ICE_AQC_TX_TOPO_FLAGS_LOAD_NEW ) && - hw->num_tx_sched_layers ==5 ) { -ice_debug (hw,ICE_DBG_INIT ,"Loaded new topology\n" ); -/* Already new topology is loaded */ -return ICE_ERR_ALREADY_EXISTS ; - } - -/* Is set topology issued already ? */ -if (flags &ICE_AQC_TX_TOPO_FLAGS_ISSUED ) { -ice_debug (hw,ICE_DBG_INIT ,"Update tx topology was done by another PF\n" ); -/* add a small delay before exiting */ -for (i =0 ; i <20 ; i++) -ice_msec_delay (100 , true); -return ICE_ERR_ALREADY_EXISTS ; - } - -/* Change the topology from new to default (5 to 9) */ -if (!(flags &ICE_AQC_TX_TOPO_FLAGS_LOAD_NEW ) && - hw->num_tx_sched_layers ==5 ) { -ice_debug (hw,ICE_DBG_INIT ,"Change topology from 5 to 9 layers\n" ); - goto update_topo; - } - pkg_hdr = (struct ice_pkg_hdr *)buf; state =ice_verify_pkg (pkg_hdr, len);if (state) {
@@ -2462,7 +2430,6 @@ int ice_cfg_tx_topo(struct ice_hw *hw, u8 *buf, u32 len)/* Get the new topology buffer */ new_topo = ((u8 *)section) + offset; -update_topo:/* acquire global lock to make sure that set topology issued * by one PF */
Signature · 1 line
2.43.0
PATCH v2 8/10 net/ice/base: allow init without TC class sched nodes
In reply to Bruce RichardsonIf DCB support is disabled via DDP image, there will not be any traffic class (TC) nodes in the scheduler tree immediately above the root level. To allow the driver to work with this scenario, we allow use of the root node as a dummy TC0 node in case where there are no TC nodes in the tree. For use of any other TC other than 0 (used by default in the driver), existing behaviour of returning NULL pointer is maintained.
--- drivers/net/ice/base/ice_sched.c | 8 +++++++- drivers/net/ice/base/ice_type.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_sched.c +7 -1
@@ -293,6 +293,10 @@ struct ice_sched_node *ice_sched_get_tc_node(struct ice_port_info *pi, u8 tc)if (!pi || !pi->root)return NULL ; +/* if no TC nodes, use root as TC node 0 */ +if (!pi->has_tc) +return tc ==0 ? pi->root :NULL ; +for (i =0 ; i < pi->root->num_children; i++)if (pi->root->children[i]->tc_num == tc)return pi->root->children[i];
@@ -1306,7 +1310,9 @@ int ice_sched_init_port(struct ice_port_info *pi)if (buf[0 ].generic[j].data.elem_type ==ICE_AQC_ELEM_TYPE_ENTRY_POINT ) hw->sw_entry_point_layer = j; - +else if (buf[0 ].generic[j].data.elem_type == +ICE_AQC_ELEM_TYPE_TC ) + pi->has_tc =1 ; status =ice_sched_add_node (pi, j, &buf[i].generic[j],NULL );if (status) goto err_init_port;
drivers/net/ice/base/ice_type.h +1 -0
@@ -1260,6 +1260,7 @@ struct ice_port_info {struct ice_qos_cfg qos_cfg; u8 is_vf:1; u8 is_custom_tx_enabled:1; + u8 has_tc:1; };struct ice_switch_info {
Signature · 1 line
2.43.0
PATCH v2 9/10 net/ice/base: read VSI layer info from VSI
In reply to Bruce RichardsonRather than computing from the number of HW layers the layer of the VSI, we can instead just read that info from the VSI node itself. This allows the layer to be changed at runtime.
--- drivers/net/ice/base/ice_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ice/base/ice_sched.c +1 -1
@@ -1550,7 +1550,6 @@ ice_sched_get_free_qparent(struct ice_port_info *pi, u16 vsi_handle, u8 tc,u16 max_children; qgrp_layer =ice_sched_get_qgrp_layer (pi->hw); - vsi_layer =ice_sched_get_vsi_layer (pi->hw); max_children = pi->hw->max_children[qgrp_layer]; vsi_ctx =ice_get_vsi_ctx (pi->hw, vsi_handle);
@@ -1560,6 +1559,7 @@ ice_sched_get_free_qparent(struct ice_port_info *pi, u16 vsi_handle, u8 tc,/* validate invalid VSI ID */ if (!vsi_node)return NULL ; + vsi_layer = vsi_node->tx_sched_layer;/* If the queue group and vsi layer are same then queues * are all attached directly to VSI
Signature · 1 line
2.43.0
PATCH v2 10/10 net/ice/base: update README
In reply to Bruce RichardsonUpdate the README file with the date of that latest base code snapshot.
--- drivers/net/ice/base/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ice/base/README +1 -1
@@ -6,7 +6,7 @@ Intel® ICE driver ================== This directory contains source code of ice base driver generated on -2024-08-19 released by the team which develops +2024-10-11 released by the team which develops basic drivers for any ice NIC. The directory of base/ contains the original source package. This driver is valid for the product(s) listed below
Signature · 1 line
2.43.0
Hi Bruce,
Quoted 42 lines · Bruce Richardson
A number of small fixes and other changes to enable Tx scheduler enhancements to our DPDK driver have been added to the base code. Upstream these changes for 24.11 RC2. Most have previously been submitted as part of the scheduler changes [1]
[1] https://patches.dpdk.org/project/dpdk/list/?series=32758&state=*
v2: include README file update
Bruce Richardson (7):
net/ice/base: remove 255 limit on sched child nodesnet/ice/base: set VSI index on newly created nodesnet/ice/base: optimize subtree searchesnet/ice/base: remove flag checks before topology uploadnet/ice/base: allow init without TC class sched nodesnet/ice/base: read VSI layer info from VSInet/ice/base: update READMEDave Ertman (1):
net/ice/base: fix VLAN replay after resetFabio Pricoco (1):
net/ice/base: add bounds checkJacob Keller (1):
net/ice/base: re-enable bypass mode for E822drivers/net/ice/base/README | 2 +- drivers/net/ice/base/ice_controlq.c | 23 +++++- drivers/net/ice/base/ice_dcb.c | 3 +- drivers/net/ice/base/ice_ddp.c | 33 -------- drivers/net/ice/base/ice_ptp_hw.c | 117 ++++++++++++++++++++++++++-- drivers/net/ice/base/ice_ptp_hw.h | 2 +- drivers/net/ice/base/ice_sched.c | 59 +++++++------- drivers/net/ice/base/ice_switch.c | 2 - drivers/net/ice/base/ice_type.h | 3 +- drivers/net/ice/ice_ethdev.c | 2 +- 10 files changed, 169 insertions(+), 77 deletions(-)--
2.43.0
Signature · 2 lines
Regards, Vladimir
Bruce Richardson
AppliedQuoted 4 lines · Vladimir
Hi Bruce,
Series-acked-by Vladimir Medvedkin <[email protected]>
Applied to dpdk-next-net-intel
/Bruce