Thread (23 messages) flat view 23 messages, 2 authors, 2020-01-17

Re: [PATCH v3 11/17] octeontx2-pf: Receive side scaling support

From: Sunil Kovvuri <hidden>
Date: 2020-01-17 17:36:51

On Fri, Jan 17, 2020 at 7:09 AM Jakub Kicinski [off-list ref] wrote:
On Fri, 17 Jan 2020 01:17:27 +0530, sunil.kovvuri@gmail.com wrote:
quoted
+int otx2_rss_init(struct otx2_nic *pfvf)
+{
+     struct otx2_rss_info *rss = &pfvf->hw.rss_info;
+     int idx, ret = 0;
+
+     /* Enable RSS */
+     rss->enable = true;
+     rss->rss_size = sizeof(rss->ind_tbl);
+
+     /* Init RSS key here */
+     netdev_rss_key_fill(rss->key, sizeof(rss->key));
+     otx2_set_rss_key(pfvf);
+
+     /* Default indirection table */
+     for (idx = 0; idx < rss->rss_size; idx++)
+             rss->ind_tbl[idx] =
+                     ethtool_rxfh_indir_default(idx, pfvf->hw.rx_queues);
+
+     ret = otx2_set_rss_table(pfvf);
+     if (ret)
+             return ret;
+
+     /* Default flowkey or hash config to be used for generating flow tag */
+     rss->flowkey_cfg = NIX_FLOW_KEY_TYPE_IPV4 | NIX_FLOW_KEY_TYPE_IPV6 |
+                        NIX_FLOW_KEY_TYPE_TCP | NIX_FLOW_KEY_TYPE_UDP |
+                        NIX_FLOW_KEY_TYPE_SCTP;
+
+     return otx2_set_flowkey_cfg(pfvf);
+}
quoted
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
index 557f86b..fe5b3de 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
@@ -838,6 +838,11 @@ int otx2_open(struct net_device *netdev)
      if (err)
              goto err_disable_napi;

+     /* Initialize RSS */
+     err = otx2_rss_init(pf);
+     if (err)
+             goto err_disable_napi;
Looks like you fully reset the RSS params on every close/open cycle?
I don't think that's the expected behaviour/what most NICs do.
For example you should only reset the indir table if
netif_is_rxfh_configure() returns false.
Thanks for pointing, will check this.

Sunil.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help