summaryrefslogtreecommitdiffstats
path: root/src/usr/ifmgmt.c
diff options
context:
space:
mode:
authorMichael Brown2007-07-03 01:15:53 +0200
committerMichael Brown2007-07-03 01:15:53 +0200
commit4968caab8288664d4fd21417f312f3c5a05df155 (patch)
tree6c5ecf09777ba61dc056e9253df17ea309885a7d /src/usr/ifmgmt.c
parentEnsure that pxe_netdev is set before starting up PXE NBP. (diff)
downloadipxe-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.c5
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 );
}