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 bnxt_sw_rx_bd *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];
49 vfr_bp = vfr_eth_dev->data->dev_private;
50 /* If rxq_id happens to be > max rep_queue, use rxq0 */
51 que = queue_id < BNXT_MAX_VF_REP_RINGS ? queue_id : 0;
52 rep_rxq = vfr_bp->rx_queues[que];
53 rep_rxr = rep_rxq->rx_ring;
54 mask = rep_rxr->rx_ring_struct->ring_mask;
56 /* Put this mbuf on the RxQ of the Representor */
58 &rep_rxr->rx_buf_ring[rep_rxr->rx_prod++ & mask];
59 if (!prod_rx_buf->mbuf) {
60 prod_rx_buf->mbuf = mbuf;
61 vfr_bp->rx_bytes[que] += mbuf->pkt_len;
62 vfr_bp->rx_pkts[que]++;
64 vfr_bp->rx_drop_bytes[que] += mbuf->pkt_len;
65 vfr_bp->rx_drop_pkts[que]++;
66 rte_free(mbuf); /* Representor Rx ring full, drop pkt */
73 bnxt_vf_rep_rx_burst(void *rx_queue,
74 struct rte_mbuf **rx_pkts,
77 struct bnxt_rx_queue *rxq = rx_queue;
78 struct bnxt_sw_rx_bd *cons_rx_buf;
79 struct bnxt_rx_ring_info *rxr;
80 uint16_t nb_rx_pkts = 0;
87 mask = rxr->rx_ring_struct->ring_mask;
88 for (i = 0; i < nb_pkts; i++) {
89 cons_rx_buf = &rxr->rx_buf_ring[rxr->rx_cons & mask];
90 if (!cons_rx_buf->mbuf)
92 rx_pkts[nb_rx_pkts] = cons_rx_buf->mbuf;
93 rx_pkts[nb_rx_pkts]->port = rxq->port_id;
94 cons_rx_buf->mbuf = NULL;
103 bnxt_vf_rep_tx_burst(void *tx_queue,
104 struct rte_mbuf **tx_pkts,
105 __rte_unused uint16_t nb_pkts)
107 struct bnxt_vf_rep_tx_queue *vfr_txq = tx_queue;
108 struct bnxt_tx_queue *ptxq;
110 struct bnxt_vf_representor *vf_rep_bp;
118 qid = vfr_txq->txq->queue_id;
119 vf_rep_bp = vfr_txq->bp;
120 parent = vf_rep_bp->parent_dev->data->dev_private;
121 pthread_mutex_lock(&parent->rep_info->vfr_lock);
122 ptxq = parent->tx_queues[qid];
124 ptxq->vfr_tx_cfa_action = vf_rep_bp->vfr_tx_cfa_action;
126 for (i = 0; i < nb_pkts; i++) {
127 vf_rep_bp->tx_bytes[qid] += tx_pkts[i]->pkt_len;
128 vf_rep_bp->tx_pkts[qid]++;
131 rc = bnxt_xmit_pkts(ptxq, tx_pkts, nb_pkts);
132 ptxq->vfr_tx_cfa_action = 0;
133 pthread_mutex_unlock(&parent->rep_info->vfr_lock);
138 int bnxt_vf_representor_init(struct rte_eth_dev *eth_dev, void *params)
140 struct bnxt_vf_representor *vf_rep_bp = eth_dev->data->dev_private;
141 struct bnxt_vf_representor *rep_params =
142 (struct bnxt_vf_representor *)params;
143 struct rte_eth_link *link;
144 struct bnxt *parent_bp;
147 vf_rep_bp->vf_id = rep_params->vf_id;
148 vf_rep_bp->switch_domain_id = rep_params->switch_domain_id;
149 vf_rep_bp->parent_dev = rep_params->parent_dev;
151 eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
152 eth_dev->data->representor_id = rep_params->vf_id;
154 rte_eth_random_addr(vf_rep_bp->dflt_mac_addr);
155 memcpy(vf_rep_bp->mac_addr, vf_rep_bp->dflt_mac_addr,
156 sizeof(vf_rep_bp->mac_addr));
157 eth_dev->data->mac_addrs =
158 (struct rte_ether_addr *)&vf_rep_bp->mac_addr;
159 eth_dev->dev_ops = &bnxt_vf_rep_dev_ops;
161 /* No data-path, but need stub Rx/Tx functions to avoid crash
162 * when testing with ovs-dpdk
164 eth_dev->rx_pkt_burst = bnxt_vf_rep_rx_burst;
165 eth_dev->tx_pkt_burst = bnxt_vf_rep_tx_burst;
166 /* Link state. Inherited from PF or trusted VF */
167 parent_bp = vf_rep_bp->parent_dev->data->dev_private;
168 link = &parent_bp->eth_dev->data->dev_link;
170 eth_dev->data->dev_link.link_speed = link->link_speed;
171 eth_dev->data->dev_link.link_duplex = link->link_duplex;
172 eth_dev->data->dev_link.link_status = link->link_status;
173 eth_dev->data->dev_link.link_autoneg = link->link_autoneg;
175 vf_rep_bp->fw_fid = rep_params->vf_id + parent_bp->first_vf_id;
176 PMD_DRV_LOG(INFO, "vf_rep->fw_fid = %d\n", vf_rep_bp->fw_fid);
177 rc = bnxt_hwrm_get_dflt_vnic_svif(parent_bp, vf_rep_bp->fw_fid,
178 &vf_rep_bp->dflt_vnic_id,
181 PMD_DRV_LOG(ERR, "Failed to get default vnic id of VF\n");
183 PMD_DRV_LOG(INFO, "vf_rep->dflt_vnic_id = %d\n",
184 vf_rep_bp->dflt_vnic_id);
186 PMD_DRV_LOG(INFO, "calling bnxt_print_link_info\n");
187 bnxt_print_link_info(eth_dev);
189 /* Pass the information to the rte_eth_dev_close() that it should also
190 * release the private port resources.
192 eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
194 "Switch domain id %d: Representor Device %d init done\n",
195 vf_rep_bp->switch_domain_id, vf_rep_bp->vf_id);
200 int bnxt_vf_representor_uninit(struct rte_eth_dev *eth_dev)
202 struct bnxt *parent_bp;
203 struct bnxt_vf_representor *rep =
204 (struct bnxt_vf_representor *)eth_dev->data->dev_private;
208 eth_dev->data->mac_addrs = NULL;
209 eth_dev->dev_ops = NULL;
211 parent_bp = rep->parent_dev->data->dev_private;
215 parent_bp->num_reps--;
217 if (parent_bp->rep_info)
218 memset(&parent_bp->rep_info[vf_id], 0,
219 sizeof(parent_bp->rep_info[vf_id]));
220 /* mark that this representor has been freed */
224 int bnxt_vf_rep_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_compl)
226 struct bnxt *parent_bp;
227 struct bnxt_vf_representor *rep =
228 (struct bnxt_vf_representor *)eth_dev->data->dev_private;
229 struct rte_eth_link *link;
232 parent_bp = rep->parent_dev->data->dev_private;
236 rc = bnxt_link_update_op(parent_bp->eth_dev, wait_to_compl);
238 /* Link state. Inherited from PF or trusted VF */
239 link = &parent_bp->eth_dev->data->dev_link;
241 eth_dev->data->dev_link.link_speed = link->link_speed;
242 eth_dev->data->dev_link.link_duplex = link->link_duplex;
243 eth_dev->data->dev_link.link_status = link->link_status;
244 eth_dev->data->dev_link.link_autoneg = link->link_autoneg;
245 bnxt_print_link_info(eth_dev);
250 static int bnxt_tf_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
253 struct bnxt_vf_representor *vfr = vfr_ethdev->data->dev_private;
254 struct rte_eth_dev *parent_dev = vfr->parent_dev;
255 struct bnxt *parent_bp = parent_dev->data->dev_private;
256 uint16_t vfr_port_id = vfr_ethdev->data->port_id;
257 struct ulp_tlv_param param_list[] = {
259 .type = BNXT_ULP_DF_PARAM_TYPE_DEV_PORT_ID,
261 .value = {(vfr_port_id >> 8) & 0xff, vfr_port_id & 0xff}
264 .type = BNXT_ULP_DF_PARAM_TYPE_LAST,
270 ulp_port_db_dev_port_intf_update(parent_bp->ulp_ctx, vfr_ethdev);
272 rc = ulp_default_flow_create(parent_dev, param_list,
273 BNXT_ULP_DF_TPL_VFREP_TO_VF,
274 &vfr->rep2vf_flow_id);
277 "Default flow rule creation for VFR->VF failed!\n");
281 BNXT_TF_DBG(DEBUG, "*** Default flow rule created for VFR->VF! ***\n");
282 BNXT_TF_DBG(DEBUG, "rep2vf_flow_id = %d\n", vfr->rep2vf_flow_id);
283 rc = ulp_default_flow_db_cfa_action_get(parent_bp->ulp_ctx,
285 &vfr->vfr_tx_cfa_action);
288 "Failed to get action_ptr for VFR->VF dflt rule\n");
291 BNXT_TF_DBG(DEBUG, "tx_cfa_action = %d\n", vfr->vfr_tx_cfa_action);
292 rc = ulp_default_flow_create(parent_dev, param_list,
293 BNXT_ULP_DF_TPL_VF_TO_VFREP,
294 &vfr->vf2rep_flow_id);
297 "Default flow rule creation for VF->VFR failed!\n");
301 BNXT_TF_DBG(DEBUG, "*** Default flow rule created for VF->VFR! ***\n");
302 BNXT_TF_DBG(DEBUG, "vfr2rep_flow_id = %d\n", vfr->vf2rep_flow_id);
304 rc = bnxt_hwrm_cfa_vfr_alloc(parent_bp, vfr->vf_id);
311 ulp_default_flow_destroy(vfr->parent_dev, vfr->vf2rep_flow_id);
313 ulp_default_flow_destroy(vfr->parent_dev, vfr->rep2vf_flow_id);
318 static int bnxt_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
321 struct bnxt_vf_representor *vfr = vfr_ethdev->data->dev_private;
322 struct bnxt *parent_bp;
324 if (!vfr || !vfr->parent_dev) {
326 "No memory allocated for representor\n");
330 parent_bp = vfr->parent_dev->data->dev_private;
331 if (parent_bp && !parent_bp->ulp_ctx) {
333 "ulp context not allocated for parent\n");
337 /* Check if representor has been already allocated in FW */
338 if (vfr->vfr_tx_cfa_action)
342 * Alloc VF rep rules in CFA after default VNIC is created.
343 * Otherwise the FW will create the VF-rep rules with
344 * default drop action.
346 rc = bnxt_tf_vfr_alloc(vfr_ethdev);
348 PMD_DRV_LOG(DEBUG, "allocated representor %d in FW\n",
352 "Failed to alloc representor %d in FW\n",
358 static void bnxt_vf_rep_free_rx_mbufs(struct bnxt_vf_representor *rep_bp)
360 struct bnxt_rx_queue *rxq;
363 for (i = 0; i < rep_bp->rx_nr_rings; i++) {
364 rxq = rep_bp->rx_queues[i];
365 bnxt_rx_queue_release_mbufs(rxq);
369 int bnxt_vf_rep_dev_start_op(struct rte_eth_dev *eth_dev)
371 struct bnxt_vf_representor *rep_bp = eth_dev->data->dev_private;
374 rc = bnxt_vfr_alloc(eth_dev);
377 eth_dev->rx_pkt_burst = &bnxt_vf_rep_rx_burst;
378 eth_dev->tx_pkt_burst = &bnxt_vf_rep_tx_burst;
380 bnxt_vf_rep_link_update_op(eth_dev, 1);
382 eth_dev->data->dev_link.link_status = 0;
383 bnxt_vf_rep_free_rx_mbufs(rep_bp);
389 static int bnxt_tf_vfr_free(struct bnxt_vf_representor *vfr)
393 rc = ulp_default_flow_destroy(vfr->parent_dev,
394 vfr->rep2vf_flow_id);
397 "default flow destroy failed rep2vf flowid: %d\n",
398 vfr->rep2vf_flow_id);
399 rc = ulp_default_flow_destroy(vfr->parent_dev,
400 vfr->vf2rep_flow_id);
403 "default flow destroy failed vf2rep flowid: %d\n",
404 vfr->vf2rep_flow_id);
408 static int bnxt_vfr_free(struct bnxt_vf_representor *vfr)
411 struct bnxt *parent_bp;
413 if (!vfr || !vfr->parent_dev) {
415 "No memory allocated for representor\n");
419 parent_bp = vfr->parent_dev->data->dev_private;
423 /* Check if representor has been already freed in FW */
424 if (!vfr->vfr_tx_cfa_action)
427 rc = bnxt_tf_vfr_free(vfr);
430 "Failed to free representor %d in FW\n",
435 PMD_DRV_LOG(DEBUG, "freed representor %d in FW\n",
437 vfr->vfr_tx_cfa_action = 0;
439 rc = bnxt_hwrm_cfa_vfr_free(parent_bp, vfr->vf_id);
444 void bnxt_vf_rep_dev_stop_op(struct rte_eth_dev *eth_dev)
446 struct bnxt_vf_representor *vfr_bp = eth_dev->data->dev_private;
448 /* Avoid crashes as we are about to free queues */
449 eth_dev->rx_pkt_burst = &bnxt_dummy_recv_pkts;
450 eth_dev->tx_pkt_burst = &bnxt_dummy_xmit_pkts;
452 bnxt_vfr_free(vfr_bp);
454 if (eth_dev->data->dev_started)
455 eth_dev->data->dev_link.link_status = 0;
457 bnxt_vf_rep_free_rx_mbufs(vfr_bp);
460 void bnxt_vf_rep_dev_close_op(struct rte_eth_dev *eth_dev)
462 bnxt_vf_representor_uninit(eth_dev);
465 int bnxt_vf_rep_dev_info_get_op(struct rte_eth_dev *eth_dev,
466 struct rte_eth_dev_info *dev_info)
468 struct bnxt_vf_representor *rep_bp = eth_dev->data->dev_private;
469 struct bnxt *parent_bp;
470 unsigned int max_rx_rings;
474 parent_bp = rep_bp->parent_dev->data->dev_private;
476 PMD_DRV_LOG(ERR, "Rep parent NULL!\n");
479 PMD_DRV_LOG(DEBUG, "Representor dev_info_get_op\n");
480 dev_info->max_mac_addrs = parent_bp->max_l2_ctx;
481 dev_info->max_hash_mac_addrs = 0;
483 max_rx_rings = BNXT_MAX_VF_REP_RINGS;
484 /* For the sake of symmetry, max_rx_queues = max_tx_queues */
485 dev_info->max_rx_queues = max_rx_rings;
486 dev_info->max_tx_queues = max_rx_rings;
487 dev_info->reta_size = bnxt_rss_hash_tbl_size(parent_bp);
488 dev_info->hash_key_size = 40;
491 dev_info->min_mtu = RTE_ETHER_MIN_MTU;
492 dev_info->max_mtu = BNXT_MAX_MTU;
494 /* Fast path specifics */
495 dev_info->min_rx_bufsize = 1;
496 dev_info->max_rx_pktlen = BNXT_MAX_PKT_LEN;
498 dev_info->rx_offload_capa = BNXT_DEV_RX_OFFLOAD_SUPPORT;
499 if (parent_bp->flags & BNXT_FLAG_PTP_SUPPORTED)
500 dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_TIMESTAMP;
501 dev_info->tx_offload_capa = BNXT_DEV_TX_OFFLOAD_SUPPORT;
502 dev_info->flow_type_rss_offloads = BNXT_ETH_RSS_SUPPORT;
507 int bnxt_vf_rep_dev_configure_op(__rte_unused struct rte_eth_dev *eth_dev)
509 struct bnxt_vf_representor *rep_bp = eth_dev->data->dev_private;
511 PMD_DRV_LOG(DEBUG, "Representor dev_configure_op\n");
512 rep_bp->rx_queues = (void *)eth_dev->data->rx_queues;
513 rep_bp->tx_nr_rings = eth_dev->data->nb_tx_queues;
514 rep_bp->rx_nr_rings = eth_dev->data->nb_rx_queues;
519 int bnxt_vf_rep_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
522 unsigned int socket_id,
523 __rte_unused const struct rte_eth_rxconf *rx_conf,
524 __rte_unused struct rte_mempool *mp)
526 struct bnxt_vf_representor *rep_bp = eth_dev->data->dev_private;
527 struct bnxt *parent_bp = rep_bp->parent_dev->data->dev_private;
528 struct bnxt_rx_queue *parent_rxq;
529 struct bnxt_rx_queue *rxq;
530 struct bnxt_sw_rx_bd *buf_ring;
533 if (queue_idx >= BNXT_MAX_VF_REP_RINGS) {
535 "Cannot create Rx ring %d. %d rings available\n",
536 queue_idx, BNXT_MAX_VF_REP_RINGS);
540 if (!nb_desc || nb_desc > MAX_RX_DESC_CNT) {
541 PMD_DRV_LOG(ERR, "nb_desc %d is invalid\n", nb_desc);
545 if (!parent_bp->rx_queues) {
546 PMD_DRV_LOG(ERR, "Parent Rx qs not configured yet\n");
550 parent_rxq = parent_bp->rx_queues[queue_idx];
552 PMD_DRV_LOG(ERR, "Parent RxQ has not been configured yet\n");
556 if (nb_desc != parent_rxq->nb_rx_desc) {
557 PMD_DRV_LOG(ERR, "nb_desc %d do not match parent rxq", nb_desc);
561 if (eth_dev->data->rx_queues) {
562 rxq = eth_dev->data->rx_queues[queue_idx];
564 bnxt_rx_queue_release_op(rxq);
567 rxq = rte_zmalloc_socket("bnxt_vfr_rx_queue",
568 sizeof(struct bnxt_rx_queue),
569 RTE_CACHE_LINE_SIZE, socket_id);
571 PMD_DRV_LOG(ERR, "bnxt_vfr_rx_queue allocation failed!\n");
575 rxq->nb_rx_desc = nb_desc;
577 rc = bnxt_init_rx_ring_struct(rxq, socket_id);
581 buf_ring = rte_zmalloc_socket("bnxt_rx_vfr_buf_ring",
582 sizeof(struct bnxt_sw_rx_bd) *
583 rxq->rx_ring->rx_ring_struct->ring_size,
584 RTE_CACHE_LINE_SIZE, socket_id);
586 PMD_DRV_LOG(ERR, "bnxt_rx_vfr_buf_ring allocation failed!\n");
591 rxq->rx_ring->rx_buf_ring = buf_ring;
592 rxq->queue_id = queue_idx;
593 rxq->port_id = eth_dev->data->port_id;
594 eth_dev->data->rx_queues[queue_idx] = rxq;
600 bnxt_rx_queue_release_op(rxq);
605 void bnxt_vf_rep_rx_queue_release_op(void *rx_queue)
607 struct bnxt_rx_queue *rxq = (struct bnxt_rx_queue *)rx_queue;
612 bnxt_rx_queue_release_mbufs(rxq);
614 bnxt_free_ring(rxq->rx_ring->rx_ring_struct);
615 bnxt_free_ring(rxq->rx_ring->ag_ring_struct);
616 bnxt_free_ring(rxq->cp_ring->cp_ring_struct);
621 int bnxt_vf_rep_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
624 unsigned int socket_id,
625 __rte_unused const struct rte_eth_txconf *tx_conf)
627 struct bnxt_vf_representor *rep_bp = eth_dev->data->dev_private;
628 struct bnxt *parent_bp = rep_bp->parent_dev->data->dev_private;
629 struct bnxt_tx_queue *parent_txq, *txq;
630 struct bnxt_vf_rep_tx_queue *vfr_txq;
632 if (queue_idx >= BNXT_MAX_VF_REP_RINGS) {
634 "Cannot create Tx rings %d. %d rings available\n",
635 queue_idx, BNXT_MAX_VF_REP_RINGS);
639 if (!nb_desc || nb_desc > MAX_TX_DESC_CNT) {
640 PMD_DRV_LOG(ERR, "nb_desc %d is invalid", nb_desc);
644 if (!parent_bp->tx_queues) {
645 PMD_DRV_LOG(ERR, "Parent Tx qs not configured yet\n");
649 parent_txq = parent_bp->tx_queues[queue_idx];
651 PMD_DRV_LOG(ERR, "Parent TxQ has not been configured yet\n");
655 if (nb_desc != parent_txq->nb_tx_desc) {
656 PMD_DRV_LOG(ERR, "nb_desc %d do not match parent txq", nb_desc);
660 if (eth_dev->data->tx_queues) {
661 vfr_txq = eth_dev->data->tx_queues[queue_idx];
662 bnxt_vf_rep_tx_queue_release_op(vfr_txq);
666 vfr_txq = rte_zmalloc_socket("bnxt_vfr_tx_queue",
667 sizeof(struct bnxt_vf_rep_tx_queue),
668 RTE_CACHE_LINE_SIZE, socket_id);
670 PMD_DRV_LOG(ERR, "bnxt_vfr_tx_queue allocation failed!");
673 txq = rte_zmalloc_socket("bnxt_tx_queue",
674 sizeof(struct bnxt_tx_queue),
675 RTE_CACHE_LINE_SIZE, socket_id);
677 PMD_DRV_LOG(ERR, "bnxt_tx_queue allocation failed!");
682 txq->nb_tx_desc = nb_desc;
683 txq->queue_id = queue_idx;
684 txq->port_id = eth_dev->data->port_id;
686 vfr_txq->bp = rep_bp;
687 eth_dev->data->tx_queues[queue_idx] = vfr_txq;
692 void bnxt_vf_rep_tx_queue_release_op(void *tx_queue)
694 struct bnxt_vf_rep_tx_queue *vfr_txq = tx_queue;
699 rte_free(vfr_txq->txq);
703 int bnxt_vf_rep_stats_get_op(struct rte_eth_dev *eth_dev,
704 struct rte_eth_stats *stats)
706 struct bnxt_vf_representor *rep_bp = eth_dev->data->dev_private;
709 memset(stats, 0, sizeof(*stats));
710 for (i = 0; i < BNXT_MAX_VF_REP_RINGS; i++) {
711 stats->obytes += rep_bp->tx_bytes[i];
712 stats->opackets += rep_bp->tx_pkts[i];
713 stats->ibytes += rep_bp->rx_bytes[i];
714 stats->ipackets += rep_bp->rx_pkts[i];
715 stats->imissed += rep_bp->rx_drop_pkts[i];
717 stats->q_ipackets[i] = rep_bp->rx_pkts[i];
718 stats->q_ibytes[i] = rep_bp->rx_bytes[i];
719 stats->q_opackets[i] = rep_bp->tx_pkts[i];
720 stats->q_obytes[i] = rep_bp->tx_bytes[i];
721 stats->q_errors[i] = rep_bp->rx_drop_pkts[i];
727 int bnxt_vf_rep_stats_reset_op(struct rte_eth_dev *eth_dev)
729 struct bnxt_vf_representor *rep_bp = eth_dev->data->dev_private;
732 for (i = 0; i < BNXT_MAX_VF_REP_RINGS; i++) {
733 rep_bp->tx_pkts[i] = 0;
734 rep_bp->tx_bytes[i] = 0;
735 rep_bp->rx_pkts[i] = 0;
736 rep_bp->rx_bytes[i] = 0;
737 rep_bp->rx_drop_pkts[i] = 0;