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

bgpd: CLI Changes #17553

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

krishna-samy
Copy link
Contributor

This PR has below changes

  • Add new json CLI “show ip bgp l2vpn evpn update-groups json”
  • Add command to display EVPN type-5 per-prefix
  • Fixed selectionDeferralTimer JSON field as it was displaying stalepath timer value instead of select_defer_time

ashred-lnx and others added 3 commits December 3, 2024 13:27
Ticket:#3229030
Testing Done: UT

Added sub group and json support for l2vpn update group.

TEST:

spine-1# show ip bgp l2vpn evpn update-groups json
{
  "default":{
    "3":{
      "groupCreateTime":{
        "epoch":1670880656,
        "epochString":"Mon Dec 12 21:30:56 2022\n"
      },
      "afi":"l2vpn",
      "safi":"evpn",
      "minRouteAdvInt":0,
      "subGroup":[
        {
          "subGroupId":3,
          "groupCreateTime":{
            "epoch":1670880656,
            "epochString":"Mon Dec 12 21:30:56 2022\n"
          },
          "statistics":{
            "joinEvents":6,
            "pruneEvents":0,
            "mergeEvents":2,
            "splitEvents":0,
            "switchEvents":0,
            "peerRefreshEvents":0,
            "mergeCheckEvents":0
          },
          "coalesceTime":1300,
          "version":19,
          "packetQueueInfo":{
            "qeueueLen":0,
            "queuedTotal":466,
            "queueHwmLen":39,
            "totalEnqueued":466
          },
          "adjListCount":2071,
          "needsRefresh":false,
          "peers":[
            "swp6",
            "swp1",
            "swp3",
            "swp4",
            "swp2",
            "swp5"
          ]
        }
      ]
    }
  }
}

Signed-off-by: Ashwini Reddy <[email protected]>
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.

Signed-off-by: Vivek Venkatraman <[email protected]>

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
Fixed selectionDeferralTimer JSON field which was displaying
stalepath timer value instead of select_defer_time.

Issue:3803619
Signed-off-by: Pooja Jagadeesh Doijode <[email protected]>
Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

/*
* Display global EVPN routing table for specific RD and prefix (type-5).
*/
DEFUN(show_bgp_l2vpn_evpn_route_rd_prefix,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DEFPY, please.

"Route Distinguisher\n"
"ASN:XX or A.B.C.D:XX\n"
"prefix\n"
"IP prefix\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe IPv4 prefix?

json_object *json = NULL;

bgp = bgp_get_evpn();
if (!bgp)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we be consistent and return an empty JSON in such a case also if the user expects a JSON output?

ret = str2prefix_rd(argv[idx + 1]->arg, &prd);
if (!ret) {
vty_out(vty, "%% Malformed Route Distinguisher\n");
return CMD_WARNING;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, and everywhere else returning a warning. We have already some patterns when handling similar cases, e.g.:

json_object_string_add(
					json_no, "warning",
					"No such neighbor or address family");

"Detailed info about dynamic update groups\n")
DEFPY(show_bgp_l2vpn_evpn_updgrps,
show_bgp_l2vpn_evpn_updgrps_cmd,
"show [ip] bgp l2vpn evpn update-groups [(1-1000)$subgrpid] [json$json]",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add documentation for this command too (since you touch it)?

Also... to me, it sounds like Show EVPN update-groups with an update-group id instead of subgroup-id. I think telling explicitly that we want a subgroup-id would be better (e.g.: show bgp l2vpn evpn update-group [subgroup-id (1-1000)...), no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants