diff options
author | Michael Brown | 2007-07-03 01:15:53 +0200 |
---|---|---|
committer | Michael Brown | 2007-07-03 01:15:53 +0200 |
commit | 4968caab8288664d4fd21417f312f3c5a05df155 (patch) | |
tree | 6c5ecf09777ba61dc056e9253df17ea309885a7d /src/usr/ifmgmt.c | |
parent | Ensure that pxe_netdev is set before starting up PXE NBP. (diff) | |
download | ipxe-4968caab8288664d4fd21417f312f3c5a05df155.tar.gz ipxe-4968caab8288664d4fd21417f312f3c5a05df155.tar.xz ipxe-4968caab8288664d4fd21417f312f3c5a05df155.zip |
Add trivial net device statistics (TX and RX packet count), reported
via UNDI API and also by ifstat command; may be useful for debugging.
Diffstat (limited to 'src/usr/ifmgmt.c')
-rw-r--r-- | src/usr/ifmgmt.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/usr/ifmgmt.c b/src/usr/ifmgmt.c index ff5b34a6..a43c4ca0 100644 --- a/src/usr/ifmgmt.c +++ b/src/usr/ifmgmt.c @@ -61,7 +61,8 @@ void ifclose ( struct net_device *netdev ) { * @v netdev Network device */ void ifstat ( struct net_device *netdev ) { - printf ( "%s: %s on %s (%s)\n", + printf ( "%s: %s on %s (%s) TX:%d RX:%d\n", netdev->name, netdev_hwaddr ( netdev ), netdev->dev->name, - ( ( netdev->state & NETDEV_OPEN ) ? "open" : "closed" ) ); + ( ( netdev->state & NETDEV_OPEN ) ? "open" : "closed" ), + netdev->stats.tx_count, netdev->stats.rx_count ); } |