diff options
author | glebius <glebius@FreeBSD.org> | 2014-03-13 03:42:24 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2014-03-13 03:42:24 +0000 |
commit | b38edcd355dfe9c2ac4080b8837687b0dba7dd41 (patch) | |
tree | 23c54b335bf31cd906e8cf3bad37e838d9a80c2d /sys/compat | |
parent | 2720ac2544ae02bf5f480a96cc1f9ba096803879 (diff) | |
download | FreeBSD-src-b38edcd355dfe9c2ac4080b8837687b0dba7dd41.zip FreeBSD-src-b38edcd355dfe9c2ac4080b8837687b0dba7dd41.tar.gz |
Since 32-bit if_baudrate isn't enough to describe a baud rate of a 10 Gbit
interface, in the r241616 a crutch was provided. It didn't work well, and
finally we decided that it is time to break ABI and simply make if_baudrate
a 64-bit value. Meanwhile, the entire struct if_data was reviewed.
o Remove the if_baudrate_pf crutch.
o Make all fields of struct if_data fixed machine independent size. The
notion of data (packet counters, etc) are by no means MD. And it is a
bug that on amd64 we've got a 64-bit counters, while on i386 32-bit,
which at modern speeds overflow within a second.
This also removes quite a lot of COMPAT_FREEBSD32 code.
o Give 16 bit for the ifi_datalen field. This field was provided to
make future changes to if_data less ABI breaking. Unfortunately the
8 bit size of it had effectively limited sizeof if_data to 256 bytes.
o Give 32 bits to ifi_mtu and ifi_metric.
o Give 64 bits to the rest of fields, since they are counters.
__FreeBSD_version bumped.
Discussed with: emax
Sponsored by: Netflix
Sponsored by: Nginx, Inc.
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linprocfs/linprocfs.c | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index 04281b0..cb0f3b9 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -1131,31 +1131,32 @@ linprocfs_donetdev(PFS_FILL_ARGS) TAILQ_FOREACH(ifp, &V_ifnet, if_link) { linux_ifname(ifp, ifname, sizeof ifname); sbuf_printf(sb, "%6.6s: ", ifname); - sbuf_printf(sb, "%7lu %7lu %4lu %4lu %4lu %5lu %10lu %9lu ", - ifp->if_ibytes, /* rx_bytes */ - ifp->if_ipackets, /* rx_packets */ - ifp->if_ierrors, /* rx_errors */ - ifp->if_iqdrops, /* rx_dropped + - * rx_missed_errors */ - 0UL, /* rx_fifo_errors */ - 0UL, /* rx_length_errors + - * rx_over_errors + - * rx_crc_errors + - * rx_frame_errors */ - 0UL, /* rx_compressed */ - ifp->if_imcasts); /* multicast, XXX-BZ rx only? */ - sbuf_printf(sb, "%8lu %7lu %4lu %4lu %4lu %5lu %7lu %10lu\n", - ifp->if_obytes, /* tx_bytes */ - ifp->if_opackets, /* tx_packets */ - ifp->if_oerrors, /* tx_errors */ - 0UL, /* tx_dropped */ - 0UL, /* tx_fifo_errors */ - ifp->if_collisions, /* collisions */ - 0UL, /* tx_carrier_errors + - * tx_aborted_errors + - * tx_window_errors + - * tx_heartbeat_errors */ - 0UL); /* tx_compressed */ + sbuf_printf(sb, "%7ju %7ju %4ju %4ju %4lu %5lu %10lu %9ju ", + (uintmax_t )ifp->if_ibytes, /* rx_bytes */ + (uintmax_t )ifp->if_ipackets, /* rx_packets */ + (uintmax_t )ifp->if_ierrors, /* rx_errors */ + (uintmax_t )ifp->if_iqdrops, /* rx_dropped + + * rx_missed_errors */ + 0UL, /* rx_fifo_errors */ + 0UL, /* rx_length_errors + + * rx_over_errors + + * rx_crc_errors + + * rx_frame_errors */ + 0UL, /* rx_compressed */ + (uintmax_t )ifp->if_imcasts); /* multicast, + * XXX-BZ rx only? */ + sbuf_printf(sb, "%8ju %7ju %4ju %4lu %4lu %5ju %7lu %10lu\n", + (uintmax_t )ifp->if_obytes, /* tx_bytes */ + (uintmax_t )ifp->if_opackets, /* tx_packets */ + (uintmax_t )ifp->if_oerrors, /* tx_errors */ + 0UL, /* tx_dropped */ + 0UL, /* tx_fifo_errors */ + (uintmax_t )ifp->if_collisions, /* collisions */ + 0UL, /* tx_carrier_errors + + * tx_aborted_errors + + * tx_window_errors + + * tx_heartbeat_errors*/ + 0UL); /* tx_compressed */ } IFNET_RUNLOCK(); CURVNET_RESTORE(); |