net/bnxt: fix config RSS update
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Thu, 28 Sep 2017 21:43:33 +0000 (16:43 -0500)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 6 Oct 2017 00:49:49 +0000 (02:49 +0200)
We are not configuring the RSS settings updated by rss_hash_update().
Fixing it.

Fixes: fcc0aa1edc10 ("net/bnxt: add RSS hash configuration")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt.h
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/bnxt/bnxt_rxq.c

index 3579505..65f716b 100644 (file)
@@ -176,6 +176,7 @@ struct bnxt {
        void                            *bar0;
 
        struct rte_eth_dev              *eth_dev;
+       struct rte_eth_rss_conf         rss_conf;
        struct rte_pci_device           *pdev;
 
        uint32_t                flags;
@@ -184,6 +185,7 @@ struct bnxt {
 #define BNXT_FLAG_PORT_STATS   (1 << 2)
 #define BNXT_FLAG_JUMBO                (1 << 3)
 #define BNXT_FLAG_SHORT_CMD    (1 << 4)
+#define BNXT_FLAG_UPDATE_HASH  (1 << 5)
 #define BNXT_PF(bp)            (!((bp)->flags & BNXT_FLAG_VF))
 #define BNXT_VF(bp)            ((bp)->flags & BNXT_FLAG_VF)
 #define BNXT_NPAR_ENABLED(bp)  ((bp)->port_partition_type)
index 05e601b..f8dfc1c 100644 (file)
@@ -837,6 +837,10 @@ static int bnxt_rss_hash_update_op(struct rte_eth_dev *eth_dev,
                if (rss_conf->rss_hf & BNXT_ETH_RSS_SUPPORT)
                        return -EINVAL;
        }
+
+       bp->flags |= BNXT_FLAG_UPDATE_HASH;
+       memcpy(&bp->rss_conf, rss_conf, sizeof(*rss_conf));
+
        if (rss_conf->rss_hf & ETH_RSS_IPV4)
                hash_type |= HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4;
        if (rss_conf->rss_hf & ETH_RSS_NONFRAG_IPV4_TCP)
index 8459fcc..690a599 100644 (file)
@@ -188,6 +188,11 @@ out:
                struct rte_eth_rss_conf *rss = &dev_conf->rx_adv_conf.rss_conf;
                uint16_t hash_type = 0;
 
+               if (bp->flags & BNXT_FLAG_UPDATE_HASH) {
+                       rss = &bp->rss_conf;
+                       bp->flags &= ~BNXT_FLAG_UPDATE_HASH;
+               }
+
                if (rss->rss_hf & ETH_RSS_IPV4)
                        hash_type |= HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4;
                if (rss->rss_hf & ETH_RSS_NONFRAG_IPV4_TCP)