[RFC] how to get real ifi_baudrate from network interface

看板FB_current作者時間13年前 (2012/09/20 05:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/4 (看更多)
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"
文章代碼(AID): #1GMZdJnt (FB_current)
文章代碼(AID): #1GMZdJnt (FB_current)