| 675 | } |
| 676 | |
| 677 | int |
| 678 | dpaa2_dev_recycle_deconfig(struct rte_eth_dev *eth_dev) |
| 679 | { |
| 680 | struct rte_device *dev = eth_dev->device; |
| 681 | struct dpaa2_dev_priv *priv = eth_dev->data->dev_private; |
| 682 | struct rte_dpaa2_device *dpaa2_dev = |
| 683 | container_of(dev, struct rte_dpaa2_device, device); |
| 684 | struct fsl_mc_io *dpni_dev = eth_dev->process_private; |
| 685 | struct dpni_port_cfg port_cfg; |
| 686 | int ret = 0; |
| 687 | |
| 688 | if (!(priv->flags & DPAA2_TX_LOOPBACK_MODE)) |
| 689 | return 0; |
| 690 | |
| 691 | if (priv->flags & DPAA2_TX_SERDES_LOOPBACK_MODE) { |
| 692 | if (dpaa2_svr_family == SVR_LS2088A) { |
| 693 | ret = ls_serdes_eth_lpbk(dpaa2_dev->ep_object_id, 0); |
| 694 | if (ret) { |
| 695 | DPAA2_PMD_WARN("Error(%d) to disable Serdes loopback", |
| 696 | ret); |
| 697 | } else { |
| 698 | priv->flags &= ~DPAA2_TX_SERDES_LOOPBACK_MODE; |
| 699 | } |
| 700 | } else if (dpaa2_svr_family == SVR_LX2160A) { |
| 701 | ret = lx_serdes_eth_lpbk(dpaa2_dev->ep_object_id, 0); |
| 702 | if (ret) { |
| 703 | DPAA2_PMD_WARN("Error(%d) to disable Serdes loopback", |
| 704 | ret); |
| 705 | } else { |
| 706 | priv->flags &= ~DPAA2_TX_SERDES_LOOPBACK_MODE; |
| 707 | } |
| 708 | } else { |
| 709 | DPAA2_PMD_DEBUG("Serdes loopback not support SoC(0x%08x)", |
| 710 | dpaa2_svr_family); |
| 711 | } |
| 712 | } |
| 713 | |
| 714 | if (priv->flags & DPAA2_TX_MAC_LOOPBACK_MODE) { |
| 715 | port_cfg.loopback_en = 0; |
| 716 | ret = dpni_set_port_cfg(dpni_dev, CMD_PRI_LOW, |
| 717 | priv->token, |
| 718 | DPNI_PORT_CFG_LOOPBACK, |
| 719 | &port_cfg); |
| 720 | if (ret) { |
| 721 | DPAA2_PMD_ERR("Error(%d) to disable TX mac loopback", |
| 722 | ret); |
| 723 | } else { |
| 724 | priv->flags &= ~DPAA2_TX_MAC_LOOPBACK_MODE; |
| 725 | } |
| 726 | } |
| 727 | |
| 728 | if (priv->flags & DPAA2_TX_DPNI_LOOPBACK_MODE) |
| 729 | priv->flags &= ~DPAA2_TX_DPNI_LOOPBACK_MODE; |
| 730 | |
| 731 | return ret; |
| 732 | } |
| 733 | |
| 734 | int |
no test coverage detected