Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zebra, lib: use internal rbtree for per-NS tree of ifps #17297

Merged
merged 9 commits into from
Nov 12, 2024

zebra: remove if_table from the zebra NS

b7263c0
Select commit
Loading
Failed to load commit list.
Merged

zebra, lib: use internal rbtree for per-NS tree of ifps #17297

zebra: remove if_table from the zebra NS
b7263c0
Select commit
Loading
Failed to load commit list.
frrbot / frrbot completed Oct 29, 2024 in 7s

Style and/or linter errors found

Style and/or linter errors found

Details

Thanks for your contribution to FRR!

Click for style suggestions

diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c
index 7ef3fa2e6..d46a89990 100644
--- a/zebra/if_netlink.c
+++ b/zebra/if_netlink.c
@@ -1616,8 +1616,8 @@ static int tunneldump_walk_cb(struct interface *ifp, void *arg)
 		return NS_WALK_STOP;
 	}
 
-	ret = netlink_parse_info(netlink_link_change, &(ctx->zns->netlink_cmd),
-				 ctx->dp_info, 0, true);
+	ret = netlink_parse_info(netlink_link_change, &(ctx->zns->netlink_cmd), ctx->dp_info, 0,
+				 true);
 
 	if (ret < 0) {
 		ctx->ret = ret;
diff --git a/zebra/interface.c b/zebra/interface.c
index 86de5dbae..3143a3c5f 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -1038,8 +1038,7 @@ static int zif_link_fixup_cb(struct interface *ifp, void *arg)
 	zif = ifp->info;
 	/* update bond-member to bond linkages */
 	if ((IS_ZEBRA_IF_BOND_SLAVE(ifp)) &&
-	    (zif->bondslave_info.bond_ifindex != IFINDEX_INTERNAL) &&
-	    !zif->bondslave_info.bond_if) {
+	    (zif->bondslave_info.bond_ifindex != IFINDEX_INTERNAL) && !zif->bondslave_info.bond_if) {
 		if (IS_ZEBRA_DEBUG_EVPN_MH_ES || IS_ZEBRA_DEBUG_KERNEL)
 			zlog_debug("bond mbr %s map to bond %d", zif->ifp->name,
 				   zif->bondslave_info.bond_ifindex);
@@ -1048,19 +1047,15 @@ static int zif_link_fixup_cb(struct interface *ifp, void *arg)
 
 	/* update SVI linkages */
 	if ((zif->link_ifindex != IFINDEX_INTERNAL) && !zif->link) {
-		zif->link = if_lookup_by_index_per_nsid(zif->link_nsid,
-							zif->link_ifindex);
+		zif->link = if_lookup_by_index_per_nsid(zif->link_nsid, zif->link_ifindex);
 		if (IS_ZEBRA_DEBUG_KERNEL)
-			zlog_debug("interface %s/%d's lower fixup to %s/%d",
-				   ifp->name, ifp->ifindex,
-				   zif->link ? zif->link->name : "unk",
-				   zif->link_ifindex);
+			zlog_debug("interface %s/%d's lower fixup to %s/%d", ifp->name, ifp->ifindex,
+				   zif->link ? zif->link->name : "unk", zif->link_ifindex);
 	}
 
 	/* Update VLAN<=>SVI map */
 	if (IS_ZEBRA_IF_VLAN(ifp))
-		zebra_evpn_acc_bd_svi_set(zif, NULL,
-					  !!if_is_operative(ifp));
+		zebra_evpn_acc_bd_svi_set(zif, NULL, !!if_is_operative(ifp));
 
 	return NS_WALK_CONTINUE;
 }
diff --git a/zebra/zebra_ns.c b/zebra/zebra_ns.c
index 771e7d671..dc2ebe683 100644
--- a/zebra/zebra_ns.c
+++ b/zebra/zebra_ns.c
@@ -151,8 +151,7 @@ static int lookup_ifp_name_cb(struct interface *ifp, void *arg)
  * return semantics from lib/ns.h: return NS_WALK_STOP to stop the iteration.
  * Caller's 'arg' is included in each callback.
  */
-int zebra_ns_ifp_walk(struct zebra_ns *zns,
-		      int (*func)(struct interface *ifp, void *arg), void *arg)
+int zebra_ns_ifp_walk(struct zebra_ns *zns, int (*func)(struct interface *ifp, void *arg), void *arg)
 {
 	struct ifp_tree_link *link;
 	int ret = NS_WALK_CONTINUE;
diff --git a/zebra/zebra_ns.h b/zebra/zebra_ns.h
index 0e40cebbe..94bc7ac18 100644
--- a/zebra/zebra_ns.h
+++ b/zebra/zebra_ns.h
@@ -87,8 +87,8 @@ struct interface *zebra_ns_lookup_ifp_name(struct zebra_ns *zns, const char *ifn
  * Caller's 'arg' is included in each callback.
  * The iterator returns STOP or CONTINUE also.
  */
-int zebra_ns_ifp_walk(struct zebra_ns *zns,
-		      int (*func)(struct interface *ifp, void *arg), void *arg);
+int zebra_ns_ifp_walk(struct zebra_ns *zns, int (*func)(struct interface *ifp, void *arg),
+		      void *arg);
 
 /* Walk all NSes, and all ifps for each NS. */
 void zebra_ns_ifp_walk_all(int (*func)(struct interface *ifp, void *arg), void *arg);

To apply the style suggestions:

curl https://gist.githubusercontent.com/polychaeta/5886c8ae654f1b779ddbc2ef7e5b8154/raw/fc908ac8f1626c2f1267935824220c47e08bb9a5/style.diff | git apply -

If you are a new contributor to FRR, please see our contributing guidelines.

After making changes, you do not need to create a new PR. You should perform an amend or interactive rebase followed by a force push.