> On 22 Feb 2021, at 12:46 am, Vitaliy Makkoveev <o...@bsdbox.dev> wrote:
>
> Hello.
>
>
>> + ifp->if_ioctl = veb_ioctl;
>> + ifp->if_input = veb_input;
>> + //ifp->if_rtrequest = veb_rtrequest;
>> + ifp->if_output = veb_output;
>> + ifp->if_enqueue = veb_enqueue;
>
> Could you replace c++ style comment in veb_clone_create()?
yep.
>
>> +veb_clone_destroy(struct ifnet *ifp)
>> +{
>> + struct veb_softc *sc = ifp->if_softc;
>> + struct veb_port *p, *np;
>> +
>> + NET_LOCK();
>> + sc->sc_dead = 1;
>> +
>> + if (ISSET(ifp->if_flags, IFF_RUNNING))
>> + veb_down(sc);
>> + NET_UNLOCK();
>> +
>> + if_detach(ifp);
>
>
> Also veb_down() looks strange here. I guess it is no reason to
> play with `if_flags' here and smr_barrier() could be called after
> if_detach(). This makes `sc_dead’ unnecessary.
i need to think about sc_dead again. i do it in a bunch of different drivers
and you're pretty confident it's not needed anymore.
technically the flags don't need to be cleared, but i like having the flow
right in case i made veb_down do more in the future.