diff --git a/econet/ecnt_prvt.c b/econet/ecnt_prvt.c index 12c537f6d88b57f37a1ed1d2dbd4042276e05ea9..a37fb493c0c8c7471831394b40e5dc141ec5f73e 100644 --- a/econet/ecnt_prvt.c +++ b/econet/ecnt_prvt.c @@ -212,6 +212,7 @@ int hsgmii_lan_prvt_get_port_statistics(char *ifname, struct eth_stats *stats, s if (!strncmp(driver_name, DRIVER_NAME, DRIVER_NAME_LEN)) { int i = 0, hsgmii_index = -1; const char *hsgmii_iftype; + char cmdbuf[512] = {0}; for (; i < ARRAY_SIZE(hsgmii_lookup_tbl); i++) { int j = 0; @@ -235,6 +236,11 @@ int hsgmii_lan_prvt_get_port_statistics(char *ifname, struct eth_stats *stats, s memset(&tx_stats, 0, sizeof(ECNT_FEMGR_GDMA2_TX_STATISTICS)); memset(&rx_stats, 0, sizeof(ECNT_FEMGR_GDMA2_RX_STATISTICS)); + /* Handle unbound interface statistics */ + chrCmd(cmdbuf, sizeof(cmdbuf), "cat /proc/tc3162/%s_rebind | awk '{ print $3 }'", ifname); + if (cmdbuf[0] != '\0' && strtoul(cmdbuf, NULL, 0) == 1) + return 0; + if (!fe_lib_get_hsgmii_tx_statistics(&tx_stats, hsgmii_index)) { fill_stats_tx_from_gdma(stats, rstats, &tx_stats); }