bool is_bnxt_supported(struct rte_eth_dev *dev);
 extern const struct rte_flow_ops bnxt_flow_ops;
+
+extern int bnxt_logtype_driver;
+#define PMD_DRV_LOG_RAW(level, fmt, args...) \
+       rte_log(RTE_LOG_ ## level, bnxt_logtype_driver, "%s(): " fmt, \
+               __func__, ## args)
+
+#define PMD_DRV_LOG(level, fmt, args...) \
+       PMD_DRV_LOG_RAW(level, fmt, ## args)
 #endif
 
                bnxt_link_update_op(bp->eth_dev, 1);
                break;
        default:
-               RTE_LOG(DEBUG, PMD, "handle_async_event id = 0x%x\n", event_id);
+               PMD_DRV_LOG(DEBUG, "handle_async_event id = 0x%x\n", event_id);
                break;
        }
 }
        int rc;
 
        if (bp->pf.active_vfs <= 0) {
-               RTE_LOG(ERR, PMD, "Forwarded VF with no active VFs\n");
+               PMD_DRV_LOG(ERR, "Forwarded VF with no active VFs\n");
                return;
        }
 
 
        if (fw_vf_id < bp->pf.first_vf_id ||
            fw_vf_id >= (bp->pf.first_vf_id) + bp->pf.active_vfs) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                "FWD req's source_id 0x%x out of range 0x%x - 0x%x (%d %d)\n",
                        fw_vf_id, bp->pf.first_vf_id,
                        (bp->pf.first_vf_id) + bp->pf.active_vfs - 1,
                /* Forward */
                rc = bnxt_hwrm_exec_fwd_resp(bp, fw_vf_id, fwd_cmd, req_len);
                if (rc) {
-                       RTE_LOG(ERR, PMD,
+                       PMD_DRV_LOG(ERR,
                                "Failed to send FWD req VF 0x%x, type 0x%x.\n",
                                fw_vf_id - bp->pf.first_vf_id,
                                rte_le_to_cpu_16(fwd_cmd->req_type));
 reject:
        rc = bnxt_hwrm_reject_fwd_resp(bp, fw_vf_id, fwd_cmd, req_len);
        if (rc) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Failed to send REJECT req VF 0x%x, type 0x%x.\n",
                        fw_vf_id - bp->pf.first_vf_id,
                        rte_le_to_cpu_16(fwd_cmd->req_type));
 
 #define DRV_MODULE_NAME                "bnxt"
 static const char bnxt_version[] =
        "Broadcom Cumulus driver " DRV_MODULE_NAME "\n";
+int bnxt_logtype_driver;
 
 #define PCI_VENDOR_ID_BROADCOM 0x14E4
 
 
        rc = bnxt_alloc_all_hwrm_stat_ctxs(bp);
        if (rc) {
-               RTE_LOG(ERR, PMD, "HWRM stat ctx alloc failure rc: %x\n", rc);
+               PMD_DRV_LOG(ERR, "HWRM stat ctx alloc failure rc: %x\n", rc);
                goto err_out;
        }
 
        rc = bnxt_alloc_hwrm_rings(bp);
        if (rc) {
-               RTE_LOG(ERR, PMD, "HWRM ring alloc failure rc: %x\n", rc);
+               PMD_DRV_LOG(ERR, "HWRM ring alloc failure rc: %x\n", rc);
                goto err_out;
        }
 
        rc = bnxt_alloc_all_hwrm_ring_grps(bp);
        if (rc) {
-               RTE_LOG(ERR, PMD, "HWRM ring grp alloc failure: %x\n", rc);
+               PMD_DRV_LOG(ERR, "HWRM ring grp alloc failure: %x\n", rc);
                goto err_out;
        }
 
        rc = bnxt_mq_rx_configure(bp);
        if (rc) {
-               RTE_LOG(ERR, PMD, "MQ mode configure failure rc: %x\n", rc);
+               PMD_DRV_LOG(ERR, "MQ mode configure failure rc: %x\n", rc);
                goto err_out;
        }
 
 
                rc = bnxt_hwrm_vnic_alloc(bp, vnic);
                if (rc) {
-                       RTE_LOG(ERR, PMD, "HWRM vnic %d alloc failure rc: %x\n",
+                       PMD_DRV_LOG(ERR, "HWRM vnic %d alloc failure rc: %x\n",
                                i, rc);
                        goto err_out;
                }
 
                rc = bnxt_hwrm_vnic_ctx_alloc(bp, vnic);
                if (rc) {
-                       RTE_LOG(ERR, PMD,
+                       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);
                if (rc) {
-                       RTE_LOG(ERR, PMD, "HWRM vnic %d cfg failure rc: %x\n",
+                       PMD_DRV_LOG(ERR, "HWRM vnic %d cfg failure rc: %x\n",
                                i, rc);
                        goto err_out;
                }
 
                rc = bnxt_set_hwrm_vnic_filters(bp, vnic);
                if (rc) {
-                       RTE_LOG(ERR, PMD,
+                       PMD_DRV_LOG(ERR,
                                "HWRM vnic %d filter failure rc: %x\n",
                                i, rc);
                        goto err_out;
                        }
                        rc = bnxt_hwrm_vnic_rss_cfg(bp, vnic);
                        if (rc) {
-                               RTE_LOG(ERR, PMD,
+                               PMD_DRV_LOG(ERR,
                                        "HWRM vnic %d set RSS failure rc: %x\n",
                                        i, rc);
                                goto err_out;
        }
        rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, &bp->vnic_info[0], 0, NULL);
        if (rc) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "HWRM cfa l2 rx mask failure rc: %x\n", rc);
                goto err_out;
        }
             !RTE_ETH_DEV_SRIOV(bp->eth_dev).active) &&
            bp->eth_dev->data->dev_conf.intr_conf.rxq != 0) {
                intr_vector = bp->eth_dev->data->nb_rx_queues;
-               RTE_LOG(INFO, PMD, "%s(): intr_vector = %d\n", __func__,
-                       intr_vector);
+               PMD_DRV_LOG(DEBUG, "intr_vector = %d\n", intr_vector);
                if (intr_vector > bp->rx_cp_nr_rings) {
-                       RTE_LOG(ERR, PMD, "At most %d intr queues supported",
+                       PMD_DRV_LOG(ERR, "At most %d intr queues supported",
                                        bp->rx_cp_nr_rings);
                        return -ENOTSUP;
                }
                                    bp->eth_dev->data->nb_rx_queues *
                                    sizeof(int), 0);
                if (intr_handle->intr_vec == NULL) {
-                       RTE_LOG(ERR, PMD, "Failed to allocate %d rx_queues"
+                       PMD_DRV_LOG(ERR, "Failed to allocate %d rx_queues"
                                " intr_vec", bp->eth_dev->data->nb_rx_queues);
                        return -ENOMEM;
                }
-               RTE_LOG(DEBUG, PMD, "%s(): intr_handle->intr_vec = %p "
+               PMD_DRV_LOG(DEBUG, "intr_handle->intr_vec = %p "
                        "intr_handle->nb_efd = %d intr_handle->max_intr = %d\n",
-                        __func__, intr_handle->intr_vec, intr_handle->nb_efd,
+                        intr_handle->intr_vec, intr_handle->nb_efd,
                        intr_handle->max_intr);
        }
 
 
        rc = bnxt_get_hwrm_link_config(bp, &new);
        if (rc) {
-               RTE_LOG(ERR, PMD, "HWRM Get link config failure rc: %x\n", rc);
+               PMD_DRV_LOG(ERR, "HWRM Get link config failure rc: %x\n", rc);
                goto err_out;
        }
 
        if (!bp->link_info.link_up) {
                rc = bnxt_set_hwrm_link_config(bp, true);
                if (rc) {
-                       RTE_LOG(ERR, PMD,
+                       PMD_DRV_LOG(ERR,
                                "HWRM link config failure rc: %x\n", rc);
                        goto err_out;
                }
            eth_dev->data->nb_rx_queues + eth_dev->data->nb_tx_queues >
            bp->max_stat_ctx ||
            (uint32_t)(eth_dev->data->nb_rx_queues + 1) > bp->max_ring_grps) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Insufficient resources to support requested config\n");
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Num Queues Requested: Tx %d, Rx %d\n",
                        eth_dev->data->nb_tx_queues,
                        eth_dev->data->nb_rx_queues);
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Res available: TxQ %d, RxQ %d, CQ %d Stat %d, Grp %d\n",
                        bp->max_tx_rings, bp->max_rx_rings, bp->max_cp_rings,
                        bp->max_stat_ctx, bp->max_ring_grps);
        struct rte_eth_link *link = ð_dev->data->dev_link;
 
        if (link->link_status)
-               RTE_LOG(INFO, PMD, "Port %d Link Up - speed %u Mbps - %s\n",
+               PMD_DRV_LOG(INFO, "Port %d Link Up - speed %u Mbps - %s\n",
                        eth_dev->data->port_id,
                        (uint32_t)link->link_speed,
                        (link->link_duplex == ETH_LINK_FULL_DUPLEX) ?
                        ("full-duplex") : ("half-duplex\n"));
        else
-               RTE_LOG(INFO, PMD, "Port %d Link Down\n",
+               PMD_DRV_LOG(INFO, "Port %d Link Down\n",
                        eth_dev->data->port_id);
 }
 
        int rc;
 
        if (bp->rx_cp_nr_rings > RTE_ETHDEV_QUEUE_STAT_CNTRS) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "RxQ cnt %d > CONFIG_RTE_ETHDEV_QUEUE_STAT_CNTRS %d\n",
                        bp->rx_cp_nr_rings, RTE_ETHDEV_QUEUE_STAT_CNTRS);
        }
        struct bnxt_filter_info *filter;
 
        if (BNXT_VF(bp)) {
-               RTE_LOG(ERR, PMD, "Cannot add MAC address to a VF interface\n");
+               PMD_DRV_LOG(ERR, "Cannot add MAC address to a VF interface\n");
                return -ENOTSUP;
        }
 
        if (!vnic) {
-               RTE_LOG(ERR, PMD, "VNIC not found for pool %d!\n", pool);
+               PMD_DRV_LOG(ERR, "VNIC not found for pool %d!\n", pool);
                return -EINVAL;
        }
        /* Attach requested MAC address to the new l2_filter */
        STAILQ_FOREACH(filter, &vnic->filter, next) {
                if (filter->mac_index == index) {
-                       RTE_LOG(ERR, PMD,
+                       PMD_DRV_LOG(ERR,
                                "MAC addr already existed for pool %d\n", pool);
                        return -EINVAL;
                }
        }
        filter = bnxt_alloc_filter(bp);
        if (!filter) {
-               RTE_LOG(ERR, PMD, "L2 filter alloc failed\n");
+               PMD_DRV_LOG(ERR, "L2 filter alloc failed\n");
                return -ENODEV;
        }
        STAILQ_INSERT_TAIL(&vnic->filter, filter, next);
                if (rc) {
                        new.link_speed = ETH_LINK_SPEED_100M;
                        new.link_duplex = ETH_LINK_FULL_DUPLEX;
-                       RTE_LOG(ERR, PMD,
+                       PMD_DRV_LOG(ERR,
                                "Failed to retrieve link rc = 0x%x!\n", rc);
                        goto out;
                }
                return -EINVAL;
 
        if (reta_size != HW_HASH_INDEX_SIZE) {
-               RTE_LOG(ERR, PMD, "The configured hash table lookup size "
+               PMD_DRV_LOG(ERR, "The configured hash table lookup size "
                        "(%d) must equal the size supported by the hardware "
                        "(%d)\n", reta_size, HW_HASH_INDEX_SIZE);
                return -EINVAL;
                return -EINVAL;
 
        if (reta_size != HW_HASH_INDEX_SIZE) {
-               RTE_LOG(ERR, PMD, "The configured hash table lookup size "
+               PMD_DRV_LOG(ERR, "The configured hash table lookup size "
                        "(%d) must equal the size supported by the hardware "
                        "(%d)\n", reta_size, HW_HASH_INDEX_SIZE);
                return -EINVAL;
         */
        if (dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) {
                if (!rss_conf->rss_hf)
-                       RTE_LOG(ERR, PMD, "Hash type NONE\n");
+                       PMD_DRV_LOG(ERR, "Hash type NONE\n");
        } else {
                if (rss_conf->rss_hf & BNXT_ETH_RSS_SUPPORT)
                        return -EINVAL;
                                ~HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6;
                }
                if (hash_types) {
-                       RTE_LOG(ERR, PMD,
+                       PMD_DRV_LOG(ERR,
                                "Unknwon RSS config from firmware (%08x), RSS disabled",
                                vnic->hash_type);
                        return -ENOTSUP;
        struct bnxt *bp = (struct bnxt *)dev->data->dev_private;
 
        if (!BNXT_SINGLE_PF(bp) || BNXT_VF(bp)) {
-               RTE_LOG(ERR, PMD, "Flow Control Settings cannot be modified\n");
+               PMD_DRV_LOG(ERR, "Flow Control Settings cannot be modified\n");
                return -ENOTSUP;
        }
 
        switch (udp_tunnel->prot_type) {
        case RTE_TUNNEL_TYPE_VXLAN:
                if (bp->vxlan_port_cnt) {
-                       RTE_LOG(ERR, PMD, "Tunnel Port %d already programmed\n",
+                       PMD_DRV_LOG(ERR, "Tunnel Port %d already programmed\n",
                                udp_tunnel->udp_port);
                        if (bp->vxlan_port != udp_tunnel->udp_port) {
-                               RTE_LOG(ERR, PMD, "Only one port allowed\n");
+                               PMD_DRV_LOG(ERR, "Only one port allowed\n");
                                return -ENOSPC;
                        }
                        bp->vxlan_port_cnt++;
                break;
        case RTE_TUNNEL_TYPE_GENEVE:
                if (bp->geneve_port_cnt) {
-                       RTE_LOG(ERR, PMD, "Tunnel Port %d already programmed\n",
+                       PMD_DRV_LOG(ERR, "Tunnel Port %d already programmed\n",
                                udp_tunnel->udp_port);
                        if (bp->geneve_port != udp_tunnel->udp_port) {
-                               RTE_LOG(ERR, PMD, "Only one port allowed\n");
+                               PMD_DRV_LOG(ERR, "Only one port allowed\n");
                                return -ENOSPC;
                        }
                        bp->geneve_port_cnt++;
                bp->geneve_port_cnt++;
                break;
        default:
-               RTE_LOG(ERR, PMD, "Tunnel type is not supported\n");
+               PMD_DRV_LOG(ERR, "Tunnel type is not supported\n");
                return -ENOTSUP;
        }
        rc = bnxt_hwrm_tunnel_dst_port_alloc(bp, udp_tunnel->udp_port,
        switch (udp_tunnel->prot_type) {
        case RTE_TUNNEL_TYPE_VXLAN:
                if (!bp->vxlan_port_cnt) {
-                       RTE_LOG(ERR, PMD, "No Tunnel port configured yet\n");
+                       PMD_DRV_LOG(ERR, "No Tunnel port configured yet\n");
                        return -EINVAL;
                }
                if (bp->vxlan_port != udp_tunnel->udp_port) {
-                       RTE_LOG(ERR, PMD, "Req Port: %d. Configured port: %d\n",
+                       PMD_DRV_LOG(ERR, "Req Port: %d. Configured port: %d\n",
                                udp_tunnel->udp_port, bp->vxlan_port);
                        return -EINVAL;
                }
                break;
        case RTE_TUNNEL_TYPE_GENEVE:
                if (!bp->geneve_port_cnt) {
-                       RTE_LOG(ERR, PMD, "No Tunnel port configured yet\n");
+                       PMD_DRV_LOG(ERR, "No Tunnel port configured yet\n");
                        return -EINVAL;
                }
                if (bp->geneve_port != udp_tunnel->udp_port) {
-                       RTE_LOG(ERR, PMD, "Req Port: %d. Configured port: %d\n",
+                       PMD_DRV_LOG(ERR, "Req Port: %d. Configured port: %d\n",
                                udp_tunnel->udp_port, bp->geneve_port);
                        return -EINVAL;
                }
                port = bp->geneve_fw_dst_port_id;
                break;
        default:
-               RTE_LOG(ERR, PMD, "Tunnel type is not supported\n");
+               PMD_DRV_LOG(ERR, "Tunnel type is not supported\n");
                return -ENOTSUP;
        }
 
 
                                        new_filter = bnxt_alloc_filter(bp);
                                        if (!new_filter) {
-                                               RTE_LOG(ERR, PMD,
+                                               PMD_DRV_LOG(ERR,
                                                        "MAC/VLAN filter alloc failed\n");
                                                rc = -ENOMEM;
                                                goto exit;
                                                        new_filter);
                                        if (rc)
                                                goto exit;
-                                       RTE_LOG(INFO, PMD,
+                                       PMD_DRV_LOG(INFO,
                                                "Del Vlan filter for %d\n",
                                                vlan_id);
                                }
                                }
                                new_filter = bnxt_alloc_filter(bp);
                                if (!new_filter) {
-                                       RTE_LOG(ERR, PMD,
+                                       PMD_DRV_LOG(ERR,
                                                "MAC/VLAN filter alloc failed\n");
                                        rc = -ENOMEM;
                                        goto exit;
                                                             new_filter);
                                if (rc)
                                        goto exit;
-                               RTE_LOG(INFO, PMD,
+                               PMD_DRV_LOG(INFO,
                                        "Added Vlan filter for %d\n", vlan_id);
 cont:
                                filter = temp_filter;
                        for (i = 0; i < 4095; i++)
                                bnxt_del_vlan_filter(bp, i);
                }
-               RTE_LOG(INFO, PMD, "VLAN Filtering: %d\n",
+               PMD_DRV_LOG(DEBUG, "VLAN Filtering: %d\n",
                        dev->data->dev_conf.rxmode.hw_vlan_filter);
        }
 
                                vnic->vlan_strip = false;
                        bnxt_hwrm_vnic_cfg(bp, vnic);
                }
-               RTE_LOG(INFO, PMD, "VLAN Strip Offload: %d\n",
+               PMD_DRV_LOG(DEBUG, "VLAN Strip Offload: %d\n",
                        dev->data->dev_conf.rxmode.hw_vlan_strip);
        }
 
        if (mask & ETH_VLAN_EXTEND_MASK)
-               RTE_LOG(ERR, PMD, "Extend VLAN Not supported\n");
+               PMD_DRV_LOG(ERR, "Extend VLAN Not supported\n");
 
        return 0;
 }
                if (rc)
                        break;
                filter->mac_index = 0;
-               RTE_LOG(DEBUG, PMD, "Set MAC addr\n");
+               PMD_DRV_LOG(DEBUG, "Set MAC addr\n");
        }
 }
 
                      ETHER_HDR_LEN - ETHER_CRC_LEN - VLAN_TAG_SIZE * 2;
 
        if (new_mtu < ETHER_MIN_MTU || new_mtu > max_dev_mtu) {
-               RTE_LOG(ERR, PMD, "MTU requested must be within (%d, %d)\n",
+               PMD_DRV_LOG(ERR, "MTU requested must be within (%d, %d)\n",
                        ETHER_MIN_MTU, max_dev_mtu);
                return -EINVAL;
        }
                new_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + VLAN_TAG_SIZE * 2;
 
        eth_dev->data->mtu = new_mtu;
-       RTE_LOG(INFO, PMD, "New MTU is %d\n", eth_dev->data->mtu);
+       PMD_DRV_LOG(INFO, "New MTU is %d\n", eth_dev->data->mtu);
 
        for (i = 0; i < bp->nr_vnics; i++) {
                struct bnxt_vnic_info *vnic = &bp->vnic_info[i];
        int rc;
 
        if (!BNXT_SINGLE_PF(bp) || BNXT_VF(bp)) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "PVID cannot be modified for this function\n");
                return -ENOTSUP;
        }
 
        if (efilter->ether_type == ETHER_TYPE_IPv4 ||
                efilter->ether_type == ETHER_TYPE_IPv6) {
-               RTE_LOG(ERR, PMD, "invalid ether_type(0x%04x) in"
+               PMD_DRV_LOG(ERR, "invalid ether_type(0x%04x) in"
                        " ethertype filter.", efilter->ether_type);
                *ret = -EINVAL;
                goto exit;
        }
        if (efilter->queue >= bp->rx_nr_rings) {
-               RTE_LOG(ERR, PMD, "Invalid queue %d\n", efilter->queue);
+               PMD_DRV_LOG(ERR, "Invalid queue %d\n", efilter->queue);
                *ret = -EINVAL;
                goto exit;
        }
        vnic0 = STAILQ_FIRST(&bp->ff_pool[0]);
        vnic = STAILQ_FIRST(&bp->ff_pool[efilter->queue]);
        if (vnic == NULL) {
-               RTE_LOG(ERR, PMD, "Invalid queue %d\n", efilter->queue);
+               PMD_DRV_LOG(ERR, "Invalid queue %d\n", efilter->queue);
                *ret = -EINVAL;
                goto exit;
        }
                return 0;
 
        if (arg == NULL) {
-               RTE_LOG(ERR, PMD, "arg shouldn't be NULL for operation %u.",
+               PMD_DRV_LOG(ERR, "arg shouldn't be NULL for operation %u.",
                            filter_op);
                return -EINVAL;
        }
 
                bfilter = bnxt_get_unused_filter(bp);
                if (bfilter == NULL) {
-                       RTE_LOG(ERR, PMD,
+                       PMD_DRV_LOG(ERR,
                                "Not enough resources for a new filter.\n");
                        return -ENOMEM;
                }
                                      next);
                        bnxt_free_filter(bp, filter1);
                } else if (ret == 0) {
-                       RTE_LOG(ERR, PMD, "No matching filter found\n");
+                       PMD_DRV_LOG(ERR, "No matching filter found\n");
                }
                break;
        default:
-               RTE_LOG(ERR, PMD, "unsupported operation %u.", filter_op);
+               PMD_DRV_LOG(ERR, "unsupported operation %u.", filter_op);
                ret = -EINVAL;
                goto error;
        }
        uint32_t en = 0;
 
        if (nfilter->queue >= bp->rx_nr_rings) {
-               RTE_LOG(ERR, PMD, "Invalid queue %d\n", nfilter->queue);
+               PMD_DRV_LOG(ERR, "Invalid queue %d\n", nfilter->queue);
                return -EINVAL;
        }
 
                        NTUPLE_FLTR_ALLOC_INPUT_EN_DST_PORT_MASK;
                break;
        default:
-               RTE_LOG(ERR, PMD, "invalid dst_port mask.");
+               PMD_DRV_LOG(ERR, "invalid dst_port mask.");
                return -EINVAL;
        }
 
                en |= NTUPLE_FLTR_ALLOC_IN_EN_IP_PROTO;
                break;
        default:
-               RTE_LOG(ERR, PMD, "invalid protocol mask.");
+               PMD_DRV_LOG(ERR, "invalid protocol mask.");
                return -EINVAL;
        }
 
                        NTUPLE_FLTR_ALLOC_INPUT_EN_DST_IPADDR_MASK;
                break;
        default:
-               RTE_LOG(ERR, PMD, "invalid dst_ip mask.");
+               PMD_DRV_LOG(ERR, "invalid dst_ip mask.");
                return -EINVAL;
        }
 
                        NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_IPADDR_MASK;
                break;
        default:
-               RTE_LOG(ERR, PMD, "invalid src_ip mask.");
+               PMD_DRV_LOG(ERR, "invalid src_ip mask.");
                return -EINVAL;
        }
 
                        NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_PORT_MASK;
                break;
        default:
-               RTE_LOG(ERR, PMD, "invalid src_port mask.");
+               PMD_DRV_LOG(ERR, "invalid src_port mask.");
                return -EINVAL;
        }
 
        int ret;
 
        if (nfilter->flags != RTE_5TUPLE_FLAGS) {
-               RTE_LOG(ERR, PMD, "only 5tuple is supported.");
+               PMD_DRV_LOG(ERR, "only 5tuple is supported.");
                return -EINVAL;
        }
 
        if (nfilter->flags & RTE_NTUPLE_FLAGS_TCP_FLAG) {
-               RTE_LOG(ERR, PMD, "Ntuple filter: TCP flags not supported\n");
+               PMD_DRV_LOG(ERR, "Ntuple filter: TCP flags not supported\n");
                return -EINVAL;
        }
 
        bfilter = bnxt_get_unused_filter(bp);
        if (bfilter == NULL) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Not enough resources for a new filter.\n");
                return -ENOMEM;
        }
 
        if (mfilter != NULL && filter_op == RTE_ETH_FILTER_ADD &&
            bfilter->dst_id == mfilter->dst_id) {
-               RTE_LOG(ERR, PMD, "filter exists.\n");
+               PMD_DRV_LOG(ERR, "filter exists.\n");
                ret = -EEXIST;
                goto free_filter;
        } else if (mfilter != NULL && filter_op == RTE_ETH_FILTER_ADD &&
                ret = bnxt_hwrm_set_ntuple_filter(bp, mfilter->dst_id, mfilter);
                STAILQ_REMOVE(&mvnic->filter, mfilter, bnxt_filter_info, next);
                STAILQ_INSERT_TAIL(&vnic->filter, mfilter, next);
-               RTE_LOG(ERR, PMD, "filter with matching pattern exists.\n");
-               RTE_LOG(ERR, PMD, " Updated it to the new destination queue\n");
+               PMD_DRV_LOG(ERR, "filter with matching pattern exists.\n");
+               PMD_DRV_LOG(ERR, " Updated it to the new destination queue\n");
                goto free_filter;
        }
        if (mfilter == NULL && filter_op == RTE_ETH_FILTER_DELETE) {
-               RTE_LOG(ERR, PMD, "filter doesn't exist.");
+               PMD_DRV_LOG(ERR, "filter doesn't exist.");
                ret = -ENOENT;
                goto free_filter;
        }
                return 0;
 
        if (arg == NULL) {
-               RTE_LOG(ERR, PMD, "arg shouldn't be NULL for operation %u.",
+               PMD_DRV_LOG(ERR, "arg shouldn't be NULL for operation %u.",
                            filter_op);
                return -EINVAL;
        }
                        filter_op);
                break;
        default:
-               RTE_LOG(ERR, PMD, "unsupported operation %u.", filter_op);
+               PMD_DRV_LOG(ERR, "unsupported operation %u.", filter_op);
                ret = -EINVAL;
                break;
        }
        vnic0 = STAILQ_FIRST(&bp->ff_pool[0]);
        vnic = STAILQ_FIRST(&bp->ff_pool[fdir->action.rx_queue]);
        if (vnic == NULL) {
-               RTE_LOG(ERR, PMD, "Invalid queue %d\n", fdir->action.rx_queue);
+               PMD_DRV_LOG(ERR, "Invalid queue %d\n", fdir->action.rx_queue);
                return -EINVAL;
        }
 
                /* FALLTHROUGH */
                filter = bnxt_get_unused_filter(bp);
                if (filter == NULL) {
-                       RTE_LOG(ERR, PMD,
+                       PMD_DRV_LOG(ERR,
                                "Not enough resources for a new flow.\n");
                        return -ENOMEM;
                }
 
                match = bnxt_match_fdir(bp, filter);
                if (match != NULL && filter_op == RTE_ETH_FILTER_ADD) {
-                       RTE_LOG(ERR, PMD, "Flow already exists.\n");
+                       PMD_DRV_LOG(ERR, "Flow already exists.\n");
                        ret = -EEXIST;
                        goto free_filter;
                }
                if (match == NULL && filter_op == RTE_ETH_FILTER_DELETE) {
-                       RTE_LOG(ERR, PMD, "Flow does not exist.\n");
+                       PMD_DRV_LOG(ERR, "Flow does not exist.\n");
                        ret = -ENOENT;
                        goto free_filter;
                }
        case RTE_ETH_FILTER_STATS:
        case RTE_ETH_FILTER_INFO:
                /* FALLTHROUGH */
-               RTE_LOG(ERR, PMD, "operation %u not implemented", filter_op);
+               PMD_DRV_LOG(ERR, "operation %u not implemented", filter_op);
                break;
        default:
-               RTE_LOG(ERR, PMD, "unknown operation %u", filter_op);
+               PMD_DRV_LOG(ERR, "unknown operation %u", filter_op);
                ret = -EINVAL;
                break;
        }
 
        switch (filter_type) {
        case RTE_ETH_FILTER_TUNNEL:
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "filter type: %d: To be implemented\n", filter_type);
                break;
        case RTE_ETH_FILTER_FDIR:
                *(const void **)arg = &bnxt_flow_ops;
                break;
        default:
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Filter type (%d) not supported", filter_type);
                ret = -EINVAL;
                break;
        uint32_t dir_entries;
        uint32_t entry_length;
 
-       RTE_LOG(INFO, PMD, "%s(): %04x:%02x:%02x:%02x\n",
-               __func__, bp->pdev->addr.domain, bp->pdev->addr.bus,
+       PMD_DRV_LOG(INFO, "%04x:%02x:%02x:%02x\n",
+               bp->pdev->addr.domain, bp->pdev->addr.bus,
                bp->pdev->addr.devid, bp->pdev->addr.function);
 
        rc = bnxt_hwrm_nvm_get_dir_info(bp, &dir_entries, &entry_length);
        uint32_t index;
        uint32_t offset;
 
-       RTE_LOG(INFO, PMD, "%s(): %04x:%02x:%02x:%02x in_eeprom->offset = %d "
-               "len = %d\n", __func__, bp->pdev->addr.domain,
+       PMD_DRV_LOG(INFO, "%04x:%02x:%02x:%02x in_eeprom->offset = %d "
+               "len = %d\n", bp->pdev->addr.domain,
                bp->pdev->addr.bus, bp->pdev->addr.devid,
                bp->pdev->addr.function, in_eeprom->offset, in_eeprom->length);
 
        uint8_t index, dir_op;
        uint16_t type, ext, ordinal, attr;
 
-       RTE_LOG(INFO, PMD, "%s(): %04x:%02x:%02x:%02x in_eeprom->offset = %d "
-               "len = %d\n", __func__, bp->pdev->addr.domain,
+       PMD_DRV_LOG(INFO, "%04x:%02x:%02x:%02x in_eeprom->offset = %d "
+               "len = %d\n", bp->pdev->addr.domain,
                bp->pdev->addr.bus, bp->pdev->addr.devid,
                bp->pdev->addr.function, in_eeprom->offset, in_eeprom->length);
 
        if (!BNXT_PF(bp)) {
-               RTE_LOG(ERR, PMD, "NVM write not supported from a VF\n");
+               PMD_DRV_LOG(ERR, "NVM write not supported from a VF\n");
                return -EINVAL;
        }
 
 
        /* enable device (incl. PCI PM wakeup), and bus-mastering */
        if (!pci_dev->mem_resource[0].addr) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Cannot find PCI device base address, aborting\n");
                rc = -ENODEV;
                goto init_err_disable;
 
        bp->bar0 = (void *)pci_dev->mem_resource[0].addr;
        if (!bp->bar0) {
-               RTE_LOG(ERR, PMD, "Cannot map device registers, aborting\n");
+               PMD_DRV_LOG(ERR, "Cannot map device registers, aborting\n");
                rc = -ENOMEM;
                goto init_err_release;
        }
        int rc;
 
        if (version_printed++ == 0)
-               RTE_LOG(INFO, PMD, "%s\n", bnxt_version);
+               PMD_DRV_LOG(INFO, "%s\n", bnxt_version);
 
        rte_eth_copy_pci_info(eth_dev, pci_dev);
 
 
        rc = bnxt_init_board(eth_dev);
        if (rc) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Board initialization failed rc: %x\n", rc);
                goto error;
        }
                memset(mz->addr, 0, mz->len);
                mz_phys_addr = mz->iova;
                if ((unsigned long)mz->addr == mz_phys_addr) {
-                       RTE_LOG(WARNING, PMD,
+                       PMD_DRV_LOG(WARNING,
                                "Memzone physical address same as virtual.\n");
-                       RTE_LOG(WARNING, PMD,
+                       PMD_DRV_LOG(WARNING,
                                "Using rte_mem_virt2iova()\n");
                        mz_phys_addr = rte_mem_virt2iova(mz->addr);
                        if (mz_phys_addr == 0) {
-                               RTE_LOG(ERR, PMD,
+                               PMD_DRV_LOG(ERR,
                                "unable to map address to physical memory\n");
                                return -ENOMEM;
                        }
                memset(mz->addr, 0, mz->len);
                mz_phys_addr = mz->iova;
                if ((unsigned long)mz->addr == mz_phys_addr) {
-                       RTE_LOG(WARNING, PMD,
+                       PMD_DRV_LOG(WARNING,
                                "Memzone physical address same as virtual.\n");
-                       RTE_LOG(WARNING, PMD,
+                       PMD_DRV_LOG(WARNING,
                                "Using rte_mem_virt2iova()\n");
                        mz_phys_addr = rte_mem_virt2iova(mz->addr);
                        if (mz_phys_addr == 0) {
-                               RTE_LOG(ERR, PMD,
+                               PMD_DRV_LOG(ERR,
                                "unable to map address to physical memory\n");
                                return -ENOMEM;
                        }
 
        rc = bnxt_alloc_hwrm_resources(bp);
        if (rc) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "hwrm resource allocation failure rc: %x\n", rc);
                goto error_free;
        }
                goto error_free;
        rc = bnxt_hwrm_queue_qportcfg(bp);
        if (rc) {
-               RTE_LOG(ERR, PMD, "hwrm queue qportcfg failed\n");
+               PMD_DRV_LOG(ERR, "hwrm queue qportcfg failed\n");
                goto error_free;
        }
 
        rc = bnxt_hwrm_func_qcfg(bp);
        if (rc) {
-               RTE_LOG(ERR, PMD, "hwrm func qcfg failed\n");
+               PMD_DRV_LOG(ERR, "hwrm func qcfg failed\n");
                goto error_free;
        }
 
        /* Get the MAX capabilities for this function */
        rc = bnxt_hwrm_func_qcaps(bp);
        if (rc) {
-               RTE_LOG(ERR, PMD, "hwrm query capability failure rc: %x\n", rc);
+               PMD_DRV_LOG(ERR, "hwrm query capability failure rc: %x\n", rc);
                goto error_free;
        }
        if (bp->max_tx_rings == 0) {
-               RTE_LOG(ERR, PMD, "No TX rings available!\n");
+               PMD_DRV_LOG(ERR, "No TX rings available!\n");
                rc = -EBUSY;
                goto error_free;
        }
        eth_dev->data->mac_addrs = rte_zmalloc("bnxt_mac_addr_tbl",
                                        ETHER_ADDR_LEN * bp->max_l2_ctx, 0);
        if (eth_dev->data->mac_addrs == NULL) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Failed to alloc %u bytes needed to store MAC addr tbl",
                        ETHER_ADDR_LEN * bp->max_l2_ctx);
                rc = -ENOMEM;
 
        if (bp->max_ring_grps < bp->rx_cp_nr_rings) {
                /* 1 ring is for default completion ring */
-               RTE_LOG(ERR, PMD, "Insufficient resource: Ring Group\n");
+               PMD_DRV_LOG(ERR, "Insufficient resource: Ring Group\n");
                rc = -ENOSPC;
                goto error_free;
        }
        bp->grp_info = rte_zmalloc("bnxt_grp_info",
                                sizeof(*bp->grp_info) * bp->max_ring_grps, 0);
        if (!bp->grp_info) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Failed to alloc %zu bytes to store group info table\n",
                        sizeof(*bp->grp_info) * bp->max_ring_grps);
                rc = -ENOMEM;
            ((bp->fw_ver >= ((20 << 24) | (8 << 16))))) {
                memset(bp->pf.vf_req_fwd, 0xff, sizeof(bp->pf.vf_req_fwd));
        } else {
-               RTE_LOG(WARNING, PMD,
+               PMD_DRV_LOG(WARNING,
                        "Firmware too old for VF mailbox functionality\n");
                memset(bp->pf.vf_req_fwd, 0, sizeof(bp->pf.vf_req_fwd));
        }
        ALLOW_FUNC(HWRM_VNIC_TPA_CFG);
        rc = bnxt_hwrm_func_driver_register(bp);
        if (rc) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Failed to register driver");
                rc = -EBUSY;
                goto error_free;
        }
 
-       RTE_LOG(INFO, PMD,
+       PMD_DRV_LOG(INFO,
                DRV_MODULE_NAME " found at mem %" PRIx64 ", node addr %pM\n",
                pci_dev->mem_resource[0].phys_addr,
                pci_dev->mem_resource[0].addr);
 
        rc = bnxt_hwrm_func_reset(bp);
        if (rc) {
-               RTE_LOG(ERR, PMD, "hwrm chip reset failure rc: %x\n", rc);
+               PMD_DRV_LOG(ERR, "hwrm chip reset failure rc: %x\n", rc);
                rc = -EIO;
                goto error_free;
        }
                if (bp->pdev->max_vfs) {
                        rc = bnxt_hwrm_allocate_vfs(bp, bp->pdev->max_vfs);
                        if (rc) {
-                               RTE_LOG(ERR, PMD, "Failed to allocate VFs\n");
+                               PMD_DRV_LOG(ERR, "Failed to allocate VFs\n");
                                goto error_free;
                        }
                } else {
                        rc = bnxt_hwrm_allocate_pf_only(bp);
                        if (rc) {
-                               RTE_LOG(ERR, PMD,
+                               PMD_DRV_LOG(ERR,
                                        "Failed to allocate PF resources\n");
                                goto error_free;
                        }
        return is_device_supported(dev, &bnxt_rte_pmd);
 }
 
+RTE_INIT(bnxt_init_log);
+static void
+bnxt_init_log(void)
+{
+       bnxt_logtype_driver = rte_log_register("pmd.bnxt.driver");
+       if (bnxt_logtype_driver >= 0)
+               rte_log_set_level(bnxt_logtype_driver, RTE_LOG_NOTICE);
+}
+
 RTE_PMD_REGISTER_PCI(net_bnxt, bnxt_rte_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_bnxt, bnxt_pci_id_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_bnxt, "* igb_uio | uio_pci_generic | vfio-pci");
 
        /* Find the 1st unused filter from the free_filter_list pool*/
        filter = STAILQ_FIRST(&bp->free_filter_list);
        if (!filter) {
-               RTE_LOG(ERR, PMD, "No more free filter resources\n");
+               PMD_DRV_LOG(ERR, "No more free filter resources\n");
                return NULL;
        }
        STAILQ_REMOVE_HEAD(&bp->free_filter_list, next);
 
        filter = rte_zmalloc("bnxt_vf_filter_info", sizeof(*filter), 0);
        if (!filter) {
-               RTE_LOG(ERR, PMD, "Failed to alloc memory for VF %hu filters\n",
+               PMD_DRV_LOG(ERR, "Failed to alloc memory for VF %hu filters\n",
                        vf);
                return NULL;
        }
        for (i = 0; i < max_filters; i++) {
                filter = &bp->filter_info[i];
                if (filter->fw_l2_filter_id != ((uint64_t)-1)) {
-                       RTE_LOG(ERR, PMD, "HWRM filter is not freed??\n");
+                       PMD_DRV_LOG(ERR, "HWRM filter is not freed??\n");
                        /* Call HWRM to try to free filter again */
                        rc = bnxt_hwrm_clear_l2_filter(bp, filter);
                        if (rc)
-                               RTE_LOG(ERR, PMD,
+                               PMD_DRV_LOG(ERR,
                                       "HWRM filter cannot be freed rc = %d\n",
                                        rc);
                }
                                 max_filters * sizeof(struct bnxt_filter_info),
                                 0);
        if (filter_mem == NULL) {
-               RTE_LOG(ERR, PMD, "Failed to alloc memory for %d filters",
+               PMD_DRV_LOG(ERR, "Failed to alloc memory for %d filters",
                        max_filters);
                return -ENOMEM;
        }
        /* Find the 1st unused filter from the free_filter_list pool*/
        filter = STAILQ_FIRST(&bp->free_filter_list);
        if (!filter) {
-               RTE_LOG(ERR, PMD, "No more free filter resources\n");
+               PMD_DRV_LOG(ERR, "No more free filter resources\n");
                return NULL;
        }
        STAILQ_REMOVE_HEAD(&bp->free_filter_list, next);
                        /* FALLTHROUGH */
                        /* need ntuple match, reset exact match */
                        if (!use_ntuple) {
-                               RTE_LOG(ERR, PMD,
+                               PMD_DRV_LOG(ERR,
                                        "VLAN flow cannot use NTUPLE filter\n");
                                rte_flow_error_set(error, EINVAL,
                                                   RTE_FLOW_ERROR_TYPE_ITEM,
                        use_ntuple |= 1;
                        break;
                default:
-                       RTE_LOG(ERR, PMD, "Unknown Flow type");
+                       PMD_DRV_LOG(ERR, "Unknown Flow type");
                        use_ntuple |= 1;
                }
                item++;
        int dflt_vnic;
 
        use_ntuple = bnxt_filter_type_check(pattern, error);
-       RTE_LOG(DEBUG, PMD, "Use NTUPLE %d\n", use_ntuple);
+       PMD_DRV_LOG(DEBUG, "Use NTUPLE %d\n", use_ntuple);
        if (use_ntuple < 0)
                return use_ntuple;
 
                return f0;
 
        //This flow needs DST MAC which is not same as port/l2
-       RTE_LOG(DEBUG, PMD, "Create L2 filter for DST MAC\n");
+       PMD_DRV_LOG(DEBUG, "Create L2 filter for DST MAC\n");
        filter1 = bnxt_get_unused_filter(bp);
        if (filter1 == NULL)
                return NULL;
        int rc;
 
        if (bp->eth_dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS) {
-               RTE_LOG(ERR, PMD, "Cannot create flow on RSS queues\n");
+               PMD_DRV_LOG(ERR, "Cannot create flow on RSS queues\n");
                rte_flow_error_set(error, EINVAL,
                                   RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
                                   "Cannot create flow on RSS queues");
                        rc = -rte_errno;
                        goto ret;
                }
-               RTE_LOG(DEBUG, PMD, "Queue index %d\n", act_q->index);
+               PMD_DRV_LOG(DEBUG, "Queue index %d\n", act_q->index);
 
                vnic0 = STAILQ_FIRST(&bp->ff_pool[0]);
                vnic = STAILQ_FIRST(&bp->ff_pool[act_q->index]);
                        goto ret;
                }
                filter->fw_l2_filter_id = filter1->fw_l2_filter_id;
-               RTE_LOG(DEBUG, PMD, "VNIC found\n");
+               PMD_DRV_LOG(DEBUG, "VNIC found\n");
                break;
        case RTE_FLOW_ACTION_TYPE_DROP:
                vnic0 = STAILQ_FIRST(&bp->ff_pool[0]);
 
        filter = bnxt_get_unused_filter(bp);
        if (filter == NULL) {
-               RTE_LOG(ERR, PMD, "Not enough resources for a new flow.\n");
+               PMD_DRV_LOG(ERR, "Not enough resources for a new flow.\n");
                return -ENOMEM;
        }
 
 
        ret = bnxt_flow_agrs_validate(attr, pattern, actions, error);
        if (ret != 0) {
-               RTE_LOG(ERR, PMD, "Not a validate flow.\n");
+               PMD_DRV_LOG(ERR, "Not a validate flow.\n");
                goto free_flow;
        }
 
        filter = bnxt_get_unused_filter(bp);
        if (filter == NULL) {
-               RTE_LOG(ERR, PMD, "Not enough resources for a new flow.\n");
+               PMD_DRV_LOG(ERR, "Not enough resources for a new flow.\n");
                goto free_flow;
        }
 
 
        ret = bnxt_match_filter(bp, filter);
        if (ret == -EEXIST) {
-               RTE_LOG(DEBUG, PMD, "Flow already exists.\n");
+               PMD_DRV_LOG(DEBUG, "Flow already exists.\n");
                /* Clear the filter that was created as part of
                 * validate_and_parse_flow() above
                 */
                bnxt_hwrm_clear_l2_filter(bp, filter);
                goto free_filter;
        } else if (ret == -EXDEV) {
-               RTE_LOG(DEBUG, PMD, "Flow with same pattern exists");
-               RTE_LOG(DEBUG, PMD, "Updating with different destination\n");
+               PMD_DRV_LOG(DEBUG, "Flow with same pattern exists");
+               PMD_DRV_LOG(DEBUG, "Updating with different destination\n");
                update_flow = true;
        }
 
                        ret = -EXDEV;
                        goto free_flow;
                }
-               RTE_LOG(ERR, PMD, "Successfully created flow.\n");
+               PMD_DRV_LOG(ERR, "Successfully created flow.\n");
                STAILQ_INSERT_TAIL(&vnic->flow_list, flow, next);
                return flow;
        }
 
        ret = bnxt_match_filter(bp, filter);
        if (ret == 0)
-               RTE_LOG(ERR, PMD, "Could not find matching flow\n");
+               PMD_DRV_LOG(ERR, "Could not find matching flow\n");
        if (filter->filter_type == HWRM_CFA_EM_FILTER)
                ret = bnxt_hwrm_clear_em_filter(bp, filter);
        if (filter->filter_type == HWRM_CFA_NTUPLE_FILTER)
 
                return 22;
        if (size <= 1 << 30)
                return 30;
-       RTE_LOG(ERR, PMD, "Page size %zu out of range\n", size);
+       PMD_DRV_LOG(ERR, "Page size %zu out of range\n", size);
        return sizeof(void *) * 8 - 1;
 }
 
        }
 
        if (i >= HWRM_CMD_TIMEOUT) {
-               RTE_LOG(ERR, PMD, "Error sending msg 0x%04x\n",
+               PMD_DRV_LOG(ERR, "Error sending msg 0x%04x\n",
                        req->req_type);
                goto err_ret;
        }
 
 #define HWRM_CHECK_RESULT() do {\
        if (rc) { \
-               RTE_LOG(ERR, PMD, "%s failed rc:%d\n", \
-                       __func__, rc); \
+               PMD_DRV_LOG(ERR, "failed rc:%d\n", rc); \
                rte_spinlock_unlock(&bp->hwrm_lock); \
                return rc; \
        } \
                if (resp->resp_len >= 16) { \
                        struct hwrm_err_output *tmp_hwrm_err_op = \
                                                (void *)resp; \
-                       RTE_LOG(ERR, PMD, \
-                               "%s error %d:%d:%08x:%04x\n", \
-                               __func__, \
+                       PMD_DRV_LOG(ERR, \
+                               "error %d:%d:%08x:%04x\n", \
                                rc, tmp_hwrm_err_op->cmd_err, \
                                rte_le_to_cpu_32(\
                                        tmp_hwrm_err_op->opaque_0), \
                                rte_le_to_cpu_16(\
                                        tmp_hwrm_err_op->opaque_1)); \
-               } \
-               else { \
-                       RTE_LOG(ERR, PMD, \
-                               "%s error %d\n", __func__, rc); \
+               } else { \
+                       PMD_DRV_LOG(ERR, "error %d\n", rc); \
                } \
                rte_spinlock_unlock(&bp->hwrm_lock); \
                return rc; \
        //TODO: Is there a better way to add VLANs to each VNIC in case of VMDQ
        if ((dev_conf->rxmode.mq_mode & ETH_MQ_RX_VMDQ_FLAG) &&
            conf->pool_map[j].pools & (1UL << j)) {
-               RTE_LOG(DEBUG, PMD,
+               PMD_DRV_LOG(DEBUG,
                        "Add vlan %u to vmdq pool %u\n",
                        conf->pool_map[j].vlan_id, j);
 
                                                    getpagesize(),
                                                    getpagesize());
                                if (bp->pf.vf_info[i].vlan_table == NULL)
-                                       RTE_LOG(ERR, PMD,
+                                       PMD_DRV_LOG(ERR,
                                        "Fail to alloc VLAN table for VF %d\n",
                                        i);
                                else
                                                    getpagesize(),
                                                    getpagesize());
                                if (bp->pf.vf_info[i].vlan_as_table == NULL)
-                                       RTE_LOG(ERR, PMD,
+                                       PMD_DRV_LOG(ERR,
                                        "Alloc VLAN AS table for VF %d fail\n",
                                        i);
                                else
                bp->pf.total_vnics = rte_le_to_cpu_16(resp->max_vnics);
                if (flags & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED) {
                        bp->flags |= BNXT_FLAG_PTP_SUPPORTED;
-                       RTE_LOG(INFO, PMD, "PTP SUPPORTED");
+                       PMD_DRV_LOG(INFO, "PTP SUPPORTED\n");
                        HWRM_UNLOCK();
                        bnxt_hwrm_ptp_qcfg(bp);
                }
 
        HWRM_CHECK_RESULT();
 
-       RTE_LOG(INFO, PMD, "%d.%d.%d:%d.%d.%d\n",
+       PMD_DRV_LOG(INFO, "%d.%d.%d:%d.%d.%d\n",
                resp->hwrm_intf_maj, resp->hwrm_intf_min,
                resp->hwrm_intf_upd,
                resp->hwrm_fw_maj, resp->hwrm_fw_min, resp->hwrm_fw_bld);
        bp->fw_ver = (resp->hwrm_fw_maj << 24) | (resp->hwrm_fw_min << 16) |
                        (resp->hwrm_fw_bld << 8) | resp->hwrm_fw_rsvd;
-       RTE_LOG(INFO, PMD, "Driver HWRM version: %d.%d.%d\n",
+       PMD_DRV_LOG(INFO, "Driver HWRM version: %d.%d.%d\n",
                HWRM_VERSION_MAJOR, HWRM_VERSION_MINOR, HWRM_VERSION_UPDATE);
 
        my_version = HWRM_VERSION_MAJOR << 16;
        fw_version |= resp->hwrm_intf_upd;
 
        if (resp->hwrm_intf_maj != HWRM_VERSION_MAJOR) {
-               RTE_LOG(ERR, PMD, "Unsupported firmware API version\n");
+               PMD_DRV_LOG(ERR, "Unsupported firmware API version\n");
                rc = -EINVAL;
                goto error;
        }
 
        if (my_version != fw_version) {
-               RTE_LOG(INFO, PMD, "BNXT Driver/HWRM API mismatch.\n");
+               PMD_DRV_LOG(INFO, "BNXT Driver/HWRM API mismatch.\n");
                if (my_version < fw_version) {
-                       RTE_LOG(INFO, PMD,
+                       PMD_DRV_LOG(INFO,
                                "Firmware API version is newer than driver.\n");
-                       RTE_LOG(INFO, PMD,
+                       PMD_DRV_LOG(INFO,
                                "The driver may be missing features.\n");
                } else {
-                       RTE_LOG(INFO, PMD,
+                       PMD_DRV_LOG(INFO,
                                "Firmware API version is older than driver.\n");
-                       RTE_LOG(INFO, PMD,
+                       PMD_DRV_LOG(INFO,
                                "Not all driver features may be functional.\n");
                }
        }
 
        if (bp->max_req_len > resp->max_req_win_len) {
-               RTE_LOG(ERR, PMD, "Unsupported request length\n");
+               PMD_DRV_LOG(ERR, "Unsupported request length\n");
                rc = -EINVAL;
        }
        bp->max_req_len = rte_le_to_cpu_16(resp->max_req_win_len);
                bp->hwrm_cmd_resp_dma_addr =
                        rte_mem_virt2iova(bp->hwrm_cmd_resp_addr);
                if (bp->hwrm_cmd_resp_dma_addr == 0) {
-                       RTE_LOG(ERR, PMD,
+                       PMD_DRV_LOG(ERR,
                        "Unable to map response buffer to physical memory.\n");
                        rc = -ENOMEM;
                        goto error;
                HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_SUPPORTED) &&
            (dev_caps_cfg &
             HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_INPUTUIRED)) {
-               RTE_LOG(DEBUG, PMD, "Short command supported\n");
+               PMD_DRV_LOG(DEBUG, "Short command supported\n");
 
                rte_free(bp->hwrm_short_cmd_req_addr);
 
                        rte_mem_virt2iova(bp->hwrm_short_cmd_req_addr);
                if (bp->hwrm_short_cmd_req_dma_addr == 0) {
                        rte_free(bp->hwrm_short_cmd_req_addr);
-                       RTE_LOG(ERR, PMD,
+                       PMD_DRV_LOG(ERR,
                                "Unable to map buffer to physical memory.\n");
                        rc = -ENOMEM;
                        goto error;
                /* Setting Fixed Speed. But AutoNeg is ON, So disable it */
                if (bp->link_info.auto_mode && conf->link_speed) {
                        req.auto_mode = HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE;
-                       RTE_LOG(DEBUG, PMD, "Disabling AutoNeg\n");
+                       PMD_DRV_LOG(DEBUG, "Disabling AutoNeg\n");
                }
 
                req.flags = rte_cpu_to_le_32(conf->phy_flags);
        } else {
                req.flags =
                rte_cpu_to_le_32(HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DWN);
-               RTE_LOG(INFO, PMD, "Force Link Down\n");
+               PMD_DRV_LOG(INFO, "Force Link Down\n");
        }
 
        rc = bnxt_hwrm_send_message(bp, &req, sizeof(req));
                req.int_mode = HWRM_RING_ALLOC_INPUT_INT_MODE_MSIX;
                break;
        default:
-               RTE_LOG(ERR, PMD, "hwrm alloc invalid ring type %d\n",
+               PMD_DRV_LOG(ERR, "hwrm alloc invalid ring type %d\n",
                        ring_type);
                HWRM_UNLOCK();
                return -1;
                        rc = rte_le_to_cpu_16(resp->error_code);
                switch (ring_type) {
                case HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL:
-                       RTE_LOG(ERR, PMD,
+                       PMD_DRV_LOG(ERR,
                                "hwrm_ring_alloc cp failed. rc:%d\n", rc);
                        HWRM_UNLOCK();
                        return rc;
                case HWRM_RING_FREE_INPUT_RING_TYPE_RX:
-                       RTE_LOG(ERR, PMD,
+                       PMD_DRV_LOG(ERR,
                                "hwrm_ring_alloc rx failed. rc:%d\n", rc);
                        HWRM_UNLOCK();
                        return rc;
                case HWRM_RING_FREE_INPUT_RING_TYPE_TX:
-                       RTE_LOG(ERR, PMD,
+                       PMD_DRV_LOG(ERR,
                                "hwrm_ring_alloc tx failed. rc:%d\n", rc);
                        HWRM_UNLOCK();
                        return rc;
                default:
-                       RTE_LOG(ERR, PMD, "Invalid ring. rc:%d\n", rc);
+                       PMD_DRV_LOG(ERR, "Invalid ring. rc:%d\n", rc);
                        HWRM_UNLOCK();
                        return rc;
                }
 
                switch (ring_type) {
                case HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL:
-                       RTE_LOG(ERR, PMD, "hwrm_ring_free cp failed. rc:%d\n",
+                       PMD_DRV_LOG(ERR, "hwrm_ring_free cp failed. rc:%d\n",
                                rc);
                        return rc;
                case HWRM_RING_FREE_INPUT_RING_TYPE_RX:
-                       RTE_LOG(ERR, PMD, "hwrm_ring_free rx failed. rc:%d\n",
+                       PMD_DRV_LOG(ERR, "hwrm_ring_free rx failed. rc:%d\n",
                                rc);
                        return rc;
                case HWRM_RING_FREE_INPUT_RING_TYPE_TX:
-                       RTE_LOG(ERR, PMD, "hwrm_ring_free tx failed. rc:%d\n",
+                       PMD_DRV_LOG(ERR, "hwrm_ring_free tx failed. rc:%d\n",
                                rc);
                        return rc;
                default:
-                       RTE_LOG(ERR, PMD, "Invalid ring, rc:%d\n", rc);
+                       PMD_DRV_LOG(ERR, "Invalid ring, rc:%d\n", rc);
                        return rc;
                }
        }
        struct hwrm_vnic_alloc_output *resp = bp->hwrm_cmd_resp_addr;
 
        /* map ring groups to this vnic */
-       RTE_LOG(DEBUG, PMD, "Alloc VNIC. Start %x, End %x\n",
+       PMD_DRV_LOG(DEBUG, "Alloc VNIC. Start %x, End %x\n",
                vnic->start_grp_id, vnic->end_grp_id);
        for (i = vnic->start_grp_id, j = 0; i <= vnic->end_grp_id; i++, j++)
                vnic->fw_grp_ids[j] = bp->grp_info[i].fw_grp_id;
 
        vnic->fw_vnic_id = rte_le_to_cpu_16(resp->vnic_id);
        HWRM_UNLOCK();
-       RTE_LOG(DEBUG, PMD, "VNIC ID %x\n", vnic->fw_vnic_id);
+       PMD_DRV_LOG(DEBUG, "VNIC ID %x\n", vnic->fw_vnic_id);
        return rc;
 }
 
        struct bnxt_plcmodes_cfg pmodes;
 
        if (vnic->fw_vnic_id == INVALID_HW_RING_ID) {
-               RTE_LOG(DEBUG, PMD, "VNIC ID %x\n", vnic->fw_vnic_id);
+               PMD_DRV_LOG(DEBUG, "VNIC ID %x\n", vnic->fw_vnic_id);
                return rc;
        }
 
        struct hwrm_vnic_qcfg_output *resp = bp->hwrm_cmd_resp_addr;
 
        if (vnic->fw_vnic_id == INVALID_HW_RING_ID) {
-               RTE_LOG(DEBUG, PMD, "VNIC QCFG ID %d\n", vnic->fw_vnic_id);
+               PMD_DRV_LOG(DEBUG, "VNIC QCFG ID %d\n", vnic->fw_vnic_id);
                return rc;
        }
        HWRM_PREP(req, VNIC_QCFG);
 
        vnic->rss_rule = rte_le_to_cpu_16(resp->rss_cos_lb_ctx_id);
        HWRM_UNLOCK();
-       RTE_LOG(DEBUG, PMD, "VNIC RSS Rule %x\n", vnic->rss_rule);
+       PMD_DRV_LOG(DEBUG, "VNIC RSS Rule %x\n", vnic->rss_rule);
 
        return rc;
 }
                                                bp->hwrm_cmd_resp_addr;
 
        if (vnic->rss_rule == 0xffff) {
-               RTE_LOG(DEBUG, PMD, "VNIC RSS Rule %x\n", vnic->rss_rule);
+               PMD_DRV_LOG(DEBUG, "VNIC RSS Rule %x\n", vnic->rss_rule);
                return rc;
        }
        HWRM_PREP(req, VNIC_RSS_COS_LB_CTX_FREE);
        struct hwrm_vnic_free_output *resp = bp->hwrm_cmd_resp_addr;
 
        if (vnic->fw_vnic_id == INVALID_HW_RING_ID) {
-               RTE_LOG(DEBUG, PMD, "VNIC FREE ID %x\n", vnic->fw_vnic_id);
+               PMD_DRV_LOG(DEBUG, "VNIC FREE ID %x\n", vnic->fw_vnic_id);
                return rc;
        }
 
        bp->hwrm_cmd_resp_dma_addr =
                rte_mem_virt2iova(bp->hwrm_cmd_resp_addr);
        if (bp->hwrm_cmd_resp_dma_addr == 0) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "unable to map response address to physical memory\n");
                return -ENOMEM;
        }
 
        STAILQ_FOREACH(flow, &vnic->flow_list, next) {
                filter = flow->filter;
-               RTE_LOG(ERR, PMD, "filter type %d\n", filter->filter_type);
+               PMD_DRV_LOG(ERR, "filter type %d\n", filter->filter_type);
                if (filter->filter_type == HWRM_CFA_EM_FILTER)
                        rc = bnxt_hwrm_clear_em_filter(bp, filter);
                else if (filter->filter_type == HWRM_CFA_NTUPLE_FILTER)
                        HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB;
                break;
        default:
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Unsupported link speed %d; default to AUTO\n",
                        conf_link_speed);
                break;
                one_speed = link_speed & ~ETH_LINK_SPEED_FIXED;
 
                if (one_speed & (one_speed - 1)) {
-                       RTE_LOG(ERR, PMD,
+                       PMD_DRV_LOG(ERR,
                                "Invalid advertised speeds (%u) for port %u\n",
                                link_speed, port_id);
                        return -EINVAL;
                }
                if ((one_speed & BNXT_SUPPORTED_SPEEDS) != one_speed) {
-                       RTE_LOG(ERR, PMD,
+                       PMD_DRV_LOG(ERR,
                                "Unsupported advertised speed (%u) for port %u\n",
                                link_speed, port_id);
                        return -EINVAL;
                }
        } else {
                if (!(link_speed & BNXT_SUPPORTED_SPEEDS)) {
-                       RTE_LOG(ERR, PMD,
+                       PMD_DRV_LOG(ERR,
                                "Unsupported advertised speeds (%u) for port %u\n",
                                link_speed, port_id);
                        return -EINVAL;
                break;
        case HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2GB:
        default:
-               RTE_LOG(ERR, PMD, "HWRM link speed %d not defined\n",
+               PMD_DRV_LOG(ERR, "HWRM link speed %d not defined\n",
                        hw_link_speed);
                break;
        }
                eth_link_duplex = ETH_LINK_HALF_DUPLEX;
                break;
        default:
-               RTE_LOG(ERR, PMD, "HWRM link duplex %d not defined\n",
+               PMD_DRV_LOG(ERR, "HWRM link duplex %d not defined\n",
                        hw_link_duplex);
                break;
        }
 
        rc = bnxt_hwrm_port_phy_qcfg(bp, link_info);
        if (rc) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Get link config failed with rc %d\n", rc);
                goto exit;
        }
                    HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE ||
                    bp->link_info.media_type ==
                    HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_TP) {
-                       RTE_LOG(ERR, PMD, "10GBase-T devices must autoneg\n");
+                       PMD_DRV_LOG(ERR, "10GBase-T devices must autoneg\n");
                        return -EINVAL;
                }
 
 port_phy_cfg:
        rc = bnxt_hwrm_port_phy_cfg(bp, &link_req);
        if (rc) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Set link config failed with rc %d\n", rc);
        }
 
        rc = bnxt_hwrm_send_message(bp, &req, sizeof(req));
 
        if (rc) {
-               RTE_LOG(ERR, PMD, "hwrm_func_qcaps failed rc:%d\n", rc);
+               PMD_DRV_LOG(ERR, "hwrm_func_qcaps failed rc:%d\n", rc);
                copy_func_cfg_to_qcaps(cfg_req, resp);
        } else if (resp->error_code) {
                rc = rte_le_to_cpu_16(resp->error_code);
-               RTE_LOG(ERR, PMD, "hwrm_func_qcaps error %d\n", rc);
+               PMD_DRV_LOG(ERR, "hwrm_func_qcaps error %d\n", rc);
                copy_func_cfg_to_qcaps(cfg_req, resp);
        }
 
        req.fid = rte_cpu_to_le_16(bp->pf.vf_info[vf].fid);
        rc = bnxt_hwrm_send_message(bp, &req, sizeof(req));
        if (rc) {
-               RTE_LOG(ERR, PMD, "hwrm_func_qcfg failed rc:%d\n", rc);
+               PMD_DRV_LOG(ERR, "hwrm_func_qcfg failed rc:%d\n", rc);
                return -1;
        } else if (resp->error_code) {
                rc = rte_le_to_cpu_16(resp->error_code);
-               RTE_LOG(ERR, PMD, "hwrm_func_qcfg error %d\n", rc);
+               PMD_DRV_LOG(ERR, "hwrm_func_qcfg error %d\n", rc);
                return -1;
        }
        rc = rte_le_to_cpu_16(resp->vlan);
        int rc;
 
        if (!BNXT_PF(bp)) {
-               RTE_LOG(ERR, PMD, "Attempt to allcoate VFs on a VF!\n");
+               PMD_DRV_LOG(ERR, "Attempt to allcoate VFs on a VF!\n");
                return -1;
        }
 
        size_t req_buf_sz;
 
        if (!BNXT_PF(bp)) {
-               RTE_LOG(ERR, PMD, "Attempt to allcoate VFs on a VF!\n");
+               PMD_DRV_LOG(ERR, "Attempt to allcoate VFs on a VF!\n");
                return -1;
        }
 
                                HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_MAC_ADDR);
 
                if (rc || resp->error_code) {
-                       RTE_LOG(ERR, PMD,
+                       PMD_DRV_LOG(ERR,
                                "Failed to initizlie VF %d\n", i);
-                       RTE_LOG(ERR, PMD,
+                       PMD_DRV_LOG(ERR,
                                "Not all VFs available. (%d, %d)\n",
                                rc, resp->error_code);
                        HWRM_UNLOCK();
        req.req_buf_page_addr[0] =
                rte_cpu_to_le_64(rte_mem_virt2iova(bp->pf.vf_req_buf));
        if (req.req_buf_page_addr[0] == 0) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "unable to map buffer address to physical memory\n");
                return -ENOMEM;
        }
                return -ENOMEM;
        dma_handle = rte_mem_virt2iova(buf);
        if (dma_handle == 0) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "unable to map response address to physical memory\n");
                return -ENOMEM;
        }
 
        dma_handle = rte_mem_virt2iova(buf);
        if (dma_handle == 0) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "unable to map response address to physical memory\n");
                return -ENOMEM;
        }
 
        dma_handle = rte_mem_virt2iova(buf);
        if (dma_handle == 0) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "unable to map response address to physical memory\n");
                return -ENOMEM;
        }
 
        if (req.vnic_id_tbl_addr == 0) {
                HWRM_UNLOCK();
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                "unable to map VNIC ID table address to physical memory\n");
                return -ENOMEM;
        }
        rc = bnxt_hwrm_send_message(bp, &req, sizeof(req));
        if (rc) {
                HWRM_UNLOCK();
-               RTE_LOG(ERR, PMD, "hwrm_func_vf_vnic_query failed rc:%d\n", rc);
+               PMD_DRV_LOG(ERR, "hwrm_func_vf_vnic_query failed rc:%d\n", rc);
                return -1;
        } else if (resp->error_code) {
                rc = rte_le_to_cpu_16(resp->error_code);
                HWRM_UNLOCK();
-               RTE_LOG(ERR, PMD, "hwrm_func_vf_vnic_query error %d\n", rc);
+               PMD_DRV_LOG(ERR, "hwrm_func_vf_vnic_query error %d\n", rc);
                return -1;
        }
        rc = rte_le_to_cpu_32(resp->vnic_id_cnt);
                }
        }
        /* Could not find a default VNIC. */
-       RTE_LOG(ERR, PMD, "No default VNIC\n");
+       PMD_DRV_LOG(ERR, "No default VNIC\n");
 exit:
        rte_free(vnic_ids);
        return -1;
        if (filter->fw_em_filter_id == UINT64_MAX)
                return 0;
 
-       RTE_LOG(ERR, PMD, "Clear EM filter\n");
+       PMD_DRV_LOG(ERR, "Clear EM filter\n");
        HWRM_PREP(req, CFA_EM_FLOW_FREE);
 
        req.em_filter_id = rte_cpu_to_le_64(filter->fw_em_filter_id);
 
                                               cpr->cp_ring_struct))
                                        goto no_more;
                        }
-                       RTE_LOG(INFO, PMD,
+                       PMD_DRV_LOG(INFO,
                                "Ignoring %02x completion\n", CMP_TYPE(cmp));
                        break;
                }
        return 0;
 
 setup_exit:
-       RTE_LOG(ERR, PMD, "bnxt_irq_tbl setup failed\n");
+       PMD_DRV_LOG(ERR, "bnxt_irq_tbl setup failed\n");
        return rc;
 }
 
 
        memset(mz->addr, 0, mz->len);
        mz_phys_addr = mz->iova;
        if ((unsigned long)mz->addr == mz_phys_addr) {
-               RTE_LOG(WARNING, PMD,
+               PMD_DRV_LOG(WARNING,
                        "Memzone physical address same as virtual.\n");
-               RTE_LOG(WARNING, PMD,
+               PMD_DRV_LOG(WARNING,
                        "Using rte_mem_virt2iova()\n");
                for (sz = 0; sz < total_alloc_len; sz += getpagesize())
                        rte_mem_lock_page(((char *)mz->addr) + sz);
                mz_phys_addr = rte_mem_virt2iova(mz->addr);
                if (mz_phys_addr == 0) {
-                       RTE_LOG(ERR, PMD,
+                       PMD_DRV_LOG(ERR,
                        "unable to map ring address to physical memory\n");
                        return -ENOMEM;
                }
                ring = rxr->ag_ring_struct;
                /* Agg ring */
                if (ring == NULL) {
-                       RTE_LOG(ERR, PMD, "Alloc AGG Ring is NULL!\n");
+                       PMD_DRV_LOG(ERR, "Alloc AGG Ring is NULL!\n");
                        goto err_out;
                }
 
                                cp_ring->fw_ring_id);
                if (rc)
                        goto err_out;
-               RTE_LOG(DEBUG, PMD, "Alloc AGG Done!\n");
+               PMD_DRV_LOG(DEBUG, "Alloc AGG Done!\n");
                rxr->ag_prod = 0;
                rxr->ag_doorbell =
                    (char *)pci_dev->mem_resource[2].addr +
                rxq->rx_buf_use_size = BNXT_MAX_MTU + ETHER_HDR_LEN +
                                        ETHER_CRC_LEN + (2 * VLAN_TAG_SIZE);
                if (bnxt_init_one_rx_ring(rxq)) {
-                       RTE_LOG(ERR, PMD, "bnxt_init_one_rx_ring failed!\n");
+                       PMD_DRV_LOG(ERR, "bnxt_init_one_rx_ring failed!\n");
                        bnxt_rx_queue_release_op(rxq);
                        return -ENOMEM;
                }
 
        if (bp->rx_cp_nr_rings < 2) {
                vnic = bnxt_alloc_vnic(bp);
                if (!vnic) {
-                       RTE_LOG(ERR, PMD, "VNIC alloc failed\n");
+                       PMD_DRV_LOG(ERR, "VNIC alloc failed\n");
                        rc = -ENOMEM;
                        goto err_out;
                }
                vnic->end_grp_id = vnic->start_grp_id;
                filter = bnxt_alloc_filter(bp);
                if (!filter) {
-                       RTE_LOG(ERR, PMD, "L2 filter alloc failed\n");
+                       PMD_DRV_LOG(ERR, "L2 filter alloc failed\n");
                        rc = -ENOMEM;
                        goto err_out;
                }
                        pools = bp->rx_cp_nr_rings;
                        break;
                default:
-                       RTE_LOG(ERR, PMD, "Unsupported mq_mod %d\n",
+                       PMD_DRV_LOG(ERR, "Unsupported mq_mod %d\n",
                                dev_conf->rxmode.mq_mode);
                        rc = -EINVAL;
                        goto err_out;
        for (i = 0; i < pools; i++) {
                vnic = bnxt_alloc_vnic(bp);
                if (!vnic) {
-                       RTE_LOG(ERR, PMD, "VNIC alloc failed\n");
+                       PMD_DRV_LOG(ERR, "VNIC alloc failed\n");
                        rc = -ENOMEM;
                        goto err_out;
                }
                }
                filter = bnxt_alloc_filter(bp);
                if (!filter) {
-                       RTE_LOG(ERR, PMD, "L2 filter alloc failed\n");
+                       PMD_DRV_LOG(ERR, "L2 filter alloc failed\n");
                        rc = -ENOMEM;
                        goto err_out;
                }
        int rc = 0;
 
        if (queue_idx >= bp->max_rx_rings) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Cannot create Rx ring %d. Only %d rings available\n",
                        queue_idx, bp->max_rx_rings);
                return -ENOSPC;
        }
 
        if (!nb_desc || nb_desc > MAX_RX_DESC_CNT) {
-               RTE_LOG(ERR, PMD, "nb_desc %d is invalid\n", nb_desc);
+               PMD_DRV_LOG(ERR, "nb_desc %d is invalid\n", nb_desc);
                rc = -EINVAL;
                goto out;
        }
        rxq = rte_zmalloc_socket("bnxt_rx_queue", sizeof(struct bnxt_rx_queue),
                                 RTE_CACHE_LINE_SIZE, socket_id);
        if (!rxq) {
-               RTE_LOG(ERR, PMD, "bnxt_rx_queue allocation failed!\n");
+               PMD_DRV_LOG(ERR, "bnxt_rx_queue allocation failed!\n");
                rc = -ENOMEM;
                goto out;
        }
        rxq->nb_rx_desc = nb_desc;
        rxq->rx_free_thresh = rx_conf->rx_free_thresh;
 
-       RTE_LOG(DEBUG, PMD, "RX Buf size is %d\n", rxq->rx_buf_use_size);
-       RTE_LOG(DEBUG, PMD, "RX Buf MTU %d\n", eth_dev->data->mtu);
+       PMD_DRV_LOG(DEBUG, "RX Buf size is %d\n", rxq->rx_buf_use_size);
+       PMD_DRV_LOG(DEBUG, "RX Buf MTU %d\n", eth_dev->data->mtu);
 
        rc = bnxt_init_rx_ring_struct(rxq, socket_id);
        if (rc)
        /* Allocate RX ring hardware descriptors */
        if (bnxt_alloc_rings(bp, queue_idx, NULL, rxq->rx_ring, rxq->cp_ring,
                        "rxr")) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "ring_dma_zone_reserve for rx_ring failed!\n");
                bnxt_rx_queue_release_op(rxq);
                rc = -ENOMEM;
 
        }
 
        if (rxbd == NULL)
-               RTE_LOG(ERR, PMD, "Jumbo Frame. rxbd is NULL\n");
+               PMD_DRV_LOG(ERR, "Jumbo Frame. rxbd is NULL\n");
        if (rx_buf == NULL)
-               RTE_LOG(ERR, PMD, "Jumbo Frame. rx_buf is NULL\n");
+               PMD_DRV_LOG(ERR, "Jumbo Frame. rx_buf is NULL\n");
 
 
        rx_buf->mbuf = mbuf;
        /* TODO batch allocation for better performance */
        while (rte_bitmap_get(rxr->ag_bitmap, next)) {
                if (unlikely(bnxt_alloc_ag_data(rxq, rxr, next))) {
-                       RTE_LOG(ERR, PMD,
+                       PMD_DRV_LOG(ERR,
                                "agg mbuf alloc failed: prod=0x%x\n", next);
                        break;
                }
         */
        prod = RING_NEXT(rxr->rx_ring_struct, prod);
        if (bnxt_alloc_rx_data(rxq, rxr, prod)) {
-               RTE_LOG(ERR, PMD, "mbuf alloc failed with prod=0x%x\n", prod);
+               PMD_DRV_LOG(ERR, "mbuf alloc failed with prod=0x%x\n", prod);
                rc = -ENOMEM;
                goto rx;
        }
                                rxr->rx_prod = i;
                                B_RX_DB(rxr->rx_doorbell, rxr->rx_prod);
                        } else {
-                               RTE_LOG(ERR, PMD, "Alloc  mbuf failed\n");
+                               PMD_DRV_LOG(ERR, "Alloc  mbuf failed\n");
                                break;
                        }
                }
        prod = rxr->rx_prod;
        for (i = 0; i < ring->ring_size; i++) {
                if (bnxt_alloc_rx_data(rxq, rxr, prod) != 0) {
-                       RTE_LOG(WARNING, PMD,
+                       PMD_DRV_LOG(WARNING,
                                "init'ed rx ring %d with %d/%d mbufs only\n",
                                rxq->queue_id, i, ring->ring_size);
                        break;
                rxr->rx_prod = prod;
                prod = RING_NEXT(rxr->rx_ring_struct, prod);
        }
-       RTE_LOG(DEBUG, PMD, "%s\n", __func__);
 
        ring = rxr->ag_ring_struct;
        type = RX_PROD_AGG_BD_TYPE_RX_PROD_AGG;
 
        for (i = 0; i < ring->ring_size; i++) {
                if (bnxt_alloc_ag_data(rxq, rxr, prod) != 0) {
-                       RTE_LOG(WARNING, PMD,
+                       PMD_DRV_LOG(WARNING,
                        "init'ed AG ring %d with %d/%d mbufs only\n",
                        rxq->queue_id, i, ring->ring_size);
                        break;
                rxr->ag_prod = prod;
                prod = RING_NEXT(rxr->ag_ring_struct, prod);
        }
-       RTE_LOG(DEBUG, PMD, "%s AGG Done!\n", __func__);
+       PMD_DRV_LOG(DEBUG, "AGG Done!\n");
 
        if (rxr->tpa_info) {
                for (i = 0; i < BNXT_TPA_MAX; i++) {
                        }
                }
        }
-       RTE_LOG(DEBUG, PMD, "%s TPA alloc Done!\n", __func__);
+       PMD_DRV_LOG(DEBUG, "TPA alloc Done!\n");
 
        return 0;
 }
 
 
        memset(bnxt_stats, 0, sizeof(*bnxt_stats));
        if (!(bp->flags & BNXT_FLAG_INIT_DONE)) {
-               RTE_LOG(ERR, PMD, "Device Initialization not complete!\n");
+               PMD_DRV_LOG(ERR, "Device Initialization not complete!\n");
                return 0;
        }
 
        struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
 
        if (!(bp->flags & BNXT_FLAG_INIT_DONE)) {
-               RTE_LOG(ERR, PMD, "Device Initialization not complete!\n");
+               PMD_DRV_LOG(ERR, "Device Initialization not complete!\n");
                return;
        }
 
        uint64_t tx_drop_pkts;
 
        if (!(bp->flags & BNXT_FLAG_PORT_STATS)) {
-               RTE_LOG(ERR, PMD, "xstats not supported for VF\n");
+               PMD_DRV_LOG(ERR, "xstats not supported for VF\n");
                return 0;
        }
 
                bnxt_hwrm_port_clr_stats(bp);
 
        if (BNXT_VF(bp))
-               RTE_LOG(ERR, PMD, "Operation not supported on a VF device\n");
+               PMD_DRV_LOG(ERR, "Operation not supported on a VF device\n");
        if (!BNXT_SINGLE_PF(bp))
-               RTE_LOG(ERR, PMD, "Operation not supported on a MF device\n");
+               PMD_DRV_LOG(ERR, "Operation not supported on a MF device\n");
        if (!(bp->flags & BNXT_FLAG_PORT_STATS))
-               RTE_LOG(ERR, PMD, "Operation not supported\n");
+               PMD_DRV_LOG(ERR, "Operation not supported\n");
 }
 
 int bnxt_dev_xstats_get_by_id_op(struct rte_eth_dev *dev, const uint64_t *ids,
        bnxt_dev_xstats_get_by_id_op(dev, NULL, values_copy, stat_cnt);
        for (i = 0; i < limit; i++) {
                if (ids[i] >= stat_cnt) {
-                       RTE_LOG(ERR, PMD, "id value isn't valid");
+                       PMD_DRV_LOG(ERR, "id value isn't valid");
                        return -1;
                }
                values[i] = values_copy[ids[i]];
 
        for (i = 0; i < limit; i++) {
                if (ids[i] >= stat_cnt) {
-                       RTE_LOG(ERR, PMD, "id value isn't valid");
+                       PMD_DRV_LOG(ERR, "id value isn't valid");
                        return -1;
                }
                strcpy(xstats_names[i].name,
 
        int rc = 0;
 
        if (queue_idx >= bp->max_tx_rings) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Cannot create Tx ring %d. Only %d rings available\n",
                        queue_idx, bp->max_tx_rings);
                return -ENOSPC;
        }
 
        if (!nb_desc || nb_desc > MAX_TX_DESC_CNT) {
-               RTE_LOG(ERR, PMD, "nb_desc %d is invalid", nb_desc);
+               PMD_DRV_LOG(ERR, "nb_desc %d is invalid", nb_desc);
                rc = -EINVAL;
                goto out;
        }
        txq = rte_zmalloc_socket("bnxt_tx_queue", sizeof(struct bnxt_tx_queue),
                                 RTE_CACHE_LINE_SIZE, socket_id);
        if (!txq) {
-               RTE_LOG(ERR, PMD, "bnxt_tx_queue allocation failed!");
+               PMD_DRV_LOG(ERR, "bnxt_tx_queue allocation failed!");
                rc = -ENOMEM;
                goto out;
        }
        /* Allocate TX ring hardware descriptors */
        if (bnxt_alloc_rings(bp, queue_idx, txq->tx_ring, NULL, txq->cp_ring,
                        "txr")) {
-               RTE_LOG(ERR, PMD, "ring_dma_zone_reserve for tx_ring failed!");
+               PMD_DRV_LOG(ERR, "ring_dma_zone_reserve for tx_ring failed!");
                bnxt_tx_queue_release_op(txq);
                rc = -ENOMEM;
                goto out;
        }
 
        if (bnxt_init_one_tx_ring(txq)) {
-               RTE_LOG(ERR, PMD, "bnxt_init_one_tx_ring failed!");
+               PMD_DRV_LOG(ERR, "bnxt_init_one_tx_ring failed!");
                bnxt_tx_queue_release_op(txq);
                rc = -ENOMEM;
                goto out;
 
                }
                temp = STAILQ_NEXT(temp, next);
        }
-       RTE_LOG(ERR, PMD, "VNIC %p is not found in pool[%d]\n", vnic, pool);
+       PMD_DRV_LOG(ERR, "VNIC %p is not found in pool[%d]\n", vnic, pool);
        return -EINVAL;
 }
 
        /* Find the 1st unused vnic from the free_vnic_list pool*/
        vnic = STAILQ_FIRST(&bp->free_vnic_list);
        if (!vnic) {
-               RTE_LOG(ERR, PMD, "No more free VNIC resources\n");
+               PMD_DRV_LOG(ERR, "No more free VNIC resources\n");
                return NULL;
        }
        STAILQ_REMOVE_HEAD(&bp->free_vnic_list, next);
        }
        mz_phys_addr = mz->iova;
        if ((unsigned long)mz->addr == mz_phys_addr) {
-               RTE_LOG(WARNING, PMD,
+               PMD_DRV_LOG(WARNING,
                        "Memzone physical address same as virtual.\n");
-               RTE_LOG(WARNING, PMD,
+               PMD_DRV_LOG(WARNING,
                        "Using rte_mem_virt2iova()\n");
                mz_phys_addr = rte_mem_virt2iova(mz->addr);
                if (mz_phys_addr == 0) {
-                       RTE_LOG(ERR, PMD,
+                       PMD_DRV_LOG(ERR,
                        "unable to map vnic address to physical memory\n");
                        return -ENOMEM;
                }
        for (i = 0; i < max_vnics; i++) {
                vnic = &bp->vnic_info[i];
                if (vnic->fw_vnic_id != (uint16_t)HWRM_NA_SIGNATURE) {
-                       RTE_LOG(ERR, PMD, "VNIC is not freed yet!\n");
+                       PMD_DRV_LOG(ERR, "VNIC is not freed yet!\n");
                        /* TODO Call HWRM to free VNIC */
                }
        }
        vnic_mem = rte_zmalloc("bnxt_vnic_info",
                               max_vnics * sizeof(struct bnxt_vnic_info), 0);
        if (vnic_mem == NULL) {
-               RTE_LOG(ERR, PMD, "Failed to alloc memory for %d VNICs",
+               PMD_DRV_LOG(ERR, "Failed to alloc memory for %d VNICs",
                        max_vnics);
                return -ENOMEM;
        }
 
        bp = (struct bnxt *)eth_dev->data->dev_private;
 
        if (!BNXT_PF(bp)) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Attempt to set Tx loopback on non-PF port %d!\n",
                        port);
                return -ENOTSUP;
        bp = (struct bnxt *)eth_dev->data->dev_private;
 
        if (!BNXT_PF(bp)) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Attempt to set all queues drop on non-PF port!\n");
                return -ENOTSUP;
        }
                bp->vnic_info[i].bd_stall = !on;
                rc = bnxt_hwrm_vnic_cfg(bp, &bp->vnic_info[i]);
                if (rc) {
-                       RTE_LOG(ERR, PMD, "Failed to update PF VNIC %d.\n", i);
+                       PMD_DRV_LOG(ERR, "Failed to update PF VNIC %d.\n", i);
                        return rc;
                }
        }
                                rte_pmd_bnxt_set_all_queues_drop_en_cb, &on,
                                bnxt_hwrm_vnic_cfg);
                if (rc) {
-                       RTE_LOG(ERR, PMD, "Failed to update VF VNIC %d.\n", i);
+                       PMD_DRV_LOG(ERR, "Failed to update VF VNIC %d.\n", i);
                        break;
                }
        }
                return -EINVAL;
 
        if (!BNXT_PF(bp)) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Attempt to set VF %d mac address on non-PF port %d!\n",
                        vf, port);
                return -ENOTSUP;
 
        /* Requested BW can't be greater than link speed */
        if (tot_rate > eth_dev->data->dev_link.link_speed) {
-               RTE_LOG(ERR, PMD, "Rate > Link speed. Set to %d\n", tot_rate);
+               PMD_DRV_LOG(ERR, "Rate > Link speed. Set to %d\n", tot_rate);
                return -EINVAL;
        }
 
        bp = (struct bnxt *)dev->data->dev_private;
 
        if (!BNXT_PF(bp)) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Attempt to set mac spoof on non-PF port %d!\n", port);
                return -EINVAL;
        }
        bp = (struct bnxt *)dev->data->dev_private;
 
        if (!BNXT_PF(bp)) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Attempt to set VLAN spoof on non-PF port %d!\n", port);
                return -EINVAL;
        }
                                rc = -1;
                }
        } else {
-               RTE_LOG(ERR, PMD, "Failed to update VF VNIC %d.\n", vf);
+               PMD_DRV_LOG(ERR, "Failed to update VF VNIC %d.\n", vf);
        }
 
        return rc;
                return -EINVAL;
 
        if (!BNXT_PF(bp)) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Attempt to set VF %d stripq on non-PF port %d!\n",
                        vf, port);
                return -ENOTSUP;
                                rte_pmd_bnxt_set_vf_vlan_stripq_cb, &on,
                                bnxt_hwrm_vnic_cfg);
        if (rc)
-               RTE_LOG(ERR, PMD, "Failed to update VF VNIC %d.\n", vf);
+               PMD_DRV_LOG(ERR, "Failed to update VF VNIC %d.\n", vf);
 
        return rc;
 }
                return -EINVAL;
 
        if (rx_mask & ETH_VMDQ_ACCEPT_UNTAG) {
-               RTE_LOG(ERR, PMD, "Currently cannot toggle this setting\n");
+               PMD_DRV_LOG(ERR, "Currently cannot toggle this setting\n");
                return -ENOTSUP;
        }
 
                                        &bp->pf.vf_info[vf].l2_rx_mask,
                                        bnxt_set_rx_mask_no_vlan);
        if (rc)
-               RTE_LOG(ERR, PMD, "bnxt_hwrm_func_vf_vnic_set_rxmask failed\n");
+               PMD_DRV_LOG(ERR, "bnxt_hwrm_func_vf_vnic_set_rxmask failed\n");
 
        return rc;
 }
        struct bnxt_vnic_info vnic;
 
        if (!BNXT_PF(bp)) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Attempt to set VLAN table on non-PF port!\n");
                return -EINVAL;
        }
                /* This simply indicates there's no driver loaded.
                 * This is not an error.
                 */
-               RTE_LOG(ERR, PMD, "Unable to get default VNIC for VF %d\n", vf);
+               PMD_DRV_LOG(ERR, "Unable to get default VNIC for VF %d\n", vf);
        } else {
                memset(&vnic, 0, sizeof(vnic));
                vnic.fw_vnic_id = dflt_vnic;
                                /* Now check that there's space */
                                if (cnt == getpagesize() / sizeof(struct
                                    bnxt_vlan_antispoof_table_entry)) {
-                                       RTE_LOG(ERR, PMD,
+                                       PMD_DRV_LOG(ERR,
                                             "VLAN anti-spoof table is full\n");
-                                       RTE_LOG(ERR, PMD,
+                                       PMD_DRV_LOG(ERR,
                                                "VF %d cannot add VLAN %u\n",
                                                i, vlan);
                                        rc = -1;
                return -EINVAL;
 
        if (!BNXT_PF(bp)) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Attempt to get VF %d stats on non-PF port %d!\n",
                        vf_id, port);
                return -ENOTSUP;
                return -EINVAL;
 
        if (!BNXT_PF(bp)) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Attempt to reset VF %d stats on non-PF port %d!\n",
                        vf_id, port);
                return -ENOTSUP;
                return -EINVAL;
 
        if (!BNXT_PF(bp)) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Attempt to query VF %d RX stats on non-PF port %d!\n",
                        vf_id, port);
                return -ENOTSUP;
                return -EINVAL;
 
        if (!BNXT_PF(bp)) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Attempt to query VF %d TX drops on non-PF port %d!\n",
                        vf_id, port);
                return -ENOTSUP;
                return -EINVAL;
 
        if (!BNXT_PF(bp)) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Attempt to config VF %d MAC on non-PF port %d!\n",
                        vf_id, port);
                return -ENOTSUP;
                return -EINVAL;
 
        if (!BNXT_PF(bp)) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Attempt to set VF %d vlan insert on non-PF port %d!\n",
                        vf, port);
                return -ENOTSUP;
        bp = (struct bnxt *)dev->data->dev_private;
 
        if (!BNXT_PF(bp)) {
-               RTE_LOG(ERR, PMD,
+               PMD_DRV_LOG(ERR,
                        "Attempt to set persist stats on non-PF port %d!\n",
                        port);
                return -EINVAL;