From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E5B1F4404F; Wed, 12 Jun 2024 17:21:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BCE0142FC7; Wed, 12 Jun 2024 17:06:22 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id B4F9C42FBD for ; Wed, 12 Jun 2024 17:06:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718204781; x=1749740781; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=t2qZI78IRui0JeLS9sCuv2V99ho4Yy31fT5+fUp3i7k=; b=exkzhA1mZlmUwBJEJKWrHSIuTK0OL9wprrw1g7r4jCYoX3DkLobP6M8H O6rX1i8tRYhyhsRL38UpBYbfvG2sR0BzktvpPR8Mm67TdR1lGjzf/34WV PTL9y2Iwkq2AoV6VZj0gg1hEf+jwrWqrEFCSVjCt7jrF9oieuvSiIX0S6 QTlyPoq2TOtZuaXwY6HpbVaU/bEDYk0+EBpm8SYFAhiXCHeYq3RnSr1uh lw1bQXEuNjI0ChWJeQJhCw/Xlm4COyX3jsrhr1kiIEjE3sseH7G/Gm7/Z aEVQS2e6GjlK/sAl4fdI0QJUbEhsstWmR9trtRm724AbchqON+/vJUALe g==; X-CSE-ConnectionGUID: Oj7v3ZVUTTS19qdOvI+SkA== X-CSE-MsgGUID: 7pbGDdWyRmKqEuewjD044g== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="32459939" X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="32459939" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 08:06:20 -0700 X-CSE-ConnectionGUID: +PqXI/RNQBm8LY1jdscxtQ== X-CSE-MsgGUID: t30RxBsrQX+/RXniaHyHlw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="39925868" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 12 Jun 2024 08:06:19 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Ian Stokes , bruce.richardson@intel.com, Aviraj CJ Subject: [PATCH v2 111/148] net/ice/base: add PHY statistics dump Date: Wed, 12 Jun 2024 16:01:45 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20240430154014.1026-1-ian.stokes@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Ian Stokes Added support to dump PHY registers for assisting field debugging of link issue, these registers include FEC correctable uncorrectable statistics dump. Signed-off-by: Aviraj CJ Signed-off-by: Ian Stokes --- 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(-) diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c index bd808cca6b..cb468a2252 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -1672,11 +1672,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}; @@ -1700,7 +1701,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) @@ -1718,10 +1719,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); } /** diff --git a/drivers/net/ice/base/ice_common.h b/drivers/net/ice/base/ice_common.h index dfd7e6511d..afd1091289 100644 --- a/drivers/net/ice/base/ice_common.h +++ b/drivers/net/ice/base/ice_common.h @@ -247,11 +247,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, diff --git a/drivers/net/ice/base/ice_ptp_hw.c b/drivers/net/ice/base/ice_ptp_hw.c index 54eb2953be..7413fc891f 100644 --- a/drivers/net/ice/base/ice_ptp_hw.c +++ b/drivers/net/ice/base/ice_ptp_hw.c @@ -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", @@ -2539,7 +2539,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); @@ -2672,7 +2672,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); @@ -2836,7 +2836,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); @@ -2879,7 +2879,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); @@ -4722,7 +4722,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); @@ -4760,7 +4760,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); -- 2.43.0