X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Focteontx2%2Fotx2_link.c;h=81dd6243b977192ffee57538781e8a0b43942bf1;hb=90bbd7d9545f88ac11f8b89449ad7fd799adbfba;hp=439ec4fa8924e09e2d8c441991289d58319ad0ad;hpb=5723fbed4f969bb69b32927a138b272fb002fba1;p=dpdk.git diff --git a/drivers/net/octeontx2/otx2_link.c b/drivers/net/octeontx2/otx2_link.c index 439ec4fa89..81dd6243b9 100644 --- a/drivers/net/octeontx2/otx2_link.c +++ b/drivers/net/octeontx2/otx2_link.c @@ -3,7 +3,7 @@ */ #include -#include +#include #include "otx2_ethdev.h" @@ -47,6 +47,29 @@ nix_link_status_print(struct rte_eth_dev *eth_dev, struct rte_eth_link *link) otx2_info("Port %d: Link Down", (int)(eth_dev->data->port_id)); } +void +otx2_eth_dev_link_status_get(struct otx2_dev *dev, + struct cgx_link_user_info *link) +{ + struct otx2_eth_dev *otx2_dev = (struct otx2_eth_dev *)dev; + struct rte_eth_link eth_link; + struct rte_eth_dev *eth_dev; + + if (!link || !dev) + return; + + eth_dev = otx2_dev->eth_dev; + if (!eth_dev) + return; + + rte_eth_linkstatus_get(eth_dev, ð_link); + + link->link_up = eth_link.link_status; + link->speed = eth_link.link_speed; + link->an = eth_link.link_autoneg; + link->full_duplex = eth_link.link_duplex; +} + void otx2_eth_dev_link_status_update(struct otx2_dev *dev, struct cgx_link_user_info *link) @@ -125,7 +148,7 @@ otx2_nix_link_update(struct rte_eth_dev *eth_dev, int wait_to_complete) RTE_SET_USED(wait_to_complete); memset(&link, 0, sizeof(struct rte_eth_link)); - if (otx2_dev_is_sdp(dev)) + if (!eth_dev->data->dev_started || otx2_dev_is_sdp(dev)) return 0; if (otx2_dev_is_lbk(dev))