Skip to content

Commit 56f9be2

Browse files
committed
zebra: Fix code style comments from frrbot
Signed-off-by: Yuqing Zhao <galadriel.zyq@alibaba-inc.com>
1 parent fbd2102 commit 56f9be2

7 files changed

Lines changed: 87 additions & 100 deletions

File tree

zebra/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ uint32_t rt_table_main_id = RT_TABLE_MAIN;
8383
#define OPTION_ASIC_OFFLOAD 2001
8484
#define OPTION_V6_WITH_V4_NEXTHOP 2002
8585
#define OPTION_NEXTHOP_WEIGHT_16_BIT 2003
86-
#define OPTION_NHG_FIB 2004
86+
#define OPTION_NHG_FIB 2004
8787

8888
/* Command line options. */
8989
const struct option longopts[] = {

zebra/rt_netlink.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3424,10 +3424,9 @@ netlink_put_nexthop_update_msg(struct nl_batch *bth,
34243424
*/
34253425
if (dplane_ctx_is_skip_kernel(ctx)) {
34263426
if (IS_ZEBRA_DEBUG_KERNEL || IS_ZEBRA_DEBUG_NHG) {
3427-
zlog_debug(
3428-
"%s: nhg_id %u (%s): skip flag set, ignoring",
3429-
__func__, dplane_ctx_get_nhe_id(ctx),
3430-
zebra_route_string(dplane_ctx_get_nhe_type(ctx)));
3427+
zlog_debug("%s: nhg_id %u (%s): skip flag set, ignoring", __func__,
3428+
dplane_ctx_get_nhe_id(ctx),
3429+
zebra_route_string(dplane_ctx_get_nhe_type(ctx)));
34313430
}
34323431
return FRR_NETLINK_SUCCESS;
34333432
}

zebra/zebra_dplane.c

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2489,8 +2489,7 @@ uint16_t dplane_ctx_get_nhe_nh_grp_count(const struct zebra_dplane_ctx *ctx)
24892489
return ctx->u.rinfo.nhe.nh_grp_count;
24902490
}
24912491

2492-
const struct nh_grp_full *
2493-
dplane_ctx_get_nhe_nh_grp_full(const struct zebra_dplane_ctx *ctx)
2492+
const struct nh_grp_full *dplane_ctx_get_nhe_nh_grp_full(const struct zebra_dplane_ctx *ctx)
24942493
{
24952494
DPLANE_CTX_VALID(ctx);
24962495
return ctx->u.rinfo.nhe.nh_grp_full;
@@ -2502,7 +2501,7 @@ uint32_t dplane_ctx_get_nhe_nh_grp_full_count(const struct zebra_dplane_ctx *ctx
25022501
return ctx->u.rinfo.nhe.nh_grp_full_count;
25032502
}
25042503

2505-
const uint32_t* dplane_ctx_get_nhe_depends(const struct zebra_dplane_ctx *ctx)
2504+
const uint32_t *dplane_ctx_get_nhe_depends(const struct zebra_dplane_ctx *ctx)
25062505
{
25072506
DPLANE_CTX_VALID(ctx);
25082507
return ctx->u.rinfo.nhe.depends;
@@ -2514,7 +2513,7 @@ uint32_t dplane_ctx_get_nhe_depends_count(const struct zebra_dplane_ctx *ctx)
25142513
return ctx->u.rinfo.nhe.depends_count;
25152514
}
25162515

2517-
const uint32_t* dplane_ctx_get_nhe_dependents(const struct zebra_dplane_ctx *ctx)
2516+
const uint32_t *dplane_ctx_get_nhe_dependents(const struct zebra_dplane_ctx *ctx)
25182517
{
25192518
DPLANE_CTX_VALID(ctx);
25202519
return ctx->u.rinfo.nhe.dependents;
@@ -4248,50 +4247,55 @@ int dplane_ctx_nexthop_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op,
42484247
* recursive case for dplane's FIB convergance handling.
42494248
*/
42504249
if (!zebra_nhg_depends_is_empty(nhe) &&
4251-
(zebra_nhg_fib_enabled ||
4252-
(!zebra_nhg_fib_enabled && !CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_RECURSIVE)))) {
4253-
zlog_debug("%s: NHG id=%u is a group, calling compression functions",
4254-
__func__, nhe->id);
4250+
(zebra_nhg_fib_enabled ||
4251+
(!zebra_nhg_fib_enabled && !CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_RECURSIVE)))) {
4252+
zlog_debug("%s: NHG id=%u is a group, calling compression functions", __func__,
4253+
nhe->id);
42554254
/* nh_grp is for resolved nhe ids */
42564255
ctx->u.rinfo.nhe.nh_grp_count = zebra_nhg_nhe2grp(
42574256
ctx->u.rinfo.nhe.nh_grp, nhe, MULTIPATH_NUM);
42584257

42594258
/* nh_grp_full is for all depends nhe ids, including recursive ones */
4260-
ctx->u.rinfo.nhe.nh_grp_full_count = zebra_nhg_nhe2grp_full(
4261-
ctx->u.rinfo.nhe.nh_grp_full, nhe, MULTIPATH_NUM * MAX_NHG_RECURSION);
4262-
zlog_debug("%s: NHG id=%u full grp_full_count=%u",
4263-
__func__, nhe->id, ctx->u.rinfo.nhe.nh_grp_full_count);
4259+
ctx->u.rinfo.nhe.nh_grp_full_count =
4260+
zebra_nhg_nhe2grp_full(ctx->u.rinfo.nhe.nh_grp_full, nhe,
4261+
MULTIPATH_NUM * MAX_NHG_RECURSION);
4262+
zlog_debug("%s: NHG id=%u full grp_full_count=%u", __func__, nhe->id,
4263+
ctx->u.rinfo.nhe.nh_grp_full_count);
42644264

42654265
if (zebra_nhg_fib_enabled) {
42664266
/* Fill depends array with direct depends IDs */
42674267
ctx->u.rinfo.nhe.depends_count = 0;
42684268
struct nhg_connected *rb_node_dep = NULL;
4269-
frr_each(nhg_connected_tree, &nhe->nhg_depends, rb_node_dep) {
4270-
if (ctx->u.rinfo.nhe.depends_count < array_size(ctx->u.rinfo.nhe.depends)) {
4271-
ctx->u.rinfo.nhe.depends[ctx->u.rinfo.nhe.depends_count] = rb_node_dep->nhe->id;
4269+
frr_each (nhg_connected_tree, &nhe->nhg_depends, rb_node_dep) {
4270+
if (ctx->u.rinfo.nhe.depends_count <
4271+
array_size(ctx->u.rinfo.nhe.depends)) {
4272+
ctx->u.rinfo.nhe.depends[ctx->u.rinfo.nhe.depends_count] =
4273+
rb_node_dep->nhe->id;
42724274
ctx->u.rinfo.nhe.depends_count++;
42734275
}
42744276
}
4275-
zlog_debug("%s: NHG id=%u depends_count=%u",
4276-
__func__, nhe->id, ctx->u.rinfo.nhe.depends_count);
4277+
zlog_debug("%s: NHG id=%u depends_count=%u", __func__, nhe->id,
4278+
ctx->u.rinfo.nhe.depends_count);
42774279
}
42784280
} else {
4279-
zlog_debug("%s: NHG id=%u is singleton or recursive, skip compression",
4280-
__func__, nhe->id);
4281+
zlog_debug("%s: NHG id=%u is singleton or recursive, skip compression", __func__,
4282+
nhe->id);
42814283
}
42824284

42834285
if (zebra_nhg_fib_enabled) {
42844286
/* Fill dependents array with dependent IDs */
42854287
ctx->u.rinfo.nhe.dependents_count = 0;
42864288
struct nhg_connected *rb_node_dependent = NULL;
4287-
frr_each(nhg_connected_tree, &nhe->nhg_dependents, rb_node_dependent) {
4288-
if (ctx->u.rinfo.nhe.dependents_count < array_size(ctx->u.rinfo.nhe.dependents)) {
4289-
ctx->u.rinfo.nhe.dependents[ctx->u.rinfo.nhe.dependents_count] = rb_node_dependent->nhe->id;
4289+
frr_each (nhg_connected_tree, &nhe->nhg_dependents, rb_node_dependent) {
4290+
if (ctx->u.rinfo.nhe.dependents_count <
4291+
array_size(ctx->u.rinfo.nhe.dependents)) {
4292+
ctx->u.rinfo.nhe.dependents[ctx->u.rinfo.nhe.dependents_count] =
4293+
rb_node_dependent->nhe->id;
42904294
ctx->u.rinfo.nhe.dependents_count++;
42914295
}
42924296
}
4293-
zlog_debug("%s: NHG id=%u, %p, dependents_count=%u",
4294-
__func__, nhe->id, nhe, ctx->u.rinfo.nhe.dependents_count);
4297+
zlog_debug("%s: NHG id=%u, %p, dependents_count=%u", __func__, nhe->id, nhe,
4298+
ctx->u.rinfo.nhe.dependents_count);
42954299
}
42964300

42974301
/*
@@ -4301,12 +4305,11 @@ int dplane_ctx_nexthop_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op,
43014305
* (not to kernel), since they represent intermediate routing hops.
43024306
*/
43034307
if (CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_RECEIVED) ||
4304-
(zebra_nhg_fib_enabled &&
4305-
CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_RECURSIVE))) {
4308+
(zebra_nhg_fib_enabled && CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_RECURSIVE))) {
43064309
dplane_ctx_set_skip_kernel(ctx);
43074310
if (IS_ZEBRA_DEBUG_DPLANE_DETAIL) {
43084311
zlog_debug("%s: NHG id=%u is received or recursive (nhg_fib), marking to skip kernel programming",
4309-
__func__, nhe->id);
4312+
__func__, nhe->id);
43104313
}
43114314
}
43124315
zvrf = vrf_info_lookup(nhe->vrf_id);
@@ -5094,9 +5097,8 @@ dplane_nexthop_update_internal(struct nhg_hash_entry *nhe, enum dplane_op_e op)
50945097
}
50955098

