New upstream version 16.11.8
[deb_dpdk.git] / drivers / net / bnxt / bnxt_vnic.c
index c04c4c7..58fa4be 100644 (file)
@@ -67,7 +67,7 @@ void bnxt_init_vnics(struct bnxt *bp)
 {
        struct bnxt_vnic_info *vnic;
        uint16_t max_vnics;
-       int i, j;
+       int i;
 
        if (BNXT_PF(bp)) {
                struct bnxt_pf_info *pf = &bp->pf;
@@ -85,9 +85,6 @@ void bnxt_init_vnics(struct bnxt *bp)
                vnic->fw_rss_cos_lb_ctx = (uint16_t)HWRM_NA_SIGNATURE;
                vnic->ctx_is_rss_cos_lb = HW_CONTEXT_NONE;
 
-               for (j = 0; j < MAX_QUEUES_PER_VNIC; j++)
-                       vnic->fw_grp_ids[j] = (uint16_t)HWRM_NA_SIGNATURE;
-
                prandom_bytes(vnic->rss_hash_key, HW_HASH_KEY_SIZE);
                STAILQ_INIT(&vnic->filter);
                STAILQ_INSERT_TAIL(&bp->free_vnic_list, vnic, next);
@@ -175,7 +172,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
        struct rte_pci_device *pdev = bp->pdev;
        const struct rte_memzone *mz;
        char mz_name[RTE_MEMZONE_NAMESIZE];
-       int entry_length = RTE_CACHE_LINE_ROUNDUP(
+       uint32_t entry_length = RTE_CACHE_LINE_ROUNDUP(
                                HW_HASH_INDEX_SIZE * sizeof(*vnic->rss_table) +
                                HW_HASH_KEY_SIZE);
        uint16_t max_vnics;
@@ -229,6 +226,9 @@ void bnxt_free_vnic_mem(struct bnxt *bp)
        struct bnxt_vnic_info *vnic;
        uint16_t max_vnics, i;
 
+       if (bp->vnic_info == NULL)
+               return;
+
        if (BNXT_PF(bp)) {
                struct bnxt_pf_info *pf = &bp->pf;