Skip to Content.
Sympa Menu

rare-dev - Re: [rare-dev] Compilation failures for Tofino2

Subject: Rare project developers

List archive

Re: [rare-dev] Compilation failures for Tofino2


Chronological Thread 
  • From: Alexander Gall <>
  • To: mc36 <>
  • Cc: <>
  • Subject: Re: [rare-dev] Compilation failures for Tofino2
  • Date: Thu, 2 Jun 2022 10:27:24 +0200


Interesting. The problem goes away when I add a redundant entry with a
fixed value of mpls_encap_decap_sap_type in the global part of
include/ig_ctl_pkt_pre_emit.p4:

diff --git a/p4src/include/ig_ctl_pkt_pre_emit.p4
b/p4src/include/ig_ctl_pkt_pre_emit.p4
index c53597f..0575f34 100644
--- a/p4src/include/ig_ctl_pkt_pre_emit.p4
+++ b/p4src/include/ig_ctl_pkt_pre_emit.p4
@@ -309,6 +309,7 @@ ig_md.nexthop_id:
(1, 0, 0, 0, 0, 0, 0, 0, 4, _):act_pkt_srv_l3vpn_ipv4_encap();
(1, 0, 0, 0, 0, 0, 0, 0, 6, _):act_pkt_srv_l3vpn_ipv6_encap();
#endif
+ (0, 0, 0, 0, 0, 0, 0, 0, 4, CPU_PORT):act_pkt_send_to_cpu();
(0, 0, 0, 0, 0, 0, 0, 0, _, CPU_PORT):act_pkt_send_to_cpu();
(0, 0, 0, 0, 0, 0, 0, 1, _, CPU_PORT):act_pkt_send_to_cpu();
(0, 0, 0, 0, 0, 0, 1, 0, _, CPU_PORT):act_pkt_send_to_cpu();

That seems like an easy workaround :)

--
Alex

On Thu, 2 Jun 2022 09:28:22 +0200, Alexander Gall <> said:

> Hi csaba
> I'm adding support for the AS9516-32D to RARE but I'm hitting what I
> believe is a compiler bug. It affects basically all profiles, for example

> [~/rare]$ bf-p4c --std p4-16 --target tofino2 --arch t2na -Iprofiles/9.7.1
> -Ip4src -DCERN_FLOWLAB p4src/bf_router.p4
> warning: ingress::ig_intr_md_for_tm.ucast_egress_port is read in ingress
> deparser, however it is never or partially initialized
> bf_router.tofino2/pipe/bf_router.bfa:1909: error: No phv record
> ig_md.mpls_encap_decap_sap_type
> bf_router.tofino2/pipe/bf_router.bfa:1909: error: No phv record
> ig_md.mpls_encap_decap_sap_type
> bf_router.tofino2/pipe/bf_router.bfa:1909: error: No phv record
> ig_md.mpls_encap_decap_sap_type
> bf_router.tofino2/pipe/bf_router.bfa:1909: error: No phv record
> ig_md.mpls_encap_decap_sap_type
> bf_router.tofino2/pipe/bf_router.bfa:1909: error: No phv record
> ig_md.mpls_encap_decap_sap_type
> bf_router.tofino2/pipe/bf_router.bfa:1909: error: No phv record
> ig_md.mpls_encap_decap_sap_type
> bf_router.tofino2/pipe/bf_router.bfa:1909: error: No phv record
> ig_md.mpls_encap_decap_sap_type
> bf_router.tofino2/pipe/bf_router.bfa:1909: error: No phv record
> ig_md.mpls_encap_decap_sap_type
> bf_router.tofino2/pipe/bf_router.bfa:1909: error: No phv record
> ig_md.mpls_encap_decap_sap_type
> bf_router.tofino2/pipe/bf_router.bfa:1909: error: No phv record
> ig_md.mpls_encap_decap_sap_type
> bf_router.tofino2/pipe/bf_router.bfa:1909: error: No phv record
> ig_md.mpls_encap_decap_sap_type
> bf_router.tofino2/pipe/bf_router.bfa:1909: error: No phv record
> ig_md.mpls_encap_decap_sap_type
> bf_router.tofino2/pipe/bf_router.bfa:1909: error: No phv record
> ig_md.mpls_encap_decap_sap_type
> bf_router.tofino2/pipe/bf_router.bfa:1909: error: No phv record
> ig_md.mpls_encap_decap_sap_type
> failed command assembler

