]> git.droids-corp.org - dpdk.git/commitdiff
common/sfc_efx/base: query RSS queue span limit on Riverhead
authorIvan Malov <ivan.malov@oktetlabs.ru>
Tue, 1 Feb 2022 08:49:56 +0000 (11:49 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 2 Feb 2022 17:37:31 +0000 (18:37 +0100)
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
drivers/common/sfc_efx/base/ef10_rx.c
drivers/common/sfc_efx/base/efx.h
drivers/common/sfc_efx/base/siena_nic.c

index 355d27447023c018d808085061de900f3a3e92e8..d9f7c0f36256325e26fdd83f9436ae3d1613c894 100644 (file)
@@ -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
index a658e0dba240afd606665942295f9e2b967f4bf8..3b041b962e70b8b309b80fa71d842d7614afaf43 100644 (file)
@@ -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;
        }
index 96769935c0d28b4258638803341b2282684ae48d..f875487b89f0fb4d3dbba35bad5b560094fc77b2 100644 (file)
@@ -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.
index e42599131a6f5f9baa500b6419544f08824a8741..5f6d298d3f820b74d1040281ec8b00fbf3a033fe 100644 (file)
@@ -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;