MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mrvl_dev_set_link_up

Function mrvl_dev_set_link_up

dpdk/drivers/net/mvpp2/mrvl_ethdev.c:614–644  ·  view source on GitHub ↗

* DPDK callback to bring the link up. * * @param dev * Pointer to Ethernet device structure. * * @return * 0 on success, negative error value otherwise. */

Source from the content-addressed store, hash-verified

612 * 0 on success, negative error value otherwise.
613 */
614static int
615mrvl_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.

Callers 1

mrvl_dev_startFunction · 0.85

Calls 1

mrvl_mtu_setFunction · 0.85

Tested by

no test coverage detected