K 10 svn:author V 7 glebius K 8 svn:date V 27 2015-01-16T11:45:54.030354Z K 7 svn:log V 1492 Make API around if_mtu, if_capabilities, if_capenable and if_hwassist more strict. Disallow direct access to these fields at all. o if_mtu - Stack guarantees that any MTU change attempt is reported via SIOCSIFMTU, so drivers can store it in softc and don't need go to ifnet layer. - Stack does the equal MTU check, drivers don't need to copy & paste it. - If driver doesn't report error, then stack updates MTU. o if_capabilities - Drivers should init them in ifat_capabilities at if_attach(), and are not allowed to modify later. Stack neither. o if_capenable - Stack guarantees that any capenable change is reported via SIOCSIFCAP. Stack supplies current capabilities (in case if driver doesn't store them) in ifr_curcap, and requested capabilities in ifr_reqcap. - Stack does the equal check, as well as that requested capenable are subset of interface capabilities. Drivers don't need to cut-n-paste that. - Stack enforces IFCAP_VLAN_HWTAGGING in case of IFCAP_VLAN_HWTSO. - Drivers may alter ifr_reqcap, as in some edge cases they could be actually not capable of running capabilities announced at if_attach. - Drivers must either return error or, return 0 and in the latter case must initialize ifr_hwassist value in the ifreq. o There are some edge cases when a driver may want to change its capenable as result of MTU change. Or vice versa? In this case, the driver should call if_drvioctl() upon itself. Sponsored by: Nginx, Inc. END