DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ivan Malov <ivan.malov@oktetlabs.ru>
To: dev@dpdk.org
Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	Andy Moreton <amoreton@xilinx.com>
Subject: [PATCH 2/8] common/sfc_efx/base: query RSS queue span limit on Riverhead
Date: Tue,  1 Feb 2022 11:49:56 +0300	[thread overview]
Message-ID: <20220201085002.320102-3-ivan.malov@oktetlabs.ru> (raw)
In-Reply-To: <20220201085002.320102-1-ivan.malov@oktetlabs.ru>

On Riverhead boards, clients can query the limit on how many
queues an RSS context may address. Put the capability to use.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 drivers/common/sfc_efx/base/ef10_nic.c  | 14 ++++++++++++--
 drivers/common/sfc_efx/base/ef10_rx.c   |  3 ++-
 drivers/common/sfc_efx/base/efx.h       |  7 +++++++
 drivers/common/sfc_efx/base/siena_nic.c |  2 ++
 4 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/drivers/common/sfc_efx/base/ef10_nic.c b/drivers/common/sfc_efx/base/ef10_nic.c
index 355d274470..d9f7c0f362 100644
--- a/drivers/common/sfc_efx/base/ef10_nic.c
+++ b/drivers/common/sfc_efx/base/ef10_nic.c
@@ -1051,14 +1051,14 @@ ef10_get_datapath_caps(
 	efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
 	efx_mcdi_req_t req;
 	EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_CAPABILITIES_IN_LEN,
-		MC_CMD_GET_CAPABILITIES_V7_OUT_LEN);
+		MC_CMD_GET_CAPABILITIES_V9_OUT_LEN);
 	efx_rc_t rc;
 
 	req.emr_cmd = MC_CMD_GET_CAPABILITIES;
 	req.emr_in_buf = payload;
 	req.emr_in_length = MC_CMD_GET_CAPABILITIES_IN_LEN;
 	req.emr_out_buf = payload;
-	req.emr_out_length = MC_CMD_GET_CAPABILITIES_V7_OUT_LEN;
+	req.emr_out_length = MC_CMD_GET_CAPABILITIES_V9_OUT_LEN;
 
 	efx_mcdi_execute_quiet(enp, &req);
 
@@ -1466,6 +1466,16 @@ ef10_get_datapath_caps(
 	encp->enc_mae_admin = B_FALSE;
 #endif /* EFSYS_OPT_MAE */
 
+#if EFSYS_OPT_RX_SCALE
+	if (req.emr_out_length_used >= MC_CMD_GET_CAPABILITIES_V9_OUT_LEN) {
+		encp->enc_rx_scale_indirection_max_nqueues =
+		    MCDI_OUT_DWORD(req,
+			GET_CAPABILITIES_V9_OUT_RSS_MAX_INDIRECTION_QUEUES);
+	} else {
+		encp->enc_rx_scale_indirection_max_nqueues = EFX_MAXRSS;
+	}
+#endif /* EFSYS_OPT_RX_SCALE */
+
 #undef CAP_FLAGS1
 #undef CAP_FLAGS2
 #undef CAP_FLAGS3
diff --git a/drivers/common/sfc_efx/base/ef10_rx.c b/drivers/common/sfc_efx/base/ef10_rx.c
index a658e0dba2..3b041b962e 100644
--- a/drivers/common/sfc_efx/base/ef10_rx.c
+++ b/drivers/common/sfc_efx/base/ef10_rx.c
@@ -18,6 +18,7 @@ efx_mcdi_rss_context_alloc(
 	__in		uint32_t num_queues,
 	__out		uint32_t *rss_contextp)
 {
+	const efx_nic_cfg_t *encp = efx_nic_cfg_get(enp);
 	efx_mcdi_req_t req;
 	EFX_MCDI_DECLARE_BUF(payload, MC_CMD_RSS_CONTEXT_ALLOC_IN_LEN,
 		MC_CMD_RSS_CONTEXT_ALLOC_OUT_LEN);
@@ -25,7 +26,7 @@ efx_mcdi_rss_context_alloc(
 	uint32_t context_type;
 	efx_rc_t rc;
 
-	if (num_queues > EFX_MAXRSS) {
+	if (num_queues > encp->enc_rx_scale_indirection_max_nqueues) {
 		rc = EINVAL;
 		goto fail1;
 	}
diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h
index 96769935c0..f875487b89 100644
--- a/drivers/common/sfc_efx/base/efx.h
+++ b/drivers/common/sfc_efx/base/efx.h
@@ -1495,6 +1495,13 @@ typedef struct efx_nic_cfg_s {
 	uint32_t		enc_rx_buf_align_start;
 	uint32_t		enc_rx_buf_align_end;
 #if EFSYS_OPT_RX_SCALE
+	/*
+	 * The limit on how many queues an RSS indirection table can address.
+	 *
+	 * Indirection table entries are offsets relative to a base queue ID.
+	 * This means that the maximum offset has to be less than this value.
+	 */
+	uint32_t		enc_rx_scale_indirection_max_nqueues;
 	uint32_t		enc_rx_scale_max_exclusive_contexts;
 	/*
 	 * Mask of supported hash algorithms.
diff --git a/drivers/common/sfc_efx/base/siena_nic.c b/drivers/common/sfc_efx/base/siena_nic.c
index e42599131a..5f6d298d3f 100644
--- a/drivers/common/sfc_efx/base/siena_nic.c
+++ b/drivers/common/sfc_efx/base/siena_nic.c
@@ -119,6 +119,8 @@ siena_board_cfg(
 	encp->enc_rx_push_align = 1;
 
 #if EFSYS_OPT_RX_SCALE
+	encp->enc_rx_scale_indirection_max_nqueues = EFX_MAXRSS;
+
 	/* There is one RSS context per function */
 	encp->enc_rx_scale_max_exclusive_contexts = 1;
 
-- 
2.30.2


  parent reply	other threads:[~2022-02-01  8:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-01  8:49 [PATCH 0/8] net/sfc: improve flow action RSS support on EF100 boards Ivan Malov
2022-02-01  8:49 ` [PATCH 1/8] net/sfc: rework flow action RSS support Ivan Malov
2022-02-01  8:49 ` Ivan Malov [this message]
2022-02-01  8:49 ` [PATCH 3/8] net/sfc: use non-static queue span limit in flow action RSS Ivan Malov
2022-02-01  8:49 ` [PATCH 4/8] common/sfc_efx/base: revise name of RSS table entry count Ivan Malov
2022-02-01  8:49 ` [PATCH 5/8] common/sfc_efx/base: support selecting " Ivan Malov
2022-02-02 11:51   ` Ray Kinsella
2022-02-02 12:24     ` Ivan Malov
2022-02-01  8:50 ` [PATCH 6/8] net/sfc: use adaptive table entry count in flow action RSS Ivan Malov
2022-02-01  8:50 ` [PATCH 7/8] common/sfc_efx/base: support the even spread RSS mode Ivan Malov
2022-02-01  8:50 ` [PATCH 8/8] net/sfc: use the even spread mode in flow action RSS Ivan Malov
2022-02-02 17:41 ` [PATCH 0/8] net/sfc: improve flow action RSS support on EF100 boards 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=20220201085002.320102-3-ivan.malov@oktetlabs.ru \
    --to=ivan.malov@oktetlabs.ru \
    --cc=amoreton@xilinx.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    /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).