Flow learning is done using NTAPI in the application. This describes how to handle flows with API examples.
Flow management application architecture
The application can handle received frames in multiple threads as the SmartNIC can distribute flows to a maximum of 128 host buffers. The frames belonging to the same flow are delivered to the same host buffer. If a received frame is unknown (missed), the application adds the flow to the flow table (flow learning). When the application handles RX frames and flow learning in the same thread, the flow-learning rate may not be able to keep up with the RX rate. This results in dropped packets. It is therefore recommended to handle RX frames and flow learning in separate threads using a queue as illustrated in the following figure.
Code examples
Code examples for the flow management are available in the package. They are placed in the /opt/napatech3/examples/flow directory.