1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2014-2020 Broadcom
13 #include "bnxt_hwrm.h"
14 #include "hsi_struct_def_dpdk.h"
15 #include "bnxt_tf_common.h"
16 #include "ulp_port_db.h"
17 #include "ulp_flow_db.h"
19 static const struct eth_dev_ops bnxt_vf_rep_dev_ops = {
20 .dev_infos_get = bnxt_vf_rep_dev_info_get_op,
21 .dev_configure = bnxt_vf_rep_dev_configure_op,
22 .dev_start = bnxt_vf_rep_dev_start_op,
23 .rx_queue_setup = bnxt_vf_rep_rx_queue_setup_op,
24 .rx_queue_release = bnxt_vf_rep_rx_queue_release_op,
25 .tx_queue_setup = bnxt_vf_rep_tx_queue_setup_op,
26 .tx_queue_release = bnxt_vf_rep_tx_queue_release_op,
27 .link_update = bnxt_vf_rep_link_update_op,
28 .dev_close = bnxt_vf_rep_dev_close_op,
29 .dev_stop = bnxt_vf_rep_dev_stop_op,
30 .stats_get = bnxt_vf_rep_stats_get_op,
31 .stats_reset = bnxt_vf_rep_stats_reset_op,
32 .filter_ctrl = bnxt_filter_ctrl_op
36 bnxt_vfr_recv(uint16_t port_id, uint16_t queue_id, struct rte_mbuf *mbuf)
38 struct rte_mbuf **prod_rx_buf;
39 struct bnxt_rx_ring_info *rep_rxr;
40 struct bnxt_rx_queue *rep_rxq;
41 struct rte_eth_dev *vfr_eth_dev;
42 struct bnxt_vf_representor *vfr_bp;
46 vfr_eth_dev = &rte_eth_devices[port_id];
47 vfr_bp = vfr_eth_dev->data->dev_private;
48 /* If rxq_id happens to be > max rep_queue, use rxq0 */
49 que = queue_id < BNXT_MAX_VF_REP_RINGS ? queue_id : 0;
50 rep_rxq = vfr_bp->rx_queues[que];
51 rep_rxr = rep_rxq->rx_ring;
52 mask = rep_rxr->rx_ring_struct->ring_mask;
54 /* Put this mbuf on the RxQ of the Representor */
55 prod_rx_buf = &rep_rxr->rx_buf_ring[rep_rxr->rx_prod++ & mask];
58 vfr_bp->rx_bytes[que] += mbuf->pkt_len;
59 vfr_bp->rx_pkts[que]++;
61 vfr_bp->rx_drop_bytes[que] += mbuf->pkt_len;
62 vfr_bp->rx_drop_pkts[que]++;
63 rte_pktmbuf_free(mbuf); /* Representor Rx ring full, drop pkt */
70 bnxt_vf_rep_rx_burst(void *rx_queue,
71 struct rte_mbuf **rx_pkts,
74 struct bnxt_rx_queue *rxq = rx_queue;
75 struct rte_mbuf **cons_rx_buf;
76 struct bnxt_rx_ring_info *rxr;
77 uint16_t nb_rx_pkts = 0;
84 mask = rxr->rx_ring_struct->ring_mask;
85 for (i = 0; i < nb_pkts; i++) {
86 cons_rx_buf = &rxr->rx_buf_ring[rxr->rx_cons & mask];
87 if (*cons_rx_buf == NULL)
89 rx_pkts[nb_rx_pkts] = *cons_rx_buf;
90 rx_pkts[nb_rx_pkts]->port = rxq->port_id;
100 bnxt_vf_rep_tx_burst(void *tx_queue,
101 struct rte_mbuf **tx_pkts,
102 __rte_unused uint16_t nb_pkts)
104 struct bnxt_vf_rep_tx_queue *vfr_txq = tx_queue;
105 struct bnxt_tx_queue *ptxq;
107 struct bnxt_vf_representor *vf_rep_bp;
115 qid = vfr_txq->txq->queue_id;
116 vf_rep_bp = vfr_txq->bp;
117 parent = vf_rep_bp->parent_dev->data->dev_private;
118 pthread_mutex_lock(&parent->rep_info->vfr_lock);
119 ptxq = parent->tx_queues[qid];
121 ptxq->vfr_tx_cfa_action = vf_rep_bp->vfr_tx_cfa_action;
123 for (i = 0; i < nb_pkts; i++) {
124 vf_rep_bp->tx_bytes[qid] += tx_pkts[i]->pkt_len;
125 vf_rep_bp->tx_pkts[qid]++;
128 rc = bnxt_xmit_pkts(ptxq, tx_pkts, nb_pkts);
129 ptxq->vfr_tx_cfa_action = 0;
130 pthread_mutex_unlock(&parent->rep_info->vfr_lock);
136 bnxt_get_dflt_vnic_svif(struct bnxt *bp, struct bnxt_vf_representor *vf_rep_bp)
138 struct bnxt_rep_info *rep_info;
141 rc = bnxt_hwrm_get_dflt_vnic_svif(bp, vf_rep_bp->fw_fid,
142 &vf_rep_bp->dflt_vnic_id,
145 PMD_DRV_LOG(ERR, "Failed to get default vnic id of VF\n");
146 vf_rep_bp->dflt_vnic_id = BNXT_DFLT_VNIC_ID_INVALID;
147 vf_rep_bp->svif = BNXT_SVIF_INVALID;
149 PMD_DRV_LOG(INFO, "vf_rep->dflt_vnic_id = %d\n",
150 vf_rep_bp->dflt_vnic_id);
152 if (vf_rep_bp->dflt_vnic_id != BNXT_DFLT_VNIC_ID_INVALID &&
153 vf_rep_bp->svif != BNXT_SVIF_INVALID) {
154 rep_info = &bp->rep_info[vf_rep_bp->vf_id];
155 rep_info->conduit_valid = true;
161 int bnxt_vf_representor_init(struct rte_eth_dev *eth_dev, void *params)
163 struct bnxt_vf_representor *vf_rep_bp = eth_dev->data->dev_private;
164 struct bnxt_vf_representor *rep_params =
165 (struct bnxt_vf_representor *)params;
166 struct rte_eth_link *link;
167 struct bnxt *parent_bp;
169 vf_rep_bp->vf_id = rep_params->vf_id;
170 vf_rep_bp->switch_domain_id = rep_params->switch_domain_id;
171 vf_rep_bp->parent_dev = rep_params->parent_dev;
173 eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
174 eth_dev->data->representor_id = rep_params->vf_id;
176 rte_eth_random_addr(vf_rep_bp->dflt_mac_addr);
177 memcpy(vf_rep_bp->mac_addr, vf_rep_bp->dflt_mac_addr,
178 sizeof(vf_rep_bp->mac_addr));
179 eth_dev->data->mac_addrs =
180 (struct rte_ether_addr *)&vf_rep_bp->mac_addr;
181 eth_dev->dev_ops = &bnxt_vf_rep_dev_ops;
183 /* No data-path, but need stub Rx/Tx functions to avoid crash
184 * when testing with ovs-dpdk
186 eth_dev->rx_pkt_burst = bnxt_vf_rep_rx_burst;
187 eth_dev->tx_pkt_burst = bnxt_vf_rep_tx_burst;
188 /* Link state. Inherited from PF or trusted VF */
189 parent_bp = vf_rep_bp->parent_dev->data->dev_private;
190 link = &parent_bp->eth_dev->data->dev_link;
192 eth_dev->data->dev_link.link_speed = link->link_speed;
193 eth_dev->data->dev_link.link_duplex = link->link_duplex;
194 eth_dev->data->dev_link.link_status = link->link_status;
195 eth_dev->data->dev_link.link_autoneg = link->link_autoneg;
197 PMD_DRV_LOG(INFO, "calling bnxt_print_link_info\n");
198 bnxt_print_link_info(eth_dev);
200 /* Pass the information to the rte_eth_dev_close() that it should also
201 * release the private port resources.
203 eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
205 "Switch domain id %d: Representor Device %d init done\n",
206 vf_rep_bp->switch_domain_id, vf_rep_bp->vf_id);
208 vf_rep_bp->fw_fid = rep_params->vf_id + parent_bp->first_vf_id;
209 PMD_DRV_LOG(INFO, "vf_rep->fw_fid = %d\n", vf_rep_bp->fw_fid);
214 int bnxt_vf_representor_uninit(struct rte_eth_dev *eth_dev)
216 struct bnxt *parent_bp;
217 struct bnxt_vf_representor *rep =
218 (struct bnxt_vf_representor *)eth_dev->data->dev_private;
222 eth_dev->data->mac_addrs = NULL;
223 eth_dev->dev_ops = NULL;
225 parent_bp = rep->parent_dev->data->dev_private;
229 parent_bp->num_reps--;
231 if (parent_bp->rep_info)
232 memset(&parent_bp->rep_info[vf_id], 0,
233 sizeof(parent_bp->rep_info[vf_id]));
234 /* mark that this representor has been freed */
238 int bnxt_vf_rep_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_compl)
240 struct bnxt *parent_bp;
241 struct bnxt_vf_representor *rep =
242 (struct bnxt_vf_representor *)eth_dev->data->dev_private;
243 struct rte_eth_link *link;
246 parent_bp = rep->parent_dev->data->dev_private;
250 rc = bnxt_link_update_op(parent_bp->eth_dev, wait_to_compl);
252 /* Link state. Inherited from PF or trusted VF */
253 link = &parent_bp->eth_dev->data->dev_link;
255 eth_dev->data->dev_link.link_speed = link->link_speed;
256 eth_dev->data->dev_link.link_duplex = link->link_duplex;
257 eth_dev->data->dev_link.link_status = link->link_status;
258 eth_dev->data->dev_link.link_autoneg = link->link_autoneg;
259 bnxt_print_link_info(eth_dev);
264 static int bnxt_tf_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
267 struct bnxt_vf_representor *vfr = vfr_ethdev->data->dev_private;
268 struct rte_eth_dev *parent_dev = vfr->parent_dev;
269 struct bnxt *parent_bp = parent_dev->data->dev_private;
271 if (!parent_bp || !parent_bp->ulp_ctx) {
272 BNXT_TF_DBG(ERR, "Invalid arguments\n");
276 /* Update the ULP portdata base with the new VFR interface */
277 rc = ulp_port_db_dev_port_intf_update(parent_bp->ulp_ctx, vfr_ethdev);
279 BNXT_TF_DBG(ERR, "Failed to update ulp port details vfr:%u\n",
284 /* Create the default rules for the VFR */
285 rc = bnxt_ulp_create_vfr_default_rules(vfr_ethdev);
287 BNXT_TF_DBG(ERR, "Failed to create VFR default rules vfr:%u\n",
291 /* update the port id so you can backtrack to ethdev */
292 vfr->dpdk_port_id = vfr_ethdev->data->port_id;
293 rc = bnxt_hwrm_cfa_vfr_alloc(parent_bp, vfr->vf_id);
295 BNXT_TF_DBG(ERR, "Failed in hwrm vfr alloc vfr:%u rc=%d\n",
297 (void)bnxt_ulp_delete_vfr_default_rules(vfr);
303 static int bnxt_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
306 struct bnxt_vf_representor *vfr = vfr_ethdev->data->dev_private;
307 struct bnxt *parent_bp;
309 if (!vfr || !vfr->parent_dev) {
311 "No memory allocated for representor\n");
315 parent_bp = vfr->parent_dev->data->dev_private;
316 if (parent_bp && !parent_bp->ulp_ctx) {
318 "ulp context not allocated for parent\n");
322 /* Check if representor has been already allocated in FW */
323 if (vfr->vfr_tx_cfa_action)
327 * Alloc VF rep rules in CFA after default VNIC is created.
328 * Otherwise the FW will create the VF-rep rules with
329 * default drop action.
331 rc = bnxt_tf_vfr_alloc(vfr_ethdev);
333 PMD_DRV_LOG(DEBUG, "allocated representor %d in FW\n",
337 "Failed to alloc representor %d in FW\n",
343 static void bnxt_vf_rep_free_rx_mbufs(struct bnxt_vf_representor *rep_bp)
345 struct bnxt_rx_queue *rxq;
348 for (i = 0; i < rep_bp->rx_nr_rings; i++) {
349 rxq = rep_bp->rx_queues[i];
350 bnxt_rx_queue_release_mbufs(rxq);
354 int bnxt_vf_rep_dev_start_op(struct rte_eth_dev *eth_dev)
356 struct bnxt_vf_representor *rep_bp = eth_dev->data->dev_private;
357 struct bnxt_rep_info *rep_info;
358 struct bnxt *parent_bp;
361 parent_bp = rep_bp->parent_dev->data->dev_private;
362 rep_info = &parent_bp->rep_info[rep_bp->vf_id];
364 pthread_mutex_lock(&rep_info->vfr_start_lock);
365 if (!rep_info->conduit_valid) {
366 rc = bnxt_get_dflt_vnic_svif(parent_bp, rep_bp);
367 if (rc || !rep_info->conduit_valid) {
368 pthread_mutex_unlock(&rep_info->vfr_start_lock);
372 pthread_mutex_unlock(&rep_info->vfr_start_lock);
374 rc = bnxt_vfr_alloc(eth_dev);
376 eth_dev->data->dev_link.link_status = 0;
377 bnxt_vf_rep_free_rx_mbufs(rep_bp);
380 eth_dev->rx_pkt_burst = &bnxt_vf_rep_rx_burst;
381 eth_dev->tx_pkt_burst = &bnxt_vf_rep_tx_burst;
382 bnxt_vf_rep_link_update_op(eth_dev, 1);
387 static int bnxt_tf_vfr_free(struct bnxt_vf_representor *vfr)
389 return bnxt_ulp_delete_vfr_default_rules(vfr);
392 static int bnxt_vfr_free(struct bnxt_vf_representor *vfr)
395 struct bnxt *parent_bp;
397 if (!vfr || !vfr->parent_dev) {
399 "No memory allocated for representor\n");
403 parent_bp = vfr->parent_dev->data->dev_private;
407 /* Check if representor has been already freed in FW */
408 if (!vfr->vfr_tx_cfa_action)
411 rc = bnxt_tf_vfr_free(vfr);
414 "Failed to free representor %d in FW\n",
418 PMD_DRV_LOG(DEBUG, "freed representor %d in FW\n",
420 vfr->vfr_tx_cfa_action = 0;
422 rc = bnxt_hwrm_cfa_vfr_free(parent_bp, vfr->vf_id);
427 void bnxt_vf_rep_dev_stop_op(struct rte_eth_dev *eth_dev)
429 struct bnxt_vf_representor *vfr_bp = eth_dev->data->dev_private;
431 /* Avoid crashes as we are about to free queues */
432 eth_dev->rx_pkt_burst = &bnxt_dummy_recv_pkts;
433 eth_dev->tx_pkt_burst = &bnxt_dummy_xmit_pkts;
435 bnxt_vfr_free(vfr_bp);
437 if (eth_dev->data->dev_started)
438 eth_dev->data->dev_link.link_status = 0;
440 bnxt_vf_rep_free_rx_mbufs(vfr_bp);
443 void bnxt_vf_rep_dev_close_op(struct rte_eth_dev *eth_dev)
445 bnxt_vf_representor_uninit(eth_dev);
448 int bnxt_vf_rep_dev_info_get_op(struct rte_eth_dev *eth_dev,
449 struct rte_eth_dev_info *dev_info)
451 struct bnxt_vf_representor *rep_bp = eth_dev->data->dev_private;
452 struct bnxt *parent_bp;
453 unsigned int max_rx_rings;
457 parent_bp = rep_bp->parent_dev->data->dev_private;
459 PMD_DRV_LOG(ERR, "Rep parent NULL!\n");
462 PMD_DRV_LOG(DEBUG, "Representor dev_info_get_op\n");
463 dev_info->max_mac_addrs = parent_bp->max_l2_ctx;
464 dev_info->max_hash_mac_addrs = 0;
466 max_rx_rings = BNXT_MAX_VF_REP_RINGS;
467 /* For the sake of symmetry, max_rx_queues = max_tx_queues */
468 dev_info->max_rx_queues = max_rx_rings;
469 dev_info->max_tx_queues = max_rx_rings;
470 dev_info->reta_size = bnxt_rss_hash_tbl_size(parent_bp);
471 dev_info->hash_key_size = 40;
474 dev_info->min_mtu = RTE_ETHER_MIN_MTU;
475 dev_info->max_mtu = BNXT_MAX_MTU;
477 /* Fast path specifics */
478 dev_info->min_rx_bufsize = 1;
479 dev_info->max_rx_pktlen = BNXT_MAX_PKT_LEN;
481 dev_info->rx_offload_capa = BNXT_DEV_RX_OFFLOAD_SUPPORT;
482 if (parent_bp->flags & BNXT_FLAG_PTP_SUPPORTED)
483 dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_TIMESTAMP;
484 dev_info->tx_offload_capa = BNXT_DEV_TX_OFFLOAD_SUPPORT;
485 dev_info->flow_type_rss_offloads = BNXT_ETH_RSS_SUPPORT;
490 int bnxt_vf_rep_dev_configure_op(__rte_unused struct rte_eth_dev *eth_dev)
492 struct bnxt_vf_representor *rep_bp = eth_dev->data->dev_private;
494 PMD_DRV_LOG(DEBUG, "Representor dev_configure_op\n");
495 rep_bp->rx_queues = (void *)eth_dev->data->rx_queues;
496 rep_bp->tx_nr_rings = eth_dev->data->nb_tx_queues;
497 rep_bp->rx_nr_rings = eth_dev->data->nb_rx_queues;
502 int bnxt_vf_rep_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
505 unsigned int socket_id,
506 __rte_unused const struct rte_eth_rxconf *rx_conf,
507 __rte_unused struct rte_mempool *mp)
509 struct bnxt_vf_representor *rep_bp = eth_dev->data->dev_private;
510 struct bnxt *parent_bp = rep_bp->parent_dev->data->dev_private;
511 struct bnxt_rx_queue *parent_rxq;
512 struct bnxt_rx_queue *rxq;
513 struct rte_mbuf **buf_ring;
516 if (queue_idx >= BNXT_MAX_VF_REP_RINGS) {
518 "Cannot create Rx ring %d. %d rings available\n",
519 queue_idx, BNXT_MAX_VF_REP_RINGS);
523 if (!nb_desc || nb_desc > MAX_RX_DESC_CNT) {
524 PMD_DRV_LOG(ERR, "nb_desc %d is invalid\n", nb_desc);
528 if (!parent_bp->rx_queues) {
529 PMD_DRV_LOG(ERR, "Parent Rx qs not configured yet\n");
533 parent_rxq = parent_bp->rx_queues[queue_idx];
535 PMD_DRV_LOG(ERR, "Parent RxQ has not been configured yet\n");
539 if (nb_desc != parent_rxq->nb_rx_desc) {
540 PMD_DRV_LOG(ERR, "nb_desc %d do not match parent rxq", nb_desc);
544 if (eth_dev->data->rx_queues) {
545 rxq = eth_dev->data->rx_queues[queue_idx];
547 bnxt_rx_queue_release_op(rxq);
550 rxq = rte_zmalloc_socket("bnxt_vfr_rx_queue",
551 sizeof(struct bnxt_rx_queue),
552 RTE_CACHE_LINE_SIZE, socket_id);
554 PMD_DRV_LOG(ERR, "bnxt_vfr_rx_queue allocation failed!\n");
558 rxq->nb_rx_desc = nb_desc;
560 rc = bnxt_init_rx_ring_struct(rxq, socket_id);
564 buf_ring = rte_zmalloc_socket("bnxt_rx_vfr_buf_ring",
565 sizeof(struct rte_mbuf *) *
566 rxq->rx_ring->rx_ring_struct->ring_size,
567 RTE_CACHE_LINE_SIZE, socket_id);
569 PMD_DRV_LOG(ERR, "bnxt_rx_vfr_buf_ring allocation failed!\n");
574 rxq->rx_ring->rx_buf_ring = buf_ring;
575 rxq->queue_id = queue_idx;
576 rxq->port_id = eth_dev->data->port_id;
577 eth_dev->data->rx_queues[queue_idx] = rxq;
583 bnxt_rx_queue_release_op(rxq);
588 void bnxt_vf_rep_rx_queue_release_op(void *rx_queue)
590 struct bnxt_rx_queue *rxq = (struct bnxt_rx_queue *)rx_queue;
595 bnxt_rx_queue_release_mbufs(rxq);
597 bnxt_free_ring(rxq->rx_ring->rx_ring_struct);
598 bnxt_free_ring(rxq->rx_ring->ag_ring_struct);
599 bnxt_free_ring(rxq->cp_ring->cp_ring_struct);
604 int bnxt_vf_rep_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
607 unsigned int socket_id,
608 __rte_unused const struct rte_eth_txconf *tx_conf)
610 struct bnxt_vf_representor *rep_bp = eth_dev->data->dev_private;
611 struct bnxt *parent_bp = rep_bp->parent_dev->data->dev_private;
612 struct bnxt_tx_queue *parent_txq, *txq;
613 struct bnxt_vf_rep_tx_queue *vfr_txq;
615 if (queue_idx >= BNXT_MAX_VF_REP_RINGS) {
617 "Cannot create Tx rings %d. %d rings available\n",
618 queue_idx, BNXT_MAX_VF_REP_RINGS);
622 if (!nb_desc || nb_desc > MAX_TX_DESC_CNT) {
623 PMD_DRV_LOG(ERR, "nb_desc %d is invalid", nb_desc);
627 if (!parent_bp->tx_queues) {
628 PMD_DRV_LOG(ERR, "Parent Tx qs not configured yet\n");
632 parent_txq = parent_bp->tx_queues[queue_idx];
634 PMD_DRV_LOG(ERR, "Parent TxQ has not been configured yet\n");
638 if (nb_desc != parent_txq->nb_tx_desc) {
639 PMD_DRV_LOG(ERR, "nb_desc %d do not match parent txq", nb_desc);
643 if (eth_dev->data->tx_queues) {
644 vfr_txq = eth_dev->data->tx_queues[queue_idx];
645 bnxt_vf_rep_tx_queue_release_op(vfr_txq);
649 vfr_txq = rte_zmalloc_socket("bnxt_vfr_tx_queue",
650 sizeof(struct bnxt_vf_rep_tx_queue),
651 RTE_CACHE_LINE_SIZE, socket_id);
653 PMD_DRV_LOG(ERR, "bnxt_vfr_tx_queue allocation failed!");
656 txq = rte_zmalloc_socket("bnxt_tx_queue",
657 sizeof(struct bnxt_tx_queue),
658 RTE_CACHE_LINE_SIZE, socket_id);
660 PMD_DRV_LOG(ERR, "bnxt_tx_queue allocation failed!");
665 txq->nb_tx_desc = nb_desc;
666 txq->queue_id = queue_idx;
667 txq->port_id = eth_dev->data->port_id;
669 vfr_txq->bp = rep_bp;
670 eth_dev->data->tx_queues[queue_idx] = vfr_txq;
675 void bnxt_vf_rep_tx_queue_release_op(void *tx_queue)
677 struct bnxt_vf_rep_tx_queue *vfr_txq = tx_queue;
682 rte_free(vfr_txq->txq);
686 int bnxt_vf_rep_stats_get_op(struct rte_eth_dev *eth_dev,
687 struct rte_eth_stats *stats)
689 struct bnxt_vf_representor *rep_bp = eth_dev->data->dev_private;
692 memset(stats, 0, sizeof(*stats));
693 for (i = 0; i < BNXT_MAX_VF_REP_RINGS; i++) {
694 stats->obytes += rep_bp->tx_bytes[i];
695 stats->opackets += rep_bp->tx_pkts[i];
696 stats->ibytes += rep_bp->rx_bytes[i];
697 stats->ipackets += rep_bp->rx_pkts[i];
698 stats->imissed += rep_bp->rx_drop_pkts[i];
700 stats->q_ipackets[i] = rep_bp->rx_pkts[i];
701 stats->q_ibytes[i] = rep_bp->rx_bytes[i];
702 stats->q_opackets[i] = rep_bp->tx_pkts[i];
703 stats->q_obytes[i] = rep_bp->tx_bytes[i];
704 stats->q_errors[i] = rep_bp->rx_drop_pkts[i];
710 int bnxt_vf_rep_stats_reset_op(struct rte_eth_dev *eth_dev)
712 struct bnxt_vf_representor *rep_bp = eth_dev->data->dev_private;
715 for (i = 0; i < BNXT_MAX_VF_REP_RINGS; i++) {
716 rep_bp->tx_pkts[i] = 0;
717 rep_bp->tx_bytes[i] = 0;
718 rep_bp->rx_pkts[i] = 0;
719 rep_bp->rx_bytes[i] = 0;
720 rep_bp->rx_drop_pkts[i] = 0;