DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Mody, Rasesh" <Rasesh.Mody@cavium.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Cc: "Mody, Rasesh" <Rasesh.Mody@cavium.com>,
	"ferruh.yigit@intel.com" <ferruh.yigit@intel.com>,
	Dept-Eng DPDK Dev <Dept-EngDPDKDev@cavium.com>
Subject: [dpdk-dev] [PATCH 05/18] net/qede/base: add API to update FW RSS indirection table
Date: Sat, 29 Sep 2018 08:14:30 +0000	[thread overview]
Message-ID: <1538208822-9726-6-git-send-email-rasesh.mody@cavium.com> (raw)
In-Reply-To: <1538208822-9726-1-git-send-email-rasesh.mody@cavium.com>

Added ecore_update_eth_rss_ind_table_entry() api to update FW RSS
indirection table entry according to new interface of FW 8.37.x.x.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
 drivers/net/qede/base/ecore_l2.c     |   52 ++++++++++++++++++++++++++++++++++
 drivers/net/qede/base/ecore_l2_api.h |   24 ++++++++++++++++
 2 files changed, 76 insertions(+)

diff --git a/drivers/net/qede/base/ecore_l2.c b/drivers/net/qede/base/ecore_l2.c
index ec40aac..d87ffda 100644
--- a/drivers/net/qede/base/ecore_l2.c
+++ b/drivers/net/qede/base/ecore_l2.c
@@ -2323,3 +2323,55 @@ enum _ecore_status_t
 	return ecore_init_vport_rl(p_hwfn, p_ptt, vport, rate,
 				   p_link->speed);
 }
+
+#define RSS_TSTORM_UPDATE_STATUS_MAX_POLL_COUNT    100
+#define RSS_TSTORM_UPDATE_STATUS_POLL_PERIOD_US    1
+
+enum _ecore_status_t
+ecore_update_eth_rss_ind_table_entry(struct ecore_hwfn *p_hwfn,
+				     u8 vport_id,
+				     u8 ind_table_index,
+				     u16 ind_table_value)
+{
+	struct eth_tstorm_rss_update_data update_data = { 0 };
+	void OSAL_IOMEM *addr = OSAL_NULL;
+	enum _ecore_status_t rc;
+	u8 abs_vport_id;
+	u32 cnt = 0;
+
+	OSAL_BUILD_BUG_ON(sizeof(update_data) != sizeof(u64));
+
+	rc = ecore_fw_vport(p_hwfn, vport_id, &abs_vport_id);
+	if (rc != ECORE_SUCCESS)
+		return rc;
+
+	addr = (u8 OSAL_IOMEM *)p_hwfn->regview +
+	       GTT_BAR0_MAP_REG_TSDM_RAM +
+	       TSTORM_ETH_RSS_UPDATE_OFFSET(p_hwfn->rel_pf_id);
+
+	*(u64 *)(&update_data) = DIRECT_REG_RD64(p_hwfn, addr);
+
+	for (cnt = 0; update_data.valid &&
+	     cnt < RSS_TSTORM_UPDATE_STATUS_MAX_POLL_COUNT; cnt++) {
+		OSAL_UDELAY(RSS_TSTORM_UPDATE_STATUS_POLL_PERIOD_US);
+		*(u64 *)(&update_data) = DIRECT_REG_RD64(p_hwfn, addr);
+	}
+
+	if (update_data.valid) {
+		DP_NOTICE(p_hwfn, true,
+			  "rss update valid status is not clear! valid=0x%x vport id=%d ind_Table_idx=%d ind_table_value=%d.\n",
+			  update_data.valid, vport_id, ind_table_index,
+			  ind_table_value);
+
+		return ECORE_AGAIN;
+	}
+
+	update_data.valid	    = 1;
+	update_data.ind_table_index = ind_table_index;
+	update_data.ind_table_value = ind_table_value;
+	update_data.vport_id	    = abs_vport_id;
+
+	DIRECT_REG_WR64(p_hwfn, addr, *(u64 *)(&update_data));
+
+	return ECORE_SUCCESS;
+}
diff --git a/drivers/net/qede/base/ecore_l2_api.h b/drivers/net/qede/base/ecore_l2_api.h
index bde825c..21595f3 100644
--- a/drivers/net/qede/base/ecore_l2_api.h
+++ b/drivers/net/qede/base/ecore_l2_api.h
@@ -470,4 +470,28 @@ enum _ecore_status_t
 				  dma_addr_t p_addr, u16 length,
 				  u16 qid, u8 vport_id,
 				  bool b_is_add);
