Skip to contentSkip to conversation

net/ice: Update base code with latest snapshot.

RFC In review Ian Stokes 6 participants 428 messages May 1, 2024 – Jun 28, 2024 Page 5 of 5

Subsystems (3)
lore
Share & tools
lore
#380 lore raw

PATCH v4 63/103 net/ice/base: enable SB access explicitly before 1st PHY access

In reply to Anatoly Burakov

From: Sergey Temerkhanov <[email protected]>

Explicitly enable sideband device access before the first PHY access to avoid possible errors for ETH56G.

---
 drivers/net/ice/base/ice_ptp_hw.c | 38 +++++++++++++++++++++++--------
 1 file changed, 29 insertions(+), 9 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +29 -9
index 0eb14c1b41..06e9bec4eb 100644
@@ -2148,6 +2148,33 @@ ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool bypass)
 	return 0;
 }
 
+/**
+ * ice_sb_access_ena_eth56g - Enable SB devices (PHY and others) access
+ * @hw: pointer to HW struct
+ * @enable: Enable or disable access
+ *
+ * Enable sideband devices (PHY and others) access.
+ */
+static void ice_sb_access_ena_eth56g(struct ice_hw *hw, bool enable)
+{
+	u32 regval;
+
+	/* Enable reading and writing switch and PHY registers over the
+	 * sideband queue.
+	 */
+#define PF_SB_REM_DEV_CTL_SWITCH_READ BIT(1)
+#define PF_SB_REM_DEV_CTL_PHY0 BIT(2)
+	regval = rd32(hw, PF_SB_REM_DEV_CTL);
+	if (enable)
+		regval |= (PF_SB_REM_DEV_CTL_SWITCH_READ |
+			   PF_SB_REM_DEV_CTL_PHY0);
+	else
+		regval &= ~(PF_SB_REM_DEV_CTL_SWITCH_READ |
+			    PF_SB_REM_DEV_CTL_PHY0);
+
+	wr32(hw, PF_SB_REM_DEV_CTL, regval);
+}
+
 /**
  * ice_ptp_init_phc_eth56g - Perform E822 specific PHC initialization
  * @hw: pointer to HW struct
@@ -2157,15 +2184,6 @@ ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool bypass)
 static int ice_ptp_init_phc_eth56g(struct ice_hw *hw)
 {
 	int err = 0;
-	u32 regval;
-
-	/* Enable reading switch and PHY registers over the sideband queue */
-#define PF_SB_REM_DEV_CTL_SWITCH_READ BIT(1)
-#define PF_SB_REM_DEV_CTL_PHY0 BIT(2)
-	regval = rd32(hw, PF_SB_REM_DEV_CTL);
-	regval |= (PF_SB_REM_DEV_CTL_SWITCH_READ |
-		   PF_SB_REM_DEV_CTL_PHY0);
-	wr32(hw, PF_SB_REM_DEV_CTL, regval);
 
 	/* Initialize the Clock Generation Unit */
 	err = ice_init_cgu_e82x(hw);
@@ -2206,6 +2224,8 @@ int ice_ptp_init_phy_model(struct ice_hw *hw)
 	int err;
 	u32 phy_rev;
 
+	ice_sb_access_ena_eth56g(hw, true);
+
 	err = ice_read_phy_eth56g_raw_lp(hw, PHY_REG_REVISION, &phy_rev,
 					    true);
 	if (err)
Signature · 1 line
2.43.0
#381 lore raw

PATCH v4 64/103 net/ice/base: refactor ETH56G PHY initialization

In reply to Anatoly Burakov

From: Sergey Temerkhanov <[email protected]>

Assign the ETH56G PHY address according to the PCI IDs in preparation for further changes.

---
 drivers/net/ice/base/ice_ptp_hw.c  | 39 +++++++++++++++++++-----------
 drivers/net/ice/base/ice_ptp_hw.h  |  2 +-
 drivers/net/ice/base/ice_sbq_cmd.h |  2 +-
 drivers/net/ice/base/ice_type.h    |  1 +
 4 files changed, 28 insertions(+), 16 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +25 -14
