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

Function ngbe_dev_link_status_print

dpdk/drivers/net/ngbe/ngbe_ethdev.c:2213–2236  ·  view source on GitHub ↗

* It gets and then prints the link status. * * @param dev * Pointer to struct rte_eth_dev. * * @return * - On success, zero. * - On failure, a negative value. */

Source from the content-addressed store, hash-verified

2211 * - On failure, a negative value.
2212 */
2213static void
2214ngbe_dev_link_status_print(struct rte_eth_dev *dev)
2215{
2216 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
2217 struct rte_eth_link link;
2218
2219 rte_eth_linkstatus_get(dev, &link);
2220
2221 if (link.link_status == RTE_ETH_LINK_UP) {
2222 PMD_INIT_LOG(INFO, "Port %d: Link Up - speed %u Mbps - %s",
2223 (int)(dev->data->port_id),
2224 (unsigned int)link.link_speed,
2225 link.link_duplex == RTE_ETH_LINK_FULL_DUPLEX ?
2226 "full-duplex" : "half-duplex");
2227 } else {
2228 PMD_INIT_LOG(INFO, " Port %d: Link Down",
2229 (int)(dev->data->port_id));
2230 }
2231 PMD_INIT_LOG(DEBUG, "PCI Address: " PCI_PRI_FMT,
2232 pci_dev->addr.domain,
2233 pci_dev->addr.bus,
2234 pci_dev->addr.devid,
2235 pci_dev->addr.function);
2236}
2237
2238/*
2239 * It executes link_update after knowing an interrupt occurred.

Callers 2

Calls 1

rte_eth_linkstatus_getFunction · 0.85

Tested by

no test coverage detected