Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add @likely/@unlikely annotations for blocks #4979

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
modified test outputs
Signed-off-by: Chris Dodd <cdodd@nvidia.com>
  • Loading branch information
ChrisDodd committed Dec 16, 2024
commit 5ba499deb2d3935b99101b0819fa5c45c0c85021
30 changes: 7 additions & 23 deletions testdata/p4_16_samples_outputs/fabric_20190420/fabric-frontend.p4
Original file line number Diff line number Diff line change
Expand Up @@ -562,34 +562,18 @@ control FabricIngress(inout parsed_headers_t hdr, inout fabric_metadata_t fabric
}
@name("FabricIngress.next.routing_hashed") action next_routing_hashed_0(@name("port_num") port_num_t port_num_1, @name("smac") mac_addr_t smac, @name("dmac") mac_addr_t dmac) {
@hidden {
@hidden {
hdr.ethernet.src_addr = smac;
}
@hidden {
hdr.ethernet.dst_addr = dmac;
}
@hidden {
standard_metadata.egress_spec = port_num_1;
}
hdr.ethernet.src_addr = smac;
hdr.ethernet.dst_addr = dmac;
standard_metadata.egress_spec = port_num_1;
}
next_hashed_counter.count();
}
@name("FabricIngress.next.mpls_routing_hashed") action next_mpls_routing_hashed_0(@name("port_num") port_num_t port_num_2, @name("smac") mac_addr_t smac_0, @name("dmac") mac_addr_t dmac_0, @name("label") mpls_label_t label_0) {
@hidden {
@hidden {
fabric_metadata.mpls_label = label_0;
}
@hidden {
@hidden {
hdr.ethernet.src_addr = smac_0;
}
@hidden {
hdr.ethernet.dst_addr = dmac_0;
}
@hidden {
standard_metadata.egress_spec = port_num_2;
}
}
fabric_metadata.mpls_label = label_0;
hdr.ethernet.src_addr = smac_0;
hdr.ethernet.dst_addr = dmac_0;
standard_metadata.egress_spec = port_num_2;
}
next_hashed_counter.count();
}
Expand Down
38 changes: 26 additions & 12 deletions testdata/p4_16_samples_outputs/fabric_20190420/fabric-midend.p4
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,9 @@ control FabricIngress(inout parsed_headers_t hdr, inout fabric_metadata_t fabric
}
@name("FabricIngress.forwarding.bridging_counter") direct_counter(CounterType.packets_and_bytes) forwarding_bridging_counter;
@name("FabricIngress.forwarding.set_next_id_bridging") action forwarding_set_next_id_bridging_0(@name("next_id") bit<32> next_id_0) {
fabric_metadata._next_id10 = next_id_0;
@hidden {
fabric_metadata._next_id10 = next_id_0;
}
forwarding_bridging_counter.count();
}
@name("FabricIngress.forwarding.bridging") table forwarding_bridging {
Expand All @@ -430,7 +432,9 @@ control FabricIngress(inout parsed_headers_t hdr, inout fabric_metadata_t fabric
@name("FabricIngress.forwarding.mpls_counter") direct_counter(CounterType.packets_and_bytes) forwarding_mpls_counter;
@name("FabricIngress.forwarding.pop_mpls_and_next") action forwarding_pop_mpls_and_next_0(@name("next_id") bit<32> next_id_6) {
fabric_metadata._mpls_label5 = 20w0;
fabric_metadata._next_id10 = next_id_6;
@hidden {
fabric_metadata._next_id10 = next_id_6;
}
forwarding_mpls_counter.count();
}
@name("FabricIngress.forwarding.mpls") table forwarding_mpls {
Expand All @@ -447,7 +451,9 @@ control FabricIngress(inout parsed_headers_t hdr, inout fabric_metadata_t fabric
}
@name("FabricIngress.forwarding.routing_v4_counter") direct_counter(CounterType.packets_and_bytes) forwarding_routing_v4_counter;
@name("FabricIngress.forwarding.set_next_id_routing_v4") action forwarding_set_next_id_routing_v4_0(@name("next_id") bit<32> next_id_7) {
fabric_metadata._next_id10 = next_id_7;
@hidden {
fabric_metadata._next_id10 = next_id_7;
}
forwarding_routing_v4_counter.count();
}
@name("FabricIngress.forwarding.nop_routing_v4") action forwarding_nop_routing_v4_0() {
Expand Down Expand Up @@ -533,7 +539,9 @@ control FabricIngress(inout parsed_headers_t hdr, inout fabric_metadata_t fabric
}
@name("FabricIngress.next.xconnect_counter") direct_counter(CounterType.packets_and_bytes) next_xconnect_counter;
@name("FabricIngress.next.output_xconnect") action next_output_xconnect_0(@name("port_num") bit<9> port_num) {
standard_metadata.egress_spec = port_num;
@hidden {
standard_metadata.egress_spec = port_num;
}
next_xconnect_counter.count();
}
@name("FabricIngress.next.set_next_id_xconnect") action next_set_next_id_xconnect_0(@name("next_id") bit<32> next_id_9) {
Expand All @@ -557,20 +565,26 @@ control FabricIngress(inout parsed_headers_t hdr, inout fabric_metadata_t fabric
@max_group_size(16) @name("FabricIngress.next.hashed_selector") action_selector(HashAlgorithm.crc16, 32w1024, 32w16) next_hashed_selector;
@name("FabricIngress.next.hashed_counter") direct_counter(CounterType.packets_and_bytes) next_hashed_counter;
@name("FabricIngress.next.output_hashed") action next_output_hashed_0(@name("port_num") bit<9> port_num_0) {
standard_metadata.egress_spec = port_num_0;
@hidden {
standard_metadata.egress_spec = port_num_0;
}
next_hashed_counter.count();
}
@name("FabricIngress.next.routing_hashed") action next_routing_hashed_0(@name("port_num") bit<9> port_num_1, @name("smac") bit<48> smac, @name("dmac") bit<48> dmac) {
hdr.ethernet.src_addr = smac;
hdr.ethernet.dst_addr = dmac;
standard_metadata.egress_spec = port_num_1;
@hidden {
hdr.ethernet.src_addr = smac;
hdr.ethernet.dst_addr = dmac;
standard_metadata.egress_spec = port_num_1;
}
next_hashed_counter.count();
}
@name("FabricIngress.next.mpls_routing_hashed") action next_mpls_routing_hashed_0(@name("port_num") bit<9> port_num_2, @name("smac") bit<48> smac_0, @name("dmac") bit<48> dmac_0, @name("label") bit<20> label_0) {
fabric_metadata._mpls_label5 = label_0;
hdr.ethernet.src_addr = smac_0;
hdr.ethernet.dst_addr = dmac_0;
standard_metadata.egress_spec = port_num_2;
@hidden {
fabric_metadata._mpls_label5 = label_0;
hdr.ethernet.src_addr = smac_0;
hdr.ethernet.dst_addr = dmac_0;
standard_metadata.egress_spec = port_num_2;
}
next_hashed_counter.count();
}
@name("FabricIngress.next.hashed") table next_hashed {
Expand Down
172 changes: 94 additions & 78 deletions testdata/p4_16_samples_outputs/omec/up4-midend.p4
Original file line number Diff line number Diff line change
Expand Up @@ -431,27 +431,35 @@ control PreQosPipe(inout parsed_headers_t hdr, inout local_metadata_t local_meta
const default_action = do_drop_1();
}
@name("PreQosPipe.uplink_term_fwd") action uplink_term_fwd(@name("ctr_idx") bit<32> ctr_idx_0, @name("tc") bit<2> tc_2, @name("app_meter_idx") bit<32> app_meter_idx) {
local_meta.ctr_idx = ctr_idx_0;
local_meta.terminations_hit = true;
@hidden {
local_meta.ctr_idx = ctr_idx_0;
local_meta.terminations_hit = true;
}
local_meta.app_meter_idx_internal = app_meter_idx;
local_meta.tc = tc_2;
}
@name("PreQosPipe.uplink_term_drop") action uplink_term_drop(@name("ctr_idx") bit<32> ctr_idx_5) {
local_meta.ctr_idx = ctr_idx_5;
local_meta.terminations_hit = true;
@hidden {
local_meta.ctr_idx = ctr_idx_5;
local_meta.terminations_hit = true;
}
local_meta.needs_dropping = true;
}
@name("PreQosPipe.downlink_term_fwd") action downlink_term_fwd(@name("ctr_idx") bit<32> ctr_idx_6, @name("teid") bit<32> teid_1, @name("qfi") bit<6> qfi_1, @name("tc") bit<2> tc_3, @name("app_meter_idx") bit<32> app_meter_idx_2) {
local_meta.ctr_idx = ctr_idx_6;
local_meta.terminations_hit = true;
@hidden {
local_meta.ctr_idx = ctr_idx_6;
local_meta.terminations_hit = true;
}
local_meta.tunnel_out_teid = teid_1;
local_meta.tunnel_out_qfi = qfi_1;
local_meta.app_meter_idx_internal = app_meter_idx_2;
local_meta.tc = tc_3;
}
@name("PreQosPipe.downlink_term_drop") action downlink_term_drop(@name("ctr_idx") bit<32> ctr_idx_7) {
local_meta.ctr_idx = ctr_idx_7;
local_meta.terminations_hit = true;
@hidden {
local_meta.ctr_idx = ctr_idx_7;
local_meta.terminations_hit = true;
}
local_meta.needs_dropping = true;
}
@name("PreQosPipe.terminations_uplink") table terminations_uplink_0 {
Expand Down Expand Up @@ -510,78 +518,86 @@ control PreQosPipe(inout parsed_headers_t hdr, inout local_metadata_t local_meta
default_action = NoAction_2();
}
@name("PreQosPipe.do_gtpu_tunnel") action do_gtpu_tunnel() {
hdr.inner_udp = hdr.udp;
hdr.udp.setInvalid();
hdr.inner_tcp = hdr.tcp;
hdr.tcp.setInvalid();
hdr.inner_icmp = hdr.icmp;
hdr.icmp.setInvalid();
hdr.udp.setValid();
hdr.udp.sport = local_meta.tunnel_out_udp_sport;
hdr.udp.dport = 16w2152;
hdr.udp.len = hdr.ipv4.total_len + 16w16;
hdr.udp.checksum = 16w0;
hdr.inner_ipv4 = hdr.ipv4;
hdr.ipv4.setValid();
hdr.ipv4.version = 4w4;
hdr.ipv4.ihl = 4w5;
hdr.ipv4.dscp = 6w0;
hdr.ipv4.ecn = 2w0;
hdr.ipv4.total_len = hdr.ipv4.total_len + 16w36;
hdr.ipv4.identification = 16w0x1513;
hdr.ipv4.flags = 3w0;
hdr.ipv4.frag_offset = 13w0;
hdr.ipv4.ttl = 8w64;
hdr.ipv4.proto = 8w17;
hdr.ipv4.src_addr = local_meta.tunnel_out_src_ipv4_addr;
hdr.ipv4.dst_addr = local_meta.tunnel_out_dst_ipv4_addr;
hdr.ipv4.checksum = 16w0;
hdr.gtpu.setValid();
hdr.gtpu.version = 3w0x1;
hdr.gtpu.pt = 1w0x1;
hdr.gtpu.spare = 1w0;
hdr.gtpu.ex_flag = 1w0;
hdr.gtpu.seq_flag = 1w0;
hdr.gtpu.npdu_flag = 1w0;
hdr.gtpu.msgtype = 8w255;
hdr.gtpu.msglen = hdr.inner_ipv4.total_len;
hdr.gtpu.teid = local_meta.tunnel_out_teid;
@hidden {
hdr.inner_udp = hdr.udp;
hdr.udp.setInvalid();
hdr.inner_tcp = hdr.tcp;
hdr.tcp.setInvalid();
hdr.inner_icmp = hdr.icmp;
hdr.icmp.setInvalid();
hdr.udp.setValid();
hdr.udp.sport = local_meta.tunnel_out_udp_sport;
hdr.udp.dport = 16w2152;
hdr.udp.len = hdr.ipv4.total_len + 16w16;
hdr.udp.checksum = 16w0;
hdr.inner_ipv4 = hdr.ipv4;
hdr.ipv4.setValid();
hdr.ipv4.version = 4w4;
hdr.ipv4.ihl = 4w5;
hdr.ipv4.dscp = 6w0;
hdr.ipv4.ecn = 2w0;
hdr.ipv4.total_len = hdr.ipv4.total_len + 16w36;
hdr.ipv4.identification = 16w0x1513;
hdr.ipv4.flags = 3w0;
hdr.ipv4.frag_offset = 13w0;
hdr.ipv4.ttl = 8w64;
hdr.ipv4.proto = 8w17;
hdr.ipv4.src_addr = local_meta.tunnel_out_src_ipv4_addr;
hdr.ipv4.dst_addr = local_meta.tunnel_out_dst_ipv4_addr;
hdr.ipv4.checksum = 16w0;
}
@hidden {
hdr.gtpu.setValid();
hdr.gtpu.version = 3w0x1;
hdr.gtpu.pt = 1w0x1;
hdr.gtpu.spare = 1w0;
hdr.gtpu.ex_flag = 1w0;
hdr.gtpu.seq_flag = 1w0;
hdr.gtpu.npdu_flag = 1w0;
hdr.gtpu.msgtype = 8w255;
hdr.gtpu.msglen = hdr.inner_ipv4.total_len;
hdr.gtpu.teid = local_meta.tunnel_out_teid;
}
}
@name("PreQosPipe.do_gtpu_tunnel_with_psc") action do_gtpu_tunnel_with_psc() {
hdr.inner_udp = hdr.udp;
hdr.udp.setInvalid();
hdr.inner_tcp = hdr.tcp;
hdr.tcp.setInvalid();
hdr.inner_icmp = hdr.icmp;
hdr.icmp.setInvalid();
hdr.udp.setValid();
hdr.udp.sport = local_meta.tunnel_out_udp_sport;
hdr.udp.dport = 16w2152;
hdr.udp.len = hdr.ipv4.total_len + 16w24;
hdr.udp.checksum = 16w0;
hdr.inner_ipv4 = hdr.ipv4;
hdr.ipv4.setValid();
hdr.ipv4.version = 4w4;
hdr.ipv4.ihl = 4w5;
hdr.ipv4.dscp = 6w0;
hdr.ipv4.ecn = 2w0;
hdr.ipv4.total_len = hdr.ipv4.total_len + 16w44;
hdr.ipv4.identification = 16w0x1513;
hdr.ipv4.flags = 3w0;
hdr.ipv4.frag_offset = 13w0;
hdr.ipv4.ttl = 8w64;
hdr.ipv4.proto = 8w17;
hdr.ipv4.src_addr = local_meta.tunnel_out_src_ipv4_addr;
hdr.ipv4.dst_addr = local_meta.tunnel_out_dst_ipv4_addr;
hdr.ipv4.checksum = 16w0;
hdr.gtpu.setValid();
hdr.gtpu.version = 3w0x1;
hdr.gtpu.pt = 1w0x1;
hdr.gtpu.spare = 1w0;
hdr.gtpu.seq_flag = 1w0;
hdr.gtpu.npdu_flag = 1w0;
hdr.gtpu.msgtype = 8w255;
hdr.gtpu.teid = local_meta.tunnel_out_teid;
@hidden {
hdr.inner_udp = hdr.udp;
hdr.udp.setInvalid();
hdr.inner_tcp = hdr.tcp;
hdr.tcp.setInvalid();
hdr.inner_icmp = hdr.icmp;
hdr.icmp.setInvalid();
hdr.udp.setValid();
hdr.udp.sport = local_meta.tunnel_out_udp_sport;
hdr.udp.dport = 16w2152;
hdr.udp.len = hdr.ipv4.total_len + 16w24;
hdr.udp.checksum = 16w0;
hdr.inner_ipv4 = hdr.ipv4;
hdr.ipv4.setValid();
hdr.ipv4.version = 4w4;
hdr.ipv4.ihl = 4w5;
hdr.ipv4.dscp = 6w0;
hdr.ipv4.ecn = 2w0;
hdr.ipv4.total_len = hdr.ipv4.total_len + 16w44;
hdr.ipv4.identification = 16w0x1513;
hdr.ipv4.flags = 3w0;
hdr.ipv4.frag_offset = 13w0;
hdr.ipv4.ttl = 8w64;
hdr.ipv4.proto = 8w17;
hdr.ipv4.src_addr = local_meta.tunnel_out_src_ipv4_addr;
hdr.ipv4.dst_addr = local_meta.tunnel_out_dst_ipv4_addr;
hdr.ipv4.checksum = 16w0;
}
@hidden {
hdr.gtpu.setValid();
hdr.gtpu.version = 3w0x1;
hdr.gtpu.pt = 1w0x1;
hdr.gtpu.spare = 1w0;
hdr.gtpu.seq_flag = 1w0;
hdr.gtpu.npdu_flag = 1w0;
hdr.gtpu.msgtype = 8w255;
hdr.gtpu.teid = local_meta.tunnel_out_teid;
}
hdr.gtpu.msglen = hdr.inner_ipv4.total_len + 16w8;
hdr.gtpu.ex_flag = 1w1;
hdr.gtpu_options.setValid();
Expand Down