ethdev: add device flag to bypass auto-filled queue xstats
[dpdk.git] / drivers / net / bnxt / bnxt_reps.c
index 7350c09..b4566c9 100644 (file)
 #include "ulp_port_db.h"
 #include "ulp_flow_db.h"
 
-static const struct eth_dev_ops bnxt_vf_rep_dev_ops = {
-       .dev_infos_get = bnxt_vf_rep_dev_info_get_op,
-       .dev_configure = bnxt_vf_rep_dev_configure_op,
-       .dev_start = bnxt_vf_rep_dev_start_op,
-       .rx_queue_setup = bnxt_vf_rep_rx_queue_setup_op,
-       .rx_queue_release = bnxt_vf_rep_rx_queue_release_op,
-       .tx_queue_setup = bnxt_vf_rep_tx_queue_setup_op,
-       .tx_queue_release = bnxt_vf_rep_tx_queue_release_op,
-       .link_update = bnxt_vf_rep_link_update_op,
-       .dev_close = bnxt_vf_rep_dev_close_op,
-       .dev_stop = bnxt_vf_rep_dev_stop_op,
-       .stats_get = bnxt_vf_rep_stats_get_op,
-       .stats_reset = bnxt_vf_rep_stats_reset_op,
+static const struct eth_dev_ops bnxt_rep_dev_ops = {
+       .dev_infos_get = bnxt_rep_dev_info_get_op,
+       .dev_configure = bnxt_rep_dev_configure_op,
+       .dev_start = bnxt_rep_dev_start_op,
+       .rx_queue_setup = bnxt_rep_rx_queue_setup_op,
+       .rx_queue_release = bnxt_rep_rx_queue_release_op,
+       .tx_queue_setup = bnxt_rep_tx_queue_setup_op,
+       .tx_queue_release = bnxt_rep_tx_queue_release_op,
+       .link_update = bnxt_rep_link_update_op,
+       .dev_close = bnxt_rep_dev_close_op,
+       .dev_stop = bnxt_rep_dev_stop_op,
+       .stats_get = bnxt_rep_stats_get_op,
+       .stats_reset = bnxt_rep_stats_reset_op,
        .filter_ctrl = bnxt_filter_ctrl_op
 };
 
@@ -39,7 +39,7 @@ bnxt_vfr_recv(uint16_t port_id, uint16_t queue_id, struct rte_mbuf *mbuf)
        struct bnxt_rx_ring_info *rep_rxr;
        struct bnxt_rx_queue *rep_rxq;
        struct rte_eth_dev *vfr_eth_dev;
-       struct bnxt_vf_representor *vfr_bp;
+       struct bnxt_representor *vfr_bp;
        uint16_t mask;
        uint8_t que;
 
@@ -55,22 +55,24 @@ bnxt_vfr_recv(uint16_t port_id, uint16_t queue_id, struct rte_mbuf *mbuf)
        mask = rep_rxr->rx_ring_struct->ring_mask;
 
        /* Put this mbuf on the RxQ of the Representor */
-       prod_rx_buf = &rep_rxr->rx_buf_ring[rep_rxr->rx_prod++ & mask];
+       prod_rx_buf = &rep_rxr->rx_buf_ring[rep_rxr->rx_prod & mask];
        if (!*prod_rx_buf) {
                *prod_rx_buf = mbuf;
                vfr_bp->rx_bytes[que] += mbuf->pkt_len;
                vfr_bp->rx_pkts[que]++;
+               rep_rxr->rx_prod++;
        } else {
+               /* Representor Rx ring full, drop pkt */
                vfr_bp->rx_drop_bytes[que] += mbuf->pkt_len;
                vfr_bp->rx_drop_pkts[que]++;
-               rte_pktmbuf_free(mbuf); /* Representor Rx ring full, drop pkt */
+               rte_pktmbuf_free(mbuf);
        }
 
        return 0;
 }
 
 static uint16_t
