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 Jan 27, 2025
1 parent b425e83 commit f54b6ed
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 42 deletions.
6 changes: 3 additions & 3 deletions misc/native/p4emu_fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
43 changes: 20 additions & 23 deletions misc/native/p4emu_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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; i<vlanout_table.size; i++) {
struct vlanout_entry *ontry = table_get(&vlanout_table, i);
struct vlanin_entry ival;
if (ontry->port2 != 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);
Expand Down Expand Up @@ -3243,8 +3240,8 @@ void doMainLoop() {
case 'v':
case 'V':
printf(" id vlan port\n");
for (int i=0; i<vlanin_table.size; i++) {
struct vlanin_entry *ntry = table_get(&vlanin_table, i);
for (int i=0; i<vlanout_table.size; i++) {
struct vlanout_entry *ntry = table_get(&vlanout_table, i);
printf("%10i %10i %10i\n", ntry->id, ntry->vlan, ntry->port);
}
break;
Expand Down
23 changes: 11 additions & 12 deletions misc/native/p4emu_tab.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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;
}

Expand All @@ -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);
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
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 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
Expand Down
2 changes: 1 addition & 1 deletion src/rtr.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</style>
<title>tester</title></head><body>
release: freeRouter v25.1.27-cur, done by sprscc13@mrn0b0dy.<br/>
tested: 2025-01-27 18:50:29, took 00:15:29, with 50 workers, on 3634 cases, 0 failed, 0 traces, 1 retries<br/>
tested: 2025-01-27 19:20:50, took 00:15:02, with 50 workers, on 3634 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
2 changes: 1 addition & 1 deletion src/rtr8.csv
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/rtr8.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</style>
<title>tester</title></head><body>
release: freeRouter v25.1.27-cur, done by sprscc13@mrn0b0dy.<br/>
tested: 2025-01-27 19:01:11, took 00:10:18, with 50 workers, on 700 cases, 0 failed, 0 traces, 0 retries<br/>
tested: 2025-01-27 19:34:08, took 00:12:55, with 50 workers, on 700 cases, 0 failed, 0 traces, 1 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 f54b6ed

Please sign in to comment.