From: Andrew Boyer <aboyer@pensando.io>
To: dev@dpdk.org
Cc: Alfredo Cardigliano <cardigliano@ntop.org>,
Andrew Boyer <aboyer@pensando.io>
Subject: [dpdk-dev] [PATCH 1/6] net/ionic: preserve RSS state unless RETA size changes
Date: Thu, 10 Dec 2020 06:22:26 -0800 [thread overview]
Message-ID: <20201210142231.63209-2-aboyer@pensando.io> (raw)
In-Reply-To: <20201210142231.63209-1-aboyer@pensando.io>
This preserves settings across a stop/start.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
---
drivers/net/ionic/ionic_lif.c | 44 ++++++++++++++++-------------------
drivers/net/ionic/ionic_lif.h | 1 +
2 files changed, 21 insertions(+), 24 deletions(-)
diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c
index 28ae9dc8a..646c921b2 100644
--- a/drivers/net/ionic/ionic_lif.c
+++ b/drivers/net/ionic/ionic_lif.c
@@ -962,8 +962,6 @@ ionic_lif_rss_config(struct ionic_lif *lif,
static int
ionic_lif_rss_setup(struct ionic_lif *lif)
{
- size_t tbl_size = sizeof(*lif->rss_ind_tbl) *
- lif->adapter->ident.lif.eth.rss_ind_tbl_sz;
static const uint8_t toeplitz_symmetric_key[] = {
0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A,
0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A,
@@ -971,34 +969,35 @@ ionic_lif_rss_setup(struct ionic_lif *lif)
0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A,
0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A,
};
- uint32_t socket_id = rte_socket_id();
uint32_t i;
- int err;
+ uint16_t tbl_sz = lif->adapter->ident.lif.eth.rss_ind_tbl_sz;
IONIC_PRINT_CALL();
- lif->rss_ind_tbl_z = rte_eth_dma_zone_reserve(lif->eth_dev,
- "rss_ind_tbl",
- 0 /* queue_idx*/, tbl_size, IONIC_ALIGN, socket_id);
-
if (!lif->rss_ind_tbl_z) {
- IONIC_PRINT(ERR, "OOM");
- return -ENOMEM;
- }
+ lif->rss_ind_tbl_z = rte_eth_dma_zone_reserve(lif->eth_dev,
+ "rss_ind_tbl", 0 /* queue_idx */,
+ sizeof(*lif->rss_ind_tbl) * tbl_sz,
+ IONIC_ALIGN, rte_socket_id());
+ if (!lif->rss_ind_tbl_z) {
+ IONIC_PRINT(ERR, "OOM");
+ return -ENOMEM;
+ }
- lif->rss_ind_tbl = lif->rss_ind_tbl_z->addr;
- lif->rss_ind_tbl_pa = lif->rss_ind_tbl_z->iova;
+ lif->rss_ind_tbl = lif->rss_ind_tbl_z->addr;
+ lif->rss_ind_tbl_pa = lif->rss_ind_tbl_z->iova;
+ }
- /* Fill indirection table with 'default' values */
- for (i = 0; i < lif->adapter->ident.lif.eth.rss_ind_tbl_sz; i++)
- lif->rss_ind_tbl[i] = i % lif->nrxqcqs;
+ if (lif->rss_ind_tbl_nrxqcqs != lif->nrxqcqs) {
+ lif->rss_ind_tbl_nrxqcqs = lif->nrxqcqs;
- err = ionic_lif_rss_config(lif, IONIC_RSS_OFFLOAD_ALL,
- toeplitz_symmetric_key, NULL);
- if (err)
- return err;
+ /* Fill indirection table with 'default' values */
+ for (i = 0; i < tbl_sz; i++)
+ lif->rss_ind_tbl[i] = i % lif->nrxqcqs;
+ }
- return 0;
+ return ionic_lif_rss_config(lif, IONIC_RSS_OFFLOAD_ALL,
+ toeplitz_symmetric_key, NULL);
}
static void
@@ -1578,9 +1577,6 @@ ionic_lif_start(struct ionic_lif *lif)
uint32_t i;
int err;
- IONIC_PRINT(DEBUG, "Setting RSS configuration on port %u",
- lif->port_id);
-
err = ionic_lif_rss_setup(lif);
if (err)
return err;
diff --git a/drivers/net/ionic/ionic_lif.h b/drivers/net/ionic/ionic_lif.h
index 8e2b42443..b80931c61 100644
--- a/drivers/net/ionic/ionic_lif.h
+++ b/drivers/net/ionic/ionic_lif.h
@@ -108,6 +108,7 @@ struct ionic_lif {
uint8_t *rss_ind_tbl;
rte_iova_t rss_ind_tbl_pa;
const struct rte_memzone *rss_ind_tbl_z;
+ uint32_t rss_ind_tbl_nrxqcqs;
uint32_t info_sz;
struct ionic_lif_info *info;
rte_iova_t info_pa;
--
2.17.1
next prev parent reply other threads:[~2020-12-10 14:23 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-10 14:22 [dpdk-dev] [PATCH 0/6] net/ionic: fixes for stop and start Andrew Boyer
2020-12-10 14:22 ` Andrew Boyer [this message]
2020-12-10 14:22 ` [dpdk-dev] [PATCH 2/6] net/ionic: preserve RX mode across LIF stop/start Andrew Boyer
2020-12-10 14:22 ` [dpdk-dev] [PATCH 3/6] net/ionic: fully implement remove-on-close Andrew Boyer
2020-12-15 13:42 ` Ferruh Yigit
2020-12-16 19:52 ` Andrew Boyer
2020-12-10 14:22 ` [dpdk-dev] [PATCH 4/6] net/ionic: improve link state handling Andrew Boyer
2020-12-10 14:22 ` [dpdk-dev] [PATCH 5/6] net/ionic: improve queue " Andrew Boyer
2020-12-10 14:22 ` [dpdk-dev] [PATCH 6/6] net/ionic: stop queues when LIF is stopped Andrew Boyer
2020-12-15 14:01 ` [dpdk-dev] [PATCH 0/6] net/ionic: fixes for stop and start Ferruh Yigit
2020-12-16 21:12 ` [dpdk-dev] [PATCH v2 0/7] " Andrew Boyer
2021-01-11 17:08 ` Ferruh Yigit
2020-12-16 21:12 ` [dpdk-dev] [PATCH v2 1/7] net/ionic: preserve RSS state unless RETA size changes Andrew Boyer
2020-12-16 21:12 ` [dpdk-dev] [PATCH v2 2/7] net/ionic: preserve Rx mode across LIF stop/start Andrew Boyer
2020-12-16 21:12 ` [dpdk-dev] [PATCH v2 3/7] net/ionic: remove multi-LIF support Andrew Boyer
2020-12-16 21:12 ` [dpdk-dev] [PATCH v2 4/7] net/ionic: fully implement remove-on-close Andrew Boyer
2020-12-16 21:12 ` [dpdk-dev] [PATCH v2 5/7] net/ionic: improve link state handling Andrew Boyer
2020-12-16 21:12 ` [dpdk-dev] [PATCH v2 6/7] net/ionic: improve queue " Andrew Boyer
2020-12-16 21:12 ` [dpdk-dev] [PATCH v2 7/7] net/ionic: stop queues when LIF is stopped Andrew Boyer
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=20201210142231.63209-2-aboyer@pensando.io \
--to=aboyer@pensando.io \
--cc=cardigliano@ntop.org \
--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).