50965099
zlog_debug("%s: NHG id=%u flags=0x%x enqueuing to dplane, nh_grp_count=%u, nh_grp_full_count=%u",
5097-
__func__, nhe->id, nhe->flags,
5098-
ctx->u.rinfo.nhe.nh_grp_count,
5099-
ctx->u.rinfo.nhe.nh_grp_full_count);
5100+
__func__, nhe->id, nhe->flags, ctx->u.rinfo.nhe.nh_grp_count,
5101+
ctx->u.rinfo.nhe.nh_grp_full_count);
51005102

51015103
ret = dplane_update_enqueue(ctx);
51025104
}

zebra/zebra_dplane.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -642,12 +642,11 @@ dplane_ctx_get_nhe_ng(const struct zebra_dplane_ctx *ctx);
642642
const struct nh_grp *
643643
dplane_ctx_get_nhe_nh_grp(const struct zebra_dplane_ctx *ctx);
644644
uint16_t dplane_ctx_get_nhe_nh_grp_count(const struct zebra_dplane_ctx *ctx);
645-
const struct nh_grp_full *
646-
dplane_ctx_get_nhe_nh_grp_full(const struct zebra_dplane_ctx *ctx);
645+
const struct nh_grp_full *dplane_ctx_get_nhe_nh_grp_full(const struct zebra_dplane_ctx *ctx);
647646
uint32_t dplane_ctx_get_nhe_nh_grp_full_count(const struct zebra_dplane_ctx *ctx);
648-
const uint32_t* dplane_ctx_get_nhe_depends(const struct zebra_dplane_ctx *ctx);
647+
const uint32_t *dplane_ctx_get_nhe_depends(const struct zebra_dplane_ctx *ctx);
649648
uint32_t dplane_ctx_get_nhe_depends_count(const struct zebra_dplane_ctx *ctx);
650-
const uint32_t* dplane_ctx_get_nhe_dependents(const struct zebra_dplane_ctx *ctx);
649+
const uint32_t *dplane_ctx_get_nhe_dependents(const struct zebra_dplane_ctx *ctx);
651650
uint32_t dplane_ctx_get_nhe_dependents_count(const struct zebra_dplane_ctx *ctx);
652651

