Skip to contentSkip to conversation

ice: Support 5 layer tx scheduler topology

PATCH Superseded Michal Wilczynski 2 participants 14 messages Mar 14, 2023 – Mar 22, 2023

Subsystems (5)

v10 of 11 Superseded Latest is v11 →

lore
Share & tools
lore
#0 lore raw

v10 cover ice: Support 5 layer tx scheduler topology

This is a re-send of series that was previously accepted and merged to the tree, but testing discovered problems with this series so it was later dropped. This version fixes the bug found by validation.

For performance reasons there is a need to have support for selectable tx scheduler topology. Currently firmware supports only the default 9-layer and 5-layer topology. This patch series enables switch from default to 5-layer topology, if user decides to opt-in.

v10: Fixed incorrect call to ice_fill_dflt_direct_cmd_desc that caused
the bug found by validation.
v9: Nothing changed, this is a re-send per validation request

Lukasz Czapnik (1):
ice: Add txbalancing devlink param
v6: Added this commit
v7: Fixed nitpicks, checkpatch issue, changed functions to static

Michal Wilczynski (2):
ice: Enable switching default tx scheduler topology
v2:
- Moved definitions of scheduling layers to other commit v3:
- Removed wrong tags
- Added blank line
- Indented a comment
- Moved parts of code to separate commit
- Removed unnecessary initializations
- Change from unnecessary devm_kmemdup to kmemdup
v5:
- Changed freeing to kfree
- Changed commit message to clarify that parameter change is not yet upstream

ice: Document txbalancing parameter
v7: Added this commit

Raj Victor (2):
ice: Support 5 layer topology
v2:
- Added example of performance decrease in commit message
- Reworded commit message for imperative mood
- Removed unnecessary tags
- Refactored duplicated function call
- Fixed RCT
- Fixed unnecessary call to devm_kfree
- Defined constants
v3:
- Changed title
- Changes in commit description, added versions of DDP and firmware, also added test methodology
- Removed unnecessary defines
- Added a newline for define separation
- Did s/tx/Tx in comments
- Removed newline between error check
v8:
- Removed msleep's in the loops

ice: Adjust the VSI/Aggregator layers
v3:
- Added this commit
- Removed unnecessary 'else'

 Documentation/networking/devlink/ice.rst      |  17 ++
 .../net/ethernet/intel/ice/ice_adminq_cmd.h   |  31 +++
 drivers/net/ethernet/intel/ice/ice_common.c   |   6 +
 drivers/net/ethernet/intel/ice/ice_ddp.c      | 201 ++++++++++++++++++
 drivers/net/ethernet/intel/ice/ice_ddp.h      |   7 +-
 drivers/net/ethernet/intel/ice/ice_devlink.c  | 162 +++++++++++++-
 .../net/ethernet/intel/ice/ice_fw_update.c    |   2 +-
 .../net/ethernet/intel/ice/ice_fw_update.h    |   3 +
 drivers/net/ethernet/intel/ice/ice_main.c     | 104 +++++++--
 drivers/net/ethernet/intel/ice/ice_nvm.c      |   2 +-
 drivers/net/ethernet/intel/ice/ice_nvm.h      |   3 +
 drivers/net/ethernet/intel/ice/ice_sched.c    |  34 +--
 drivers/net/ethernet/intel/ice/ice_sched.h    |   3 +
 drivers/net/ethernet/intel/ice/ice_type.h     |   1 +
 14 files changed, 535 insertions(+), 41 deletions(-)
Signature · 6 lines
2.37.2

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
#1 lore raw

PATCH v10 1/5 ice: Support 5 layer topology

From: Raj Victor <[email protected]>

There is a performance issue reported when the number of VSIs are not multiple of 8. This is caused due to the max children limitation per node(8) in 9 layer topology. The BW credits are shared evenly among the children by default. Assume one node has 8 children and the other has 1. The parent of these nodes share the BW credit equally among them. Apparently this causes a problem for the first node which has 8 children. The 9th VM get more BW credits than the first 8 VMs.

Example:

1) With 8 VM's:
for x in 0 1 2 3 4 5 6 7;
do taskset -c ${x} netperf -P0 -H 172.68.169.125 & sleep .1 ; done

tx_queue_0_packets: 23283027
tx_queue_1_packets: 23292289
tx_queue_2_packets: 23276136
tx_queue_3_packets: 23279828
tx_queue_4_packets: 23279828
tx_queue_5_packets: 23279333
tx_queue_6_packets: 23277745
tx_queue_7_packets: 23279950
tx_queue_8_packets: 0

2) With 9 VM's:
for x in 0 1 2 3 4 5 6 7 8;
do taskset -c ${x} netperf -P0 -H 172.68.169.125 & sleep .1 ; done

tx_queue_0_packets: 24163396
tx_queue_1_packets: 24164623
tx_queue_2_packets: 24163188
tx_queue_3_packets: 24163701
tx_queue_4_packets: 24163683
tx_queue_5_packets: 24164668
tx_queue_6_packets: 23327200
tx_queue_7_packets: 24163853
tx_queue_8_packets: 91101417

So on average queue 8 statistics show that 3.7 times more packets were send there than to the other queues.

The FW starting with version 3.20, has increased the max number of children per node by reducing the number of layers from 9 to 5. Reflect this on driver side.

---
 .../net/ethernet/intel/ice/ice_adminq_cmd.h   |  22 ++
 drivers/net/ethernet/intel/ice/ice_common.c   |   4 +
 drivers/net/ethernet/intel/ice/ice_ddp.c      | 200 ++++++++++++++++++
 drivers/net/ethernet/intel/ice/ice_ddp.h      |   7 +-
 drivers/net/ethernet/intel/ice/ice_sched.h    |   3 +
 drivers/net/ethernet/intel/ice/ice_type.h     |   1 +
 6 files changed, 235 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +22 -0
