bmv2
Designing your own switch target with bmv2
|
Public Member Functions | |
virtual void | learn (list_id_t list_id, const Packet &pkt)=0 |
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.
|
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.