summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSindhu Parvathi Gopinathan <sgopinathan@nvidia.com>2023-04-10 04:54:09 -0700
committerChirag Shah <chirag@nvidia.com>2023-04-10 21:08:27 -0700
commit48ac5e1306b18e02f2bc1e5847d7ebe387a9a75d (patch)
tree9b5c134cbad5f9ab9b475e7c540450ff04509f99
parent8b985768bffa7a6cb0b571393e2ae2d119e303c7 (diff)
bgpd:add local_es_df_preference into l2vpn-evpn es json output
Added "Local ES DF preference" into bgp l2vpn evpn es json output. - show bgp l2vpn evpn es <es-id> json - show bgp l2vpn evpn es detail json Before Fix:- ``` cumulus@torm-11:mgmt:~$ sudo vtysh -c "show bgp l2vpn evpn es 03:44:38:39:ff:ff:01:00:00:01 json" { "esi":"03:44:38:39:ff:ff:01:00:00:01", "rd":"27.0.0.21:15", "type":[ "local", "remote" ], "vteps":[ { "vtep_ip":"27.0.0.22", "flags":[ "esr", "active" ], "dfPreference":32767, "dfAlgorithm":32767 }, { "vtep_ip":"27.0.0.23", "flags":[ "esr", "active" ], "dfPreference":32767, "dfAlgorithm":32767 } ], "vniCount":10, "flags":[ "up", "advertiseEVI" ], "originator_ip":"27.0.0.21", "remoteVniCount":10, "vrfCount":3, "macipPathCount":33, "macipGlobalPathCount":132, "inconsistentVniVtepCount":0, "fragments":[ { "rd":"27.0.0.21:15", "eviCount":10 } ] } cumulus@torm-11:mgmt:~$ ``` After Fix:- ``` cumulus@torm-11:mgmt:~$ cumulus@torm-11:mgmt:~$ sudo vtysh -c "show bgp l2vpn evpn es 03:44:38:39:ff:ff:01:00:00:01 json" { "esi":"03:44:38:39:ff:ff:01:00:00:01", "rd":"27.0.0.21:4", "type":[ "local", "remote" ], "vteps":[ { "vtep_ip":"27.0.0.22", "flags":[ "esr", "active" ], "dfPreference":32767, "dfAlgorithm":32767 }, { "vtep_ip":"27.0.0.23", "flags":[ "esr", "active" ], "dfPreference":32767, "dfAlgorithm":32767 } ], "vniCount":10, "flags":[ "advertiseEVI" ], "originator_ip":"27.0.0.21", "remoteVniCount":10, "vrfCount":3, "macipPathCount":33, "macipGlobalPathCount":132, "inconsistentVniVtepCount":0, "localEsDfPreference":50000, ====> Added Local ES DF preference "fragments":[ { "rd":"27.0.0.21:4", "eviCount":10 } ] } cumulus@torm-11:mgmt:~$ ``` Ticket:#3411906 Issue:3411906 Testing: UT done Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
-rw-r--r--bgpd/bgp_evpn_mh.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bgpd/bgp_evpn_mh.c b/bgpd/bgp_evpn_mh.c
index d821d4d582..c43d79d71a 100644
--- a/bgpd/bgp_evpn_mh.c
+++ b/bgpd/bgp_evpn_mh.c
@@ -2608,6 +2608,9 @@ static void bgp_evpn_es_show_entry_detail(struct vty *vty,
listcount(es->macip_global_path_list));
json_object_int_add(json, "inconsistentVniVtepCount",
es->incons_evi_vtep_cnt);
+ if (es->flags & BGP_EVPNES_LOCAL)
+ json_object_int_add(json, "localEsDfPreference",
+ es->df_pref);
if (listcount(es->es_vtep_list)) {
json_vteps = json_object_new_array();
for (ALL_LIST_ELEMENTS_RO(es->es_vtep_list, node,