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 Dec 26, 2024
1 parent 2991f7b commit 54757c9
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 76 deletions.
2 changes: 1 addition & 1 deletion misc/native/p4emu_fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -1609,7 +1609,7 @@ void processDataPacket(struct packetContext *ctx, int bufS, int prt) {
memcpy(&bufH[0], &bufD[bufP], 12);
bufP += 12;
bufP += 2;
bridge_ntry.id = mpls_res->bridge;
bridge_ntry.id = mpls_res->port;
goto bridgevpls_rx;
case 6: // punt
doCpuing;
Expand Down
4 changes: 2 additions & 2 deletions misc/native/p4emu_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ int doOneCommand(struct packetContext *ctx, unsigned char* buf) {
mpls_ntry.nexthop = atoi(arg[3]);
mpls_ntry.swap = atoi(arg[5]);
mpls_ntry.push = atoi(arg[6]);
mpls_ntry.ver = 4;
mpls_ntry.ver = 6;
mpls_ntry.command = 9;
if (del == 0) table_del(&mpls_table, &mpls_ntry);
else table_add(&mpls_table, &mpls_ntry);
Expand Down Expand Up @@ -601,7 +601,7 @@ int doOneCommand(struct packetContext *ctx, unsigned char* buf) {
}
if (strcmp(arg[0], "bridgelabel") == 0) {
mpls_ntry.label = atoi(arg[3]);
mpls_ntry.bridge = atoi(arg[2]);
mpls_ntry.port = atoi(arg[2]);
mpls_ntry.command = 5;
if (del == 0) table_del(&mpls_table, &mpls_ntry);
else table_add(&mpls_table, &mpls_ntry);
Expand Down
1 change: 0 additions & 1 deletion misc/native/p4emu_tab.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ struct mpls_entry {
long byte;
int nexthop;
int port;
int bridge;
int vrf;
int ver;
int swap;
Expand Down
42 changes: 21 additions & 21 deletions misc/native/p4xdp_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ struct {
res->byte += bufE - bufD; \
switch (res->cmd) { \
case 1: \
neik = res->hop; \
neik = res->nexthop; \
goto ethtyp_tx; \
case 2: \
break; \
Expand All @@ -190,7 +190,7 @@ struct {
tmp = (res->label1 << 12) | 0x100 | ttl; \
put32msb(bufD, bufP, tmp); \
ethtyp = ETHERTYPE_MPLS_UCAST; \
neik = res->hop; \
neik = res->nexthop; \
goto ethtyp_tx; \
case 4: \
bufP -= 4; \
Expand All @@ -200,7 +200,7 @@ struct {
tmp = (res->label1 << 12) | ttl; \
put32msb(bufD, bufP, tmp); \
ethtyp = ETHERTYPE_MPLS_UCAST; \
neik = res->hop; \
neik = res->nexthop; \
goto ethtyp_tx; \
case 5: \
goto drop; \
Expand All @@ -214,7 +214,7 @@ struct {
bufD[bufP + 1] = ttl; \
put16msb(bufD, bufP + 2, ethtyp); \
__builtin_memcpy(&bufD[bufP + 4], res->polka, 16); \
neik = res->hop; \
neik = res->nexthop; \
ethtyp = ETHERTYPE_POLKA; \
goto ethtyp_tx; \
default: \
Expand Down Expand Up @@ -255,7 +255,7 @@ struct {

#define switchMpls() \
case 2: \
neik = resm->hop; \
neik = resm->nexthop; \
if ((tmp & 0x100) == 0) { \
bufD[bufP + 3] = ttl; \
goto ethtyp_tx; \
Expand All @@ -274,7 +274,7 @@ struct {
bufP -= 4; \
label = (tmp & 0xf00) | ttl | (resm->swap << 12); \
put32msb(bufD, bufP, label); \
neik = resm->hop; \
neik = resm->nexthop; \
goto ethtyp_tx; \
case 4: \
revalidatePacket(bufP + 14); \
Expand All @@ -288,7 +288,7 @@ struct {
bufP += 12; \
ethtyp = get16msb(bufD, bufP); \
bufP += 2; \
tmp = resm->brdg; \
tmp = resm->port; \
goto bridge_rx; \
case 6: \
bufP -= 4; \
Expand All @@ -297,14 +297,14 @@ struct {
bufP -= 4; \
label = (tmp & 0xe00) | ttl | (resm->swap << 12); \
put32msb(bufD, bufP, label); \
neik = resm->hop; \
neik = resm->nexthop; \
goto ethtyp_tx; \
case 7: \
goto cpu; \
case 8: \
if (bpf_xdp_adjust_head(ctx, bufP) != 0) goto drop; \
prt = resm->port; \
continue; \
case 8: \
goto cpu; \
default: \
goto drop;

Expand Down Expand Up @@ -641,7 +641,7 @@ __u32 xdp_router(struct xdp_md *ctx) {
case 1: // route
break;
case 2: // bridge
tmp = vrfp->brdg;
tmp = vrfp->bridge;
switch (ethtyp) {
case ETHERTYPE_IPV4: // ipv4
if (vrfp->pmtud4 > 0) {
Expand Down Expand Up @@ -673,7 +673,7 @@ __u32 xdp_router(struct xdp_md *ctx) {
bufP -= 4;
ttl = 0xff | (vrfp->label1 << 12);
put32msb(bufD, bufP, ttl);
neik = vrfp->hop;
neik = vrfp->nexthop;
goto ethtyp_tx;
case 4: // loconnifc
prt = vrfp->label1;
Expand Down Expand Up @@ -751,7 +751,7 @@ __u32 xdp_router(struct xdp_md *ctx) {
struct routes_res* res4 = bpf_map_lookup_elem(&routes4, &rou4);
if (res4 == NULL) goto punt;
if (vrfp->verify4 > 1) {
neik = res4->hop;
neik = res4->nexthop;
struct neigh_res* neir = bpf_map_lookup_elem(&neighs, &neik);
if (neir == NULL) goto punt;
if (neir->aclport != prt) goto punt;
Expand Down Expand Up @@ -793,7 +793,7 @@ __u32 xdp_router(struct xdp_md *ctx) {
struct routes_res* res6 = bpf_map_lookup_elem(&routes6, &rou6);
if (res6 == NULL) goto punt;
if (vrfp->verify6 > 1) {
neik = res6->hop;
neik = res6->nexthop;
struct neigh_res* neir = bpf_map_lookup_elem(&neighs, &neik);
if (neir == NULL) goto punt;
if (neir->aclport != prt) goto punt;
Expand Down Expand Up @@ -947,7 +947,7 @@ __u32 xdp_router(struct xdp_md *ctx) {
bufP += 12;
ethtyp = get16msb(bufD, bufP);
bufP += 2;
tmp = vrfp->brdg;
tmp = vrfp->bridge;
bridge_rx:
{}
struct bridge_key brdk;
Expand Down Expand Up @@ -984,7 +984,7 @@ __u32 xdp_router(struct xdp_md *ctx) {
bufP -= 4;
tmp = 0xff | (brdr->label1 << 12);
put32msb(bufD, bufP, tmp);
neik = brdr->hop;
neik = brdr->nexthop;
goto ethtyp_tx;
case 3: // routed
bufP -= 12;
Expand All @@ -994,7 +994,7 @@ __u32 xdp_router(struct xdp_md *ctx) {
revalidatePacket(3 * sizeof(macaddr));
__builtin_memcpy(&bufD[bufP], &macaddr[0], sizeof(macaddr));
ethtyp = ETHERTYPE_ROUTEDMAC;
neik = brdr->hop;
neik = brdr->nexthop;
goto ethtyp_tx;
case 4: // pckoudp4
bufP -= 12;
Expand All @@ -1006,7 +1006,7 @@ __u32 xdp_router(struct xdp_md *ctx) {
putUdpHeader(brdr);
putIpv4header(brdr, IP_PROTOCOL_UDP);
bufP += 2;
neik = brdr->hop;
neik = brdr->nexthop;
goto ethtyp_tx;
case 5: // pckoudp6
bufP -= 12;
Expand All @@ -1018,7 +1018,7 @@ __u32 xdp_router(struct xdp_md *ctx) {
putUdpHeader(brdr);
putIpv6header(brdr, IP_PROTOCOL_UDP);
bufP += 2;
neik = brdr->hop;
neik = brdr->nexthop;
goto ethtyp_tx;
case 6: // vxlan4
bufP -= 12;
Expand All @@ -1031,7 +1031,7 @@ __u32 xdp_router(struct xdp_md *ctx) {
putUdpHeader(brdr);
putIpv4header(brdr, IP_PROTOCOL_UDP);
bufP += 2;
neik = brdr->hop;
neik = brdr->nexthop;
goto ethtyp_tx;
case 7: // vxlan6
bufP -= 12;
Expand All @@ -1044,7 +1044,7 @@ __u32 xdp_router(struct xdp_md *ctx) {
putUdpHeader(brdr);
putIpv6header(brdr, IP_PROTOCOL_UDP);
bufP += 2;
neik = brdr->hop;
neik = brdr->nexthop;
goto ethtyp_tx;
default:
goto drop;
Expand Down
22 changes: 12 additions & 10 deletions misc/native/p4xdp_krno.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ struct {
res->byte += bufE - bufD; \
switch (res->cmd) { \
case 1: \
neik = res->hop; \
neik = res->nexthop; \
goto ethtyp_tx; \
case 2: \
goto cpu; \
Expand All @@ -190,7 +190,7 @@ struct {
tmp = (res->label1 << 12) | 0x100 | ttl; \
put32msb(bufD, bufP, tmp); \
ethtyp = ETHERTYPE_MPLS_UCAST; \
neik = res->hop; \
neik = res->nexthop; \
goto ethtyp_tx; \
case 4: \
bufP -= 4; \
Expand All @@ -200,7 +200,7 @@ struct {
tmp = (res->label1 << 12) | ttl; \
put32msb(bufD, bufP, tmp); \
ethtyp = ETHERTYPE_MPLS_UCAST; \
neik = res->hop; \
neik = res->nexthop; \
goto ethtyp_tx; \
case 5: \
goto drop; \
Expand Down Expand Up @@ -242,7 +242,7 @@ struct {

#define switchMpls() \
case 2: \
neik = resm->hop; \
neik = resm->nexthop; \
if ((tmp & 0x100) == 0) { \
bufD[bufP + 3] = ttl; \
goto ethtyp_tx; \
Expand All @@ -261,7 +261,7 @@ struct {
bufP -= 4; \
label = (tmp & 0xf00) | ttl | (resm->swap << 12); \
put32msb(bufD, bufP, label); \
neik = resm->hop; \
neik = resm->nexthop; \
goto ethtyp_tx; \
case 4: \
revalidatePacket(bufP + 14); \
Expand All @@ -275,7 +275,7 @@ struct {
bufP += 12; \
ethtyp = get16msb(bufD, bufP); \
bufP += 2; \
tmp = resm->brdg; \
tmp = resm->port; \
goto bridge_rx; \
case 6: \
bufP -= 4; \
Expand All @@ -284,8 +284,10 @@ struct {
bufP -= 4; \
label = (tmp & 0xe00) | ttl | (resm->swap << 12); \
put32msb(bufD, bufP, label); \
neik = resm->hop; \
neik = resm->nexthop; \
goto ethtyp_tx; \
case 7: \
goto cpu; \
default: \
goto drop;

Expand Down Expand Up @@ -414,7 +416,7 @@ __u32 xdp_router(struct xdp_md *ctx) {
case 1: // route
break;
case 2: // bridge
tmp = vrfp->brdg;
tmp = vrfp->bridge;
goto bridge_rx;
case 3: // xconn
bufP -= 2;
Expand All @@ -431,7 +433,7 @@ __u32 xdp_router(struct xdp_md *ctx) {
bufP -= 4;
ttl = 0xff | (vrfp->label1 << 12);
put32msb(bufD, bufP, ttl);
neik = vrfp->hop;
neik = vrfp->nexthop;
goto ethtyp_tx;
case 4: // loconn
prt = vrfp->label1;
Expand Down Expand Up @@ -558,7 +560,7 @@ __u32 xdp_router(struct xdp_md *ctx) {
bufP -= 4;
tmp = 0xff | (brdr->label1 << 12);
put32msb(bufD, bufP, tmp);
neik = brdr->hop;
neik = brdr->nexthop;
goto ethtyp_tx;
default:
goto drop;
Expand Down
Loading

0 comments on commit 54757c9

Please sign in to comment.