From f54b6ed8d0f2da8a46d7cd0f5982a9ba22352c7a Mon Sep 17 00:00:00 2001 From: mc36 Date: Mon, 27 Jan 2025 20:35:13 +0100 Subject: [PATCH] automatic commit at releng box --- misc/native/p4emu_fwd.h | 6 +++--- misc/native/p4emu_msg.h | 43 +++++++++++++++++++---------------------- misc/native/p4emu_tab.h | 23 +++++++++++----------- src/rtr.csv | 2 +- src/rtr.html | 2 +- src/rtr8.csv | 2 +- src/rtr8.html | 2 +- 7 files changed, 38 insertions(+), 42 deletions(-) diff --git a/misc/native/p4emu_fwd.h b/misc/native/p4emu_fwd.h index d7eb4c98fb..1d6ded3fa0 100644 --- a/misc/native/p4emu_fwd.h +++ b/misc/native/p4emu_fwd.h @@ -1661,16 +1661,16 @@ void processDataPacket(struct packetContext *ctx, int bufS, int prt) { } doDropper; case ETHERTYPE_VLAN: // dot1q + if (port2vrf_res == NULL) doDropper; ctx->stat->packVlan++; ctx->stat->byteVlan += bufS; ttl = get16msb(bufD, bufP) & 0xfff; ctx->hash ^= ttl; - vlanin_ntry.port = prt; vlanin_ntry.vlan = ttl; bufP += 2; - index = table_find(&vlanin_table, &vlanin_ntry); + index = table_find(&port2vrf_res->vlanin, &vlanin_ntry); if (index < 0) doDropper; - vlanin_res = table_get(&vlanin_table, index); + vlanin_res = table_get(&port2vrf_res->vlanin, index); prt = vlanin_res->id; vlanin_res->pack++; vlanin_res->byte += bufS; diff --git a/misc/native/p4emu_msg.h b/misc/native/p4emu_msg.h index 5e8bf3d76f..a7499d0317 100644 --- a/misc/native/p4emu_msg.h +++ b/misc/native/p4emu_msg.h @@ -839,23 +839,25 @@ int doOneCommand(struct packetContext *ctx, unsigned char* buf) { return 0; } if (strcmp(arg[0], "portvlan") == 0) { + vlanout_ntry.port = port2vrf_ntry.port = atoi(arg[3]); + port2vrf_res = port2vrf_init(&port2vrf_ntry); vlanout_ntry.id = vlanin_ntry.id = atoi(arg[2]); - vlanout_ntry.port = vlanin_ntry.port = atoi(arg[3]); vlanout_ntry.vlan = vlanin_ntry.vlan = atoi(arg[4]); - if (del == 0) table_del(&vlanin_table, &vlanin_ntry); - else table_add(&vlanin_table, &vlanin_ntry); + if (del == 0) table_del(&port2vrf_res->vlanin, &vlanin_ntry); + else table_add(&port2vrf_res->vlanin, &vlanin_ntry); if (del == 0) table_del(&vlanout_table, &vlanout_ntry); else table_add(&vlanout_table, &vlanout_ntry); return 0; } if (strcmp(arg[0], "portqinq") == 0) { + vlanout_ntry.port2 = port2vrf_ntry.port = atoi(arg[4]); + port2vrf_res = port2vrf_init(&port2vrf_ntry); vlanout_ntry.id = vlanin_ntry.id = atoi(arg[2]); vlanout_ntry.port = atoi(arg[3]); - vlanout_ntry.port2 = vlanin_ntry.port = atoi(arg[4]); vlanout_ntry.vlan2 = atoi(arg[5]); vlanout_ntry.vlan = vlanin_ntry.vlan = atoi(arg[6]); - if (del == 0) table_del(&vlanin_table, &vlanin_ntry); - else table_add(&vlanin_table, &vlanin_ntry); + if (del == 0) table_del(&port2vrf_res->vlanin, &vlanin_ntry); + else table_add(&port2vrf_res->vlanin, &vlanin_ntry); if (del == 0) table_del(&vlanout_table, &vlanout_ntry); else table_add(&vlanout_table, &vlanout_ntry); return 0; @@ -1629,19 +1631,21 @@ int doOneCommand(struct packetContext *ctx, unsigned char* buf) { return 0; } if (strcmp(arg[0], "bundlevlan") == 0) { + port2vrf_ntry.port = atoi(arg[2]); + port2vrf_res = port2vrf_init(&port2vrf_ntry); vlanin_ntry.id = atoi(arg[4]); - vlanin_ntry.port = atoi(arg[2]); vlanin_ntry.vlan = atoi(arg[3]); - if (del == 0) table_del(&vlanin_table, &vlanin_ntry); - else table_add(&vlanin_table, &vlanin_ntry); + if (del == 0) table_del(&port2vrf_res->vlanin, &vlanin_ntry); + else table_add(&port2vrf_res->vlanin, &vlanin_ntry); return 0; } if (strcmp(arg[0], "bundleqinq") == 0) { + port2vrf_ntry.port = atoi(arg[2]); + port2vrf_res = port2vrf_init(&port2vrf_ntry); vlanin_ntry.id = atoi(arg[4]); - vlanin_ntry.port = atoi(arg[2]); vlanin_ntry.vlan = atoi(arg[3]); - if (del == 0) table_del(&vlanin_table, &vlanin_ntry); - else table_add(&vlanin_table, &vlanin_ntry); + if (del == 0) table_del(&port2vrf_res->vlanin, &vlanin_ntry); + else table_add(&port2vrf_res->vlanin, &vlanin_ntry); return 0; } if (strcmp(arg[0], "pppoe") == 0) { @@ -3058,15 +3062,8 @@ void doStatLoop() { fprintf(commandTx, "counter %i 0 0 %li %li 0 0\r\n", ntry->id, ntry->pack, ntry->byte); } for (int i=0; iport2 != 0) ival.port = ontry->port2; - else ival.port = ontry->port; - ival.vlan = ontry->vlan; - int o = table_find(&vlanin_table, &ival); - if (o < 0) continue; - struct vlanin_entry *intry = table_get(&vlanin_table, o); - fprintf(commandTx, "counter %i %li %li %li %li 0 0\r\n", intry->id, intry->pack, intry->byte, ontry->pack, ontry->byte); + struct vlanout_entry *ntry = table_get(&vlanout_table, i); + fprintf(commandTx, "counter %i 0 0 %li %li 0 0\r\n", ntry->id, ntry->pack, ntry->byte); } if ((round % 150) != 0) { fflush(commandTx); @@ -3243,8 +3240,8 @@ void doMainLoop() { case 'v': case 'V': printf(" id vlan port\n"); - for (int i=0; iid, ntry->vlan, ntry->port); } break; diff --git a/misc/native/p4emu_tab.h b/misc/native/p4emu_tab.h index 0d6eb1d8fd..c4a7371c75 100644 --- a/misc/native/p4emu_tab.h +++ b/misc/native/p4emu_tab.h @@ -112,6 +112,7 @@ struct port2vrf_entry { int sgtSet; int sgtTag; struct table_head pppoe; + struct table_head vlanin; #ifndef HAVE_NOCRYPTO int mcscEthtyp; int mcscCrTxKeyLen; @@ -155,6 +156,14 @@ struct pppoe_entry { }; +struct vlanin_entry { + int vlan; + int id; + long pack; + long byte; +}; + + struct port2vrf_entry* port2vrf_init(struct port2vrf_entry *ntry) { int index = table_find(&port2vrf_table, ntry); if (index >= 0) return table_get(&port2vrf_table, index); @@ -164,6 +173,7 @@ struct port2vrf_entry* port2vrf_init(struct port2vrf_entry *ntry) { ntry->monTarget = -1; ntry->sgtSet = -1; table_init(&ntry->pppoe, sizeof(struct pppoe_entry), 1); + table_init(&ntry->vlanin, sizeof(struct vlanin_entry), 1); return ntry; } @@ -173,6 +183,7 @@ void port2vrf_deinit(struct port2vrf_entry *ntry) { if (index < 0) return; ntry = table_get(&port2vrf_table, index); table_deinit(&ntry->pppoe); + table_deinit(&ntry->vlanin); table_del(&port2vrf_table, ntry); } @@ -324,17 +335,6 @@ struct bridge_entry { struct table_head bridge_table; -struct vlanin_entry { - int vlan; - int port; - int id; - long pack; - long byte; -}; - -struct table_head vlanin_table; - - struct vlanout_entry { int id; int vlan; @@ -748,7 +748,6 @@ int initTables() { table_init(&vrf2rib4_table, sizeof(struct vrf2rib_entry), 1); table_init(&vrf2rib6_table, sizeof(struct vrf2rib_entry), 1); table_init(&neigh_table, sizeof(struct neigh_entry), 1); - table_init(&vlanin_table, sizeof(struct vlanin_entry), 2); table_init(&vlanout_table, sizeof(struct vlanout_entry), 1); table_init(&bridge_table, sizeof(struct bridge_entry), 3); table_init(&acls4_table, sizeof(struct acls_entry), 2); diff --git a/src/rtr.csv b/src/rtr.csv index 3d2934a6c4..8bdb536795 100644 --- a/src/rtr.csv +++ b/src/rtr.csv @@ -1,6 +1,6 @@ url;file;result;test -;-;-;freeRouter v25.1.27-cur, done by sprscc13@mrn0b0dy. --;-;-;2025-01-27 18:50:29, took 00:15:29, with 50 workers, on 3634 cases, 0 failed, 0 traces, 1 retries +-;-;-;2025-01-27 19:20:50, took 00:15:02, with 50 workers, on 3634 cases, 0 failed, 0 traces, 4 retries -;-;-;./rtr.bin http://sources.freertr.org/cfg/basic01.tst;basic01.tst;success;dummy test http://sources.freertr.org/cfg/basic02.tst;basic02.tst;success;interface with slot diff --git a/src/rtr.html b/src/rtr.html index 449b9e0cf5..6fcbb1806a 100644 --- a/src/rtr.html +++ b/src/rtr.html @@ -10,7 +10,7 @@ tester release: freeRouter v25.1.27-cur, done by sprscc13@mrn0b0dy.
-tested: 2025-01-27 18:50:29, took 00:15:29, with 50 workers, on 3634 cases, 0 failed, 0 traces, 1 retries
+tested: 2025-01-27 19:20:50, took 00:15:02, with 50 workers, on 3634 cases, 0 failed, 0 traces, 4 retries
jvm: ./rtr.bin

