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

Function rte_eth_link_get

dpdk/lib/ethdev/rte_ethdev.c:2984–3010  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2982}
2983
2984int
2985rte_eth_link_get(uint16_t port_id, struct rte_eth_link *eth_link)
2986{
2987 struct rte_eth_dev *dev;
2988
2989 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
2990 dev = &rte_eth_devices[port_id];
2991
2992 if (eth_link == NULL) {
2993 RTE_ETHDEV_LOG(ERR, "Cannot get ethdev port %u link to NULL\n",
2994 port_id);
2995 return -EINVAL;
2996 }
2997
2998 if (dev->data->dev_conf.intr_conf.lsc && dev->data->dev_started)
2999 rte_eth_linkstatus_get(dev, eth_link);
3000 else {
3001 if (*dev->dev_ops->link_update == NULL)
3002 return -ENOTSUP;
3003 (*dev->dev_ops->link_update)(dev, 1);
3004 *eth_link = dev->data->dev_link;
3005 }
3006
3007 rte_eth_trace_link_get(port_id, eth_link);
3008
3009 return 0;
3010}
3011
3012int
3013rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *eth_link)

Callers 15

rte_pcapng_add_interfaceFunction · 0.85
eth_memif_rxFunction · 0.85
eth_memif_rx_zcFunction · 0.85
eth_memif_txFunction · 0.85
eth_memif_tx_zcFunction · 0.85
test_stop_bonding_deviceFunction · 0.85
show_portFunction · 0.85
ethdev_showFunction · 0.85
start_pkt_fwdFunction · 0.85
rte_ethtool_get_linkFunction · 0.85

Calls 1

rte_eth_linkstatus_getFunction · 0.85

Tested by 3

test_stop_bonding_deviceFunction · 0.68