> This happens for 9.7.1 as well as 9.9.0. I think it's a compiler bug
> because the problem appears in the intermediate file bf_router.bfa. I
> don't really understand that file, but I think the offending secition
> is this:

> 1893 p4_param_order:
> 1894 ig_md.srv_encap_l3vpn_valid: { type: exact, size: 1,
> full_size: 1 }
> 1895 ig_md.mpls_encap_rawip_valid: { type: exact, size: 1,
> full_size: 1 }
> 1896 ig_md.mpls_encap_l3vpn_valid: { type: exact, size: 1,
> full_size: 1 }
> 1897 ig_md.mpls_encap_l2vpn_valid: { type: exact, size: 1,
> full_size: 1 }
> 1898 ig_md.mpls_encap_xconnect_valid: { type: exact, size: 1,
> full_size: 1 }
> 1899 ig_md.srv_remove: { type: exact, size: 1, full_size: 1 }
> 1900 ig_md.mpls0_remove: { type: exact, size: 1, full_size: 1}
> 1901 ig_md.mpls1_remove: { type: exact, size: 1, full_size: 1}
> 1902 ig_md.mpls_encap_decap_sap_type: { type: ternary, size: 4,
> full_size: 4 }
> 1903 ig_md.nexthop_id: { type: ternary, size: 16, full_size: 16 }
> 1904 row: 1
> 1905 result_bus: 0
> 1906 gateway:
> 1907 name: ig_ctl_pkt_pre_emit_tbl_pkt_pre_emit-gateway
> 1908 input_xbar:
> 1909 exact group 0: { 0: ig_md.nexthop_id, 16: ig_md.srv_remove,
> 25: ig_md.mpls_encap_decap_sap_type, 32: ig_md.mpls0_remove, 40:
> ig_md.mpls1_remove, 49: ig_md.srv_encap_l3vpn_val
> 1909 id, 50: ig_md.mpls_encap_l3vpn_valid, 51:
> ig_md.mpls_encap_xconnect_valid, 57: ig_md.mpls_encap_rawip_valid, 58:
> ig_md.mpls_encap_l2vpn_valid }

> The ternary key ig_md.mpls_encap_decap_sap_type appears in the "exact
> group 0" list, which is probably wrong. At least this seems to be
> confirmed by the BNG profile, which compiles fine with 9.7.1 but fails
> with 9.9.0 and the difference is exactly that (the
> mpls_encap_decap_sap_type does not appear in the "exact group 0" list
> when the compilation succeeds).

> If you can confirm this, we should open a case with Intel.

> Unfortunately, there is an additional problem with 9.7.1 and the BNG
> profile:

> [~/rare]$ bf-p4c --std p4-16 --target tofino2 --arch t2na -Iprofiles/9.7.1
> -Ip4src -DPROFILE_BNG p4src/bf_router.p4
> p4src/include/ig_ctl_vrf.p4(62): [--Wwarn=table-placement] warning:
> Shrinking table ig_ctl.ig_ctl_vrf.tbl_vrf: with 14 match bits, can only
> have 16384 entries
> table tbl_vrf {
> ^^^^^^^
> p4src/include/eg_ctl.p4(78): warning: egress::hdr.eth2.$valid is read in
> table tbl_eg_ctl78, however it is never or partially initialized
> if (hdr.eth2.isValid()) eg_md.pktlen = eg_md.pktlen + 14;
> ^
> p4src/include/eg_ctl.p4(92): warning: egress::hdr.vlan2.$valid is read in
> table tbl_eg_ctl92, however it is never or partially initialized
> if (hdr.vlan2.isValid()) eg_md.pktlen = eg_md.pktlen + 4;
> ^
> warning: ingress::ig_intr_md_for_tm.ucast_egress_port is read in ingress
> deparser, however it is never or partially initialized
> Internal compiler error. Please submit a bug report with your code.

> This bug also exists in 9.8.0 but not in 9.9.0 (in that case the BNG
> profile also fails with the ig_md.mpls_encap_decap_sap_type error).

> I fear that it will be difficult to convince Intel to back-port any
> fixes to 9.7.x :( This looks like a show-stopper for us unless we give
> up support for the APS2556...

> --
> Alex



Archive powered by MHonArc 2.6.19.

Top of Page