* DPDK callback to bring the link up. * * @param dev * Pointer to Ethernet device structure. * * @return * 0 on success, negative error value otherwise. */
| 612 | * 0 on success, negative error value otherwise. |
| 613 | */ |
| 614 | static int |
| 615 | mrvl_dev_set_link_up(struct rte_eth_dev *dev) |
| 616 | { |
| 617 | struct mrvl_priv *priv = dev->data->dev_private; |
| 618 | int ret; |
| 619 | |
| 620 | if (!priv->ppio) { |
| 621 | dev->data->dev_link.link_status = RTE_ETH_LINK_UP; |
| 622 | return 0; |
| 623 | } |
| 624 | |
| 625 | ret = pp2_ppio_enable(priv->ppio); |
| 626 | if (ret) |
| 627 | return ret; |
| 628 | |
| 629 | /* |
| 630 | * mtu/mru can be updated if pp2_ppio_enable() was called at least once |
| 631 | * as pp2_ppio_enable() changes port->t_mode from default 0 to |
| 632 | * PP2_TRAFFIC_INGRESS_EGRESS. |
| 633 | * |
| 634 | * Set mtu to default DPDK value here. |
| 635 | */ |
| 636 | ret = mrvl_mtu_set(dev, dev->data->mtu); |
| 637 | if (ret) { |
| 638 | pp2_ppio_disable(priv->ppio); |
| 639 | return ret; |
| 640 | } |
| 641 | |
| 642 | dev->data->dev_link.link_status = RTE_ETH_LINK_UP; |
| 643 | return 0; |
| 644 | } |
| 645 | |
| 646 | /** |
| 647 | * DPDK callback to bring the link down. |
no test coverage detected