CVSROOT:        /cvs
Module name:    src
Changes by:     m...@cvs.openbsd.org    2025/01/21 10:40:57

Modified files:
        sys/net        : if.c if_var.h 

Log message:
Copy if_data stuff to ifnet descriptor.

'if_data' structure contains interface data like type or baudrate mixed
with statistics counters. Each interface descriptor 'ifnet' contains the
instance of 'if_data' for deliver to the userland by request. It is not
clean which lock protects this data. Some old drivers rely on kernel
lock, some rely on net lock, ifioctl() relies on both. Moreover, network
interface could have per-cpu counters, but in such case both `if_data'
counters and per-cpu counters will be used by some pseudo drivers like
bridge(4).

Copy 'if_data' stuff into 'ifnet' descriptor to separate interface
counters from the rest data. This separation allows to start using of
consistent locking for such data.

Note, non per-cpu counters represented as array and accessed in the
per-cpu counters style to unify future usage paths.

ok bluhm

Reply via email to