index 06e9bec4eb..17193feaa8 100644
@@ -940,7 +940,7 @@ ice_write_phy_eth56g_raw_lp(struct ice_hw *hw,  u32 reg_addr, u32 val,
 	phy_msg.msg_addr_high = ICE_HI_WORD(reg_addr);
 
 	phy_msg.data = val;
-	phy_msg.dest_dev = phy_56g;
+	phy_msg.dest_dev = hw->phy_addr;
 
 	err = ice_sbq_rw_reg_lp(hw, &phy_msg, lock_sbq);
 
@@ -970,7 +970,7 @@ ice_read_phy_eth56g_raw_lp(struct ice_hw *hw, u32 reg_addr, u32 *val,
 	phy_msg.msg_addr_low = ICE_LO_WORD(reg_addr);
 	phy_msg.msg_addr_high = ICE_HI_WORD(reg_addr);
 
-	phy_msg.dest_dev = phy_56g;
+	phy_msg.dest_dev = hw->phy_addr;
 
 	err = ice_sbq_rw_reg_lp(hw, &phy_msg, lock_sbq);
 
@@ -2212,6 +2212,8 @@ ice_ptp_read_tx_hwtstamp_status_eth56g(struct ice_hw *hw, u32 *ts_err)
 	return 0;
 }
 
+#define ICE_DEVID_MASK 0xFFF8
+
 /**
  * ice_ptp_init_phy_model - Initialize hw->phy_model based on device type
   * @hw: pointer to the HW struct
@@ -2219,31 +2221,40 @@ ice_ptp_read_tx_hwtstamp_status_eth56g(struct ice_hw *hw, u32 *ts_err)
  * Determine the PHY configuration for the device, and initialize hw->phy_model
  * for use by other functions.
  */
-int ice_ptp_init_phy_model(struct ice_hw *hw)
+void ice_ptp_init_phy_model(struct ice_hw *hw)
 {
-	int err;
 	u32 phy_rev;
 
-	ice_sb_access_ena_eth56g(hw, true);
+	switch (hw->device_id & ICE_DEVID_MASK) {
+	case ICE_DEV_ID_E825C_BACKPLANE & ICE_DEVID_MASK:
+		hw->phy_addr = eth56g_dev_0;
+		break;
+	default:
+		hw->phy_addr = 0;
+	}
 
-	err = ice_read_phy_eth56g_raw_lp(hw, PHY_REG_REVISION, &phy_rev,
-					    true);
-	if (err)
-		return err;
+	if (hw->phy_addr) {
+		int err;
 
-	if (phy_rev == PHY_REVISION_ETH56G) {
-		hw->phy_model = ICE_PHY_ETH56G;
-		return 0;
+		ice_sb_access_ena_eth56g(hw, true);
+		err = ice_read_phy_eth56g_raw_lp(hw, PHY_REG_REVISION,
+						 &phy_rev, true);
+		if (err)
+			return;
+
+		if (phy_rev == PHY_REVISION_ETH56G) {
+			hw->phy_model = ICE_PHY_ETH56G;
+			return;
+		}
 	}
 
 	if (ice_is_e810(hw))
 		hw->phy_model = ICE_PHY_E810;
 	else
 		hw->phy_model = ICE_PHY_E822;
+
 	hw->phy_ports = ICE_NUM_EXTERNAL_PORTS;
 	hw->max_phy_port = ICE_NUM_EXTERNAL_PORTS;
-
-	return 0;
 }
 
 /* ----------------------------------------------------------------------------
drivers/net/ice/base/ice_ptp_hw.h +1 -1
index c4fb62a3f1..f3c0846255 100644
@@ -296,7 +296,7 @@ ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool bypass);
 int ice_phy_cfg_tx_offset_eth56g(struct ice_hw *hw, u8 port);
 int ice_phy_cfg_rx_offset_eth56g(struct ice_hw *hw, u8 port);
 
-int ice_ptp_init_phy_model(struct ice_hw *hw);
+void ice_ptp_init_phy_model(struct ice_hw *hw);
 
 #define PFTSYN_SEM_BYTES	4
 
drivers/net/ice/base/ice_sbq_cmd.h +1 -1
index 4da16caf70..aad77af9a1 100644
@@ -48,7 +48,7 @@ struct ice_sbq_evt_desc {
 };
 
 enum ice_sbq_msg_dev {
-	phy_56g = 0x02,
+	eth56g_dev_0 = 0x02,
 	rmn_0	= 0x02,
 	rmn_1	= 0x03,
 	rmn_2	= 0x04,
drivers/net/ice/base/ice_type.h +1 -0
index b55b923055..9bccced824 100644
@@ -1269,6 +1269,7 @@ struct ice_hw {
 
 	u8 pf_id;		/* device profile info */
 	enum ice_phy_model phy_model;
+	u8 phy_addr;	/* PHY address */
 	u8 phy_ports;
 	u8 max_phy_port;
 	u8 logical_pf_id;
Signature · 1 line
2.43.0
#382 lore raw

PATCH v4 65/103 net/ice/base: refactor ETH56G support for multiple PHYs per MAC

In reply to Anatoly Burakov

From: Sergey Temerkhanov <[email protected]>

Support configurations with multiple ETH56G PHYs per a MAC complex. These PHYs have their own addresses and are supposed to have their ports numbered contiguously. This commit mainly provides port number translation for these configurations.

Also, handle dual NAC correctly for max PHY ports as they differ from everything else.

---
 drivers/net/ice/base/ice_ptp_hw.c  | 234 ++++++++++++++++++-----------
 drivers/net/ice/base/ice_sbq_cmd.h |   3 +-
 drivers/net/ice/base/ice_status.h  |   2 +
 drivers/net/ice/base/ice_type.h    |  24 ++-
 4 files changed, 175 insertions(+), 88 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +149 -85
index 17193feaa8..df3e3e77bd 100644
@@ -911,8 +911,13 @@ static void ice_ptp_exec_tmr_cmd(struct ice_hw *hw)
 	ice_flush(hw);
 }
 
+enum eth56g_res_type {
+	ETH56G_PHY_REG,
+	ETH56G_PHY_MEM,
+};
+
 /* 56G PHY access functions */
-static const u32 eth56g_port_base[ICE_NUM_PHY_PORTS] = {
+static const u32 ice_eth56g_port_base[ICE_NUM_PHY_PORTS] = {
 	ICE_PHY0_BASE,
 	ICE_PHY1_BASE,
 	ICE_PHY2_BASE,
@@ -923,13 +928,14 @@ static const u32 eth56g_port_base[ICE_NUM_PHY_PORTS] = {
 /**
  * ice_write_phy_eth56g_raw_lp - Write a PHY port register with lock parameter
  * @hw: pointer to the HW struct
+ * @phy_index: PHY index
  * @reg_addr: PHY register address
  * @val: Value to write
  * @lock_sbq: true to lock the sideband queue
  */
 static int
-ice_write_phy_eth56g_raw_lp(struct ice_hw *hw,  u32 reg_addr, u32 val,
-			    bool lock_sbq)
+ice_write_phy_eth56g_raw_lp(struct ice_hw *hw, u8 phy_index, u32 reg_addr,
+			    u32 val, bool lock_sbq)
 {
 	struct ice_sbq_msg_input phy_msg;
 	int err;
@@ -940,7 +946,7 @@ ice_write_phy_eth56g_raw_lp(struct ice_hw *hw,  u32 reg_addr, u32 val,
 	phy_msg.msg_addr_high = ICE_HI_WORD(reg_addr);
 
 	phy_msg.data = val;
-	phy_msg.dest_dev = hw->phy_addr;
+	phy_msg.dest_dev = hw->phy_addr[phy_index];
 
 	err = ice_sbq_rw_reg_lp(hw, &phy_msg, lock_sbq);
 
@@ -954,13 +960,14 @@ ice_write_phy_eth56g_raw_lp(struct ice_hw *hw,  u32 reg_addr, u32 val,
 /**
  * ice_read_phy_eth56g_raw_lp - Read a PHY port register with lock parameter
  * @hw: pointer to the HW struct
- * @reg_addr: PHY port register address
- * @val: Pointer to the value to read (out param)
+ * @phy_index: PHY index
+ * @reg_addr: PHY register address
+ * @val: Value to write
  * @lock_sbq: true to lock the sideband queue
  */
 static int
-ice_read_phy_eth56g_raw_lp(struct ice_hw *hw, u32 reg_addr, u32 *val,
-			   bool lock_sbq)
+ice_read_phy_eth56g_raw_lp(struct ice_hw *hw, u8 phy_index, u32 reg_addr,
+			   u32 *val, bool lock_sbq)
 {
 	struct ice_sbq_msg_input phy_msg;
 	int err;
@@ -970,7 +977,8 @@ ice_read_phy_eth56g_raw_lp(struct ice_hw *hw, u32 reg_addr, u32 *val,
 	phy_msg.msg_addr_low = ICE_LO_WORD(reg_addr);
 	phy_msg.msg_addr_high = ICE_HI_WORD(reg_addr);
 
-	phy_msg.dest_dev = hw->phy_addr;
+	phy_msg.data = 0;
+	phy_msg.dest_dev = hw->phy_addr[phy_index];
 
 	err = ice_sbq_rw_reg_lp(hw, &phy_msg, lock_sbq);
 
@@ -986,47 +994,95 @@ ice_read_phy_eth56g_raw_lp(struct ice_hw *hw, u32 reg_addr, u32 *val,
 /**
  * ice_phy_port_reg_address_eth56g - Calculate a PHY port register address
  * @port: Port number to be written
+ * @res_type: resource type (register/memory)
  * @offset: Offset from PHY port register base
  * @address: The result address
  */
 static int
-ice_phy_port_reg_address_eth56g(u8 port, u16 offset, u32 *address)
+ice_phy_port_res_address_eth56g(u8 port, enum eth56g_res_type res_type,
+				u16 offset, u32 *address)
 {
 	u8 phy, lane;
 
-	if (port >= ICE_NUM_EXTERNAL_PORTS)
-		return ICE_ERR_OUT_OF_RANGE;
-
 	phy = port / ICE_PORTS_PER_QUAD;
 	lane = port % ICE_PORTS_PER_QUAD;
 
-	*address = offset + eth56g_port_base[phy] +
-		   PHY_PTP_LANE_ADDR_STEP * lane;
+	switch (res_type) {
+	case ETH56G_PHY_REG:
+		*address = offset + ice_eth56g_port_base[phy] +
+			   PHY_PTP_LANE_ADDR_STEP * lane;
+		break;
+	case ETH56G_PHY_MEM:
+		*address = offset + ice_eth56g_port_base[phy] +
+			   PHY_PTP_MEM_START + PHY_PTP_MEM_LANE_STEP * lane;
+		break;
+	default:
+		return ICE_ERR_PARAM;
+	}
 
 	return 0;
 }
 
 /**
- * ice_phy_port_mem_address_eth56g - Calculate a PHY port memory address
- * @port: Port number to be written
- * @offset: Offset from PHY port register base
- * @address: The result address
+ * ice_write_phy_port_eth56g_lp - Write a PHY port register with lock parameter
+ * @hw: pointer to the HW struct
+ * @reg_offs: PHY register offset
+ * @port: Port number
+ * @val: Value to write
+ * @res_type: resource type (register/memory)
+ * @lock_sbq: true to lock the sideband queue
  */
 static int
-ice_phy_port_mem_address_eth56g(u8 port, u16 offset, u32 *address)
+ice_write_phy_port_eth56g_lp(struct ice_hw *hw, u8 port, u32 reg_offs, u32 val,
+			     enum eth56g_res_type res_type, bool lock_sbq)
 {
-	u8 phy, lane;
+	u8 phy_index = port / hw->phy_ports;
+	u8 phy_port = port % hw->phy_ports;
+	int err;
+	u32 reg_addr;
 
-	if (port >= ICE_NUM_EXTERNAL_PORTS)
+	if (port >= hw->max_phy_port)
 		return ICE_ERR_OUT_OF_RANGE;
 
-	phy = port / ICE_PORTS_PER_QUAD;
-	lane = port % ICE_PORTS_PER_QUAD;
+	err = ice_phy_port_res_address_eth56g(phy_port, res_type, reg_offs,
+					      &reg_addr);
 
-	*address = offset + eth56g_port_base[phy] +
-		   PHY_PTP_MEM_START + PHY_PTP_MEM_LANE_STEP * lane;
+	if (err)
+		return err;
 
-	return 0;
+	return ice_write_phy_eth56g_raw_lp(hw, phy_index, reg_addr, val,
+					   lock_sbq);
+}
+
+/**
+ * ice_read_phy_port_eth56g_lp - Read a PHY port register with lock parameter
+ * @hw: pointer to the HW struct
+ * @reg_offs: PHY register offset
+ * @port: Port number
+ * @val: Value to write
+ * @res_type: resource type (register/memory)
+ * @lock_sbq: true to lock the sideband queue
+ */
+static int
+ice_read_phy_port_eth56g_lp(struct ice_hw *hw, u8 port, u32 reg_offs, u32 *val,
+			    enum eth56g_res_type res_type, bool lock_sbq)
+{
+	u8 phy_index = port / hw->phy_ports;
+	u8 phy_port = port % hw->phy_ports;
+	int err;
+	u32 reg_addr;
+
+	if (port >= hw->max_phy_port)
+		return ICE_ERR_OUT_OF_RANGE;
+
+	err = ice_phy_port_res_address_eth56g(phy_port, res_type, reg_offs,
+					      &reg_addr);
+
+	if (err)
+		return err;
+
+	return ice_read_phy_eth56g_raw_lp(hw, phy_index, reg_addr, val,
+					  lock_sbq);
 }
 
 /**
@@ -1041,14 +1097,8 @@ static int
 ice_write_phy_reg_eth56g_lp(struct ice_hw *hw, u8 port, u16 offset, u32 val,
 			    bool lock_sbq)
 {
-	int err;
-	u32 reg_addr;
-
-	err = ice_phy_port_reg_address_eth56g(port, offset, &reg_addr);
-	if (err)
-		return err;
-
-	return ice_write_phy_eth56g_raw_lp(hw, reg_addr, val, lock_sbq);
+	return ice_write_phy_port_eth56g_lp(hw, port, offset, val,
+					    ETH56G_PHY_REG, lock_sbq);
 }
 
 /**
@@ -1077,14 +1127,8 @@ static int
 ice_read_phy_reg_eth56g_lp(struct ice_hw *hw, u8 port, u16 offset, u32 *val,
 			   bool lock_sbq)
 {
-	int err;
-	u32 reg_addr;
-
-	err = ice_phy_port_reg_address_eth56g(port, offset, &reg_addr);
-	if (err)
-		return err;
-
-	return ice_read_phy_eth56g_raw_lp(hw, reg_addr, val, lock_sbq);
+	return ice_read_phy_port_eth56g_lp(hw, port, offset, val,
+					   ETH56G_PHY_REG, lock_sbq);
 }
 
 /**
@@ -1113,14 +1157,8 @@ static int
 ice_phy_port_mem_read_eth56g_lp(struct ice_hw *hw, u8 port, u16 offset,
 				u32 *val, bool lock_sbq)
 {
-	int err;
-	u32 mem_addr;
-
-	err = ice_phy_port_mem_address_eth56g(port, offset, &mem_addr);
-	if (err)
-		return err;
-
-	return ice_read_phy_eth56g_raw_lp(hw, mem_addr, val, lock_sbq);
+	return ice_read_phy_port_eth56g_lp(hw, port, offset, val,
+					   ETH56G_PHY_MEM, lock_sbq);
 }
 
 /**
@@ -1150,14 +1188,8 @@ static int
 ice_phy_port_mem_write_eth56g_lp(struct ice_hw *hw, u8 port, u16 offset,
 				 u32 val, bool lock_sbq)
 {
-	int err;
-	u32 mem_addr;
-
-	err = ice_phy_port_mem_address_eth56g(port, offset, &mem_addr);
-	if (err)
-		return err;
-
-	return ice_write_phy_eth56g_raw_lp(hw, mem_addr, val, lock_sbq);
+	return ice_write_phy_port_eth56g_lp(hw, port, offset, val,
+					    ETH56G_PHY_MEM, lock_sbq);
 }
 
 /**
@@ -2192,22 +2224,35 @@ static int ice_ptp_init_phc_eth56g(struct ice_hw *hw)
 }
 
 /**
- * ice_ptp_read_tx_hwtstamp_status_eth56g - Get the current TX timestamp
- * err mask. Returns the mask of ports where TX timestamps are available
+ * ice_ptp_read_tx_hwtstamp_status_eth56g - Get TX timestamp status
  * @hw: pointer to the HW struct
- * @ts_err: the timestamp mask pointer
+ * @ts_status: the timestamp mask pointer
+ *
+ * Read the PHY Tx timestamp status mask indicating which ports have Tx
+ * timestamps available.
  */
 int
-ice_ptp_read_tx_hwtstamp_status_eth56g(struct ice_hw *hw, u32 *ts_err)
+ice_ptp_read_tx_hwtstamp_status_eth56g(struct ice_hw *hw, u32 *ts_status)
 {
-	int err;
+	u32 curr_status;
+	u8 phy, mask;
 
-	err = ice_read_phy_eth56g_raw_lp(hw, PHY_PTP_INT_STATUS, ts_err,
-					    true);
-	if (err)
-		return err;
+	mask = (1 << hw->phy_ports) - 1;
+	*ts_status = 0;
 
-	ice_debug(hw, ICE_DBG_PTP, "PHY interrupt err: %x\n", *ts_err);
+	for (phy = 0; phy < hw->num_phys; phy++) {
+		int err;
+
+		err = ice_read_phy_eth56g_raw_lp(hw, phy, PHY_PTP_INT_STATUS,
+						 &curr_status, true);
+
+		if (err)
+			return err;
+
+		*ts_status |= (curr_status & mask) << (phy * hw->phy_ports);
+	}
+
+	ice_debug(hw, ICE_DBG_PTP, "PHY interrupt err: %x\n", *ts_status);
 
 	return 0;
 }
@@ -2216,37 +2261,56 @@ ice_ptp_read_tx_hwtstamp_status_eth56g(struct ice_hw *hw, u32 *ts_err)
 
 /**
  * ice_ptp_init_phy_model - Initialize hw->phy_model based on device type
-  * @hw: pointer to the HW struct
+ * @hw: pointer to the HW structure
  *
- * Determine the PHY configuration for the device, and initialize hw->phy_model
+ * Determine the PHY model for the device, and initialize hw->phy_model
  * for use by other functions.
  */
 void ice_ptp_init_phy_model(struct ice_hw *hw)
 {
-	u32 phy_rev;
+	unsigned int phy;
+
+	for (phy = 0; phy < MAX_PHYS_PER_ICE; phy++)
+		hw->phy_addr[phy] = 0;
 
 	switch (hw->device_id & ICE_DEVID_MASK) {
 	case ICE_DEV_ID_E825C_BACKPLANE & ICE_DEVID_MASK:
-		hw->phy_addr = eth56g_dev_0;
+		hw->phy_addr[0] = eth56g_dev_0;
+		hw->phy_addr[1] = eth56g_dev_1;
+		hw->num_phys = ICE_PHYS_PER_CPLX_C825X;
+		hw->phy_ports = ICE_PORTS_PER_PHY_C825X;
+		hw->max_phy_port = ice_is_nac_dual(hw) ?
+		       ICE_PORTS_PER_PHY_C825X :
+		       ICE_PHYS_PER_CPLX_C825X * ICE_PORTS_PER_PHY_C825X;
 		break;
 	default:
-		hw->phy_addr = 0;
+		goto e8xx;
 	}
 
-	if (hw->phy_addr) {
-		int err;
+	ice_sb_access_ena_eth56g(hw, true);
+	for (phy = 0; phy < hw->num_phys; phy++)
+		if (hw->phy_addr[phy]) {
+			int err;
+			u32 phy_rev;
 
-		ice_sb_access_ena_eth56g(hw, true);
-		err = ice_read_phy_eth56g_raw_lp(hw, PHY_REG_REVISION,
-						 &phy_rev, true);
-		if (err)
-			return;
+			err = ice_read_phy_eth56g_raw_lp(hw, phy,
+							 PHY_REG_REVISION,
+							 &phy_rev, true);
+			if (err) {
+				hw->phy_model = ICE_PHY_UNSUP;
+				return;
+			}
 
-		if (phy_rev == PHY_REVISION_ETH56G) {
-			hw->phy_model = ICE_PHY_ETH56G;
-			return;
+			if (phy_rev != PHY_REVISION_ETH56G) {
+				hw->phy_model = ICE_PHY_UNSUP;
+				return;
+			}
 		}
-	}
+
+	hw->phy_model = ICE_PHY_ETH56G;
+
+	return;
+e8xx:
 
 	if (ice_is_e810(hw))
 		hw->phy_model = ICE_PHY_E810;
drivers/net/ice/base/ice_sbq_cmd.h +2 -1
index aad77af9a1..d0f5ed25c4 100644
@@ -48,7 +48,8 @@ struct ice_sbq_evt_desc {
 };
 
 enum ice_sbq_msg_dev {
-	eth56g_dev_0 = 0x02,
+	eth56g_dev_0 = 2,
+	eth56g_dev_1 = 13,
 	rmn_0	= 0x02,
 	rmn_1	= 0x03,
 	rmn_2	= 0x04,
drivers/net/ice/base/ice_status.h +2 -0
index 1965347a8b..16cb22f3a6 100644
@@ -36,6 +36,8 @@ enum ice_status {
 	ICE_ERR_BUF_TOO_SHORT			= -52,
 	ICE_ERR_NVM_BLANK_MODE			= -53,
 
+	ICE_ERR_UNKNOWN_PHY			= -60,
+
 	/* ARQ/ASQ specific error codes. Range -100..-109 */
 	ICE_ERR_AQ_ERROR			= -100,
 	ICE_ERR_AQ_TIMEOUT			= -101,
drivers/net/ice/base/ice_type.h +22 -2
index 9bccced824..153c235bd6 100644
@@ -1237,12 +1237,18 @@ struct ice_switch_info {
 
 /* PHY model */
 enum ice_phy_model {
-	ICE_PHY_E810 = 1,
+	ICE_PHY_UNSUP = -1,
+	ICE_PHY_E810  = 1,
 	ICE_PHY_E822,
 	ICE_PHY_ETH56G,
 	ICE_PHY_E830,
 };
 
+enum ice_eth56g_mode {
+	ICE_ETH56G_MODE_0,
+	ICE_ETH56G_MODE_1,
+};
+
 /* Port hardware description */
 struct ice_hw {
 	u8 *hw_addr;
@@ -1269,9 +1275,17 @@ struct ice_hw {
 
 	u8 pf_id;		/* device profile info */
 	enum ice_phy_model phy_model;
-	u8 phy_addr;	/* PHY address */
 	u8 phy_ports;
 	u8 max_phy_port;
+#define ICE_PHYS_PER_CPLX_E824S	1
+#define ICE_PORTS_PER_PHY_E824S	8
+
+#define ICE_PHYS_PER_CPLX_C825X	2
+#define ICE_PORTS_PER_PHY_C825X	4
+
+#define MAX_PHYS_PER_ICE	2
+	u8 num_phys;
+	u8 phy_addr[MAX_PHYS_PER_ICE];		/* PHY address */
 	u8 logical_pf_id;
 
 	u16 max_burst_size;	/* driver sets this value */
@@ -1678,4 +1692,10 @@ struct ice_aq_get_set_rss_lut_params {
 /* AQ API version for FW auto drop reports */
 #define ICE_FW_API_AUTO_DROP_MAJ		1
 #define ICE_FW_API_AUTO_DROP_MIN		4
+
+static inline bool
+ice_is_nac_dual(struct ice_hw *hw)
+{
+	return !!(hw->dev_caps.nac_topo.mode & ICE_NAC_TOPO_DUAL_M);
+}
 #endif /* _ICE_TYPE_H_ */
Signature · 1 line
2.43.0
#383 lore raw

PATCH v4 66/103 net/ice/base: implement interface to reset timestamp memory

In reply to Anatoly Burakov

From: Karol Kolacinski <[email protected]>

Add an interface to clear the timestamp memory block for E822 and ETH56G based devices.

---
 drivers/net/ice/base/ice_ptp_hw.c | 65 +++++++++++++++++++++++++++++++
 drivers/net/ice/base/ice_ptp_hw.h |  2 +
 2 files changed, 67 insertions(+)
drivers/net/ice/base/ice_ptp_hw.c +65 -0
index df3e3e77bd..ac01de3e37 100644
@@ -1481,6 +1481,25 @@ ice_clear_phy_tstamp_eth56g(struct ice_hw *hw, u8 port, u8 idx)
 	return 0;
 }
 
+/**
+ * ice_ptp_reset_ts_memory_eth56g - Clear all timestamps from the port block
+ * @hw: pointer to the HW struct
+ */
+static void ice_ptp_reset_ts_memory_eth56g(struct ice_hw *hw)
+{
+	unsigned int port;
+
+	for (port = 0; port < hw->max_phy_port; port++) {
+		if (!(hw->ena_lports & BIT(port)))
+			continue;
+
+		ice_write_phy_reg_eth56g(hw, port, PHY_REG_TX_MEMORY_STATUS_L,
+					 0);
+		ice_write_phy_reg_eth56g(hw, port, PHY_REG_TX_MEMORY_STATUS_U,
+					 0);
+	}
+}
+
 /**
  * ice_ptp_prep_port_phy_time_eth56g - Prepare one PHY port with initial time
  * @hw: pointer to the HW struct
@@ -2911,6 +2930,33 @@ ice_clear_phy_tstamp_e822(struct ice_hw *hw, u8 quad, u8 idx)
 	return 0;
 }
 
+/**
+ * ice_ptp_reset_ts_memory_quad_e822 - Clear all timestamps from the quad block
+ * @hw: pointer to the HW struct
+ * @quad: the quad to read from
+ *
+ * Clear all timestamps from the PHY quad block that is shared between the
+ * internal PHYs on the E822 devices.
+ */
+void ice_ptp_reset_ts_memory_quad_e822(struct ice_hw *hw, u8 quad)
+{
+	ice_write_quad_reg_e822(hw, quad, Q_REG_TS_CTRL, Q_REG_TS_CTRL_M);
+	ice_write_quad_reg_e822(hw, quad, Q_REG_TS_CTRL, ~(u32)Q_REG_TS_CTRL_M);
+}
+
+/**
+ * ice_ptp_reset_ts_memory_e822 - Clear all timestamps from all quad blocks
+ * @hw: pointer to the HW struct
+ */
+static void ice_ptp_reset_ts_memory_e822(struct ice_hw *hw)
+{
+	u8 quad;
+
+	for (quad = 0; quad < ICE_MAX_QUAD; quad++) {
+		ice_ptp_reset_ts_memory_quad_e822(hw, quad);
+	}
+}
+
 /**
  * ice_ptp_set_vernier_wl - Set the window length for vernier calibration
  * @hw: pointer to the HW struct
@@ -5969,6 +6015,25 @@ ice_clear_phy_tstamp(struct ice_hw *hw, u8 block, u8 idx)
 	return err;
 }
 
+/**
+ * ice_ptp_reset_ts_memory - Reset timestamp memory for all blocks
+ * @hw: pointer to the HW struct
+ */
+void ice_ptp_reset_ts_memory(struct ice_hw *hw)
+{
+	switch (hw->phy_model) {
+	case ICE_PHY_ETH56G:
+		ice_ptp_reset_ts_memory_eth56g(hw);
+		break;
+	case ICE_PHY_E822:
+		ice_ptp_reset_ts_memory_e822(hw);
+		break;
+	case ICE_PHY_E810:
+	default:
+		return;
+	}
+}
+
 /**
  * ice_ptp_init_phc - Initialize PTP hardware clock
  * @hw: pointer to the HW struct
drivers/net/ice/base/ice_ptp_hw.h +2 -0
index f3c0846255..3bd4e27811 100644
@@ -142,6 +142,7 @@ int
 ice_read_phy_tstamp(struct ice_hw *hw, u8 block, u8 idx, u64 *tstamp);
 int
 ice_clear_phy_tstamp(struct ice_hw *hw, u8 block, u8 idx);
+void ice_ptp_reset_ts_memory(struct ice_hw *hw);
 int ice_ptp_init_phc(struct ice_hw *hw);
 bool refsync_pin_id_valid(struct ice_hw *hw, u8 id);
 int
@@ -165,6 +166,7 @@ ice_ptp_read_phy_incval_e822(struct ice_hw *hw, u8 port, u64 *incval);
 int
 ice_ptp_read_port_capture_e822(struct ice_hw *hw, u8 port,
 			       u64 *tx_ts, u64 *rx_ts);
+void ice_ptp_reset_ts_memory_quad_e822(struct ice_hw *hw, u8 quad);
 int
 ice_cfg_cgu_pll_e822(struct ice_hw *hw, enum ice_time_ref_freq *clk_freq,
 		     enum ice_clk_src *clk_src);
Signature · 1 line
2.43.0
#384 lore raw

PATCH v4 67/103 net/ice/base: return high address for multi-read eth56g registers

In reply to Anatoly Burakov

From: Jacob Keller <[email protected]>

The eth56g register checks for 40b and 64b registers do not return the high address offset. Instead it is expected that all offsets are exactly 4 bytes apart in the expected order. The e822 implementations explicitly return the address in the lookup function. This form is better because it allows for the potential of registers which may not have a static offset.

Match the e822 style by refactoring these functions to return the high address in a function parameter.

---
 drivers/net/ice/base/ice_ptp_hw.c | 43 ++++++++++++++++++++++---------
 1 file changed, 31 insertions(+), 12 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +31 -12
index ac01de3e37..01c2f95d5d 100644
@@ -1209,19 +1209,35 @@ ice_phy_port_mem_write_eth56g(struct ice_hw *hw, u8 port, u16 offset, u32 val)
 /**
  * ice_is_64b_phy_reg_eth56g - Check if this is a 64bit PHY register
  * @low_addr: the low address to check
+ * @high_addr: on return, contains the high address of the 64bit register
  *
  * Checks if the provided low address is one of the known 64bit PHY values
- * represented as two 32bit registers.
+ * represented as two 32bit registers. If it is, return the appropriate high
+ * register offset to use.
  */
-static bool ice_is_64b_phy_reg_eth56g(u16 low_addr)
+static bool ice_is_64b_phy_reg_eth56g(u16 low_addr, u16 *high_addr)
 {
 	switch (low_addr) {
 	case PHY_REG_TX_TIMER_INC_PRE_L:
+		*high_addr = PHY_REG_TX_TIMER_INC_PRE_U;
+		return true;
 	case PHY_REG_RX_TIMER_INC_PRE_L:
+		*high_addr = PHY_REG_RX_TIMER_INC_PRE_U;
+		return true;
 	case PHY_REG_TX_CAPTURE_L:
+		*high_addr = PHY_REG_TX_CAPTURE_U;
+		return true;
 	case PHY_REG_RX_CAPTURE_L:
+		*high_addr = PHY_REG_RX_CAPTURE_U;
+		return true;
 	case PHY_REG_TOTAL_TX_OFFSET_L:
+		*high_addr = PHY_REG_TOTAL_TX_OFFSET_U;
+		return true;
 	case PHY_REG_TOTAL_RX_OFFSET_L:
+		*high_addr = PHY_REG_TOTAL_RX_OFFSET_U;
+		return true;
+	case PHY_REG_TX_MEMORY_STATUS_L:
+		*high_addr = PHY_REG_TX_MEMORY_STATUS_U;
 		return true;
 	default:
 		return false;
@@ -1231,15 +1247,18 @@ static bool ice_is_64b_phy_reg_eth56g(u16 low_addr)
 /**
  * ice_is_40b_phy_reg_eth56g - Check if this is a 40bit PHY register
  * @low_addr: the low address to check
+ * @high_addr: on return, contains the high address of the 40bit value
  *
  * Checks if the provided low address is one of the known 40bit PHY values
  * split into two registers with the lower 8 bits in the low register and the
- * upper 32 bits in the high register.
+ * upper 32 bits in the high register. If it is, return the high register
+ * offset to use.
  */
-static bool ice_is_40b_phy_reg_eth56g(u16 low_addr)
+static bool ice_is_40b_phy_reg_eth56g(u16 low_addr, u16 *high_addr)
 {
 	switch (low_addr) {
 	case PHY_REG_TIMETUS_L:
+		*high_addr = PHY_REG_TIMETUS_U;
 		return true;
 	default:
 		return false;
@@ -1261,11 +1280,11 @@ static bool ice_is_40b_phy_reg_eth56g(u16 low_addr)
 static int
 ice_read_40b_phy_reg_eth56g(struct ice_hw *hw, u8 port, u16 low_addr, u64 *val)
 {
-	u16 high_addr = low_addr + sizeof(u32);
 	int err;
+	u16 high_addr;
 	u32 lo, hi;
 
-	if (!ice_is_40b_phy_reg_eth56g(low_addr))
+	if (!ice_is_40b_phy_reg_eth56g(low_addr, &high_addr))
 		return ICE_ERR_PARAM;
 
 	err = ice_read_phy_reg_eth56g(hw, port, low_addr, &lo);
@@ -1302,11 +1321,11 @@ ice_read_40b_phy_reg_eth56g(struct ice_hw *hw, u8 port, u16 low_addr, u64 *val)
 static int
 ice_read_64b_phy_reg_eth56g(struct ice_hw *hw, u8 port, u16 low_addr, u64 *val)
 {
-	u16 high_addr = low_addr + sizeof(u32);
 	int err;
+	u16 high_addr;
 	u32 lo, hi;
 
-	if (!ice_is_64b_phy_reg_eth56g(low_addr))
+	if (!ice_is_64b_phy_reg_eth56g(low_addr, &high_addr))
 		return ICE_ERR_PARAM;
 
 	err = ice_read_phy_reg_eth56g(hw, port, low_addr, &lo);
@@ -1343,11 +1362,11 @@ ice_read_64b_phy_reg_eth56g(struct ice_hw *hw, u8 port, u16 low_addr, u64 *val)
 static int
 ice_write_40b_phy_reg_eth56g(struct ice_hw *hw, u8 port, u16 low_addr, u64 val)
 {
-	u16 high_addr = low_addr + sizeof(u32);
 	int err;
+	u16 high_addr;
 	u32 lo, hi;
 
-	if (!ice_is_40b_phy_reg_eth56g(low_addr))
+	if (!ice_is_40b_phy_reg_eth56g(low_addr, &high_addr))
 		return ICE_ERR_PARAM;
 
 	lo = (u32)(val & P_REG_40B_LOW_M);
@@ -1384,11 +1403,11 @@ ice_write_40b_phy_reg_eth56g(struct ice_hw *hw, u8 port, u16 low_addr, u64 val)
 static int
 ice_write_64b_phy_reg_eth56g(struct ice_hw *hw, u8 port, u16 low_addr, u64 val)
 {
-	u16 high_addr = low_addr + sizeof(u32);
 	int err;
+	u16 high_addr;
 	u32 lo, hi;
 
-	if (!ice_is_64b_phy_reg_eth56g(low_addr))
+	if (!ice_is_64b_phy_reg_eth56g(low_addr, &high_addr))
 		return ICE_ERR_PARAM;
 
 	lo = ICE_LO_DWORD(val);
Signature · 1 line
2.43.0
#385 lore raw

PATCH v4 68/103 net/ice/base: add function to read Tx timestamp status register

In reply to Anatoly Burakov

From: Jacob Keller <[email protected]>

Both e822 and eth56g based hardware have a register indicating the status of timestamps in the Tx timestamp memory bank. This register is used to indicate which timestamps are currently valid. This is important because the interrupt logic for these devices assumes that software will only read registers with the valid bit set. If software does not follow this practice, it can potentially cause hardware to stop reporting timestamp interrupts.

Use of the status register value also allows software to avoid unnecessarily reading timestamps which haven't yet been captured.

Add a helper function which reads the timestamp memory status registers for these devices.

For e810, it is not clear if the hardware has an equivalent register. Instead, implement a stub which just reports that all timestamps are valid. This allows the timestamp tracking logic to use the same function for all current device variants.

---
 drivers/net/ice/base/ice_ptp_hw.c | 113 ++++++++++++++++++++++++++++++
 drivers/net/ice/base/ice_ptp_hw.h |   6 ++
 2 files changed, 119 insertions(+)
drivers/net/ice/base/ice_ptp_hw.c +113 -0
index 01c2f95d5d..ad90cbbe28 100644
@@ -2295,6 +2295,33 @@ ice_ptp_read_tx_hwtstamp_status_eth56g(struct ice_hw *hw, u32 *ts_status)
 	return 0;
 }
 
+/**
+ * ice_get_phy_tx_tstamp_ready_eth56g - Read the Tx memory status register
+ * @hw: pointer to the HW struct
+ * @port: the PHY port to read from
+ * @tstamp_ready: contents of the Tx memory status register
+ *
+ * Read the PHY_REG_TX_MEMORY_STATUS register indicating which timestamps in
+ * the PHY are ready. A set bit means the corresponding timestamp is valid and
+ * ready to be captured from the PHY timestamp block.
+ */
+static int
+ice_get_phy_tx_tstamp_ready_eth56g(struct ice_hw *hw, u8 port,
+				   u64 *tstamp_ready)
+{
+	int err;
+
+	err = ice_read_64b_phy_reg_eth56g(hw, port, PHY_REG_TX_MEMORY_STATUS_L,
+					  tstamp_ready);
+	if (err) {
+		ice_debug(hw, ICE_DBG_PTP, "Failed to read TX_MEMORY_STATUS for port %u, err %d\n",
+			  port, err);
+		return err;
+	}
+
+	return 0;
+}
+
 #define ICE_DEVID_MASK 0xFFF8
 
 /**
@@ -4539,6 +4566,41 @@ ice_start_phy_timer_e822(struct ice_hw *hw, u8 port, bool bypass)
 	return 0;
 }
 
+/**
+ * ice_get_phy_tx_tstamp_ready_e822 - Read Tx memory status register
+ * @hw: pointer to the HW struct
+ * @quad: the timestamp quad to read from
+ * @tstamp_ready: contents of the Tx memory status register
+ *
+ * Read the Q_REG_TX_MEMORY_STATUS register indicating which timestamps in
+ * the PHY are ready. A set bit means the corresponding timestamp is valid and
+ * ready to be captured from the PHY timestamp block.
+ */
+static int
+ice_get_phy_tx_tstamp_ready_e822(struct ice_hw *hw, u8 quad, u64 *tstamp_ready)
+{
+	u32 hi, lo;
+	int err;
+
+	err = ice_read_quad_reg_e822(hw, quad, Q_REG_TX_MEMORY_STATUS_U, &hi);
+	if (err) {
+		ice_debug(hw, ICE_DBG_PTP, "Failed to read TX_MEMORY_STATUS_U for quad %u, err %d\n",
+			  quad, err);
+		return err;
+	}
+
+	err = ice_read_quad_reg_e822(hw, quad, Q_REG_TX_MEMORY_STATUS_L, &lo);
+	if (err) {
+		ice_debug(hw, ICE_DBG_PTP, "Failed to read TX_MEMORY_STATUS_L for quad %u, err %d\n",
+			  quad, err);
+		return err;
+	}
+
+	*tstamp_ready = (u64)hi << 32 | (u64)lo;
+
+	return 0;
+}
+
 /**
  * ice_phy_exit_bypass_e822 - Exit bypass mode, after vernier calculations
  * @hw: pointer to the HW struct
@@ -5070,6 +5132,22 @@ int ice_ptp_port_cmd_e810(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd,
 	return 0;
 }
 
+/**
+ * ice_get_phy_tx_tstamp_ready_e810 - Read Tx memory status register
+ * @hw: pointer to the HW struct
+ * @port: the PHY port to read
+ * @tstamp_ready: contents of the Tx memory status register
+ *
+ * E810 devices do not use a Tx memory status register. Instead simply
+ * indicate that all timestamps are currently ready.
+ */
+static int
+ice_get_phy_tx_tstamp_ready_e810(struct ice_hw *hw, u8 port, u64 *tstamp_ready)
+{
+	*tstamp_ready = 0xFFFFFFFFFFFFFFFF;
+	return 0;
+}
+
 /* E810T SMA functions
  *
  * The following functions operate specifically on E810T hardware and are used
@@ -6087,6 +6165,41 @@ int ice_ptp_init_phc(struct ice_hw *hw)
 	return err;
 }
 
+/**
+ * ice_get_phy_tx_tstamp_ready - Read PHY Tx memory status indication
+ * @hw: pointer to the HW struct
+ * @block: the timestamp block to check
+ * @tstamp_ready: storage for the PHY Tx memory status information
+ *
+ * Check the PHY for Tx timestamp memory status. This reports a 64 bit value
+ * which indicates which timestamps in the block may be captured. A set bit
+ * means the timestamp can be read. An unset bit means the timestamp is not
+ * ready and software should avoid reading the register.
+ */
+int ice_get_phy_tx_tstamp_ready(struct ice_hw *hw, u8 block, u64 *tstamp_ready)
+{
+	int err;
+
+	switch (hw->phy_model) {
+	case ICE_PHY_ETH56G:
+		err = ice_get_phy_tx_tstamp_ready_eth56g(hw, block,
+							 tstamp_ready);
+		break;
+	case ICE_PHY_E810:
+		err = ice_get_phy_tx_tstamp_ready_e810(hw, block,
+						       tstamp_ready);
+		break;
+	case ICE_PHY_E822:
+		err = ice_get_phy_tx_tstamp_ready_e822(hw, block,
+						       tstamp_ready);
+		break;
+	default:
+		err = ICE_ERR_NOT_SUPPORTED;
+	}
+
+	return err;
+}
+
 /**
  * refsync_pin_id_valid
  * @hw: pointer to the HW struct
drivers/net/ice/base/ice_ptp_hw.h +6 -0
index 3bd4e27811..167d3e636a 100644
@@ -146,8 +146,14 @@ void ice_ptp_reset_ts_memory(struct ice_hw *hw);
 int ice_ptp_init_phc(struct ice_hw *hw);
 bool refsync_pin_id_valid(struct ice_hw *hw, u8 id);
 int
+ice_get_phy_tx_tstamp_ready(struct ice_hw *hw, u8 block, u64 *tstamp_ready);
+int
 ice_ptp_one_port_cmd(struct ice_hw *hw, u8 configured_port,
 		     enum ice_ptp_tmr_cmd configured_cmd, bool lock_sbq);
+int
+ice_ptp_read_port_capture(struct ice_hw *hw, u8 port, u64 *tx_ts, u64 *rx_ts);
+int
+ice_ptp_read_phy_incval(struct ice_hw *hw, u8 port, u64 *incval);
 
 /* E822 family functions */
 int
Signature · 1 line
2.43.0
#386 lore raw

PATCH v4 69/103 net/ice/base: implement upper-level PHY control functions

In reply to Anatoly Burakov

From: Sergey Temerkhanov <[email protected]>

Implement upper-level PHY control functions as well as required device specific defines. These include functions returning basic 56G PHY timing parameters and definitions for constant parameters.

---
 drivers/net/ice/base/ice_ptp_hw.c | 108 ++++++++++++++++++------------
 drivers/net/ice/base/ice_ptp_hw.h |  96 +++++++++++++++++++++++++-
 drivers/net/ice/base/ice_type.h   |   4 +-
 3 files changed, 162 insertions(+), 46 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +64 -44
index ad90cbbe28..f880cb2c5d 100644
@@ -6059,25 +6059,18 @@ int ice_ptp_clear_phy_offset_ready(struct ice_hw *hw)
 int
 ice_read_phy_tstamp(struct ice_hw *hw, u8 block, u8 idx, u64 *tstamp)
 {
-	int err;
-
 	switch (hw->phy_model) {
 	case ICE_PHY_ETH56G:
-		err = ice_read_phy_tstamp_eth56g(hw, block, idx, tstamp);
-		break;
+		return ice_read_phy_tstamp_eth56g(hw, block, idx, tstamp);
 	case ICE_PHY_E830:
 		return ice_read_phy_tstamp_e830(hw, block, idx, tstamp);
 	case ICE_PHY_E810:
-		err = ice_read_phy_tstamp_e810(hw, block, idx, tstamp);
-		break;
+		return ice_read_phy_tstamp_e810(hw, block, idx, tstamp);
 	case ICE_PHY_E822:
-		err = ice_read_phy_tstamp_e822(hw, block, idx, tstamp);
-		break;
+		return ice_read_phy_tstamp_e822(hw, block, idx, tstamp);
 	default:
-		err = ICE_ERR_NOT_SUPPORTED;
+		return ICE_ERR_NOT_SUPPORTED;
 	}
-
-	return err;
 }
 
 /**
@@ -6093,23 +6086,16 @@ ice_read_phy_tstamp(struct ice_hw *hw, u8 block, u8 idx, u64 *tstamp)
 int
 ice_clear_phy_tstamp(struct ice_hw *hw, u8 block, u8 idx)
 {
-	int err;
-
 	switch (hw->phy_model) {
 	case ICE_PHY_ETH56G:
-		err = ice_clear_phy_tstamp_eth56g(hw, block, idx);
-		break;
+		return ice_clear_phy_tstamp_eth56g(hw, block, idx);
 	case ICE_PHY_E810:
-		err = ice_clear_phy_tstamp_e810(hw, block, idx);
-		break;
+		return ice_clear_phy_tstamp_e810(hw, block, idx);
 	case ICE_PHY_E822:
-		err = ice_clear_phy_tstamp_e822(hw, block, idx);
-		break;
+		return ice_clear_phy_tstamp_e822(hw, block, idx);
 	default:
-		err = ICE_ERR_NOT_SUPPORTED;
+		return ICE_ERR_NOT_SUPPORTED;
 	}
-
-	return err;
 }
 
 /**
@@ -6139,7 +6125,6 @@ void ice_ptp_reset_ts_memory(struct ice_hw *hw)
  */
 int ice_ptp_init_phc(struct ice_hw *hw)
 {
-	int err;
 	u8 src_idx = hw->func_caps.ts_func_info.tmr_index_owned;
 
 	/* Enable source clocks */
@@ -6150,19 +6135,14 @@ int ice_ptp_init_phc(struct ice_hw *hw)
 
 	switch (hw->phy_model) {
 	case ICE_PHY_ETH56G:
-		err = ice_ptp_init_phc_eth56g(hw);
-		break;
+		return ice_ptp_init_phc_eth56g(hw);
 	case ICE_PHY_E810:
-		err = ice_ptp_init_phc_e810(hw);
-		break;
+		return ice_ptp_init_phc_e810(hw);
 	case ICE_PHY_E822:
-		err = ice_ptp_init_phc_e822(hw);
-		break;
+		return ice_ptp_init_phc_e822(hw);
 	default:
-		err = ICE_ERR_NOT_SUPPORTED;
+		return ICE_ERR_NOT_SUPPORTED;
 	}
-
-	return err;
 }
 
 /**
@@ -6178,26 +6158,66 @@ int ice_ptp_init_phc(struct ice_hw *hw)
  */
 int ice_get_phy_tx_tstamp_ready(struct ice_hw *hw, u8 block, u64 *tstamp_ready)
 {
-	int err;
-
 	switch (hw->phy_model) {
 	case ICE_PHY_ETH56G:
-		err = ice_get_phy_tx_tstamp_ready_eth56g(hw, block,
-							 tstamp_ready);
-		break;
+		return ice_get_phy_tx_tstamp_ready_eth56g(hw, block,
+							  tstamp_ready);
 	case ICE_PHY_E810:
-		err = ice_get_phy_tx_tstamp_ready_e810(hw, block,
-						       tstamp_ready);
-		break;
+		return ice_get_phy_tx_tstamp_ready_e810(hw, block,
+							tstamp_ready);
 	case ICE_PHY_E822:
-		err = ice_get_phy_tx_tstamp_ready_e822(hw, block,
-						       tstamp_ready);
+		return ice_get_phy_tx_tstamp_ready_e822(hw, block,
+							tstamp_ready);
 		break;
 	default:
-		err = ICE_ERR_NOT_SUPPORTED;
+		return ICE_ERR_NOT_SUPPORTED;
+	}
+}
+
+/**
+ * ice_ptp_read_port_capture - Read a port's local time capture
+ * @hw: pointer to HW struct
+ * @port: Port number to read
+ * @tx_ts: on return, the Tx port time capture
+ * @rx_ts: on return, the Rx port time capture
+ *
+ * Read the port's Tx and Rx local time capture values.
+ */
+int
+ice_ptp_read_port_capture(struct ice_hw *hw, u8 port, u64 *tx_ts,
+			  u64 *rx_ts)
+{
+	switch (hw->phy_model) {
+	case ICE_PHY_ETH56G:
+		return ice_ptp_read_port_capture_eth56g(hw, port,
+							tx_ts, rx_ts);
+	case ICE_PHY_E822:
+		return ice_ptp_read_port_capture_e822(hw, port,
+						      tx_ts, rx_ts);
+	default:
+		return ICE_ERR_NOT_SUPPORTED;
 	}
+}
 
-	return err;
+/**
+ * ice_ptp_read_phy_incval - Read a PHY port's current incval
+ * @hw: pointer to the HW struct
+ * @port: the port to read
+ * @incval: on return, the time_clk_cyc incval for this port
+ *
+ * Read the time_clk_cyc increment value for a given PHY port.
+ */
+int
+ice_ptp_read_phy_incval(struct ice_hw *hw, u8 port, u64 *incval)
+{
+	switch (hw->phy_model) {
+	case ICE_PHY_ETH56G:
+		return ice_ptp_read_phy_incval_eth56g(hw, port, incval);
+	case ICE_PHY_E822:
+		return ice_ptp_read_phy_incval_e822(hw, port, incval);
+	default:
+		return ICE_ERR_NOT_SUPPORTED;
+	}
 }
 
 /**
drivers/net/ice/base/ice_ptp_hw.h +95 -1

122 lines not on this page · raw message

drivers/net/ice/base/ice_type.h +3 -1
index 153c235bd6..724a31d775 100644
@@ -750,7 +750,9 @@ enum ice_time_ref_freq {
 	ICE_TIME_REF_FREQ_156_250	= 4,
 	ICE_TIME_REF_FREQ_245_760	= 5,
 
-	NUM_ICE_TIME_REF_FREQ
+	NUM_ICE_TIME_REF_FREQ,
+
+	ICE_TIME_REF_FREQ_INVALID	= -1,
 };
 
 /* Clock source specification */
Signature · 1 line
2.43.0
#387 lore raw

PATCH v4 70/103 net/ice/base: remove switch-related code

In reply to Anatoly Burakov

From: Sergey Temerkhanov <[email protected]>

There are some checks related to switch mode that were added to DPDK by accident. Remove them.

---
 drivers/net/ice/base/ice_ptp_hw.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +1 -12
index f880cb2c5d..77e30c2306 100644
@@ -1509,9 +1509,6 @@ static void ice_ptp_reset_ts_memory_eth56g(struct ice_hw *hw)
 	unsigned int port;
 
 	for (port = 0; port < hw->max_phy_port; port++) {
-		if (!(hw->ena_lports & BIT(port)))
-			continue;
-
 		ice_write_phy_reg_eth56g(hw, port, PHY_REG_TX_MEMORY_STATUS_L,
 					 0);
 		ice_write_phy_reg_eth56g(hw, port, PHY_REG_TX_MEMORY_STATUS_U,
@@ -1568,8 +1565,7 @@ ice_ptp_prep_phy_time_eth56g(struct ice_hw *hw, u32 time)
 
 	for (port = 0; port < hw->max_phy_port; port++) {
 		int err;
-		if (!(hw->ena_lports & BIT(port)))
-			continue;
+
 		err = ice_ptp_prep_port_phy_time_eth56g(hw, port, phy_time);
 
 		if (err) {
@@ -1664,8 +1660,6 @@ ice_ptp_prep_phy_adj_eth56g(struct ice_hw *hw, s32 adj, bool lock_sbq)
 	cycles = (s64)adj << 32;
 
 	for (port = 0; port < hw->max_phy_port; port++) {
-		if (!(hw->ena_lports & BIT(port)))
-			continue;
 
 		err = ice_ptp_prep_port_adj_eth56g(hw, port, cycles, lock_sbq);
 		if (err)
@@ -1691,8 +1685,6 @@ ice_ptp_prep_phy_incval_eth56g(struct ice_hw *hw, u64 incval)
 
 	for (port = 0; port < hw->max_phy_port; port++) {
 		int err;
-		if (!(hw->ena_lports & BIT(port)))
-			continue;
 		err = ice_write_40b_phy_reg_eth56g(hw, port, PHY_REG_TIMETUS_L,
 						   incval);
 		if (err) {
@@ -1752,9 +1744,6 @@ ice_ptp_prep_phy_adj_target_eth56g(struct ice_hw *hw, u32 target_time)
 	u8 port;
 
 	for (port = 0; port < hw->max_phy_port; port++) {
-		if (!(hw->ena_lports & BIT(port)))
-			continue;
-
 		/* Tx case */
 		/* No sub-nanoseconds data */
 		err = ice_write_phy_reg_eth56g_lp(hw, port,
Signature · 1 line
2.43.0
#388 lore raw

PATCH v4 71/103 net/ice/base: allow passing flags to sbq command

In reply to Anatoly Burakov

From: Aviraj CJ <[email protected]>

Currently, sending a command to Sideband Queue (SBQ) is done with unconditionally setting ICE_AQ_FLAG_RD flag. This patch allows the caller to pass flags to the SBQ command function, and amends all call sites as needed.

---
 drivers/net/ice/base/ice_common.c | 12 +++++++-----
 drivers/net/ice/base/ice_common.h |  6 +++---
 drivers/net/ice/base/ice_ptp_hw.c | 20 ++++++++++----------
 3 files changed, 20 insertions(+), 18 deletions(-)
drivers/net/ice/base/ice_common.c +7 -5
index de87df8f60..7b899f0782 100644
@@ -1770,11 +1770,12 @@ ice_sbq_send_cmd_nolock(struct ice_hw *hw, struct ice_sbq_cmd_desc *desc,
  * ice_sbq_rw_reg_lp - Fill Sideband Queue command, with lock parameter
  * @hw: pointer to the HW struct
  * @in: message info to be filled in descriptor
+ * @flag: flag to fill desc structure
  * @lock: true to lock the sq_lock (the usual case); false if the sq_lock has
  *        already been locked at a higher level
  */
-int ice_sbq_rw_reg_lp(struct ice_hw *hw,
-				  struct ice_sbq_msg_input *in, bool lock)
+int ice_sbq_rw_reg_lp(struct ice_hw *hw, struct ice_sbq_msg_input *in,
+		      u16 flag, bool lock)
 {
 	struct ice_sbq_cmd_desc desc = {0};
 	struct ice_sbq_msg_req msg = {0};
@@ -1798,7 +1799,7 @@ int ice_sbq_rw_reg_lp(struct ice_hw *hw,
 		 */
 		msg_len -= sizeof(msg.data);
 
-	desc.flags = CPU_TO_LE16(ICE_AQ_FLAG_RD);
+	desc.flags = CPU_TO_LE16(flag);
 	desc.opcode = CPU_TO_LE16(ice_sbq_opc_neigh_dev_req);
 	desc.param0.cmd_len = CPU_TO_LE16(msg_len);
 	if (lock)
@@ -1816,10 +1817,11 @@ int ice_sbq_rw_reg_lp(struct ice_hw *hw,
  * ice_sbq_rw_reg - Fill Sideband Queue command
  * @hw: pointer to the HW struct
  * @in: message info to be filled in descriptor
+ * @flag: flag to fill desc structure
  */
-int ice_sbq_rw_reg(struct ice_hw *hw, struct ice_sbq_msg_input *in)
+int ice_sbq_rw_reg(struct ice_hw *hw, struct ice_sbq_msg_input *in, u16 flag)
 {
-	return ice_sbq_rw_reg_lp(hw, in, true);
+	return ice_sbq_rw_reg_lp(hw, in, flag, true);
 }
 
 /**
drivers/net/ice/base/ice_common.h +3 -3
index d06742aa77..2f1b212812 100644
@@ -245,11 +245,11 @@ int ice_replay_vsi(struct ice_hw *hw, u16 vsi_handle);
 void ice_replay_post(struct ice_hw *hw);
 struct ice_q_ctx *
 ice_get_lan_q_ctx(struct ice_hw *hw, u16 vsi_handle, u8 tc, u16 q_handle);
-int ice_sbq_rw_reg_lp(struct ice_hw *hw,
-				  struct ice_sbq_msg_input *in, bool lock);
+int ice_sbq_rw_reg_lp(struct ice_hw *hw, struct ice_sbq_msg_input *in,
+		      u16 flag, bool lock);
 void ice_sbq_lock(struct ice_hw *hw);
 void ice_sbq_unlock(struct ice_hw *hw);
-int ice_sbq_rw_reg(struct ice_hw *hw, struct ice_sbq_msg_input *in);
+int ice_sbq_rw_reg(struct ice_hw *hw, struct ice_sbq_msg_input *in, u16 flag);
 int
 ice_aq_get_sensor_reading(struct ice_hw *hw, u8 sensor, u8 format,
 			  struct ice_aqc_get_sensor_reading_resp *data,
drivers/net/ice/base/ice_ptp_hw.c +10 -10
index 77e30c2306..0d2968c528 100644
@@ -122,7 +122,7 @@ ice_read_cgu_reg_e82x(struct ice_hw *hw, u16 addr, u32 *val)
 	cgu_msg.msg_addr_low = addr;
 	cgu_msg.msg_addr_high = 0x0;
 
-	err = ice_sbq_rw_reg_lp(hw, &cgu_msg, true);
+	err = ice_sbq_rw_reg_lp(hw, &cgu_msg, ICE_AQ_FLAG_RD, true);
 	if (err) {
 		ice_debug(hw, ICE_DBG_PTP, "Failed to read CGU register 0x%04x, err %d\n",
 			  addr, err);
@@ -155,7 +155,7 @@ ice_write_cgu_reg_e82x(struct ice_hw *hw, u16 addr, u32 val)
 	cgu_msg.msg_addr_high = 0x0;
 	cgu_msg.data = val;
 
-	err = ice_sbq_rw_reg_lp(hw, &cgu_msg, true);
+	err = ice_sbq_rw_reg_lp(hw, &cgu_msg, ICE_AQ_FLAG_RD, true);
 	if (err) {
 		ice_debug(hw, ICE_DBG_PTP, "Failed to write CGU register 0x%04x, err %d\n",
 			  addr, err);
@@ -948,7 +948,7 @@ ice_write_phy_eth56g_raw_lp(struct ice_hw *hw, u8 phy_index, u32 reg_addr,
 	phy_msg.data = val;
 	phy_msg.dest_dev = hw->phy_addr[phy_index];
 
-	err = ice_sbq_rw_reg_lp(hw, &phy_msg, lock_sbq);
+	err = ice_sbq_rw_reg_lp(hw, &phy_msg, ICE_AQ_FLAG_RD, lock_sbq);
 
 	if (err)
 		ice_debug(hw, ICE_DBG_PTP, "PTP failed to send msg to phy %d\n",
@@ -980,7 +980,7 @@ ice_read_phy_eth56g_raw_lp(struct ice_hw *hw, u8 phy_index, u32 reg_addr,
 	phy_msg.data = 0;
 	phy_msg.dest_dev = hw->phy_addr[phy_index];
 
-	err = ice_sbq_rw_reg_lp(hw, &phy_msg, lock_sbq);
+	err = ice_sbq_rw_reg_lp(hw, &phy_msg, ICE_AQ_FLAG_RD, lock_sbq);
 
 	if (err)
 		ice_debug(hw, ICE_DBG_PTP, "PTP failed to send msg to phy %d\n",
@@ -2530,7 +2530,7 @@ ice_read_phy_reg_e822_lp(struct ice_hw *hw, u8 port, u16 offset, u32 *val,
 	ice_fill_phy_msg_e822(&msg, port, offset);
 	msg.opcode = ice_sbq_msg_rd;
 
-	err = ice_sbq_rw_reg_lp(hw, &msg, lock_sbq);
+	err = ice_sbq_rw_reg_lp(hw, &msg, ICE_AQ_FLAG_RD, lock_sbq);
 	if (err) {
 		ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n",
 			  err);
@@ -2663,7 +2663,7 @@ ice_write_phy_reg_e822_lp(struct ice_hw *hw, u8 port, u16 offset, u32 val,
 	msg.opcode = ice_sbq_msg_wr;
 	msg.data = val;
 
-	err = ice_sbq_rw_reg_lp(hw, &msg, lock_sbq);
+	err = ice_sbq_rw_reg_lp(hw, &msg, ICE_AQ_FLAG_RD, lock_sbq);
 	if (err) {
 		ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n",
 			  err);
@@ -2827,7 +2827,7 @@ ice_read_quad_reg_e822_lp(struct ice_hw *hw, u8 quad, u16 offset, u32 *val,
 
 	msg.opcode = ice_sbq_msg_rd;
 
-	err = ice_sbq_rw_reg_lp(hw, &msg, lock_sbq);
+	err = ice_sbq_rw_reg_lp(hw, &msg, ICE_AQ_FLAG_RD, lock_sbq);
 	if (err) {
 		ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n",
 			  err);
@@ -2870,7 +2870,7 @@ ice_write_quad_reg_e822_lp(struct ice_hw *hw, u8 quad, u16 offset, u32 val,
 	msg.opcode = ice_sbq_msg_wr;
 	msg.data = val;
 
-	err = ice_sbq_rw_reg_lp(hw, &msg, lock_sbq);
+	err = ice_sbq_rw_reg_lp(hw, &msg, ICE_AQ_FLAG_RD, lock_sbq);
 	if (err) {
 		ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n",
 			  err);
@@ -4700,7 +4700,7 @@ ice_read_phy_reg_e810_lp(struct ice_hw *hw, u32 addr, u32 *val, bool lock_sbq)
 	msg.opcode = ice_sbq_msg_rd;
 	msg.dest_dev = rmn_0;
 
-	err = ice_sbq_rw_reg_lp(hw, &msg, lock_sbq);
+	err = ice_sbq_rw_reg_lp(hw, &msg, ICE_AQ_FLAG_RD, lock_sbq);
 	if (err) {
 		ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n",
 			  err);
@@ -4738,7 +4738,7 @@ ice_write_phy_reg_e810_lp(struct ice_hw *hw, u32 addr, u32 val, bool lock_sbq)
 	msg.dest_dev = rmn_0;
 	msg.data = val;
 
-	err = ice_sbq_rw_reg_lp(hw, &msg, lock_sbq);
+	err = ice_sbq_rw_reg_lp(hw, &msg, ICE_AQ_FLAG_RD, lock_sbq);
 	if (err) {
 		ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n",
 			  err);
Signature · 1 line
2.43.0
#389 lore raw

PATCH v4 72/103 net/ice/base: add Get Link Status Data version 2

In reply to Anatoly Burakov

From: Paul Greenwalt <[email protected]>

E830 introduces a new version of Get Link Status Data which increases the size of struct ice_aqc_get_link_status_data from 32 bytes to 51 bytes.

Add new link partner fields to ice_aqc_get_link_status_data; PHY type, FEC, and flow control. Add new ICE_GET_LINK_STATUS_DATA_V2 and ICE_GET_LINK_STATUS_DATALEN_V2 to support the new version and data length.

Also, moving ice_get_link_status_datalen and ice_get_link_status_datalen to ice_common.c

---
 drivers/net/ice/base/ice_adminq_cmd.h | 35 ++++++++++++++++++++++++++-
 drivers/net/ice/base/ice_common.c     | 20 +++++++++++++--
 2 files changed, 52 insertions(+), 3 deletions(-)
drivers/net/ice/base/ice_adminq_cmd.h +34 -1
index ef6284f263..a4b45b9fc5 100644
@@ -1566,7 +1566,16 @@ struct ice_aqc_get_link_status {
 	__le32 addr_low;
 };
 
+enum ice_get_link_status_data_version {
+	ICE_GET_LINK_STATUS_DATA_V1 = 1,
+	ICE_GET_LINK_STATUS_DATA_V2 = 2,
+};
+
+#define ICE_GET_LINK_STATUS_DATALEN_V1		32
+#define ICE_GET_LINK_STATUS_DATALEN_V2		56
+
 /* Get link status response data structure, also used for Link Status Event */
+#pragma pack(1)
 struct ice_aqc_get_link_status_data {
 	u8 topo_media_conflict;
 #define ICE_AQ_LINK_TOPO_CONFLICT	BIT(0)
@@ -1653,11 +1662,35 @@ struct ice_aqc_get_link_status_data {
 #define ICE_AQ_LINK_SPEED_100GB		BIT(10)
 #define ICE_AQ_LINK_SPEED_200GB		BIT(11)
 #define ICE_AQ_LINK_SPEED_UNKNOWN	BIT(15)
-	__le32 reserved3; /* Aligns next field to 8-byte boundary */
+	__le16 reserved3; /* Aligns next field to 8-byte boundary */
+	u8 ext_fec_status;
+#define ICE_AQ_LINK_RS_272_FEC_EN	BIT(0) /* RS 272 FEC enabled */
+	u8 reserved4;
 	__le64 phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */
 	__le64 phy_type_high; /* Use values from ICE_PHY_TYPE_HIGH_* */
+	/* Get link status version 2 link partner data */
+	__le64 lp_phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */
+	__le64 lp_phy_type_high; /* Use values from ICE_PHY_TYPE_HIGH_* */
+	u8 lp_fec_adv;
+#define ICE_AQ_LINK_LP_10G_KR_FEC_CAP	BIT(0)
+#define ICE_AQ_LINK_LP_25G_KR_FEC_CAP	BIT(1)
+#define ICE_AQ_LINK_LP_RS_528_FEC_CAP	BIT(2)
+#define ICE_AQ_LINK_LP_50G_KR_272_FEC_CAP BIT(3)
+#define ICE_AQ_LINK_LP_100G_KR_272_FEC_CAP BIT(4)
+#define ICE_AQ_LINK_LP_200G_KR_272_FEC_CAP BIT(5)
+	u8 lp_fec_req;
+#define ICE_AQ_LINK_LP_10G_KR_FEC_REQ	BIT(0)
+#define ICE_AQ_LINK_LP_25G_KR_FEC_REQ	BIT(1)
+#define ICE_AQ_LINK_LP_RS_528_FEC_REQ	BIT(2)
+#define ICE_AQ_LINK_LP_KR_272_FEC_REQ	BIT(3)
+	u8 lp_flowcontrol;
+#define ICE_AQ_LINK_LP_PAUSE_ADV	BIT(0)
+#define ICE_AQ_LINK_LP_ASM_DIR_ADV	BIT(1)
+	u8 reserved[5];
 };
 
+#pragma pack()
+
 /* Set event mask command (direct 0x0613) */
 struct ice_aqc_set_event_mask {
 	u8	lport_num;
drivers/net/ice/base/ice_common.c +18 -2
index 7b899f0782..d437ab5be6 100644
@@ -565,6 +565,22 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode,
 	return status;
 }
 
+#define ice_get_link_status_data_ver(hw) ((hw)->mac_type == ICE_MAC_E830 ? \
+		ICE_GET_LINK_STATUS_DATA_V2 : ICE_GET_LINK_STATUS_DATA_V1)
+
+/**
+ * ice_get_link_status_datalen
+ * @hw: pointer to the HW struct
+ *
+ * return Get Link Status datalen
+ */
+static u16 ice_get_link_status_datalen(struct ice_hw *hw)
+{
+	return (ice_get_link_status_data_ver(hw) ==
+		ICE_GET_LINK_STATUS_DATA_V1) ? ICE_GET_LINK_STATUS_DATALEN_V1 :
+		ICE_GET_LINK_STATUS_DATALEN_V2;
+}
+
 /**
  * ice_aq_get_netlist_node_pin
  * @hw: pointer to the hw struct
@@ -704,8 +720,8 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse,
 	resp->cmd_flags = CPU_TO_LE16(cmd_flags);
 	resp->lport_num = pi->lport;
 
-	status = ice_aq_send_cmd(hw, &desc, &link_data, sizeof(link_data), cd);
-
+	status = ice_aq_send_cmd(hw, &desc, &link_data,
+				 ice_get_link_status_datalen(hw), cd);
 	if (status)
 		return status;
 
Signature · 1 line
2.43.0
#390 lore raw

PATCH v4 73/103 net/ice/base: add port option commands

In reply to Anatoly Burakov

Adds the Set/Get Port Options commands (0x06EA/0x06EB), also include additional status and ID bits to improve the Link topology configuration as well as ability to change port option from pre-boot environment via the UEFI driver.

---
 drivers/net/ice/base/ice_adminq_cmd.h |  59 ++++++++++++++
 drivers/net/ice/base/ice_common.c     | 109 ++++++++++++++++++++++++++
 drivers/net/ice/base/ice_common.h     |   9 +++
 drivers/net/ice/base/ice_type.h       |   2 +
 4 files changed, 179 insertions(+)
drivers/net/ice/base/ice_adminq_cmd.h +59 -0
index a4b45b9fc5..457455fe85 100644
@@ -1889,6 +1889,63 @@ struct ice_aqc_set_port_id_led {
 	u8 rsvd[13];
 };
 
+/* Get Port Options (indirect, 0x06EA) */
+struct ice_aqc_get_port_options {
+	u8 lport_num;
+	u8 lport_num_valid;
+#define ICE_AQC_PORT_OPT_PORT_NUM_VALID	BIT(0)
+	u8 port_options_count;
+#define ICE_AQC_PORT_OPT_COUNT_S	0
+#define ICE_AQC_PORT_OPT_COUNT_M	(0xF << ICE_AQC_PORT_OPT_COUNT_S)
+#define ICE_AQC_PORT_OPT_MAX		16
+	u8 innermost_phy_index;
+	u8 port_options;
+#define ICE_AQC_PORT_OPT_ACTIVE_S	0
+#define ICE_AQC_PORT_OPT_ACTIVE_M	(0xF << ICE_AQC_PORT_OPT_ACTIVE_S)
+#define ICE_AQC_PORT_OPT_FORCED		BIT(6)
+#define ICE_AQC_PORT_OPT_VALID		BIT(7)
+	u8 pending_port_option_status;
+#define ICE_AQC_PENDING_PORT_OPT_IDX_S	0
+#define ICE_AQC_PENDING_PORT_OPT_IDX_M	(0xF << ICE_AQC_PENDING_PORT_OPT_IDX_S)
+#define ICE_AQC_PENDING_PORT_OPT_VALID	BIT(7)
+	u8 rsvd[2];
+	__le32 addr_high;
+	__le32 addr_low;
+};
+
+struct ice_aqc_get_port_options_elem {
+	u8 pmd;
+#define ICE_AQC_PORT_INV_PORT_OPT	4
+#define ICE_AQC_PORT_OPT_PMD_COUNT_S	0
+#define ICE_AQC_PORT_OPT_PMD_COUNT_M	(0xF << ICE_AQC_PORT_OPT_PMD_COUNT_S)
+#define ICE_AQC_PORT_OPT_PMD_WIDTH_S	4
+#define ICE_AQC_PORT_OPT_PMD_WIDTH_M	(0xF << ICE_AQC_PORT_OPT_PMD_WIDTH_S)
+	u8 max_lane_speed;
+#define ICE_AQC_PORT_OPT_MAX_LANE_S	0
+#define ICE_AQC_PORT_OPT_MAX_LANE_M	(0xF << ICE_AQC_PORT_OPT_MAX_LANE_S)
+#define ICE_AQC_PORT_OPT_MAX_LANE_100M	0
+#define ICE_AQC_PORT_OPT_MAX_LANE_1G	1
+#define ICE_AQC_PORT_OPT_MAX_LANE_2500M	2
+#define ICE_AQC_PORT_OPT_MAX_LANE_5G	3
+#define ICE_AQC_PORT_OPT_MAX_LANE_10G	4
+#define ICE_AQC_PORT_OPT_MAX_LANE_25G	5
+#define ICE_AQC_PORT_OPT_MAX_LANE_50G	6
+#define ICE_AQC_PORT_OPT_MAX_LANE_100G	7
+#define ICE_AQC_PORT_OPT_MAX_LANE_200G	8
+	u8 global_scid[2];
+	u8 phy_scid[2];
+	u8 pf2port_cid[2];
+};
+
+/* Set Port Option (direct, 0x06EB) */
+struct ice_aqc_set_port_option {
+	u8 lport_num;
+	u8 lport_num_valid;
+#define ICE_AQC_SET_PORT_OPT_PORT_NUM_VALID	BIT(0)
+	u8 selected_port_option;
+	u8 rsvd[13];
+};
+
 /* Set/Get GPIO (direct, 0x06EC/0x06ED) */
 struct ice_aqc_gpio {
 	__le16 gpio_ctrl_handle;
@@ -3152,6 +3209,8 @@ struct ice_aq_desc {
 		struct ice_aqc_sw_gpio sw_read_write_gpio;
 		struct ice_aqc_sff_eeprom read_write_sff_param;
 		struct ice_aqc_set_port_id_led set_port_id_led;
+		struct ice_aqc_get_port_options get_port_options;
+		struct ice_aqc_set_port_option set_port_option;
 		struct ice_aqc_get_sw_cfg get_sw_conf;
 		struct ice_aqc_set_port_params set_port_params;
 		struct ice_aqc_sw_rules sw_rules;
drivers/net/ice/base/ice_common.c +109 -0

115 lines not on this page · raw message

drivers/net/ice/base/ice_common.h +9 -0
index 2f1b212812..93d4c48fa5 100644
@@ -228,6 +228,15 @@ ice_aq_read_topo_dev_nvm(struct ice_hw *hw,
 			 struct ice_sq_cd *cd);
 
 int
+ice_aq_get_port_options(struct ice_hw *hw,
+			struct ice_aqc_get_port_options_elem *options,
+			u8 *option_count, u8 lport, bool lport_valid,
+			u8 *active_option_idx, bool *active_option_valid,
+			u8 *pending_option_idx, bool *pending_option_valid);
+int
+ice_aq_set_port_option(struct ice_hw *hw, u8 lport, u8 lport_valid,
+		       u8 new_option);
+int
 ice_dis_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u8 num_queues,
 		u16 *q_handle, u16 *q_ids, u32 *q_teids,
 		enum ice_disq_rst_src rst_src, u16 vmvf_num,
drivers/net/ice/base/ice_type.h +2 -0
index 724a31d775..14c5b2fa01 100644
@@ -1065,6 +1065,8 @@ enum ice_rl_type {
 #define ICE_TXSCHED_GET_RL_WAKEUP_MV(p) LE16_TO_CPU((p)->info.wake_up_calc)
 #define ICE_TXSCHED_GET_RL_ENCODE(p) LE16_TO_CPU((p)->info.rl_encode)
 
+#define ICE_MAX_PORT_PER_PCI_DEV	8
+
 /* The following tree example shows the naming conventions followed under
  * ice_port_info struct for default scheduler tree topology.
  *
Signature · 1 line
2.43.0
#391 lore raw

Re: [PATCH v4 073/103] net/ice/base: add port option commands

Quoted 7 lines · Anatoly Burakov

Adds the Set/Get Port Options commands (0x06EA/0x06EB), also include additional status and ID bits to improve the Link topology configuration as well as ability to change port option from pre-boot environment via the UEFI driver.

---

This commit has been accidentally submitted with missing author information. Please amend on apply with a signoff preceding mine:

Please also adjust authorship information accordingly.

Signature · 2 lines
Thanks,
Anatoly
#392 lore raw

PATCH v4 74/103 net/ice/base: replace array initialization with macros

In reply to Anatoly Burakov

From: Lukasz Plachno <[email protected]>

Certain compilers do not allow array initialization with indexes, so the best way to avoid the issue when compiling for these platforms is to use a macro.

---
 drivers/net/ice/base/ice_common.c | 217 ++++++++++++++++--------------
 drivers/net/ice/base/ice_common.h |   8 ++
 2 files changed, 121 insertions(+), 104 deletions(-)
drivers/net/ice/base/ice_common.c +113 -104
index ceb54b085c..9560187a85 100644
@@ -11,118 +11,121 @@
 
 #define ICE_PF_RESET_WAIT_COUNT	300
 
-/**
- * dump_phy_type - helper function that prints PHY type strings
- * @hw: pointer to the HW structure
- * @phy: 64 bit PHY type to decipher
- * @i: bit index within phy
- * @phy_string: string corresponding to bit i in phy
- * @prefix: prefix string to differentiate multiple dumps
- */
-static void
-dump_phy_type(struct ice_hw *hw, u64 phy, u8 i, const char *phy_string,
-	      const char *prefix)
-{
-	if (phy & BIT_ULL(i))
-		ice_debug(hw, ICE_DBG_PHY, "%s: bit(%d): %s\n", prefix, i,
-			  phy_string);
-}
+static const char * const ice_link_mode_str_low[] = {
+	ice_arr_elem_idx(0, "100BASE_TX"),
+	ice_arr_elem_idx(1, "100M_SGMII"),
+	ice_arr_elem_idx(2, "1000BASE_T"),
+	ice_arr_elem_idx(3, "1000BASE_SX"),
+	ice_arr_elem_idx(4, "1000BASE_LX"),
+	ice_arr_elem_idx(5, "1000BASE_KX"),
+	ice_arr_elem_idx(6, "1G_SGMII"),
+	ice_arr_elem_idx(7, "2500BASE_T"),
+	ice_arr_elem_idx(8, "2500BASE_X"),
+	ice_arr_elem_idx(9, "2500BASE_KX"),
+	ice_arr_elem_idx(10, "5GBASE_T"),
+	ice_arr_elem_idx(11, "5GBASE_KR"),
+	ice_arr_elem_idx(12, "10GBASE_T"),
+	ice_arr_elem_idx(13, "10G_SFI_DA"),
+	ice_arr_elem_idx(14, "10GBASE_SR"),
+	ice_arr_elem_idx(15, "10GBASE_LR"),
+	ice_arr_elem_idx(16, "10GBASE_KR_CR1"),
+	ice_arr_elem_idx(17, "10G_SFI_AOC_ACC"),
+	ice_arr_elem_idx(18, "10G_SFI_C2C"),
+	ice_arr_elem_idx(19, "25GBASE_T"),
+	ice_arr_elem_idx(20, "25GBASE_CR"),
+	ice_arr_elem_idx(21, "25GBASE_CR_S"),
+	ice_arr_elem_idx(22, "25GBASE_CR1"),
+	ice_arr_elem_idx(23, "25GBASE_SR"),
+	ice_arr_elem_idx(24, "25GBASE_LR"),
+	ice_arr_elem_idx(25, "25GBASE_KR"),
+	ice_arr_elem_idx(26, "25GBASE_KR_S"),
+	ice_arr_elem_idx(27, "25GBASE_KR1"),
+	ice_arr_elem_idx(28, "25G_AUI_AOC_ACC"),
+	ice_arr_elem_idx(29, "25G_AUI_C2C"),
+	ice_arr_elem_idx(30, "40GBASE_CR4"),
+	ice_arr_elem_idx(31, "40GBASE_SR4"),
+	ice_arr_elem_idx(32, "40GBASE_LR4"),
+	ice_arr_elem_idx(33, "40GBASE_KR4"),
+	ice_arr_elem_idx(34, "40G_XLAUI_AOC_ACC"),
+	ice_arr_elem_idx(35, "40G_XLAUI"),
+	ice_arr_elem_idx(36, "50GBASE_CR2"),
+	ice_arr_elem_idx(37, "50GBASE_SR2"),
+	ice_arr_elem_idx(38, "50GBASE_LR2"),
+	ice_arr_elem_idx(39, "50GBASE_KR2"),
+	ice_arr_elem_idx(40, "50G_LAUI2_AOC_ACC"),
+	ice_arr_elem_idx(41, "50G_LAUI2"),
+	ice_arr_elem_idx(42, "50G_AUI2_AOC_ACC"),
+	ice_arr_elem_idx(43, "50G_AUI2"),
+	ice_arr_elem_idx(44, "50GBASE_CP"),
+	ice_arr_elem_idx(45, "50GBASE_SR"),
+	ice_arr_elem_idx(46, "50GBASE_FR"),
+	ice_arr_elem_idx(47, "50GBASE_LR"),
+	ice_arr_elem_idx(48, "50GBASE_KR_PAM4"),
+	ice_arr_elem_idx(49, "50G_AUI1_AOC_ACC"),
+	ice_arr_elem_idx(50, "50G_AUI1"),
+	ice_arr_elem_idx(51, "100GBASE_CR4"),
+	ice_arr_elem_idx(52, "100GBASE_SR4"),
+	ice_arr_elem_idx(53, "100GBASE_LR4"),
+	ice_arr_elem_idx(54, "100GBASE_KR4"),
+	ice_arr_elem_idx(55, "100G_CAUI4_AOC_ACC"),
+	ice_arr_elem_idx(56, "100G_CAUI4"),
+	ice_arr_elem_idx(57, "100G_AUI4_AOC_ACC"),
+	ice_arr_elem_idx(58, "100G_AUI4"),
+	ice_arr_elem_idx(59, "100GBASE_CR_PAM4"),
+	ice_arr_elem_idx(60, "100GBASE_KR_PAM4"),
+	ice_arr_elem_idx(61, "100GBASE_CP2"),
+	ice_arr_elem_idx(62, "100GBASE_SR2"),
+	ice_arr_elem_idx(63, "100GBASE_DR"),
+};
+
+static const char * const ice_link_mode_str_high[] = {
+	ice_arr_elem_idx(0, "100GBASE_KR2_PAM4"),
+	ice_arr_elem_idx(1, "100G_CAUI2_AOC_ACC"),
+	ice_arr_elem_idx(2, "100G_CAUI2"),
+	ice_arr_elem_idx(3, "100G_AUI2_AOC_ACC"),
+	ice_arr_elem_idx(4, "100G_AUI2"),
+	ice_arr_elem_idx(5, "200G_CR4_PAM4"),
+	ice_arr_elem_idx(6, "200G_SR4"),
+	ice_arr_elem_idx(7, "200G_FR4"),
+	ice_arr_elem_idx(8, "200G_LR4"),
+	ice_arr_elem_idx(9, "200G_DR4"),
+	ice_arr_elem_idx(10, "200G_KR4_PAM4"),
+	ice_arr_elem_idx(11, "200G_AUI4_AOC_ACC"),
+	ice_arr_elem_idx(12, "200G_AUI4"),
+	ice_arr_elem_idx(13, "200G_AUI8_AOC_ACC"),
+	ice_arr_elem_idx(14, "200G_AUI8"),
+	ice_arr_elem_idx(15, "400GBASE_FR8"),
+};
 
 /**
- * ice_dump_phy_type_low - helper function to dump phy_type_low
+ * ice_dump_phy_type - helper function to dump phy_type
  * @hw: pointer to the HW structure
  * @low: 64 bit value for phy_type_low
+ * @high: 64 bit value for phy_type_high
  * @prefix: prefix string to differentiate multiple dumps
  */
 static void
-ice_dump_phy_type_low(struct ice_hw *hw, u64 low, const char *prefix)
+ice_dump_phy_type(struct ice_hw *hw, u64 low, u64 high, const char *prefix)
 {
+	u32 i;
+
 	ice_debug(hw, ICE_DBG_PHY, "%s: phy_type_low: 0x%016llx\n", prefix,
 		  (unsigned long long)low);
 
-	dump_phy_type(hw, low, 0, "100BASE_TX", prefix);
-	dump_phy_type(hw, low, 1, "100M_SGMII", prefix);
-	dump_phy_type(hw, low, 2, "1000BASE_T", prefix);
-	dump_phy_type(hw, low, 3, "1000BASE_SX", prefix);
-	dump_phy_type(hw, low, 4, "1000BASE_LX", prefix);
-	dump_phy_type(hw, low, 5, "1000BASE_KX", prefix);
-	dump_phy_type(hw, low, 6, "1G_SGMII", prefix);
-	dump_phy_type(hw, low, 7, "2500BASE_T", prefix);
-	dump_phy_type(hw, low, 8, "2500BASE_X", prefix);
-	dump_phy_type(hw, low, 9, "2500BASE_KX", prefix);
-	dump_phy_type(hw, low, 10, "5GBASE_T", prefix);
-	dump_phy_type(hw, low, 11, "5GBASE_KR", prefix);
-	dump_phy_type(hw, low, 12, "10GBASE_T", prefix);
-	dump_phy_type(hw, low, 13, "10G_SFI_DA", prefix);
-	dump_phy_type(hw, low, 14, "10GBASE_SR", prefix);
-	dump_phy_type(hw, low, 15, "10GBASE_LR", prefix);
-	dump_phy_type(hw, low, 16, "10GBASE_KR_CR1", prefix);
-	dump_phy_type(hw, low, 17, "10G_SFI_AOC_ACC", prefix);
-	dump_phy_type(hw, low, 18, "10G_SFI_C2C", prefix);
-	dump_phy_type(hw, low, 19, "25GBASE_T", prefix);
-	dump_phy_type(hw, low, 20, "25GBASE_CR", prefix);
-	dump_phy_type(hw, low, 21, "25GBASE_CR_S", prefix);
-	dump_phy_type(hw, low, 22, "25GBASE_CR1", prefix);
-	dump_phy_type(hw, low, 23, "25GBASE_SR", prefix);
-	dump_phy_type(hw, low, 24, "25GBASE_LR", prefix);
-	dump_phy_type(hw, low, 25, "25GBASE_KR", prefix);
-	dump_phy_type(hw, low, 26, "25GBASE_KR_S", prefix);
-	dump_phy_type(hw, low, 27, "25GBASE_KR1", prefix);
-	dump_phy_type(hw, low, 28, "25G_AUI_AOC_ACC", prefix);
-	dump_phy_type(hw, low, 29, "25G_AUI_C2C", prefix);
-	dump_phy_type(hw, low, 30, "40GBASE_CR4", prefix);
-	dump_phy_type(hw, low, 31, "40GBASE_SR4", prefix);
-	dump_phy_type(hw, low, 32, "40GBASE_LR4", prefix);
-	dump_phy_type(hw, low, 33, "40GBASE_KR4", prefix);
-	dump_phy_type(hw, low, 34, "40G_XLAUI_AOC_ACC", prefix);
-	dump_phy_type(hw, low, 35, "40G_XLAUI", prefix);
-	dump_phy_type(hw, low, 36, "50GBASE_CR2", prefix);
-	dump_phy_type(hw, low, 37, "50GBASE_SR2", prefix);
-	dump_phy_type(hw, low, 38, "50GBASE_LR2", prefix);
-	dump_phy_type(hw, low, 39, "50GBASE_KR2", prefix);
-	dump_phy_type(hw, low, 40, "50G_LAUI2_AOC_ACC", prefix);
-	dump_phy_type(hw, low, 41, "50G_LAUI2", prefix);
-	dump_phy_type(hw, low, 42, "50G_AUI2_AOC_ACC", prefix);
-	dump_phy_type(hw, low, 43, "50G_AUI2", prefix);
-	dump_phy_type(hw, low, 44, "50GBASE_CP", prefix);
-	dump_phy_type(hw, low, 45, "50GBASE_SR", prefix);
-	dump_phy_type(hw, low, 46, "50GBASE_FR", prefix);
-	dump_phy_type(hw, low, 47, "50GBASE_LR", prefix);
-	dump_phy_type(hw, low, 48, "50GBASE_KR_PAM4", prefix);
-	dump_phy_type(hw, low, 49, "50G_AUI1_AOC_ACC", prefix);
-	dump_phy_type(hw, low, 50, "50G_AUI1", prefix);
-	dump_phy_type(hw, low, 51, "100GBASE_CR4", prefix);
-	dump_phy_type(hw, low, 52, "100GBASE_SR4", prefix);
-	dump_phy_type(hw, low, 53, "100GBASE_LR4", prefix);
-	dump_phy_type(hw, low, 54, "100GBASE_KR4", prefix);
-	dump_phy_type(hw, low, 55, "100G_CAUI4_AOC_ACC", prefix);
-	dump_phy_type(hw, low, 56, "100G_CAUI4", prefix);
-	dump_phy_type(hw, low, 57, "100G_AUI4_AOC_ACC", prefix);
-	dump_phy_type(hw, low, 58, "100G_AUI4", prefix);
-	dump_phy_type(hw, low, 59, "100GBASE_CR_PAM4", prefix);
-	dump_phy_type(hw, low, 60, "100GBASE_KR_PAM4", prefix);
-	dump_phy_type(hw, low, 61, "100GBASE_CP2", prefix);
-	dump_phy_type(hw, low, 62, "100GBASE_SR2", prefix);
-	dump_phy_type(hw, low, 63, "100GBASE_DR", prefix);
-}
+	for (i = 0; i < ARRAY_SIZE(ice_link_mode_str_low); i++) {
+		if (low & BIT_ULL(i))
+			ice_debug(hw, ICE_DBG_PHY, "%s:   bit(%d): %s\n",
+				  prefix, i, ice_link_mode_str_low[i]);
+	}
 
-/**
- * ice_dump_phy_type_high - helper function to dump phy_type_high
- * @hw: pointer to the HW structure
- * @high: 64 bit value for phy_type_high
- * @prefix: prefix string to differentiate multiple dumps
- */
-static void
-ice_dump_phy_type_high(struct ice_hw *hw, u64 high, const char *prefix)
-{
 	ice_debug(hw, ICE_DBG_PHY, "%s: phy_type_high: 0x%016llx\n", prefix,
 		  (unsigned long long)high);
 
-	dump_phy_type(hw, high, 0, "100GBASE_KR2_PAM4", prefix);
-	dump_phy_type(hw, high, 1, "100G_CAUI2_AOC_ACC", prefix);
-	dump_phy_type(hw, high, 2, "100G_CAUI2", prefix);
-	dump_phy_type(hw, high, 3, "100G_AUI2_AOC_ACC", prefix);
-	dump_phy_type(hw, high, 4, "100G_AUI2", prefix);
+	for (i = 0; i < ARRAY_SIZE(ice_link_mode_str_high); i++) {
+		if (high & BIT_ULL(i))
+			ice_debug(hw, ICE_DBG_PHY, "%s:   bit(%d): %s\n",
+				  prefix, i, ice_link_mode_str_high[i]);
+	}
 }
 
 /**
@@ -515,19 +518,25 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode,
 
 	ice_debug(hw, ICE_DBG_LINK, "get phy caps dump\n");
 
-	if (report_mode == ICE_AQC_REPORT_TOPO_CAP_MEDIA)
+	switch (report_mode) {
+	case ICE_AQC_REPORT_TOPO_CAP_MEDIA:
 		prefix = "phy_caps_media";
-	else if (report_mode == ICE_AQC_REPORT_TOPO_CAP_NO_MEDIA)
+		break;
+	case ICE_AQC_REPORT_TOPO_CAP_NO_MEDIA:
 		prefix = "phy_caps_no_media";
-	else if (report_mode == ICE_AQC_REPORT_ACTIVE_CFG)
+		break;
+	case ICE_AQC_REPORT_ACTIVE_CFG:
 		prefix = "phy_caps_active";
-	else if (report_mode == ICE_AQC_REPORT_DFLT_CFG)
+		break;
+	case ICE_AQC_REPORT_DFLT_CFG:
 		prefix = "phy_caps_default";
-	else
+		break;
+	default:
 		prefix = "phy_caps_invalid";
+	}
 
-	ice_dump_phy_type_low(hw, LE64_TO_CPU(pcaps->phy_type_low), prefix);
-	ice_dump_phy_type_high(hw, LE64_TO_CPU(pcaps->phy_type_high), prefix);
+	ice_dump_phy_type(hw, LE64_TO_CPU(pcaps->phy_type_low),
+			  LE64_TO_CPU(pcaps->phy_type_high), prefix);
 
 	ice_debug(hw, ICE_DBG_LINK, "%s: report_mode = 0x%x\n",
 		  prefix, report_mode);
drivers/net/ice/base/ice_common.h +8 -0
index 93d4c48fa5..df0a247263 100644
@@ -84,6 +84,14 @@ ice_aq_get_internal_data(struct ice_hw *hw, u16 cluster_id, u16 table_id,
  */
 #define ICE_ALIGN(ptr, align)	(((ptr) + ((align) - 1)) & ~((align) - 1))
 
+/* Define a macro for initializing array using indexes. Due to limitation
+ * of MSVC compiler it is necessary to allow other projects to replace
+ * that macro and strip the index from initialization.
+ * Linux driver is using coccinelle to maintain source sync with upstream
+ * and is not requiring this macro.
+ */
+#define ice_arr_elem_idx(idx, val)	[(idx)] = (val)
+
 int
 ice_write_rxq_ctx(struct ice_hw *hw, struct ice_rlan_ctx *rlan_ctx,
 		  u32 rxq_index);
Signature · 1 line
2.43.0
#393 lore raw

PATCH v4 75/103 net/ice/base: switch speed conversions to static lookups

In reply to Anatoly Burakov

From: Jesse Brandeburg <[email protected]>

Refactor to use a constant time lookup in a table for speed conversions from ICE_AQ_LINK_SPEED values to speeds defined in firmware.

Also, make sure 200000MBPS is defined when needed.

---
 drivers/net/ice/base/ice_common.c    | 40 ++++++++++++++++++++++++++--
 drivers/net/ice/base/ice_common.h    |  1 +
 drivers/net/ice/base/ice_lan_tx_rx.h |  2 +-
 3 files changed, 40 insertions(+), 3 deletions(-)
drivers/net/ice/base/ice_common.c +38 -2
index 9560187a85..de1079b3ae 100644
@@ -3308,8 +3308,8 @@ bool ice_is_100m_speed_supported(struct ice_hw *hw)
  * Note: In the structure of [phy_type_low, phy_type_high], there should
  * be one bit set, as this function will convert one PHY type to its
  * speed.
- * If no bit gets set, ICE_LINK_SPEED_UNKNOWN will be returned
- * If more than one bit gets set, ICE_LINK_SPEED_UNKNOWN will be returned
+ * If no bit gets set, ICE_AQ_LINK_SPEED_UNKNOWN will be returned
+ * If more than one bit gets set, ICE_AQ_LINK_SPEED_UNKNOWN will be returned
  */
 static u16
 ice_get_link_speed_based_on_phy_type(u64 phy_type_low, u64 phy_type_high)
@@ -6322,6 +6322,42 @@ bool ice_fw_supports_report_dflt_cfg(struct ice_hw *hw)
 				     ICE_FW_API_REPORT_DFLT_CFG_PATCH);
 }
 
+/* each of the indexes into the following array match the speed of a return
+ * value from the list of AQ returned speeds like the range:
+ * ICE_AQ_LINK_SPEED_10MB .. ICE_AQ_LINK_SPEED_100GB excluding
+ * ICE_AQ_LINK_SPEED_UNKNOWN which is BIT(15) The array is defined as 15
+ * elements long because the link_speed returned by the firmware is a 16 bit
+ * value, but is indexed by [fls(speed) - 1]
+ */
+static const u32 ice_aq_to_link_speed[] = {
+	ICE_LINK_SPEED_10MBPS,	/* BIT(0) */
+	ICE_LINK_SPEED_100MBPS,
+	ICE_LINK_SPEED_1000MBPS,
+	ICE_LINK_SPEED_2500MBPS,
+	ICE_LINK_SPEED_5000MBPS,
+	ICE_LINK_SPEED_10000MBPS,
+	ICE_LINK_SPEED_20000MBPS,
+	ICE_LINK_SPEED_25000MBPS,
+	ICE_LINK_SPEED_40000MBPS,
+	ICE_LINK_SPEED_50000MBPS,
+	ICE_LINK_SPEED_100000MBPS,	/* BIT(10) */
+	ICE_LINK_SPEED_200000MBPS,
+};
+
+/**
+ * ice_get_link_speed - get integer speed from table
+ * @index: array index from fls(aq speed) - 1
+ *
+ * Returns: u32 value containing integer speed
+ */
+u32 ice_get_link_speed(u16 index)
+{
+	if (index >= ARRAY_SIZE(ice_aq_to_link_speed))
+		return ICE_LINK_SPEED_UNKNOWN;
+
+	return ice_aq_to_link_speed[index];
+}
+
 /**
  * ice_fw_supports_fec_dis_auto
  * @hw: pointer to the hardware structure
drivers/net/ice/base/ice_common.h +1 -0
index df0a247263..894d650b1a 100644
@@ -224,6 +224,7 @@ int
 ice_aq_sff_eeprom(struct ice_hw *hw, u16 lport, u8 bus_addr,
 		  u16 mem_addr, u8 page, u8 set_page, u8 *data, u8 length,
 		  bool write, struct ice_sq_cd *cd);
+u32 ice_get_link_speed(u16 index);
 
 int
 ice_aq_prog_topo_dev_nvm(struct ice_hw *hw,
drivers/net/ice/base/ice_lan_tx_rx.h +1 -1
index 39673e36f7..a28345c2c4 100644
@@ -2469,5 +2469,5 @@ static inline struct ice_rx_ptype_decoded ice_decode_rx_desc_ptype(u16 ptype)
 #define ICE_LINK_SPEED_40000MBPS	40000
 #define ICE_LINK_SPEED_50000MBPS	50000
 #define ICE_LINK_SPEED_100000MBPS	100000
-
+#define ICE_LINK_SPEED_200000MBPS	200000
 #endif /* _ICE_LAN_TX_RX_H_ */
Signature · 1 line
2.43.0
#394 lore raw

PATCH v4 76/103 net/ice/base: merge unified E830 headers

In reply to Anatoly Burakov

From: Scott W Taylor <[email protected]>

These changes are a result of combining E800 and E830 autogen files, as well as multiple other infrastructural changes and E830-specific macro additions in place of common definitions to better align with shared code.

---
 drivers/net/ice/base/ice_common.c     |   35 +-
 drivers/net/ice/base/ice_hw_autogen.h | 2482 +++++++++++++++++++++----
 drivers/net/ice/base/ice_nvm.c        |   15 +-
 3 files changed, 2158 insertions(+), 374 deletions(-)
drivers/net/ice/base/ice_common.c +23 -12
index de1079b3ae..916fe30c94 100644
@@ -813,17 +813,28 @@ ice_fill_tx_timer_and_fc_thresh(struct ice_hw *hw,
 	 * Also, because we are operating on transmit timer and fc
 	 * threshold of LFC, we don't turn on any bit in tx_tmr_priority
 	 */
-#define IDX_OF_LFC PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_MAX_INDEX
+#define E800_IDX_OF_LFC E800_PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_MAX_INDEX
 
-	/* Retrieve the transmit timer */
-	val = rd32(hw, PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA(IDX_OF_LFC));
-	tx_timer_val = val &
-		PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_HSEC_CTL_TX_PAUSE_QUANTA_M;
-	cmd->tx_tmr_value = CPU_TO_LE16(tx_timer_val);
+	if ((hw)->mac_type == ICE_MAC_E830) {
+		/* Retrieve the transmit timer */
+		val = rd32(hw, E830_PRTMAC_CL01_PAUSE_QUANTA);
+		tx_timer_val = val & E830_PRTMAC_CL01_PAUSE_QUANTA_CL0_PAUSE_QUANTA_M;
+		cmd->tx_tmr_value = CPU_TO_LE16(tx_timer_val);
 
-	/* Retrieve the fc threshold */
-	val = rd32(hw, PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER(IDX_OF_LFC));
-	fc_thres_val = val & PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER_M;
+		/* Retrieve the fc threshold */
+		val = rd32(hw, E830_PRTMAC_CL01_QUANTA_THRESH);
+		fc_thres_val = val & E830_PRTMAC_CL01_QUANTA_THRESH_CL0_QUANTA_THRESH_M;
+	} else {
+		/* Retrieve the transmit timer */
+		val = rd32(hw, E800_PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA(E800_IDX_OF_LFC));
+		tx_timer_val = val &
+			E800_PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_HSEC_CTL_TX_PAUSE_QUANTA_M;
+		cmd->tx_tmr_value = CPU_TO_LE16(tx_timer_val);
+
+		/* Retrieve the fc threshold */
+		val = rd32(hw, E800_PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER(E800_IDX_OF_LFC));
+		fc_thres_val = val & E800_PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER_M;
+	}
 
 	cmd->fc_refresh_threshold = CPU_TO_LE16(fc_thres_val);
 }
@@ -2712,11 +2723,11 @@ ice_parse_fdir_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_p)
 	if (hw->dcf_enabled)
 		return;
 	reg_val = rd32(hw, GLQF_FD_SIZE);
-	val = (reg_val & GLQF_FD_SIZE_FD_GSIZE_M) >>
+	val = (reg_val & GLQF_FD_SIZE_FD_GSIZE_M_BY_MAC(hw)) >>
 		GLQF_FD_SIZE_FD_GSIZE_S;
 	func_p->fd_fltr_guar =
 		ice_get_num_per_func(hw, val);
-	val = (reg_val & GLQF_FD_SIZE_FD_BSIZE_M) >>
+	val = (reg_val & GLQF_FD_SIZE_FD_BSIZE_M_BY_MAC(hw)) >>
 		GLQF_FD_SIZE_FD_BSIZE_S;
 	func_p->fd_fltr_best_effort = val;
 
@@ -5724,7 +5735,7 @@ enum ice_fw_modes ice_get_fw_mode(struct ice_hw *hw)
 	u32 fw_mode;
 
 	/* check the current FW mode */
-	fw_mode = rd32(hw, GL_MNG_FWSM) & GL_MNG_FWSM_FW_MODES_M;
+	fw_mode = rd32(hw, GL_MNG_FWSM) & E800_GL_MNG_FWSM_FW_MODES_M;
 
 	if (fw_mode & ICE_FW_MODE_DBG_M)
 		return ICE_FW_MODE_DBG;
drivers/net/ice/base/ice_hw_autogen.h +2126 -356

2,748 lines not on this page · raw message

drivers/net/ice/base/ice_nvm.c +9 -6
index b0d238f7e0..35da0c8b9c 100644
@@ -1359,13 +1359,16 @@ ice_nvm_access_write(struct ice_hw *hw, struct ice_nvm_access_cmd *cmd,
 		return status;
 
 	/* Reject requests to write to read-only registers */
-	switch (cmd->offset) {
-	case GL_HICR_EN:
-	case GLGEN_RSTAT:
+	if (hw->mac_type == ICE_MAC_E830) {
+		if (cmd->offset == E830_GL_HICR_EN)
+			return ICE_ERR_OUT_OF_RANGE;
+	} else {
+		if (cmd->offset == GL_HICR_EN)
+			return ICE_ERR_OUT_OF_RANGE;
+	}
+
+	if (cmd->offset == GLGEN_RSTAT)
 		return ICE_ERR_OUT_OF_RANGE;
-	default:
-		break;
-	}
 
 	ice_debug(hw, ICE_DBG_NVM, "NVM access: writing register %08x with value %08x\n",
 		  cmd->offset, data->regval);
Signature · 1 line
2.43.0
#395 lore raw

PATCH v4 77/103 net/ice/base: support E830 in DDP pkg handling

In reply to Anatoly Burakov

From: Sergey Temerkhanov <[email protected]>

Add support for E830 DDP packages in the DDP package handling code.

---
 drivers/net/ice/base/ice_ddp.c | 6 ++++++
 drivers/net/ice/base/ice_ddp.h | 1 +
 2 files changed, 7 insertions(+)
drivers/net/ice/base/ice_ddp.c +6 -0
index 3271d4572d..d5d81db949 100644
@@ -424,6 +424,9 @@ static u32 ice_get_pkg_segment_id(enum ice_mac_type mac_type)
 	u32 seg_id;
 
 	switch (mac_type) {
+	case ICE_MAC_E830:
+		seg_id = SEGMENT_TYPE_ICE_E830;
+		break;
 	case ICE_MAC_GENERIC:
 	case ICE_MAC_GENERIC_3K:
 	case ICE_MAC_GENERIC_3K_E825:
@@ -444,6 +447,9 @@ static u32 ice_get_pkg_sign_type(enum ice_mac_type mac_type)
 	u32 sign_type;
 
 	switch (mac_type) {
+	case ICE_MAC_E830:
+		sign_type = SEGMENT_SIGN_TYPE_RSA3K_SBB;
+		break;
 	case ICE_MAC_GENERIC_3K:
 		sign_type = SEGMENT_SIGN_TYPE_RSA3K;
 		break;
drivers/net/ice/base/ice_ddp.h +1 -0
index 9aa5f03559..5761920207 100644
@@ -107,6 +107,7 @@ struct ice_generic_seg_hdr {
 #define SEGMENT_TYPE_METADATA	0x00000001
 #define SEGMENT_TYPE_ICE_E810	0x00000010
 #define SEGMENT_TYPE_SIGNING	0x00001001
+#define SEGMENT_TYPE_ICE_E830	0x00000017
 #define SEGMENT_TYPE_ICE_RUN_TIME_CFG 0x00000020
 	__le32 seg_type;
 	struct ice_pkg_ver seg_format_ver;
Signature · 1 line
2.43.0
#396 lore raw

PATCH v4 78/103 net/ice/base: support E830 in Topology AQ command

In reply to Anatoly Burakov

From: Dan Nowlin <[email protected]>

In E830, regarding the Get Tx Topology AQ command, there is a change in the way that the RD bit must be set. For E830, the RD bit must be cleared. Setting the RD bit for the E830 device was causing the Get Tx Topology command to fail.

Fix it to clear RD bit for E830 device.

---
 drivers/net/ice/base/ice_ddp.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_ddp.c +6 -1
index d5d81db949..f82e5a387f 100644
@@ -2298,11 +2298,16 @@ ice_get_set_tx_topo(struct ice_hw *hw, u8 *buf, u16 buf_size,
 		if (buf)
 			cmd->set_flags |= ICE_AQC_TX_TOPO_FLAGS_SRC_RAM |
 					  ICE_AQC_TX_TOPO_FLAGS_LOAD_NEW;
+
+		desc.flags |= CPU_TO_LE16(ICE_AQ_FLAG_RD);
 	} else {
 		ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_tx_topo);
 		cmd->get_flags = ICE_AQC_TX_TOPO_GET_RAM;
+
+		if (!ice_is_e830(hw))
+			desc.flags |= CPU_TO_LE16(ICE_AQ_FLAG_RD);
 	}
-	desc.flags |= CPU_TO_LE16(ICE_AQ_FLAG_RD);
+
 	status = ice_aq_send_cmd(hw, &desc, buf, buf_size, cd);
 	if (status)
 		return status;
Signature · 1 line
2.43.0
#397 lore raw

PATCH v4 79/103 net/ice/base: add E830 PTP init

In reply to Anatoly Burakov

From: Paul Greenwalt <[email protected]>

Add E830 PTP initialization flow.

TXPP requires SW and HW timer clock synchronization which is done during the PTP initialization flow.

The E810 and E830 PTP initialization flows are similar. The primary difference that E810 initializes the PHY via AQCs, and E830 does not initialize the external PHY.

---
 drivers/net/ice/base/ice_ptp_hw.c | 42 ++++++++++++++++++++++++++++---
 1 file changed, 39 insertions(+), 3 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +39 -3
index 0d2968c528..1a25cf5434 100644
@@ -911,6 +911,18 @@ static void ice_ptp_exec_tmr_cmd(struct ice_hw *hw)
 	ice_flush(hw);
 }
 
+/**
+ * ice_ptp_zero_syn_dlay - Set synchronization delay to zero
+ * @hw: pointer to HW struct
+ *
+ * Zero E810 and E830 specific PTP hardware clock synchronization delay.
+ */
+static void ice_ptp_zero_syn_dlay(struct ice_hw *hw)
+{
+	wr32(hw, GLTSYN_SYNC_DLAY, 0);
+	ice_flush(hw);
+}
+
 enum eth56g_res_type {
 	ETH56G_PHY_REG,
 	ETH56G_PHY_MEM,
@@ -2368,9 +2380,10 @@ void ice_ptp_init_phy_model(struct ice_hw *hw)
 
 	if (ice_is_e810(hw))
 		hw->phy_model = ICE_PHY_E810;
+	else if (ice_is_e830(hw))
+		hw->phy_model = ICE_PHY_E830;
 	else
 		hw->phy_model = ICE_PHY_E822;
-
 	hw->phy_ports = ICE_NUM_EXTERNAL_PORTS;
 	hw->max_phy_port = ICE_NUM_EXTERNAL_PORTS;
 }
@@ -4934,8 +4947,7 @@ int ice_ptp_init_phy_e810(struct ice_hw *hw)
  */
 static int ice_ptp_init_phc_e810(struct ice_hw *hw)
 {
-	/* Ensure synchronization delay is zero */
-	wr32(hw, GLTSYN_SYNC_DLAY, 0);
+	ice_ptp_zero_syn_dlay(hw);
 
 	/* Initialize the PHY */
 	return ice_ptp_init_phy_e810(hw);
@@ -5451,6 +5463,24 @@ int ice_ptp_read_sdp_section_from_nvm(struct ice_hw *hw, bool *section_exist,
 	return err;
 }
 
+/* E830 functions
+ *
+ * The following functions operate on the E830 series devices.
+ *
+ */
+
+/**
+ * ice_ptp_init_phc_e830 - Perform E830 specific PHC initialization
+ * @hw: pointer to HW struct
+ *
+ * Perform E830-specific PTP hardware clock initialization steps.
+ */
+static int ice_ptp_init_phc_e830(struct ice_hw *hw)
+{
+	ice_ptp_zero_syn_dlay(hw);
+	return 0;
+}
+
 /**
  * ice_ptp_write_direct_incval_e830 - Prep PHY port increment value change
  * @hw: pointer to HW struct
@@ -6101,6 +6131,7 @@ void ice_ptp_reset_ts_memory(struct ice_hw *hw)
 		ice_ptp_reset_ts_memory_e822(hw);
 		break;
 	case ICE_PHY_E810:
+	case ICE_PHY_E830:
 	default:
 		return;
 	}
@@ -6129,6 +6160,8 @@ int ice_ptp_init_phc(struct ice_hw *hw)
 		return ice_ptp_init_phc_e810(hw);
 	case ICE_PHY_E822:
 		return ice_ptp_init_phc_e822(hw);
+	case ICE_PHY_E830:
+		return ice_ptp_init_phc_e830(hw);
 	default:
 		return ICE_ERR_NOT_SUPPORTED;
 	}
@@ -6151,6 +6184,9 @@ int ice_get_phy_tx_tstamp_ready(struct ice_hw *hw, u8 block, u64 *tstamp_ready)
 	case ICE_PHY_ETH56G:
 		return ice_get_phy_tx_tstamp_ready_eth56g(hw, block,
 							  tstamp_ready);
+	case ICE_PHY_E830:
+		return ice_get_phy_tx_tstamp_ready_e830(hw, block,
+							tstamp_ready);
 	case ICE_PHY_E810:
 		return ice_get_phy_tx_tstamp_ready_e810(hw, block,
 							tstamp_ready);
Signature · 1 line
2.43.0
#398 lore raw

PATCH v4 80/103 net/ice/base: allow skipping main timer programming

In reply to Anatoly Burakov

From: Sergey Temerkhanov <[email protected]>

Allow initialization functions to skip main timer programming.

---
 drivers/net/ice/base/ice_ptp_hw.c | 31 ++++++++++++++++++++-----------
 drivers/net/ice/base/ice_ptp_hw.h |  9 ++++++---
 drivers/net/ice/ice_ethdev.c      |  2 +-
 3 files changed, 27 insertions(+), 15 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +20 -11
index 1a25cf5434..8a6b18b099 100644
@@ -5793,6 +5793,7 @@ static int ice_ptp_tmr_cmd(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd,
  * ice_ptp_init_time - Initialize device time to provided value
  * @hw: pointer to HW struct
  * @time: 64bits of time (GLTSYN_TIME_L and GLTSYN_TIME_H)
+ * @wr_main_tmr: program the main timer
  *
  * Initialize the device to the specified time provided. This requires a three
  * step process:
@@ -5802,7 +5803,7 @@ static int ice_ptp_tmr_cmd(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd,
  * 3) issue an init_time timer command to synchronously switch both the source
  *    and port timers to the new init time value at the next clock cycle.
  */
-int ice_ptp_init_time(struct ice_hw *hw, u64 time)
+int ice_ptp_init_time(struct ice_hw *hw, u64 time, bool wr_main_tmr)
 {
 	int err;
 	u8 tmr_idx;
@@ -5814,9 +5815,11 @@ int ice_ptp_init_time(struct ice_hw *hw, u64 time)
 	if (hw->phy_model == ICE_PHY_E830)
 		return ice_ptp_write_direct_phc_time_e830(hw, time);
 
-	wr32(hw, GLTSYN_SHTIME_L(tmr_idx), ICE_LO_DWORD(time));
-	wr32(hw, GLTSYN_SHTIME_H(tmr_idx), ICE_HI_DWORD(time));
-	wr32(hw, GLTSYN_SHTIME_0(tmr_idx), 0);
+	if (wr_main_tmr) {
+		wr32(hw, GLTSYN_SHTIME_L(tmr_idx), ICE_LO_DWORD(time));
+		wr32(hw, GLTSYN_SHTIME_H(tmr_idx), ICE_HI_DWORD(time));
+		wr32(hw, GLTSYN_SHTIME_0(tmr_idx), 0);
+	}
 
 	/* PHY Clks */
 	/* Fill Rx and Tx ports and send msg to PHY */
@@ -5844,8 +5847,9 @@ int ice_ptp_init_time(struct ice_hw *hw, u64 time)
  * ice_ptp_write_incval - Program PHC with new increment value
  * @hw: pointer to HW struct
  * @incval: Source timer increment value per clock cycle
+ * @wr_main_tmr: Program the main timer
  *
- * Program the PHC with a new increment value. This requires a three-step
+ * Program the timers with a new increment value. This requires a three-step
  * process:
  *
  * 1) Write the increment value to the source timer shadow registers
@@ -5854,7 +5858,8 @@ int ice_ptp_init_time(struct ice_hw *hw, u64 time)
  *    the source and port timers to the new increment value at the next clock
  *    cycle.
  */
-int ice_ptp_write_incval(struct ice_hw *hw, u64 incval)
+int ice_ptp_write_incval(struct ice_hw *hw, u64 incval,
+			 bool wr_main_tmr)
 {
 	int err;
 	u8 tmr_idx;
@@ -5865,9 +5870,11 @@ int ice_ptp_write_incval(struct ice_hw *hw, u64 incval)
 	if (hw->phy_model == ICE_PHY_E830)
 		return ice_ptp_write_direct_incval_e830(hw, incval);
 
-	/* Shadow Adjust */
-	wr32(hw, GLTSYN_SHADJ_L(tmr_idx), ICE_LO_DWORD(incval));
-	wr32(hw, GLTSYN_SHADJ_H(tmr_idx), ICE_HI_DWORD(incval));
+	if (wr_main_tmr) {
+		/* Shadow Adjust */
+		wr32(hw, GLTSYN_SHADJ_L(tmr_idx), ICE_LO_DWORD(incval));
+		wr32(hw, GLTSYN_SHADJ_H(tmr_idx), ICE_HI_DWORD(incval));
+	}
 
 	switch (hw->phy_model) {
 	case ICE_PHY_ETH56G:
@@ -5893,17 +5900,19 @@ int ice_ptp_write_incval(struct ice_hw *hw, u64 incval)
  * ice_ptp_write_incval_locked - Program new incval while holding semaphore
  * @hw: pointer to HW struct
  * @incval: Source timer increment value per clock cycle
+ * @wr_main_tmr: Program the main timer
  *
  * Program a new PHC incval while holding the PTP semaphore.
  */
-int ice_ptp_write_incval_locked(struct ice_hw *hw, u64 incval)
+int ice_ptp_write_incval_locked(struct ice_hw *hw, u64 incval,
+				bool wr_main_tmr)
 {
 	int err;
 
 	if (!ice_ptp_lock(hw))
 		return ICE_ERR_NOT_READY;
 
-	err = ice_ptp_write_incval(hw, incval);
+	err = ice_ptp_write_incval(hw, incval, wr_main_tmr);
 
 	ice_ptp_unlock(hw);
 
drivers/net/ice/base/ice_ptp_hw.h +6 -3
index d4bee8ce40..bd6bb3e839 100644
@@ -142,9 +142,12 @@ u64 ice_ptp_read_src_incval(struct ice_hw *hw);
 bool ice_ptp_lock(struct ice_hw *hw);
 void ice_ptp_unlock(struct ice_hw *hw);
 void ice_ptp_src_cmd(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd);
-int ice_ptp_init_time(struct ice_hw *hw, u64 time);
-int ice_ptp_write_incval(struct ice_hw *hw, u64 incval);
-int ice_ptp_write_incval_locked(struct ice_hw *hw, u64 incval);
+int ice_ptp_init_time(struct ice_hw *hw, u64 time,
+		      bool wr_main_tmr);
+int ice_ptp_write_incval(struct ice_hw *hw, u64 incval,
+			 bool wr_main_tmr);
+int ice_ptp_write_incval_locked(struct ice_hw *hw, u64 incval,
+				bool wr_main_tmr);
 int ice_ptp_adj_clock(struct ice_hw *hw, s32 adj, bool lock_sbq);
 int
 ice_ptp_adj_clock_at_time(struct ice_hw *hw, u64 at_time, s32 adj);
drivers/net/ice/ice_ethdev.c +1 -1
index 9447b44141..64ac64326a 100644
@@ -6460,7 +6460,7 @@ ice_timesync_enable(struct rte_eth_dev *dev)
 			return -1;
 		}
 
-		ret = ice_ptp_write_incval(hw, ICE_PTP_NOMINAL_INCVAL_E810);
+		ret = ice_ptp_write_incval(hw, ICE_PTP_NOMINAL_INCVAL_E810, true);
 		if (ret) {
 			PMD_DRV_LOG(ERR,
 				"Failed to write PHC increment time value");
Signature · 1 line
2.43.0
#399 lore raw

PATCH v4 81/103 net/ice/base: fix compile issues on some targets

In reply to Anatoly Burakov

To avoid triggering compile errors reported on some targets, use explicit type casts to specify type conversion.

---
 drivers/net/ice/base/ice_flow.h   | 2 +-
 drivers/net/ice/base/ice_parser.c | 3 ++-
 drivers/net/ice/base/ice_ptp_hw.c | 9 +++++----
 drivers/net/ice/base/ice_switch.c | 7 ++++---
 4 files changed, 12 insertions(+), 9 deletions(-)
drivers/net/ice/base/ice_flow.h +1 -1
index c1658be477..8c66fb1b96 100644
@@ -485,7 +485,7 @@ struct ice_flow_entry {
 	u8 acts_cnt;
 };
 
-#define ICE_FLOW_ENTRY_HNDL(e)	((intptr_t)e)
+#define ICE_FLOW_ENTRY_HNDL(e)	((u64)e)
 #define ICE_FLOW_ENTRY_PTR(h)	((struct ice_flow_entry *)(h))
 
 struct ice_flow_prof {
drivers/net/ice/base/ice_parser.c +2 -1
index 551e24a5f5..67e36107b5 100644
@@ -146,7 +146,8 @@ void *ice_parser_create_table(struct ice_hw *hw, u32 sect_type,
 			if (no_offset)
 				idx++;
 			else
-				idx = hdr->offset + state.entry_idx;
+				idx = LE16_TO_CPU(hdr->offset) +
+							state.entry_idx;
 			parse_item(hw, idx,
 				   (void *)((uintptr_t)table + idx * item_size),
 				   data, item_size);
drivers/net/ice/base/ice_ptp_hw.c +5 -4
index 8a6b18b099..6929d72ccb 100644
@@ -4063,7 +4063,7 @@ ice_phy_calc_pmd_adj_e822(struct ice_hw *hw, u8 port,
 			return err;
 		}
 
-		rx_cycle = val & P_REG_RX_80_TO_160_CNT_RXCYC_M;
+		rx_cycle = (u8)(val & P_REG_RX_80_TO_160_CNT_RXCYC_M);
 		if (rx_cycle) {
 			mult = rx_cycle * 40;
 
@@ -5825,13 +5825,14 @@ int ice_ptp_init_time(struct ice_hw *hw, u64 time, bool wr_main_tmr)
 	/* Fill Rx and Tx ports and send msg to PHY */
 	switch (hw->phy_model) {
 	case ICE_PHY_ETH56G:
-		err = ice_ptp_prep_phy_time_eth56g(hw, time & 0xFFFFFFFF);
+		err = ice_ptp_prep_phy_time_eth56g(hw,
+						   (u32)(time & 0xFFFFFFFF));
 		break;
 	case ICE_PHY_E810:
-		err = ice_ptp_prep_phy_time_e810(hw, time & 0xFFFFFFFF);
+		err = ice_ptp_prep_phy_time_e810(hw, (u32)(time & 0xFFFFFFFF));
 		break;
 	case ICE_PHY_E822:
-		err = ice_ptp_prep_phy_time_e822(hw, time & 0xFFFFFFFF);
+		err = ice_ptp_prep_phy_time_e822(hw, (u32)(time & 0xFFFFFFFF));
 		break;
 	default:
 		err = ICE_ERR_NOT_SUPPORTED;
drivers/net/ice/base/ice_switch.c +4 -3
index 04b76840dd..92405e1fdb 100644
@@ -7593,7 +7593,8 @@ ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm,
 		}
 
 		for (i = 0; i < entry->r_group.n_val_pairs; i++) {
-			buf[recps].content.lkup_indx[i + 1] = entry->fv_idx[i];
+			buf[recps].content.lkup_indx[i + 1] =
+				(u8)entry->fv_idx[i];
 			buf[recps].content.mask[i + 1] =
 				CPU_TO_LE16(entry->fv_mask[i]);
 		}
@@ -7614,8 +7615,8 @@ ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm,
 				((chain_idx << ICE_AQ_RECIPE_RESULT_DATA_S) &
 				 ICE_AQ_RECIPE_RESULT_DATA_M);
 			ice_clear_bit(chain_idx, result_idx_bm);
-			chain_idx = ice_find_first_bit(result_idx_bm,
-						       ICE_MAX_FV_WORDS);
+			chain_idx = (u8)ice_find_first_bit(result_idx_bm,
+							   ICE_MAX_FV_WORDS);
 		}
 
 		/* fill recipe dependencies */
Signature · 1 line
2.43.0
#400 lore raw

PATCH v4 82/103 net/ice/base: add L2TPv3 support for adv rules

In reply to Anatoly Burakov

From: Wojciech Drewek <[email protected]>

This patch adds L2TPv3 dummy packets, data structures and defines.

---
 drivers/net/ice/base/ice_switch.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/net/ice/base/ice_switch.c +6 -2
index 92405e1fdb..e8edcf5ba3 100644
@@ -2033,6 +2033,7 @@ static const u8 dummy_ipv6_nat_pkt[] = {
 
 static const struct ice_dummy_pkt_offsets dummy_ipv4_l2tpv3_packet_offsets[] = {
 	{ ICE_MAC_OFOS,		0 },
+	{ ICE_ETYPE_OL,		12 },
 	{ ICE_IPV4_OFOS,	14 },
 	{ ICE_L2TPV3,		34 },
 	{ ICE_PROTOCOL_LAST,	0 },
@@ -2042,7 +2043,8 @@ static const u8 dummy_ipv4_l2tpv3_pkt[] = {
 	0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
 	0x00, 0x00, 0x00, 0x00,
 	0x00, 0x00, 0x00, 0x00,
-	0x08, 0x00,
+
+	0x08, 0x00,		/* ICE_ETYPE_OL 12 */
 
 	0x45, 0x00, 0x00, 0x20, /* ICE_IPV4_IL 14 */
 	0x00, 0x00, 0x40, 0x00,
@@ -2058,6 +2060,7 @@ static const u8 dummy_ipv4_l2tpv3_pkt[] = {
 
 static const struct ice_dummy_pkt_offsets dummy_ipv6_l2tpv3_packet_offsets[] = {
 	{ ICE_MAC_OFOS,		0 },
+	{ ICE_ETYPE_OL,		12 },
 	{ ICE_IPV6_OFOS,	14 },
 	{ ICE_L2TPV3,		54 },
 	{ ICE_PROTOCOL_LAST,	0 },
@@ -2067,7 +2070,8 @@ static const u8 dummy_ipv6_l2tpv3_pkt[] = {
 	0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
 	0x00, 0x00, 0x00, 0x00,
 	0x00, 0x00, 0x00, 0x00,
-	0x86, 0xDD,
+
+	0x86, 0xDD,		/* ICE_ETYPE_OL 12 */
 
 	0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_IL 14 */
 	0x00, 0x0c, 0x73, 0x40,
Signature · 1 line
2.43.0
#401 lore raw

PATCH v4 83/103 net/ice/base: detect and store device sensor reading capability

In reply to Anatoly Burakov

From: Eric Joyner <[email protected]>

The driver can use this capability to see if temperature sensor reading or other HW sensor reading capabilities are supported before reading them using the Get Sensor Reading AQ command.

---
 drivers/net/ice/base/ice_adminq_cmd.h |  1 +
 drivers/net/ice/base/ice_common.c     | 23 +++++++++++++++++++++++
 drivers/net/ice/base/ice_type.h       |  3 +++
 3 files changed, 27 insertions(+)
drivers/net/ice/base/ice_adminq_cmd.h +1 -0
index 457455fe85..7334addd09 100644
@@ -120,6 +120,7 @@ struct ice_aqc_list_caps_elem {
 #define ICE_AQC_CAPS_1588				0x0046
 #define ICE_AQC_CAPS_MAX_MTU				0x0047
 #define ICE_AQC_CAPS_IWARP				0x0051
+#define ICE_AQC_CAPS_SENSOR_READING			0x0067
 #define ICE_AQC_CAPS_PCIE_RESET_AVOIDANCE		0x0076
 #define ICE_AQC_CAPS_POST_UPDATE_RESET_RESTRICT		0x0077
 #define ICE_AQC_CAPS_NVM_MGMT				0x0080
drivers/net/ice/base/ice_common.c +23 -0
index 916fe30c94..fe2cc543e4 100644
@@ -2948,6 +2948,26 @@ ice_parse_nac_topo_dev_caps(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p,
 		  dev_p->nac_topo.id);
 }
 
+/**
+ * ice_parse_sensor_reading_cap - Parse ICE_AQC_CAPS_SENSOR_READING cap
+ * @hw: pointer to the HW struct
+ * @dev_p: pointer to device capabilities structure
+ * @cap: capability element to parse
+ *
+ * Parse ICE_AQC_CAPS_SENSOR_READING for device capability for reading
+ * enabled sensors.
+ */
+static void
+ice_parse_sensor_reading_cap(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p,
+			     struct ice_aqc_list_caps_elem *cap)
+{
+	dev_p->supported_sensors = LE32_TO_CPU(cap->number);
+
+	ice_debug(hw, ICE_DBG_INIT,
+		  "dev caps: supported sensors (bitmap) = 0x%x\n",
+		  dev_p->supported_sensors);
+}
+
 /**
  * ice_parse_dev_caps - Parse device capabilities
  * @hw: pointer to the HW struct
@@ -2996,6 +3016,9 @@ ice_parse_dev_caps(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p,
 		case ICE_AQC_CAPS_NAC_TOPOLOGY:
 			ice_parse_nac_topo_dev_caps(hw, dev_p, &cap_resp[i]);
 			break;
+		case ICE_AQC_CAPS_SENSOR_READING:
+			ice_parse_sensor_reading_cap(hw, dev_p, &cap_resp[i]);
+			break;
 		default:
 			/* Don't list common capabilities as unknown */
 			if (!found)
drivers/net/ice/base/ice_type.h +3 -0
index 14c5b2fa01..e199868326 100644
@@ -827,6 +827,9 @@ struct ice_hw_dev_caps {
 	struct ice_ts_dev_info ts_dev_info;
 	u32 num_funcs;
 	struct ice_nac_topology nac_topo;
+	/* bitmap of supported sensors */
+	u32 supported_sensors;
+#define ICE_SENSOR_SUPPORT_E810_INT_TEMP	BIT(0)
 };
 
 /* Information about MAC such as address, etc... */
Signature · 1 line
2.43.0
#402 lore raw

PATCH v4 84/103 net/ice/base: increase PF reset wait timeout to 500 milliseconds

In reply to Anatoly Burakov

From: Benjamin Mikailenko <[email protected]>

In the CORE ICE driver enabled devlink to issue EMPR resets during NVM update. As a result, resets took a matter of around 25ms longer than driver wait time to finish.

Fix this by increasing driver wait time from 300ms to 500ms.

---
 drivers/net/ice/base/ice_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ice/base/ice_common.c +1 -1
index fe2cc543e4..ca8087dec1 100644
@@ -9,7 +9,7 @@
 #include "ice_flow.h"
 #include "ice_switch.h"
 
-#define ICE_PF_RESET_WAIT_COUNT	300
+#define ICE_PF_RESET_WAIT_COUNT	500
 
 static const char * const ice_link_mode_str_low[] = {
 	ice_arr_elem_idx(0, "100BASE_TX"),
Signature · 1 line
2.43.0
#403 lore raw

PATCH v4 85/103 net/ice/base: use a variable to store reset count

In reply to Anatoly Burakov

From: Fabio Pricoco <[email protected]>

Depending on platform and whether silicon validation tools are used, the timeout value may be set to a different value. This patch uses a variable to store the reset count value as opposed to using the macro directly.

---
 drivers/net/ice/base/ice_common.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
drivers/net/ice/base/ice_common.c +11 -7
index ca8087dec1..c14f66d55b 100644
@@ -1236,7 +1236,7 @@ void ice_deinit_hw(struct ice_hw *hw)
  */
 int ice_check_reset(struct ice_hw *hw)
 {
-	u32 cnt, reg = 0, grst_timeout, uld_mask;
+	u32 cnt, reg = 0, grst_timeout, uld_mask, reset_wait_cnt;
 
 	/* Poll for Device Active state in case a recent CORER, GLOBR,
 	 * or EMPR has occurred. The grst delay value is in 100ms units.
@@ -1267,8 +1267,10 @@ int ice_check_reset(struct ice_hw *hw)
 
 	uld_mask = ICE_RESET_DONE_MASK;
 
+	reset_wait_cnt = ICE_PF_RESET_WAIT_COUNT;
+
 	/* Device is Active; check Global Reset processes are done */
-	for (cnt = 0; cnt < ICE_PF_RESET_WAIT_COUNT; cnt++) {
+	for (cnt = 0; cnt < reset_wait_cnt; cnt++) {
 		reg = rd32(hw, GLNVM_ULD) & uld_mask;
 		if (reg == uld_mask) {
 			ice_debug(hw, ICE_DBG_INIT, "Global reset processes done. %d\n", cnt);
@@ -1277,7 +1279,7 @@ int ice_check_reset(struct ice_hw *hw)
 		ice_msec_delay(10, true);
 	}
 
-	if (cnt == ICE_PF_RESET_WAIT_COUNT) {
+	if (cnt == reset_wait_cnt) {
 		ice_debug(hw, ICE_DBG_INIT, "Wait for Reset Done timed out. GLNVM_ULD = 0x%x\n",
 			  reg);
 		return ICE_ERR_RESET_FAILED;
@@ -1295,7 +1297,7 @@ int ice_check_reset(struct ice_hw *hw)
  */
 static int ice_pf_reset(struct ice_hw *hw)
 {
-	u32 cnt, reg;
+	u32 cnt, reg, reset_wait_cnt, cfg_lock_timeout;
 
 	/* If at function entry a global reset was already in progress, i.e.
 	 * state is not 'device active' or any of the reset done bits are not
@@ -1320,8 +1322,10 @@ static int ice_pf_reset(struct ice_hw *hw)
 	 * timeout plus the PFR timeout which will account for a possible reset
 	 * that is occurring during a download package operation.
 	 */
-	for (cnt = 0; cnt < ICE_GLOBAL_CFG_LOCK_TIMEOUT +
-	     ICE_PF_RESET_WAIT_COUNT; cnt++) {
+	reset_wait_cnt = ICE_PF_RESET_WAIT_COUNT;
+	cfg_lock_timeout = ICE_GLOBAL_CFG_LOCK_TIMEOUT;
+
+	for (cnt = 0; cnt < cfg_lock_timeout + reset_wait_cnt; cnt++) {
 		reg = rd32(hw, PFGEN_CTRL);
 		if (!(reg & PFGEN_CTRL_PFSWR_M))
 			break;
@@ -1329,7 +1333,7 @@ static int ice_pf_reset(struct ice_hw *hw)
 		ice_msec_delay(1, true);
 	}
 
-	if (cnt == ICE_PF_RESET_WAIT_COUNT) {
+	if (cnt == cfg_lock_timeout + reset_wait_cnt) {
 		ice_debug(hw, ICE_DBG_INIT, "PF reset polling failed to complete.\n");
 		return ICE_ERR_RESET_FAILED;
 	}
Signature · 1 line
2.43.0
#404 lore raw

PATCH v4 86/103 net/ice/base: fix masking in ice_get_ctx()

In reply to Anatoly Burakov

From: Yahui Cao <[email protected]>

No need to invert mask since we only reserve the masked bits instead of clear them.

Fixes a03c714bfe0b ("net/ice/base: add two helper functions")
---
 drivers/net/ice/base/ice_common.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/ice/base/ice_common.c +4 -4
index c14f66d55b..9a9c8f86e5 100644
@@ -5014,7 +5014,7 @@ ice_read_byte(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)
 
 	ice_memcpy(&dest_byte, src, sizeof(dest_byte), ICE_NONDMA_TO_NONDMA);
 
-	dest_byte &= ~(mask);
+	dest_byte &= mask;
 
 	dest_byte >>= shift_width;
 
@@ -5054,7 +5054,7 @@ ice_read_word(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)
 	/* the data in the memory is stored as little endian so mask it
 	 * correctly
 	 */
-	src_word &= ~(CPU_TO_LE16(mask));
+	src_word &= CPU_TO_LE16(mask);
 
 	/* get the data back into host order before shifting */
 	dest_word = LE16_TO_CPU(src_word);
@@ -5105,7 +5105,7 @@ ice_read_dword(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)
 	/* the data in the memory is stored as little endian so mask it
 	 * correctly
 	 */
-	src_dword &= ~(CPU_TO_LE32(mask));
+	src_dword &= CPU_TO_LE32(mask);
 
 	/* get the data back into host order before shifting */
 	dest_dword = LE32_TO_CPU(src_dword);
@@ -5156,7 +5156,7 @@ ice_read_qword(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)
 	/* the data in the memory is stored as little endian so mask it
 	 * correctly
 	 */
-	src_qword &= ~(CPU_TO_LE64(mask));
+	src_qword &= CPU_TO_LE64(mask);
 
 	/* get the data back into host order before shifting */
 	dest_qword = LE64_TO_CPU(src_qword);
Signature · 1 line
2.43.0
#405 lore raw

PATCH v4 87/103 net/ice/base: add AQ function to configure SyncE error reporting

In reply to Anatoly Burakov

From: Ben Shelton <[email protected]>

The AE driver will call this function to enable the SyncE error reporting mechanism and enable event reporting when errors occur.

---
 drivers/net/ice/base/ice_adminq_cmd.h | 29 +++++++++++++++++++++++++++
 drivers/net/ice/base/ice_common.c     | 29 +++++++++++++++++++++++++++
 drivers/net/ice/base/ice_common.h     |  3 +++
 3 files changed, 61 insertions(+)
drivers/net/ice/base/ice_adminq_cmd.h +29 -0
index 7334addd09..936735022d 100644
@@ -3014,6 +3014,29 @@ struct ice_aqc_get_pkg_info_resp {
 	struct ice_aqc_get_pkg_info pkg_info[STRUCT_HACK_VAR_LEN];
 };
 
+/* Configure CGU Error Reporting (direct, 0x0C60) */
+struct ice_aqc_cfg_cgu_err {
+	u8 cmd;
+#define ICE_AQC_CFG_CGU_EVENT_SHIFT	0
+#define ICE_AQC_CFG_CGU_EVENT_MASK	BIT(ICE_AQC_CFG_CGU_EVENT_SHIFT)
+#define ICE_AQC_CFG_CGU_EVENT_EN	(0 << ICE_AQC_CFG_CGU_EVENT_SHIFT)
+#define ICE_AQC_CFG_CGU_EVENT_DIS	ICE_AQC_CFG_CGU_EVENT_MASK
+#define ICE_AQC_CFG_CGU_ERR_SHIFT	1
+#define ICE_AQC_CFG_CGU_ERR_MASK	BIT(ICE_AQC_CFG_CGU_ERR_SHIFT)
+#define ICE_AQC_CFG_CGU_ERR_EN		(0 << ICE_AQC_CFG_CGU_ERR_SHIFT)
+#define ICE_AQC_CFG_CGU_ERR_DIS		ICE_AQC_CFG_CGU_ERR_MASK
+	u8 rsvd[15];
+};
+
+/* CGU Error Event (direct, 0x0C60) */
+struct ice_aqc_event_cgu_err {
+	u8 err_type;
+#define ICE_AQC_CGU_ERR_SYNCE_LOCK_LOSS		BIT(0)
+#define ICE_AQC_CGU_ERR_HOLDOVER_CHNG		BIT(1)
+#define ICE_AQC_CGU_ERR_TIMESYNC_LOCK_LOSS	BIT(2)
+	u8 rsvd[15];
+};
+
 /* Driver Shared Parameters (direct, 0x0C90) */
 struct ice_aqc_driver_shared_params {
 	u8 set_or_get_op;
@@ -3266,6 +3289,8 @@ struct ice_aq_desc {
 		struct ice_aqc_get_vsi_resp get_vsi_resp;
 		struct ice_aqc_download_pkg download_pkg;
 		struct ice_aqc_get_pkg_info_list get_pkg_info_list;
+		struct ice_aqc_cfg_cgu_err config_cgu_err;
+		struct ice_aqc_event_cgu_err cgu_err;
 		struct ice_aqc_driver_shared_params drv_shared_params;
 		struct ice_aqc_debug_dump_internals debug_dump;
 		struct ice_aqc_set_mac_lb set_mac_lb;
@@ -3539,6 +3564,10 @@ enum ice_adminq_opc {
 	ice_aqc_opc_update_pkg				= 0x0C42,
 	ice_aqc_opc_get_pkg_info_list			= 0x0C43,
 
+	/* 1588/SyncE commands/events */
+	ice_aqc_opc_cfg_cgu_err				= 0x0C60,
+	ice_aqc_opc_event_cgu_err			= 0x0C60,
+
 	ice_aqc_opc_driver_shared_params		= 0x0C90,
 
 	/* Standalone Commands/Events */
drivers/net/ice/base/ice_common.c +29 -0
index 9a9c8f86e5..9a61c1357d 100644
@@ -5471,6 +5471,35 @@ ice_cfg_vsi_lan(struct ice_port_info *pi, u16 vsi_handle, u16 tc_bitmap,
 			      ICE_SCHED_NODE_OWNER_LAN);
 }
 
+/**
+ * ice_aq_cfg_cgu_err
+ * @hw: pointer to the HW struct
+ * @ena_event_report: enable or disable event reporting
+ * @ena_err_report: enable/re-enable or disable error reporting mechanism
+ * @cd: pointer to command details structure or NULL
+ *
+ * Configure CGU error reporting mechanism (0x0C60)
+ */
+int
+ice_aq_cfg_cgu_err(struct ice_hw *hw, bool ena_event_report,
+		   bool ena_err_report, struct ice_sq_cd *cd)
+{
+	struct ice_aqc_cfg_cgu_err *cmd;
+	struct ice_aq_desc desc;
+
+	cmd = &desc.params.config_cgu_err;
+
+	ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_cfg_cgu_err);
+
+	if (!ena_event_report)
+		cmd->cmd |= ICE_AQC_CFG_CGU_EVENT_DIS;
+
+	if (!ena_err_report)
+		cmd->cmd |= ICE_AQC_CFG_CGU_ERR_DIS;
+
+	return ice_aq_send_cmd(hw, &desc, NULL, 0, cd);
+}
+
 /**
  * ice_aq_get_sensor_reading
  * @hw: pointer to the HW struct
drivers/net/ice/base/ice_common.h +3 -0
index 894d650b1a..51710f9c8b 100644
@@ -269,6 +269,9 @@ void ice_sbq_lock(struct ice_hw *hw);
 void ice_sbq_unlock(struct ice_hw *hw);
 int ice_sbq_rw_reg(struct ice_hw *hw, struct ice_sbq_msg_input *in, u16 flag);
 int
+ice_aq_cfg_cgu_err(struct ice_hw *hw, bool ena_event_report, bool ena_err_report,
+		   struct ice_sq_cd *cd);
+int
 ice_aq_get_sensor_reading(struct ice_hw *hw, u8 sensor, u8 format,
 			  struct ice_aqc_get_sensor_reading_resp *data,
 			  struct ice_sq_cd *cd);
Signature · 1 line
2.43.0
#406 lore raw

PATCH v4 88/103 net/ice/base: update boost struct for traffic types

In reply to Anatoly Burakov

From: Przemek Kitszel <[email protected]>

Update boost struc to support both udp and vlan based on union.

---
 drivers/net/ice/base/ice_flex_type.h | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/net/ice/base/ice_flex_type.h +10 -2
index c83479d6fa..52320d86dc 100644
@@ -382,8 +382,16 @@ struct ice_sw_fv_list_entry {
 struct ice_boost_key_value {
 #define ICE_BOOST_REMAINING_HV_KEY	15
 	u8 remaining_hv_key[ICE_BOOST_REMAINING_HV_KEY];
-	__le16 hv_dst_port_key;
-	__le16 hv_src_port_key;
+	union {
+		struct {
+			__le16 hv_dst_port_key;
+			__le16 hv_src_port_key;
+		} /* udp_tunnel */;
+		struct {
+			__le16 hv_vlan_id_key;
+			__le16 hv_etype_key;
+		} vlan;
+	};
 	u8 tcam_search_key;
 };
 #pragma pack()
Signature · 1 line
2.43.0
#407 lore raw

PATCH v4 89/103 net/ice/base: enable CGU error reporting

In reply to Anatoly Burakov

From: Karol Kolacinski <[email protected]>

Enable CGU error reporting for SyncE and TimeSync issues. Process TimeSync loss of lock event by trying to acquire lock with the default config.

---
 drivers/net/ice/base/ice_ptp_hw.c | 49 ++++++++++++++++++++++++++++++-
 1 file changed, 48 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_ptp_hw.c +48 -1
index 6929d72ccb..bf3c32ae64 100644
@@ -787,7 +787,49 @@ static int ice_init_cgu_e82x(struct ice_hw *hw)
 }
 
 /**
- * @ice_ptp_tmr_cmd_to_src_reg - Convert to source timer command value
+ * ice_ptp_cgu_err_reporting - Enable/disable error reporting for CGU
+ * @hw: pointer to HW struct
+ * @enable: true if reporting should be enabled
+ *
+ * Enable or disable error events to be reported through Admin Queue.
+ *
+ * Return: 0 on success, error code otherwise
+ */
+static int ice_ptp_cgu_err_reporting(struct ice_hw *hw, bool enable)
+{
+	int err;
+
+	err = ice_aq_cfg_cgu_err(hw, enable, enable, NULL);
+	if (err) {
+		ice_debug(hw, ICE_DBG_PTP,
+			  "Failed to %s CGU error reporting, err %d\n",
+			  enable ? "enable" : "disable", err);
+		return err;
+	}
+
+	return 0;
+}
+
+/**
+ * ice_ptp_process_cgu_err - Handle reported CGU error
+ * @hw: pointer to HW struct
+ * @event: reported CGU error descriptor
+ */
+void ice_ptp_process_cgu_err(struct ice_hw *hw, struct ice_rq_event_info *event)
+{
+	u8 err_type = event->desc.params.cgu_err.err_type;
+
+	if (err_type & ICE_AQC_CGU_ERR_TIMESYNC_LOCK_LOSS) {
+		ice_warn(hw, "TimeSync PLL lock lost. Retrying to acquire lock with default PLL configuration.\n");
+		ice_init_cgu_e82x(hw);
+	}
+
+	/* Reenable CGU error reporting */
+	ice_ptp_cgu_err_reporting(hw, true);
+}
+
+/**
+ * ice_ptp_tmr_cmd_to_src_reg - Convert to source timer command value
  * @hw: pointer to HW struct
  * @cmd: Timer command
  *
@@ -3054,6 +3096,11 @@ static int ice_ptp_init_phc_e822(struct ice_hw *hw)
 	if (err)
 		return err;
 
+	/* Enable CGU error reporting */
+	err = ice_ptp_cgu_err_reporting(hw, true);
+	if (err)
+		return err;
+
 	/* Set window length for all the ports */
 	return ice_ptp_set_vernier_wl(hw);
 }
Signature · 1 line
2.43.0
#408 lore raw

PATCH v4 90/103 net/ice/base: cleanup timestamp registers correctly

In reply to Anatoly Burakov

From: Karol Kolacinski <[email protected]>

E822 PHY TS registers should not be written and the only way to cleanup them is to reset QUAD memory.

To ensure that the status bit for the timestamp index is cleared, ensure that ice_clear_phy_tstamp implementations first read the timestamp out. Implementations which can write the register continue to do so.

Add a note to indicate this function should only be called on timestamps which have their valid bit set.

---
 drivers/net/ice/base/ice_ptp_hw.c | 46 ++++++++++++++++++-------------
 1 file changed, 27 insertions(+), 19 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +27 -19
index bf3c32ae64..bba228ed39 100644
@@ -1540,8 +1540,18 @@ static int
 ice_clear_phy_tstamp_eth56g(struct ice_hw *hw, u8 port, u8 idx)
 {
 	int err;
+	u64 unused_tstamp;
 	u16 lo_addr;
 
+	/* Read the timestamp register to ensure the timestamp status bit is
+	 * cleared.
+	 */
+	err = ice_read_phy_tstamp_eth56g(hw, port, idx, &unused_tstamp);
+	if (err) {
+		ice_debug(hw, ICE_DBG_PTP, "Failed to read the PHY timestamp register for port %u, idx %u, err %d\n",
+			  port, idx, err);
+	}
+
 	lo_addr = (u16)PHY_TSTAMP_L(idx);
 
 	err = ice_phy_port_mem_write_eth56g(hw, port, lo_addr, 0);
@@ -2997,23 +3007,13 @@ ice_read_phy_tstamp_e822(struct ice_hw *hw, u8 quad, u8 idx, u64 *tstamp)
 static int
 ice_clear_phy_tstamp_e822(struct ice_hw *hw, u8 quad, u8 idx)
 {
+	u64 unused_tstamp;
 	int err;
-	u16 lo_addr, hi_addr;
 
-	lo_addr = (u16)TS_L(Q_REG_TX_MEMORY_BANK_START, idx);
-	hi_addr = (u16)TS_H(Q_REG_TX_MEMORY_BANK_START, idx);
-
-	err = ice_write_quad_reg_e822(hw, quad, lo_addr, 0);
-	if (err) {
-		ice_debug(hw, ICE_DBG_PTP, "Failed to clear low PTP timestamp register, err %d\n",
-			  err);
-		return err;
-	}
-
-	err = ice_write_quad_reg_e822(hw, quad, hi_addr, 0);
+	err = ice_read_phy_tstamp_e822(hw, quad, idx, &unused_tstamp);
 	if (err) {
-		ice_debug(hw, ICE_DBG_PTP, "Failed to clear high PTP timestamp register, err %d\n",
-			  err);
+		ice_debug(hw, ICE_DBG_PTP, "Failed to read the timestamp register for quad %u, idx %u, err %d\n",
+			  quad, idx, err);
 		return err;
 	}
 
@@ -4939,23 +4939,31 @@ ice_read_phy_tstamp_e810(struct ice_hw *hw, u8 lport, u8 idx, u64 *tstamp)
 static int
 ice_clear_phy_tstamp_e810(struct ice_hw *hw, u8 lport, u8 idx)
 {
-	int err;
 	u32 lo_addr, hi_addr;
+	u64 unused_tstamp;
+	int err;
+
+	err = ice_read_phy_tstamp_e810(hw, lport, idx, &unused_tstamp);
+	if (err) {
+		ice_debug(hw, ICE_DBG_PTP, "Failed to read the timestamp register for lport %u, idx %u, err %d\n",
+			  lport, idx, err);
+		return err;
+	}
 
 	lo_addr = TS_EXT(LOW_TX_MEMORY_BANK_START, lport, idx);
 	hi_addr = TS_EXT(HIGH_TX_MEMORY_BANK_START, lport, idx);
 
 	err = ice_write_phy_reg_e810(hw, lo_addr, 0);
 	if (err) {
-		ice_debug(hw, ICE_DBG_PTP, "Failed to clear low PTP timestamp register, err %d\n",
-			  err);
+		ice_debug(hw, ICE_DBG_PTP, "Failed to clear low PTP timestamp register for lport %u, idx %u, err %d\n",
+			  lport, idx, err);
 		return err;
 	}
 
 	err = ice_write_phy_reg_e810(hw, hi_addr, 0);
 	if (err) {
-		ice_debug(hw, ICE_DBG_PTP, "Failed to clear high PTP timestamp register, err %d\n",
-			  err);
+		ice_debug(hw, ICE_DBG_PTP, "Failed to clear high PTP timestamp register for lport %u, idx %u, err %d\n",
+			  lport, idx, err);
 		return err;
 	}
 
Signature · 1 line
2.43.0
#409 lore raw

PATCH v4 91/103 net/ice/base: remove PHY port timer bypass mode

In reply to Anatoly Burakov

From: Milena Olech <[email protected]>

Previous implementation switches between bypass and Vernier mode dynamically. However bypass mode should be removed due to low precision.

---
 drivers/net/ice/base/ice_ptp_hw.c | 195 +-----------------------------
 drivers/net/ice/base/ice_ptp_hw.h |   6 +-
 drivers/net/ice/ice_ethdev.c      |   2 +-
 3 files changed, 6 insertions(+), 197 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +3 -192
index bba228ed39..08ff620b34 100644
@@ -2214,7 +2214,6 @@ ice_stop_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool soft_reset)
  * ice_start_phy_timer_eth56g - Start the PHY clock timer
  * @hw: pointer to the HW struct
  * @port: the PHY port to start
- * @bypass: unused, for compatibility
  *
  * 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
@@ -2222,7 +2221,7 @@ ice_stop_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool soft_reset)
  *
  */
 int
-ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool bypass)
+ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port)
 {
 	int err;
 	u32 lo, hi;
@@ -3926,47 +3925,6 @@ int ice_phy_cfg_tx_offset_e822(struct ice_hw *hw, u8 port)
 	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;
-	int err;
-	u64 total_offset;
-
-	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 0;
-}
-
 /**
  * ice_phy_calc_pmd_adj_e822 - Calculate PMD adjustment for Rx
  * @hw: pointer to the HW struct
@@ -4277,47 +4235,6 @@ static int ice_ptp_clear_phy_offset_ready_e822(struct ice_hw *hw)
 	return 0;
 }
 
-/**
- * ice_phy_cfg_fixed_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;
-	int err;
-	u64 total_offset;
-
-	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 0;
-}
-
 /**
  * ice_read_phy_and_phc_time_e822 - Simultaneously capture PHC and PHY time
  * @hw: pointer to the HW struct
@@ -4498,20 +4415,15 @@ ice_stop_phy_timer_e822(struct ice_hw *hw, u8 port, bool soft_reset)
  * 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.
  *
- * 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. Use ice_phy_exit_bypass_e822 to exit bypass mode once hardware
- * has completed offset calculation.
+ * Hardware will take Vernier measurements on Tx or Rx of packets.
  */
 int
-ice_start_phy_timer_e822(struct ice_hw *hw, u8 port, bool bypass)
+ice_start_phy_timer_e822(struct ice_hw *hw, u8 port)
 {
 	u32 lo, hi, val;
 	u64 incval;
@@ -4592,23 +4504,6 @@ ice_start_phy_timer_e822(struct ice_hw *hw, u8 port, bool bypass)
 	if (err)
 		return err;
 
-	if (bypass) {
-		val |= P_REG_PS_BYPASS_MODE_M;
-		/* Enter BYPASS mode, enabling timestamps immediately. */
-		err = ice_write_phy_reg_e822(hw, port, P_REG_PS, val);
-		if (err)
-			return err;
-
-		/* 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;
-	}
 
 	ice_debug(hw, ICE_DBG_PTP, "Enabled clock on PHY port %u\n", port);
 
@@ -4650,90 +4545,6 @@ ice_get_phy_tx_tstamp_ready_e822(struct ice_hw *hw, u8 quad, u64 *tstamp_ready)
 	return 0;
 }
 
-/**
- * ice_phy_exit_bypass_e822 - Exit bypass mode, after vernier calculations
- * @hw: pointer to the HW struct
- * @port: the PHY port to configure
- *
- * After hardware finishes vernier calculations for the Tx and Rx offset, this
- * function can be used to exit bypass mode by updating the total Tx and Rx
- * offsets, and then disabling bypass. This will enable hardware to include
- * the more precise offset calibrations, increasing precision of the generated
- * timestamps.
- *
- * This cannot be done until hardware has measured the offsets, which requires
- * waiting until at least one packet has been sent and received by the device.
- */
-int ice_phy_exit_bypass_e822(struct ice_hw *hw, u8 port)
-{
-	int err;
-	u32 val;
-
-	err = ice_read_phy_reg_e822(hw, port, P_REG_TX_OV_STATUS, &val);
-	if (err) {
-		ice_debug(hw, ICE_DBG_PTP, "Failed to read TX_OV_STATUS for port %u, err %d\n",
-			  port, err);
-		return err;
-	}
-
-	if (!(val & P_REG_TX_OV_STATUS_OV_M)) {
-		ice_debug(hw, ICE_DBG_PTP, "Tx offset is not yet valid for port %u\n",
-			  port);
-		return ICE_ERR_NOT_READY;
-	}
-
-	err = ice_read_phy_reg_e822(hw, port, P_REG_RX_OV_STATUS, &val);
-	if (err) {
-		ice_debug(hw, ICE_DBG_PTP, "Failed to read RX_OV_STATUS for port %u, err %d\n",
-			  port, err);
-		return err;
-	}
-
-	if (!(val & P_REG_TX_OV_STATUS_OV_M)) {
-		ice_debug(hw, ICE_DBG_PTP, "Rx offset is not yet valid for port %u\n",
-			  port);
-		return ICE_ERR_NOT_READY;
-	}
-
-	err = ice_phy_cfg_tx_offset_e822(hw, port);
-	if (err) {
-		ice_debug(hw, ICE_DBG_PTP, "Failed to program total Tx offset for port %u, err %d\n",
-			  port, err);
-		return err;
-	}
-
-	err = ice_phy_cfg_rx_offset_e822(hw, port);
-	if (err) {
-		ice_debug(hw, ICE_DBG_PTP, "Failed to program total Rx offset for port %u, err %d\n",
-			  port, err);
-		return err;
-	}
-
-	/* Exit bypass mode now that the offset has been updated */
-	err = ice_read_phy_reg_e822(hw, port, P_REG_PS, &val);
-	if (err) {
-		ice_debug(hw, ICE_DBG_PTP, "Failed to read P_REG_PS for port %u, err %d\n",
-			  port, err);
-		return err;
-	}
-
-	if (!(val & P_REG_PS_BYPASS_MODE_M))
-		ice_debug(hw, ICE_DBG_PTP, "Port %u not in bypass mode\n",
-			  port);
-
-	val &= ~P_REG_PS_BYPASS_MODE_M;
-	err = ice_write_phy_reg_e822(hw, port, P_REG_PS, val);
-	if (err) {
-		ice_debug(hw, ICE_DBG_PTP, "Failed to disable bypass for port %u, err %d\n",
-			  port, err);
-		return err;
-	}
-
-	ice_info(hw, "Exiting bypass mode on PHY port %u\n", port);
-
-	return 0;
-}
-
 /* E810 functions
  *
  * The following functions operate on the E810 series devices which use
drivers/net/ice/base/ice_ptp_hw.h +2 -4
index bd6bb3e839..aa7fd66885 100644
@@ -270,11 +270,9 @@ 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, bool bypass);
+int ice_start_phy_timer_e822(struct ice_hw *hw, u8 port);
 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 ice_phy_exit_bypass_e822(struct ice_hw *hw, u8 port);
 
 /* E810 family functions */
 bool ice_is_gps_present_e810t(struct ice_hw *hw);
@@ -316,7 +314,7 @@ ice_ptp_read_tx_hwtstamp_status_eth56g(struct ice_hw *hw, u32 *ts_status);
 int
 ice_stop_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool soft_reset);
 int
-ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool bypass);
+ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port);
 int ice_phy_cfg_tx_offset_eth56g(struct ice_hw *hw, u8 port);
 int ice_phy_cfg_rx_offset_eth56g(struct ice_hw *hw, u8 port);
 
drivers/net/ice/ice_ethdev.c +1 -1
index 64ac64326a..dbdcacf019 100644
@@ -2518,7 +2518,7 @@ ice_dev_init(struct rte_eth_dev *dev)
 		hw->phy_model = ICE_PHY_E822;
 
 	if (hw->phy_model == ICE_PHY_E822) {
-		ret = ice_start_phy_timer_e822(hw, hw->pf_id, true);
+		ret = ice_start_phy_timer_e822(hw, hw->pf_id);
 		if (ret)
 			PMD_INIT_LOG(ERR, "Failed to start phy timer\n");
 	}
Signature · 1 line
2.43.0
#410 lore raw

PATCH v4 92/103 net/ice/base: implement TX interrupt enablement functions

In reply to Anatoly Burakov

From: Sergey Temerkhanov <[email protected]>

Introduce functions enabling/disabling TX TS interrupts for the E822 and ETH56G PHYs

---
 drivers/net/ice/base/ice_ptp_hw.c | 73 +++++++++++++++++++++++++++++++
 drivers/net/ice/base/ice_ptp_hw.h |  4 ++
 2 files changed, 77 insertions(+)
drivers/net/ice/base/ice_ptp_hw.c +73 -0
index 08ff620b34..f775575de3 100644
@@ -2026,6 +2026,41 @@ int ice_phy_cfg_rx_offset_eth56g(struct ice_hw *hw, u8 port)
 	return ice_write_phy_reg_eth56g(hw, port, PHY_REG_RX_OFFSET_READY, 1);
 }
 
+/**
+ * ice_phy_cfg_intr_eth56g - Configure TX timestamp interrupt
+ * @hw: pointer to the HW struct
+ * @port: the timestamp port
+ * @ena: enable or disable interrupt
+ * @threshold: interrupt threshold
+ *
+ * Configure TX timestamp interrupt for the specified port
+ */
+
+int
+ice_phy_cfg_intr_eth56g(struct ice_hw *hw, u8 port, bool ena, u8 threshold)
+{
+	int err;
+	u32 val;
+
+	err = ice_read_phy_reg_eth56g(hw, port, PHY_REG_TS_INT_CONFIG,
+				      &val);
+	if (err)
+		return err;
+
+	if (ena) {
+		val |= PHY_TS_INT_CONFIG_ENA_M;
+		val &= ~PHY_TS_INT_CONFIG_THRESHOLD_M;
+		val |= ((threshold << PHY_TS_INT_CONFIG_THRESHOLD_S) &
+			PHY_TS_INT_CONFIG_THRESHOLD_M);
+	} else {
+		val &= ~PHY_TS_INT_CONFIG_ENA_M;
+	}
+
+	err = ice_write_phy_reg_eth56g(hw, port, PHY_REG_TS_INT_CONFIG,
+				       val);
+	return err;
+}
+
 /**
  * ice_ptp_clear_phy_offset_ready_eth56g - Clear PHY OFFSET_READY registers
  * @hw: pointer to the HW struct
@@ -4545,6 +4580,44 @@ ice_get_phy_tx_tstamp_ready_e822(struct ice_hw *hw, u8 quad, u64 *tstamp_ready)
 	return 0;
 }
 
+/**
+ * ice_phy_cfg_intr_e822 - Configure TX timestamp interrupt
+ * @hw: pointer to the HW struct
+ * @quad: the timestamp quad
+ * @ena: enable or disable interrupt
+ * @threshold: interrupt threshold
+ *
+ * Configure TX timestamp interrupt for the specified quad
+ */
+
+int
+ice_phy_cfg_intr_e822(struct ice_hw *hw, u8 quad, bool ena, u8 threshold)
+{
+	int err;
+	u32 val;
+
+	err = ice_read_quad_reg_e822(hw, quad,
+				     Q_REG_TX_MEM_GBL_CFG,
+				     &val);
+	if (err)
+		return err;
+
+	if (ena) {
+		val |= Q_REG_TX_MEM_GBL_CFG_INTR_ENA_M;
+		val &= ~Q_REG_TX_MEM_GBL_CFG_INTR_THR_M;
+		val |= ((threshold << Q_REG_TX_MEM_GBL_CFG_INTR_THR_S) &
+			Q_REG_TX_MEM_GBL_CFG_INTR_THR_M);
+	} else {
+		val &= ~Q_REG_TX_MEM_GBL_CFG_INTR_ENA_M;
+	}
+
+	err = ice_write_quad_reg_e822(hw, quad,
+				      Q_REG_TX_MEM_GBL_CFG,
+				      val);
+
+	return err;
+}
+
 /* E810 functions
  *
  * The following functions operate on the E810 series devices which use
drivers/net/ice/base/ice_ptp_hw.h +4 -0
index aa7fd66885..d40336072b 100644
@@ -273,6 +273,8 @@ 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_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
+ice_phy_cfg_intr_e822(struct ice_hw *hw, u8 quad, bool ena, u8 threshold);
 
 /* E810 family functions */
 bool ice_is_gps_present_e810t(struct ice_hw *hw);
@@ -317,6 +319,8 @@ int
 ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port);
 int ice_phy_cfg_tx_offset_eth56g(struct ice_hw *hw, u8 port);
 int ice_phy_cfg_rx_offset_eth56g(struct ice_hw *hw, u8 port);
+int
+ice_phy_cfg_intr_eth56g(struct ice_hw *hw, u8 port, bool ena, u8 threshold);
 
 #define ICE_ETH56G_PLL_FREQ		800000000
 #define ICE_ETH56G_NOMINAL_INCVAL	0x140000000ULL
Signature · 1 line
2.43.0
#411 lore raw

PATCH v4 93/103 net/ice/base: make Tx and Rx vernier offset calibration independent

In reply to Anatoly Burakov

The Tx and Rx calibration and timestamp generation blocks are independent. It is not required to wait for both to complete before programming the offsets. Instead, we can program the offset for each independently as soon as they are ready.

Modify the ice_phy_cfg_tx_offset_e822 and ice_phy_cfg_rx_offset_e822 functions with the following additions:

a) Check the relevant P_REG_*_OR bit first and do nothing if the offset has already been programmed

b) Check the P_REG_*_OV_STATUS bit to determine if the offset status is ready, meaning that the hardware vernier calibration steps have completed. Return ICE_ERR_NOT_READY if the offset is not yet read.

The driver can now simply call ice_phy_cfg_rx_offset_e822 and ice_phy_cfg_tx_offset_e822 periodically until the offsets have been programmed.

In this way, the Tx and Rx blocks will be enabled independently without each waiting on the other block to complete. This can enable faster calibration on some setups which have a low rate of either Tx or Rx traffic.

---
 drivers/net/ice/base/ice_ptp_hw.c | 67 +++++++++++++++++++++++++++++--
 1 file changed, 64 insertions(+), 3 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +64 -3
index f775575de3..b340b4aa6d 100644
@@ -3890,14 +3890,19 @@ ice_calc_fixed_tx_offset_e822(struct ice_hw *hw, enum ice_ptp_link_spd link_spd)
  * adjust Tx timestamps by. This is calculated by combining some known static
  * latency along with the Vernier offset computations done by hardware.
  *
- * This function must be called only after the offset registers are valid,
- * i.e. after the Vernier calibration wait has passed, to ensure that the PHY
- * has measured the offset.
+ * This function will not return successfully until the Tx offset calculations
+ * have been completed, which requires waiting until at least one packet has
+ * been transmitted by the device. It is safe to call this function
+ * periodically until calibration succeeds, as it will only program the offset
+ * once.
  *
  * To avoid overflow, when calculating the offset based on the known static
  * latency values, we use measurements in 1/100th of a nanosecond, and divide
  * the TUs per second up front. This avoids overflow while allowing
  * calculation of the adjustment using integer arithmetic.
+ *
+ * Returns zero on success, ICE_ERR_NOT_READY if the hardware vernier offset
+ * calibration has not completed, or another error code on failure.
  */
 int ice_phy_cfg_tx_offset_e822(struct ice_hw *hw, u8 port)
 {
@@ -3905,6 +3910,28 @@ int ice_phy_cfg_tx_offset_e822(struct ice_hw *hw, u8 port)
 	enum ice_ptp_fec_mode fec_mode;
 	u64 total_offset, val;
 	int err;
+	u32 reg;
+
+	/* Nothing to do if we've already programmed the offset */
+	err = ice_read_phy_reg_e822(hw, port, P_REG_TX_OR, &reg);
+	if (err) {
+		ice_debug(hw, ICE_DBG_PTP, "Failed to read TX_OR for port %u, err %d\n",
+			  port, err);
+		return err;
+	}
+
+	if (reg)
+		return 0;
+
+	err = ice_read_phy_reg_e822(hw, port, P_REG_TX_OV_STATUS, &reg);
+	if (err) {
+		ice_debug(hw, ICE_DBG_PTP, "Failed to read TX_OV_STATUS for port %u, err %d\n",
+			  port, err);
+		return err;
+	}
+
+	if (!(reg & P_REG_TX_OV_STATUS_OV_M))
+		return ICE_ERR_NOT_READY;
 
 	err = ice_phy_get_speed_and_fec_e822(hw, port, &link_spd, &fec_mode);
 	if (err)
@@ -3957,6 +3984,8 @@ int ice_phy_cfg_tx_offset_e822(struct ice_hw *hw, u8 port)
 	if (err)
 		return err;
 
+	ice_info(hw, "Port=%d Tx vernier offset calibration complete\n", port);
+
 	return 0;
 }
 
@@ -4162,6 +4191,11 @@ ice_calc_fixed_rx_offset_e822(struct ice_hw *hw, enum ice_ptp_link_spd link_spd)
  * measurements taken in hardware with some data about known fixed delay as
  * well as adjusting for multi-lane alignment delay.
  *
+ * This function will not return successfully until the Rx offset calculations
+ * have been completed, which requires waiting until at least one packet has
+ * been received by the device. It is safe to call this function periodically
+ * until calibration succeeds, as it will only program the offset once.
+ *
  * This function must be called only after the offset registers are valid,
  * i.e. after the Vernier calibration wait has passed, to ensure that the PHY
  * has measured the offset.
@@ -4170,6 +4204,9 @@ ice_calc_fixed_rx_offset_e822(struct ice_hw *hw, enum ice_ptp_link_spd link_spd)
  * latency values, we use measurements in 1/100th of a nanosecond, and divide
  * the TUs per second up front. This avoids overflow while allowing
  * calculation of the adjustment using integer arithmetic.
+ *
+ * Returns zero on success, ICE_ERR_NOT_READY if the hardware vernier offset
+ * calibration has not completed, or another error code on failure.
  */
 int ice_phy_cfg_rx_offset_e822(struct ice_hw *hw, u8 port)
 {
@@ -4177,6 +4214,28 @@ int ice_phy_cfg_rx_offset_e822(struct ice_hw *hw, u8 port)
 	enum ice_ptp_fec_mode fec_mode;
 	u64 total_offset, pmd, val;
 	int err;
+	u32 reg;
+
+	/* Nothing to do if we've already programmed the offset */
+	err = ice_read_phy_reg_e822(hw, port, P_REG_RX_OR, &reg);
+	if (err) {
+		ice_debug(hw, ICE_DBG_PTP, "Failed to read RX_OR for port %u, err %d\n",
+			  port, err);
+		return err;
+	}
+
+	if (reg)
+		return 0;
+
+	err = ice_read_phy_reg_e822(hw, port, P_REG_RX_OV_STATUS, &reg);
+	if (err) {
+		ice_debug(hw, ICE_DBG_PTP, "Failed to read RX_OV_STATUS for port %u, err %d\n",
+			  port, err);
+		return err;
+	}
+
+	if (!(reg & P_REG_RX_OV_STATUS_OV_M))
+		return ICE_ERR_NOT_READY;
 
 	err = ice_phy_get_speed_and_fec_e822(hw, port, &link_spd, &fec_mode);
 	if (err)
@@ -4237,6 +4296,8 @@ int ice_phy_cfg_rx_offset_e822(struct ice_hw *hw, u8 port)
 	if (err)
 		return err;
 
+	ice_info(hw, "Port=%d Rx vernier offset calibration complete\n", port);
+
 	return 0;
 }
 
Signature · 1 line
2.43.0
#412 lore raw

Re: [PATCH v4 093/103] net/ice/base: make Tx and Rx vernier offset calibration independent

Quoted 18 lines · Anatoly Burakov

The Tx and Rx calibration and timestamp generation blocks are independent. It is not required to wait for both to complete before programming the offsets. Instead, we can program the offset for each independently as soon as they are ready.

Modify the ice_phy_cfg_tx_offset_e822 and ice_phy_cfg_rx_offset_e822 functions with the following additions:

a) Check the relevant P_REG_*_OR bit first and do nothing if the offset has already been programmed

b) Check the P_REG_*_OV_STATUS bit to determine if the offset status is ready, meaning that the hardware vernier calibration steps have completed. Return ICE_ERR_NOT_READY if the offset is not yet read.

The driver can now simply call ice_phy_cfg_rx_offset_e822 and ice_phy_cfg_tx_offset_e822 periodically until the offsets have been programmed.

Quoted 8 lines

In this way, the Tx and Rx blocks will be enabled independently without each waiting on the other block to complete. This can enable faster calibration on some setups which have a low rate of either Tx or Rx traffic.

---

The patch has accidentally been submitted with incorrect authorship information, please amend on apply to being authored by Siddaraju DH (from first signoff line).

Signature · 2 lines
Thanks,
Anatoly
#413 lore raw

Re: [PATCH v4 093/103] net/ice/base: make Tx and Rx vernier offset calibration independent

Quoted 23 lines · Anatoly
Quoted 22 lines · Anatoly Burakov

The Tx and Rx calibration and timestamp generation blocks are independent. It is not required to wait for both to complete before programming the offsets. Instead, we can program the offset for each independently as soon as they are ready.

Modify the ice_phy_cfg_tx_offset_e822 and ice_phy_cfg_rx_offset_e822 functions with the following additions:

a) Check the relevant P_REG_*_OR bit first and do nothing if the offset has already been programmed

b) Check the P_REG_*_OV_STATUS bit to determine if the offset status is ready, meaning that the hardware vernier calibration steps have completed. Return ICE_ERR_NOT_READY if the offset is not yet read.

The driver can now simply call ice_phy_cfg_rx_offset_e822 and ice_phy_cfg_tx_offset_e822 periodically until the offsets have been programmed.

In this way, the Tx and Rx blocks will be enabled independently without each waiting on the other block to complete. This can enable faster calibration on some setups which have a low rate of either Tx or Rx traffic.

Quoted 9 lines
Quoted 4 lines

---

The patch has accidentally been submitted with incorrect authorship information, please amend on apply to being authored by Siddaraju DH (from first signoff line).

Will fix all such minor issues on apply, no problem. thanks,
/Bruce

#414 lore raw

PATCH v4 94/103 net/ice/base: change a method to get pca9575 handle

In reply to Anatoly Burakov

From: Milena Olech <[email protected]>

More universal method for getting pca9575 handle is introduced. The first step is to look for CLK_MUX handle. Having that it is possible to find CLK_MUX GPIO pin. Provided data let check what is driving the pin - the expectation is that pca9575 node part number is returned.

---
 drivers/net/ice/base/ice_adminq_cmd.h | 12 +++++--
 drivers/net/ice/base/ice_ptp_hw.c     | 50 +++++++++++++++++++++++----
 2 files changed, 53 insertions(+), 9 deletions(-)
drivers/net/ice/base/ice_adminq_cmd.h +10 -2
index 936735022d..96ba19f94a 100644
@@ -1761,6 +1761,8 @@ struct ice_aqc_link_topo_params {
 #define ICE_AQC_LINK_TOPO_NODE_TYPE_CAGE	6
 #define ICE_AQC_LINK_TOPO_NODE_TYPE_MEZZ	7
 #define ICE_AQC_LINK_TOPO_NODE_TYPE_ID_EEPROM	8
+#define ICE_AQC_LINK_TOPO_NODE_TYPE_CLK_CTRL	9
+#define ICE_AQC_LINK_TOPO_NODE_TYPE_CLK_MUX	10
 #define ICE_AQC_LINK_TOPO_NODE_TYPE_GPS		11
 #define ICE_AQC_LINK_TOPO_NODE_CTX_S		4
 #define ICE_AQC_LINK_TOPO_NODE_CTX_M		\
@@ -1798,8 +1800,13 @@ struct ice_aqc_link_topo_addr {
 struct ice_aqc_get_link_topo {
 	struct ice_aqc_link_topo_addr addr;
 	u8 node_part_num;
-#define ICE_ACQ_GET_LINK_TOPO_NODE_NR_PCA9575	0x21
-#define ICE_ACQ_GET_LINK_TOPO_NODE_NR_GEN_GPS	0x48
+#define ICE_AQC_GET_LINK_TOPO_NODE_NR_PCA9575			0x21
+#define ICE_AQC_GET_LINK_TOPO_NODE_NR_ZL30632_80032		0x24
+#define ICE_AQC_GET_LINK_TOPO_NODE_NR_SI5383_5384		0x25
+#define ICE_AQC_GET_LINK_TOPO_NODE_NR_E822_PHY			0x30
+#define ICE_AQC_GET_LINK_TOPO_NODE_NR_C827			0x31
+#define ICE_AQC_GET_LINK_TOPO_NODE_NR_GEN_CLK_MUX		0x47
+#define ICE_AQC_GET_LINK_TOPO_NODE_NR_GEN_GPS			0x48
 	u8 rsvd[9];
 };
 
@@ -1827,6 +1834,7 @@ struct ice_aqc_get_link_topo_pin {
 #define ICE_AQC_LINK_TOPO_IO_FUNC_RED_LED	12
 #define ICE_AQC_LINK_TOPO_IO_FUNC_GREEN_LED	13
 #define ICE_AQC_LINK_TOPO_IO_FUNC_BLUE_LED	14
+#define ICE_AQC_LINK_TOPO_IO_FUNC_CLK_IN	20
 #define ICE_AQC_LINK_TOPO_INPUT_IO_TYPE_S	5
 #define ICE_AQC_LINK_TOPO_INPUT_IO_TYPE_M	\
 			(0x7 << ICE_AQC_LINK_TOPO_INPUT_IO_TYPE_S)
drivers/net/ice/base/ice_ptp_hw.c +43 -7

78 lines not on this page · raw message

Signature · 1 line
2.43.0
#415 lore raw

PATCH v4 95/103 net/ice/base: rename SMA register macros

In reply to Anatoly Burakov

From: Jacob Keller <[email protected]>

The macros used to define the bits for controlling the SMA are different to what was submitted to Linux. Correct the names to match.

---
 drivers/net/ice/base/ice_ptp_hw.c |  8 ++++----
 drivers/net/ice/base/ice_ptp_hw.h | 26 ++++++++++++++++++--------
 2 files changed, 22 insertions(+), 12 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +4 -4
index cb689c1a25..50ffa7b796 100644
@@ -5351,10 +5351,10 @@ int ice_read_sma_ctrl_e810t(struct ice_hw *hw, u8 *data)
 
 	*data = 0;
 
-	for (i = ICE_E810T_SMA_MIN_BIT; i <= ICE_E810T_SMA_MAX_BIT; i++) {
+	for (i = ICE_SMA_MIN_BIT_E810T; i <= ICE_SMA_MAX_BIT_E810T; i++) {
 		bool pin;
 
-		status = ice_aq_get_gpio(hw, handle, i + ICE_E810T_P1_OFFSET,
+		status = ice_aq_get_gpio(hw, handle, i + ICE_PCA9575_P1_OFFSET,
 					 &pin, NULL);
 		if (status)
 			break;
@@ -5381,11 +5381,11 @@ int ice_write_sma_ctrl_e810t(struct ice_hw *hw, u8 data)
 	if (status)
 		return status;
 
-	for (i = ICE_E810T_SMA_MIN_BIT; i <= ICE_E810T_SMA_MAX_BIT; i++) {
+	for (i = ICE_SMA_MIN_BIT_E810T; i <= ICE_SMA_MAX_BIT_E810T; i++) {
 		bool pin;
 
 		pin = !(data & (1 << i));
-		status = ice_aq_set_gpio(hw, handle, i + ICE_E810T_P1_OFFSET,
+		status = ice_aq_set_gpio(hw, handle, i + ICE_PCA9575_P1_OFFSET,
 					 pin, NULL);
 		if (status)
 			break;
drivers/net/ice/base/ice_ptp_hw.h +18 -8
index d40336072b..c4a5c030f1 100644
@@ -661,6 +661,21 @@ ice_get_base_incval(struct ice_hw *hw, enum ice_src_tmr_mode src_tmr_mode)
 #define E830_HIGH_TX_MEMORY_BANK(slot, port) \
 				(E830_PRTTSYN_TXTIME_H(slot) + 0x8 * (port))
 
+/* E810T SMA controller pin control */
+#define ICE_SMA1_DIR_EN_E810T		BIT(4)
+#define ICE_SMA1_TX_EN_E810T		BIT(5)
+#define ICE_SMA2_UFL2_RX_DIS_E810T	BIT(3)
+#define ICE_SMA2_DIR_EN_E810T		BIT(6)
+#define ICE_SMA2_TX_EN_E810T		BIT(7)
+
+#define ICE_SMA1_MASK_E810T	(ICE_SMA1_DIR_EN_E810T | \
+				 ICE_SMA1_TX_EN_E810T)
+#define ICE_SMA2_MASK_E810T	(ICE_SMA2_UFL2_RX_DIS_E810T | \
+				 ICE_SMA2_DIR_EN_E810T | \
+				 ICE_SMA2_TX_EN_E810T)
+#define ICE_ALL_SMA_MASK_E810T	(ICE_SMA1_MASK_E810T | \
+				 ICE_SMA2_MASK_E810T)
+
 /* E810T PCA9575 IO controller registers */
 #define ICE_PCA9575_P0_IN	0x0
 #define ICE_PCA9575_P1_IN	0x1
@@ -671,15 +686,10 @@ ice_get_base_incval(struct ice_hw *hw, enum ice_src_tmr_mode src_tmr_mode)
 
 /* E810T PCA9575 IO controller pin control */
 #define ICE_E810T_P0_GNSS_PRSNT_N	BIT(4)
-#define ICE_E810T_P1_SMA1_DIR_EN	BIT(4)
-#define ICE_E810T_P1_SMA1_TX_EN		BIT(5)
-#define ICE_E810T_P1_SMA2_UFL2_RX_DIS	BIT(3)
-#define ICE_E810T_P1_SMA2_DIR_EN	BIT(6)
-#define ICE_E810T_P1_SMA2_TX_EN		BIT(7)
 
-#define ICE_E810T_SMA_MIN_BIT	3
-#define ICE_E810T_SMA_MAX_BIT	7
-#define ICE_E810T_P1_OFFSET	8
+#define ICE_SMA_MIN_BIT_E810T	3
+#define ICE_SMA_MAX_BIT_E810T	7
+#define ICE_PCA9575_P1_OFFSET	8
 /* 56G PHY quad register base addresses */
 #define ICE_PHY0_BASE			0x092000
 #define ICE_PHY1_BASE			0x126000
Signature · 1 line
2.43.0
#416 lore raw

PATCH v4 96/103 net/ice/base: make is_gps_present more generic

In reply to Anatoly Burakov

The driver checks the netlist for nodes indicating hardware support using functions named "ice_is_<feature>_present" sometimes with an additional _e810t postfix. These functions check the contents of the netlist, and don't make any direct device ID check.

When upstreaming the functions to Linux, the name was changed to use the form "ice_is_<feature>_in_netlist" and removed all the device postfixes. Rename this function to match, as well as update code style.

---
 drivers/net/ice/base/ice_common.c | 39 ++++++++++++++++++++++---------
 drivers/net/ice/base/ice_common.h |  1 +
 drivers/net/ice/base/ice_ptp_hw.c | 15 ------------
 drivers/net/ice/base/ice_ptp_hw.h |  1 -
 4 files changed, 29 insertions(+), 27 deletions(-)
drivers/net/ice/base/ice_common.c +28 -11
index 9a61c1357d..fed499f449 100644
@@ -7,6 +7,7 @@
 #include "ice_adminq_cmd.h"
 
 #include "ice_flow.h"
+#include "ice_ptp_hw.h"
 #include "ice_switch.h"
 
 #define ICE_PF_RESET_WAIT_COUNT	500
@@ -655,20 +656,24 @@ ice_aq_get_netlist_node(struct ice_hw *hw, struct ice_aqc_get_link_topo *cmd,
  * @node_part_number: node part number to look for
  * @node_handle: output parameter if node found - optional
  *
- * Find and return the node handle for a given node type and part number in the
- * netlist. When found 0 is returned, ICE_ERR_DOES_NOT_EXIST
- * otherwise. If node_handle provided, it would be set to found node handle.
+ * Scan the netlist for a node handle of the given node type and part number.
+ *
+ * If node_handle is non-NULL it will be modified on function exit. It is only
+ * valid if the function returns zero, and should be ignored on any non-zero
+ * return value.
+ *
+ * Returns: 0 if the node is found, ICE_ERR_DOES_NOT_EXIST if no handle was
+ * found, and an error code on failure to access the AQ.
  */
 int
 ice_find_netlist_node(struct ice_hw *hw, u8 node_type_ctx, u8 node_part_number,
 		      u16 *node_handle)
 {
-	struct ice_aqc_get_link_topo cmd;
-	u8 rec_node_part_number;
-	u16 rec_node_handle;
 	u8 idx;
 
 	for (idx = 0; idx < MAX_NETLIST_SIZE; idx++) {
+		struct ice_aqc_get_link_topo cmd;
+		u8 rec_node_part_number;
 		int status;
 
 		memset(&cmd, 0, sizeof(cmd));
@@ -679,20 +684,32 @@ ice_find_netlist_node(struct ice_hw *hw, u8 node_type_ctx, u8 node_part_number,
 
 		status = ice_aq_get_netlist_node(hw, &cmd,
 						 &rec_node_part_number,
-						 &rec_node_handle);
+						 node_handle);
 		if (status)
 			return status;
 
-		if (rec_node_part_number == node_part_number) {
-			if (node_handle)
-				*node_handle = rec_node_handle;
+		if (rec_node_part_number == node_part_number)
 			return 0;
-		}
 	}
 
 	return ICE_ERR_DOES_NOT_EXIST;
 }
 
+/**
+ * ice_is_gps_in_netlist
+ * @hw: pointer to the hw struct
+ *
+ * Check if the GPS generic device is present in the netlist
+ */
+bool ice_is_gps_in_netlist(struct ice_hw *hw)
+{
+	if (ice_find_netlist_node(hw, ICE_AQC_LINK_TOPO_NODE_TYPE_GPS,
+				  ICE_AQC_GET_LINK_TOPO_NODE_NR_GEN_GPS, NULL))
+		return false;
+
+	return true;
+}
+
 /**
  * ice_aq_get_link_info
  * @pi: port information structure
drivers/net/ice/base/ice_common.h +1 -0
index 51710f9c8b..684d76d9a0 100644
@@ -169,6 +169,7 @@ ice_aq_get_netlist_node(struct ice_hw *hw, struct ice_aqc_get_link_topo *cmd,
 int
 ice_find_netlist_node(struct ice_hw *hw, u8 node_type_ctx, u8 node_part_number,
 		      u16 *node_handle);
+bool ice_is_gps_in_netlist(struct ice_hw *hw);
 void
 ice_update_phy_type(u64 *phy_type_low, u64 *phy_type_high,
 		    u16 link_speeds_bitmap);
drivers/net/ice/base/ice_ptp_hw.c +0 -15
index 50ffa7b796..7d06287a2d 100644
@@ -5253,21 +5253,6 @@ ice_get_pca9575_handle(struct ice_hw *hw, u16 *pca9575_handle)
 	return 0;
 }
 
-/**
- * ice_is_gps_present_e810t
- * @hw: pointer to the hw struct
- *
- * Check if the GPS generic device is present in the netlist
- */
-bool ice_is_gps_present_e810t(struct ice_hw *hw)
-{
-	if (ice_find_netlist_node(hw, ICE_AQC_LINK_TOPO_NODE_TYPE_GPS,
-				  ICE_AQC_GET_LINK_TOPO_NODE_NR_GEN_GPS, NULL))
-		return false;
-
-	return true;
-}
-
 /**
  * ice_read_pca9575_reg_e810t
  * @hw: pointer to the hw struct
drivers/net/ice/base/ice_ptp_hw.h +0 -1
index c4a5c030f1..fb56d76e98 100644
@@ -277,7 +277,6 @@ int
 ice_phy_cfg_intr_e822(struct ice_hw *hw, u8 quad, bool ena, u8 threshold);
 
 /* E810 family functions */
-bool ice_is_gps_present_e810t(struct ice_hw *hw);
 int ice_ptp_init_phy_e810(struct ice_hw *hw);
 int
 ice_read_pca9575_reg_e810t(struct ice_hw *hw, u8 offset, u8 *data);
Signature · 1 line
2.43.0
#417 lore raw

Re: [PATCH v4 096/103] net/ice/base: make is_gps_present more generic

Quoted 5 lines · Anatoly Burakov

The driver checks the netlist for nodes indicating hardware support using functions named "ice_is_<feature>_present" sometimes with an additional _e810t postfix. These functions check the contents of the netlist, and don't make any direct device ID check.

Quoted 8 lines

When upstreaming the functions to Linux, the name was changed to use the form "ice_is_<feature>_in_netlist" and removed all the device postfixes. Rename this function to match, as well as update code style.

---

The patch has accidentally been submitted with incorrect authorship information, please amend on apply to being authored by Jacob Keller (from first signoff line).

Signature · 2 lines
Thanks,
Anatoly
#418 lore raw

PATCH v4 97/103 net/ice/base: add missing defines and misc cleanup

In reply to Anatoly Burakov

From: Ian Stokes <[email protected]>

Add various missing defines and definitions that are currently not present in DPDK but are present in upstream code.

---
 drivers/net/ice/base/ice_adminq_cmd.h | 84 +++++++++++++++------------
 drivers/net/ice/base/ice_lan_tx_rx.h  | 28 ++++++++-
 drivers/net/ice/base/ice_type.h       | 30 ++++++++++
 3 files changed, 103 insertions(+), 39 deletions(-)
drivers/net/ice/base/ice_adminq_cmd.h +47 -37
index 96ba19f94a..daa5dedb41 100644
@@ -109,7 +109,6 @@ struct ice_aqc_list_caps {
 struct ice_aqc_list_caps_elem {
 	__le16 cap;
 #define ICE_AQC_CAPS_VALID_FUNCTIONS			0x0005
-#define ICE_AQC_MAX_VALID_FUNCTIONS			0x8
 #define ICE_AQC_CAPS_VSI				0x0017
 #define ICE_AQC_CAPS_DCB				0x0018
 #define ICE_AQC_CAPS_RSS				0x0040
@@ -132,6 +131,8 @@ struct ice_aqc_list_caps_elem {
 #define ICE_AQC_CAPS_NAC_TOPOLOGY			0x0087
 #define ICE_AQC_CAPS_OROM_RECOVERY_UPDATE		0x0090
 #define ICE_AQC_CAPS_ROCEV2_LAG				0x0092
+#define ICE_AQC_BIT_ROCEV2_LAG				0x01
+#define ICE_AQC_BIT_SRIOV_LAG				0x02
 #define ICE_AQC_CAPS_NEXT_CLUSTER_ID			0x0096
 	u8 major_ver;
 	u8 minor_ver;
@@ -493,6 +494,7 @@ struct ice_aqc_vsi_props {
 #define ICE_AQ_VSI_SW_FLAG_RX_PRUNE_EN_S	0
 #define ICE_AQ_VSI_SW_FLAG_RX_PRUNE_EN_M	(0xF << ICE_AQ_VSI_SW_FLAG_RX_PRUNE_EN_S)
 #define ICE_AQ_VSI_SW_FLAG_RX_VLAN_PRUNE_ENA	BIT(0)
+#define ICE_AQ_VSI_SW_FLAG_RX_PASS_PRUNE_ENA	BIT(3)
 #define ICE_AQ_VSI_SW_FLAG_LAN_ENA		BIT(4)
 	u8 veb_stat_id;
 #define ICE_AQ_VSI_SW_VEB_STAT_ID_S		0
@@ -891,6 +893,8 @@ struct ice_sw_rule_lkup_rx_tx {
 #define ICE_SINGLE_ACT_PTR		0x2
 #define ICE_SINGLE_ACT_PTR_VAL_S	4
 #define ICE_SINGLE_ACT_PTR_VAL_M	(0x1FFF << ICE_SINGLE_ACT_PTR_VAL_S)
+	/* Bit 17 should be set if pointed action includes a FWD cmd */
+#define ICE_SINGLE_ACT_PTR_HAS_FWD	BIT(17)
 	/* Bit 18 should be set to 1 */
 #define ICE_SINGLE_ACT_PTR_BIT		BIT(18)
 
@@ -1001,25 +1005,6 @@ struct ice_sw_rule_vsi_list {
 };
 #pragma pack()
 
-#pragma pack(1)
-/* Query VSI list command/response entry */
-struct ice_sw_rule_vsi_list_query {
-	__le16 index;
-	u8 vsi_list[DIVIDE_AND_ROUND_UP(ICE_MAX_VSI, BITS_PER_BYTE)];
-};
-#pragma pack()
-
-/* PFC Ignore (direct 0x0301)
- * The command and response use the same descriptor structure
- */
-struct ice_aqc_pfc_ignore {
-	u8	tc_bitmap;
-	u8	cmd_flags; /* unused in response */
-#define ICE_AQC_PFC_IGNORE_SET		BIT(7)
-#define ICE_AQC_PFC_IGNORE_CLEAR	0
-	u8	reserved[14];
-};
-
 /* Query PFC Mode (direct 0x0302)
  * Set PFC Mode (direct 0x0303)
  */
@@ -1034,17 +1019,6 @@ struct ice_aqc_set_query_pfc_mode {
 	u8	rsvd[15];
 };
 
-/* Set DCB Parameters (direct 0x0306) */
-struct ice_aqc_set_dcb_params {
-	u8 cmd_flags; /* unused in response */
-#define ICE_AQC_LINK_UP_DCB_CFG    BIT(0)
-#define ICE_AQC_PERSIST_DCB_CFG    BIT(1)
-	u8 valid_flags; /* unused in response */
-#define ICE_AQC_LINK_UP_DCB_CFG_VALID    BIT(0)
-#define ICE_AQC_PERSIST_DCB_CFG_VALID    BIT(1)
-	u8 rsvd[14];
-};
-
 /* Get Default Topology (indirect 0x0400) */
 struct ice_aqc_get_topo {
 	u8 port_num;
@@ -1708,6 +1682,7 @@ struct ice_aqc_set_event_mask {
 #define ICE_AQ_LINK_EVENT_PORT_TX_SUSPENDED	BIT(9)
 #define ICE_AQ_LINK_EVENT_TOPO_CONFLICT		BIT(10)
 #define ICE_AQ_LINK_EVENT_MEDIA_CONFLICT	BIT(11)
+#define ICE_AQ_LINK_EVENT_PHY_FW_LOAD_FAIL	BIT(12)
 	u8	reserved1[6];
 };
 
@@ -2048,10 +2023,17 @@ struct ice_aqc_nvm {
 #define ICE_AQC_NVM_REVERT_LAST_ACTIV	BIT(6) /* Write Activate only */
 #define ICE_AQC_NVM_ACTIV_SEL_MASK	MAKEMASK(0x7, 3)
 #define ICE_AQC_NVM_FLASH_ONLY		BIT(7)
-#define ICE_AQC_NVM_POR_FLAG	0	/* Used by NVM Write completion on ARQ */
-#define ICE_AQC_NVM_PERST_FLAG	1
-#define ICE_AQC_NVM_EMPR_FLAG	2
-#define ICE_AQC_NVM_EMPR_ENA		BIT(0)
+#define ICE_AQC_NVM_RESET_LVL_M		MAKEMASK(0x3, 0) /* Write reply only */
+#define ICE_AQC_NVM_POR_FLAG		0
+#define ICE_AQC_NVM_PERST_FLAG		1
+#define ICE_AQC_NVM_EMPR_FLAG		2
+#define ICE_AQC_NVM_EMPR_ENA		BIT(0) /* Write Activate reply only */
+	/* For Write Activate, several flags are sent as part of a separate
+	 * flags2 field using a separate byte. For simplicity of the software
+	 * interface, we pass the flags as a 16 bit value so these flags are
+	 * all offset by 8 bits
+	 */
+#define ICE_AQC_NVM_ACTIV_REQ_EMPR	BIT(8) /* NVM Write Activate only */
 	__le16 module_typeid;
 	__le16 length;
 #define ICE_AQC_NVM_ERASE_LEN	0xFFFF
@@ -2104,6 +2086,7 @@ struct ice_aqc_nvm {
 					     ICE_AQC_NVM_SDP_CFG_SDP_NUM_OFFSET)
 #define ICE_AQC_NVM_SDP_CFG_NA_PIN_MASK		MAKEMASK(0x1, 15)
 
+#define ICE_AQC_NVM_MINSREV_MOD_ID		0x130
 #define ICE_AQC_NVM_TX_TOPO_MOD_ID		0x14B
 #define ICE_AQC_NVM_CMPO_MOD_ID			0x153
 
@@ -2114,6 +2097,21 @@ struct ice_aqc_nvm_cmpo {
 	__le16 cages_cfg[8];
 };
 
+/* Used for reading and writing MinSRev using 0x0701 and 0x0703. Note that the
+ * type field is excluded from the section when reading and writing from
+ * a module using the module_typeid field with these AQ commands.
+ */
+struct ice_aqc_nvm_minsrev {
+	__le16 length;
+	__le16 validity;
+#define ICE_AQC_NVM_MINSREV_NVM_VALID		BIT(0)
+#define ICE_AQC_NVM_MINSREV_OROM_VALID		BIT(1)
+	__le16 nvm_minsrev_l;
+	__le16 nvm_minsrev_h;
+	__le16 orom_minsrev_l;
+	__le16 orom_minsrev_h;
+};
+
 struct ice_aqc_nvm_tx_topo_user_sel {
 	__le16 length;
 	u8 data;
@@ -2431,6 +2429,15 @@ struct ice_aqc_clear_fd_table {
 	u8 reserved[12];
 };
 
+/* Sideband Control Interface Commands */
+/* Neighbor Device Request (indirect 0x0C00); also used for the response. */
+struct ice_aqc_neigh_dev_req {
+	__le16 sb_data_len;
+	u8 reserved[6];
+	__le32 addr_high;
+	__le32 addr_low;
+};
+
 /* Allocate ACL table (indirect 0x0C10) */
 #define ICE_AQC_ACL_KEY_WIDTH		40
 #define ICE_AQC_ACL_KEY_WIDTH_BYTES	5
@@ -3260,10 +3267,8 @@ struct ice_aq_desc {
 		struct ice_aqc_nvm nvm;
 		struct ice_aqc_nvm_cfg nvm_cfg;
 		struct ice_aqc_nvm_checksum nvm_checksum;
-		struct ice_aqc_pfc_ignore pfc_ignore;
 		struct ice_aqc_nvm_sanitization sanitization;
 		struct ice_aqc_set_query_pfc_mode set_query_pfc_mode;
-		struct ice_aqc_set_dcb_params set_dcb_params;
 		struct ice_aqc_lldp_get_mib lldp_get_mib;
 		struct ice_aqc_lldp_set_mib_change lldp_set_event;
 		struct ice_aqc_lldp_add_delete_tlv lldp_add_delete_tlv;
@@ -3276,6 +3281,7 @@ struct ice_aq_desc {
 		struct ice_aqc_get_set_rss_lut get_set_rss_lut;
 		struct ice_aqc_get_set_rss_key get_set_rss_key;
 		struct ice_aqc_clear_fd_table clear_fd_table;
+		struct ice_aqc_neigh_dev_req neigh_dev;
 		struct ice_aqc_acl_alloc_table alloc_table;
 		struct ice_aqc_acl_tbl_actpair tbl_actpair;
 		struct ice_aqc_acl_alloc_scen alloc_scen;
@@ -3516,6 +3522,8 @@ enum ice_adminq_opc {
 	ice_aqc_opc_nvm_sr_dump				= 0x0707,
 	ice_aqc_opc_nvm_save_factory_settings		= 0x0708,
 	ice_aqc_opc_nvm_update_empr			= 0x0709,
+	ice_aqc_opc_nvm_pkg_data			= 0x070A,
+	ice_aqc_opc_nvm_pass_component_tbl		= 0x070B,
 	ice_aqc_opc_nvm_sanitization			= 0x070C,
 
 	/* LLDP commands */
@@ -3538,6 +3546,8 @@ enum ice_adminq_opc {
 	ice_aqc_opc_get_rss_key				= 0x0B04,
 	ice_aqc_opc_get_rss_lut				= 0x0B05,
 	ice_aqc_opc_clear_fd_table			= 0x0B06,
+	/* Sideband Control Interface commands */
+	ice_aqc_opc_neighbour_device_request		= 0x0C00,
 	/* ACL commands */
 	ice_aqc_opc_alloc_acl_tbl			= 0x0C10,
 	ice_aqc_opc_dealloc_acl_tbl			= 0x0C11,
drivers/net/ice/base/ice_lan_tx_rx.h +26 -2
index a28345c2c4..a4eb6e45ed 100644
@@ -162,7 +162,6 @@ struct ice_fltr_desc {
 
 #define ICE_FXD_FLTR_QW1_FDID_PRI_S	25
 #define ICE_FXD_FLTR_QW1_FDID_PRI_M	(0x7ULL << ICE_FXD_FLTR_QW1_FDID_PRI_S)
-#define ICE_FXD_FLTR_QW1_FDID_PRI_ZERO	0x0ULL
 #define ICE_FXD_FLTR_QW1_FDID_PRI_ONE	0x1ULL
 #define ICE_FXD_FLTR_QW1_FDID_PRI_THREE	0x3ULL
 
@@ -284,6 +283,7 @@ enum ice_rx_desc_error_l3l4e_masks {
 enum ice_rx_l2_ptype {
 	ICE_RX_PTYPE_L2_RESERVED	= 0,
 	ICE_RX_PTYPE_L2_MAC_PAY2	= 1,
+	ICE_RX_PTYPE_L2_TIMESYNC_PAY2	= 2,
 	ICE_RX_PTYPE_L2_FIP_PAY2	= 3,
 	ICE_RX_PTYPE_L2_OUI_PAY2	= 4,
 	ICE_RX_PTYPE_L2_MACCNTRL_PAY2	= 5,
@@ -343,6 +343,7 @@ enum ice_rx_ptype_inner_prot {
 	ICE_RX_PTYPE_INNER_PROT_TCP		= 2,
 	ICE_RX_PTYPE_INNER_PROT_SCTP		= 3,
 	ICE_RX_PTYPE_INNER_PROT_ICMP		= 4,
+	ICE_RX_PTYPE_INNER_PROT_TIMESYNC	= 5,
 };
 
 enum ice_rx_ptype_payload_layer {
@@ -930,6 +931,8 @@ enum ice_rx_flex_desc_exstat_bits {
 
 #define ICE_RXQ_CTX_SIZE_DWORDS		8
 #define ICE_RXQ_CTX_SZ			(ICE_RXQ_CTX_SIZE_DWORDS * sizeof(u32))
+#define ICE_TXQ_CTX_SIZE_DWORDS		10
+#define ICE_TXQ_CTX_SZ			(ICE_TXQ_CTX_SIZE_DWORDS * sizeof(u32))
 #define ICE_TX_CMPLTNQ_CTX_SIZE_DWORDS	22
 #define ICE_TX_DRBELL_Q_CTX_SIZE_DWORDS	5
 #define GLTCLAN_CQ_CNTX(i, CQ)		(GLTCLAN_CQ_CNTX0(CQ) + ((i) * 0x0800))
@@ -1070,7 +1073,7 @@ enum ice_tx_desc_len_fields {
 struct ice_tx_ctx_desc {
 	__le32 tunneling_params;
 	__le16 l2tag2;
-	__le16 gsc;
+	__le16 gcs;
 	__le64 qw1;
 };
 
@@ -1190,6 +1193,7 @@ struct ice_tlan_ctx {
 	u8 pkt_shaper_prof_idx;
 	u8 gsc_ena;
 	u8 int_q_state;	/* width not needed - internal - DO NOT WRITE!!! */
+	u16 tail;
 };
 
 /* LAN Tx Completion Queue data */
@@ -1206,6 +1210,7 @@ struct ice_tx_cmpltnq {
 #pragma pack(1)
 struct ice_tx_cmpltnq_ctx {
 	u64 base;
+#define ICE_TX_CMPLTNQ_CTX_BASE_S	7
 	u32 q_len;
 #define ICE_TX_CMPLTNQ_CTX_Q_LEN_S	4
 	u8 generation;
@@ -1213,6 +1218,9 @@ struct ice_tx_cmpltnq_ctx {
 	u8 pf_num;
 	u16 vmvf_num;
 	u8 vmvf_type;
+#define ICE_TX_CMPLTNQ_CTX_VMVF_TYPE_VF		0
+#define ICE_TX_CMPLTNQ_CTX_VMVF_TYPE_VMQ	1
+#define ICE_TX_CMPLTNQ_CTX_VMVF_TYPE_PF		2
 	u8 tph_desc_wr;
 	u8 cpuid;
 	u32 cmpltn_cache[16];
@@ -1227,15 +1235,30 @@ struct ice_tx_drbell_fmt {
 	u32 db;
 };
 
+/* FIXME: move to a .c file that references this variable */
+/* LAN Tx Doorbell Descriptor format info */
+static const struct ice_ctx_ele ice_tx_drbell_fmt_info[] = {
+					 /* Field		Width	LSB */
+	ICE_CTX_STORE(ice_tx_drbell_fmt, txq_id,		14,	0),
+	ICE_CTX_STORE(ice_tx_drbell_fmt, dd,			1,	14),
+	ICE_CTX_STORE(ice_tx_drbell_fmt, rs,			1,	15),
+	ICE_CTX_STORE(ice_tx_drbell_fmt, db,			32,	32),
+	{ 0 }
+};
 
 /* LAN Tx Doorbell Queue Context */
 #pragma pack(1)
 struct ice_tx_drbell_q_ctx {
 	u64 base;
+#define ICE_TX_DRBELL_Q_CTX_BASE_S	7
 	u16 ring_len;
+#define ICE_TX_DRBELL_Q_CTX_RING_LEN_S	4
 	u8 pf_num;
 	u16 vf_num;
 	u8 vmvf_type;
+#define ICE_TX_DRBELL_Q_CTX_VMVF_TYPE_VF	0
+#define ICE_TX_DRBELL_Q_CTX_VMVF_TYPE_VMQ	1
+#define ICE_TX_DRBELL_Q_CTX_VMVF_TYPE_PF	2
 	u8 cpuid;
 	u8 tph_desc_rd;
 	u8 tph_desc_wr;
@@ -1285,6 +1308,7 @@ struct ice_tx_drbell_q_ctx {
 /* shorter macros makes the table fit but are terse */
 #define ICE_RX_PTYPE_NOF		ICE_RX_PTYPE_NOT_FRAG
 #define ICE_RX_PTYPE_FRG		ICE_RX_PTYPE_FRAG
+#define ICE_RX_PTYPE_INNER_PROT_TS	ICE_RX_PTYPE_INNER_PROT_TIMESYNC
 
 /* Lookup table mapping the 10-bit HW PTYPE to the bit field for decoding */
 static const struct ice_rx_ptype_decoded ice_ptype_lkup[1024] = {
drivers/net/ice/base/ice_type.h +30 -0
index e199868326..4fea771ebe 100644
@@ -43,6 +43,24 @@ static inline int ice_ilog2(u64 n)
 	return -1;
 }
 
+/**
+ * ice_fls - find the most significant bit set in a u64
+ * @n: u64 value to scan for a bit
+ *
+ * Returns: 0 if no bits found, otherwise the index of the highest bit that was
+ * set, like ice_fls(0x20) == 6. This means this is returning a *1 based*
+ * count, and that the maximum largest value returned is 64!
+ */
+static inline unsigned int ice_fls(u64 n)
+{
+	int ret;
+
+	ret = ice_ilog2(n);
+
+	/* add one to turn to the ilog2 value into a 1 based index */
+	return ret >= 0 ? ret + 1 : 0;
+}
+
 static inline bool ice_is_tc_ena(ice_bitmap_t bitmap, u8 tc)
 {
 	return ice_is_bit_set(&bitmap, tc);
@@ -98,6 +116,8 @@ static inline u32 ice_round_to_num(u32 N, u32 R)
 #define ICE_LO_DWORD(x)		((u32)((x) & 0xFFFFFFFF))
 #define ICE_HI_WORD(x)		((u16)(((x) >> 16) & 0xFFFF))
 #define ICE_LO_WORD(x)		((u16)((x) & 0xFFFF))
+#define ICE_HI_BYTE(x)		((u8)(((x) >> 8) & 0xFF))
+#define ICE_LO_BYTE(x)		((u8)((x) & 0xFF))
 
 /* debug masks - set these bits in hw->debug_mask to control output */
 #define ICE_DBG_TRACE		BIT_ULL(0) /* for function-trace only */
@@ -918,6 +938,14 @@ struct ice_nvm_info {
 	u8 minor;
 };
 
+/* Minimum Security Revision information */
+struct ice_minsrev_info {
+	u32 nvm;
+	u32 orom;
+	u8 nvm_valid : 1;
+	u8 orom_valid : 1;
+};
+
 /* Enumeration of possible flash banks for the NVM, OROM, and Netlist modules
  * of the flash image.
  */
@@ -1231,6 +1259,7 @@ struct ice_port_info {
 	struct ice_bw_type_info tc_node_bw_t_info[ICE_MAX_TRAFFIC_CLASS];
 	struct ice_qos_cfg qos_cfg;
 	u8 is_vf:1;
+	u8 is_custom_tx_enabled:1;
 };
 
 struct ice_switch_info {
@@ -1511,6 +1540,7 @@ enum ice_sw_fwd_act_type {
 	ICE_FWD_TO_QGRP,
 	ICE_SET_MARK,
 	ICE_DROP_PACKET,
+	ICE_LG_ACTION,
 	ICE_INVAL_ACT
 };
 
Signature · 1 line
2.43.0
#419 lore raw

PATCH v4 98/103 net/ice/base: align code to base driver

In reply to Anatoly Burakov

Currently, there are some miscellaneous changes that are missing from DPDK that are present in base driver code. This patch aligns our code to that of base driver, with following changes happening:

- Whitespace/line break alignment (majority of changes)
- Comment fixes
- Moving function definitions within headers
- Moving functions within .c files
- Moving case statements within code
- Moving structure definitions
- Moving variable declarations
- Renaming static functions
- Adding a local variable in place of direct accesses
- Replacing local variables with direct accesses
- Removing useless !!

---
 drivers/net/ice/base/ice_adminq_cmd.h    |  18 +-
 drivers/net/ice/base/ice_bitops.h        |   4 +-
 drivers/net/ice/base/ice_common.c        | 248 +++++-----
 drivers/net/ice/base/ice_common.h        |   1 -
 drivers/net/ice/base/ice_controlq.c      |   7 +-
 drivers/net/ice/base/ice_controlq.h      |   1 -
 drivers/net/ice/base/ice_ddp.c           |   3 +-
 drivers/net/ice/base/ice_devids.h        |   8 +-
 drivers/net/ice/base/ice_fdir.c          |  22 +-
 drivers/net/ice/base/ice_flex_pipe.c     | 106 +++--
 drivers/net/ice/base/ice_flex_type.h     |   1 -
 drivers/net/ice/base/ice_flow.c          |  91 ++--
 drivers/net/ice/base/ice_flow.h          |  17 +-
 drivers/net/ice/base/ice_hw_autogen.h    |   2 +-
 drivers/net/ice/base/ice_lan_tx_rx.h     |   3 +-
 drivers/net/ice/base/ice_nvm.c           |  19 +-
 drivers/net/ice/base/ice_nvm.h           |   1 -
 drivers/net/ice/base/ice_parser.c        |  20 +-
 drivers/net/ice/base/ice_parser.h        |  18 +-
 drivers/net/ice/base/ice_parser_rt.c     |  22 +-
 drivers/net/ice/base/ice_parser_rt.h     |   2 +-
 drivers/net/ice/base/ice_protocol_type.h |  11 +-
 drivers/net/ice/base/ice_ptp_consts.h    |   3 +-
 drivers/net/ice/base/ice_ptp_hw.c        | 399 ++++++++--------
 drivers/net/ice/base/ice_ptp_hw.h        |   7 +-
 drivers/net/ice/base/ice_sched.h         |  10 +-
 drivers/net/ice/base/ice_switch.c        | 580 ++++++++++++-----------
 drivers/net/ice/base/ice_switch.h        |   9 +-
 drivers/net/ice/base/ice_type.h          |   3 +-
 drivers/net/ice/base/ice_xlt_kb.c        |   4 +-
 30 files changed, 833 insertions(+), 807 deletions(-)
drivers/net/ice/base/ice_adminq_cmd.h +9 -9
index daa5dedb41..6a89e1614a 100644
@@ -761,7 +761,7 @@ struct ice_aqc_recipe_content {
 #define ICE_AQ_RECIPE_ID_S		0
 #define ICE_AQ_RECIPE_ID_M		(0x3F << ICE_AQ_RECIPE_ID_S)
 #define ICE_AQ_RECIPE_ID_IS_ROOT	BIT(7)
-#define	ICE_AQ_SW_ID_LKUP_IDX		0
+#define ICE_AQ_SW_ID_LKUP_IDX		0
 	u8 lkup_indx[5];
 #define ICE_AQ_RECIPE_LKUP_DATA_S	0
 #define ICE_AQ_RECIPE_LKUP_DATA_M	(0x3F << ICE_AQ_RECIPE_LKUP_DATA_S)
@@ -1098,9 +1098,9 @@ struct ice_aqc_txsched_elem {
 	u8 generic;
 #define ICE_AQC_ELEM_GENERIC_MODE_M		0x1
 #define ICE_AQC_ELEM_GENERIC_PRIO_S		0x1
-#define ICE_AQC_ELEM_GENERIC_PRIO_M	(0x7 << ICE_AQC_ELEM_GENERIC_PRIO_S)
+#define ICE_AQC_ELEM_GENERIC_PRIO_M		(0x7 << ICE_AQC_ELEM_GENERIC_PRIO_S)
 #define ICE_AQC_ELEM_GENERIC_SP_S		0x4
-#define ICE_AQC_ELEM_GENERIC_SP_M	(0x1 << ICE_AQC_ELEM_GENERIC_SP_S)
+#define ICE_AQC_ELEM_GENERIC_SP_M		(0x1 << ICE_AQC_ELEM_GENERIC_SP_S)
 #define ICE_AQC_ELEM_GENERIC_ADJUST_VAL_S	0x5
 #define ICE_AQC_ELEM_GENERIC_ADJUST_VAL_M	\
 	(0x3 << ICE_AQC_ELEM_GENERIC_ADJUST_VAL_S)
@@ -1290,10 +1290,11 @@ struct ice_aqc_get_phy_caps {
 	/* 18.0 - Report qualified modules */
 #define ICE_AQC_GET_PHY_RQM		BIT(0)
 	/* 18.1 - 18.3 : Report mode
-	 * 000b - Report NVM capabilities
-	 * 001b - Report topology capabilities
-	 * 010b - Report SW configured
-	 * 100b - Report default capabilities
+	 * 000b - Report topology capabilities, without media
+	 * 001b - Report topology capabilities, with media
+	 * 010b - Report Active configuration
+	 * 011b - Report PHY Type and FEC mode capabilities
+	 * 100b - Report Default capabilities
 	 */
 #define ICE_AQC_REPORT_MODE_S			1
 #define ICE_AQC_REPORT_MODE_M			(7 << ICE_AQC_REPORT_MODE_S)
@@ -2930,7 +2931,6 @@ struct ice_aqc_dis_txq_item {
 			(1 << ICE_AQC_Q_DIS_BUF_ELEM_TYPE_S)
 	__le16 q_id[STRUCT_HACK_VAR_LEN];
 };
-
 #pragma pack()
 
 /* Tx LAN Queues Cleanup Event (0x0C31) */
@@ -3010,7 +3010,7 @@ struct ice_pkg_ver {
 };
 
 #define ICE_PKG_NAME_SIZE	32
-#define ICE_SEG_ID_SIZE	28
+#define ICE_SEG_ID_SIZE		28
 #define ICE_SEG_NAME_SIZE	28
 
 struct ice_aqc_get_pkg_info {
drivers/net/ice/base/ice_bitops.h +2 -2
index 5c17bcb674..85e14a2358 100644
@@ -375,7 +375,7 @@ static inline bool ice_is_any_bit_set(ice_bitmap_t *bitmap, u16 size)
 }
 
 /**
- * ice_cp_bitmap - copy bitmaps.
+ * ice_cp_bitmap - copy bitmaps
  * @dst: bitmap destination
  * @src: bitmap to copy from
  * @size: Size of the bitmaps in bits
@@ -433,7 +433,7 @@ ice_bitmap_hweight(ice_bitmap_t *bm, u16 size)
 }
 
 /**
- * ice_cmp_bitmap - compares two bitmaps.
+ * ice_cmp_bitmap - compares two bitmaps
  * @bmp1: the bitmap to compare
  * @bmp2: the bitmap to compare with bmp1
  * @size: Size of the bitmaps in bits
drivers/net/ice/base/ice_common.c +125 -123

308 lines not on this page · raw message

drivers/net/ice/base/ice_common.h +0 -1
index 684d76d9a0..71b1f34d0a 100644
@@ -187,7 +187,6 @@ int
 ice_get_link_default_override(struct ice_link_default_override_tlv *ldo,
 			      struct ice_port_info *pi);
 bool ice_is_phy_caps_an_enabled(struct ice_aqc_get_phy_caps_data *caps);
-
 enum ice_fc_mode ice_caps_to_fc_mode(u8 caps);
 enum ice_fec_mode ice_caps_to_fec_mode(u8 caps, u8 fec_options);
 int
drivers/net/ice/base/ice_controlq.c +4 -3
index 436551a82d..af27dc8542 100644
@@ -470,7 +470,7 @@ ice_shutdown_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)
 }
 
 /**
- * ice_aq_ver_check - Check the reported AQ API version.
+ * ice_aq_ver_check - Check the reported AQ API version
  * @hw: pointer to the hardware structure
  *
  * Checks if the driver should load on a given AQ API version.
@@ -658,8 +658,9 @@ static bool ice_is_sbq_supported(struct ice_hw *hw)
  *
  * NOTE: this function does not destroy the control queue locks.
  */
-static void ice_shutdown_ctrlq(struct ice_hw *hw, enum ice_ctl_q q_type,
-			       bool unloading)
+static void
+ice_shutdown_ctrlq(struct ice_hw *hw, enum ice_ctl_q q_type,
+		   bool unloading)
 {
 	struct ice_ctl_q_info *cq;
 
drivers/net/ice/base/ice_controlq.h +0 -1
index 24e34d9579..d5257172cc 100644
@@ -87,7 +87,6 @@ struct ice_sq_cd {
 	struct ice_aq_desc *wb_desc;
 };
 
-
 /* rq event information */
 struct ice_rq_event_info {
 	struct ice_aq_desc desc;
drivers/net/ice/base/ice_ddp.c +1 -2
index f82e5a387f..24506dfaea 100644
@@ -1034,7 +1034,6 @@ static enum ice_ddp_state ice_chk_pkg_version(struct ice_pkg_ver *pkg_ver)
 		 (pkg_ver->major == ICE_PKG_SUPP_VER_MAJ &&
 		  pkg_ver->minor < ICE_PKG_SUPP_VER_MNR))
 		return ICE_DDP_PKG_FILE_VERSION_TOO_LOW;
-
 	return ICE_DDP_PKG_SUCCESS;
 }
 
@@ -2335,8 +2334,8 @@ int ice_cfg_tx_topo(struct ice_hw *hw, u8 *buf, u32 len)
 	struct ice_pkg_hdr *pkg_hdr;
 	enum ice_ddp_state state;
 	u16 i, size = 0, offset;
-	int status;
 	u32 reg = 0;
+	int status;
 	u8 flags;
 
 	if (!buf || !len)
drivers/net/ice/base/ice_devids.h +4 -4
index 33e6cc6ade..07fb9aca0b 100644
@@ -6,6 +6,8 @@
 #define _ICE_DEVIDS_H_
 
 /* Device IDs */
+#define ICE_DEV_ID_E822_SI_DFLT		0x1888
+/* Intel(R) Ethernet Connection E823-L for backplane */
 #define ICE_DEV_ID_E823L_BACKPLANE	0x124C
 /* Intel(R) Ethernet Connection E823-L for SFP */
 #define ICE_DEV_ID_E823L_SFP		0x124D
@@ -53,8 +55,6 @@
 /* Intel(R) Ethernet Controller E810-XXV for SFP */
 #define ICE_DEV_ID_E810_XXV_SFP		0x159B
 /* Intel(R) Ethernet Connection E823-C for backplane */
-#define ICE_DEV_ID_E822_SI_DFLT		0x1888
-/* Intel(R) Ethernet Connection E823-L for backplane */
 #define ICE_DEV_ID_E823C_BACKPLANE	0x188A
 /* Intel(R) Ethernet Connection E823-C for QSFP */
 #define ICE_DEV_ID_E823C_QSFP		0x188B
@@ -87,9 +87,9 @@
 /* Intel(R) Ethernet Connection E825-C for backplane */
 #define ICE_DEV_ID_E825C_BACKPLANE	0x579C
 /* Intel(R) Ethernet Connection E825-C for QSFP */
-#define ICE_DEV_ID_E825C_QSFP	        0x579D
+#define ICE_DEV_ID_E825C_QSFP		0x579D
 /* Intel(R) Ethernet Connection E825-C for SFP */
-#define ICE_DEV_ID_E825C_SFP	        0x579E
+#define ICE_DEV_ID_E825C_SFP		0x579E
 /* Intel(R) Ethernet Connection E825-C 1GbE */
 #define ICE_DEV_ID_E825C_SGMII		0x579F
 #define ICE_DEV_ID_C825X		0x0DCD
drivers/net/ice/base/ice_fdir.c +13 -9
index 75fae4408f..f62313c559 100644
@@ -6,6 +6,7 @@
 #include "ice_fdir.h"
 
 /* These are training packet headers used to program flow director filters. */
+
 static const u8 ice_fdir_tcpv4_pkt[] = {
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 	0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00,
@@ -3587,7 +3588,7 @@ int ice_get_fdir_cnt_all(struct ice_hw *hw)
 }
 
 /**
- * ice_pkt_insert_ipv6_addr - insert a be32 IPv6 address into a memory buffer.
+ * ice_pkt_insert_ipv6_addr - insert a be32 IPv6 address into a memory buffer
  * @pkt: packet buffer
  * @offset: offset into buffer
  * @addr: IPv6 address to convert and insert into pkt at offset
@@ -3602,12 +3603,12 @@ static void ice_pkt_insert_ipv6_addr(u8 *pkt, int offset, __be32 *addr)
 }
 
 /**
- * ice_pkt_insert_u6_qfi - insert a u6 value qfi into a memory buffer for gtpu
+ * ice_pkt_insert_u6_qfi - insert a u6 value QFI into a memory buffer for GTPU
  * @pkt: packet buffer
  * @offset: offset into buffer
  * @data: 8 bit value to convert and insert into pkt at offset
  *
- * This function is designed for inserting qfi (6 bits) for gtpu.
+ * This function is designed for inserting QFI (6 bits) for GTPU.
  */
 static void ice_pkt_insert_u6_qfi(u8 *pkt, int offset, u8 data)
 {
@@ -3618,7 +3619,7 @@ static void ice_pkt_insert_u6_qfi(u8 *pkt, int offset, u8 data)
 }
 
 /**
- * ice_pkt_insert_u8 - insert a u8 value into a memory buffer.
+ * ice_pkt_insert_u8 - insert a u8 value into a memory buffer
  * @pkt: packet buffer
  * @offset: offset into buffer
  * @data: 8 bit value to convert and insert into pkt at offset
@@ -3629,7 +3630,7 @@ static void ice_pkt_insert_u8(u8 *pkt, int offset, u8 data)
 }
 
 /**
- * ice_pkt_insert_u8_tc - insert a u8 value into a memory buffer for TC ipv6.
+ * ice_pkt_insert_u8_tc - insert a u8 value into a memory buffer for TC IPv6
  * @pkt: packet buffer
  * @offset: offset into buffer
  * @data: 8 bit value to convert and insert into pkt at offset
@@ -3651,7 +3652,7 @@ static void ice_pkt_insert_u8_tc(u8 *pkt, int offset, u8 data)
 }
 
 /**
- * ice_pkt_insert_u16 - insert a be16 value into a memory buffer.
+ * ice_pkt_insert_u16 - insert a be16 value into a memory buffer
  * @pkt: packet buffer
  * @offset: offset into buffer
  * @data: 16 bit value to convert and insert into pkt at offset
@@ -3662,7 +3663,7 @@ static void ice_pkt_insert_u16(u8 *pkt, int offset, __be16 data)
 }
 
 /**
- * ice_pkt_insert_u32 - insert a be32 value into a memory buffer.
+ * ice_pkt_insert_u32 - insert a be32 value into a memory buffer
  * @pkt: packet buffer
  * @offset: offset into buffer
  * @data: 32 bit value to convert and insert into pkt at offset
@@ -3673,7 +3674,7 @@ static void ice_pkt_insert_u32(u8 *pkt, int offset, __be32 data)
 }
 
 /**
- * ice_pkt_insert_mac_addr - insert a MAC addr into a memory buffer.
+ * ice_pkt_insert_mac_addr - insert a MAC addr into a memory buffer
  * @pkt: packet buffer
  * @addr: MAC address to convert and insert into pkt at offset
  */
@@ -4101,7 +4102,8 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input,
 		ice_pkt_insert_u8(loc, ICE_IPV4_TOS_OFFSET, input->ip.v4.tos);
 		ice_pkt_insert_u8(loc, ICE_IPV4_TTL_OFFSET, input->ip.v4.ttl);
 		ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac);
-		ice_pkt_insert_mac_addr(loc + ETH_ALEN, input->ext_data.src_mac);
+		ice_pkt_insert_mac_addr(loc + ETH_ALEN,
+					input->ext_data.src_mac);
 		break;
 	case ICE_FLTR_PTYPE_NONF_IPV4_SCTP:
 		ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET,
@@ -4223,6 +4225,8 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input,
 				   input->ip.v4.dst_ip);
 		ice_pkt_insert_u8(loc, ICE_IPV4_TOS_OFFSET, input->ip.v4.tos);
 		ice_pkt_insert_u8(loc, ICE_IPV4_TTL_OFFSET, input->ip.v4.ttl);
+		ice_pkt_insert_u8(loc, ICE_IPV4_PROTO_OFFSET,
+				  input->ip.v4.proto);
 		ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac);
 		ice_pkt_insert_mac_addr(loc + ETH_ALEN,
 					input->ext_data.src_mac);
drivers/net/ice/base/ice_flex_pipe.c +54 -52

146 lines not on this page · raw message

drivers/net/ice/base/ice_flex_type.h +0 -1
index 52320d86dc..45cdce9b0a 100644
@@ -651,7 +651,6 @@ struct ice_prof_tcam_entry {
 	u8 key[ICE_TCAM_KEY_SZ];
 	u8 prof_id;
 };
-
 #pragma pack()
 
 struct ice_prof_id_section {
drivers/net/ice/base/ice_flow.c +45 -46

238 lines not on this page · raw message

drivers/net/ice/base/ice_flow.h +8 -9
index 8c66fb1b96..65b261beca 100644
@@ -371,14 +371,14 @@ enum ice_flow_avf_hdr_field {
 enum ice_rss_cfg_hdr_type {
 	ICE_RSS_OUTER_HEADERS, /* take outer headers as inputset. */
 	ICE_RSS_INNER_HEADERS, /* take inner headers as inputset. */
-	/* take inner headers as inputset for packet with outer ipv4. */
+	/* take inner headers as inputset for packet with outer IPv4. */
 	ICE_RSS_INNER_HEADERS_W_OUTER_IPV4,
-	/* take inner headers as inputset for packet with outer ipv6. */
+	/* take inner headers as inputset for packet with outer IPv6. */
 	ICE_RSS_INNER_HEADERS_W_OUTER_IPV6,
 	/* take outer headers first then inner headers as inputset */
-	/* take inner as inputset for GTPoGRE with outer ipv4 + gre. */
+	/* take inner as inputset for GTPoGRE with outer IPv4 + GRE. */
 	ICE_RSS_INNER_HEADERS_W_OUTER_IPV4_GRE,
-	/* take inner as inputset for GTPoGRE with outer ipv6 + gre. */
+	/* take inner as inputset for GTPoGRE with outer IPv6 + GRE. */
 	ICE_RSS_INNER_HEADERS_W_OUTER_IPV6_GRE,
 	ICE_RSS_ANY_HEADERS
 };
@@ -576,16 +576,15 @@ int
 ice_flow_assoc_prof(struct ice_hw *hw, enum ice_block blk,
 		    struct ice_flow_prof *prof, u16 vsi_handle);
 int
-ice_flow_assoc_vsig_vsi(struct ice_hw *hw, enum ice_block blk, u16 vsi_handle,
-			u16 vsig);
-int
 ice_flow_set_hw_prof(struct ice_hw *hw, u16 dest_vsi_handle,
 		     u16 fdir_vsi_handle, struct ice_parser_profile *prof,
 		     enum ice_block blk);
 int
+ice_flow_assoc_vsig_vsi(struct ice_hw *hw, enum ice_block blk, u16 vsi_handle,
+			u16 vsig);
+int
 ice_flow_get_hw_prof(struct ice_hw *hw, enum ice_block blk, u64 prof_id,
 		     u8 *hw_prof);
-
 u64 ice_flow_find_entry(struct ice_hw *hw, enum ice_block blk, u64 entry_id);
 int
 ice_flow_add_entry(struct ice_hw *hw, enum ice_block blk, u64 prof_id,
@@ -604,7 +603,7 @@ void
 ice_flow_add_fld_raw(struct ice_flow_seg_info *seg, u16 off, u8 len,
 		     u16 val_loc, u16 mask_loc);
 int ice_flow_rem_vsi_prof(struct ice_hw *hw, enum ice_block blk,
-				      u16 vsi_handle, u64 prof_id);
+			  u16 vsi_handle, u64 prof_id);
 void ice_rem_vsi_rss_list(struct ice_hw *hw, u16 vsi_handle);
 int ice_replay_rss_cfg(struct ice_hw *hw, u16 vsi_handle);
 int
drivers/net/ice/base/ice_hw_autogen.h +1 -1
index 8c8e04e50a..3753cc77c2 100644
@@ -22,6 +22,7 @@
 #define GLNVM_FLA			0x000B6108
 #define GL_HIDA_MAX_INDEX		15
 #define GL_HIBA_MAX_INDEX		1023
+#define GL_MNG_FWSM_FW_LOADING_M	BIT(30)
 #define GL_RDPU_CNTRL				0x00052054 /* Reset Source: CORER */
 #define GL_RDPU_CNTRL_RX_PAD_EN_S		0
 #define GL_RDPU_CNTRL_RX_PAD_EN_M		BIT(0)
@@ -5533,7 +5534,6 @@
 #define GL_MNG_FW_RAM_STAT_MNG_MEM_ECC_ERR_S	1
 #define GL_MNG_FW_RAM_STAT_MNG_MEM_ECC_ERR_M	BIT(1)
 #define GL_MNG_FWSM				0x000B6134 /* Reset Source: POR */
-#define GL_MNG_FWSM_FW_LOADING_M		BIT(30)
 #define GL_MNG_FWSM_FW_MODES_S			0
 #define GL_MNG_FWSM_FW_MODES_M_BY_MAC(hw) ((hw)->mac_type == ICE_MAC_E830 ? E830_GL_MNG_FWSM_FW_MODES_M : E800_GL_MNG_FWSM_FW_MODES_M)
 #define E800_GL_MNG_FWSM_FW_MODES_M		MAKEMASK(0x7, 0)
drivers/net/ice/base/ice_lan_tx_rx.h +2 -1
index a4eb6e45ed..209b8e5c43 100644
@@ -921,7 +921,8 @@ enum ice_rx_flex_desc_exstat_bits {
 	ICE_RX_FLEX_DESC_EXSTAT_OVERSIZE_S = 3,
 };
 
-/* For ice_32b_rx_flex_desc.ts_low:
+/*
+ * For ice_32b_rx_flex_desc.ts_low:
  * [0]: Timestamp-low validity bit
  * [1:7]: Timestamp-low value
  */
drivers/net/ice/base/ice_nvm.c +7 -12
index 35da0c8b9c..528489929e 100644
@@ -125,8 +125,7 @@ ice_read_flat_nvm(struct ice_hw *hw, u32 offset, u32 *length, u8 *data,
  *
  * Reads one 16 bit word from the Shadow RAM using ice_read_flat_nvm.
  */
-static int
-ice_read_sr_word_aq(struct ice_hw *hw, u16 offset, u16 *data)
+static int ice_read_sr_word_aq(struct ice_hw *hw, u16 offset, u16 *data)
 {
 	u32 bytes = sizeof(u16);
 	__le16 data_local;
@@ -535,8 +534,7 @@ ice_get_pfa_module_tlv(struct ice_hw *hw, u16 *module_tlv, u16 *module_tlv_len,
  *
  * Reads the part number string from the NVM.
  */
-int
-ice_read_pba_string(struct ice_hw *hw, u8 *pba_num, u32 pba_num_size)
+int ice_read_pba_string(struct ice_hw *hw, u8 *pba_num, u32 pba_num_size)
 {
 	u16 pba_tlv, pba_tlv_len;
 	u16 pba_word, pba_size;
@@ -620,7 +618,7 @@ static int ice_get_nvm_srev(struct ice_hw *hw, enum ice_bank_select bank, u32 *s
  * @nvm: pointer to NVM info structure
  *
  * Read the NVM EETRACK ID and map version of the main NVM image bank, filling
- * in the nvm info structure.
+ * in the NVM info structure.
  */
 static int
 ice_get_nvm_ver_info(struct ice_hw *hw, enum ice_bank_select bank, struct ice_nvm_info *nvm)
@@ -845,7 +843,7 @@ int ice_get_inactive_orom_ver(struct ice_hw *hw, struct ice_orom_info *orom)
 }
 
 /**
- * ice_discover_flash_size - Discover the available flash size.
+ * ice_discover_flash_size - Discover the available flash size
  * @hw: pointer to the HW struct
  *
  * The device flash could be up to 16MB in size. However, it is possible that
@@ -909,8 +907,7 @@ static int ice_discover_flash_size(struct ice_hw *hw)
  * sector size by using the highest bit. The reported pointer value will be in
  * bytes, intended for flat NVM reads.
  */
-static int
-ice_read_sr_pointer(struct ice_hw *hw, u16 offset, u32 *pointer)
+static int ice_read_sr_pointer(struct ice_hw *hw, u16 offset, u32 *pointer)
 {
 	int status;
 	u16 value;
@@ -941,8 +938,7 @@ ice_read_sr_pointer(struct ice_hw *hw, u16 offset, u32 *pointer)
  * Each area size word is specified in 4KB sector units. This function reports
  * the size in bytes, intended for flat NVM reads.
  */
-static int
-ice_read_sr_area_size(struct ice_hw *hw, u16 offset, u32 *size)
+static int ice_read_sr_area_size(struct ice_hw *hw, u16 offset, u32 *size)
 {
 	int status;
 	u16 value;
@@ -967,8 +963,7 @@ ice_read_sr_area_size(struct ice_hw *hw, u16 offset, u32 *size)
  * structure for later use in order to calculate the correct offset to read
  * from the active module.
  */
-static int
-ice_determine_active_flash_banks(struct ice_hw *hw)
+static int ice_determine_active_flash_banks(struct ice_hw *hw)
 {
 	struct ice_bank_info *banks = &hw->flash.banks;
 	u16 ctrl_word;
drivers/net/ice/base/ice_nvm.h +0 -1
index 66443c2694..f47b4b6d5a 100644
@@ -34,7 +34,6 @@ struct ice_orom_civd_info {
 	u8 combo_name_len;	/* Length of the unicode combo image version string, max of 32 */
 	__le16 combo_name[32];	/* Unicode string representing the Combo Image version */
 };
-
 #pragma pack()
 
 #define ICE_NVM_ACCESS_MAJOR_VER	0
drivers/net/ice/base/ice_parser.c +10 -10
index 67e36107b5..167f9534b1 100644
@@ -311,7 +311,7 @@ void ice_parser_destroy(struct ice_parser *psr)
  * @rslt: input/output parameter to save parser result.
  */
 int ice_parser_run(struct ice_parser *psr, const u8 *pkt_buf,
-			       int pkt_len, struct ice_parser_result *rslt)
+		   int pkt_len, struct ice_parser_result *rslt)
 {
 	ice_parser_rt_reset(&psr->rt);
 	ice_parser_rt_pktbuf_set(&psr->rt, pkt_buf, pkt_len);
@@ -342,10 +342,10 @@ void ice_parser_result_dump(struct ice_hw *hw, struct ice_parser_result *rslt)
 
 static void _bst_vm_set(struct ice_parser *psr, const char *prefix, bool on)
 {
-	struct ice_bst_tcam_item *item;
 	u16 i = 0;
 
 	while (true) {
+		struct ice_bst_tcam_item *item;
 		item = ice_bst_tcam_search(psr->bst_tcam_table,
 					   psr->bst_lbl_table,
 					   prefix, &i);
@@ -373,10 +373,10 @@ _tunnel_port_set(struct ice_parser *psr, const char *prefix, u16 udp_port,
 		 bool on)
 {
 	u8 *buf = (u8 *)&udp_port;
-	struct ice_bst_tcam_item *item;
 	u16 i = 0;
 
 	while (true) {
+		struct ice_bst_tcam_item *item;
 		item = ice_bst_tcam_search(psr->bst_tcam_table,
 					   psr->bst_lbl_table,
 					   prefix, &i);
@@ -414,7 +414,7 @@ _tunnel_port_set(struct ice_parser *psr, const char *prefix, u16 udp_port,
  * @on: true to turn on; false to turn off
  */
 int ice_parser_vxlan_tunnel_set(struct ice_parser *psr,
-					    u16 udp_port, bool on)
+				u16 udp_port, bool on)
 {
 	return _tunnel_port_set(psr, "TNL_VXLAN", udp_port, on);
 }
@@ -426,7 +426,7 @@ int ice_parser_vxlan_tunnel_set(struct ice_parser *psr,
  * @on: true to turn on; false to turn off
  */
 int ice_parser_geneve_tunnel_set(struct ice_parser *psr,
-					     u16 udp_port, bool on)
+				 u16 udp_port, bool on)
 {
 	return _tunnel_port_set(psr, "TNL_GENEVE", udp_port, on);
 }
@@ -438,7 +438,7 @@ int ice_parser_geneve_tunnel_set(struct ice_parser *psr,
  * @on: true to turn on; false to turn off
  */
 int ice_parser_ecpri_tunnel_set(struct ice_parser *psr,
-					    u16 udp_port, bool on)
+				u16 udp_port, bool on)
 {
 	return _tunnel_port_set(psr, "TNL_UDP_ECPRI", udp_port, on);
 }
@@ -487,10 +487,10 @@ static bool _nearest_proto_id(struct ice_parser_result *rslt, u16 offset,
  * @prof: input/output parameter to save the profile
  */
 int ice_parser_profile_init(struct ice_parser_result *rslt,
-					const u8 *pkt_buf, const u8 *msk_buf,
-					int buf_len, enum ice_block blk,
-					bool prefix_match,
-					struct ice_parser_profile *prof)
+			    const u8 *pkt_buf, const u8 *msk_buf,
+			    int buf_len, enum ice_block blk,
+			    bool prefix_match,
+			    struct ice_parser_profile *prof)
 {
 	u8 proto_id = 0xff;
 	u16 proto_off = 0;
drivers/net/ice/base/ice_parser.h +9 -9
index f2a72cc44b..28c96af6da 100644
@@ -59,11 +59,11 @@ int ice_parser_create(struct ice_hw *hw, struct ice_parser **psr);
 void ice_parser_destroy(struct ice_parser *psr);
 void ice_parser_dvm_set(struct ice_parser *psr, bool on);
 int ice_parser_vxlan_tunnel_set(struct ice_parser *psr,
-					    u16 udp_port, bool on);
+				u16 udp_port, bool on);
 int ice_parser_geneve_tunnel_set(struct ice_parser *psr,
-					     u16 udp_port, bool on);
+				 u16 udp_port, bool on);
 int ice_parser_ecpri_tunnel_set(struct ice_parser *psr,
-					    u16 udp_port, bool on);
+				u16 udp_port, bool on);
 
 struct ice_parser_proto_off {
 	u8 proto_id; /* hardware protocol ID */
@@ -84,7 +84,7 @@ struct ice_parser_result {
 };
 
 int ice_parser_run(struct ice_parser *psr, const u8 *pkt_buf,
-			       int pkt_len, struct ice_parser_result *rslt);
+		   int pkt_len, struct ice_parser_result *rslt);
 void ice_parser_result_dump(struct ice_hw *hw, struct ice_parser_result *rslt);
 
 struct ice_parser_fv {
@@ -95,7 +95,7 @@ struct ice_parser_fv {
 };
 
 struct ice_parser_profile {
-	struct ice_parser_fv fv[48]; /* field vector array */
+	struct ice_parser_fv fv[48]; /* field vector arrary */
 	int fv_num; /* field vector number must <= 48 */
 	u16 flags; /* 16 bits key builder flag */
 	u16 flags_msk; /* key builder flag masker */
@@ -104,10 +104,10 @@ struct ice_parser_profile {
 };
 
 int ice_parser_profile_init(struct ice_parser_result *rslt,
-					const u8 *pkt_buf, const u8 *msk_buf,
-					int buf_len, enum ice_block blk,
-					bool prefix_match,
-					struct ice_parser_profile *prof);
+			    const u8 *pkt_buf, const u8 *msk_buf,
+			    int buf_len, enum ice_block blk,
+			    bool prefix_match,
+			    struct ice_parser_profile *prof);
 void ice_parser_profile_dump(struct ice_hw *hw,
 			     struct ice_parser_profile *prof);
 bool ice_check_ddp_support_proto_id(struct ice_hw *hw,
drivers/net/ice/base/ice_parser_rt.c +11 -11
index 50a3d301b0..09aac0c6e6 100644
@@ -346,7 +346,7 @@ static void _bst_pgp_set(struct ice_parser_rt *rt,
 		  rt->pg, bst->address);
 }
 
-static struct ice_pg_cam_item *_pg_cam_match(struct ice_parser_rt *rt)
+static struct ice_pg_cam_item *__pg_cam_match(struct ice_parser_rt *rt)
 {
 	struct ice_parser *psr = rt->psr;
 	struct ice_pg_cam_item *item;
@@ -361,7 +361,7 @@ static struct ice_pg_cam_item *_pg_cam_match(struct ice_parser_rt *rt)
 	return item;
 }
 
-static struct ice_pg_nm_cam_item *_pg_nm_cam_match(struct ice_parser_rt *rt)
+static struct ice_pg_nm_cam_item *__pg_nm_cam_match(struct ice_parser_rt *rt)
 {
 	struct ice_parser *psr = rt->psr;
 	struct ice_pg_nm_cam_item *item;
@@ -411,9 +411,8 @@ static void _flg_add(struct ice_parser_rt *rt, int idx, bool val)
 
 static void _flg_update(struct ice_parser_rt *rt, struct ice_alu *alu)
 {
-	int i;
-
 	if (alu->dedicate_flags_ena) {
+		int i;
 		if (alu->flags_extr_imm) {
 			for (i = 0; i < alu->dst_len; i++)
 				_flg_add(rt, alu->dst_start + i,
@@ -653,12 +652,12 @@ static void _alu_pg_exe(struct ice_parser_rt *rt)
 static void _proto_off_update(struct ice_parser_rt *rt)
 {
 	struct ice_parser *psr = rt->psr;
-	int i;
 
 	if (rt->action->is_pg) {
 		struct ice_proto_grp_item *proto_grp =
 			&psr->proto_grp_table[rt->action->proto_id];
 		u16 po;
+		int i;
 
 		for (i = 0; i < 8; i++) {
 			struct ice_proto_off *entry = &proto_grp->po[i];
@@ -696,11 +695,11 @@ static void _marker_set(struct ice_parser_rt *rt, int idx)
 static void _marker_update(struct ice_parser_rt *rt)
 {
 	struct ice_parser *psr = rt->psr;
-	int i;
 
 	if (rt->action->is_mg) {
 		struct ice_mk_grp_item *mk_grp =
 			&psr->mk_grp_table[rt->action->marker_id];
+		int i;
 
 		for (i = 0; i < 8; i++) {
 			u8 marker = mk_grp->markers[i];
@@ -771,13 +770,11 @@ static void _result_resolve(struct ice_parser_rt *rt,
  * @rslt: input/output parameter to save parser result
  */
 int ice_parser_rt_execute(struct ice_parser_rt *rt,
-				      struct ice_parser_result *rslt)
+			  struct ice_parser_result *rslt)
 {
 	struct ice_pg_nm_cam_item *pg_nm_cam;
 	struct ice_parser *psr = rt->psr;
 	struct ice_pg_cam_item *pg_cam;
-	struct ice_bst_tcam_item *bst;
-	struct ice_imem_item *imem;
 	int status = 0;
 	u16 node;
 	u16 pc;
@@ -786,6 +783,9 @@ int ice_parser_rt_execute(struct ice_parser_rt *rt,
 	ice_debug(rt->psr->hw, ICE_DBG_PARSER, "Start with Node: %d\n", node);
 
 	while (true) {
+		struct ice_bst_tcam_item *bst;
+		struct ice_imem_item *imem;
+
 		pc = rt->gpr[GPR_NP_IDX];
 		imem = &psr->imem_table[pc];
 		ice_debug(rt->psr->hw, ICE_DBG_PARSER, "Load imem at pc: %d\n",
@@ -829,9 +829,9 @@ int ice_parser_rt_execute(struct ice_parser_rt *rt,
 		}
 
 		rt->action = NULL;
-		pg_cam = _pg_cam_match(rt);
+		pg_cam = __pg_cam_match(rt);
 		if (!pg_cam) {
-			pg_nm_cam = _pg_nm_cam_match(rt);
+			pg_nm_cam = __pg_nm_cam_match(rt);
 			if (pg_nm_cam) {
 				ice_debug(rt->psr->hw, ICE_DBG_PARSER, "Match ParseGraph Nomatch CAM Address %d\n",
 					  pg_nm_cam->idx);
drivers/net/ice/base/ice_parser_rt.h +1 -1
index f95068d07d..a77d4432a2 100644
@@ -49,5 +49,5 @@ void ice_parser_rt_pktbuf_set(struct ice_parser_rt *rt, const u8 *pkt_buf,
 
 struct ice_parser_result;
 int ice_parser_rt_execute(struct ice_parser_rt *rt,
-				      struct ice_parser_result *rslt);
+			  struct ice_parser_result *rslt);
 #endif /* _ICE_PARSER_RT_H_ */
drivers/net/ice/base/ice_protocol_type.h +6 -5
index d2d3f75fc2..de960d7d1b 100644
@@ -98,6 +98,10 @@ enum ice_sw_tunnel_type {
 	ICE_SW_TUN_IPV6_GTPU_EH_IPV6_UDP,
 	ICE_SW_TUN_IPV6_GTPU_IPV6_TCP,
 	ICE_SW_TUN_IPV6_GTPU_EH_IPV6_TCP,
+	ICE_SW_TUN_IPV4_GTPU_IPV4,
+	ICE_SW_TUN_IPV4_GTPU_IPV6,
+	ICE_SW_TUN_IPV6_GTPU_IPV4,
+	ICE_SW_TUN_IPV6_GTPU_IPV6,
 	ICE_SW_TUN_PPPOE,
 	ICE_SW_TUN_PPPOE_PAY,
 	ICE_SW_TUN_PPPOE_IPV4,
@@ -128,10 +132,6 @@ enum ice_sw_tunnel_type {
 	ICE_SW_TUN_PPPOE_PAY_QINQ,
 	ICE_SW_TUN_PPPOE_IPV4_QINQ,
 	ICE_SW_TUN_PPPOE_IPV6_QINQ,
-	ICE_SW_TUN_IPV4_GTPU_IPV4,
-	ICE_SW_TUN_IPV4_GTPU_IPV6,
-	ICE_SW_TUN_IPV6_GTPU_IPV4,
-	ICE_SW_TUN_IPV6_GTPU_IPV6,
 	ICE_SW_TUN_GTP_IPV4,
 	ICE_SW_TUN_GTP_IPV6,
 	ICE_ALL_TUNNELS /* All tunnel types including NVGRE */
@@ -223,7 +223,8 @@ enum ice_prot_id {
 
 #define ICE_MDID_SIZE 2
 #define ICE_TUN_FLAG_MDID 20
-#define ICE_TUN_FLAG_MDID_OFF(word)   (ICE_MDID_SIZE * (ICE_TUN_FLAG_MDID + (word)))
+#define ICE_TUN_FLAG_MDID_OFF(word) \
+	(ICE_MDID_SIZE * (ICE_TUN_FLAG_MDID + (word)))
 #define ICE_TUN_FLAG_MASK 0xFF
 #define ICE_DIR_FLAG_MASK 0x10
 #define ICE_TUN_FLAG_IN_VLAN_MASK 0x80 /* VLAN inside tunneled header */
drivers/net/ice/base/ice_ptp_consts.h +2 -1
index 546bf8ba91..bd0258f437 100644
@@ -157,7 +157,8 @@ const struct ice_cgu_pll_params_e822 e822_cgu_params[NUM_ICE_TIME_REF_FREQ] = {
 	},
 };
 
-/* struct ice_vernier_info_e822
+/*
+ * struct ice_vernier_info_e822
  *
  * E822 hardware calibrates the delay of the timestamp indication from the
  * actual packet transmission or reception during the initialization of the
drivers/net/ice/base/ice_ptp_hw.c +211 -188

618 lines not on this page · raw message

drivers/net/ice/base/ice_ptp_hw.h +4 -3
index fb56d76e98..967eed3d9d 100644
@@ -675,6 +675,10 @@ ice_get_base_incval(struct ice_hw *hw, enum ice_src_tmr_mode src_tmr_mode)
 #define ICE_ALL_SMA_MASK_E810T	(ICE_SMA1_MASK_E810T | \
 				 ICE_SMA2_MASK_E810T)
 
+#define ICE_SMA_MIN_BIT_E810T	3
+#define ICE_SMA_MAX_BIT_E810T	7
+#define ICE_PCA9575_P1_OFFSET	8
+
 /* E810T PCA9575 IO controller registers */
 #define ICE_PCA9575_P0_IN	0x0
 #define ICE_PCA9575_P1_IN	0x1
@@ -686,9 +690,6 @@ ice_get_base_incval(struct ice_hw *hw, enum ice_src_tmr_mode src_tmr_mode)
 /* E810T PCA9575 IO controller pin control */
 #define ICE_E810T_P0_GNSS_PRSNT_N	BIT(4)
 
-#define ICE_SMA_MIN_BIT_E810T	3
-#define ICE_SMA_MAX_BIT_E810T	7
-#define ICE_PCA9575_P1_OFFSET	8
 /* 56G PHY quad register base addresses */
 #define ICE_PHY0_BASE			0x092000
 #define ICE_PHY1_BASE			0x126000
drivers/net/ice/base/ice_sched.h +5 -5
index 92c3811c7e..51591bc6e7 100644
@@ -101,6 +101,10 @@ int
 ice_aq_query_sched_elems(struct ice_hw *hw, u16 elems_req,
 			 struct ice_aqc_txsched_elem_data *buf, u16 buf_size,
 			 u16 *elems_ret, struct ice_sq_cd *cd);
+
+int
+ice_sched_set_node_bw_lmt(struct ice_port_info *pi, struct ice_sched_node *node,
+			  enum ice_rl_type rl_type, u32 bw);
 int ice_sched_init_port(struct ice_port_info *pi);
 int ice_sched_query_res_alloc(struct ice_hw *hw);
 void ice_sched_get_psm_clk_freq(struct ice_hw *hw);
@@ -235,11 +239,7 @@ void ice_sched_replay_agg(struct ice_hw *hw);
 int ice_sched_replay_tc_node_bw(struct ice_port_info *pi);
 int ice_replay_vsi_agg(struct ice_hw *hw, u16 vsi_handle);
 int ice_sched_replay_root_node_bw(struct ice_port_info *pi);
-int
-ice_sched_replay_q_bw(struct ice_port_info *pi, struct ice_q_ctx *q_ctx);
-int
-ice_sched_set_node_bw_lmt(struct ice_port_info *pi, struct ice_sched_node *node,
-			  enum ice_rl_type rl_type, u32 bw);
+int ice_sched_replay_q_bw(struct ice_port_info *pi, struct ice_q_ctx *q_ctx);
 int
 ice_sched_cfg_node_bw_alloc(struct ice_hw *hw, struct ice_sched_node *node,
 			    enum ice_rl_type rl_type, u16 bw_alloc);
drivers/net/ice/base/ice_switch.c +291 -289

734 lines not on this page · raw message

drivers/net/ice/base/ice_switch.h +5 -4
index 41004a38b1..6bec3cb0b9 100644
@@ -15,7 +15,7 @@
 #define ICE_FLTR_RX	BIT(0)
 #define ICE_FLTR_TX	BIT(1)
 #define ICE_FLTR_RX_LB	BIT(2)
-#define ICE_FLTR_TX_RX (ICE_FLTR_RX | ICE_FLTR_TX)
+#define ICE_FLTR_TX_RX	(ICE_FLTR_RX | ICE_FLTR_TX)
 
 /* Switch Profile IDs for Profile related switch rules */
 #define ICE_PROFID_IPV4_TCP		4
@@ -254,6 +254,7 @@ union lg_act_entry {
 	struct entry_generic_act generic_act;
 	struct entry_statistics statistics;
 };
+
 struct ice_prof_type_entry {
 	u16 prof_id;
 	enum ice_sw_tunnel_type type;
@@ -289,7 +290,8 @@ struct ice_rule_query_data {
 	u16 vsi_handle;
 };
 
-/* This structure allows to pass info about lb_en and lan_en
+/*
+ * This structure allows to pass info about lb_en and lan_en
  * flags to ice_add_adv_rule. Values in act would be used
  * only if act_valid was set to true, otherwise dflt
  * values would be used.
@@ -507,8 +509,7 @@ ice_aq_get_res_descs(struct ice_hw *hw, u16 num_entries,
 		     bool res_shared, u16 *desc_id, struct ice_sq_cd *cd);
 int
 ice_add_vlan(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list);
-int
-ice_remove_vlan(struct ice_hw *hw, struct LIST_HEAD_TYPE *v_list);
+int ice_remove_vlan(struct ice_hw *hw, struct LIST_HEAD_TYPE *v_list);
 void ice_rem_all_sw_rules_info(struct ice_hw *hw);
 int ice_add_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_lst);
 int ice_remove_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_lst);
drivers/net/ice/base/ice_type.h +1 -2
index 4fea771ebe..598a80155b 100644
@@ -1355,7 +1355,6 @@ struct ice_hw {
 			      void *buf, u16 buf_size);
 	void *aq_send_cmd_param;
 	u8 dcf_enabled;		/* Device Config Function */
-
 	u8 api_branch;		/* API branch version */
 	u8 api_maj_ver;		/* API major version */
 	u8 api_min_ver;		/* API minor version */
@@ -1427,6 +1426,7 @@ struct ice_hw {
 	/* tunneling info */
 	struct ice_lock tnl_lock;
 	struct ice_tunnel_table tnl;
+
 	/* dvm boost update information */
 	struct ice_dvm_table dvm_upd;
 
@@ -1710,7 +1710,6 @@ struct ice_aq_get_set_rss_lut_params {
 /* AQ API version for report default configuration */
 #define ICE_FW_API_REPORT_DFLT_CFG_MAJ		1
 #define ICE_FW_API_REPORT_DFLT_CFG_MIN		7
-
 #define ICE_FW_API_REPORT_DFLT_CFG_PATCH	3
 
 /* FW branch number for hardware families */
drivers/net/ice/base/ice_xlt_kb.c +2 -2
index b8240946b4..0d5a510384 100644
@@ -24,7 +24,7 @@ static void _xlt_kb_entry_dump(struct ice_hw *hw,
 }
 
 /**
- * ice_imem_dump - dump a xlt key build info
+ * ice_xlt_kb_dump - dump a xlt key build info
  * @hw: pointer to the hardware structure
  * @kb: key build to dump
  */
@@ -180,7 +180,7 @@ struct ice_xlt_kb *ice_xlt_kb_get_fd(struct ice_hw *hw)
 }
 
 /**
- * ice_xlt_kb_get_fd - create rss xlt key build
+ * ice_xlt_kb_get_rss - create rss xlt key build
  * @hw: pointer to the hardware structure
  */
 struct ice_xlt_kb *ice_xlt_kb_get_rss(struct ice_hw *hw)
Signature · 1 line
2.43.0
#420 lore raw

PATCH v4 99/103 net/ice/base: make some functions non-static

In reply to Anatoly Burakov

To better align with base driver, make some functions non-static, and move structure definitions where necessary.

---
 drivers/net/ice/base/ice_ptp_hw.c |  4 ++--
 drivers/net/ice/base/ice_ptp_hw.h |  2 ++
 drivers/net/ice/base/ice_sched.c  |  8 +++----
 drivers/net/ice/base/ice_sched.h  | 18 ++++++++++++++++
 drivers/net/ice/base/ice_switch.c | 17 ++++++---------
 drivers/net/ice/base/ice_switch.h | 36 +++++++++++++++++++++++++++++++
 6 files changed, 68 insertions(+), 17 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +2 -2
index 88f6387cb6..b3b58f76d6 100644
@@ -171,7 +171,7 @@ ice_write_cgu_reg_e82x(struct ice_hw *hw, u16 addr, u32 val)
  *
  * Convert the specified TIME_REF clock frequency to a string.
  */
-static const char *ice_clk_freq_str(u8 clk_freq)
+const char *ice_clk_freq_str(u8 clk_freq)
 {
 	switch ((enum ice_time_ref_freq)clk_freq) {
 	case ICE_TIME_REF_FREQ_25_000:
@@ -197,7 +197,7 @@ static const char *ice_clk_freq_str(u8 clk_freq)
  *
  * Convert the specified clock source to its string name.
  */
-static const char *ice_clk_src_str(u8 clk_src)
+const char *ice_clk_src_str(u8 clk_src)
 {
 	switch ((enum ice_clk_src)clk_src) {
 	case ICE_CLK_SRC_TCX0:
drivers/net/ice/base/ice_ptp_hw.h +2 -0
index 967eed3d9d..9ce77fbe4e 100644
@@ -188,6 +188,8 @@ ice_ptp_read_phy_incval_e822(struct ice_hw *hw, u8 port, u64 *incval);
 int
 ice_ptp_read_port_capture_e822(struct ice_hw *hw, u8 port,
 			       u64 *tx_ts, u64 *rx_ts);
+const char *ice_clk_freq_str(u8 clk_freq);
+const char *ice_clk_src_str(u8 clk_src);
 void ice_ptp_reset_ts_memory_quad_e822(struct ice_hw *hw, u8 quad);
 int
 ice_cfg_cgu_pll_e822(struct ice_hw *hw, enum ice_time_ref_freq *clk_freq,
drivers/net/ice/base/ice_sched.c +4 -4
index 478260c28d..353316cd0e 100644
@@ -913,7 +913,7 @@ ice_aq_cfg_l2_node_cgd(struct ice_hw *hw, u16 num_l2_nodes,
  *
  * This function add nodes to HW as well as to SW DB for a given layer
  */
-static int
+int
 ice_sched_add_elems(struct ice_port_info *pi, struct ice_sched_node *tc_node,
 		    struct ice_sched_node *parent, u8 layer, u16 num_nodes,
 		    u16 *num_nodes_added, u32 *first_node_teid,
@@ -2277,7 +2277,7 @@ ice_sched_get_free_vsi_parent(struct ice_hw *hw, struct ice_sched_node *node,
  * This function removes the child from the old parent and adds it to a new
  * parent
  */
-static void
+void
 ice_sched_update_parent(struct ice_sched_node *new_parent,
 			struct ice_sched_node *node)
 {
@@ -2311,7 +2311,7 @@ ice_sched_update_parent(struct ice_sched_node *new_parent,
  *
  * This function move the child nodes to a given parent.
  */
-static int
+int
 ice_sched_move_nodes(struct ice_port_info *pi, struct ice_sched_node *parent,
 		     u16 num_items, u32 *list)
 {
@@ -4382,7 +4382,7 @@ ice_sched_set_node_bw_dflt(struct ice_port_info *pi,
  * node's RL profile ID of type CIR, EIR, or SRL, and removes old profile
  * ID from local database. The caller needs to hold scheduler lock.
  */
-static int
+int
 ice_sched_set_node_bw(struct ice_port_info *pi, struct ice_sched_node *node,
 		      enum ice_rl_type rl_type, u32 bw, u8 layer_num)
 {
drivers/net/ice/base/ice_sched.h +18 -0
index 51591bc6e7..0037cbf76f 100644
@@ -105,6 +105,21 @@ ice_aq_query_sched_elems(struct ice_hw *hw, u16 elems_req,
 int
 ice_sched_set_node_bw_lmt(struct ice_port_info *pi, struct ice_sched_node *node,
 			  enum ice_rl_type rl_type, u32 bw);
+
+int
+ice_sched_set_node_bw(struct ice_port_info *pi, struct ice_sched_node *node,
+		      enum ice_rl_type rl_type, u32 bw, u8 layer_num);
+
+int
+ice_sched_add_elems(struct ice_port_info *pi, struct ice_sched_node *tc_node,
+		    struct ice_sched_node *parent, u8 layer, u16 num_nodes,
+		    u16 *num_nodes_added, u32 *first_node_teid,
+		    struct ice_sched_node **prealloc_node);
+
+int
+ice_sched_move_nodes(struct ice_port_info *pi, struct ice_sched_node *parent,
+		     u16 num_items, u32 *list);
+
 int ice_sched_init_port(struct ice_port_info *pi);
 int ice_sched_query_res_alloc(struct ice_hw *hw);
 void ice_sched_get_psm_clk_freq(struct ice_hw *hw);
@@ -123,6 +138,9 @@ int
 ice_sched_add_node(struct ice_port_info *pi, u8 layer,
 		   struct ice_aqc_txsched_elem_data *info,
 		   struct ice_sched_node *prealloc_node);
+void
+ice_sched_update_parent(struct ice_sched_node *new_parent,
+			struct ice_sched_node *node);
 void ice_free_sched_node(struct ice_port_info *pi, struct ice_sched_node *node);
 struct ice_sched_node *ice_sched_get_tc_node(struct ice_port_info *pi, u8 tc);
 struct ice_sched_node *
drivers/net/ice/base/ice_switch.c +6 -11
index 5fc38a69f0..96ef26d535 100644
@@ -38,11 +38,6 @@ static const u8 dummy_eth_header[DUMMY_ETH_HDR_LEN] = { 0x2, 0, 0, 0, 0, 0,
 							0x2, 0, 0, 0, 0, 0,
 							0x81, 0, 0, 0};
 
-struct ice_dummy_pkt_offsets {
-	enum ice_protocol_type type;
-	u16 offset; /* ICE_PROTOCOL_LAST indicates end of list */
-};
-
 static const struct ice_dummy_pkt_offsets dummy_gre_tcp_packet_offsets[] = {
 	{ ICE_MAC_OFOS,		0 },
 	{ ICE_ETYPE_OL,		12 },
@@ -4742,7 +4737,7 @@ ice_find_rule_entry(struct LIST_HEAD_TYPE *list_head,
  * handle element. This can be extended further to search VSI list with more
  * than 1 vsi_count. Returns pointer to VSI list entry if found.
  */
-static struct ice_vsi_list_map_info *
+struct ice_vsi_list_map_info *
 ice_find_vsi_list_entry(struct ice_sw_recipe *recp_list, u16 vsi_handle,
 			u16 *vsi_list_id)
 {
@@ -8181,7 +8176,7 @@ bool ice_is_prof_rule(enum ice_sw_tunnel_type type)
  * @rinfo: other information regarding the rule e.g. priority and action info
  * @rid: return the recipe ID of the recipe created
  */
-static int
+int
 ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
 		   u16 lkups_cnt, struct ice_adv_rule_info *rinfo, u16 *rid)
 {
@@ -8383,7 +8378,7 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
  * @pkt_len: packet length of dummy packet
  * @offsets: pointer to receive the pointer to the offsets for the packet
  */
-static void
+void
 ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
 		      enum ice_sw_tunnel_type tun_type, const u8 **pkt,
 		      u16 *pkt_len,
@@ -8914,7 +8909,7 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
  * @pkt_len: packet length of dummy packet
  * @offsets: offset info for the dummy packet
  */
-static int
+int
 ice_fill_adv_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
 			  struct ice_sw_rule_lkup_rx_tx *s_rule,
 			  const u8 *dummy_pkt, u16 pkt_len,
@@ -9127,7 +9122,7 @@ ice_fill_adv_packet_vlan(u16 vlan_type, u8 *pkt,
  * Helper function to search for a given advance rule entry
  * Returns pointer to entry storing the rule if found
  */
-static struct ice_adv_fltr_mgmt_list_entry *
+struct ice_adv_fltr_mgmt_list_entry *
 ice_find_adv_rule_entry(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
 			u16 lkups_cnt, u16 recp_id,
 			struct ice_adv_rule_info *rinfo)
@@ -9178,7 +9173,7 @@ ice_find_adv_rule_entry(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
  *		Add the new VSI to the previously created VSI list set
  *		using the update switch rule command
  */
-static int
+int
 ice_adv_add_update_vsi_list(struct ice_hw *hw,
 			    struct ice_adv_fltr_mgmt_list_entry *m_entry,
 			    struct ice_adv_rule_info *cur_fltr,
drivers/net/ice/base/ice_switch.h +36 -0
index 6bec3cb0b9..00bffe4e4e 100644
@@ -438,6 +438,42 @@ enum ice_promisc_flags {
 	ICE_PROMISC_MAX,
 };
 
+struct ice_dummy_pkt_offsets {
+	enum ice_protocol_type type;
+	u16 offset; /* ICE_PROTOCOL_LAST indicates end of list */
+};
+
+void
+ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
+		      enum ice_sw_tunnel_type tun_type, const u8 **pkt,
+		      u16 *pkt_len,
+		      const struct ice_dummy_pkt_offsets **offsets);
+
+int
+ice_fill_adv_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
+			  struct ice_sw_rule_lkup_rx_tx *s_rule,
+			  const u8 *dummy_pkt, u16 pkt_len,
+			  const struct ice_dummy_pkt_offsets *offsets);
+
+int
+ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
+		   u16 lkups_cnt, struct ice_adv_rule_info *rinfo, u16 *rid);
+
+struct ice_adv_fltr_mgmt_list_entry *
+ice_find_adv_rule_entry(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
+			u16 lkups_cnt, u16 recp_id,
+			struct ice_adv_rule_info *rinfo);
+
+int
+ice_adv_add_update_vsi_list(struct ice_hw *hw,
+			    struct ice_adv_fltr_mgmt_list_entry *m_entry,
+			    struct ice_adv_rule_info *cur_fltr,
+			    struct ice_adv_rule_info *new_fltr);
+
+struct ice_vsi_list_map_info *
+ice_find_vsi_list_entry(struct ice_sw_recipe *recp_list, u16 vsi_handle,
+			u16 *vsi_list_id);
+
 /* VSI related commands */
 int
 ice_aq_add_vsi(struct ice_hw *hw, struct ice_vsi_ctx *vsi_ctx,
Signature · 1 line
2.43.0
#421 lore raw

PATCH v4 100/103 net/ice/base: make some functions static

In reply to Anatoly Burakov

To better align with upstream release, remove some functions from switch header and make them static instead.

---
 drivers/net/ice/base/ice_ptp_hw.c | 14 +++++++-------
 drivers/net/ice/base/ice_ptp_hw.h | 16 ----------------
 2 files changed, 7 insertions(+), 23 deletions(-)
drivers/net/ice/base/ice_ptp_hw.c +7 -7
index b3b58f76d6..004f659eae 100644
@@ -3412,7 +3412,7 @@ ice_ptp_read_port_capture_e822(struct ice_hw *hw, u8 port, u64 *tx_ts,
  * Note there is no equivalent of this operation on E810, as that device
  * always handles all external PHYs internally.
  */
-int
+static int
 ice_ptp_write_port_cmd_e822(struct ice_hw *hw, u8 port,
 			    enum ice_ptp_tmr_cmd cmd, bool lock_sbq)
 {
@@ -5072,8 +5072,8 @@ ice_ptp_prep_phy_adj_target_e810(struct ice_hw *hw, u32 target_time)
  * Prepare the external PHYs connected to this device for a timer sync
  * command.
  */
-int ice_ptp_port_cmd_e810(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd,
-			  bool lock_sbq)
+static int ice_ptp_port_cmd_e810(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd,
+				 bool lock_sbq)
 {
 	u32 val = ice_ptp_tmr_cmd_to_port_reg(hw, cmd);
 	int err;
@@ -5516,7 +5516,7 @@ ice_ptp_write_direct_phc_time_e830(struct ice_hw *hw, u64 time)
  * Prepare the external PHYs connected to this device for a timer sync
  * command.
  */
-int
+static int
 ice_ptp_port_cmd_e830(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd,
 		      bool lock_sbq)
 {
@@ -5565,7 +5565,7 @@ ice_read_phy_tstamp_e830(struct ice_hw *hw, u8 lport, u8 idx, u64 *tstamp)
  * @tstamp_ready: contents of the Tx memory status register
  *
  */
-int
+static int
 ice_get_phy_tx_tstamp_ready_e830(struct ice_hw *hw, u8 port, u64 *tstamp_ready)
 {
 	u64 hi;
@@ -5711,8 +5711,8 @@ void ice_ptp_init_phy_model(struct ice_hw *hw)
  * programming only a single port, instead use ice_ptp_one_port_cmd() to
  * ensure non-modified ports get properly initialized to ICE_PTP_NOP.
  */
-int ice_ptp_write_port_cmd(struct ice_hw *hw, u8 port,
-			   enum ice_ptp_tmr_cmd cmd, bool lock_sbq)
+static int ice_ptp_write_port_cmd(struct ice_hw *hw, u8 port,
+				  enum ice_ptp_tmr_cmd cmd, bool lock_sbq)
 {
 	switch (hw->phy_model) {
 	case ICE_PHY_ETH56G:
drivers/net/ice/base/ice_ptp_hw.h +0 -16
index 9ce77fbe4e..9357dfd327 100644
@@ -195,12 +195,6 @@ int
 ice_cfg_cgu_pll_e822(struct ice_hw *hw, enum ice_time_ref_freq *clk_freq,
 		     enum ice_clk_src *clk_src);
 int
-ice_ptp_write_port_cmd_e822(struct ice_hw *hw, u8 port,
-			    enum ice_ptp_tmr_cmd cmd, bool lock_sbq);
-int
-ice_ptp_write_port_cmd(struct ice_hw *hw, u8 port, enum ice_ptp_tmr_cmd cmd,
-		       bool lock_sbq);
-int
 ice_cfg_cgu_pll_e825c(struct ice_hw *hw, enum ice_time_ref_freq *clk_freq,
 		      enum ice_clk_src *clk_src);
 int
@@ -213,16 +207,6 @@ ice_cfg_cgu_bypass_mux_e825c(struct ice_hw *hw, u8 port_num, bool clock_1588,
 			     unsigned int ena);
 int ice_cfg_synce_ethdiv_e825c(struct ice_hw *hw, u8 *divider);
 
-/* E8 Family */
-int
-ice_ptp_port_cmd_e830(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd,
-		      bool lock_sbq);
-int
-ice_ptp_port_cmd_e810(struct ice_hw *hw, enum ice_ptp_tmr_cmd cmd,
-		      bool lock_sbq);
-int
-ice_get_phy_tx_tstamp_ready_e830(struct ice_hw *hw, u8 port, u64 *tstamp_ready);
-
 /**
  * ice_e822_time_ref - Get the current TIME_REF from capabilities
  * @hw: pointer to the HW structure
Signature · 1 line
2.43.0
#422 lore raw

PATCH v4 101/103 net/ice/base: introduce new functions in ice_sched_node

In reply to Anatoly Burakov

From: Michal Wilczynski <[email protected]>

Add new functions to configure the hardware with new parameters.

---
 drivers/net/ice/base/ice_sched.c | 52 ++++++++++++++++++++++++++++++++
 drivers/net/ice/base/ice_sched.h |  9 ++++++
 2 files changed, 61 insertions(+)
drivers/net/ice/base/ice_sched.c +52 -0
index 353316cd0e..373c32a518 100644
@@ -4418,6 +4418,58 @@ ice_sched_set_node_bw(struct ice_port_info *pi, struct ice_sched_node *node,
 				       ICE_AQC_RL_PROFILE_TYPE_M, old_id);
 }
 
+/**
+ * ice_sched_set_node_priority - set node's priority
+ * @pi: port information structure
+ * @node: tree node
+ * @priority: number 0-7 representing priority among siblings
+ *
+ * This function sets priority of a node among it's siblings.
+ */
+int
+ice_sched_set_node_priority(struct ice_port_info *pi, struct ice_sched_node *node,
+			    u16 priority)
+{
+	struct ice_aqc_txsched_elem_data buf;
+	struct ice_aqc_txsched_elem *data;
+
+	buf = node->info;
+	data = &buf.data;
+
+	data->valid_sections |= ICE_AQC_ELEM_VALID_GENERIC;
+	data->generic |= ICE_AQC_ELEM_GENERIC_PRIO_M &
+			 (priority << ICE_AQC_ELEM_GENERIC_PRIO_S);
+
+	return ice_sched_update_elem(pi->hw, node, &buf);
+}
+
+/**
+ * ice_sched_set_node_weight - set node's weight
+ * @pi: port information structure
+ * @node: tree node
+ * @weight: number 1-200 representing weight for WFQ
+ *
+ * This function sets weight of the node for WFQ algorithm.
+ */
+int
+ice_sched_set_node_weight(struct ice_port_info *pi, struct ice_sched_node *node, u16 weight)
+{
+	struct ice_aqc_txsched_elem_data buf;
+	struct ice_aqc_txsched_elem *data;
+
+	buf = node->info;
+	data = &buf.data;
+
+	data->valid_sections = ICE_AQC_ELEM_VALID_CIR | ICE_AQC_ELEM_VALID_EIR |
+			       ICE_AQC_ELEM_VALID_GENERIC;
+	data->cir_bw.bw_alloc = CPU_TO_LE16(weight);
+	data->eir_bw.bw_alloc = CPU_TO_LE16(weight);
+	data->generic |= ICE_AQC_ELEM_GENERIC_SP_M &
+			 (0x0 << ICE_AQC_ELEM_GENERIC_SP_S);
+
+	return ice_sched_update_elem(pi->hw, node, &buf);
+}
+
 /**
  * ice_sched_set_node_bw_lmt - set node's BW limit
  * @pi: port information structure
drivers/net/ice/base/ice_sched.h +9 -0
index 0037cbf76f..9f78516dfb 100644
@@ -7,6 +7,8 @@
 
 #include "ice_common.h"
 
+#define SCHED_NODE_NAME_MAX_LEN 32
+
 #define ICE_SCHED_5_LAYERS	5
 #define ICE_SCHED_9_LAYERS	9
 
@@ -120,6 +122,13 @@ int
 ice_sched_move_nodes(struct ice_port_info *pi, struct ice_sched_node *parent,
 		     u16 num_items, u32 *list);
 
+int
+ice_sched_set_node_priority(struct ice_port_info *pi, struct ice_sched_node *node,
+			    u16 priority);
+int
+ice_sched_set_node_weight(struct ice_port_info *pi, struct ice_sched_node *node,
+			  u16 weight);
+
 int ice_sched_init_port(struct ice_port_info *pi);
 int ice_sched_query_res_alloc(struct ice_hw *hw);
 void ice_sched_get_psm_clk_freq(struct ice_hw *hw);
Signature · 1 line
2.43.0
#423 lore raw

PATCH v4 102/103 net/ice/base: add missing files for shared code update

In reply to Anatoly Burakov

From: Ian Stokes <[email protected]>

Add missing files that are present in shared code update. Although these do not contain code add them so that shared code update matches like for like.

---
 drivers/net/ice/base/ice_fwlog.c                             | 5 +++++
 .../{vmxnet3/base/vmware_pack_end.h => ice/base/ice_fwlog.h} | 2 +-
 .../base/vmware_pack_end.h => ice/base/ice_vf_mbx.c}         | 2 +-
 .../base/vmware_pack_end.h => ice/base/ice_vf_mbx.h}         | 2 +-
 drivers/net/ice/base/meson.build                             | 2 ++
 5 files changed, 10 insertions(+), 3 deletions(-)
 create mode 100644 drivers/net/ice/base/ice_fwlog.c
 copy drivers/net/{vmxnet3/base/vmware_pack_end.h => ice/base/ice_fwlog.h} (50%)
 copy drivers/net/{vmxnet3/base/vmware_pack_end.h => ice/base/ice_vf_mbx.c} (50%)
 copy drivers/net/{vmxnet3/base/vmware_pack_end.h => ice/base/ice_vf_mbx.h} (50%)
drivers/net/ice/base/ice_fwlog.c new file +5 -0
new file mode 100644
index 0000000000..a285ff3c66
@@ -0,0 +1,5 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2001-2023 Intel Corporation
+ */
+
+#include "ice_osdep.h"
drivers/net/ice/base/ice_fwlog.h renamed from drivers/net/vmxnet3/base/vmware_pack_end.h +1 -1
similarity index 50%
copy from drivers/net/vmxnet3/base/vmware_pack_end.h
copy to drivers/net/ice/base/ice_fwlog.h
index df22590f82..220da416ec 100644
@@ -1,3 +1,3 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2010-2014 Intel Corporation
+ * Copyright(c) 2001-2023 Intel Corporation
  */
drivers/net/ice/base/ice_vf_mbx.c renamed from drivers/net/vmxnet3/base/vmware_pack_end.h +1 -1
similarity index 50%
copy from drivers/net/vmxnet3/base/vmware_pack_end.h
copy to drivers/net/ice/base/ice_vf_mbx.c
index df22590f82..220da416ec 100644
@@ -1,3 +1,3 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2010-2014 Intel Corporation
+ * Copyright(c) 2001-2023 Intel Corporation
  */
drivers/net/ice/base/ice_vf_mbx.h renamed from drivers/net/vmxnet3/base/vmware_pack_end.h +1 -1
similarity index 50%
copy from drivers/net/vmxnet3/base/vmware_pack_end.h
copy to drivers/net/ice/base/ice_vf_mbx.h
index df22590f82..220da416ec 100644
@@ -1,3 +1,3 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2010-2014 Intel Corporation
+ * Copyright(c) 2001-2023 Intel Corporation
  */
drivers/net/ice/base/meson.build +2 -0
index 41ed2d96c6..38ddde9e8c 100644
@@ -27,6 +27,8 @@ sources = [
         'ice_xlt_kb.c',
         'ice_parser_rt.c',
         'ice_ddp.c',
+        'ice_fwlog.c',
+        'ice_vf_mbx.c',
 ]
 
 error_cflags = [
Signature · 1 line
2.43.0
#424 lore raw

PATCH v4 103/103 net/ice: add new device ids

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

Add new device ids for latest gen NICs.

---
 drivers/net/ice/ice_ethdev.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/ice/ice_ethdev.c +9 -0
index dbdcacf019..f7189b2dfe 100644
@@ -217,6 +217,15 @@ static const struct rte_pci_id pci_id_ice_map[] = {
 	{ RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E825C_SFP) },
 	{ RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_C825X) },
 	{ RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E825C_SGMII) },
+	{ RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_BACKPLANE) },
+	{ RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_QSFP56) },
+	{ RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_SFP) },
+	{ RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830C_BACKPLANE) },
+	{ RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_XXV_BACKPLANE) },
+	{ RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830C_QSFP) },
+	{ RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_XXV_QSFP) },
+	{ RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830C_SFP) },
+	{ RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_XXV_SFP) },
 	{ .vendor_id = 0, /* sentinel */ },
 };
 
Signature · 1 line
2.43.0
#425 lore raw

Re: [PATCH v4 000/103] Update net/ice base driver to latest upstream snapshot

In reply to Anatoly Burakov
Quoted 4 lines · Anatoly Burakov

This is a patchset loosely based on internal development tree which tracked ICE driver development over a period of time since last snapshot update.

Quoted 9 lines

v3-> v4:
- Rebased on top of latest next-net-intel as some patches were already merged
- Addressed review comments that were added to v2 after work on v3 was finished
- Clarified and corrected more commit messages
- Split most of the "squash a few fixes together" style patches
- Moved around and squashed a few changes that felt better together
- Merged all of the "update style to match upstream" style patches into one big patch
- Moved all style patches to the end of the patchset

As mentioned on v3, will be applying this patchset in stages.

Patches 1-25 acked and applied to dpdk-next-net-intel with minor adjustments:
* commit log (mainly title) updates
* added some fixes tags where appropriate
* added missing mailmap entries.

Thanks,
/Bruce

#426 lore raw

Re: [PATCH v4 000/103] Update net/ice base driver to latest upstream snapshot

Quoted 14 lines · Bruce Richardson
Quoted 4 lines · Anatoly Burakov

This is a patchset loosely based on internal development tree which tracked ICE driver development over a period of time since last snapshot update.

Quoted 9 lines

v3-> v4:
- Rebased on top of latest next-net-intel as some patches were already merged
- Addressed review comments that were added to v2 after work on v3 was finished
- Clarified and corrected more commit messages
- Split most of the "squash a few fixes together" style patches
- Moved around and squashed a few changes that felt better together
- Merged all of the "update style to match upstream" style patches into one big patch
- Moved all style patches to the end of the patchset

Quoted 7 lines

As mentioned on v3, will be applying this patchset in stages.

Patches 1-25 acked and applied to dpdk-next-net-intel with minor adjustments:
* commit log (mainly title) updates
* added some fixes tags where appropriate
* added missing mailmap entries.

Patches 1-62 now acked and merged as above.

Thanks,
/Bruce

#427 lore raw

Re: [PATCH v4 000/103] Update net/ice base driver to latest upstream snapshot

In reply to Bruce Richardson
Quoted 14 lines · Bruce Richardson
Quoted 4 lines · Anatoly Burakov

This is a patchset loosely based on internal development tree which tracked ICE driver development over a period of time since last snapshot update.

Quoted 9 lines

v3-> v4:
- Rebased on top of latest next-net-intel as some patches were already merged
- Addressed review comments that were added to v2 after work on v3 was finished
- Clarified and corrected more commit messages
- Split most of the "squash a few fixes together" style patches
- Moved around and squashed a few changes that felt better together
- Merged all of the "update style to match upstream" style patches into one big patch
- Moved all style patches to the end of the patchset

Quoted 7 lines

As mentioned on v3, will be applying this patchset in stages.

Patches 1-25 acked and applied to dpdk-next-net-intel with minor adjustments:
* commit log (mainly title) updates
* added some fixes tags where appropriate
* added missing mailmap entries.

All patches in this set now merged to dpdk-next-net-intel with minor fixups. Thanks Anatoly and Ian for all the work preparing this mammoth patchset.

/Bruce