+
+ if (print_statistics) {
+ struct netdev_stats s;
+ int error;
+
+ error = netdev_open(dpif_port.name, dpif_port.type, &netdev);
+ if (error) {
+ printf(", open failed (%s)", strerror(error));
+ continue;
+ }
+ error = netdev_get_stats(netdev, &s);
+ if (error) {
+ printf(", could not retrieve stats (%s)", strerror(error));
+ continue;
+ }
+
+ netdev_close(netdev);
+ print_stat("\t\tRX packets:", s.rx_packets);
+ print_stat(" errors:", s.rx_errors);
+ print_stat(" dropped:", s.rx_dropped);
+ print_stat(" overruns:", s.rx_over_errors);
+ print_stat(" frame:", s.rx_frame_errors);
+ printf("\n");
+
+ print_stat("\t\tTX packets:", s.tx_packets);
+ print_stat(" errors:", s.tx_errors);
+ print_stat(" dropped:", s.tx_dropped);
+ print_stat(" aborted:", s.tx_aborted_errors);
+ print_stat(" carrier:", s.tx_carrier_errors);
+ printf("\n");
+
+ print_stat("\t\tcollisions:", s.collisions);
+ printf("\n");
+
+ print_stat("\t\tRX bytes:", s.rx_bytes);
+ print_human_size(s.rx_bytes);
+ print_stat(" TX bytes:", s.tx_bytes);
+ print_human_size(s.tx_bytes);
+ printf("\n");
+ }