- 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);
+ 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);