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 28, 2025
1 parent 5eac55b commit f476f4f
Show file tree
Hide file tree
Showing 8 changed files with 195 additions and 216 deletions.
65 changes: 26 additions & 39 deletions misc/native/p4emu_fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -1540,9 +1540,8 @@ void processDataPacket(struct packetContext *ctx, int bufS, int prt) {
bufP += 4;
mpls_ntry.label = (label >> 12) & 0xfffff;
ctx->hash ^= mpls_ntry.label;
index = table_find(&mpls_table, &mpls_ntry);
if (index < 0) doDropper;
mpls_res = table_get(&mpls_table, index);
mpls_res = hasht_find(&mpls_table, &mpls_ntry);
if (mpls_res == NULL) doDropper;
mpls_res->pack++;
mpls_res->byte += bufS;
switch (mpls_res->command) {
Expand Down Expand Up @@ -1665,9 +1664,8 @@ void processDataPacket(struct packetContext *ctx, int bufS, int prt) {
ctx->stat->byteIpv4 += bufS;
vrf2rib_ntry.vrf = port2vrf_res->vrf;
ipv4_rx:
index = table_find(&vrf2rib4_table, &vrf2rib_ntry);
if (index < 0) doDropper;
vrf2rib_res = table_get(&vrf2rib4_table, index);
vrf2rib_res = hasht_find(&vrf2rib4_table, &vrf2rib_ntry);
if (vrf2rib_res == NULL) doDropper;
if ((bufD[bufP + 0] & 0xf0) != 0x40) doDropper;
bufT = bufD[bufP + 0] & 0xf; // ihl
if (bufT < 5) doDropper;
Expand Down Expand Up @@ -1733,9 +1731,8 @@ void processDataPacket(struct packetContext *ctx, int bufS, int prt) {
policer_ntry.vrf = 0;
policer_ntry.meter = aceh_res->nexthop;
policer_ntry.dir = 1;
index = table_find(&policer_table, &policer_ntry);
if (index < 0) doDropper;
policer_res = table_get(&policer_table, index);
policer_res = hasht_find(&policer_table, &policer_ntry);
if (policer_res == NULL) doDropper;
if (policer_res->avail < 1) doDropper;
policer_res->avail -= bufS - bufP + preBuff;
ipv4_qosed:
Expand All @@ -1750,9 +1747,8 @@ void processDataPacket(struct packetContext *ctx, int bufS, int prt) {
policer_ntry.vrf = vrf2rib_ntry.vrf;
policer_ntry.meter = aceh_res->pri;
policer_ntry.dir = 3;
index = table_find(&policer_table, &policer_ntry);
if (index < 0) doDropper;
policer_res = table_get(&policer_table, index);
policer_res = hasht_find(&policer_table, &policer_ntry);
if (policer_res == NULL) doDropper;
if (policer_res->avail < 1) doDropper;
policer_res->avail -= bufS - bufP + preBuff;
ipv4_flwed:
Expand Down Expand Up @@ -1801,9 +1797,8 @@ void processDataPacket(struct packetContext *ctx, int bufS, int prt) {
break;
case 2: // setvrf
vrf2rib_ntry.vrf = aceh_res->vrf;
index = table_find(&vrf2rib4_table, &vrf2rib_ntry);
if (index < 0) doDropper;
vrf2rib_res = table_get(&vrf2rib4_table, index);
vrf2rib_res = hasht_find(&vrf2rib4_table, &vrf2rib_ntry);
if (vrf2rib_res == NULL) doDropper;
break;
case 3: // sethop
vrf2rib_ntry.vrf = aceh_res->vrf;
Expand Down Expand Up @@ -1871,9 +1866,8 @@ void processDataPacket(struct packetContext *ctx, int bufS, int prt) {
policer_ntry.vrf = 0;
policer_ntry.meter = aceh_res->nexthop;
policer_ntry.dir = 2;
index = table_find(&policer_table, &policer_ntry);
if (index < 0) doDropper;
policer_res = table_get(&policer_table, index);
policer_res = hasht_find(&policer_table, &policer_ntry);
if (policer_res == NULL) doDropper;
if (policer_res->avail < 1) doDropper;
policer_res->avail -= bufS - bufP + preBuff;
goto neigh_tx;
Expand Down Expand Up @@ -1926,9 +1920,8 @@ void processDataPacket(struct packetContext *ctx, int bufS, int prt) {
ctx->stat->byteIpv6 += bufS;
vrf2rib_ntry.vrf = port2vrf_res->vrf;
ipv6_rx:
index = table_find(&vrf2rib6_table, &vrf2rib_ntry);
if (index < 0) doDropper;
vrf2rib_res = table_get(&vrf2rib6_table, index);
vrf2rib_res = hasht_find(&vrf2rib6_table, &vrf2rib_ntry);
if (vrf2rib_res == NULL) doDropper;
if ((bufD[bufP + 0] & 0xf0) != 0x60) doDropper;
ttl = get16msb(bufD, bufP + 4) + 40 + bufP - preBuff; // len
if (ttl > bufS) doDropper;
Expand Down Expand Up @@ -2013,9 +2006,8 @@ void processDataPacket(struct packetContext *ctx, int bufS, int prt) {
policer_ntry.vrf = 0;
policer_ntry.meter = aceh_res->nexthop;
policer_ntry.dir = 1;
index = table_find(&policer_table, &policer_ntry);
if (index < 0) doDropper;
policer_res = table_get(&policer_table, index);
policer_res = hasht_find(&policer_table, &policer_ntry);
if (policer_res == NULL) doDropper;
if (policer_res->avail < 1) doDropper;
policer_res->avail -= bufS - bufP + preBuff;
ipv6_qosed:
Expand All @@ -2030,9 +2022,8 @@ void processDataPacket(struct packetContext *ctx, int bufS, int prt) {
policer_ntry.vrf = vrf2rib_ntry.vrf;
policer_ntry.meter = aceh_res->pri;
policer_ntry.dir = 4;
index = table_find(&policer_table, &policer_ntry);
if (index < 0) doDropper;
policer_res = table_get(&policer_table, index);
policer_res = hasht_find(&policer_table, &policer_ntry);
if (policer_res == NULL) doDropper;
if (policer_res->avail < 1) doDropper;
policer_res->avail -= bufS - bufP + preBuff;
ipv6_flwed:
Expand Down Expand Up @@ -2097,9 +2088,8 @@ void processDataPacket(struct packetContext *ctx, int bufS, int prt) {
break;
case 2: // setvrf
vrf2rib_ntry.vrf = aceh_res->vrf;
index = table_find(&vrf2rib6_table, &vrf2rib_ntry);
if (index < 0) doDropper;
vrf2rib_res = table_get(&vrf2rib6_table, index);
vrf2rib_res = hasht_find(&vrf2rib6_table, &vrf2rib_ntry);
if (vrf2rib_res == NULL) doDropper;
break;
case 3: // sethop
vrf2rib_ntry.vrf = aceh_res->vrf;
Expand Down Expand Up @@ -2176,9 +2166,8 @@ void processDataPacket(struct packetContext *ctx, int bufS, int prt) {
policer_ntry.vrf = 0;
policer_ntry.meter = aceh_res->nexthop;
policer_ntry.dir = 2;
index = table_find(&policer_table, &policer_ntry);
if (index < 0) doDropper;
policer_res = table_get(&policer_table, index);
policer_res = hasht_find(&policer_table, &policer_ntry);
if (policer_res == NULL) doDropper;
if (policer_res->avail < 1) doDropper;
policer_res->avail -= bufS - bufP + preBuff;
goto neigh_tx;
Expand Down Expand Up @@ -2355,9 +2344,8 @@ void processDataPacket(struct packetContext *ctx, int bufS, int prt) {
bufD[bufP + 1] = ttl;
vrf2rib_ntry.vrf = port2vrf_res->vrf;
if (bufD[bufP + 0] == 0) {
index = table_find(&vrf2rib4_table, &vrf2rib_ntry);
if (index < 0) doDropper;
vrf2rib_res = table_get(&vrf2rib4_table, index);
vrf2rib_res = hasht_find(&vrf2rib4_table, &vrf2rib_ntry);
if (vrf2rib_res == NULL) doDropper;
polkaPoly_ntry.port = prt;
polkaPoly_res = hasht_find(&polkaPoly_table, &polkaPoly_ntry);
if (polkaPoly_res == NULL) doDropper;
Expand All @@ -2379,9 +2367,8 @@ void processDataPacket(struct packetContext *ctx, int bufS, int prt) {
neigh_ntry.id = polkaIdx_res->nexthop;
goto ethtyp_tx;
}
index = table_find(&vrf2rib6_table, &vrf2rib_ntry);
if (index < 0) doDropper;
vrf2rib_res = table_get(&vrf2rib6_table, index);
vrf2rib_res = hasht_find(&vrf2rib6_table, &vrf2rib_ntry);
if (vrf2rib_res == NULL) doDropper;
polkaPoly_ntry.port = prt;
polkaPoly_res = hasht_find(&mpolkaPoly_table, &polkaPoly_ntry);
if (polkaPoly_res == NULL) doDropper;
Expand Down
Loading

0 comments on commit f476f4f

Please sign in to comment.