P4

P4代码注释比较全的一个demo,非常有助于新手理解P4

已邀请:

yifan - 春风十里不如你

赞同来自:


/* Why bother creating an action that just does one primitive action?
* That is, why not just use 'mark_to_drop' as one of the possible
* actions when defining a table? Because the P4_16 compiler does not
* allow primitive actions to be used directly as actions of tables.
* You must use 'compound actions', i.e. ones explicitly defined with
* the 'action' keyword like below.
*
* mark_to_drop() is an extern defined in v1model.h, I believe
* implemented in the behavioral model by setting an appropriate
* 'intrinsic metadata' field with a code indicating the packet should
* be dropped. */
这个不错

要回复问题请先登录注册