[RFC] how to get real ifi_baudrate from network interface
hello,
for sometime now i've been repeatedly annoyed by the fact that 10G
interfaces lie about their ifi_baudrate. i would like to propose
simple (hopefuly) change to address this.
quick summary of the problem:
struct if_data {
....
u_char ifi_spare_char1; /* spare byte */
u_char ifi_spare_char2; /* spare byte */
....
u_long ifi_baudrate; /* linespeed */
....
};
as you can see ifi_baudrate is an u_long which is an arch specific
type. on 32-bit arch it does not have enough bits to hold 10G line
speed value (in bits per second)
proposal
we reuse one of the ifi_spare_char1 or ifi_spare_char2 bytes and
re-purpose it as power factor to be applied to ifi_baudrate, i.e.
real_ifi_baudrate = ifi_baudrate * 10 ** ifi_spare_char1
obviously, 10G nic drivers will have to set ifi_spare_char1 to
appropriate value, but it should not be a big deal. also, legacy tools
that do not know about ifi_spare_char1 would continue to report
"wrong" ifi_baudrate as they used to.
any objections?
thanks,
max
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
討論串 (同標題文章)
完整討論串 (本文為第 1 之 4 篇):