bgpd: EVPN rd all or specific rd options based route table - #21843
Conversation
Add support for command show bgp l2vpn evpn route rd <rd> prefix <prefix> [json] This is currently a Cumulus-specific change. Multiple of the EVPN operational commands need to be unified with upstream changes which have now caught up to display most of the needed information of the global EVPN table but differ in some aspects from existing Cumulus commands. The unification also needs to handle per-VNI (per-EVI) information and will be post CL 4.2. Ticket: CM-26918 Reviewed By: Output reviewed by Mahesh & Chirag Testing Done: 1. Manual check 2. Precommit - https://trdb.cumulusnetworks.com/trdb3/product/1/userjobs?user=vivek&job=32 Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
Ticket: #4992460 Testing: Before fix: btor-11# show bgp l2vpn evpn route rd all prefix 2060:1:1:110::/64 % Malformed Route Distinguisher After fix: btor-11# show bgp l2vpn evpn route rd all prefix 2060:1:1:110::/64 Route Distinguisher: 144.1.1.6:9 BGP routing table entry for 144.1.1.6:9:[5]:[0]:[64]:[2060:1:1:110::] Paths: (1 available, best FRRouting#1) Not advertised to any peer Route [5]:[0]:[64]:[2060:1:1:110::] VNI 104002 Local 6.0.0.1 (bordertor-11) from 0.0.0.0 (6.0.0.1) Origin incomplete, metric 0, weight 32768, valid, sourced, local, bestpath-from-AS Local, best (First path received) Extended Community: ET:8 RT:60176:104002 Rmac:00:01:00:00:01:08 Last update: Sun Apr 26 00:12:25 2026 Displayed 1 prefixes (1 paths) Json: btor-11# show bgp l2vpn evpn route rd all prefix 2060:1:1:110::/64 json { "144.1.1.6:9":{ "rd":"144.1.1.6:9", "prefix":"[5]:[0]:[64]:[2060:1:1:110::]", "prefixLen":352, "routeType":5, .... }, "numPrefix":1, "numPaths":1 } Assisted-by: Cluade Signed-off-by: Chirag Shah <chirag@nvidia.com>
Greptile SummaryThis PR adds two new VTY show handlers β Confidence Score: 5/5PR is safe to merge; prior lock-leak issues addressed and new code closely follows the evpn_show_route_rd_macip pattern No new P0/P1 issues identified. The ref-count management concerns from previous review threads are resolved. Both new handler functions correctly mirror the existing evpn_show_route_rd_macip reference implementation, including proper bgp_dest_unlock_node calls on all paths. No files require special attention Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["show bgp l2vpn evpn route rd <all|RD> prefix <prefix>"] --> B{rd_all?}
B -- yes --> C["evpn_show_route_rd_all_prefix()"]
B -- no --> D["evpn_show_route_rd_prefix()"]
C --> E["build_type5_prefix_from_ip_prefix()"]
E --> F["Iterate all RD entries in bgp->rib"]
F --> G{table == NULL?}
G -- yes --> F
G -- no --> H["bgp_safi_node_lookup(rib, safi, prefix, rd)"]
H --> I{rn found & has path info?}
I -- no --> J["bgp_dest_unlock_node(rn)"] --> F
I -- yes --> K["bgp_evpn_show_route_rd_header + route_vty_out_detail_header"]
K --> L["Loop: route_vty_out_detail per pi"]
L --> M["bgp_dest_unlock_node(rn)"] --> F
F --> N["Print: Displayed N prefixes (M paths)"]
D --> O["build_type5_prefix_from_ip_prefix()"]
O --> P["bgp_safi_node_lookup(rib, safi, prefix, prd)"]
P --> Q{rn found & has path info?}
Q -- no --> R["bgp_dest_unlock_node(rn) / Network not in table"]
Q -- yes --> S["route_vty_out_detail_header"]
S --> T["Loop: route_vty_out_detail per pi"]
T --> U["bgp_dest_unlock_node(rn) / Print: Displayed N paths"]
Reviews (2): Last reviewed commit: "tests: EVPN change assert msgs to f-stri..." | Re-trigger Greptile |
Signed-off-by: Chirag Shah <chirag@nvidia.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
Json:
specific rd routes:
Signed-off-by: Vivek Venkatraman vivek@nvidia.com
Signed-off-by: Chirag Shah chirag@nvidia.com