-bnxt_vf_rep_rx_burst(void *rx_queue,
+bnxt_rep_rx_burst(void *rx_queue,
                     struct rte_mbuf **rx_pkts,
                     uint16_t nb_pkts)
 {
@@ -100,14 +102,14 @@ bnxt_vf_rep_rx_burst(void *rx_queue,
 }
 
 static uint16_t
-bnxt_vf_rep_tx_burst(void *tx_queue,
+bnxt_rep_tx_burst(void *tx_queue,
                     struct rte_mbuf **tx_pkts,
                     __rte_unused uint16_t nb_pkts)
 {
        struct bnxt_vf_rep_tx_queue *vfr_txq = tx_queue;
        struct bnxt_tx_queue *ptxq;
        struct bnxt *parent;
-       struct  bnxt_vf_representor *vf_rep_bp;
+       struct  bnxt_representor *vf_rep_bp;
        int qid;
        int rc;
        int i;
@@ -136,7 +138,7 @@ bnxt_vf_rep_tx_burst(void *tx_queue,
 }
 
 static int
-bnxt_get_dflt_vnic_svif(struct bnxt *bp, struct bnxt_vf_representor *vf_rep_bp)
+bnxt_get_dflt_vnic_svif(struct bnxt *bp, struct bnxt_representor *vf_rep_bp)
 {
        struct bnxt_rep_info *rep_info;
        int rc;
@@ -161,20 +163,29 @@ bnxt_get_dflt_vnic_svif(struct bnxt *bp, struct bnxt_vf_representor *vf_rep_bp)
        return rc;
 }
 
-int bnxt_vf_representor_init(struct rte_eth_dev *eth_dev, void *params)
+int bnxt_representor_init(struct rte_eth_dev *eth_dev, void *params)
 {
-       struct bnxt_vf_representor *vf_rep_bp = eth_dev->data->dev_private;
-       struct bnxt_vf_representor *rep_params =
-                                (struct bnxt_vf_representor *)params;
+       struct bnxt_representor *vf_rep_bp = eth_dev->data->dev_private;
+       struct bnxt_representor *rep_params =
+                                (struct bnxt_representor *)params;
        struct rte_eth_link *link;
        struct bnxt *parent_bp;
+       uint16_t first_vf_id;
+       int rc = 0;
 
        PMD_DRV_LOG(DEBUG, "BNXT Port:%d VFR init\n", eth_dev->data->port_id);
        vf_rep_bp->vf_id = rep_params->vf_id;
        vf_rep_bp->switch_domain_id = rep_params->switch_domain_id;
        vf_rep_bp->parent_dev = rep_params->parent_dev;
-
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
+       vf_rep_bp->rep_based_pf = rep_params->rep_based_pf;
+       vf_rep_bp->flags = rep_params->flags;
+       vf_rep_bp->rep_q_r2f = rep_params->rep_q_r2f;
+       vf_rep_bp->rep_q_f2r = rep_params->rep_q_f2r;
+       vf_rep_bp->rep_fc_r2f = rep_params->rep_fc_r2f;
+       vf_rep_bp->rep_fc_f2r = rep_params->rep_fc_f2r;
+
+       eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR |
+                                       RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
        eth_dev->data->representor_id = rep_params->vf_id;
 
        rte_eth_random_addr(vf_rep_bp->dflt_mac_addr);
@@ -182,13 +193,13 @@ int bnxt_vf_representor_init(struct rte_eth_dev *eth_dev, void *params)
               sizeof(vf_rep_bp->mac_addr));
        eth_dev->data->mac_addrs =
                (struct rte_ether_addr *)&vf_rep_bp->mac_addr;
-       eth_dev->dev_ops = &bnxt_vf_rep_dev_ops;
+       eth_dev->dev_ops = &bnxt_rep_dev_ops;
 
        /* No data-path, but need stub Rx/Tx functions to avoid crash
         * when testing with ovs-dpdk
         */
-       eth_dev->rx_pkt_burst = bnxt_vf_rep_rx_burst;
-       eth_dev->tx_pkt_burst = bnxt_vf_rep_tx_burst;
+       eth_dev->rx_pkt_burst = bnxt_rep_rx_burst;
+       eth_dev->tx_pkt_burst = bnxt_rep_tx_burst;
        /* Link state. Inherited from PF or trusted VF */
        parent_bp = vf_rep_bp->parent_dev->data->dev_private;
        link = &parent_bp->eth_dev->data->dev_link;
@@ -201,30 +212,50 @@ int bnxt_vf_representor_init(struct rte_eth_dev *eth_dev, void *params)
        PMD_DRV_LOG(INFO, "calling bnxt_print_link_info\n");
        bnxt_print_link_info(eth_dev);
 
-       /* Pass the information to the rte_eth_dev_close() that it should also
-        * release the private port resources.
-        */
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
        PMD_DRV_LOG(INFO,
                    "Switch domain id %d: Representor Device %d init done\n",
                    vf_rep_bp->switch_domain_id, vf_rep_bp->vf_id);
 
-       vf_rep_bp->fw_fid = rep_params->vf_id + parent_bp->first_vf_id;
+       if (vf_rep_bp->rep_based_pf) {
+               vf_rep_bp->fw_fid = vf_rep_bp->rep_based_pf + 1;
+               if (!(BNXT_REP_PF(vf_rep_bp))) {
+                       /* VF representor for the remote PF,get first_vf_id */
+                       rc = bnxt_hwrm_first_vf_id_query(parent_bp,
+                                                        vf_rep_bp->fw_fid,
+                                                        &first_vf_id);
+                       if (rc)
+                               return rc;
+                       if (first_vf_id == 0xffff) {
+                               PMD_DRV_LOG(ERR,
+                                           "Invalid first_vf_id fid:%x\n",
+                                           vf_rep_bp->fw_fid);
+                               return -EINVAL;
+                       }
+                       PMD_DRV_LOG(INFO, "first_vf_id = %x parent_fid:%x\n",
+                                   first_vf_id, vf_rep_bp->fw_fid);
+                       vf_rep_bp->fw_fid = rep_params->vf_id + first_vf_id;
+               }
+       }  else {
+               vf_rep_bp->fw_fid = rep_params->vf_id + parent_bp->first_vf_id;
+       }
+
        PMD_DRV_LOG(INFO, "vf_rep->fw_fid = %d\n", vf_rep_bp->fw_fid);
 
        return 0;
 }
 
-int bnxt_vf_representor_uninit(struct rte_eth_dev *eth_dev)
+int bnxt_representor_uninit(struct rte_eth_dev *eth_dev)
 {
        struct bnxt *parent_bp;
-       struct bnxt_vf_representor *rep =
-               (struct bnxt_vf_representor *)eth_dev->data->dev_private;
+       struct bnxt_representor *rep =
+               (struct bnxt_representor *)eth_dev->data->dev_private;
        uint16_t vf_id;
 
+       if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+               return 0;
+
        PMD_DRV_LOG(DEBUG, "BNXT Port:%d VFR uninit\n", eth_dev->data->port_id);
        eth_dev->data->mac_addrs = NULL;
-       eth_dev->dev_ops = NULL;
 
        parent_bp = rep->parent_dev->data->dev_private;
        if (!parent_bp) {
@@ -242,11 +273,11 @@ int bnxt_vf_representor_uninit(struct rte_eth_dev *eth_dev)
        return 0;
 }
 
-int bnxt_vf_rep_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_compl)
+int bnxt_rep_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_compl)
 {
        struct bnxt *parent_bp;
-       struct bnxt_vf_representor *rep =
-               (struct bnxt_vf_representor *)eth_dev->data->dev_private;
+       struct bnxt_representor *rep =
+               (struct bnxt_representor *)eth_dev->data->dev_private;
        struct rte_eth_link *link;
        int rc;
 
@@ -271,7 +302,7 @@ int bnxt_vf_rep_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_compl)
 static int bnxt_tf_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
 {
        int rc;
-       struct bnxt_vf_representor *vfr = vfr_ethdev->data->dev_private;
+       struct bnxt_representor *vfr = vfr_ethdev->data->dev_private;
        struct rte_eth_dev *parent_dev = vfr->parent_dev;
        struct bnxt *parent_bp = parent_dev->data->dev_private;
 
@@ -297,7 +328,12 @@ static int bnxt_tf_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
        }
        /* update the port id so you can backtrack to ethdev */
        vfr->dpdk_port_id = vfr_ethdev->data->port_id;
-       rc = bnxt_hwrm_cfa_vfr_alloc(parent_bp, vfr->vf_id);
+
+       if (BNXT_STINGRAY(parent_bp)) {
+               rc = bnxt_hwrm_cfa_pair_alloc(parent_bp, vfr);
+       } else {
+               rc = bnxt_hwrm_cfa_vfr_alloc(parent_bp, vfr->vf_id);
+       }
        if (rc) {
                BNXT_TF_DBG(ERR, "Failed in hwrm vfr alloc vfr:%u rc=%d\n",
                            vfr->vf_id, rc);
@@ -311,7 +347,7 @@ static int bnxt_tf_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
 static int bnxt_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
 {
        int rc = 0;
-       struct bnxt_vf_representor *vfr = vfr_ethdev->data->dev_private;
+       struct bnxt_representor *vfr = vfr_ethdev->data->dev_private;
        struct bnxt *parent_bp;
 
        if (!vfr || !vfr->parent_dev) {
@@ -348,7 +384,7 @@ static int bnxt_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
        return rc;
 }
 
-static void bnxt_vf_rep_free_rx_mbufs(struct bnxt_vf_representor *rep_bp)
+static void bnxt_rep_free_rx_mbufs(struct bnxt_representor *rep_bp)
 {
        struct bnxt_rx_queue *rxq;
        unsigned int i;
@@ -359,9 +395,9 @@ static void bnxt_vf_rep_free_rx_mbufs(struct bnxt_vf_representor *rep_bp)
        }
 }
 
-int bnxt_vf_rep_dev_start_op(struct rte_eth_dev *eth_dev)
+int bnxt_rep_dev_start_op(struct rte_eth_dev *eth_dev)
 {
-       struct bnxt_vf_representor *rep_bp = eth_dev->data->dev_private;
+       struct bnxt_representor *rep_bp = eth_dev->data->dev_private;
        struct bnxt_rep_info *rep_info;
        struct bnxt *parent_bp;
        int rc;
@@ -383,23 +419,23 @@ int bnxt_vf_rep_dev_start_op(struct rte_eth_dev *eth_dev)
        rc = bnxt_vfr_alloc(eth_dev);
        if (rc) {
                eth_dev->data->dev_link.link_status = 0;
-               bnxt_vf_rep_free_rx_mbufs(rep_bp);
+               bnxt_rep_free_rx_mbufs(rep_bp);
                return rc;
        }
-       eth_dev->rx_pkt_burst = &bnxt_vf_rep_rx_burst;
-       eth_dev->tx_pkt_burst = &bnxt_vf_rep_tx_burst;
-       bnxt_vf_rep_link_update_op(eth_dev, 1);
+       eth_dev->rx_pkt_burst = &bnxt_rep_rx_burst;
+       eth_dev->tx_pkt_burst = &bnxt_rep_tx_burst;
+       bnxt_rep_link_update_op(eth_dev, 1);
 
        return 0;
 }
 
-static int bnxt_tf_vfr_free(struct bnxt_vf_representor *vfr)
+static int bnxt_tf_vfr_free(struct bnxt_representor *vfr)
 {
        BNXT_TF_DBG(DEBUG, "BNXT Port:%d VFR ulp free\n", vfr->dpdk_port_id);
        return bnxt_ulp_delete_vfr_default_rules(vfr);
 }
 
-static int bnxt_vfr_free(struct bnxt_vf_representor *vfr)
+static int bnxt_vfr_free(struct bnxt_representor *vfr)
 {
        int rc = 0;
        struct bnxt *parent_bp;
@@ -432,14 +468,17 @@ static int bnxt_vfr_free(struct bnxt_vf_representor *vfr)
                    vfr->vf_id);
        vfr->vfr_tx_cfa_action = 0;
 
-       rc = bnxt_hwrm_cfa_vfr_free(parent_bp, vfr->vf_id);
+       if (BNXT_STINGRAY(parent_bp))
+               rc = bnxt_hwrm_cfa_pair_free(parent_bp, vfr);
+       else
+               rc = bnxt_hwrm_cfa_vfr_free(parent_bp, vfr->vf_id);
 
        return rc;
 }
 
-void bnxt_vf_rep_dev_stop_op(struct rte_eth_dev *eth_dev)
+int bnxt_rep_dev_stop_op(struct rte_eth_dev *eth_dev)
 {
-       struct bnxt_vf_representor *vfr_bp = eth_dev->data->dev_private;
+       struct bnxt_representor *vfr_bp = eth_dev->data->dev_private;
 
        /* Avoid crashes as we are about to free queues */
        eth_dev->rx_pkt_burst = &bnxt_dummy_recv_pkts;
@@ -452,19 +491,22 @@ void bnxt_vf_rep_dev_stop_op(struct rte_eth_dev *eth_dev)
        if (eth_dev->data->dev_started)
                eth_dev->data->dev_link.link_status = 0;
 
-       bnxt_vf_rep_free_rx_mbufs(vfr_bp);
+       bnxt_rep_free_rx_mbufs(vfr_bp);
+
+       return 0;
 }
 
-void bnxt_vf_rep_dev_close_op(struct rte_eth_dev *eth_dev)
+int bnxt_rep_dev_close_op(struct rte_eth_dev *eth_dev)
 {
        BNXT_TF_DBG(DEBUG, "BNXT Port:%d VFR close\n", eth_dev->data->port_id);
-       bnxt_vf_representor_uninit(eth_dev);
+       bnxt_representor_uninit(eth_dev);
+       return 0;
 }
 
-int bnxt_vf_rep_dev_info_get_op(struct rte_eth_dev *eth_dev,
+int bnxt_rep_dev_info_get_op(struct rte_eth_dev *eth_dev,
                                struct rte_eth_dev_info *dev_info)
 {
-       struct bnxt_vf_representor *rep_bp = eth_dev->data->dev_private;
+       struct bnxt_representor *rep_bp = eth_dev->data->dev_private;
        struct bnxt *parent_bp;
        unsigned int max_rx_rings;
        int rc = 0;
@@ -508,9 +550,9 @@ int bnxt_vf_rep_dev_info_get_op(struct rte_eth_dev *eth_dev,
        return 0;
 }
 
-int bnxt_vf_rep_dev_configure_op(__rte_unused struct rte_eth_dev *eth_dev)
+int bnxt_rep_dev_configure_op(__rte_unused struct rte_eth_dev *eth_dev)
 {
-       struct bnxt_vf_representor *rep_bp = eth_dev->data->dev_private;
+       struct bnxt_representor *rep_bp = eth_dev->data->dev_private;
 
        PMD_DRV_LOG(DEBUG, "Representor dev_configure_op\n");
        rep_bp->rx_queues = (void *)eth_dev->data->rx_queues;
@@ -520,14 +562,39 @@ int bnxt_vf_rep_dev_configure_op(__rte_unused struct rte_eth_dev *eth_dev)
        return 0;
 }
 
-int bnxt_vf_rep_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
-                         uint16_t queue_idx,
-                         uint16_t nb_desc,
-                         unsigned int socket_id,
-                         __rte_unused const struct rte_eth_rxconf *rx_conf,
-                         __rte_unused struct rte_mempool *mp)
+static int bnxt_init_rep_rx_ring(struct bnxt_rx_queue *rxq,
+                                unsigned int socket_id)
 {
-       struct bnxt_vf_representor *rep_bp = eth_dev->data->dev_private;
+       struct bnxt_rx_ring_info *rxr;
+       struct bnxt_ring *ring;
+
+       rxr = rte_zmalloc_socket("bnxt_rep_rx_ring",
+                                sizeof(struct bnxt_rx_ring_info),
+                                RTE_CACHE_LINE_SIZE, socket_id);
+       if (rxr == NULL)
+               return -ENOMEM;
+       rxq->rx_ring = rxr;
+
+       ring = rte_zmalloc_socket("bnxt_rep_rx_ring_struct",
+                                 sizeof(struct bnxt_ring),
+                                 RTE_CACHE_LINE_SIZE, socket_id);
+       if (ring == NULL)
+               return -ENOMEM;
+       rxr->rx_ring_struct = ring;
+       ring->ring_size = rte_align32pow2(rxq->nb_rx_desc);
+       ring->ring_mask = ring->ring_size - 1;
+
+       return 0;
+}
+
+int bnxt_rep_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
+                              uint16_t queue_idx,
+                              uint16_t nb_desc,
+                              unsigned int socket_id,
+                              __rte_unused const struct rte_eth_rxconf *rx_conf,
+                              __rte_unused struct rte_mempool *mp)
+{
+       struct bnxt_representor *rep_bp = eth_dev->data->dev_private;
        struct bnxt *parent_bp = rep_bp->parent_dev->data->dev_private;
        struct bnxt_rx_queue *parent_rxq;
        struct bnxt_rx_queue *rxq;
@@ -578,7 +645,7 @@ int bnxt_vf_rep_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
 
        rxq->nb_rx_desc = nb_desc;
 
-       rc = bnxt_init_rx_ring_struct(rxq, socket_id);
+       rc = bnxt_init_rep_rx_ring(rxq, socket_id);
        if (rc)
                goto out;
 
@@ -601,12 +668,12 @@ int bnxt_vf_rep_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
 
 out:
        if (rxq)
-               bnxt_rx_queue_release_op(rxq);
+               bnxt_rep_rx_queue_release_op(rxq);
 
        return rc;
 }
 
-void bnxt_vf_rep_rx_queue_release_op(void *rx_queue)
+void bnxt_rep_rx_queue_release_op(void *rx_queue)
 {
        struct bnxt_rx_queue *rxq = (struct bnxt_rx_queue *)rx_queue;
 
@@ -616,19 +683,19 @@ void bnxt_vf_rep_rx_queue_release_op(void *rx_queue)
        bnxt_rx_queue_release_mbufs(rxq);
 
        bnxt_free_ring(rxq->rx_ring->rx_ring_struct);
-       bnxt_free_ring(rxq->rx_ring->ag_ring_struct);
-       bnxt_free_ring(rxq->cp_ring->cp_ring_struct);
+       rte_free(rxq->rx_ring->rx_ring_struct);
+       rte_free(rxq->rx_ring);
 
        rte_free(rxq);
 }
 
-int bnxt_vf_rep_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
-                         uint16_t queue_idx,
-                         uint16_t nb_desc,
-                         unsigned int socket_id,
-                         __rte_unused const struct rte_eth_txconf *tx_conf)
+int bnxt_rep_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
+                              uint16_t queue_idx,
+                              uint16_t nb_desc,
+                              unsigned int socket_id,
+                              __rte_unused const struct rte_eth_txconf *tx_conf)
 {
-       struct bnxt_vf_representor *rep_bp = eth_dev->data->dev_private;
+       struct bnxt_representor *rep_bp = eth_dev->data->dev_private;
        struct bnxt *parent_bp = rep_bp->parent_dev->data->dev_private;
        struct bnxt_tx_queue *parent_txq, *txq;
        struct bnxt_vf_rep_tx_queue *vfr_txq;
@@ -663,7 +730,7 @@ int bnxt_vf_rep_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
 
        if (eth_dev->data->tx_queues) {
                vfr_txq = eth_dev->data->tx_queues[queue_idx];
-               bnxt_vf_rep_tx_queue_release_op(vfr_txq);
+               bnxt_rep_tx_queue_release_op(vfr_txq);
                vfr_txq = NULL;
        }
 
@@ -693,7 +760,7 @@ int bnxt_vf_rep_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
        return 0;
 }
 
