Vyatta NOS documentation

Learn how to install, configure, and operate Vyatta Network Operating System (Vyatta NOS), which helps to drive our virtual networking and physical platforms portfolio.

BFD dataplane CPU affinity

Bidirectional Forwarding Detection (BFD) is a protocol used to monitor liveness of forwarding engines in order to enable quicker control plane convergence in the event of failure of a node. The original offload design did not consider the fact that the BFD thread in the dataplane either needs to execute on a dedicated CPU or have some other means of always being scheduled in a timely manner in order to avoid timing out sessions. This has resulted in issues when the CPU load on the main thread can result in erratic scheduling of the BFD thread. This patch adds a new command that can dedicate a CPU for BFD in the dataplane using affinity configuration.

set protocols bfd dataplane cpu-affinity <cpu-id>

cpu-id is in the range 1 to 255. It is customized per platform to reflect the actual number of CPUs available on the platform.

When this command is issued, the BFD thread is moved to or started on the specified CPU. All existing BFD sessions experience a flap during this activity due to the temporary teardown and re-instantiation of the BFD thread.

The CPU specified must conform to the following restrictions:

  1. It must not be the CPU used to host the main thread of the dataplane.
    • If no affinity is configured for the dataplane as a whole, the main thread is hosted by CPU 0.
    • If the dataplane CPU affinity is configured using set system default dataplane cpu-affinity, the main thread is hosted on the cpu with the lowest id in the list specified.
  2. It must not be a CPU configured for control, forwarding or any other feature.
    • The other existing commands dealing with dataplane cpu affinity are as follows:
      • set system default dataplane control cpu-affinity <cpu-list>
      • set interfaces dataplane <interface> < cpu-affinity | transmit-cpu-affinity | receive-cpu-affinity > <list>
      • set security vpn ipsec dataplane < crypto | crypto-fwd > cpu-affinity <list>
      • set service nat cgnat cpu-affinity event session <cpu>

The above restrictions are validated at the time of committing the configuration and the configuration commit fails if the user specifies an invalid configuration.

If the CPU specified by the user does not exist on the system, the configuration is still accepted in order to handle scenarios of VM re-provisioning. However an error message of severity CRITICAL will be emitted indicating that the configuration was not honored. If this happens, BFD runs in a degraded mode on the same CPU as the main thread.