ng_ether naming

Ermal Luçi eri at freebsd.org
Thu Dec 13 18:57:51 UTC 2012


On Thu, Dec 13, 2012 at 5:25 PM, Andriy Gapon <avg at freebsd.org> wrote:

> on 13/12/2012 14:08 Alexander V. Chernikov said the following:
> > On 13.12.2012 15:46, Andriy Gapon wrote:
> >>
> >> ng_ether uses if_xname for naming its nodes.
> >> This could be troublesome for mapping interface names to their ng_ether
> companions
> >> in the face of interface renaming capability.  Especially given that
> interface
> >> renaming and ng_ether _module_ loading may happen in an arbitrary order.
> >>
> >> I am not sure how to solve this best.
> >>
> >> One possibility is to use if_dname+if_dunit combination for ng_ether
> naming.  This
> >> should be stable and available for querying.  This behavior should also
> be
> >> backward compatible with ng_ether being compiled into kernel
> (if_dname+if_dunit ==
> >> if_xname before any renaming could occur).
> >>
> >> Another possibility is to do ng_ether renaming when its interface is
> renamed.
> >> This seems nicer but appears to be more work and more intrusive, because
> >> interfaces would have to know about their ng_ether nodes.
> >
> > Not exactly. You can register for ifnet_departure_event and
> ifnet_arrival_event.
> >
> > Interface renaming is done via sending departure event with old name and
> arrvial
> > event with new one.
>
> Good to know.  Thank you!
>
>
> So which approach sounds better?
> Or maybe there is even a better one?
>
>
The best is interface event handling.
Just recopy the new name from if_xname and should be done.


> >>
> >> What do you think?
> >> Thank you.
> >>
> >> And just in case:
> >> $ ifconfig -l
> >> net0 lo0
> >> $ ngctl list
> >> There are 2 total nodes:
> >>    Name: re0             Type: ether           ID: 00000001   Num
> hooks: 0
> >>    Name: ngctl11353      Type: socket          ID: 00000003   Num
> hooks: 0
> >>
> >
> >
>
>
> --
> Andriy Gapon
> _______________________________________________
> freebsd-net at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
>



-- 
Ermal


More information about the freebsd-net mailing list