+
+/**
+ * @brief - ecore_update_eth_rss_ind_table_entry
+ *
+ * This function being used to update RSS indirection table entry to FW RAM
+ * instead of using the SP vport update ramrod with rss params.
+ *
+ * Notice:
+ * This function supports only one outstanding command per engine. Ecore
+ * clients which use this function should call ecore_mcp_ind_table_lock() prior
+ * to it and ecore_mcp_ind_table_unlock() after it.
+ *
+ * @params p_hwfn
+ * @params vport_id
+ * @params ind_table_index
+ * @params ind_table_value
+ *
+ * @return enum _ecore_status_t
+ */
+enum _ecore_status_t
+ecore_update_eth_rss_ind_table_entry(struct ecore_hwfn *p_hwfn,
+				     u8 vport_id,
+				     u8 ind_table_index,
+				     u16 ind_table_value);
 #endif
-- 
1.7.10.3

  parent reply	other threads:[~2018-09-29  8:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-29  8:13 [dpdk-dev] [PATCH 00/18] net/qede: base driver update Mody, Rasesh
2018-09-29  8:14 ` [dpdk-dev] [PATCH 01/18] net/qede/base: upgrade to FW 8.37.7.0 Mody, Rasesh
2018-09-29  8:14 ` [dpdk-dev] [PATCH 02/18] net/qede/base: check for EDPM enabled in DB recovery Mody, Rasesh
2018-09-29  8:14 ` [dpdk-dev] [PATCH 03/18] net/qede/base: add DPC sync after PF stop Mody, Rasesh
2018-09-29  8:14 ` [dpdk-dev] [PATCH 04/18] net/qede/base: workaround to indicate SHMEM data ready Mody, Rasesh
2018-09-29  8:14 ` [dpdk-dev] [PATCH 06/18] net/qede/base: add mf-bit/API for FIP special mode Mody, Rasesh
2018-09-29  8:14 ` Mody, Rasesh [this message]
2018-09-29  8:14 ` [dpdk-dev] [PATCH 07/18] net/qede/base: add error handling for mutex allocation Mody, Rasesh
2018-09-29  8:14 ` [dpdk-dev] [PATCH 08/18] net/qede/base: adjust queue manager idx greater than max Mody, Rasesh
2018-09-29  8:14 ` [dpdk-dev] [PATCH 09/18] net/qede/base: add pretend function for port/PF Mody, Rasesh
2018-09-29  8:14 ` [dpdk-dev] [PATCH 11/18] net/qede/base: add periodic Doorbell Recovery support Mody, Rasesh
2018-09-29  8:14 ` [dpdk-dev] [PATCH 12/18] net/qede/base: get pre-negotiated OEM values Mody, Rasesh
2018-09-29  8:14 ` [dpdk-dev] [PATCH 10/18] net/qede/base: add support for SRIOV VF min rate Mody, Rasesh
2018-09-29  8:14 ` [dpdk-dev] [PATCH 13/18] net/qede/base: enable control frame filtering Mody, Rasesh
2018-09-29  8:14 ` [dpdk-dev] [PATCH 15/18] net/qede/base: add RL update params Mody, Rasesh
2018-09-29  8:14 ` [dpdk-dev] [PATCH 14/18] net/qede/base: changes for 100G Mody, Rasesh
2018-09-29  8:14 ` [dpdk-dev] [PATCH 16/18] net/qede/base: add APIs for dscp priority map configuration Mody, Rasesh
2018-09-29  8:14 ` [dpdk-dev] [PATCH 17/18] net/qede/base: semantic changes Mody, Rasesh
2018-09-29  8:14 ` [dpdk-dev] [PATCH 18/18] net/qede: bump PMD version to 2.10.0.1 Mody, Rasesh
2018-10-03 10:32 ` [dpdk-dev] [PATCH 00/18] net/qede: base driver update Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1538208822-9726-6-git-send-email-rasesh.mody@cavium.com \
    --to=rasesh.mody@cavium.com \
    --cc=Dept-EngDPDKDev@cavium.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).