]> git.itanic.dy.fi Git - linux-stable/commitdiff
ionic: keep users rss hash across lif reset
authorShannon Nelson <snelson@pensando.io>
Tue, 3 Dec 2019 22:17:34 +0000 (14:17 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Dec 2019 15:09:12 +0000 (16:09 +0100)
[ Upstream commit ffac2027e18f006f42630f2e01a8a9bd8dc664b5 ]

If the user has specified their own RSS hash key, don't
lose it across queue resets such as DOWN/UP, MTU change,
and number of channels change.  This is fixed by moving
the key initialization to a little earlier in the lif
creation.

Also, let's clean up the RSS config a little better on
the way down by setting it all to 0.

Fixes: aa3198819bea ("ionic: Add RSS support")
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/pensando/ionic/ionic_lif.c

index 20faa8d24c9ffea255d25bf5103b16f94613d301..134640412d7b72723c6d6773ac443efeb786cc92 100644 (file)
@@ -1364,12 +1364,9 @@ int ionic_lif_rss_config(struct ionic_lif *lif, const u16 types,
 
 static int ionic_lif_rss_init(struct ionic_lif *lif)
 {
-       u8 rss_key[IONIC_RSS_HASH_KEY_SIZE];
        unsigned int tbl_sz;
        unsigned int i;
 
-       netdev_rss_key_fill(rss_key, IONIC_RSS_HASH_KEY_SIZE);
-
        lif->rss_types = IONIC_RSS_TYPE_IPV4     |
                         IONIC_RSS_TYPE_IPV4_TCP |
                         IONIC_RSS_TYPE_IPV4_UDP |
@@ -1382,12 +1379,18 @@ static int ionic_lif_rss_init(struct ionic_lif *lif)
        for (i = 0; i < tbl_sz; i++)
                lif->rss_ind_tbl[i] = ethtool_rxfh_indir_default(i, lif->nxqs);
 
-       return ionic_lif_rss_config(lif, lif->rss_types, rss_key, NULL);
+       return ionic_lif_rss_config(lif, lif->rss_types, NULL, NULL);
 }
 
-static int ionic_lif_rss_deinit(struct ionic_lif *lif)
+static void ionic_lif_rss_deinit(struct ionic_lif *lif)
 {
-       return ionic_lif_rss_config(lif, 0x0, NULL, NULL);
+       int tbl_sz;
+
+       tbl_sz = le16_to_cpu(lif->ionic->ident.lif.eth.rss_ind_tbl_sz);
+       memset(lif->rss_ind_tbl, 0, tbl_sz);
+       memset(lif->rss_hash_key, 0, IONIC_RSS_HASH_KEY_SIZE);
+
+       ionic_lif_rss_config(lif, 0x0, NULL, NULL);
 }
 
 static void ionic_txrx_disable(struct ionic_lif *lif)
@@ -1710,6 +1713,7 @@ static struct ionic_lif *ionic_lif_alloc(struct ionic *ionic, unsigned int index
                dev_err(dev, "Failed to allocate rss indirection table, aborting\n");
                goto err_out_free_qcqs;
        }
+       netdev_rss_key_fill(lif->rss_hash_key, IONIC_RSS_HASH_KEY_SIZE);
 
        list_add_tail(&lif->list, &ionic->lifs);