bmv2
Designing your own switch target with bmv2
Public Member Functions | List of all members
bm::LearnEngineIface Class Referenceabstract

Public Member Functions

virtual void learn (list_id_t list_id, const Packet &pkt)=0
 

Detailed Description

Enables learning in the switch. For now it is the responsibility of the switch (look at the simple switch target for an example) to invoke the learn() method, which will send out the learning notifications.

Member Function Documentation

◆ learn()

virtual void bm::LearnEngineIface::learn ( list_id_t  list_id,
const Packet pkt 
)
pure virtual

Performs learning on the packet. Needs to be called by the target after a learning-enabled pipeline has been applied on the packet. See the simple switch implementation for an example.

The list_id should be mapped to a field list in the JSON fed into the switch. Since learning is still not well-standardized in P4, this process is a little bit hacky for now.


The documentation for this class was generated from the following file: