P4

哪位大神知道p4-14中intrinsic_metadata的用法?


在switch.p4中有以下代码,是实现泛洪功能的
action set_bd_flood_mc_index(mc_index) {
modify_field(intrinsic_metadata.mcast_grp, mc_index);
}

table bd_flood {
reads {
    ingress_metadata.bd : exact;
    l2_metadata.lkp_pkt_type : exact;
}
actions {
    nop;
    set_bd_flood_mc_index;
}
size : BD_FLOOD_TABLE_SIZE;
}

control process_multicast_flooding {

ifndef MULTICAST_DISABLE

    apply(bd_flood);

endif /* MULTICAST_DISABLE */

}


上面的 intrinsic_metadata.mcast_grp 被赋值后不知道在哪里被调用,搜索了全部的代码都没有查到。
请问intrinsic_metadata.mcast_grp是在哪里被使用?

附件是switch的源码,麻烦哪位大神帮解答一下。
已邀请:

hanw

赞同来自: Cool


intrinsic_metadata用于控制固定功能模块的功能,multicast一般是在固定功能模块中实现的。

mario_hu - 欲戴王冠必承其重

赞同来自:


@hanw 谢谢您的回复,multicast在固定功能模块中实现,我们在哪里可以看到这部分的代码?我现在不知道intrinsic_metadata.mcast_grp的用法,请问有哪些资料有介绍吗?

hanw

赞同来自:


固定功能的模块不是用P4语言描述的,你可以读一下VMware research和barefoot刚发表的文章 “The P416 Programming Language",我刚刚转发了。

mario_hu - 欲戴王冠必承其重

赞同来自:


@hanw 谢谢您的回复

要回复问题请先登录注册