Skip to content

Commit 3f106e8

Browse files
committed
zebra: Rename vni_count to vni_refcnt
Rename vni_count to vni_refcnt to reflect what it is being used for Signed-off-by: Soumya Roy <[email protected]>
1 parent 35a0251 commit 3f106e8

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

zebra/zebra_evpn_mh.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -785,11 +785,11 @@ void zebra_evpn_vl_vxl_ref(uint16_t vid, vni_t vni_id,
785785
* VNI has changed for this VLAN and needs to be updated
786786
*/
787787
else if (acc_bd->vxlan_zif && zebra_vxlan_if_vni_find(acc_bd->vxlan_zif, acc_bd->vni)) {
788-
tmp_cnt = acc_bd->vni_count;
789-
acc_bd->vni_count++;
788+
tmp_cnt = acc_bd->vni_refcnt;
789+
acc_bd->vni_refcnt++;
790790
if (IS_ZEBRA_DEBUG_EVPN_MH_ES)
791791
zlog_debug("access_vlan %d increment VNI count: %d->%d", vid, tmp_cnt,
792-
acc_bd->vni_count);
792+
acc_bd->vni_refcnt);
793793
return;
794794
}
795795
old_vni = acc_bd->vni;
@@ -799,7 +799,7 @@ void zebra_evpn_vl_vxl_ref(uint16_t vid, vni_t vni_id,
799799

800800
acc_bd->vni = vni_id;
801801
acc_bd->vxlan_zif = vxlan_zif;
802-
acc_bd->vni_count = 1;
802+
acc_bd->vni_refcnt = 1;
803803

804804
old_zevpn = acc_bd->zevpn;
805805
acc_bd->zevpn = zebra_evpn_lookup(vni_id);
@@ -838,12 +838,12 @@ void zebra_evpn_vl_vxl_deref(uint16_t vid, vni_t vni_id,
838838
acc_bd = zebra_evpn_acc_vl_find(vid, br_if);
839839
if (!acc_bd)
840840
return;
841-
if (acc_bd->vni_count > 1) {
842-
tmp_cnt = acc_bd->vni_count;
843-
acc_bd->vni_count--;
841+
if (acc_bd->vni_refcnt > 1) {
842+
tmp_cnt = acc_bd->vni_refcnt;
843+
acc_bd->vni_refcnt--;
844844
if (IS_ZEBRA_DEBUG_EVPN_MH_ES)
845845
zlog_debug("access_vlan %d decrement VNI count: %d->%d", vid, tmp_cnt,
846-
acc_bd->vni_count);
846+
acc_bd->vni_refcnt);
847847
return;
848848
}
849849

@@ -1024,7 +1024,7 @@ static void zebra_evpn_acc_vl_json_fill(struct zebra_evpn_access_bd *acc_bd,
10241024
if (acc_bd->mbr_zifs)
10251025
json_object_int_add(json, "memberIfCount",
10261026
listcount(acc_bd->mbr_zifs));
1027-
json_object_int_add(json, "vniCount", acc_bd->vni_count);
1027+
json_object_int_add(json, "vniCount", acc_bd->vni_refcnt);
10281028

10291029
if (detail) {
10301030
json_object *json_mbrs;
@@ -1068,7 +1068,7 @@ static void zebra_evpn_acc_vl_show_entry_detail(struct vty *vty,
10681068
}
10691069
vty_out(vty, " Member Count: %d\n",
10701070
listcount(acc_bd->mbr_zifs));
1071-
vty_out(vty, " VNI-count: %d\n", acc_bd->vni_count);
1071+
vty_out(vty, " VNI-count: %d\n", acc_bd->vni_refcnt);
10721072
vty_out(vty, " Members: \n");
10731073
for (ALL_LIST_ELEMENTS_RO(acc_bd->mbr_zifs, node, zif))
10741074
vty_out(vty, " %s\n", zif->ifp->name);
@@ -1089,7 +1089,7 @@ static void zebra_evpn_acc_vl_show_entry(struct vty *vty,
10891089
vty_out(vty, "%-21s %-15s %-8d %-15s %-15d %u\n", vlan_str,
10901090
acc_bd->vlan_zif ? acc_bd->vlan_zif->ifp->name : "-",
10911091
acc_bd->zevpn ? acc_bd->zevpn->vni : 0,
1092-
acc_bd->vxlan_zif ? acc_bd->vxlan_zif->ifp->name : "-", acc_bd->vni_count,
1092+
acc_bd->vxlan_zif ? acc_bd->vxlan_zif->ifp->name : "-", acc_bd->vni_refcnt,
10931093
listcount(acc_bd->mbr_zifs));
10941094
}
10951095
}

zebra/zebra_evpn_mh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ struct zebra_evpn_access_bd {
179179
/* SVI associated with the VLAN */
180180
struct zebra_if *vlan_zif;
181181
/* VNI count */
182-
uint8_t vni_count;
182+
uint8_t vni_refcnt;
183183
};
184184

185185
/* multihoming information stored in zrouter */

0 commit comments

Comments
 (0)