Register Action Error in Tofino Model @ P4-16

Hello everyone,

I have this issue while implementing registers in Tofino Model. I am only including the minimal code to avoid any confusion:

control SwitchIngress(inout header_t hdr,
        inout metadata_t meta,
        in ingress_intrinsic_metadata_t ig_intr_md,
        in ingress_intrinsic_metadata_from_parser_t ig_prsr_md,
        inout ingress_intrinsic_metadata_for_deparser_t ig_dprsr_md,
        inout ingress_intrinsic_metadata_for_tm_t ig_tm_md) {

Register<bit<64>, bit<32>>(REGISTER_LENGTH, 0) subflow_fwd_bytes;

    RegisterAction<bit<64>, bit<32>, bit<32>>(subflow_fwd_bytes) subflow_fwd_bytes_register_action_ipv6 = {
        void apply(inout bit<64> sfb) {
        if(meta.isForward==1)
        {
            if(hdr.ipv6.isValid())
                sfb = sfb +  (bit<64>)hdr.ipv6.payloadLen;
        }
        }
    };

action update_flow_metrics()
    {
 subflow_fwd_bytes_register_action_ipv6.execute(idx);
}
}

I get the following error:

/home/tofino/P4-Project/read_write.p4(1054): error: : multiple calls to execute in action update_flow_metrics
        subflow_fwd_bytes_register_action_ipv6.execute(idx);

Any ideas how to resolve this error? Thank you!

@sank1911 – Welcome to the community!

Please, direct all your Tofino-specific inquiries to the appropriate Intel support forums.