net/bnxt: reduce verbosity of logs
[dpdk.git] / drivers / net / bnxt / bnxt_vnic.c
index aebfb1f..9ea9938 100644 (file)
@@ -89,6 +89,9 @@ void bnxt_free_vnic_attributes(struct bnxt *bp)
        struct bnxt_vnic_info *vnic;
        unsigned int i;
 
+       if (bp->vnic_info == NULL)
+               return;
+
        for (i = 0; i < bp->max_vnics; i++) {
                vnic = &bp->vnic_info[i];
                if (vnic->rss_table) {
@@ -113,14 +116,23 @@ 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];
-       uint32_t entry_length = RTE_CACHE_LINE_ROUNDUP(
-                               HW_HASH_INDEX_SIZE * sizeof(*vnic->rss_table) +
-                               HW_HASH_KEY_SIZE +
-                               BNXT_MAX_MC_ADDRS * ETHER_ADDR_LEN);
+       uint32_t entry_length;
+       size_t rss_table_size;
        uint16_t max_vnics;
        int i;
        rte_iova_t mz_phys_addr;
 
+       entry_length = HW_HASH_KEY_SIZE +
+                      BNXT_MAX_MC_ADDRS * RTE_ETHER_ADDR_LEN;
+
+       if (BNXT_CHIP_THOR(bp))
+               rss_table_size = BNXT_RSS_TBL_SIZE_THOR *
+                                2 * sizeof(*vnic->rss_table);
+       else
+               rss_table_size = HW_HASH_INDEX_SIZE * sizeof(*vnic->rss_table);
+
+       entry_length = RTE_CACHE_LINE_ROUNDUP(entry_length + rss_table_size);
+
        max_vnics = bp->max_vnics;
        snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
                 "bnxt_%04x:%02x:%02x:%02x_vnicattr", pdev->addr.domain,
@@ -138,14 +150,13 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
        }
        mz_phys_addr = mz->iova;
        if ((unsigned long)mz->addr == mz_phys_addr) {
-               PMD_DRV_LOG(WARNING,
-                       "Memzone physical address same as virtual.\n");
-               PMD_DRV_LOG(WARNING,
-                       "Using rte_mem_virt2iova()\n");
+               PMD_DRV_LOG(DEBUG,
+                           "Memzone physical address same as virtual.\n");
+               PMD_DRV_LOG(DEBUG, "Using rte_mem_virt2iova()\n");
                mz_phys_addr = rte_mem_virt2iova(mz->addr);
-               if (mz_phys_addr == 0) {
+               if (mz_phys_addr == RTE_BAD_IOVA) {
                        PMD_DRV_LOG(ERR,
-                       "unable to map vnic address to physical memory\n");
+                                   "unable to map to physical memory\n");
                        return -ENOMEM;
                }
        }
@@ -160,10 +171,10 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
 
                vnic->rss_table_dma_addr = mz_phys_addr + (entry_length * i);
                vnic->rss_hash_key = (void *)((char *)vnic->rss_table +
-                            HW_HASH_INDEX_SIZE * sizeof(*vnic->rss_table));
+                                             rss_table_size);
 
                vnic->rss_hash_key_dma_addr = vnic->rss_table_dma_addr +
-                            HW_HASH_INDEX_SIZE * sizeof(*vnic->rss_table);
+                                             rss_table_size;
                vnic->mc_list = (void *)((char *)vnic->rss_hash_key +
                                HW_HASH_KEY_SIZE);
                vnic->mc_list_dma_addr = vnic->rss_hash_key_dma_addr +