CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected]    2025/12/08 20:33:06

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

Log message:
add if_get_smr()

if_get_smr() is like if_get() in that you give it an interface index
and it gives you an ifnet pointer (or NULL), except it doesnt bump
the reference count on the interface. to compensate, you can only
use it inside an SMR critical section.

the good news is that the ifidxmap map and ifnet lookups are already
done using SMR, so this is an extremely trivial change.

the benefit of this is that you can avoid the atomic operations on
a shared variable (the ifnet refcnt) when using an interface in an
smr critical section.

Reply via email to