Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/sys



Module Name:    src
Committed By:   msaitoh
Date:           Fri May 17 07:37:12 UTC 2019

Modified Files:
        src/sys/compat/common: Makefile.sysio compat_80_mod.c compat_mod.h
            files.common if_43.c
        src/sys/compat/netbsd32: netbsd32_ioctl.c netbsd32_ioctl.h
        src/sys/compat/sys: sockio.h
        src/sys/kern: compat_stub.c
        src/sys/net: if.c if_media.c if_media.h
        src/sys/sys: compat_stub.h sockio.h
Added Files:
        src/sys/compat/common: if_media_80.c

Log Message:
 The max subtype of the ifmedia word is 31. It's too small for Ethernet now.
We currently use use it up to 30. We should extend the limit to be able to use
more than 10Gbps speeds. Our ifmedia(4) is inconvenience and have some problem
so we should redesign the interface, but it's too late for netbsd-9 to do it.
So, we keep the data structure size and modify the structure a bit. The
strategy is almost the same as FreeBSD. Many bits of IFM_OMASK for Ethernet
have not used, so use some of them for Ethernet's subtype.

The differences against FreeBSD are:
 - We use NetBSD style compat code (i.e. no SIOCGIFXMEDIA).
 - FreeBSD's IFM_ETH_XTYPE's bit location is from 11 to "14" even though
   IFM_OMASK is from 8 to "15". We use _IFM_ETH_XTMASK 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.

New layout of the media word is as follows (from ifmedia_h):

 * if_media Options word:
 *      Bits    Use
 *      ----    -------
 *      0-4     Media subtype   MAX SUBTYPE == 255 for ETH and 31 for others
 *      5-7     Media type
 *      8-15    Type specific options
 *      16-18   Mode (for multi-mode devices)
 *      19      (Reserved for Future Use)
 *      20-27   Shared (global) options
 *      28-31   Instance
 *
 *   3                     2                   1
 *   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
 *  +-------+---------------+-+-----+---------------+-----+---------+
 *  |       |               |R|     |               |     |         |
 *  | IMASK |     GMASK     |F|MMASK+-----+ OMASK   |NMASK|  TMASK  |
 *  |       |               |U|     |XTMSK|         |     |         |
 *  +-------+---------------+-+-----+-----+---------+-----+---------+
 *   <----->                   <--->                 <--->
 *  IFM_INST()               IFM_MODE()            IFM_TYPE()
 *
 *                              IFM_SUBTYPE(other than ETH)<------->
 *
 *                                   <---> IFM_SUBTYPE(ETH)<------->
 *
 *
 *           <------------->         <------------->
 *                        IFM_OPTIONS()


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/compat/common/Makefile.sysio
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/common/compat_80_mod.c \
    src/sys/compat/common/files.common
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/common/compat_mod.h
cvs rdiff -u -r1.21 -r1.22 src/sys/compat/common/if_43.c
cvs rdiff -u -r0 -r1.1 src/sys/compat/common/if_media_80.c
cvs rdiff -u -r1.102 -r1.103 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.66 -r1.67 src/sys/compat/netbsd32/netbsd32_ioctl.h
cvs rdiff -u -r1.18 -r1.19 src/sys/compat/sys/sockio.h
cvs rdiff -u -r1.11 -r1.12 src/sys/kern/compat_stub.c
cvs rdiff -u -r1.453 -r1.454 src/sys/net/if.c
cvs rdiff -u -r1.44 -r1.45 src/sys/net/if_media.c
cvs rdiff -u -r1.64 -r1.65 src/sys/net/if_media.h
cvs rdiff -u -r1.15 -r1.16 src/sys/sys/compat_stub.h
cvs rdiff -u -r1.36 -r1.37 src/sys/sys/sockio.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index