PR #200319
The interaction between carp and bridge code makes the OS hang.
If there is a bridge with member an interface that has a CARP ip and no minimal amount of traffic flowing in the system result is a hang of the system and sometimes a crash.
Reference https://redmine.pfsense.org/issues/4607
After analysis seems that the carp code uses taskqueue_swi for scheduling demotion events.
The carp CIF lock had a lot of contention.
ether_input was doing duplicate checks of bridge_input causing even more contention on the CIF lock.
Attached patch converts CIF lock to RW lock.
- avoids duplicate checks from ether_input in case of bridge
- schedules task as taskqueue_thread rather than a SWI thread