Skip to content

Commit 03cdcf6

Browse files
committed
[FRR]: Bring FPM fixes from FRR mainline
Bring the following fix from FRR mainline and apply to dplane_fpm_sonic: - zebra: On dplane failure to write ctx, let zebra know (FRRouting@a1ce6a4) Signed-off-by: Yuqing Zhao <[email protected]>
1 parent c1c774b commit 03cdcf6

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/sonic-frr/dplane_fpm_sonic/dplane_fpm_sonic.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2345,6 +2345,7 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx)
23452345
zlog_err(
23462346
"%s: netlink_srv6_msg_encode failed",
23472347
__func__);
2348+
dplane_ctx_set_status(ctx, ZEBRA_DPLANE_REQUEST_FAILURE);
23482349
return 0;
23492350
}
23502351
} else {
@@ -2355,6 +2356,7 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx)
23552356
zlog_err(
23562357
"%s: netlink_route_multipath_msg_encode failed",
23572358
__func__);
2359+
dplane_ctx_set_status(ctx, ZEBRA_DPLANE_REQUEST_FAILURE);
23582360
return 0;
23592361
}
23602362
}
@@ -2376,6 +2378,7 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx)
23762378
zlog_err(
23772379
"%s: netlink_srv6_msg_encode failed",
23782380
__func__);
2381+
dplane_ctx_set_status(ctx, ZEBRA_DPLANE_REQUEST_FAILURE);
23792382
return 0;
23802383
}
23812384
} else {
@@ -2387,6 +2390,7 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx)
23872390
zlog_err(
23882391
"%s: netlink_route_multipath_msg_encode failed",
23892392
__func__);
2393+
dplane_ctx_set_status(ctx, ZEBRA_DPLANE_REQUEST_FAILURE);
23902394
return 0;
23912395
}
23922396
}
@@ -2401,6 +2405,7 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx)
24012405
if (rv <= 0) {
24022406
zlog_err("%s: netlink_macfdb_update_ctx failed",
24032407
__func__);
2408+
dplane_ctx_set_status(ctx, ZEBRA_DPLANE_REQUEST_FAILURE);
24042409
return 0;
24052410
}
24062411

@@ -2413,6 +2418,7 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx)
24132418
if (rv <= 0) {
24142419
zlog_err("%s: netlink_nexthop_msg_encode failed",
24152420
__func__);
2421+
dplane_ctx_set_status(ctx, ZEBRA_DPLANE_REQUEST_FAILURE);
24162422
return 0;
24172423
}
24182424

@@ -2425,6 +2431,7 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx)
24252431
if (rv <= 0) {
24262432
zlog_err("%s: netlink_nexthop_msg_encode failed",
24272433
__func__);
2434+
dplane_ctx_set_status(ctx, ZEBRA_DPLANE_REQUEST_FAILURE);
24282435
return 0;
24292436
}
24302437

@@ -2437,6 +2444,7 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx)
24372444
zlog_err(
24382445
"%s: netlink_srv6_msg_encode failed",
24392446
__func__);
2447+
dplane_ctx_set_status(ctx, ZEBRA_DPLANE_REQUEST_FAILURE);
24402448
return 0;
24412449
}
24422450
nl_buf_len += (size_t)rv;
@@ -2449,6 +2457,7 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx)
24492457
zlog_err(
24502458
"%s: netlink_srv6_msg_encode failed",
24512459
__func__);
2460+
dplane_ctx_set_status(ctx, ZEBRA_DPLANE_REQUEST_FAILURE);
24522461
return 0;
24532462
}
24542463
nl_buf_len += (size_t)rv;
@@ -2460,6 +2469,7 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx)
24602469
if (rv <= 0) {
24612470
zlog_err("%s: netlink_nexthop_msg_encode failed",
24622471
__func__);
2472+
dplane_ctx_set_status(ctx, ZEBRA_DPLANE_REQUEST_FAILURE);
24632473
return 0;
24642474
}
24652475

@@ -2472,6 +2482,7 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx)
24722482
if (rv <= 0) {
24732483
zlog_err("%s: netlink_pic_context_msg_encode failed",
24742484
__func__);
2485+
dplane_ctx_set_status(ctx, ZEBRA_DPLANE_REQUEST_FAILURE);
24752486
return 0;
24762487
}
24772488

@@ -2484,6 +2495,7 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx)
24842495
if (rv <= 0) {
24852496
zlog_err("%s: netlink_lsp_msg_encoder failed",
24862497
__func__);
2498+
dplane_ctx_set_status(ctx, ZEBRA_DPLANE_REQUEST_FAILURE);
24872499
return 0;
24882500
}
24892501

@@ -2987,7 +2999,6 @@ static void fpm_process_queue(struct event *t)
29872999
/* Account the processed entries. */
29883000
processed_contexts++;
29893001

2990-
dplane_ctx_set_status(ctx, ZEBRA_DPLANE_REQUEST_SUCCESS);
29913002
dplane_provider_enqueue_out_ctx(fnc->prov, ctx);
29923003
}
29933004

0 commit comments

Comments
 (0)