Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause
2 : : * Copyright(c) 2014-2023 Broadcom
3 : : * All rights reserved.
4 : : */
5 : :
6 : : #include "bnxt.h"
7 : : #include "bnxt_ring.h"
8 : : #include "bnxt_reps.h"
9 : : #include "bnxt_rxq.h"
10 : : #include "bnxt_rxr.h"
11 : : #include "bnxt_txq.h"
12 : : #include "bnxt_txr.h"
13 : : #include "bnxt_hwrm.h"
14 : : #include "hsi_struct_def_dpdk.h"
15 : : #include "bnxt_tf_common.h"
16 : : #include "bnxt_ulp_utils.h"
17 : : #include "ulp_port_db.h"
18 : : #include "ulp_flow_db.h"
19 : :
20 : : static const struct eth_dev_ops bnxt_rep_dev_ops = {
21 : : .dev_infos_get = bnxt_rep_dev_info_get_op,
22 : : .dev_configure = bnxt_rep_dev_configure_op,
23 : : .dev_start = bnxt_rep_dev_start_op,
24 : : .rx_queue_setup = bnxt_rep_rx_queue_setup_op,
25 : : .rx_queue_release = bnxt_rep_rx_queue_release_op,
26 : : .tx_queue_setup = bnxt_rep_tx_queue_setup_op,
27 : : .tx_queue_release = bnxt_rep_tx_queue_release_op,
28 : : .link_update = bnxt_rep_link_update_op,
29 : : .dev_close = bnxt_rep_dev_close_op,
30 : : .dev_stop = bnxt_rep_dev_stop_op,
31 : : .stats_get = bnxt_rep_stats_get_op,
32 : : .stats_reset = bnxt_rep_stats_reset_op,
33 : : .flow_ops_get = bnxt_flow_ops_get_op
34 : : };
35 : :
36 : : static bool bnxt_rep_check_parent(struct bnxt_representor *rep)
37 : : {
38 [ # # # # : 0 : if (!rep->parent_dev->data || !rep->parent_dev->data->dev_private)
# # # # #
# # # ]
39 : : return false;
40 : :
41 : : return true;
42 : : }
43 : :
44 : : uint16_t
45 : 0 : bnxt_vfr_recv(uint16_t port_id, uint16_t queue_id, struct rte_mbuf *mbuf)
46 : : {
47 : : struct bnxt_representor *vfr_bp = NULL;
48 : : struct bnxt_rx_ring_info *rep_rxr;
49 : : struct rte_eth_dev *vfr_eth_dev;
50 : : struct rte_mbuf **prod_rx_buf;
51 : : struct bnxt_rx_queue *rep_rxq;
52 : : uint16_t mask;
53 : : uint8_t que;
54 : :
55 : 0 : vfr_eth_dev = &rte_eth_devices[port_id];
56 : 0 : vfr_bp = vfr_eth_dev ? vfr_eth_dev->data->dev_private : NULL;
57 : :
58 [ # # ]: 0 : if (unlikely(vfr_bp == NULL))
59 : : return 1;
60 : :
61 : : /* If rxq_id happens to be > nr_rings, use ring 0 */
62 [ # # ]: 0 : que = queue_id < vfr_bp->rx_nr_rings ? queue_id : 0;
63 : 0 : rep_rxq = vfr_bp->rx_queues[que];
64 : : /* Ideally should not happen now, paranoid check */
65 [ # # ]: 0 : if (!rep_rxq)
66 : : return 1;
67 : 0 : rep_rxr = rep_rxq->rx_ring;
68 : 0 : mask = rep_rxr->rx_ring_struct->ring_mask;
69 : :
70 : : /* Put this mbuf on the RxQ of the Representor */
71 : 0 : prod_rx_buf = &rep_rxr->rx_buf_ring[rep_rxr->rx_raw_prod & mask];
72 [ # # ]: 0 : if (*prod_rx_buf == NULL) {
73 : 0 : *prod_rx_buf = mbuf;
74 : 0 : vfr_bp->rx_bytes[que] += mbuf->pkt_len;
75 : 0 : vfr_bp->rx_pkts[que]++;
76 : 0 : rep_rxr->rx_raw_prod++;
77 : : } else {
78 : : /* Representor Rx ring full, drop pkt */
79 : 0 : vfr_bp->rx_drop_bytes[que] += mbuf->pkt_len;
80 [ # # ]: 0 : vfr_bp->rx_drop_pkts[que]++;
81 : : rte_mbuf_raw_free(mbuf);
82 : : }
83 : :
84 : : return 0;
85 : : }
86 : :
87 : : static uint16_t
88 : 0 : bnxt_rep_rx_burst(void *rx_queue,
89 : : struct rte_mbuf **rx_pkts,
90 : : uint16_t nb_pkts)
91 : : {
92 : : struct bnxt_rx_queue *rxq = rx_queue;
93 : : struct rte_mbuf **cons_rx_buf;
94 : : struct bnxt_rx_ring_info *rxr;
95 : : uint16_t nb_rx_pkts = 0;
96 : : uint16_t mask, i;
97 : :
98 [ # # ]: 0 : if (!rxq)
99 : : return 0;
100 : :
101 : 0 : rxr = rxq->rx_ring;
102 : 0 : mask = rxr->rx_ring_struct->ring_mask;
103 [ # # ]: 0 : for (i = 0; i < nb_pkts; i++) {
104 : 0 : cons_rx_buf = &rxr->rx_buf_ring[rxr->rx_cons & mask];
105 [ # # ]: 0 : if (*cons_rx_buf == NULL)
106 : 0 : return nb_rx_pkts;
107 : 0 : rx_pkts[nb_rx_pkts] = *cons_rx_buf;
108 : 0 : rx_pkts[nb_rx_pkts]->port = rxq->port_id;
109 : 0 : *cons_rx_buf = NULL;
110 : 0 : nb_rx_pkts++;
111 : 0 : rxr->rx_cons++;
112 : : }
113 : :
114 : : return nb_rx_pkts;
115 : : }
116 : :
117 : : static uint16_t
118 : 0 : bnxt_rep_tx_burst(void *tx_queue,
119 : : struct rte_mbuf **tx_pkts,
120 : : uint16_t nb_pkts)
121 : : {
122 : : struct bnxt_vf_rep_tx_queue *vfr_txq = tx_queue;
123 : : struct bnxt_tx_queue *ptxq;
124 : : struct bnxt *parent;
125 : : struct bnxt_representor *vf_rep_bp;
126 : : int qid;
127 : : int rc;
128 : : int i;
129 : :
130 [ # # ]: 0 : if (!vfr_txq)
131 : : return 0;
132 : :
133 : 0 : qid = vfr_txq->txq->queue_id;
134 : 0 : vf_rep_bp = vfr_txq->bp;
135 : 0 : parent = vf_rep_bp->parent_dev->data->dev_private;
136 : 0 : ptxq = parent->tx_queues[qid];
137 : 0 : pthread_mutex_lock(&ptxq->txq_lock);
138 : :
139 : 0 : ptxq->vfr_tx_cfa_action = vf_rep_bp->vfr_tx_cfa_action;
140 : :
141 [ # # ]: 0 : for (i = 0; i < nb_pkts; i++) {
142 : 0 : vf_rep_bp->tx_bytes[qid] += tx_pkts[i]->pkt_len;
143 : 0 : vf_rep_bp->tx_pkts[qid]++;
144 : : }
145 : :
146 : 0 : rc = _bnxt_xmit_pkts(ptxq, tx_pkts, nb_pkts);
147 : 0 : ptxq->vfr_tx_cfa_action = 0;
148 : 0 : pthread_mutex_unlock(&ptxq->txq_lock);
149 : :
150 : 0 : return rc;
151 : : }
152 : :
153 : : static int
154 : 0 : bnxt_get_dflt_vnic_svif(struct bnxt *bp, struct bnxt_representor *vf_rep_bp)
155 : : {
156 : : struct bnxt_rep_info *rep_info;
157 : : int rc;
158 : :
159 : 0 : rc = bnxt_hwrm_get_dflt_vnic_svif(bp, vf_rep_bp->fw_fid,
160 : : &vf_rep_bp->dflt_vnic_id,
161 : : &vf_rep_bp->svif);
162 [ # # ]: 0 : if (rc) {
163 : 0 : PMD_DRV_LOG_LINE(ERR, "Failed to get default vnic id of VF");
164 : 0 : vf_rep_bp->dflt_vnic_id = BNXT_DFLT_VNIC_ID_INVALID;
165 : 0 : vf_rep_bp->svif = BNXT_SVIF_INVALID;
166 : : } else {
167 : 0 : PMD_DRV_LOG_LINE(INFO, "vf_rep->dflt_vnic_id = %d",
168 : : vf_rep_bp->dflt_vnic_id);
169 : : }
170 [ # # ]: 0 : if (vf_rep_bp->dflt_vnic_id != BNXT_DFLT_VNIC_ID_INVALID &&
171 [ # # ]: 0 : vf_rep_bp->svif != BNXT_SVIF_INVALID) {
172 : 0 : rep_info = &bp->rep_info[vf_rep_bp->vf_id];
173 : 0 : rep_info->conduit_valid = true;
174 : : }
175 : :
176 : 0 : return rc;
177 : : }
178 : :
179 : 0 : int bnxt_representor_init(struct rte_eth_dev *eth_dev, void *params)
180 : : {
181 : 0 : struct bnxt_representor *vf_rep_bp = eth_dev->data->dev_private;
182 : : struct bnxt_representor *rep_params =
183 : : (struct bnxt_representor *)params;
184 : : struct rte_eth_link *link;
185 : : struct bnxt *parent_bp;
186 : : uint16_t first_vf_id;
187 : : int rc = 0;
188 : :
189 : 0 : PMD_DRV_LOG_LINE(DEBUG, "BNXT Port:%d VFR init", eth_dev->data->port_id);
190 : 0 : vf_rep_bp->vf_id = rep_params->vf_id;
191 : 0 : vf_rep_bp->switch_domain_id = rep_params->switch_domain_id;
192 : 0 : vf_rep_bp->parent_dev = rep_params->parent_dev;
193 : 0 : vf_rep_bp->rep_based_pf = rep_params->rep_based_pf;
194 : 0 : vf_rep_bp->flags = rep_params->flags;
195 : 0 : vf_rep_bp->rep_q_r2f = rep_params->rep_q_r2f;
196 : 0 : vf_rep_bp->rep_q_f2r = rep_params->rep_q_f2r;
197 : 0 : vf_rep_bp->rep_fc_r2f = rep_params->rep_fc_r2f;
198 : 0 : vf_rep_bp->rep_fc_f2r = rep_params->rep_fc_f2r;
199 : :
200 : 0 : eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR |
201 : : RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
202 : 0 : eth_dev->data->representor_id = rep_params->vf_id;
203 : 0 : eth_dev->data->backer_port_id = rep_params->parent_dev->data->port_id;
204 : :
205 : 0 : rte_eth_random_addr(vf_rep_bp->dflt_mac_addr);
206 : 0 : memcpy(vf_rep_bp->mac_addr, vf_rep_bp->dflt_mac_addr,
207 : : sizeof(vf_rep_bp->mac_addr));
208 : 0 : eth_dev->data->mac_addrs =
209 : : (struct rte_ether_addr *)&vf_rep_bp->mac_addr;
210 : 0 : eth_dev->dev_ops = &bnxt_rep_dev_ops;
211 : :
212 : : /* No data-path, but need stub Rx/Tx functions to avoid crash
213 : : * when testing with ovs-dpdk
214 : : */
215 : 0 : eth_dev->rx_pkt_burst = bnxt_rep_rx_burst;
216 : 0 : eth_dev->tx_pkt_burst = bnxt_rep_tx_burst;
217 : : /* Link state. Inherited from PF or trusted VF */
218 : 0 : parent_bp = vf_rep_bp->parent_dev->data->dev_private;
219 : 0 : link = &parent_bp->eth_dev->data->dev_link;
220 : :
221 : 0 : eth_dev->data->dev_link.link_speed = link->link_speed;
222 : 0 : eth_dev->data->dev_link.link_duplex = link->link_duplex;
223 : 0 : eth_dev->data->dev_link.link_status = link->link_status;
224 : 0 : eth_dev->data->dev_link.link_autoneg = link->link_autoneg;
225 : :
226 : 0 : bnxt_print_link_info(eth_dev);
227 : :
228 : 0 : PMD_DRV_LOG_LINE(INFO,
229 : : "Switch domain id %d: Representor Device %d init done",
230 : : vf_rep_bp->switch_domain_id, vf_rep_bp->vf_id);
231 : :
232 [ # # ]: 0 : if (BNXT_REP_BASED_PF(vf_rep_bp)) {
233 : 0 : vf_rep_bp->fw_fid = vf_rep_bp->rep_based_pf + 1;
234 : 0 : vf_rep_bp->parent_pf_idx = vf_rep_bp->rep_based_pf;
235 [ # # ]: 0 : if (!(BNXT_REP_PF(vf_rep_bp))) {
236 : : /* VF representor for the remote PF,get first_vf_id */
237 : 0 : rc = bnxt_hwrm_first_vf_id_query(parent_bp,
238 : : vf_rep_bp->fw_fid,
239 : : &first_vf_id);
240 [ # # ]: 0 : if (rc)
241 : : return rc;
242 [ # # ]: 0 : if (first_vf_id == 0xffff) {
243 : 0 : PMD_DRV_LOG_LINE(ERR,
244 : : "Invalid first_vf_id fid:%x",
245 : : vf_rep_bp->fw_fid);
246 : 0 : return -EINVAL;
247 : : }
248 : 0 : PMD_DRV_LOG_LINE(INFO, "first_vf_id = %x parent_fid:%x",
249 : : first_vf_id, vf_rep_bp->fw_fid);
250 : 0 : vf_rep_bp->fw_fid = rep_params->vf_id + first_vf_id;
251 : : }
252 : : } else {
253 : 0 : vf_rep_bp->fw_fid = rep_params->vf_id + parent_bp->first_vf_id;
254 [ # # ]: 0 : if (BNXT_VF_IS_TRUSTED(parent_bp))
255 : 0 : vf_rep_bp->parent_pf_idx = parent_bp->parent->fid - 1;
256 : : else
257 : 0 : vf_rep_bp->parent_pf_idx = parent_bp->fw_fid - 1;
258 : : }
259 : :
260 : 0 : PMD_DRV_LOG_LINE(INFO, "vf_rep->fw_fid = %d", vf_rep_bp->fw_fid);
261 : :
262 : 0 : return 0;
263 : : }
264 : :
265 : 0 : int bnxt_representor_uninit(struct rte_eth_dev *eth_dev)
266 : : {
267 : : struct bnxt *parent_bp;
268 : 0 : struct bnxt_representor *rep =
269 : 0 : (struct bnxt_representor *)eth_dev->data->dev_private;
270 : : uint16_t vf_id;
271 : :
272 [ # # ]: 0 : if (rte_eal_process_type() != RTE_PROC_PRIMARY)
273 : : return 0;
274 : :
275 : 0 : PMD_DRV_LOG_LINE(DEBUG, "BNXT Port:%d VFR uninit", eth_dev->data->port_id);
276 [ # # ]: 0 : eth_dev->data->mac_addrs = NULL;
277 : :
278 : : if (!bnxt_rep_check_parent(rep)) {
279 : 0 : PMD_DRV_LOG_LINE(DEBUG, "BNXT Port:%d already freed",
280 : : eth_dev->data->port_id);
281 : 0 : return 0;
282 : : }
283 : : parent_bp = rep->parent_dev->data->dev_private;
284 : :
285 : 0 : parent_bp->num_reps--;
286 : 0 : vf_id = rep->vf_id;
287 [ # # ]: 0 : if (parent_bp->rep_info)
288 : 0 : memset(&parent_bp->rep_info[vf_id], 0,
289 : : sizeof(parent_bp->rep_info[vf_id]));
290 : : /* mark that this representor has been freed */
291 : : return 0;
292 : : }
293 : :
294 : 0 : int bnxt_rep_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_compl)
295 : : {
296 : : struct bnxt *parent_bp;
297 : 0 : struct bnxt_representor *rep =
298 [ # # ]: 0 : (struct bnxt_representor *)eth_dev->data->dev_private;
299 : : struct rte_eth_link *link;
300 : : int rc;
301 : :
302 : : if (!bnxt_rep_check_parent(rep))
303 : : return 0;
304 : :
305 : : parent_bp = rep->parent_dev->data->dev_private;
306 : 0 : rc = bnxt_link_update_op(parent_bp->eth_dev, wait_to_compl);
307 : :
308 : : /* Link state. Inherited from PF or trusted VF */
309 : 0 : link = &parent_bp->eth_dev->data->dev_link;
310 : :
311 : 0 : eth_dev->data->dev_link.link_speed = link->link_speed;
312 : 0 : eth_dev->data->dev_link.link_duplex = link->link_duplex;
313 : 0 : eth_dev->data->dev_link.link_status = link->link_status;
314 : 0 : eth_dev->data->dev_link.link_autoneg = link->link_autoneg;
315 : 0 : bnxt_print_link_info(eth_dev);
316 : :
317 : 0 : return rc;
318 : : }
319 : :
320 : 0 : static int bnxt_tf_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
321 : : {
322 : : int rc;
323 : 0 : struct bnxt_representor *vfr = vfr_ethdev->data->dev_private;
324 : 0 : struct rte_eth_dev *parent_dev = vfr->parent_dev;
325 : 0 : struct bnxt *parent_bp = parent_dev->data->dev_private;
326 : :
327 [ # # # # ]: 0 : if (!parent_bp || !parent_bp->ulp_ctx) {
328 : 0 : PMD_DRV_LOG_LINE(ERR, "Invalid arguments");
329 : 0 : return 0;
330 : : }
331 : : /* update the port id so you can backtrack to ethdev */
332 : 0 : vfr->dpdk_port_id = vfr_ethdev->data->port_id;
333 : :
334 : : /* If pair is present, then delete the pair */
335 [ # # ]: 0 : if (!BNXT_CHIP_P7(parent_bp))
336 [ # # ]: 0 : if (bnxt_hwrm_cfa_pair_exists(parent_bp, vfr))
337 : 0 : (void)bnxt_hwrm_cfa_pair_free(parent_bp, vfr);
338 : :
339 : : /* Update the ULP portdata base with the new VFR interface */
340 : 0 : rc = ulp_port_db_port_update(parent_bp->ulp_ctx, vfr_ethdev);
341 [ # # ]: 0 : if (rc) {
342 : 0 : PMD_DRV_LOG_LINE(ERR, "Failed to update ulp port details vfr:%u",
343 : : vfr->vf_id);
344 : 0 : return rc;
345 : : }
346 : :
347 : : /* Create the default rules for the VFR */
348 : 0 : rc = bnxt_ulp_create_vfr_default_rules(vfr_ethdev);
349 [ # # ]: 0 : if (rc) {
350 : 0 : PMD_DRV_LOG_LINE(ERR, "Failed to create VFR default rules vfr:%u",
351 : : vfr->vf_id);
352 : 0 : return rc;
353 : : }
354 : : /* update the port id so you can backtrack to ethdev */
355 : 0 : vfr->dpdk_port_id = vfr_ethdev->data->port_id;
356 : :
357 [ # # ]: 0 : if (BNXT_CHIP_P7(parent_bp)) {
358 : 0 : rc = bnxt_hwrm_release_afm_func(parent_bp,
359 : 0 : vfr->fw_fid,
360 : 0 : parent_bp->fw_fid,
361 : : HWRM_CFA_RELEASE_AFM_FUNC_INPUT_TYPE_EFID,
362 : : 0);
363 : :
364 [ # # ]: 0 : if (rc) {
365 : 0 : PMD_DRV_LOG_LINE(ERR,
366 : : "Failed to release EFID:%d from RFID:%d rc=%d",
367 : : vfr->vf_id, parent_bp->fw_fid, rc);
368 : 0 : goto error_del_rules;
369 : : }
370 : 0 : PMD_DRV_LOG_LINE(DEBUG, "Released EFID:%d from RFID:%d",
371 : : vfr->fw_fid, parent_bp->fw_fid);
372 : :
373 : : } else {
374 : 0 : rc = bnxt_hwrm_cfa_pair_alloc(parent_bp, vfr);
375 [ # # ]: 0 : if (rc) {
376 : 0 : PMD_DRV_LOG_LINE(ERR,
377 : : "Failed in hwrm vfr alloc vfr:%u rc=%d",
378 : : vfr->vf_id, rc);
379 : 0 : goto error_del_rules;
380 : : }
381 : : }
382 : :
383 : : /* if supported, it will add the vfr endpoint to the session, otherwise
384 : : * it returns success
385 : : */
386 [ # # ]: 0 : rc = bnxt_ulp_vfr_session_fid_add(parent_bp->ulp_ctx, vfr->fw_fid);
387 [ # # ]: 0 : if (rc)
388 : 0 : goto error_del_rules;
389 : : else
390 : 0 : PMD_DRV_LOG_LINE(DEBUG,
391 : : "BNXT Port:%d VFR created and initialized",
392 : : vfr->dpdk_port_id);
393 : 0 : return rc;
394 : 0 : error_del_rules:
395 : 0 : (void)bnxt_ulp_delete_vfr_default_rules(vfr);
396 : 0 : return rc;
397 : : }
398 : :
399 : 0 : static int bnxt_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
400 : : {
401 : : int rc = 0;
402 : 0 : struct bnxt_representor *vfr = vfr_ethdev->data->dev_private;
403 : : struct bnxt *parent_bp;
404 : :
405 [ # # # # ]: 0 : if (!vfr || !vfr->parent_dev) {
406 : 0 : PMD_DRV_LOG_LINE(ERR,
407 : : "No memory allocated for representor");
408 : 0 : return -ENOMEM;
409 : : }
410 : :
411 : 0 : parent_bp = vfr->parent_dev->data->dev_private;
412 [ # # # # ]: 0 : if (parent_bp && !parent_bp->ulp_ctx) {
413 : 0 : PMD_DRV_LOG_LINE(ERR,
414 : : "ulp context not allocated for parent");
415 : 0 : return -EIO;
416 : : }
417 : :
418 : : /* Check if representor has been already allocated in FW */
419 [ # # ]: 0 : if (vfr->vfr_tx_cfa_action)
420 : : return 0;
421 : :
422 : : /*
423 : : * Alloc VF rep rules in CFA after default VNIC is created.
424 : : * Otherwise the FW will create the VF-rep rules with
425 : : * default drop action.
426 : : */
427 : 0 : rc = bnxt_tf_vfr_alloc(vfr_ethdev);
428 [ # # ]: 0 : if (!rc)
429 : 0 : PMD_DRV_LOG_LINE(DEBUG, "allocated representor %d in FW",
430 : : vfr->vf_id);
431 : : else
432 : 0 : PMD_DRV_LOG_LINE(ERR,
433 : : "Failed to alloc representor %d in FW",
434 : : vfr->vf_id);
435 : :
436 : : return rc;
437 : : }
438 : :
439 : 0 : static void bnxt_vfr_rx_queue_release_mbufs(struct bnxt_rx_queue *rxq)
440 : : {
441 : : struct rte_mbuf **sw_ring;
442 : : unsigned int i;
443 : :
444 [ # # # # ]: 0 : if (!rxq || !rxq->rx_ring)
445 : : return;
446 : :
447 : 0 : sw_ring = rxq->rx_ring->rx_buf_ring;
448 [ # # ]: 0 : if (sw_ring) {
449 [ # # ]: 0 : for (i = 0; i < rxq->rx_ring->rx_ring_struct->ring_size; i++) {
450 [ # # ]: 0 : if (sw_ring[i]) {
451 [ # # ]: 0 : if (sw_ring[i] != &rxq->fake_mbuf)
452 : : rte_pktmbuf_free_seg(sw_ring[i]);
453 : 0 : sw_ring[i] = NULL;
454 : : }
455 : : }
456 : : }
457 : : }
458 : :
459 : : static void bnxt_rep_free_rx_mbufs(struct bnxt_representor *rep_bp)
460 : : {
461 : : struct bnxt_rx_queue *rxq;
462 : : unsigned int i;
463 : :
464 [ # # # # ]: 0 : for (i = 0; i < rep_bp->rx_nr_rings; i++) {
465 : 0 : rxq = rep_bp->rx_queues[i];
466 : 0 : bnxt_vfr_rx_queue_release_mbufs(rxq);
467 : : }
468 : : }
469 : :
470 : 0 : int bnxt_rep_dev_start_op(struct rte_eth_dev *eth_dev)
471 : : {
472 : 0 : struct bnxt_representor *rep_bp = eth_dev->data->dev_private;
473 : : struct bnxt_rep_info *rep_info;
474 : : struct bnxt *parent_bp;
475 : : int rc;
476 : :
477 : 0 : parent_bp = rep_bp->parent_dev->data->dev_private;
478 : 0 : rep_info = &parent_bp->rep_info[rep_bp->vf_id];
479 : :
480 : 0 : PMD_DRV_LOG_LINE(DEBUG, "BNXT Port:%d VFR start",
481 : : eth_dev->data->port_id);
482 : 0 : pthread_mutex_lock(&rep_info->vfr_start_lock);
483 [ # # ]: 0 : if (!rep_info->conduit_valid) {
484 : 0 : rc = bnxt_get_dflt_vnic_svif(parent_bp, rep_bp);
485 [ # # # # ]: 0 : if (rc || !rep_info->conduit_valid) {
486 : 0 : pthread_mutex_unlock(&rep_info->vfr_start_lock);
487 : 0 : return rc;
488 : : }
489 : : }
490 : 0 : pthread_mutex_unlock(&rep_info->vfr_start_lock);
491 : :
492 : 0 : rc = bnxt_vfr_alloc(eth_dev);
493 [ # # ]: 0 : if (rc) {
494 : 0 : eth_dev->data->dev_link.link_status = 0;
495 : : bnxt_rep_free_rx_mbufs(rep_bp);
496 : : return rc;
497 : : }
498 : 0 : eth_dev->rx_pkt_burst = &bnxt_rep_rx_burst;
499 : 0 : eth_dev->tx_pkt_burst = &bnxt_rep_tx_burst;
500 : 0 : bnxt_rep_link_update_op(eth_dev, 1);
501 : :
502 : 0 : return 0;
503 : : }
504 : :
505 : 0 : static int bnxt_tf_vfr_flush_flows(struct bnxt_representor *vfr_bp)
506 : : {
507 : 0 : struct bnxt *parent_bp = vfr_bp->parent_dev->data->dev_private;
508 : : uint16_t func_id;
509 : :
510 : : /* it is assumed that port is either TVF or PF */
511 [ # # ]: 0 : if (unlikely(ulp_port_db_port_func_id_get(parent_bp->ulp_ctx,
512 : : vfr_bp->dpdk_port_id,
513 : : &func_id))) {
514 : 0 : BNXT_DRV_DBG(ERR, "Invalid argument\n");
515 : 0 : return -EINVAL;
516 : : }
517 : 0 : return ulp_flow_db_function_flow_flush(parent_bp->ulp_ctx, func_id);
518 : : }
519 : :
520 : 0 : static int bnxt_tf_vfr_free(struct bnxt_representor *vfr)
521 : : {
522 : : struct bnxt *parent_bp;
523 : : int32_t rc;
524 : :
525 : 0 : PMD_DRV_LOG_LINE(DEBUG, "BNXT Port:%d VFR ulp free", vfr->dpdk_port_id);
526 : 0 : rc = bnxt_tf_vfr_flush_flows(vfr);
527 [ # # ]: 0 : if (rc)
528 : 0 : PMD_DRV_LOG_LINE(ERR,
529 : : "Failed to delete rules from Port:%d VFR",
530 : : vfr->dpdk_port_id);
531 : :
532 : 0 : rc = bnxt_ulp_delete_vfr_default_rules(vfr);
533 [ # # ]: 0 : if (rc)
534 : 0 : PMD_DRV_LOG_LINE(ERR,
535 : : "Failed to delete dflt rules from Port:%d VFR",
536 : : vfr->dpdk_port_id);
537 : :
538 : : /* Need to remove the vfr fid from the session regardless */
539 : 0 : parent_bp = vfr->parent_dev->data->dev_private;
540 [ # # ]: 0 : if (!parent_bp) {
541 : 0 : PMD_DRV_LOG_LINE(DEBUG, "BNXT Port:%d VFR already freed",
542 : : vfr->dpdk_port_id);
543 : 0 : return 0;
544 : : }
545 [ # # ]: 0 : rc = bnxt_ulp_vfr_session_fid_rem(parent_bp->ulp_ctx, vfr->fw_fid);
546 [ # # ]: 0 : if (rc)
547 : 0 : PMD_DRV_LOG_LINE(ERR,
548 : : "Failed to remove BNXT Port:%d VFR from session",
549 : : vfr->dpdk_port_id);
550 : : return rc;
551 : : }
552 : :
553 : 0 : static int bnxt_vfr_free(struct bnxt_representor *vfr)
554 : : {
555 : : int rc = 0;
556 : : struct bnxt *parent_bp;
557 : :
558 [ # # # # ]: 0 : if (!vfr || !vfr->parent_dev) {
559 : 0 : PMD_DRV_LOG_LINE(ERR,
560 : : "No memory allocated for representor");
561 : 0 : return -ENOMEM;
562 : : }
563 : :
564 : : if (!bnxt_rep_check_parent(vfr)) {
565 : 0 : PMD_DRV_LOG_LINE(DEBUG, "BNXT Port:%d VFR already freed",
566 : : vfr->dpdk_port_id);
567 : 0 : return 0;
568 : : }
569 : : parent_bp = vfr->parent_dev->data->dev_private;
570 : :
571 : : /* Check if representor has been already freed in FW */
572 [ # # ]: 0 : if (!vfr->vfr_tx_cfa_action)
573 : : return 0;
574 : :
575 : 0 : rc = bnxt_tf_vfr_free(vfr);
576 [ # # ]: 0 : if (rc) {
577 : 0 : PMD_DRV_LOG_LINE(ERR,
578 : : "Failed to free representor %d in FW",
579 : : vfr->vf_id);
580 : : }
581 : :
582 : 0 : PMD_DRV_LOG_LINE(DEBUG, "freed representor %d in FW",
583 : : vfr->vf_id);
584 : 0 : vfr->vfr_tx_cfa_action = 0;
585 : :
586 [ # # ]: 0 : if (!BNXT_CHIP_P7(parent_bp))
587 : 0 : rc = bnxt_hwrm_cfa_pair_free(parent_bp, vfr);
588 : :
589 : : return rc;
590 : : }
591 : :
592 : 0 : int bnxt_rep_dev_stop_op(struct rte_eth_dev *eth_dev)
593 : : {
594 : 0 : struct bnxt_representor *vfr_bp = eth_dev->data->dev_private;
595 : :
596 : : /* Avoid crashes as we are about to free queues */
597 : 0 : bnxt_stop_rxtx(eth_dev);
598 : :
599 : 0 : PMD_DRV_LOG_LINE(DEBUG, "BNXT Port:%d VFR stop",
600 : : eth_dev->data->port_id);
601 : :
602 : 0 : bnxt_vfr_free(vfr_bp);
603 : :
604 [ # # ]: 0 : if (eth_dev->data->dev_started)
605 : 0 : eth_dev->data->dev_link.link_status = 0;
606 : :
607 : : bnxt_rep_free_rx_mbufs(vfr_bp);
608 : :
609 : 0 : return 0;
610 : : }
611 : :
612 : 0 : int bnxt_rep_dev_close_op(struct rte_eth_dev *eth_dev)
613 : : {
614 : 0 : PMD_DRV_LOG_LINE(DEBUG, "BNXT Port:%d VFR close",
615 : : eth_dev->data->port_id);
616 : 0 : bnxt_representor_uninit(eth_dev);
617 : 0 : return 0;
618 : : }
619 : :
620 : 0 : int bnxt_rep_dev_info_get_op(struct rte_eth_dev *eth_dev,
621 : : struct rte_eth_dev_info *dev_info)
622 : : {
623 : 0 : struct bnxt_representor *rep_bp = eth_dev->data->dev_private;
624 : : struct bnxt *parent_bp;
625 : : unsigned int max_rx_rings;
626 : :
627 : : /* Need be an error scenario, if parent is removed first */
628 [ # # ]: 0 : if (eth_dev->device->driver == NULL)
629 : : return -ENODEV;
630 : :
631 : : /* MAC Specifics */
632 : : if (!bnxt_rep_check_parent(rep_bp)) {
633 : 0 : PMD_DRV_LOG_LINE(INFO, "Rep parent port does not exist.");
634 : : /* Need not be an error scenario, if parent is closed first */
635 : 0 : return 0;
636 : : }
637 : :
638 : : parent_bp = rep_bp->parent_dev->data->dev_private;
639 : 0 : PMD_DRV_LOG_LINE(DEBUG, "Representor dev_info_get_op");
640 : 0 : dev_info->max_mac_addrs = parent_bp->max_l2_ctx;
641 : 0 : dev_info->max_hash_mac_addrs = 0;
642 : :
643 : 0 : max_rx_rings = parent_bp->rx_nr_rings ?
644 [ # # ]: 0 : RTE_MIN(parent_bp->rx_nr_rings, BNXT_MAX_VF_REP_RINGS) :
645 : : BNXT_MAX_VF_REP_RINGS;
646 : :
647 : : /* For the sake of symmetry, max_rx_queues = max_tx_queues */
648 : 0 : dev_info->max_rx_queues = max_rx_rings;
649 : 0 : dev_info->max_tx_queues = max_rx_rings;
650 : 0 : dev_info->reta_size = bnxt_rss_hash_tbl_size(parent_bp);
651 : 0 : dev_info->hash_key_size = 40;
652 : 0 : dev_info->dev_capa &= ~RTE_ETH_DEV_CAPA_FLOW_RULE_KEEP;
653 : :
654 : : /* MTU specifics */
655 : 0 : dev_info->min_mtu = RTE_ETHER_MIN_MTU;
656 : 0 : dev_info->max_mtu = BNXT_MAX_MTU;
657 : :
658 : : /* Fast path specifics */
659 : 0 : dev_info->min_rx_bufsize = 1;
660 : 0 : dev_info->max_rx_pktlen = BNXT_MAX_PKT_LEN;
661 : :
662 : 0 : dev_info->rx_offload_capa = bnxt_get_rx_port_offloads(parent_bp);
663 : 0 : dev_info->tx_offload_capa = bnxt_get_tx_port_offloads(parent_bp);
664 : 0 : dev_info->flow_type_rss_offloads = bnxt_eth_rss_support(parent_bp);
665 : :
666 : 0 : dev_info->switch_info.name = eth_dev->device->name;
667 : 0 : dev_info->switch_info.domain_id = rep_bp->switch_domain_id;
668 : 0 : dev_info->switch_info.port_id =
669 : 0 : rep_bp->vf_id & BNXT_SWITCH_PORT_ID_VF_MASK;
670 : :
671 : 0 : return 0;
672 : : }
673 : :
674 : 0 : int bnxt_rep_dev_configure_op(struct rte_eth_dev *eth_dev)
675 : : {
676 : 0 : struct bnxt_representor *rep_bp = eth_dev->data->dev_private;
677 : :
678 : 0 : PMD_DRV_LOG_LINE(DEBUG, "Representor dev_configure_op");
679 : 0 : rep_bp->rx_queues = (void *)eth_dev->data->rx_queues;
680 : 0 : rep_bp->tx_nr_rings = eth_dev->data->nb_tx_queues;
681 : 0 : rep_bp->rx_nr_rings = eth_dev->data->nb_rx_queues;
682 : :
683 : 0 : return 0;
684 : : }
685 : :
686 : 0 : static int bnxt_init_rep_rx_ring(struct bnxt_rx_queue *rxq,
687 : : unsigned int socket_id)
688 : : {
689 : : struct bnxt_rx_ring_info *rxr;
690 : : struct bnxt_ring *ring;
691 : :
692 : 0 : rxr = rte_zmalloc_socket("bnxt_rep_rx_ring",
693 : : sizeof(struct bnxt_rx_ring_info),
694 : : RTE_CACHE_LINE_SIZE, socket_id);
695 [ # # ]: 0 : if (rxr == NULL)
696 : : return -ENOMEM;
697 : 0 : rxq->rx_ring = rxr;
698 : :
699 : 0 : ring = rte_zmalloc_socket("bnxt_rep_rx_ring_struct",
700 : : sizeof(struct bnxt_ring),
701 : : RTE_CACHE_LINE_SIZE, socket_id);
702 [ # # ]: 0 : if (ring == NULL)
703 : : return -ENOMEM;
704 : 0 : rxr->rx_ring_struct = ring;
705 : 0 : ring->ring_size = rte_align32pow2(rxq->nb_rx_desc);
706 : 0 : ring->ring_mask = ring->ring_size - 1;
707 : :
708 : 0 : return 0;
709 : : }
710 : :
711 : 0 : int bnxt_rep_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
712 : : uint16_t queue_idx,
713 : : uint16_t nb_desc,
714 : : unsigned int socket_id,
715 : : __rte_unused const struct rte_eth_rxconf *rx_conf,
716 : : __rte_unused struct rte_mempool *mp)
717 : : {
718 : 0 : struct bnxt_representor *rep_bp = eth_dev->data->dev_private;
719 : 0 : struct bnxt *parent_bp = rep_bp->parent_dev->data->dev_private;
720 : : struct bnxt_rx_queue *parent_rxq;
721 : : struct bnxt_rx_queue *rxq;
722 : : struct rte_mbuf **buf_ring;
723 : : int rc = 0;
724 : :
725 [ # # ]: 0 : if (queue_idx >= rep_bp->rx_nr_rings) {
726 : 0 : PMD_DRV_LOG_LINE(ERR,
727 : : "Cannot create Rx ring %d. %d rings available",
728 : : queue_idx, rep_bp->rx_nr_rings);
729 : 0 : return -EINVAL;
730 : : }
731 : :
732 [ # # ]: 0 : if (!nb_desc || nb_desc > MAX_RX_DESC_CNT) {
733 : 0 : PMD_DRV_LOG_LINE(ERR, "nb_desc %d is invalid", nb_desc);
734 : 0 : return -EINVAL;
735 : : }
736 : :
737 [ # # ]: 0 : if (!parent_bp->rx_queues) {
738 : 0 : PMD_DRV_LOG_LINE(ERR, "Parent Rx qs not configured yet");
739 : 0 : return -EINVAL;
740 : : }
741 : :
742 : 0 : parent_rxq = parent_bp->rx_queues[queue_idx];
743 [ # # ]: 0 : if (!parent_rxq) {
744 : 0 : PMD_DRV_LOG_LINE(ERR, "Parent RxQ has not been configured yet");
745 : 0 : return -EINVAL;
746 : : }
747 : :
748 [ # # ]: 0 : if (nb_desc != parent_rxq->nb_rx_desc) {
749 : 0 : PMD_DRV_LOG_LINE(ERR, "nb_desc %d do not match parent rxq", nb_desc);
750 : 0 : return -EINVAL;
751 : : }
752 : :
753 [ # # ]: 0 : if (eth_dev->data->rx_queues) {
754 : 0 : rxq = eth_dev->data->rx_queues[queue_idx];
755 [ # # ]: 0 : if (rxq)
756 : 0 : bnxt_rx_queue_release_op(eth_dev, queue_idx);
757 : : }
758 : :
759 : 0 : rxq = rte_zmalloc_socket("bnxt_vfr_rx_queue",
760 : : sizeof(struct bnxt_rx_queue),
761 : : RTE_CACHE_LINE_SIZE, socket_id);
762 [ # # ]: 0 : if (!rxq) {
763 : 0 : PMD_DRV_LOG_LINE(ERR, "bnxt_vfr_rx_queue allocation failed!");
764 : 0 : return -ENOMEM;
765 : : }
766 : :
767 : 0 : eth_dev->data->rx_queues[queue_idx] = rxq;
768 : :
769 : 0 : rxq->nb_rx_desc = nb_desc;
770 : :
771 : 0 : rc = bnxt_init_rep_rx_ring(rxq, socket_id);
772 [ # # ]: 0 : if (rc)
773 : 0 : goto out;
774 : :
775 : 0 : buf_ring = rte_zmalloc_socket("bnxt_rx_vfr_buf_ring",
776 : : sizeof(struct rte_mbuf *) *
777 : 0 : rxq->rx_ring->rx_ring_struct->ring_size,
778 : : RTE_CACHE_LINE_SIZE, socket_id);
779 [ # # ]: 0 : if (!buf_ring) {
780 : 0 : PMD_DRV_LOG_LINE(ERR, "bnxt_rx_vfr_buf_ring allocation failed!");
781 : : rc = -ENOMEM;
782 : 0 : goto out;
783 : : }
784 : :
785 : 0 : rxq->rx_ring->rx_buf_ring = buf_ring;
786 : 0 : rxq->queue_id = queue_idx;
787 : 0 : rxq->port_id = eth_dev->data->port_id;
788 : :
789 : 0 : return 0;
790 : :
791 : 0 : out:
792 : : if (rxq)
793 : 0 : bnxt_rep_rx_queue_release_op(eth_dev, queue_idx);
794 : :
795 : 0 : return rc;
796 : : }
797 : :
798 : 0 : void bnxt_rep_rx_queue_release_op(struct rte_eth_dev *dev, uint16_t queue_idx)
799 : : {
800 : 0 : struct bnxt_rx_queue *rxq = dev->data->rx_queues[queue_idx];
801 : :
802 [ # # ]: 0 : if (!rxq)
803 : : return;
804 : :
805 : 0 : bnxt_rx_queue_release_mbufs(rxq);
806 : :
807 : 0 : bnxt_free_ring(rxq->rx_ring->rx_ring_struct);
808 : 0 : rte_free(rxq->rx_ring->rx_ring_struct);
809 : 0 : rte_free(rxq->rx_ring);
810 : :
811 : 0 : rte_free(rxq);
812 : : }
813 : :
814 : 0 : int bnxt_rep_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
815 : : uint16_t queue_idx,
816 : : uint16_t nb_desc,
817 : : unsigned int socket_id,
818 : : __rte_unused const struct rte_eth_txconf *tx_conf)
819 : : {
820 : 0 : struct bnxt_representor *rep_bp = eth_dev->data->dev_private;
821 : 0 : struct bnxt *parent_bp = rep_bp->parent_dev->data->dev_private;
822 : : struct bnxt_tx_queue *parent_txq, *txq;
823 : : struct bnxt_vf_rep_tx_queue *vfr_txq;
824 : :
825 [ # # ]: 0 : if (queue_idx >= rep_bp->tx_nr_rings) {
826 : 0 : PMD_DRV_LOG_LINE(ERR,
827 : : "Cannot create Tx rings %d. %d rings available",
828 : : queue_idx, rep_bp->tx_nr_rings);
829 : 0 : return -EINVAL;
830 : : }
831 : :
832 [ # # ]: 0 : if (!nb_desc || nb_desc > MAX_TX_DESC_CNT) {
833 : 0 : PMD_DRV_LOG_LINE(ERR, "nb_desc %d is invalid", nb_desc);
834 : 0 : return -EINVAL;
835 : : }
836 : :
837 [ # # ]: 0 : if (!parent_bp->tx_queues) {
838 : 0 : PMD_DRV_LOG_LINE(ERR, "Parent Tx qs not configured yet");
839 : 0 : return -EINVAL;
840 : : }
841 : :
842 : 0 : parent_txq = parent_bp->tx_queues[queue_idx];
843 [ # # ]: 0 : if (!parent_txq) {
844 : 0 : PMD_DRV_LOG_LINE(ERR, "Parent TxQ has not been configured yet");
845 : 0 : return -EINVAL;
846 : : }
847 : :
848 [ # # ]: 0 : if (nb_desc != parent_txq->nb_tx_desc) {
849 : 0 : PMD_DRV_LOG_LINE(ERR, "nb_desc %d do not match parent txq", nb_desc);
850 : 0 : return -EINVAL;
851 : : }
852 : :
853 [ # # ]: 0 : if (eth_dev->data->tx_queues) {
854 : 0 : vfr_txq = eth_dev->data->tx_queues[queue_idx];
855 [ # # ]: 0 : if (vfr_txq != NULL)
856 : 0 : bnxt_rep_tx_queue_release_op(eth_dev, queue_idx);
857 : : }
858 : :
859 : 0 : vfr_txq = rte_zmalloc_socket("bnxt_vfr_tx_queue",
860 : : sizeof(struct bnxt_vf_rep_tx_queue),
861 : : RTE_CACHE_LINE_SIZE, socket_id);
862 [ # # ]: 0 : if (!vfr_txq) {
863 : 0 : PMD_DRV_LOG_LINE(ERR, "bnxt_vfr_tx_queue allocation failed!");
864 : 0 : return -ENOMEM;
865 : : }
866 : 0 : txq = rte_zmalloc_socket("bnxt_tx_queue",
867 : : sizeof(struct bnxt_tx_queue),
868 : : RTE_CACHE_LINE_SIZE, socket_id);
869 [ # # ]: 0 : if (!txq) {
870 : 0 : PMD_DRV_LOG_LINE(ERR, "bnxt_tx_queue allocation failed!");
871 : 0 : rte_free(vfr_txq);
872 : 0 : return -ENOMEM;
873 : : }
874 : :
875 : 0 : txq->nb_tx_desc = nb_desc;
876 : 0 : txq->queue_id = queue_idx;
877 : 0 : txq->port_id = eth_dev->data->port_id;
878 : 0 : vfr_txq->txq = txq;
879 : 0 : vfr_txq->bp = rep_bp;
880 : 0 : eth_dev->data->tx_queues[queue_idx] = vfr_txq;
881 : :
882 : 0 : return 0;
883 : : }
884 : :
885 : 0 : void bnxt_rep_tx_queue_release_op(struct rte_eth_dev *dev, uint16_t queue_idx)
886 : : {
887 : 0 : struct bnxt_vf_rep_tx_queue *vfr_txq = dev->data->tx_queues[queue_idx];
888 : :
889 [ # # ]: 0 : if (!vfr_txq)
890 : : return;
891 : :
892 : 0 : rte_free(vfr_txq->txq);
893 : 0 : rte_free(vfr_txq);
894 : 0 : dev->data->tx_queues[queue_idx] = NULL;
895 : : }
896 : :
897 : 0 : int bnxt_rep_stats_get_op(struct rte_eth_dev *eth_dev,
898 : : struct rte_eth_stats *stats, struct eth_queue_stats *qstats)
899 : : {
900 : 0 : struct bnxt_representor *rep_bp = eth_dev->data->dev_private;
901 : : unsigned int i;
902 : :
903 : : memset(stats, 0, sizeof(*stats));
904 [ # # ]: 0 : for (i = 0; i < rep_bp->rx_nr_rings; i++) {
905 : 0 : stats->obytes += rep_bp->tx_bytes[i];
906 : 0 : stats->opackets += rep_bp->tx_pkts[i];
907 : 0 : stats->ibytes += rep_bp->rx_bytes[i];
908 : 0 : stats->ipackets += rep_bp->rx_pkts[i];
909 : 0 : stats->imissed += rep_bp->rx_drop_pkts[i];
910 : :
911 [ # # ]: 0 : if (qstats) {
912 : 0 : qstats->q_ipackets[i] = rep_bp->rx_pkts[i];
913 : 0 : qstats->q_ibytes[i] = rep_bp->rx_bytes[i];
914 : 0 : qstats->q_opackets[i] = rep_bp->tx_pkts[i];
915 : 0 : qstats->q_obytes[i] = rep_bp->tx_bytes[i];
916 : 0 : qstats->q_errors[i] = rep_bp->rx_drop_pkts[i];
917 : : }
918 : : }
919 : :
920 : 0 : return 0;
921 : : }
922 : :
923 : 0 : int bnxt_rep_stats_reset_op(struct rte_eth_dev *eth_dev)
924 : : {
925 : 0 : struct bnxt_representor *rep_bp = eth_dev->data->dev_private;
926 : : unsigned int i;
927 : :
928 [ # # ]: 0 : for (i = 0; i < rep_bp->rx_nr_rings; i++) {
929 : 0 : rep_bp->tx_pkts[i] = 0;
930 : 0 : rep_bp->tx_bytes[i] = 0;
931 : 0 : rep_bp->rx_pkts[i] = 0;
932 : 0 : rep_bp->rx_bytes[i] = 0;
933 : 0 : rep_bp->rx_drop_pkts[i] = 0;
934 : : }
935 : 0 : return 0;
936 : : }
937 : :
938 : 0 : int bnxt_rep_stop_all(struct bnxt *bp)
939 : : {
940 : : uint16_t vf_id;
941 : : struct rte_eth_dev *rep_eth_dev;
942 : : int ret;
943 : :
944 : : /* No vfrep ports just exit */
945 [ # # ]: 0 : if (!bp->rep_info)
946 : : return 0;
947 : :
948 [ # # # # : 0 : for (vf_id = 0; vf_id < BNXT_MAX_VF_REPS(bp); vf_id++) {
# # ]
949 : 0 : rep_eth_dev = bp->rep_info[vf_id].vfr_eth_dev;
950 [ # # ]: 0 : if (!rep_eth_dev)
951 : 0 : continue;
952 : 0 : ret = bnxt_rep_dev_stop_op(rep_eth_dev);
953 [ # # ]: 0 : if (ret != 0)
954 : 0 : return ret;
955 : : }
956 : :
957 : : return 0;
958 : : }
|