| 547 | } |
| 548 | |
| 549 | static int |
| 550 | octeontx_dev_close(struct rte_eth_dev *dev) |
| 551 | { |
| 552 | struct octeontx_txq *txq = NULL; |
| 553 | struct octeontx_nic *nic = octeontx_pmd_priv(dev); |
| 554 | unsigned int i; |
| 555 | int ret; |
| 556 | |
| 557 | PMD_INIT_FUNC_TRACE(); |
| 558 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) |
| 559 | return 0; |
| 560 | |
| 561 | /* Stopping/closing event device once all eth ports are closed. */ |
| 562 | if (__atomic_fetch_sub(&evdev_refcnt, 1, __ATOMIC_ACQUIRE) - 1 == 0) { |
| 563 | rte_event_dev_stop(nic->evdev); |
| 564 | rte_event_dev_close(nic->evdev); |
| 565 | } |
| 566 | |
| 567 | octeontx_dev_flow_ctrl_fini(dev); |
| 568 | |
| 569 | octeontx_dev_vlan_offload_fini(dev); |
| 570 | |
| 571 | ret = octeontx_pko_channel_close(nic->base_ochan); |
| 572 | if (ret < 0) { |
| 573 | octeontx_log_err("failed to close channel %d VF%d %d %d", |
| 574 | nic->base_ochan, nic->port_id, nic->num_tx_queues, |
| 575 | ret); |
| 576 | } |
| 577 | /* Free txq resources for this port */ |
| 578 | for (i = 0; i < nic->num_tx_queues; i++) { |
| 579 | txq = dev->data->tx_queues[i]; |
| 580 | if (!txq) |
| 581 | continue; |
| 582 | |
| 583 | rte_free(txq); |
| 584 | } |
| 585 | |
| 586 | octeontx_port_close(nic); |
| 587 | nic->reconfigure = false; |
| 588 | |
| 589 | return 0; |
| 590 | } |
| 591 | |
| 592 | static int |
| 593 | octeontx_dev_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu) |
no test coverage detected