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 0A3E645895; Thu, 29 Aug 2024 11:00:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7863942D78; Thu, 29 Aug 2024 11:00:35 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) by mails.dpdk.org (Postfix) with ESMTP id 6E23842D45 for ; Thu, 29 Aug 2024 11:00:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724922032; x=1756458032; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=cKl2YClmzHt2vDw4x40MzyvgInriEvStlSFv5/ZzPn8=; b=XgpBYM7ZVbLeNMU8vQMMayTO6+doBWtGIX5KFttWPlquut/kxxG5X8vH sORQx5H+JcMY49i2Ny9YvKaIeT86MPzIsMUx6DbQeZ4B0oqHWaYEu0UUt s98cxQOhot6ifF4hagXZ2AWXvAjYXXki8qgbl0TNppXa27bMNMAaAvv1T OFKd3W4B3V95d9SRueyfDXmhu4GFhae/mLMRw1hoIgLb6OJCDP0dMyaIN /+4GrKMVYJpqQCatDpr1LierIBqWKJe1Dwkg2z4GN5S+VHTH5eMQtY/Pp gczn58+KkOk0sk6Btu/NmTXGx5yfNNg4mte7XuR0GSu4oE/leBpsET3yU Q==; X-CSE-ConnectionGUID: EJa+ZSSaRJCbcQpOuony+w== X-CSE-MsgGUID: MLdMv3tYSN60/VYWah2n+w== X-IronPort-AV: E=McAfee;i="6700,10204,11178"; a="23663425" X-IronPort-AV: E=Sophos;i="6.10,185,1719903600"; d="scan'208";a="23663425" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2024 02:00:31 -0700 X-CSE-ConnectionGUID: Kb9sfTe+QiCSe53DyqFIBw== X-CSE-MsgGUID: L3VPF37UQjyTehyYW1jLYg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,185,1719903600"; d="scan'208";a="64202943" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa008.jf.intel.com with ESMTP; 29 Aug 2024 02:00:30 -0700 From: Anatoly Burakov To: dev@dpdk.org, Jakub Chylkowski , Alice Michael , Piotr Pietruszewski Subject: [PATCH v1 04/15] net/ixgbe/base: add missing legacy mailbox API Date: Thu, 29 Aug 2024 10:00:09 +0100 Message-ID: <8bde577b60c97b4c9a13f5d353831373d7c705d9.1724921977.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.5 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 When the new mailbox API was introduced, the legacy mailbox API was also provided, but was missing from the patches due to the way the patches were generated. This patch adds the missing legacy mailbox API to the driver. Fixes: 6d243d2caf2c ("net/ixgbe/base: introduce new mailbox API") Signed-off-by: Anatoly Burakov --- drivers/net/ixgbe/base/ixgbe_mbx.c | 44 ++++++++++++++++++++++++++++++ drivers/net/ixgbe/base/ixgbe_mbx.h | 1 + 2 files changed, 45 insertions(+) diff --git a/drivers/net/ixgbe/base/ixgbe_mbx.c b/drivers/net/ixgbe/base/ixgbe_mbx.c index 444a0d339d..23659266d0 100644 --- a/drivers/net/ixgbe/base/ixgbe_mbx.c +++ b/drivers/net/ixgbe/base/ixgbe_mbx.c @@ -169,6 +169,26 @@ s32 ixgbe_check_for_rst(struct ixgbe_hw *hw, u16 mbx_id) return ret_val; } +/** + * ixgbe_clear_mbx - Clear Mailbox Memory + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to write + * + * Set VFMBMEM of given VF to 0x0. + **/ +s32 ixgbe_clear_mbx(struct ixgbe_hw *hw, u16 mbx_id) +{ + struct ixgbe_mbx_info *mbx = &hw->mbx; + s32 ret_val = IXGBE_ERR_CONFIG; + + DEBUGFUNC("ixgbe_clear_mbx"); + + if (mbx->ops[mbx_id].clear) + ret_val = mbx->ops[mbx_id].clear(hw, mbx_id); + + return ret_val; +} + /** * ixgbe_poll_for_msg - Wait for message notification * @hw: pointer to the HW structure @@ -628,6 +648,7 @@ void ixgbe_init_mbx_params_vf(struct ixgbe_hw *hw) mbx->ops[0].check_for_msg = ixgbe_check_for_msg_vf; mbx->ops[0].check_for_ack = ixgbe_check_for_ack_vf; mbx->ops[0].check_for_rst = ixgbe_check_for_rst_vf; + mbx->ops[0].clear = NULL; mbx->stats.msgs_tx = 0; mbx->stats.msgs_rx = 0; @@ -1024,6 +1045,27 @@ STATIC s32 ixgbe_read_mbx_pf(struct ixgbe_hw *hw, u32 *msg, u16 size, return IXGBE_SUCCESS; } +/** + * ixgbe_clear_mbx_pf - Clear Mailbox Memory + * @hw: pointer to the HW structure + * @vf_id: the VF index + * + * Set VFMBMEM of given VF to 0x0. + **/ +STATIC s32 ixgbe_clear_mbx_pf(struct ixgbe_hw *hw, u16 vf_id) +{ + u16 mbx_size = hw->mbx.size; + u16 i; + + if (vf_id > 63) + return IXGBE_ERR_PARAM; + + for (i = 0; i < mbx_size; ++i) + IXGBE_WRITE_REG_ARRAY(hw, IXGBE_PFMBMEM(vf_id), i, 0x0); + + return IXGBE_SUCCESS; +} + /** * ixgbe_init_mbx_params_pf_id - set initial values for pf mailbox * @hw: pointer to the HW structure @@ -1042,6 +1084,7 @@ void ixgbe_init_mbx_params_pf_id(struct ixgbe_hw *hw, u16 vf_id) mbx->ops[vf_id].check_for_msg = ixgbe_check_for_msg_pf; mbx->ops[vf_id].check_for_ack = ixgbe_check_for_ack_pf; mbx->ops[vf_id].check_for_rst = ixgbe_check_for_rst_pf; + mbx->ops[vf_id].clear = ixgbe_clear_mbx_pf; } /** @@ -1119,6 +1162,7 @@ void ixgbe_upgrade_mbx_params_pf(struct ixgbe_hw *hw, u16 vf_id) mbx->ops[vf_id].check_for_msg = ixgbe_check_for_msg_pf; mbx->ops[vf_id].check_for_ack = ixgbe_check_for_ack_pf; mbx->ops[vf_id].check_for_rst = ixgbe_check_for_rst_pf; + mbx->ops[vf_id].clear = ixgbe_clear_mbx_pf; mbx->stats.msgs_tx = 0; mbx->stats.msgs_rx = 0; diff --git a/drivers/net/ixgbe/base/ixgbe_mbx.h b/drivers/net/ixgbe/base/ixgbe_mbx.h index 56ab435286..434f7c6a69 100644 --- a/drivers/net/ixgbe/base/ixgbe_mbx.h +++ b/drivers/net/ixgbe/base/ixgbe_mbx.h @@ -168,6 +168,7 @@ s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id); s32 ixgbe_check_for_msg(struct ixgbe_hw *hw, u16 mbx_id); s32 ixgbe_check_for_ack(struct ixgbe_hw *hw, u16 mbx_id); s32 ixgbe_check_for_rst(struct ixgbe_hw *hw, u16 mbx_id); +s32 ixgbe_clear_mbx(struct ixgbe_hw *hw, u16 vf_number); void ixgbe_init_mbx_params_vf(struct ixgbe_hw *hw); void ixgbe_upgrade_mbx_params_vf(struct ixgbe_hw *hw); void ixgbe_init_mbx_params_pf(struct ixgbe_hw *hw); -- 2.43.5