-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
Description
注:
在提问之前,请确认你的问题是否能够通过以下方式解决:(1)百度;(2)bing;(3)Google;(4)Stackoverflow。
一个参考的主要提问步骤分为:
- (1)标题:出现bug的概要,例:"在根目录下,某某文件无法找到"
- (2)背景介绍(可选):介绍你大概的目的是什么;例:"为了测试数独,我做了这个实验,遇到了这个问题。"
- (3)实验环境:你的系统环境、安装的依赖,选择性给出;例:"我的操作系统为Ubuntu 14.04,64位。"
- (4)重要:重现bug的步骤,尽量条理清晰、简明;参照下例;
- (5)期待出现的行为(可选):如果没有遇到这个bug,你希望得到的结果是什么;参照下例;
- (6)结果出现的行为:较为全面的bug信息,或者错误日志,或者二者兼具;参照下例;
- (7)额外信息:一些附加的信息,如代码(简短的骨架,或者以站外链接的形式贴出),或者你对于该错误的认识;
- (8)礼貌用语。
例:
Title: "error: HashAlgorithm.csum16: Invalid enum tag"
大家好。
我的实验环境为Ubuntu 14.04,64位,装有编译器p4c和软件交换机bmv2的所有依赖,并已更新到最新版本。(第2、3点)
正常情况下,使用转换器将P4 14程序转换到P4 16程序是没有问题的(第5点);但是当我使用以下命令,尝试将一个P4 14的程序转换为P4 16程序时,发生了错误。
命令为(第4点):
$ p4c-bm2-ss --p4-14 --pp heavy_hitter_16.p4 heavy_hitter.p4
错误日志具体为(第6点):
heavy_hitter.p4(127): warning: -1: negative value with unsigned type
add_to_field(ipv4.ttl, -1);
^
heavy_hitter.p4(152): warning: csum16: unexpected algorithm
algorithm : csum16;
^^^^^^
error: HashAlgorithm.csum16: Invalid enum tag
heavy_hitter.p4(177): error: hash: Cannot unify Type(HashAlgorithm) to HashAlgorithm
modify_field_with_hash_based_offset(custom_metadata.hash_val1, 0,
^
/usr/local/share/p4c/p4include/v1model.p4(115)
enum HashAlgorithm {
^^^^
我使用的P4程序为(第4点和第7点,在这个例子的情况下,也视作是重现错误的关键步骤):
header_type ethernet_t {
fields {
dstAddr : 48;
srcAddr : 48;
etherType : 16;
}
}
...我使用的这个程序通过了P4 14程序的检验(第7点)。
期待您的回复,十分感谢!(第8点)
Reactions are currently unavailable