Skip to content

Commit

Permalink
automatic commit at releng box
Browse files Browse the repository at this point in the history
  • Loading branch information
mc36 committed Feb 2, 2022
1 parent ffe315a commit 4377a3d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
25 changes: 15 additions & 10 deletions misc/p4bf/include/ig_ctl_bridge.p4
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ control IngressControlBridge(inout headers hdr, inout ingress_metadata_t ig_md,
in ingress_intrinsic_metadata_t ig_intr_md)
{

DirectCounter< bit<64> > (CounterType_t.PACKETS_AND_BYTES) stats;
DirectCounter< bit<64> > (CounterType_t.PACKETS_AND_BYTES) statsRx;

DirectCounter< bit<64> > (CounterType_t.PACKETS_AND_BYTES) statsTx;

action act_set_bridge_port() {
statsRx.count();
ig_md.bridge_src = 1;
}

action act_bridge_miss() {
statsRx.count();
ig_md.bridge_src = 0;
ig_md.nexthop_id = CPU_PORT;
// Packets sent to the controller needs to be prepended with the
Expand All @@ -49,10 +53,11 @@ hdr.ethernet.src_mac_addr:
}
size = MAC_TABLE_SIZE;
default_action = act_bridge_miss();
counters = statsRx;
}

action act_set_bridge_out(SubIntId_t port) {
stats.count();
statsTx.count();
ig_md.bridge_trg = port;
ig_md.target_id = port;
}
Expand All @@ -61,7 +66,7 @@ hdr.ethernet.src_mac_addr:


action act_set_bridge_routed(NextHopId_t nexthop) {
stats.count();
statsTx.count();
ig_md.bridge_trg = MAX_PORT;
ig_md.vrf = 0;
#ifdef HAVE_NSH
Expand Down Expand Up @@ -91,7 +96,7 @@ hdr.ethernet.src_mac_addr:

#ifdef HAVE_MPLS
action act_set_bridge_vpls(NextHopId_t port, label_t lab_tun, label_t lab_svc) {
stats.count();
statsTx.count();
ig_md.bridge_trg = MAX_PORT;
ig_md.mpls0_remove = 0;
ig_md.mpls1_remove = 0;
Expand All @@ -106,7 +111,7 @@ hdr.ethernet.src_mac_addr:

#ifdef HAVE_VXLAN
action act_set_bridge_vxlan4(NextHopId_t nexthop, ipv4_addr_t dst_ip_addr, ipv4_addr_t src_ip_addr, bit<24> instance) {
stats.count();
statsTx.count();
ig_md.bridge_trg = MAX_PORT;
ig_md.vrf = 0;
#ifdef HAVE_NSH
Expand Down Expand Up @@ -159,7 +164,7 @@ hdr.ethernet.src_mac_addr:

#ifdef HAVE_VXLAN
action act_set_bridge_vxlan6(NextHopId_t nexthop, ipv6_addr_t dst_ip_addr, ipv6_addr_t src_ip_addr, bit<24> instance) {
stats.count();
statsTx.count();
ig_md.bridge_trg = MAX_PORT;
ig_md.vrf = 0;
#ifdef HAVE_NSH
Expand Down Expand Up @@ -209,7 +214,7 @@ hdr.ethernet.src_mac_addr:

#ifdef HAVE_PCKOUDP
action act_set_bridge_pckoudp4(NextHopId_t nexthop, ipv4_addr_t dst_ip_addr, ipv4_addr_t src_ip_addr, bit<16> src_port, bit<16> dst_port) {
stats.count();
statsTx.count();
ig_md.bridge_trg = MAX_PORT;
ig_md.vrf = 0;
#ifdef HAVE_NSH
Expand Down Expand Up @@ -257,7 +262,7 @@ hdr.ethernet.src_mac_addr:

#ifdef HAVE_PCKOUDP
action act_set_bridge_pckoudp6(NextHopId_t nexthop, ipv6_addr_t dst_ip_addr, ipv6_addr_t src_ip_addr, bit<16> src_port, bit<16> dst_port) {
stats.count();
statsTx.count();
ig_md.bridge_trg = MAX_PORT;
ig_md.vrf = 0;
#ifdef HAVE_NSH
Expand Down Expand Up @@ -300,7 +305,7 @@ hdr.ethernet.src_mac_addr:


action act_bridge_punt() {
stats.count();
statsTx.count();
ig_md.bridge_trg = 0;
ig_md.nexthop_id = CPU_PORT;
// Packets sent to the controller needs to be prepended with the
Expand Down Expand Up @@ -334,7 +339,7 @@ hdr.ethernet.dst_mac_addr:
}
size = MAC_TABLE_SIZE;
default_action = act_bridge_punt();
counters = stats;
counters = statsTx;
}

apply {
Expand Down
7 changes: 5 additions & 2 deletions misc/p4lang/include/ig_ctl_bridge.p4
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ control IngressControlBridge(inout headers hdr,
inout ingress_metadata_t ig_md,
inout standard_metadata_t ig_intr_md) {

direct_counter(CounterType.packets_and_bytes) stats;
direct_counter(CounterType.packets_and_bytes) statsRx;

direct_counter(CounterType.packets_and_bytes) statsTx;

action send_to_cpu() {
ig_md.nexthop_id = CPU_PORT;
Expand Down Expand Up @@ -52,6 +54,7 @@ hdr.ethernet.src_mac_addr:
}
size = MAC_TABLE_SIZE;
default_action = act_bridge_miss();
counters = statsRx;
}


Expand Down Expand Up @@ -363,7 +366,7 @@ hdr.ethernet.dst_mac_addr:
}
size = MAC_TABLE_SIZE;
default_action = act_bridge_punt();
counters = stats;
counters = statsTx;
}


Expand Down
2 changes: 1 addition & 1 deletion src/rtr.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
url;file;result;test
-;-;-;freeRouter v22.2.2-cur, done by cs@nop.
-;-;-;2022-02-02 15:28:42, took 00:07:12, with 100 workers, on 2654 cases, 0 failed, 0 traces, 4 retries
-;-;-;2022-02-02 15:41:47, took 00:06:25, with 100 workers, on 2654 cases, 0 failed, 0 traces, 4 retries
-;-;-;./rtr.bin
http://sources.nop.hu/cfg/basic.tst;basic.tst;success;dummy test
http://sources.nop.hu/cfg/conn-amt01.tst;conn-amt01.tst;success;amt over ipv4
Expand Down
2 changes: 1 addition & 1 deletion src/rtr.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</style>
<title>tester</title></head><body>
release: freeRouter v22.2.2-cur, done by cs@nop.<br/>
tested: 2022-02-02 15:28:42, took 00:07:12, with 100 workers, on 2654 cases, 0 failed, 0 traces, 4 retries<br/>
tested: 2022-02-02 15:41:47, took 00:06:25, with 100 workers, on 2654 cases, 0 failed, 0 traces, 4 retries<br/>
jvm: ./rtr.bin<br/>
<br/>
<table><thead><tr><td><b>file</b></td><td><b>result</b></td><td><b>test</b></td></tr></thead><tbody>
Expand Down

0 comments on commit 4377a3d

Please sign in to comment.