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 4/8] common/sfc_efx/base: revise name of RSS table entry count
Date: Tue, 1 Feb 2022 11:49:58 +0300 [thread overview]
Message-ID: <20220201085002.320102-5-ivan.malov@oktetlabs.ru> (raw)
In-Reply-To: <20220201085002.320102-1-ivan.malov@oktetlabs.ru>
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 <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_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
next prev 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 ` [PATCH 2/8] common/sfc_efx/base: query RSS queue span limit on Riverhead Ivan Malov
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 ` Ivan Malov [this message]
2022-02-01 8:49 ` [PATCH 5/8] common/sfc_efx/base: support selecting RSS table entry count 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-5-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).