index 838d9b274d68..ef2d30dc996d 100644
@@ -120,6 +120,7 @@ struct ice_aqc_list_caps_elem {
 #define ICE_AQC_CAPS_PCIE_RESET_AVOIDANCE		0x0076
 #define ICE_AQC_CAPS_POST_UPDATE_RESET_RESTRICT		0x0077
 #define ICE_AQC_CAPS_NVM_MGMT				0x0080
+#define ICE_AQC_CAPS_TX_SCHED_TOPO_COMP_MODE		0x0085
 
 	u8 major_ver;
 	u8 minor_ver;
@@ -798,6 +799,23 @@ struct ice_aqc_get_topo {
 	__le32 addr_low;
 };
 
+/* Get/Set Tx Topology (indirect 0x0418/0x0417) */
+struct ice_aqc_get_set_tx_topo {
+	u8 set_flags;
+#define ICE_AQC_TX_TOPO_FLAGS_CORRER		BIT(0)
+#define ICE_AQC_TX_TOPO_FLAGS_SRC_RAM		BIT(1)
+#define ICE_AQC_TX_TOPO_FLAGS_LOAD_NEW		BIT(4)
+#define ICE_AQC_TX_TOPO_FLAGS_ISSUED		BIT(5)
+
+	u8 get_flags;
+#define ICE_AQC_TX_TOPO_GET_RAM	2
+
+	__le16 reserved1;
+	__le32 reserved2;
+	__le32 addr_high;
+	__le32 addr_low;
+};
+
 /* Update TSE (indirect 0x0403)
  * Get TSE (indirect 0x0404)
  * Add TSE (indirect 0x0401)
@@ -2197,6 +2215,7 @@ struct ice_aq_desc {
 		struct ice_aqc_get_link_topo get_link_topo;
 		struct ice_aqc_i2c read_write_i2c;
 		struct ice_aqc_read_i2c_resp read_i2c_resp;
+		struct ice_aqc_get_set_tx_topo get_set_tx_topo;
 	} params;
 };
 
@@ -2302,6 +2321,9 @@ enum ice_adminq_opc {
 	ice_aqc_opc_query_sched_res			= 0x0412,
 	ice_aqc_opc_remove_rl_profiles			= 0x0415,
 
+	ice_aqc_opc_set_tx_topo				= 0x0417,
+	ice_aqc_opc_get_tx_topo				= 0x0418,
+
 	/* PHY commands */
 	ice_aqc_opc_get_phy_caps			= 0x0600,
 	ice_aqc_opc_set_phy_cfg				= 0x0601,
drivers/net/ethernet/intel/ice/ice_common.c +4 -0
index c2fda4fa4188..477a6b15100f 100644
@@ -2252,6 +2252,10 @@ ice_parse_common_caps(struct ice_hw *hw, struct ice_hw_common_caps *caps,
 			  "%s: reset_restrict_support = %d\n", prefix,
 			  caps->reset_restrict_support);
 		break;
+	case ICE_AQC_CAPS_TX_SCHED_TOPO_COMP_MODE:
+		caps->tx_sched_topo_comp_mode_en = (number == 1);
+		break;
+
 	default:
 		/* Not one of the recognized common capabilities */
 		found = false;
drivers/net/ethernet/intel/ice/ice_ddp.c +200 -0

209 lines not on this page · raw message

drivers/net/ethernet/intel/ice/ice_ddp.h +5 -2
index 37eadb3d27a8..2427b9db88e0 100644
@@ -100,8 +100,9 @@ struct ice_pkg_hdr {
 
 /* generic segment */
 struct ice_generic_seg_hdr {
-#define SEGMENT_TYPE_METADATA 0x00000001
-#define SEGMENT_TYPE_ICE 0x00000010
+#define SEGMENT_TYPE_METADATA		0x00000001
+#define SEGMENT_TYPE_ICE		0x00000010
+#define SEGMENT_TYPE_ICE_RUN_TIME_CFG	0x00000020
 	__le32 seg_type;
 	struct ice_pkg_ver seg_format_ver;
 	__le32 seg_size;
@@ -442,4 +443,6 @@ void *ice_pkg_enum_section(struct ice_seg *ice_seg, struct ice_pkg_enum *state,
 
 struct ice_buf_hdr *ice_pkg_val_buf(struct ice_buf *buf);
 
+int ice_cfg_tx_topo(struct ice_hw *hw, u8 *buf, u32 len);
+
 #endif
drivers/net/ethernet/intel/ice/ice_sched.h +3 -0
index 9c100747445a..1d01a1898b8b 100644
@@ -6,6 +6,9 @@
 
 #include "ice_common.h"
 
+#define ICE_SCHED_5_LAYERS	5
+#define ICE_SCHED_9_LAYERS	9
+
 #define SCHED_NODE_NAME_MAX_LEN 32
 
 #define ICE_QGRP_LAYER_OFFSET	2
drivers/net/ethernet/intel/ice/ice_type.h +1 -0
index a09556e57803..5602695243a8 100644
@@ -290,6 +290,7 @@ struct ice_hw_common_caps {
 	bool pcie_reset_avoidance;
 	/* Post update reset restriction */
 	bool reset_restrict_support;
+	bool tx_sched_topo_comp_mode_en;
 };
 
 /* IEEE 1588 TIME_SYNC specific info */
Signature · 6 lines
2.37.2

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
#2 lore raw

PATCH v10 2/5 ice: Adjust the VSI/Aggregator layers

In reply to Michal Wilczynski

From: Raj Victor <[email protected]>

Adjust the VSI/Aggregator layers based on the number of logical layers supported by the FW. Currently the VSI and aggregator layers are fixed based on the 9 layer scheduler tree layout. Due to performance reasons the number of layers of the scheduler tree is changing from 9 to 5. It requires a readjustment of these VSI/Aggregator layer values.

---
 drivers/net/ethernet/intel/ice/ice_sched.c | 34 +++++++++++-----------
 1 file changed, 17 insertions(+), 17 deletions(-)
drivers/net/ethernet/intel/ice/ice_sched.c +17 -17
index 4eca8d195ef0..c1b2f1a181c6 100644
@@ -1132,12 +1132,11 @@ static u8 ice_sched_get_vsi_layer(struct ice_hw *hw)
 	 *     5 or less       sw_entry_point_layer
 	 */
 	/* calculate the VSI layer based on number of layers. */
-	if (hw->num_tx_sched_layers > ICE_VSI_LAYER_OFFSET + 1) {
-		u8 layer = hw->num_tx_sched_layers - ICE_VSI_LAYER_OFFSET;
-
-		if (layer > hw->sw_entry_point_layer)
-			return layer;
-	}
+	if (hw->num_tx_sched_layers == ICE_SCHED_9_LAYERS)
+		return hw->num_tx_sched_layers - ICE_VSI_LAYER_OFFSET;
+	if (hw->num_tx_sched_layers == ICE_SCHED_5_LAYERS)
+		/* qgroup and VSI layers are same */
+		return hw->num_tx_sched_layers - ICE_QGRP_LAYER_OFFSET;
 	return hw->sw_entry_point_layer;
 }
 
@@ -1154,12 +1153,8 @@ static u8 ice_sched_get_agg_layer(struct ice_hw *hw)
 	 *     7 or less       sw_entry_point_layer
 	 */
 	/* calculate the aggregator layer based on number of layers. */
-	if (hw->num_tx_sched_layers > ICE_AGG_LAYER_OFFSET + 1) {
-		u8 layer = hw->num_tx_sched_layers - ICE_AGG_LAYER_OFFSET;
-
-		if (layer > hw->sw_entry_point_layer)
-			return layer;
-	}
+	if (hw->num_tx_sched_layers == ICE_SCHED_9_LAYERS)
+		return hw->num_tx_sched_layers - ICE_AGG_LAYER_OFFSET;
 	return hw->sw_entry_point_layer;
 }
 
@@ -1515,10 +1510,11 @@ ice_sched_get_free_qparent(struct ice_port_info *pi, u16 vsi_handle, u8 tc,
 {
 	struct ice_sched_node *vsi_node, *qgrp_node;
 	struct ice_vsi_ctx *vsi_ctx;
+	u8 qgrp_layer, vsi_layer;
 	u16 max_children;
-	u8 qgrp_layer;
 
 	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);
@@ -1529,6 +1525,12 @@ ice_sched_get_free_qparent(struct ice_port_info *pi, u16 vsi_handle, u8 tc,
 	if (!vsi_node)
 		return NULL;
 
+	/* If the queue group and vsi layer are same then queues
+	 * are all attached directly to VSI
+	 */
+	if (qgrp_layer == vsi_layer)
+		return vsi_node;
+
 	/* get the first queue group node from VSI sub-tree */
 	qgrp_node = ice_sched_get_first_node(pi, vsi_node, qgrp_layer);
 	while (qgrp_node) {
@@ -3210,7 +3212,7 @@ ice_sched_add_rl_profile(struct ice_port_info *pi,
 	u8 profile_type;
 	int status;
 
-	if (layer_num >= ICE_AQC_TOPO_MAX_LEVEL_NUM)
+	if (!pi || layer_num >= pi->hw->num_tx_sched_layers)
 		return NULL;
 	switch (rl_type) {
 	case ICE_MIN_BW:
@@ -3226,8 +3228,6 @@ ice_sched_add_rl_profile(struct ice_port_info *pi,
 		return NULL;
 	}
 
-	if (!pi)
-		return NULL;
 	hw = pi->hw;
 	list_for_each_entry(rl_prof_elem, &pi->rl_prof_list[layer_num],
 			    list_entry)
@@ -3457,7 +3457,7 @@ ice_sched_rm_rl_profile(struct ice_port_info *pi, u8 layer_num, u8 profile_type,
 	struct ice_aqc_rl_profile_info *rl_prof_elem;
 	int status = 0;
 
-	if (layer_num >= ICE_AQC_TOPO_MAX_LEVEL_NUM)
+	if (layer_num >= pi->hw->num_tx_sched_layers)
 		return -EINVAL;
 	/* Check the existing list for RL profile */
 	list_for_each_entry(rl_prof_elem, &pi->rl_prof_list[layer_num],
Signature · 6 lines
2.37.2

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
#3 lore raw

PATCH v10 3/5 ice: Enable switching default tx scheduler topology

In reply to Michal Wilczynski

Introduce support for tx scheduler topology change, based on user selection, from default 9-layer to 5-layer. In order for switch to be successful there is a new NVM(version 3.20 or older) and DDP package(OS Package 1.3.29 or older).

Enable 5-layer topology switch in init path of the driver. To accomplish that upload of the DDP package needs to be delayed, until change in Tx topology is finished. To trigger the Tx change user selection should be changed in NVM using devlink. Then the platform should be rebooted.

---
 drivers/net/ethernet/intel/ice/ice_common.c |   2 +
 drivers/net/ethernet/intel/ice/ice_ddp.c    |   3 +-
 drivers/net/ethernet/intel/ice/ice_main.c   | 104 ++++++++++++++++----
 3 files changed, 89 insertions(+), 20 deletions(-)
drivers/net/ethernet/intel/ice/ice_common.c +2 -0
index 477a6b15100f..37f27b147122 100644
@@ -1696,6 +1696,8 @@ ice_aq_send_cmd(struct ice_hw *hw, struct ice_aq_desc *desc, void *buf,
 	case ice_aqc_opc_set_port_params:
 	case ice_aqc_opc_get_vlan_mode_parameters:
 	case ice_aqc_opc_set_vlan_mode_parameters:
+	case ice_aqc_opc_set_tx_topo:
+	case ice_aqc_opc_get_tx_topo:
 	case ice_aqc_opc_add_recipe:
 	case ice_aqc_opc_recipe_to_profile:
 	case ice_aqc_opc_get_recipe:
drivers/net/ethernet/intel/ice/ice_ddp.c +2 -1
index e9abbe428727..d83a5ad2fd51 100644
@@ -2065,7 +2065,8 @@ int ice_cfg_tx_topo(struct ice_hw *hw, u8 *buf, u32 len)
 	/* acquire global lock to make sure that set topology issued
 	 * by one PF
 	 */
-	status = ice_acquire_global_cfg_lock(hw, ICE_RES_WRITE);
+	status = ice_acquire_res(hw, ICE_GLOBAL_CFG_LOCK_RES_ID, ICE_RES_WRITE,
+				 ICE_GLOBAL_CFG_LOCK_TIMEOUT);
 	if (status) {
 		ice_debug(hw, ICE_DBG_INIT, "Failed to acquire global lock\n");
 		return status;
drivers/net/ethernet/intel/ice/ice_main.c +85 -19

134 lines not on this page · raw message

Signature · 6 lines
2.37.2

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
maintainer
#4 lore raw

Re: [Intel-wired-lan] [PATCH net-next v10 3/5] ice: Enable switching default tx scheduler topology

Quoted 22 lines · Michal Wilczynski

Introduce support for tx scheduler topology change, based on user selection, from default 9-layer to 5-layer. In order for switch to be successful there is a new NVM(version 3.20 or older) and DDP package(OS Package 1.3.29 or older).

Enable 5-layer topology switch in init path of the driver. To accomplish that upload of the DDP package needs to be delayed, until change in Tx topology is finished. To trigger the Tx change user selection should be changed in NVM using devlink. Then the platform should be rebooted.

---
  drivers/net/ethernet/intel/ice/ice_common.c |   2 +
  drivers/net/ethernet/intel/ice/ice_ddp.c    |   3 +-
  drivers/net/ethernet/intel/ice/ice_main.c   | 104 ++++++++++++++++----
  3 files changed, 89 insertions(+), 20 deletions(-)
drivers/net/ethernet/intel/ice/ice_common.c +0 -0
index 477a6b15100f..37f27b147122 100644

drivers/net/ethernet/intel/ice/ice_common.c ice_aq_send_cmd(struct ice_hw *hw, struct ice_aq_desc *desc, void *buf, · line 1700

Quoted 5 lines
drivers/net/ethernet/intel/ice/ice_common.c +2 -0
@@ -1696,6 +1696,8 @@ ice_aq_send_cmd(struct ice_hw *hw, struct ice_aq_desc *desc, void *buf,
  	case ice_aqc_opc_set_port_params:
  	case ice_aqc_opc_get_vlan_mode_parameters:
  	case ice_aqc_opc_set_vlan_mode_parameters:
+	case ice_aqc_opc_set_tx_topo:
+	case ice_aqc_opc_get_tx_topo:

Seems like this should be in patch 1?

Quoted 3 lines
drivers/net/ethernet/intel/ice/ice_common.c +0 -0
  	case ice_aqc_opc_add_recipe:
  	case ice_aqc_opc_recipe_to_profile:
  	case ice_aqc_opc_get_recipe:

[...]

Quoted 38 lines
drivers/net/ethernet/intel/ice/ice_common.c +26 -3
+/**
+ * ice_init_ddp_config - DDP related configuration
+ * @hw: pointer to the hardware structure
+ * @pf: pointer to pf structure
+ *
+ * This function loads DDP file from the disk, then initializes Tx
+ * topology. At the end DDP package is loaded on the card.
+ */
+static int ice_init_ddp_config(struct ice_hw *hw, struct ice_pf *pf)
+{
+	struct device *dev = ice_pf_to_dev(pf);
+	const struct firmware *firmware = NULL;
+	int err;
+
+	err = ice_request_fw(pf, &firmware);
+	if (err)
+		return err;
+
+	err = ice_init_tx_topology(hw, firmware);
  	if (err) {
-		dev_err(dev, "The DDP package file was not found or could not be read. Entering Safe Mode\n");
-		return;
+		dev_err(dev, "ice_init_hw during change of tx topology failed: %d\n",
+			err);
+		release_firmware(firmware);
+		return err;
  	}
 
-	/* request for firmware was successful. Download to device */
+	/* Download firmware to device */
  	ice_load_pkg(firmware, pf);
  	release_firmware(firmware);
+
+	return err;
  }
 
  /**

drivers/net/ethernet/intel/ice/ice_common.c static int ice_init_dev(struct ice_pf *pf) · line 4795

Quoted 5 lines
drivers/net/ethernet/intel/ice/ice_common.c +1 -1
@@ -4726,9 +4792,9 @@ static int ice_init_dev(struct ice_pf *pf)
 
  	ice_init_feature_support(pf);
 
-	ice_request_fw(pf);
+	ice_init_ddp_config(hw, pf);

This function returns a value, but it's not being used/checked. Should it be void or be used for the check below? I think former sounds better as checking safe mode, to set safe mode caps sounds safer :)

drivers/net/ethernet/intel/ice/ice_common.c static int ice_init_dev(struct ice_pf *pf) · line 4799

Quoted 6 lines
drivers/net/ethernet/intel/ice/ice_common.c +1 -1
-	/* if ice_request_fw fails, ICE_FLAG_ADV_FEATURES bit won't be
+	/* if ice_init_ddp_config fails, ICE_FLAG_ADV_FEATURES bit won't be
  	 * set in pf->state, which will cause ice_is_safe_mode to return
  	 * true
  	 */

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#5 lore raw

Re: [Intel-wired-lan] [PATCH net-next v10 3/5] ice: Enable switching default tx scheduler topology

Quoted 18 lines · Tony Nguyen
Quoted 17 lines · Michal Wilczynski

Introduce support for tx scheduler topology change, based on user selection, from default 9-layer to 5-layer. In order for switch to be successful there is a new NVM(version 3.20 or older) and DDP package(OS Package 1.3.29 or older).

Enable 5-layer topology switch in init path of the driver. To accomplish that upload of the DDP package needs to be delayed, until change in Tx topology is finished. To trigger the Tx change user selection should be changed in NVM using devlink. Then the platform should be rebooted.

---
  drivers/net/ethernet/intel/ice/ice_common.c |   2 + drivers/net/ethernet/intel/ice/ice_ddp.c    |   3 +- drivers/net/ethernet/intel/ice/ice_main.c   | 104 ++++++++++++++++----

  3 files changed, 89 insertions(+), 20 deletions(-)
Quoted 12 lines
Quoted 10 lines
drivers/net/ethernet/intel/ice/ice_common.c +0 -0
index 477a6b15100f..37f27b147122 100644
@@ -1696,6 +1696,8 @@ ice_aq_send_cmd(struct ice_hw *hw, struct ice_aq_desc *desc, void *buf,

      case ice_aqc_opc_set_port_params:
      case ice_aqc_opc_get_vlan_mode_parameters:
      case ice_aqc_opc_set_vlan_mode_parameters:
+    case ice_aqc_opc_set_tx_topo:
+    case ice_aqc_opc_get_tx_topo:

Seems like this should be in patch 1?

I suppose so, originally I wanted to preserve the patch as-is from OOT, as it was from another author, so that's why it ended here. Will fix this.

Quoted 40 lines
Quoted 4 lines

      case ice_aqc_opc_add_recipe:
      case ice_aqc_opc_recipe_to_profile:
      case ice_aqc_opc_get_recipe:

[...]

Quoted 33 lines
drivers/net/ethernet/intel/ice/ice_common.c +19 -0
+/**
+ * ice_init_ddp_config - DDP related configuration
+ * @hw: pointer to the hardware structure
+ * @pf: pointer to pf structure
+ *
+ * This function loads DDP file from the disk, then initializes Tx
+ * topology. At the end DDP package is loaded on the card.
+ */
+static int ice_init_ddp_config(struct ice_hw *hw, struct ice_pf *pf)
+{
+    struct device *dev = ice_pf_to_dev(pf);
+    const struct firmware *firmware = NULL;
+    int err;
+
+    err = ice_request_fw(pf, &firmware);
+    if (err)
+        return err;
+
+    err = ice_init_tx_topology(hw, firmware);

      if (err) {
-        dev_err(dev, "The DDP package file was not found or could not be read. Entering Safe Mode\n"); -        return;
+        dev_err(dev, "ice_init_hw during change of tx topology failed: %d\n",
+            err);
+        release_firmware(firmware);
+        return err;
      }
  -    /* request for firmware was successful. Download to device */
+    /* Download firmware to device */
      ice_load_pkg(firmware, pf);
      release_firmware(firmware);
+
+    return err;

Quoted 8 lines

drivers/net/ethernet/intel/ice/ice_common.c static int ice_init_dev(struct ice_pf *pf) · line 4794

Quoted 6 lines

  }
    /**

drivers/net/ethernet/intel/ice/ice_common.c +1 -0
@@ -4726,9 +4792,9 @@ static int ice_init_dev(struct ice_pf *pf)
         ice_init_feature_support(pf);
   -    ice_request_fw(pf);
+    ice_init_ddp_config(hw, pf);

This function returns a value, but it's not being used/checked. Should it be void or be used for the check below? I think former sounds better as checking safe mode, to set safe mode caps sounds safer :)

Well here the story is also convoluted ;), originally the return value was used, but then there was a bug in OOT, someone fixed it and it's left like this. Will fix this per your suggestion, feels safer as previous approach is already proven to introduce bugs

Quoted 6 lines
Quoted 6 lines

  -    /* if ice_request_fw fails, ICE_FLAG_ADV_FEATURES bit won't be +    /* if ice_init_ddp_config fails, ICE_FLAG_ADV_FEATURES bit won't be
       * set in pf->state, which will cause ice_is_safe_mode to return
       * true
       */

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#6 lore raw

Re: [Intel-wired-lan] [PATCH net-next v10 3/5] ice: Enable switching default tx scheduler topology

Quoted 79 lines · Michal
Quoted 18 lines · Tony Nguyen
Quoted 17 lines · Michal Wilczynski

Introduce support for tx scheduler topology change, based on user selection, from default 9-layer to 5-layer. In order for switch to be successful there is a new NVM(version 3.20 or older) and DDP package(OS Package 1.3.29 or older).

Enable 5-layer topology switch in init path of the driver. To accomplish that upload of the DDP package needs to be delayed, until change in Tx topology is finished. To trigger the Tx change user selection should be changed in NVM using devlink. Then the platform should be rebooted.

---
  drivers/net/ethernet/intel/ice/ice_common.c |   2 + drivers/net/ethernet/intel/ice/ice_ddp.c    |   3 +- drivers/net/ethernet/intel/ice/ice_main.c   | 104 ++++++++++++++++----

  3 files changed, 89 insertions(+), 20 deletions(-)
Quoted 11 lines
Quoted 10 lines
drivers/net/ethernet/intel/ice/ice_common.c +0 -0
index 477a6b15100f..37f27b147122 100644
@@ -1696,6 +1696,8 @@ ice_aq_send_cmd(struct ice_hw *hw, struct ice_aq_desc *desc, void *buf,

      case ice_aqc_opc_set_port_params:
      case ice_aqc_opc_get_vlan_mode_parameters:
      case ice_aqc_opc_set_vlan_mode_parameters:
+    case ice_aqc_opc_set_tx_topo:
+    case ice_aqc_opc_get_tx_topo:

Seems like this should be in patch 1?

I suppose so, originally I wanted to preserve the patch as-is from OOT, as it was from another author, so that's why it ended here. Will fix this.

Quoted 37 lines
Quoted 3 lines

      case ice_aqc_opc_add_recipe:
      case ice_aqc_opc_recipe_to_profile:
      case ice_aqc_opc_get_recipe:

[...]

Quoted 32 lines
drivers/net/ethernet/intel/ice/ice_common.c +19 -0
+/**
+ * ice_init_ddp_config - DDP related configuration
+ * @hw: pointer to the hardware structure
+ * @pf: pointer to pf structure
+ *
+ * This function loads DDP file from the disk, then initializes Tx
+ * topology. At the end DDP package is loaded on the card.
+ */
+static int ice_init_ddp_config(struct ice_hw *hw, struct ice_pf *pf)
+{
+    struct device *dev = ice_pf_to_dev(pf);
+    const struct firmware *firmware = NULL;
+    int err;
+
+    err = ice_request_fw(pf, &firmware);
+    if (err)
+        return err;
+
+    err = ice_init_tx_topology(hw, firmware);

      if (err) {
-        dev_err(dev, "The DDP package file was not found or could not be read. Entering Safe Mode\n"); -        return;
+        dev_err(dev, "ice_init_hw during change of tx topology failed: %d\n",
+            err);
+        release_firmware(firmware);
+        return err;
      }
  -    /* request for firmware was successful. Download to device */
+    /* Download firmware to device */
      ice_load_pkg(firmware, pf);
      release_firmware(firmware);
+

Quoted 8 lines

drivers/net/ethernet/intel/ice/ice_common.c static int ice_init_dev(struct ice_pf *pf) · line 4794

Quoted 7 lines

+    return err;
  }
    /**

drivers/net/ethernet/intel/ice/ice_common.c +1 -0
@@ -4726,9 +4792,9 @@ static int ice_init_dev(struct ice_pf *pf)
         ice_init_feature_support(pf);
   -    ice_request_fw(pf);
+    ice_init_ddp_config(hw, pf);

This function returns a value, but it's not being used/checked. Should it be void or be used for the check below? I think former sounds better as checking safe mode, to set safe mode caps sounds safer :)

Quoted 2 lines

Well here the story is also convoluted ;), originally the return value was used, but then there was a bug in OOT, someone fixed it and it's left like this. Will fix this per your suggestion, feels safer as previous approach is already proven to introduce bugs

Actually I've re-read the function and it seems to me like it needs to return value. The reason for it - it calls ice_init_hw(), if that fails we don't really want to go into safe mode. Instead we want to fail the driver load altogether, since it's much more serious fail than simply not being able to load the DDP package.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

  -    /* if ice_request_fw fails, ICE_FLAG_ADV_FEATURES bit won't be +    /* if ice_init_ddp_config fails, ICE_FLAG_ADV_FEATURES bit won't be
       * set in pf->state, which will cause ice_is_safe_mode to return
       * true
       */

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

maintainer
#7 lore raw

Re: [Intel-wired-lan] [PATCH net-next v10 3/5] ice: Enable switching default tx scheduler topology

Quoted 2 lines · Michal

Actually I've re-read the function and it seems to me like it needs to return value. The reason for it - it calls ice_init_hw(), if that fails we don't really want to go into safe mode. Instead we want to fail the driver load altogether, since it's much more serious fail than simply not being able to load the DDP package.

Sounds good to me; as long as it gets used :)

Thanks,
Tony
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#8 lore raw

PATCH v10 4/5 ice: Add txbalancing devlink param

In reply to Michal Wilczynski

From: Lukasz Czapnik <[email protected]>

It was observed that Tx performance was inconsistent across all queues and/or VSIs and that it was directly connected to existing 9-layer topology of the Tx scheduler.

Introduce new private devlink param - txbalance. This parameter gives user flexibility to choose the 5-layer transmit scheduler topology which helps to smooth out the transmit performance.

Allowed parameter values are true for enabled and false for disabled.

Example usage:

Show:
devlink dev param show pci/0000:4b:00.0 name txbalancing pci/0000:4b:00.0:
name txbalancing type driver-specific
values:
cmode permanent value true

Set:
devlink dev param set pci/0000:4b:00.0 name txbalancing value true cmode permanent

---
 .../net/ethernet/intel/ice/ice_adminq_cmd.h   |   9 +
 drivers/net/ethernet/intel/ice/ice_devlink.c  | 162 +++++++++++++++++-
 .../net/ethernet/intel/ice/ice_fw_update.c    |   2 +-
 .../net/ethernet/intel/ice/ice_fw_update.h    |   3 +
 drivers/net/ethernet/intel/ice/ice_nvm.c      |   2 +-
 drivers/net/ethernet/intel/ice/ice_nvm.h      |   3 +
 6 files changed, 178 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +9 -0
index ef2d30dc996d..740236b3f0fc 100644
@@ -1571,6 +1571,15 @@ struct ice_aqc_nvm {
 };
 
 #define ICE_AQC_NVM_START_POINT			0
+#define ICE_AQC_NVM_TX_TOPO_MOD_ID		0x14B
+
+struct ice_aqc_nvm_tx_topo_user_sel {
+	__le16 length;
+	u8 data;
+#define ICE_AQC_NVM_TX_TOPO_USER_SEL		BIT(4)
+
+	u8 reserved;
+};
 
 /* NVM Checksum Command (direct, 0x0706) */
 struct ice_aqc_nvm_checksum {
drivers/net/ethernet/intel/ice/ice_devlink.c +161 -1

174 lines not on this page · raw message

drivers/net/ethernet/intel/ice/ice_fw_update.c +1 -1
index 3dc5662d62a6..dc5b49104674 100644
@@ -286,7 +286,7 @@ ice_send_component_table(struct pldmfw *context, struct pldmfw_component *compon
  *
  * Returns: zero on success, or a negative error code on failure.
  */
-static int
+int
 ice_write_one_nvm_block(struct ice_pf *pf, u16 module, u32 offset,
 			u16 block_size, u8 *block, bool last_cmd,
 			u8 *reset_level, struct netlink_ext_ack *extack)
drivers/net/ethernet/intel/ice/ice_fw_update.h +3 -0
index 750574885716..04b200462757 100644
@@ -9,5 +9,8 @@ int ice_devlink_flash_update(struct devlink *devlink,
 			     struct netlink_ext_ack *extack);
 int ice_get_pending_updates(struct ice_pf *pf, u8 *pending,
 			    struct netlink_ext_ack *extack);
+int ice_write_one_nvm_block(struct ice_pf *pf, u16 module, u32 offset,
+			    u16 block_size, u8 *block, bool last_cmd,
+			    u8 *reset_level, struct netlink_ext_ack *extack);
 
 #endif
drivers/net/ethernet/intel/ice/ice_nvm.c +1 -1
index f6f52a248066..745f2459943f 100644
@@ -18,7 +18,7 @@
  *
  * Read the NVM using the admin queue commands (0x0701)
  */
-static int
+int
 ice_aq_read_nvm(struct ice_hw *hw, u16 module_typeid, u32 offset, u16 length,
 		void *data, bool last_command, bool read_shadow_ram,
 		struct ice_sq_cd *cd)
drivers/net/ethernet/intel/ice/ice_nvm.h +3 -0
index 774c2317967d..88978b9a95b1 100644
@@ -14,6 +14,9 @@ struct ice_orom_civd_info {
 
 int ice_acquire_nvm(struct ice_hw *hw, enum ice_aq_res_access_type access);
 void ice_release_nvm(struct ice_hw *hw);
+int ice_aq_read_nvm(struct ice_hw *hw, u16 module_typeid, u32 offset, u16 length,
+		    void *data, bool last_command, bool read_shadow_ram,
+		    struct ice_sq_cd *cd);
 int
 ice_read_flat_nvm(struct ice_hw *hw, u32 offset, u32 *length, u8 *data,
 		  bool read_shadow_ram);
Signature · 6 lines
2.37.2

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
maintainer
#9 lore raw

Re: [Intel-wired-lan] [PATCH net-next v10 4/5] ice: Add txbalancing devlink param

Quoted 1 line · Michal Wilczynski

From: Lukasz Czapnik <[email protected]>

[...]

drivers/net/ethernet/intel/ice/ice_devlink.c ice_devlink_port_unsplit(struct devlink *devlink, struct devlink_port *port, · line 827

Quoted 12 lines
drivers/net/ethernet/intel/ice/ice_devlink.c +12 -0
+/**
+ * ice_devlink_txbalance_get - Get txbalance parameter
+ * @devlink: pointer to the devlink instance
+ * @id: the parameter ID to set
+ * @ctx: context to store the parameter value
+ *
+ * Returns zero on success and negative value on failure.
+ */
+static int ice_devlink_txbalance_get(struct devlink *devlink, u32 id,
+				     struct devlink_param_gset_ctx *ctx)
+{
+	struct ice_pf *pf = (struct ice_pf *)devlink_priv(devlink);

The casting is unneeded... same for others below this.

Quoted 22 lines
drivers/net/ethernet/intel/ice/ice_devlink.c +22 -0
+	struct device *dev = ice_pf_to_dev(pf);
+	int status;
+
+	status = ice_get_tx_topo_user_sel(pf, &ctx->val.vbool);
+	if (status) {
+		dev_warn(dev, "Failed to read Tx Scheduler Tree - User Selection data from flash\n");
+		return -EIO;
+	}
+
+	return 0;
+}
+
+/**
+ * ice_devlink_txbalance_set - Set txbalance parameter
+ * @devlink: pointer to the devlink instance
+ * @id: the parameter ID to set
+ * @ctx: context to get the parameter value
+ *
+ * Returns zero on success and negative value on failure.
+ */
+static int ice_devlink_txbalance_set(struct devlink *devlink, u32 id,
+				     struct devlink_param_gset_ctx *ctx)

drivers/net/ethernet/intel/ice/ice_devlink.c ice_devlink_port_unsplit(struct devlink *devlink, struct devlink_port *port, · line 859

Quoted 10 lines
drivers/net/ethernet/intel/ice/ice_devlink.c +10 -0
+{
+	struct ice_pf *pf = (struct ice_pf *)devlink_priv(devlink);
+	struct device *dev = ice_pf_to_dev(pf);
+	int status;
+
+	status = ice_update_tx_topo_user_sel(pf, ctx->val.vbool);
+	if (status)
+		return -EIO;
+
+	dev_warn(dev, "Transmit balancing setting has been changed on this device. You must reboot the system for the change to take effect");

Does this need a newline?

Quoted 95 lines
drivers/net/ethernet/intel/ice/ice_devlink.c +40 -1
+
+	return 0;
+}
+
+/**
+ * ice_devlink_txbalance_validate - Validate passed txbalance parameter value
+ * @devlink: unused pointer to devlink instance
+ * @id: the parameter ID to validate
+ * @val: value to validate
+ * @extack: netlink extended ACK structure
+ *
+ * Supported values are:
+ * true - five layer, false - nine layer Tx Scheduler Topology Tree
+ *
+ * Returns zero when passed parameter value is supported. Negative value on
+ * error.
+ */
+static int ice_devlink_txbalance_validate(struct devlink *devlink, u32 id,
+					  union devlink_param_value val,
+					  struct netlink_ext_ack *extack)
+{
+	struct ice_pf *pf = (struct ice_pf *)devlink_priv(devlink);
+	struct ice_hw *hw = &pf->hw;
+
+	if (!hw->func_caps.common_cap.tx_sched_topo_comp_mode_en) {
+		NL_SET_ERR_MSG_MOD(extack,
+				   "Error: Requested feature is not supported by the FW on this device. Update the FW and run this command again.");
+		return -EOPNOTSUPP;
+	}
+
+	return 0;
+}
+
  /**
   * ice_tear_down_devlink_rate_tree - removes devlink-rate exported tree
   * @pf: pf struct
@@ -1391,7 +1545,13 @@ static const struct devlink_param ice_devlink_params[] = {
  			      ice_devlink_enable_iw_get,
  			      ice_devlink_enable_iw_set,
  			      ice_devlink_enable_iw_validate),
-
+	DEVLINK_PARAM_DRIVER(ICE_DEVLINK_PARAM_ID_TX_BALANCE,
+			     "txbalancing",
+			     DEVLINK_PARAM_TYPE_BOOL,
+			     BIT(DEVLINK_PARAM_CMODE_PERMANENT),
+			     ice_devlink_txbalance_get,
+			     ice_devlink_txbalance_set,
+			     ice_devlink_txbalance_validate),
  };
 
  static void ice_devlink_free(void *devlink_ptr)
drivers/net/ethernet/intel/ice/ice_fw_update.c +1 -1
index 3dc5662d62a6..dc5b49104674 100644
@@ -286,7 +286,7 @@ ice_send_component_table(struct pldmfw *context, struct pldmfw_component *compon
   *
   * Returns: zero on success, or a negative error code on failure.
   */
-static int
+int
  ice_write_one_nvm_block(struct ice_pf *pf, u16 module, u32 offset,
  			u16 block_size, u8 *block, bool last_cmd,
  			u8 *reset_level, struct netlink_ext_ack *extack)
drivers/net/ethernet/intel/ice/ice_fw_update.h +3 -0
index 750574885716..04b200462757 100644
@@ -9,5 +9,8 @@ int ice_devlink_flash_update(struct devlink *devlink,
  			     struct netlink_ext_ack *extack);
  int ice_get_pending_updates(struct ice_pf *pf, u8 *pending,
  			    struct netlink_ext_ack *extack);
+int ice_write_one_nvm_block(struct ice_pf *pf, u16 module, u32 offset,
+			    u16 block_size, u8 *block, bool last_cmd,
+			    u8 *reset_level, struct netlink_ext_ack *extack);
 
  #endif
drivers/net/ethernet/intel/ice/ice_nvm.c +1 -1
index f6f52a248066..745f2459943f 100644
@@ -18,7 +18,7 @@
   *
   * Read the NVM using the admin queue commands (0x0701)
   */
-static int
+int
  ice_aq_read_nvm(struct ice_hw *hw, u16 module_typeid, u32 offset, u16 length,
  		void *data, bool last_command, bool read_shadow_ram,
  		struct ice_sq_cd *cd)
drivers/net/ethernet/intel/ice/ice_nvm.h +0 -0
index 774c2317967d..88978b9a95b1 100644

drivers/net/ethernet/intel/ice/ice_nvm.h struct ice_orom_civd_info { · line 22

Quoted 9 lines
drivers/net/ethernet/intel/ice/ice_nvm.h +3 -0
@@ -14,6 +14,9 @@ struct ice_orom_civd_info {
 
  int ice_acquire_nvm(struct ice_hw *hw, enum ice_aq_res_access_type access);
  void ice_release_nvm(struct ice_hw *hw);
+int ice_aq_read_nvm(struct ice_hw *hw, u16 module_typeid, u32 offset, u16 length,
+		    void *data, bool last_command, bool read_shadow_ram,
+		    struct ice_sq_cd *cd);
  int
  ice_read_flat_nvm(struct ice_hw *hw, u32 offset, u32 *length, u8 *data,
  		  bool read_shadow_ram);

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#10 lore raw

Re: [Intel-wired-lan] [PATCH net-next v10 4/5] ice: Add txbalancing devlink param

Quoted 5 lines · Tony Nguyen
Quoted 1 line · Michal Wilczynski

From: Lukasz Czapnik <[email protected]>

[...]

Quoted 14 lines

drivers/net/ethernet/intel/ice/ice_devlink.c ice_devlink_port_unsplit(struct devlink *devlink, struct devlink_port *port, · line 827

Quoted 12 lines
drivers/net/ethernet/intel/ice/ice_devlink.c +12 -0
+/**
+ * ice_devlink_txbalance_get - Get txbalance parameter
+ * @devlink: pointer to the devlink instance
+ * @id: the parameter ID to set
+ * @ctx: context to store the parameter value
+ *
+ * Returns zero on success and negative value on failure.
+ */
+static int ice_devlink_txbalance_get(struct devlink *devlink, u32 id,
+                     struct devlink_param_gset_ctx *ctx)
+{
+    struct ice_pf *pf = (struct ice_pf *)devlink_priv(devlink);

The casting is unneeded... same for others below this.

Oh yeah, it's probably for our unit tests in OOT. Will remove this.

Quoted 27 lines
Quoted 27 lines

+    struct device *dev = ice_pf_to_dev(pf);
+    int status;

drivers/net/ethernet/intel/ice/ice_devlink.c +24 -0
+
+    status = ice_get_tx_topo_user_sel(pf, &ctx->val.vbool);
+    if (status) {
+        dev_warn(dev, "Failed to read Tx Scheduler Tree - User Selection data from flash\n");
+        return -EIO;
+    }
+
+    return 0;
+}
+
+/**
+ * ice_devlink_txbalance_set - Set txbalance parameter
+ * @devlink: pointer to the devlink instance
+ * @id: the parameter ID to set
+ * @ctx: context to get the parameter value
+ *
+ * Returns zero on success and negative value on failure.
+ */
+static int ice_devlink_txbalance_set(struct devlink *devlink, u32 id,
+                     struct devlink_param_gset_ctx *ctx)
+{
+    struct ice_pf *pf = (struct ice_pf *)devlink_priv(devlink);
+    struct device *dev = ice_pf_to_dev(pf);
+    int status;
Quoted 8 lines

drivers/net/ethernet/intel/ice/ice_devlink.c ice_devlink_port_unsplit(struct devlink *devlink, struct devlink_port *port, · line 859

Quoted 6 lines
drivers/net/ethernet/intel/ice/ice_devlink.c +6 -0
+
+    status = ice_update_tx_topo_user_sel(pf, ctx->val.vbool);
+    if (status)
+        return -EIO;
+
+    dev_warn(dev, "Transmit balancing setting has been changed on this device. You must reboot the system for the change to take effect");

Does this need a newline?

I think so, usually I run checkpatch without any extra arguments so maybe that's why it didn't catch it, but still it seems like the line should be over 100 characters

Quoted 94 lines
Quoted 94 lines
drivers/net/ethernet/intel/ice/ice_devlink.c +33 -0
+
+    return 0;
+}
+
+/**
+ * ice_devlink_txbalance_validate - Validate passed txbalance parameter value
+ * @devlink: unused pointer to devlink instance
+ * @id: the parameter ID to validate
+ * @val: value to validate
+ * @extack: netlink extended ACK structure
+ *
+ * Supported values are:
+ * true - five layer, false - nine layer Tx Scheduler Topology Tree
+ *
+ * Returns zero when passed parameter value is supported. Negative value on
+ * error.
+ */
+static int ice_devlink_txbalance_validate(struct devlink *devlink, u32 id,
+                      union devlink_param_value val,
+                      struct netlink_ext_ack *extack)
+{
+    struct ice_pf *pf = (struct ice_pf *)devlink_priv(devlink);
+    struct ice_hw *hw = &pf->hw;
+
+    if (!hw->func_caps.common_cap.tx_sched_topo_comp_mode_en) {
+        NL_SET_ERR_MSG_MOD(extack,
+                   "Error: Requested feature is not supported by the FW on this device. Update the FW and run this command again.");
+        return -EOPNOTSUPP;
+    }
+
+    return 0;
+}
+

  /**
   * ice_tear_down_devlink_rate_tree - removes devlink-rate exported tree
   * @pf: pf struct

drivers/net/ethernet/intel/ice/ice_devlink.c +7 -1
@@ -1391,7 +1545,13 @@ static const struct devlink_param ice_devlink_params[] = {
                     ice_devlink_enable_iw_get,
                     ice_devlink_enable_iw_set,
                     ice_devlink_enable_iw_validate),
-
+    DEVLINK_PARAM_DRIVER(ICE_DEVLINK_PARAM_ID_TX_BALANCE,
+                 "txbalancing",
+                 DEVLINK_PARAM_TYPE_BOOL,
+                 BIT(DEVLINK_PARAM_CMODE_PERMANENT),
+                 ice_devlink_txbalance_get,
+                 ice_devlink_txbalance_set,
+                 ice_devlink_txbalance_validate),
   };
     static void ice_devlink_free(void *devlink_ptr)
drivers/net/ethernet/intel/ice/ice_fw_update.c +1 -1
index 3dc5662d62a6..dc5b49104674 100644
@@ -286,7 +286,7 @@ ice_send_component_table(struct pldmfw *context, struct pldmfw_component *compon
    *
    * Returns: zero on success, or a negative error code on failure.
    */
-static int
+int
   ice_write_one_nvm_block(struct ice_pf *pf, u16 module, u32 offset,
               u16 block_size, u8 *block, bool last_cmd,
               u8 *reset_level, struct netlink_ext_ack *extack)
drivers/net/ethernet/intel/ice/ice_fw_update.h +3 -0
index 750574885716..04b200462757 100644
@@ -9,5 +9,8 @@ int ice_devlink_flash_update(struct devlink *devlink,
                    struct netlink_ext_ack *extack);
   int ice_get_pending_updates(struct ice_pf *pf, u8 *pending,
                   struct netlink_ext_ack *extack);
+int ice_write_one_nvm_block(struct ice_pf *pf, u16 module, u32 offset,
+                u16 block_size, u8 *block, bool last_cmd,
+                u8 *reset_level, struct netlink_ext_ack *extack);
     #endif
drivers/net/ethernet/intel/ice/ice_nvm.c +1 -1
index f6f52a248066..745f2459943f 100644
@@ -18,7 +18,7 @@
    *
    * Read the NVM using the admin queue commands (0x0701)
    */
-static int
+int
   ice_aq_read_nvm(struct ice_hw *hw, u16 module_typeid, u32 offset, u16 length,
           void *data, bool last_command, bool read_shadow_ram,
           struct ice_sq_cd *cd)
drivers/net/ethernet/intel/ice/ice_nvm.h +0 -0
index 774c2317967d..88978b9a95b1 100644
@@ -14,6 +14,9 @@ struct ice_orom_civd_info {
Quoted 8 lines
Quoted 8 lines
drivers/net/ethernet/intel/ice/ice_nvm.h +3 -0
     int ice_acquire_nvm(struct ice_hw *hw, enum ice_aq_res_access_type access);
   void ice_release_nvm(struct ice_hw *hw);
+int ice_aq_read_nvm(struct ice_hw *hw, u16 module_typeid, u32 offset, u16 length,
+            void *data, bool last_command, bool read_shadow_ram,
+            struct ice_sq_cd *cd);

  int
  ice_read_flat_nvm(struct ice_hw *hw, u32 offset, u32 *length, u8 *data, bool read_shadow_ram);

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#11 lore raw

PATCH v10 5/5 ice: Document txbalancing parameter

In reply to Michal Wilczynski

New driver specific parameter 'txbalancing' was introduced. Describe parameter in the documentation.

---
 Documentation/networking/devlink/ice.rst | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
Documentation/networking/devlink/ice.rst +17 -0
index 10f282c2117c..6ffe230f71a5 100644
@@ -7,6 +7,23 @@ ice devlink support
 This document describes the devlink features implemented by the ``ice``
 device driver.
 
+Parameters
+=============
+
+.. list-table:: Driver-specific parameters implemented
+   :widths: 5 5 5 85
+
+   * - Name
+     - Type
+     - Mode
+     - Description
+   * - ``txbalancing``
+     - Boolean
+     - permanent
+     - This parameter gives user flexibility to choose the 5-layer
+       transmit scheduler topology which helps to smooth out the transmit
+       performance.
+
 Info versions
 =============
 
Signature · 6 lines
2.37.2

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
maintainer
#12 lore raw

Re: [Intel-wired-lan] [PATCH net-next v10 5/5] ice: Document txbalancing parameter

Quoted 22 lines · Michal Wilczynski

New driver specific parameter 'txbalancing' was introduced. Describe parameter in the documentation.

---
  Documentation/networking/devlink/ice.rst | 17 +++++++++++++++++
  1 file changed, 17 insertions(+)
Documentation/networking/devlink/ice.rst +6 -0
index 10f282c2117c..6ffe230f71a5 100644
@@ -7,6 +7,23 @@ ice devlink support
  This document describes the devlink features implemented by the ``ice``
  device driver.
 
+Parameters
+=============
+
+.. list-table:: Driver-specific parameters implemented
+   :widths: 5 5 5 85
+

Documentation/networking/devlink/ice.rst ice devlink support · line 25

Quoted 10 lines
Documentation/networking/devlink/ice.rst +10 -0
+   * - Name
+     - Type
+     - Mode
+     - Description
+   * - ``txbalancing``
+     - Boolean
+     - permanent
+     - This parameter gives user flexibility to choose the 5-layer
+       transmit scheduler topology which helps to smooth out the transmit
+       performance.

I feel like there should be some explanation (here or in the driver documentation) of the difference/trade-off between 9 and 5 layer. Why would I ever want 9 layer?

Documentation/networking/devlink/ice.rst ice devlink support · line 29

Quoted 4 lines
Documentation/networking/devlink/ice.rst +1 -0
+
  Info versions
  =============
 

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#13 lore raw

Re: [Intel-wired-lan] [PATCH net-next v10 5/5] ice: Document txbalancing parameter

Quoted 28 lines · Tony Nguyen
Quoted 25 lines · Michal Wilczynski

New driver specific parameter 'txbalancing' was introduced. Describe parameter in the documentation.

---
  Documentation/networking/devlink/ice.rst | 17 +++++++++++++++++

  1 file changed, 17 insertions(+)
Documentation/networking/devlink/ice.rst +0 -0
index 10f282c2117c..6ffe230f71a5 100644
@@ -7,6 +7,23 @@ ice devlink support

  This document describes the devlink features implemented by the ``ice`` device driver.
  +Parameters
+=============

Documentation/networking/devlink/ice.rst +8 -0
+
+.. list-table:: Driver-specific parameters implemented
+   :widths: 5 5 5 85
+
+   * - Name
+     - Type
+     - Mode
+     - Description
Quoted 8 lines
Quoted 6 lines

+   * - ``txbalancing``
+     - Boolean
+     - permanent
+     - This parameter gives user flexibility to choose the 5-layer +       transmit scheduler topology which helps to smooth out the transmit +       performance.

I feel like there should be some explanation (here or in the driver documentation) of the difference/trade-off between 9 and 5 layer. Why would I ever want 9 layer?

Sure, will dig some details and put a more useful info here.

Overall thanks for reviewing Tony !

BR,
Michał

Quoted 5 lines
Quoted 5 lines

+
  Info versions
  =============

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan