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 CACA7A00C5; Tue, 1 Feb 2022 09:50:53 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 137BC426F8; Tue, 1 Feb 2022 09:50:16 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id CC1B540685 for ; Tue, 1 Feb 2022 09:50:07 +0100 (CET) Received: from bree.oktetlabs.ru (bree.oktetlabs.ru [192.168.34.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPS id 3980938; Tue, 1 Feb 2022 11:50:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 3980938 Authentication-Results: shelob.oktetlabs.ru/3980938; dkim=none; dkim-atps=neutral From: Ivan Malov To: dev@dpdk.org Cc: Andrew Rybchenko , Andy Moreton Subject: [PATCH 4/8] common/sfc_efx/base: revise name of RSS table entry count Date: Tue, 1 Feb 2022 11:49:58 +0300 Message-Id: <20220201085002.320102-5-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220201085002.320102-1-ivan.malov@oktetlabs.ru> References: <20220201085002.320102-1-ivan.malov@oktetlabs.ru> 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 In the existing code, "n" is hardly a clear name for that. Use a clearer name to help future maintainers of the code. Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/common/sfc_efx/base/ef10_impl.h | 10 +++--- drivers/common/sfc_efx/base/ef10_rx.c | 25 +++++++-------- drivers/common/sfc_efx/base/efx.h | 10 +++--- drivers/common/sfc_efx/base/efx_rx.c | 39 ++++++++++++------------ drivers/common/sfc_efx/base/rhead_impl.h | 10 +++--- drivers/common/sfc_efx/base/rhead_rx.c | 12 ++++---- 6 files changed, 54 insertions(+), 52 deletions(-) diff --git a/drivers/common/sfc_efx/base/ef10_impl.h b/drivers/common/sfc_efx/base/ef10_impl.h index d48f238479..597dd24909 100644 --- a/drivers/common/sfc_efx/base/ef10_impl.h +++ b/drivers/common/sfc_efx/base/ef10_impl.h @@ -1163,12 +1163,12 @@ ef10_rx_scale_key_set( __in size_t n); LIBEFX_INTERNAL -extern __checkReturn efx_rc_t +extern __checkReturn efx_rc_t ef10_rx_scale_tbl_set( - __in efx_nic_t *enp, - __in uint32_t rss_context, - __in_ecount(n) unsigned int *table, - __in size_t n); + __in efx_nic_t *enp, + __in uint32_t rss_context, + __in_ecount(nentries) unsigned int *table, + __in size_t nentries); LIBEFX_INTERNAL extern __checkReturn uint32_t diff --git a/drivers/common/sfc_efx/base/ef10_rx.c b/drivers/common/sfc_efx/base/ef10_rx.c index 3b041b962e..5008139a3f 100644 --- a/drivers/common/sfc_efx/base/ef10_rx.c +++ b/drivers/common/sfc_efx/base/ef10_rx.c @@ -292,12 +292,12 @@ efx_mcdi_rss_context_set_key( #endif /* EFSYS_OPT_RX_SCALE */ #if EFSYS_OPT_RX_SCALE -static efx_rc_t +static efx_rc_t efx_mcdi_rss_context_set_table( - __in efx_nic_t *enp, - __in uint32_t rss_context, - __in_ecount(n) unsigned int *table, - __in size_t n) + __in efx_nic_t *enp, + __in uint32_t rss_context, + __in_ecount(nentries) unsigned int *table, + __in size_t nentries) { efx_mcdi_req_t req; EFX_MCDI_DECLARE_BUF(payload, MC_CMD_RSS_CONTEXT_SET_TABLE_IN_LEN, @@ -325,7 +325,8 @@ efx_mcdi_rss_context_set_table( for (i = 0; i < MC_CMD_RSS_CONTEXT_SET_TABLE_IN_INDIRECTION_TABLE_LEN; i++) { - req_table[i] = (n > 0) ? (uint8_t)table[i % n] : 0; + req_table[i] = (nentries > 0) ? + (uint8_t)table[i % nentries] : 0; } efx_mcdi_execute(enp, &req); @@ -514,12 +515,12 @@ ef10_rx_scale_key_set( #endif /* EFSYS_OPT_RX_SCALE */ #if EFSYS_OPT_RX_SCALE - __checkReturn efx_rc_t + __checkReturn efx_rc_t ef10_rx_scale_tbl_set( - __in efx_nic_t *enp, - __in uint32_t rss_context, - __in_ecount(n) unsigned int *table, - __in size_t n) + __in efx_nic_t *enp, + __in uint32_t rss_context, + __in_ecount(nentries) unsigned int *table, + __in size_t nentries) { efx_rc_t rc; @@ -533,7 +534,7 @@ ef10_rx_scale_tbl_set( } if ((rc = efx_mcdi_rss_context_set_table(enp, - rss_context, table, n)) != 0) + rss_context, table, nentries)) != 0) goto fail2; return (0); diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h index f875487b89..a35e29ebcf 100644 --- a/drivers/common/sfc_efx/base/efx.h +++ b/drivers/common/sfc_efx/base/efx.h @@ -2903,12 +2903,12 @@ efx_rx_scale_mode_set( __in boolean_t insert); LIBEFX_API -extern __checkReturn efx_rc_t +extern __checkReturn efx_rc_t efx_rx_scale_tbl_set( - __in efx_nic_t *enp, - __in uint32_t rss_context, - __in_ecount(n) unsigned int *table, - __in size_t n); + __in efx_nic_t *enp, + __in uint32_t rss_context, + __in_ecount(nentries) unsigned int *table, + __in size_t nentries); LIBEFX_API extern __checkReturn efx_rc_t diff --git a/drivers/common/sfc_efx/base/efx_rx.c b/drivers/common/sfc_efx/base/efx_rx.c index 7e63363be7..eb3f736f63 100644 --- a/drivers/common/sfc_efx/base/efx_rx.c +++ b/drivers/common/sfc_efx/base/efx_rx.c @@ -41,12 +41,12 @@ siena_rx_scale_key_set( __in_ecount(n) uint8_t *key, __in size_t n); -static __checkReturn efx_rc_t +static __checkReturn efx_rc_t siena_rx_scale_tbl_set( - __in efx_nic_t *enp, - __in uint32_t rss_context, - __in_ecount(n) unsigned int *table, - __in size_t n); + __in efx_nic_t *enp, + __in uint32_t rss_context, + __in_ecount(nentries) unsigned int *table, + __in size_t nentries); static __checkReturn uint32_t siena_rx_prefix_hash( @@ -690,12 +690,12 @@ efx_rx_scale_key_set( #endif /* EFSYS_OPT_RX_SCALE */ #if EFSYS_OPT_RX_SCALE - __checkReturn efx_rc_t + __checkReturn efx_rc_t efx_rx_scale_tbl_set( - __in efx_nic_t *enp, - __in uint32_t rss_context, - __in_ecount(n) unsigned int *table, - __in size_t n) + __in efx_nic_t *enp, + __in uint32_t rss_context, + __in_ecount(nentries) unsigned int *table, + __in size_t nentries) { const efx_rx_ops_t *erxop = enp->en_erxop; efx_rc_t rc; @@ -703,7 +703,8 @@ efx_rx_scale_tbl_set( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX); - if ((rc = erxop->erxo_scale_tbl_set(enp, rss_context, table, n)) != 0) + if ((rc = erxop->erxo_scale_tbl_set(enp, rss_context, table, + nentries)) != 0) goto fail1; return (0); @@ -1419,12 +1420,12 @@ siena_rx_scale_key_set( #endif #if EFSYS_OPT_RX_SCALE -static __checkReturn efx_rc_t +static __checkReturn efx_rc_t siena_rx_scale_tbl_set( - __in efx_nic_t *enp, - __in uint32_t rss_context, - __in_ecount(n) unsigned int *table, - __in size_t n) + __in efx_nic_t *enp, + __in uint32_t rss_context, + __in_ecount(nentries) unsigned int *table, + __in size_t nentries) { efx_oword_t oword; int index; @@ -1438,7 +1439,7 @@ siena_rx_scale_tbl_set( goto fail1; } - if (n > FR_BZ_RX_INDIRECTION_TBL_ROWS) { + if (nentries > FR_BZ_RX_INDIRECTION_TBL_ROWS) { rc = EINVAL; goto fail2; } @@ -1447,7 +1448,7 @@ siena_rx_scale_tbl_set( uint32_t byte; /* Calculate the entry to place in the table */ - byte = (n > 0) ? (uint32_t)table[index % n] : 0; + byte = (nentries > 0) ? (uint32_t)table[index % nentries] : 0; EFSYS_PROBE2(table, int, index, uint32_t, byte); @@ -1462,7 +1463,7 @@ siena_rx_scale_tbl_set( uint32_t byte; /* Determine if we're starting a new batch */ - byte = (n > 0) ? (uint32_t)table[index % n] : 0; + byte = (nentries > 0) ? (uint32_t)table[index % nentries] : 0; /* Read the table */ EFX_BAR_TBL_READO(enp, FR_BZ_RX_INDIRECTION_TBL, diff --git a/drivers/common/sfc_efx/base/rhead_impl.h b/drivers/common/sfc_efx/base/rhead_impl.h index dd38ded775..e0d95ba2aa 100644 --- a/drivers/common/sfc_efx/base/rhead_impl.h +++ b/drivers/common/sfc_efx/base/rhead_impl.h @@ -287,12 +287,12 @@ rhead_rx_scale_key_set( __in size_t n); LIBEFX_INTERNAL -extern __checkReturn efx_rc_t +extern __checkReturn efx_rc_t rhead_rx_scale_tbl_set( - __in efx_nic_t *enp, - __in uint32_t rss_context, - __in_ecount(n) unsigned int *table, - __in size_t n); + __in efx_nic_t *enp, + __in uint32_t rss_context, + __in_ecount(nentries) unsigned int *table, + __in size_t nentries); LIBEFX_INTERNAL extern __checkReturn uint32_t diff --git a/drivers/common/sfc_efx/base/rhead_rx.c b/drivers/common/sfc_efx/base/rhead_rx.c index 7b9a4af9da..d28f936ab7 100644 --- a/drivers/common/sfc_efx/base/rhead_rx.c +++ b/drivers/common/sfc_efx/base/rhead_rx.c @@ -162,16 +162,16 @@ rhead_rx_scale_key_set( return (rc); } - __checkReturn efx_rc_t + __checkReturn efx_rc_t rhead_rx_scale_tbl_set( - __in efx_nic_t *enp, - __in uint32_t rss_context, - __in_ecount(n) unsigned int *table, - __in size_t n) + __in efx_nic_t *enp, + __in uint32_t rss_context, + __in_ecount(nentries) unsigned int *table, + __in size_t nentries) { efx_rc_t rc; - rc = ef10_rx_scale_tbl_set(enp, rss_context, table, n); + rc = ef10_rx_scale_tbl_set(enp, rss_context, table, nentries); if (rc != 0) goto fail1; -- 2.30.2