net/bnxt: allocate RSS context only if RSS mode is enabled
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Thu, 28 Jun 2018 20:15:45 +0000 (13:15 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 2 Jul 2018 23:35:58 +0000 (01:35 +0200)
allocate RSS context only if RSS mode is enabled.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_ethdev.c

index 896e2d2..e93a376 100644 (file)
@@ -249,6 +249,7 @@ static int bnxt_init_chip(struct bnxt *bp)
 
        /* VNIC configuration */
        for (i = 0; i < bp->nr_vnics; i++) {
+               struct rte_eth_conf *dev_conf = &bp->eth_dev->data->dev_conf;
                struct bnxt_vnic_info *vnic = &bp->vnic_info[i];
 
                rc = bnxt_hwrm_vnic_alloc(bp, vnic);
@@ -258,12 +259,15 @@ static int bnxt_init_chip(struct bnxt *bp)
                        goto err_out;
                }
 
-               rc = bnxt_hwrm_vnic_ctx_alloc(bp, vnic);
-               if (rc) {
-                       PMD_DRV_LOG(ERR,
-                               "HWRM vnic %d ctx alloc failure rc: %x\n",
-                               i, rc);
-                       goto err_out;
+               /* Alloc RSS context only if RSS mode is enabled */
+               if (dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS) {
+                       rc = bnxt_hwrm_vnic_ctx_alloc(bp, vnic);
+                       if (rc) {
+                               PMD_DRV_LOG(ERR,
+                                       "HWRM vnic %d ctx alloc failure rc: %x\n",
+                                       i, rc);
+                               goto err_out;
+                       }
                }
 
                rc = bnxt_hwrm_vnic_cfg(bp, vnic);