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 D87E6454EF; Tue, 25 Jun 2024 13:26:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A1DCA43295; Tue, 25 Jun 2024 13:18:46 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by mails.dpdk.org (Postfix) with ESMTP id 6DBC042E8F for ; Tue, 25 Jun 2024 13:17:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719314245; x=1750850245; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BVMj89gflP4a94x7fV32mVRukfTQutTXQwvacNXwv8E=; b=HAB1pPQiKHd8YRHCjl65BJibtFFhWvVNXtxjkofOToLOjyZ3mjJhYJXY QYVNsmQpPCzkE0UfQT7A8Xy4n1u80Qt4buVaha0RC0jSlxQ/MDX3eGdLC 0hPdukES9UFTQK5W3iTtQUJvZVIJtIFJTfjjR3C6znwfxmyGwZkAsH+X1 2Vd+W+Q1y35XmmPYDhDEqd1UdGAgIczzAFr7typ7k7QWQGztlA+2wGZES ReqVQyQ5DLAIZx9iXyKsy/sLJxCzbHlxLlT8nK8+xFWDeLo4p5qysnKbA Fnpesi9jNVW5kduT+mLj87eJcd8qc/C1MFodwF3qrSxXcKjESoV8U16D2 g==; X-CSE-ConnectionGUID: w/Gl+vs4T6WKlTrdir6NUA== X-CSE-MsgGUID: y5SX1ub9TC2f0RxiYfgpWQ== X-IronPort-AV: E=McAfee;i="6700,10204,11113"; a="16080451" X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="16080451" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2024 04:17:25 -0700 X-CSE-ConnectionGUID: ien/lE1bSLS2//7cBRtEUg== X-CSE-MsgGUID: VMafsFilRGiLG1oSlFA/SA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="43719565" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 25 Jun 2024 04:17:24 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Aviraj CJ , bruce.richardson@intel.com, ian.stokes@intel.com Subject: [PATCH v3 091/129] net/ice/base: allow passing flags to sbq command Date: Tue, 25 Jun 2024 12:13:36 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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: Aviraj CJ 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. 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 ea1ff6b0ea..ccf5b341ef 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -1767,11 +1767,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}; @@ -1795,7 +1796,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) @@ -1813,10 +1814,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 d06742aa77..2f1b212812 100644 --- a/drivers/net/ice/base/ice_common.h +++ b/drivers/net/ice/base/ice_common.h @@ -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, diff --git a/drivers/net/ice/base/ice_ptp_hw.c b/drivers/net/ice/base/ice_ptp_hw.c index 1d8c758808..9de5c1caaf 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); @@ -4709,7 +4709,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); @@ -4747,7 +4747,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