On Wed, Nov 11, 2020 at 05:25:25AM -0300, Martin Pieuchot wrote: > While discussing the new source address mechanism with denis@, I figured > those ought to be documented. > > Note that `ar_rtableid' is unused and can die. The ART code is actually > free from any network knowledge. > > ok? >
it seems sound. OK denis@ > Index: net/art.c > =================================================================== > RCS file: /cvs/src/sys/net/art.c,v > retrieving revision 1.28 > diff -u -p -r1.28 art.c > --- net/art.c 31 Mar 2019 19:29:27 -0000 1.28 > +++ net/art.c 9 Nov 2020 19:52:48 -0000 > @@ -115,7 +115,6 @@ art_alloc(unsigned int rtableid, unsigne > } > > ar->ar_off = off; > - ar->ar_rtableid = rtableid; > rw_init(&ar->ar_lock, "art"); > > return (ar); > Index: net/art.h > =================================================================== > RCS file: /cvs/src/sys/net/art.h,v > retrieving revision 1.19 > diff -u -p -r1.19 art.h > --- net/art.h 29 Oct 2020 21:15:27 -0000 1.19 > +++ net/art.h 9 Nov 2020 19:52:42 -0000 > @@ -27,16 +27,22 @@ > > /* > * Root of the ART tables, equivalent to the radix head. > + * > + * Locks used to protect struct members in this file: > + * I immutable after creation > + * l root's `ar_lock' > + * K kernel lock > + * For SRP related structures that allow lock-free reads, the write lock > + * is indicated below. > */ > struct art_root { > - struct srp ar_root; /* First table */ > - struct rwlock ar_lock; /* Serialise modifications */ > - uint8_t ar_bits[ART_MAXLVL]; /* Per level stride */ > - uint8_t ar_nlvl; /* Number of levels */ > - uint8_t ar_alen; /* Address length in bits */ > - uint8_t ar_off; /* Offset of the key in bytes */ > - unsigned int ar_rtableid; /* ID of this routing table */ > - struct sockaddr *source; /* optional src addr to use */ > + struct srp ar_root; /* [l] First table */ > + struct rwlock ar_lock; /* [] Serialise modifications */ > + uint8_t ar_bits[ART_MAXLVL]; /* [I] Per level stride */ > + uint8_t ar_nlvl; /* [I] Number of levels */ > + uint8_t ar_alen; /* [I] Address length in bits */ > + uint8_t ar_off; /* [I] Offset of key in bytes */ > + struct sockaddr *source; /* [K] optional src addr to use > */ > }; > > #define ISLEAF(e) (((unsigned long)(e) & 1) == 0) >