-- it works fine for phy's that are carrier-up, but crashes if they are
carrier-down.
0: /home/pim/src/vpp/src/vnet/interface_funcs.h:46 (vnet_get_hw_interface) assertion `! pool_is_free (vnm->interface_main.hw_interfaces, _e)' fails
at /home/pim/src/vpp/src/vppinfra/error.c:143
ns=0x7fff98774e80 "dataplane", host_sw_if_indexp=0x0) at /home/pim/src/vpp/src/plugins/lcpng/lcpng_interface.c:998
at /home/pim/src/vpp/src/plugins/lcpng/lcpng_if_cli.c:96
parent_command_index=371) at /home/pim/src/vpp/src/vlib/cli.c:591
parent_command_index=0) at /home/pim/src/vpp/src/vlib/cli.c:548
at /home/pim/src/vpp/src/vlib/cli.c:694
Namespace members used to be char[], now they are vectors. Using
strlen on a default value for these vectors results in a segmentation
fault.
Use vec_cmp instead. While at it, fix the output format to be %v.
- move tap_set_carrier() upstream to lcp_itf_set_link_state()
- refuse to set admin-up on sub-int if parent is down
- no need to switch namespaces, lcp_itf_set_link_state() already does
- in change_mtu and change_admin_state, if the interface is a sub,
we only have to sync that one interface. Otherwise, walk the parent
interface and all sub-ints with lcp_itf_pair_sync_state_hw() and
make note of this in the (DBG) log
Instead of doing BATCH_DELAY_MS work and BATCH_DELAY_MS sleep, add
a BATCH_WORK_MS (40) and lower BATCH_DELAY_MS (10), so we'll work
80% of the time, and consume netlink messages 20% of the time.
Also raise the total batch size to 8K because on my test machine
we run 2K in 13ms or 8K in ~50ms.
Stop adding paths with add_special(); there is a scenario with Bird2
that makes this crash:
- Assume a VPP which has its fib fully synced
- Kill VPP
- Bird will see network devices remove, and mark all routes 'unreach'
- Start VPP
- Bird will see the devices come back, and issue netlink messages for
each route that is unreach
- these become add_special() because they have no nexthop and are
of type UNREACHABLE
- adding these to the FIB sometimes crashes in dpo handling
To avoid this, no longer add_special() -- as a caveat, manually inserted
routes to unreach/blackhole will not be explicitly added, however most
will be caught by fib-entry for default-route (which is a 'drop'). This
behavior should be fixed, but it's at the moment not obvious to me how
and I'd prefer this behavior over SIGABORT/SIGSEGV deeper in the code.
This is a little bit of a performance hit (consuming 2K msgs was 11ms, is now 18ms)
but putting the barrier locks inline is fragile and will eventually
cause an issue. As with Matt's pending plugin, sync and release the
barrier lock around the entire handler, rather than in-line.
Contrary to Matt's implementation, I am also going to lock route_add()
and route_del() because without the locking, I get spurious crashes.