-void bnxt_vf_rep_tx_queue_release_op(void *tx_queue)
+void bnxt_rep_tx_queue_release_op(void *tx_queue)
 {
        struct bnxt_vf_rep_tx_queue *vfr_txq = tx_queue;
 
@@ -704,10 +771,10 @@ void bnxt_vf_rep_tx_queue_release_op(void *tx_queue)
        rte_free(vfr_txq);
 }
 
-int bnxt_vf_rep_stats_get_op(struct rte_eth_dev *eth_dev,
+int bnxt_rep_stats_get_op(struct rte_eth_dev *eth_dev,
                             struct rte_eth_stats *stats)
 {
-       struct bnxt_vf_representor *rep_bp = eth_dev->data->dev_private;
+       struct bnxt_representor *rep_bp = eth_dev->data->dev_private;
        int i;
 
        memset(stats, 0, sizeof(*stats));
@@ -728,9 +795,9 @@ int bnxt_vf_rep_stats_get_op(struct rte_eth_dev *eth_dev,
        return 0;
 }
 
-int bnxt_vf_rep_stats_reset_op(struct rte_eth_dev *eth_dev)
+int bnxt_rep_stats_reset_op(struct rte_eth_dev *eth_dev)
 {
-       struct bnxt_vf_representor *rep_bp = eth_dev->data->dev_private;
+       struct bnxt_representor *rep_bp = eth_dev->data->dev_private;
        int i;
 
        for (i = 0; i < BNXT_MAX_VF_REP_RINGS; i++) {
@@ -743,19 +810,24 @@ int bnxt_vf_rep_stats_reset_op(struct rte_eth_dev *eth_dev)
        return 0;
 }
 
-void bnxt_vf_rep_stop_all(struct bnxt *bp)
+int bnxt_rep_stop_all(struct bnxt *bp)
 {
        uint16_t vf_id;
        struct rte_eth_dev *rep_eth_dev;
+       int ret;
 
        /* No vfrep ports just exit */
        if (!bp->rep_info)
-               return;
+               return 0;
 
        for (vf_id = 0; vf_id < BNXT_MAX_VF_REPS; vf_id++) {
                rep_eth_dev = bp->rep_info[vf_id].vfr_eth_dev;
                if (!rep_eth_dev)
                        continue;
-               bnxt_vf_rep_dev_stop_op(rep_eth_dev);
+               ret = bnxt_rep_dev_stop_op(rep_eth_dev);
+               if (ret != 0)
+                       return ret;
        }
+
+       return 0;
 }