653652
/* Accessors for LSP information */

zebra/zebra_nhg.c

Lines changed: 42 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3475,8 +3475,8 @@ static bool is_srv6_nhg(struct nhg_hash_entry *nhe)
34753475
* but with recursive ones to keep depending relations.
34763476
*/
34773477
static uint32_t zebra_nhg_nhe2grp_full_internal(struct nh_grp_full *grp_full, uint32_t curr_index,
3478-
struct nhg_hash_entry *nhe, struct nhg_hash_entry *original,
3479-
uint32_t max_num)
3478+
struct nhg_hash_entry *nhe,
3479+
struct nhg_hash_entry *original, uint32_t max_num)
34803480
{
34813481
struct nhg_connected *rb_node_dep = NULL;
34823482
struct nhg_hash_entry *curr_node = NULL;
@@ -3487,10 +3487,9 @@ static uint32_t zebra_nhg_nhe2grp_full_internal(struct nh_grp_full *grp_full, ui
34873487
* We only write its direct depends in the array.
34883488
*/
34893489
/* go through all depends from current node */
3490-
frr_each(nhg_connected_tree, &nhe->nhg_depends, rb_node_dep) {
3490+
frr_each (nhg_connected_tree, &nhe->nhg_depends, rb_node_dep) {
34913491
if (i >= max_num) {
3492-
zlog_err("%s: BREAK: i=%u >= max_num=%u",
3493-
__func__, i, max_num);
3492+
zlog_err("%s: BREAK: i=%u >= max_num=%u", __func__, i, max_num);
34943493
goto done;
34953494
}
34963495

@@ -3500,39 +3499,31 @@ static uint32_t zebra_nhg_nhe2grp_full_internal(struct nh_grp_full *grp_full, ui
35003499
* and we will put in installed or queued ones (same logic as zebra_nhg_nhe2grp_internal).
35013500
* If it's a invalid nhg for normal case, skip
35023501
*/
3503-
if (!is_srv6_nhg(curr_node)
3504-
&& !CHECK_FLAG(curr_node->flags, NEXTHOP_GROUP_VALID)) {
3505-
if (IS_ZEBRA_DEBUG_RIB_DETAILED
3506-
|| IS_ZEBRA_DEBUG_NHG)
3507-
zlog_debug(
3508-
"%s: NHG ID (%u) not valid as a normal case, not appending to dplane install group",
3509-
__func__, curr_node->id);
3502+
if (!is_srv6_nhg(curr_node) && !CHECK_FLAG(curr_node->flags, NEXTHOP_GROUP_VALID)) {
3503+
if (IS_ZEBRA_DEBUG_RIB_DETAILED || IS_ZEBRA_DEBUG_NHG)
3504+
zlog_debug("%s: NHG ID (%u) not valid as a normal case, not appending to dplane install group",
3505+
__func__, curr_node->id);
35103506
continue;
35113507
}
35123508

35133509
/* Recursive NHGs are never installed to kernel, only require VALID.
35143510
* Non-recursive (leaf) NHGs must be INSTALLED or QUEUED to be included.
35153511
*/
3516-
if (!is_srv6_nhg(curr_node)
3517-
&& !CHECK_FLAG(curr_node->flags, NEXTHOP_GROUP_RECURSIVE)
3518-
&& !(CHECK_FLAG(curr_node->flags, NEXTHOP_GROUP_INSTALLED) ||
3519-
CHECK_FLAG(curr_node->flags, NEXTHOP_GROUP_QUEUED)))
3520-
{
3521-
if (IS_ZEBRA_DEBUG_RIB_DETAILED
3522-
|| IS_ZEBRA_DEBUG_NHG)
3523-
zlog_debug(
3524-
"%s: NHG ID (%u) not installed or queued as a normal case, not appending to dplane install group",
3525-
__func__, curr_node->id);
3512+
if (!is_srv6_nhg(curr_node) &&
3513+
!CHECK_FLAG(curr_node->flags, NEXTHOP_GROUP_RECURSIVE) &&
3514+
!(CHECK_FLAG(curr_node->flags, NEXTHOP_GROUP_INSTALLED) ||
3515+
CHECK_FLAG(curr_node->flags, NEXTHOP_GROUP_QUEUED))) {
3516+
if (IS_ZEBRA_DEBUG_RIB_DETAILED || IS_ZEBRA_DEBUG_NHG)
3517+
zlog_debug("%s: NHG ID (%u) not installed or queued as a normal case, not appending to dplane install group",
3518+
__func__, curr_node->id);
35263519
continue;
35273520
}
35283521

35293522
/* If it's queued, we just log but not skip */
35303523
if (CHECK_FLAG(curr_node->flags, NEXTHOP_GROUP_QUEUED)) {
3531-
if (IS_ZEBRA_DEBUG_RIB_DETAILED
3532-
|| IS_ZEBRA_DEBUG_NHG)
3533-
zlog_debug(
3534-
"%s: NUG ID (%u) queued, dependency being installed, we add it to nh_grp_full array.",
3535-
__func__, curr_node->id);
3524+
if (IS_ZEBRA_DEBUG_RIB_DETAILED || IS_ZEBRA_DEBUG_NHG)
3525+
zlog_debug("%s: NUG ID (%u) queued, dependency being installed, we add it to nh_grp_full array.",
3526+
__func__, curr_node->id);
35363527
}
35373528

35383529
if (!zebra_nhg_depends_is_empty(curr_node)) {
@@ -3543,14 +3534,18 @@ static uint32_t zebra_nhg_nhe2grp_full_internal(struct nh_grp_full *grp_full, ui
35433534
struct nhg_connected *sub_rb_node = NULL;
35443535

35453536
/* Count how many sub-depends this node has */
3546-
frr_each(nhg_connected_tree, &curr_node->nhg_depends, sub_rb_node) {
3537+
frr_each (nhg_connected_tree, &curr_node->nhg_depends,
3538+
sub_rb_node) {
35473539
/* Apply same filters as main loop */
3548-
if (!is_srv6_nhg(sub_rb_node->nhe)
3549-
&& !CHECK_FLAG(sub_rb_node->nhe->flags, NEXTHOP_GROUP_VALID))
3540+
if (!is_srv6_nhg(sub_rb_node->nhe) &&
3541+
!CHECK_FLAG(sub_rb_node->nhe->flags,
3542+
NEXTHOP_GROUP_VALID))
35503543
continue;
3551-
if (!is_srv6_nhg(sub_rb_node->nhe)
3552-
&& !(CHECK_FLAG(sub_rb_node->nhe->flags, NEXTHOP_GROUP_INSTALLED) ||
3553-
CHECK_FLAG(sub_rb_node->nhe->flags, NEXTHOP_GROUP_QUEUED)))
3544+
if (!is_srv6_nhg(sub_rb_node->nhe) &&
3545+
!(CHECK_FLAG(sub_rb_node->nhe->flags,
3546+
NEXTHOP_GROUP_INSTALLED) ||
3547+
CHECK_FLAG(sub_rb_node->nhe->flags,
3548+
NEXTHOP_GROUP_QUEUED)))
35543549
continue;
35553550

35563551
sub_depend_count++;
@@ -3564,22 +3559,20 @@ static uint32_t zebra_nhg_nhe2grp_full_internal(struct nh_grp_full *grp_full, ui
35643559
}
35653560

35663561
/* Then, recursively write its sub-depends */
3567-
i = zebra_nhg_nhe2grp_full_internal(grp_full, i, curr_node, original, max_num);
3568-
}
3569-
else {
3562+
i = zebra_nhg_nhe2grp_full_internal(grp_full, i, curr_node, original,
3563+
max_num);
3564+
} else {
35703565
/* Go through the resolved nexthops to get weight,
35713566
* but we do not use this to determine if put in this node.
35723567
* We put in all depends nodes, and set the state flag of them.
35733568
*/
35743569
bool found = false;
35753570

35763571
for (ALL_NEXTHOPS_PTR(&original->nhg, nexthop)) {
3577-
if (CHECK_FLAG(nexthop->flags,
3578-
NEXTHOP_FLAG_RECURSIVE))
3572+
if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
35793573
continue;
35803574

3581-
if (nexthop_cmp_no_weight(curr_node->nhg.nexthop,
3582-
nexthop) != 0)
3575+
if (nexthop_cmp_no_weight(curr_node->nhg.nexthop, nexthop) != 0)
35833576
continue;
35843577

35853578
found = true;
@@ -3590,8 +3583,7 @@ static uint32_t zebra_nhg_nhe2grp_full_internal(struct nh_grp_full *grp_full, ui
35903583
* that means it's not a valid nhg and we record it.
35913584
*/
35923585
if (!found) {
3593-
if (IS_ZEBRA_DEBUG_RIB_DETAILED ||
3594-
IS_ZEBRA_DEBUG_NHG)
3586+
if (IS_ZEBRA_DEBUG_RIB_DETAILED || IS_ZEBRA_DEBUG_NHG)
35953587
zlog_debug("%s: Nexthop ID (%u) unable to find nexthop in Nexthop Group Entry, something is terribly wrong",
35963588
__func__, curr_node->id);
35973589
}
@@ -3612,22 +3604,19 @@ static uint32_t zebra_nhg_nhe2grp_full_internal(struct nh_grp_full *grp_full, ui
36123604
zlog_debug("%s: skipping backup nhe", __func__);
36133605

36143606
done:
3615-
zlog_debug("%s: dumping grp_full array from [%u] to [%u]:",
3616-
__func__, curr_index, i > 0 ? i - 1 : 0);
3607+
zlog_debug("%s: dumping grp_full array from [%u] to [%u]:", __func__, curr_index,
3608+
i > 0 ? i - 1 : 0);
36173609
for (uint32_t idx = curr_index; idx < i && idx < max_num; idx++) {
3618-
zlog_debug("%s: grp_full[%u] = {id=%u, weight=%u, num_direct=%u}",
3619-
__func__, idx,
3620-
grp_full[idx].id,
3621-
grp_full[idx].weight,
3622-
grp_full[idx].num_direct);
3610+
zlog_debug("%s: grp_full[%u] = {id=%u, weight=%u, num_direct=%u}", __func__, idx,
3611+
grp_full[idx].id, grp_full[idx].weight, grp_full[idx].num_direct);
36233612
}
36243613

36253614
return i;
36263615
}
36273616

36283617
/* Convert a nhe into a group array with full depends */
3629-
uint32_t zebra_nhg_nhe2grp_full(struct nh_grp_full *grp_full,
3630-
struct nhg_hash_entry *nhe, uint32_t max_num)
3618+
uint32_t zebra_nhg_nhe2grp_full(struct nh_grp_full *grp_full, struct nhg_hash_entry *nhe,
3619+
uint32_t max_num)
36313620
{
36323621
/* Call into the recursive function */
36333622
return zebra_nhg_nhe2grp_full_internal(grp_full, 0, nhe, nhe, max_num);
@@ -3654,7 +3643,7 @@ void zebra_nhg_mark_received_flag(struct nhg_hash_entry *nhe)
36543643
zlog_debug("%s: Marking nhg %pNG as received", __func__, nhe);
36553644
}
36563645
/* Make sure all depends are marked as well*/
3657-
frr_each(nhg_connected_tree, &nhe->nhg_depends, rb_node_dep) {
3646+
frr_each (nhg_connected_tree, &nhe->nhg_depends, rb_node_dep) {
36583647
zebra_nhg_mark_received_flag(rb_node_dep->nhe);
36593648
}
36603649
}
@@ -3671,8 +3660,7 @@ void zebra_nhg_install_kernel(struct nhg_hash_entry *nhe, uint8_t type)
36713660
* as-is (with their recursive nexthop address) for backwalk support.
36723661
*/
36733662
if (!CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_RECEIVED) &&
3674-
!(zebra_nhg_fib_enabled &&
3675-
CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_RECURSIVE))) {
3663+
!(zebra_nhg_fib_enabled && CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_RECURSIVE))) {
36763664
if (IS_ZEBRA_DEBUG_NHG_DETAIL)
36773665
zlog_debug("%s: resolving nhg %pNG before install since it is not marked as received",
36783666
__func__, nhe);

zebra/zebra_nhg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,8 @@ extern void zebra_nhg_check_valid(struct nhg_hash_entry *nhe);
403403
extern uint16_t zebra_nhg_nhe2grp(struct nh_grp *grp, struct nhg_hash_entry *nhe, int size);
404404

405405
/* Convert nhe full depends to a grp context that can be passed around safely */
406-
extern uint32_t zebra_nhg_nhe2grp_full(struct nh_grp_full *grp_full,
407-
struct nhg_hash_entry *nhe, uint32_t max_num);
406+
extern uint32_t zebra_nhg_nhe2grp_full(struct nh_grp_full *grp_full, struct nhg_hash_entry *nhe,
407+
uint32_t max_num);
408408

409409
/* Dataplane install/uninstall */
410410
extern void zebra_nhg_install_kernel(struct nhg_hash_entry *nhe, uint8_t type);

zebra/zebra_rib.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,7 @@ static void route_entry_update_original_nhe(struct route_entry *re, struct nhg_h
478478
zebra_nhg_mark_received_flag(nhe);
479479

480480
if (IS_ZEBRA_DEBUG_RIB_DETAILED || IS_ZEBRA_DEBUG_NHG_DETAIL) {
481-
zlog_debug("%s: re (%p) set nhe_received %p, (%pNG) ",
482-
__func__, re, nhe, nhe);
481+
zlog_debug("%s: re (%p) set nhe_received %p, (%pNG) ", __func__, re, nhe, nhe);
483482
}
484483
zebra_nhg_increment_ref(nhe);
485484
}
@@ -699,7 +698,7 @@ void rib_install_kernel(struct route_node *rn, struct route_entry *re,
699698
* Install the resolved nexthop object first.
700699
*/
701700
zebra_nhg_install_kernel(re->nhe, re->type);
702-
if(re->nhe_received)
701+
if (re->nhe_received)
703702
zebra_nhg_install_kernel(re->nhe_received, re->type);
704703

705704
/*
@@ -2605,8 +2604,8 @@ static void rib_re_nhg_free(struct route_entry *re)
26052604
*/
26062605
if (re->nhe_received) {
26072606
if (IS_ZEBRA_DEBUG_RIB_DETAILED || IS_ZEBRA_DEBUG_NHG_DETAIL) {
2608-
zlog_debug("%s: re (%p) clear nhe_received %p, (%pNG) ",
2609-
__func__, re, re->nhe_received, re->nhe_received);
2607+
zlog_debug("%s: re (%p) clear nhe_received %p, (%pNG) ", __func__, re,
2608+
re->nhe_received, re->nhe_received);
26102609
}
26112610
zebra_nhg_decrement_ref(re->nhe_received);
26122611
re->nhe_received = NULL;

0 commit comments

Comments
 (0)