diff --git a/src/rtr8.csv b/src/rtr8.csv index 23c906f33d..e96ff405a5 100644 --- a/src/rtr8.csv +++ b/src/rtr8.csv @@ -1,6 +1,6 @@ url;file;result;test -;-;-;freeRouter v25.1.27-cur, done by sprscc13@mrn0b0dy. --;-;-;2025-01-27 19:01:11, took 00:10:18, with 50 workers, on 700 cases, 0 failed, 0 traces, 0 retries +-;-;-;2025-01-27 19:34:08, took 00:12:55, with 50 workers, on 700 cases, 0 failed, 0 traces, 1 retries -;-;-;./rtr.bin http://sources.freertr.org/cfg/p4lang-acl001.tst;p4lang-acl001.tst;success;p4lang: copp http://sources.freertr.org/cfg/p4lang-acl002.tst;p4lang-acl002.tst;success;p4lang: ingress access list diff --git a/src/rtr8.html b/src/rtr8.html index 1210613b95..7248c0bae9 100644 --- a/src/rtr8.html +++ b/src/rtr8.html @@ -10,7 +10,7 @@ tester release: freeRouter v25.1.27-cur, done by sprscc13@mrn0b0dy.
-tested: 2025-01-27 19:01:11, took 00:10:18, with 50 workers, on 700 cases, 0 failed, 0 traces, 0 retries
+tested: 2025-01-27 19:34:08, took 00:12:55, with 50 workers, on 700 cases, 0 failed, 0 traces, 1 retries
jvm: ./rtr.bin

fileresulttest
fileresulttest