tech-net archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
ifmedia change (was Re: change ifmedia word from int to uint64_t)
(I changed the Subject)
Hi, all.
I'm working to overhaul ifmedia(4) and the lower layer. Changing the
ifmedia word from int to uint64_t was one of them. If I commit it to
current and then netbsd-9 is branched, Other changes will be added
to -current in future. It will make the ABI change twice. It makes
the compat code in if.c and ifmedia.c very complex and also makes
some 3rd party programs complex.
So, I gave up to change the ifmedia word from int to uint64_t. Instead
of it, I'd like to change the ifmedia word not changing the size but
changing the usage usage only on IFM_ETHER.
Diff:
http://www.netbsd.org/~msaitoh/ifmedia-20190513-0.dif
The strategy is almost the same as FreeBSD. Many bits of IFM_OMASK
for Ethernet have not used, some of them are used. The differences against
FreeBSD are:
- We use NetBSD style compat code. Don't use SIOCGIFXMEDIA.
The old ioctls are prefixed with 'O'.
- New IFM_ETH_XTYPE's bit location in FreeBSD is little strange.
We use from bit 13 to 15.
- FreeBSD changed the meaning of IFM_TYPE_MATCH(). I think we should
not do it. We keep it not changing and added new IFM_TYPE_SUBTYPE_MATCH()
macro for matching both TYPE and SUBTYPE.
- Added up to 400GBASE-SR16.
The above diff includes a test patch in if_tap.c. I tested the
following environment on the new kernel:
- New amd64 dynamic link ifconfig(8)
- netbsd-8 amd64 dynamic link ifconfig(8)
- netbsd-7 i386 static link ifconfig(8)
- netbsd-4 amd64 dynamic link ifconfig(8) (for COMPAT_43 testing)
I think this change isn't harmful, so I'll commit the change in
this weekend if no one objects. Feedback are welcomed.
Thanks in advance.
--
-----------------------------------------------
SAITOH Masanobu (msaitoh%execsw.org@localhost
msaitoh%netbsd.org@localhost)
Home |
Main Index |
Thread Index |
Old Index