Hello Dave,
>
> sorry i'm late to the party. can you try this diff?
glad to see you are here.
I think you diff looks good. I'm just concerned about
the memory allocation in veb_ports_insert(). The
memory is allocated with `M_WAITOK` flag, which essentially
means we may give up CPU.
the veb_ports_insert() is being called from veb_add_port()
here:
1500 }
1501
1502 p->p_brport.eb_port_take = veb_eb_brport_take;
1503 p->p_brport.eb_port_rele = veb_eb_brport_rele;
1504
1505 om = SMR_PTR_GET_LOCKED(ports_ptr);
1506 nm = veb_ports_insert(om, p);
1507
1508 /* this might have changed if we slept for malloc or ifpromisc */
1509 error = ether_brport_isset(ifp0);
at this point we hold a NET_LOCK(). So basically if there won't
be enough memory we might start sleeping waiting for memory
while we will be holding a NET_LOCK.
This is something we should try to avoid, however this can be
sorted out later. At this point I just want to point out
this problem, which can be certainly solved in follow up
commit. pf(4) also has its homework to be done around
sleeping mallocs.
I think your diff should go in as is.
thanks and regards
OK sashan