Commit Graph

221 Commits

Author SHA1 Message Date
Donald Sharp
736e6a45e6 bgpd: Prevent ecomm memory leak
There are some situations where we create a ecommunity for
comparing to internal state when we are deleting, but in the
failure cases we would not free up the created memory.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-27 15:16:32 -04:00
Anuradha Karuppiah
74e2bd891d bgpd: support for DF election in EVPN-MH
DF (Designated forwarder) election is used for picking a single
BUM-traffic forwarded per-ES. RFC7432 specifies a mechanism called
service carving for DF election. However that mechanism has many
disadvantages -
1. LBs poorly.
2. Doesn't allow for a controlled failover needed in upgrade
scenarios.
3. Not easy to hw accelerate.

To fix the poor performance of service carving alternate DF mechanisms
have been proposed via the following drafts -
draft-ietf-bess-evpn-df-election-framework
draft-ietf-bess-evpn-pref-df

This commit adds support for the pref-df election mechanism which
is used as the default. Other mechanisms including service-carving
may be added later.

In this mechanism one switch on an ES is elected as DF based on the
preference value; higher preference wins with IP address acting
as the tie-breaker (lower-IP wins if pref value is the same).

Sample output
=============
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
torm-11# sh bgp l2vpn evpn es 03:00:00:00:00:01:11:00:00:01
ESI: 03:00:00:00:00:01:11:00:00:01
 Type: LR
 RD: 27.0.0.15:6
 Originator-IP: 27.0.0.15
 Local ES DF preference: 100
 VNI Count: 10
 Remote VNI Count: 10
 Inconsistent VNI VTEP Count: 0
 Inconsistencies: -
 VTEPs:
  27.0.0.16 flags: EA df_alg: preference df_pref: 32767
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
torm-11# sh bgp l2vpn evpn route esi 03:00:00:00:00:01:11:00:00:01
*> [4]:[03:00:00:00:00:01:11:00:00:01]:[32]:[27.0.0.15]
                    27.0.0.15                          32768 i
                    ET:8 ES-Import-Rt:00:00:00:00:01:11 DF: (alg: 2, pref: 100)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-10-26 10:26:21 -07:00
Donald Sharp
cd7f9b1711
Merge pull request #7323 from ton31337/fix/inet_ntoa_to_pFX_master
bgpd: Convert inet_ntoa to %pI4
2020-10-20 09:10:24 -04:00
Patrick Ruddy
cecc76cdc5
Merge pull request #7300 from sworleys/EVPN-RType-NUMs
lib,bgpd: more evpn route-type numerical command versions
2020-10-20 11:05:31 +01:00
Donatas Abraitis
23d0a75356 bgpd: Convert inet_ntoa to %pI4/inet_ntop
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-10-18 11:22:30 +03:00
Pat Ruddy
f137734bb4 bgpd: replace bgp_evpn_route2str with prefix2str
Remove bgp_evpn_route2str and replace calls with prefix2str

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-10-16 11:54:30 +01:00
Stephen Worley
15dc08a600 bgpd: numerical evpn type support to debug commands
Add number evpn route type support for debug commands.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-10-13 16:13:16 -04:00
Stephen Worley
2b1364e1b7 bgpd: numerical evpn type support to more show cmds
Add numberical evpn route type support to some more
show commands.

Also, simplify some of the code there to call common type parsing
function. Some of the bounds checking there is also unncessary given
how our cli node matching works.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-10-13 16:13:16 -04:00
Donatas Abraitis
7563bd3fd8
Merge pull request #7252 from sworleys/EVPN-RType-Help
lib,bgpd: EVPN help string cleanup
2020-10-09 09:19:18 +03:00
Stephen Worley
f5dc0b1a42 bgpd: re-use HELP_STR evpn macros
Re-use some of the HELP_STR macros rather than copypastaing
strings everywhere.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-10-08 16:01:56 -04:00
Igor Ryzhov
1673a90dd3 bgpd: hide test commands
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-08 11:03:25 +03:00
Rafael Zalamena
28673973b7 bgpd: fix missing doc string in evpn
Add the missing EVPN doc string in the show command.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-08-07 14:32:58 -03:00
Anuradha Karuppiah
b5e140c85c bgpd: CLI changes for EAD routes and ES/ES-EVI display
1. Sample ES display
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
torm-11# sh bgp l2vpn evpn es
ES Flags: L local, R remote, I inconsistent
VTEP Flags: E ESR/Type-4, A active nexthop
ESI                            Flags RD                    #VNIs    VTEPs
03:00:00:00:00:01:11:00:00:01  LR    27.0.0.15:15          10       27.0.0.16(EA)
03:00:00:00:00:01:22:00:00:02  LR    27.0.0.15:16          10       27.0.0.16(EA)
03:00:00:00:00:01:22:00:00:03  LR    27.0.0.15:17          10       27.0.0.16(EA)
03:00:00:00:00:02:11:00:00:01  R     -                     10       27.0.0.17(A),27.0.0.18(A)
03:00:00:00:00:02:22:00:00:02  R     -                     10       27.0.0.17(A),27.0.0.18(A)
03:00:00:00:00:02:22:00:00:03  R     -                     10       27.0.0.17(A),27.0.0.18(A)
torm-11#

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

2. Sample ES-EVI display
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
torm-11# sh bgp l2vpn evpn es-evi
Flags: L local, R remote, I inconsistent
VTEP-Flags: E EAD-per-ES, V EAD-per-EVI
VNI      ESI                            Flags VTEPs
1005     03:00:00:00:00:01:11:00:00:01  LR    27.0.0.16(EV)
1005     03:00:00:00:00:01:22:00:00:02  LR    27.0.0.16(EV)
1005     03:00:00:00:00:01:22:00:00:03  LR    27.0.0.16(EV)
1005     03:00:00:00:00:02:11:00:00:01  R     27.0.0.17(EV),27.0.0.18(EV)
1005     03:00:00:00:00:02:22:00:00:02  R     27.0.0.17(EV),27.0.0.18(EV)
1005     03:00:00:00:00:02:22:00:00:03  R     27.0.0.17(EV),27.0.0.18(EV)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

3. Sample EAD route display
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
torm-11# sh bgp l2vpn evpn route type ead
BGP table version is 19, local router ID is 27.0.0.15
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
EVPN type-1 prefix: [4]:[ESI]:[EthTag]:[IPlen]:[VTEP-IP]
EVPN type-2 prefix: [2]:[EthTag]:[MAClen]:[MAC]:[IPlen]:[IP]
EVPN type-3 prefix: [3]:[EthTag]:[IPlen]:[OrigIP]
EVPN type-4 prefix: [4]:[ESI]:[IPlen]:[OrigIP]
EVPN type-5 prefix: [5]:[EthTag]:[IPlen]:[IP]

   Network          Next Hop            Metric LocPrf Weight Path
                    Extended Community
Route Distinguisher: 27.0.0.15:5
*> [1]:[0]:[03:00:00:00:00:01:11:00:00:01]:[128]:[0.0.0.0]
                    27.0.0.15                          32768 i
                    ET:8 RT:5550:1009
*> [1]:[0]:[03:00:00:00:00:01:22:00:00:02]:[128]:[0.0.0.0]
                    27.0.0.15                          32768 i
                    ET:8 RT:5550:1009
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-08-05 06:46:12 -07:00
Anuradha Karuppiah
185fb14a41 bgpd: pull the multihoming code out to a separate file
Re-org only; no other code changes. This is being done to make maintanence
of MH functionality (which will have more code added to it) easy.

The code moved here was originally committed via -
'commit 50f74cf131 ("*: support for evpn type-4 route")'

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-08-05 06:46:12 -07:00
Donald Sharp
5f140efeef bgpd: Deref after null check in bgp_evpn_vty.c
Coverity has noticed that we are using bgp_evpn after
we have already NULL checked it one time.  Add an assert
to make Coverity happy here, if we get to this point
something terrible has happened.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-07-27 07:10:41 -04:00
Madhuri Kuruganti
ae2488324e bgpd: wide option
Signed-off-by: Madhuri Kuruganti <k.madhuri@samsung.com>
2020-07-23 19:18:11 +05:30
David Lamparter
3efd0893d0 *: un-split strings across lines
Remove mid-string line breaks, cf. workflow doc:

  .. [#tool_style_conflicts] For example, lines over 80 characters are allowed
     for text strings to make it possible to search the code for them: please
     see `Linux kernel style (breaking long lines and strings)
     <https://www.kernel.org/doc/html/v4.10/process/coding-style.html#breaking-long-lines-and-strings>`_
     and `Issue #1794 <https://github.com/FRRouting/frr/issues/1794>`_.

Scripted commit, idempotent to running:
```
python3 tools/stringmangle.py --unwrap `git ls-files | egrep '\.[ch]$'`
```

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-07-14 10:37:25 +02:00
Donatas Abraitis
10b49f1450 bgpd: Add command to show only established sessions
```
exit1-debian-9# show bgp summary

IPv4 Unicast Summary:
BGP router identifier 192.168.0.1, local AS number 100 vrf-id 0
BGP table version 8
RIB entries 15, using 2880 bytes of memory
Peers 2, using 43 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
192.168.0.2     4        200        10         6        0    0    0 00:00:35            8        8
2a02:4780::2    4          0         0         1        0    0    0    never       Active        0

Total number of neighbors 2
exit1-debian-9# show bgp summary established

IPv4 Unicast Summary:
BGP router identifier 192.168.0.1, local AS number 100 vrf-id 0
BGP table version 8
RIB entries 15, using 2880 bytes of memory
Peers 2, using 43 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
192.168.0.2     4        200        10         6        0    0    0 00:00:39            8        8

Total number of neighbors 2
exit1-debian-9# show bgp summary failed

IPv4 Unicast Summary:
BGP router identifier 192.168.0.1, local AS number 100 vrf-id 0
BGP table version 8
RIB entries 15, using 2880 bytes of memory
Peers 2, using 43 KiB of memory

Neighbor        EstdCnt DropCnt ResetTime Reason
2a02:4780::2          0       0     never Waiting for peer OPEN

Total number of neighbors 2
exit1-debian-9#
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-07-09 16:10:20 +03:00
Donald Sharp
9bcb3eef54 bgp: rename bgp_node to bgp_dest
This is the bulk part extracted from "bgpd: Convert from `struct
bgp_node` to `struct bgp_dest`".  It should not result in any functional
change.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-06-23 17:32:52 +02:00
Chirag Shah
e67df34d25 bgpd: move advertise-vni-all above vni config
Move config 'advertise-vni-all' above all evpn
configuration as vni specific confi commands
have check for advertise-vni-all enabled first.

Ticket: CM-29312
Reviewed By:
Testing Done:

router bgp 5650
...
advertise-all-vni
vni 1002
 route-target import 55500:10002
 route-target export 55500:10002
exit-vni
...

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-06-01 23:18:09 -07:00
Quentin Young
772270f3b6 *: sprintf -> snprintf
Replace sprintf with snprintf where straightforward to do so.

- sprintf's into local scope buffers of known size are replaced with the
  equivalent snprintf call
- snprintf's into local scope buffers of known size that use the buffer
  size expression now use sizeof(buffer)
- sprintf(buf + strlen(buf), ...) replaced with snprintf() into temp
  buffer followed by strlcat

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-20 19:14:33 -04:00
Trey Aspelund
8937a1e613 bgpd: Add int args to show bgp evpn route type
This adds numeric keywords to 'show bgp l2vpn evpn route type'.

Signed-off-by: Trey Aspelund <taspelund@cumulusnetworks.com>
2020-04-14 20:36:12 -04:00
Trey Aspelund
f2562d3ac1 bgpd: Fix typos in show bgp evpn route type
This fixes unnecessary whitespaces and makes capitalization
match for route type help strings.

Signed-off-by: Trey Aspelund <taspelund@cumulusnetworks.com>
2020-04-14 19:06:01 -04:00
Donatas Abraitis
c4efd0f423 *: Do not cast to the same type
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-08 17:15:06 +03:00
Donald Sharp
b54892e0ea bgpd: Convert users of rn->p to use accessor function
Add new function `bgp_node_get_prefix()` and modify
the bgp code base to use it.

This is prep work for the struct bgp_dest rework.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-26 16:25:16 -04:00
Donald Sharp
1be1693edf bgpd, lib: More constification of various code
More second order effects of cleaning up rn usage
in bgp.  Sprinkle the fairy const's all over the place.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-23 08:41:17 -04:00
Donatas Abraitis
3dc339cdc2 bgpd: Convert lots of int type functions to bool/void
Some were converted to bool, where true/false status is needed.
Converted to void only those, where the return status was only false or true.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-21 14:59:18 +02:00
Chirag Shah
0b509723a0 bgpd: change evpn vni json field format
Change advertiseSviMacip to advertiseSviMacIp in
json output.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-02-11 11:38:26 -08:00
Chirag Shah
37ae1adbfa bgpd: readjust fields in evpn vni json cmd
1) Keep consistant field name, such as
"inKernel".
2) Keep fields order same for both outputs.

Testing Done:

TORS1# show bgp l2vpn evpn vni json
{
  "advertiseGatewayMacip":"Disabled",
  "advertiseSviMacip":"Disabled",
  "advertiseAllVnis":"Enabled",
  "flooding":"Head-end replication",
  "numVnis":8,
  "numL2Vnis":5,
  "numL3Vnis":3,
  "1002":{
    "vni":1002,
    "type":"L2",
    "inKernel":"True",
    "rd":"27.0.0.15:8",
    "originatorIp":"27.0.0.15",
    "mcastGroup":"0.0.0.0",
    "advertiseGatewayMacip":"Disabled",
    "advertiseSviMacip":"Disabled",
    "importRTs":[
      "5550:1002"
    ],
    "exportRTs":[
      "5550:1002"
    ]
  },
}

TORS1# show bgp l2vpn evpn vni 1002 json
{
  "vni":1002,
  "type":"L2",
  "inKernel":"True",
  "rd":"27.0.0.15:8",
  "originatorIp":"27.0.0.15",
  "mcastGroup":"0.0.0.0",
  "advertiseGatewayMacip":"Disabled",
  "advertiseSviMacip":"Disabled",
  "importRts":[
    "5550:1002"
  ],
  "exportRts":[
    "5550:1002"
  ]
}

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-02-11 11:11:28 -08:00
Chirag Shah
7c9cb387ff bgpd: add fields to bgp evpn vni json cmd
Bring 'show bgp l2vpn evpn vni json' inline
with 'show bgp l2vpn evpn vni <id> json' in
terms of fields.

Ticket:CM-28328
Reviewed By:
Testing Done:

TORS1# show bgp l2vpn evpn vni json
{
  "advertiseGatewayMacip":"Disabled",
  "advertiseSviMacip":"Disabled",
  "advertiseAllVnis":"Enabled",
  "flooding":"Head-end replication",
  "numVnis":8,
  "numL2Vnis":5,
  "numL3Vnis":3,
  "1002":{
    "vni":1002,
    "type":"L2",
    "inKernel":"True",
    "originatorIp":"27.0.0.15",
    "rd":"27.0.0.15:8",
    "mcastGroup":"0.0.0.0",
    "advertiseGatewayMacip":"Disabled",
    "advertiseSviMacip":"Disabled",
    "importRTs":[
      "5550:1002"
    ],
    "exportRTs":[
      "5550:1002"
    ]
  },
}

TORS1# show bgp l2vpn evpn vni 1002 json
{
  "vni":1002,
  "type":"L2",
  "kernelFlag":"Yes",
  "rd":"27.0.0.15:8",
  "originatorIp":"27.0.0.15",
  "mcastGroup":"0.0.0.0",
  "advertiseGatewayMacip":"Disabled",
  "advertiseSviMacip":"Disabled",
  "importRts":[
    "5550:1002"
  ],
  "exportRts":[
    "5550:1002"
  ]
}

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-02-11 11:11:28 -08:00
Donatas Abraitis
975a328e2e *: Replace s_addr 0 => INADDR_ANY
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-06 09:00:12 +02:00
Chirag Shah
24882500ff bgpd: fix memory leak in evpn json outpus II
Two of the evpn show commands with json option has memory leak.
1) show bgp l2vpn evpn route vni all json
2) show bgp l2vpn evpn route esi json

Before fix:
----------
Executed 'show bgp l2vpn evpn route vni all json' multiple times
used ordinary blocks continue to increase.

Note at the time of show command capture there were 22 evpn routes
in vni evpn route table.

Memory statistics for bgpd:
System allocator statistics:
  Total heap allocated:  9152 KiB
  Holding block headers: 0 bytes
  Used small blocks:     0 bytes
  Used ordinary blocks:  7300 KiB
  Free small blocks:     1760 bytes
  Free ordinary blocks:  1852 KiB
  Ordinary blocks:       880
  Small blocks:          51
  Holding blocks:        0

Ticket:CM-27920
Reviewed By:
Testing Done:

After fix:
---------
Executed 'show bgp l2vpn evpn route vni all json' multiple times
Used ordinary blocks remains low.

Memory statistics for bgpd:
System allocator statistics:
  Total heap allocated:  8356 KiB
  Holding block headers: 0 bytes
  Used small blocks:     0 bytes
  Used ordinary blocks:  6492 KiB
  Free small blocks:     1840 bytes
  Free ordinary blocks:  1864 KiB
  Ordinary blocks:       939
  Small blocks:          52
  Holding blocks:        0

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-01-27 11:07:02 -08:00
Chirag Shah
a1df2ac599 bgpd: fix memory leak in evpn json outputs
Found memory leak in json output of evpn's route
commands.

After executing 'show bgp l2vpn evpn route type prefix json'
and 'show bgp l2vpn evpn route type macip json' few times
(6 times) with more than 600 routes in total seeing
memory footprint for bgpd continue to grow.

Memory statistics for bgpd:
System allocator statistics:
  Total heap allocated:  12 MiB
  Holding block headers: 0 bytes
  Used small blocks:     0 bytes
  Used ordinary blocks:  8390 KiB
  Free small blocks:     1760 bytes
  Free ordinary blocks:  3762 KiB
  Ordinary blocks:       1161
  Small blocks:          51
  Holding blocks:        0

Ticket:CM-27920
Testing Done:

After fix:
excute few times,
'show bgp l2vpn evpn route type prefix json'
and 'show bgp l2vpn evpn route type macip json'
commands where used ordinary blocks (uordblks) is
in steady state.

Memory statistics for bgpd:
System allocator statistics:
  Total heap allocated:  9968 KiB
  Holding block headers: 0 bytes
  Used small blocks:     0 bytes
  Used ordinary blocks:  6486 KiB
  Free small blocks:     1984 bytes
  Free ordinary blocks:  3482 KiB
  Ordinary blocks:       1110
  Small blocks:          54
  Holding blocks:        0

Memory statistics for bgpd:
System allocator statistics:
  Total heap allocated:  10100 KiB
  Holding block headers: 0 bytes
  Used small blocks:     0 bytes
  Used ordinary blocks:  6488 KiB
  Free small blocks:     1984 bytes
  Free ordinary blocks:  3612 KiB
  Ordinary blocks:       1113
  Small blocks:          54
  Holding blocks:        0

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-01-24 12:17:17 -08:00
Chirag Shah
0137a3d874 bgpd: fix advertise pip running config
advertise pip running configuration should
display ip followed by mac parameters value as defined
in cli signature.

advertise-pip is enabled by default, when displaying the
running configuration, there is '\n' added after
ip and mac parameters which was not guarded around
the non-default parameters.

Currently, for every bgp vrf instance it ends up
displaying l2vpn address-family section due to
unguarded newline.

running config:
router bgp 6004 vrf vrf1
 !
 address-family l2vpn evpn
 exit-address-family
!

Ticket:CM-26964
Testing Done:

With fix when only 'router bgp 6004 vrf vrf1' configured,
running config looks like:

!
router bgp 6004 vrf vrf1
!

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-01-06 17:00:00 -08:00
Chirag Shah
a6e7677e63 bgpd: adv pip to throw warning under default vrf
Instead of CMD_WARNING, use CMD_WARNING_CONFIG_FAILED
for any mis-configuration scenario.

Testing Done:

TOR(config)# router bgp 5548
TOR(config-router)# address-family l2vpn evpn
TOR(config-router-af)# no advertise-pip
This command is supported under L3VNI BGP EVPN VRF

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-11-22 07:53:40 -08:00
Chirag Shah
1c97c9fd23 bgpd: evpn pip convert ntoa to ntop
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-11-22 07:53:36 -08:00
Chirag Shah
23c7421d4d bgpd: evpn pip display pip values
Display pip system mac and ip values
in per vni detail output.

Ticket:CM-26190
Reviewed By:
Testing Done:

Following new values add to the below output
for L3vni:

  System-IP: 27.0.0.11
  System-MAC: 00:02:00:00:00:2e
  Router-MAC: 44:38:39:ff:ff:01

TORC11# show bgp l2vpn evpn vni 4002
VNI: 4002 (known to the kernel)
  Type: L3
  Tenant VRF: vrf2
  RD: 141.2.1.2:2
  Originator IP: 36.0.0.11
  Advertise-gw-macip : n/a
  Advertise-pip: Yes
  System-IP: 27.0.0.11
  System-MAC: 00:02:00:00:00:2e
  Router-MAC: 44:38:39:ff:ff:01
  Import Route Target:
    5546:4002
  Export Route Target:
    5546:4002

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-11-22 07:53:33 -08:00
Chirag Shah
0ca1058096 bgpd: evpn pip handle svi ip route
By default announct Self Type-2 routes with
system IP as nexthop and system MAC as
nexthop.

An API to check type-2 is self route via
checking ipv4/ipv6 address from connected interfaces list.

An API to extract RMAC and nexthop for type-2
routes based on advertise-svi-ip knob is enabled.

When advertise-pip is enabled/disabled, trigger type-2
route update. For self type-2 routes to use
anycast or individual (rmac, nexthop) addresses.

Ticket:CM-26190
Reviewed By:
Testing Done:

Enable 'advertise-svi-ip' knob in bgp default instance.
the vrf instance svi ip is advertised with nexthop
as default instance router-id and RMAC as system MAC.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-11-22 07:53:32 -08:00
Chirag Shah
5394a27663 bgpd: evpn pip data struct and cli
Evpn Primary IP advertisement feature uses
individual system IP and system MAC for prefix (type-5)
and self type-2 routes.

The PIP knob is enabled by default for bgp vrf instance.

Configuration CLI for enable/disable PIP feature knob.
User can configure PIP system IP and MAC to retain as
permanent values.

For the PIP IP, the default behavior is to accept bgp default
instance's router-id. When the default instance router-id change,
reflect PIP IP assignment.

Reflect type-5 to use system-IP and system MAC as nexthop and RMAC
values.

Ticket:CM-26190

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-11-22 07:53:28 -08:00
Chirag Shah
90c31d7190 bgpd: fix json output for show cmd for evpn routes
Fix json output where show command displayed
"Route Distinguisher: " string in json output because
NULL json object passed to bgp_evpn_show_route_rd_header()

Testing Done:
Route Distinguisher: ip 27.0.0.11:3
Route Distinguisher: ip 27.0.0.11:4
Route Distinguisher: ip 27.0.0.16:3
Route Distinguisher: ip 27.0.0.16:5
Route Distinguisher: ip 27.0.0.16:9
{
  "27.0.0.11:3":{
    "rd":"27.0.0.11:3",
    "[2]:[0]:[48]:[00:02:00:00:00:02]":{
      "prefix":"[2]:[0]:[48]:[00:02:00:00:00:02]",
      "prefixLen":288,
 ...
}

Post fix:
{
  "27.0.0.11:3":{
    "rd":"27.0.0.11:3",
    "[2]:[0]:[48]:[00:02:00:00:00:02]":{
      "prefix":"[2]:[0]:[48]:[00:02:00:00:00:02]",
      "prefixLen":288,
  ...
}
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-11-11 07:57:57 -08:00
Chirag Shah
527fd6dee5 bgpd: fix rd printing in show commands for evpn rts
PR 5118 introduce additional (prepend) keywords
like 'ip' to Route Distinguisher output which
breaks existing evpn route show commands parsing.

Restore to original behavior.

Testing Done:

vtysh -c 'show bgp l2vpn evpn route'

Before fix:
Route Distinguisher: ip 27.0.0.15:44

Post fix:
Route Distinguisher: 27.0.0.15:44

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-11-11 07:57:37 -08:00
Russ White
b42d15054d
Merge pull request #5118 from lkrishnamoor/routes_json
bgpd: Fix in "show bgp l2vpn evpn neighbors X.X.X.X routes json"
2019-10-16 15:01:13 -04:00
Russ White
218f11515b
Merge pull request #5022 from chiragshah6/mdev
bgpd: evpn fix advertise-svi-ip display in show commands
2019-10-15 11:34:22 -04:00
Lakshman Krishnamoorthy
7f433a5e4d bgpd: Implement "sh bgp l2vpn evpn community|large-community X"
Full output here: https://github.com/FRRouting/frr/pull/5119

Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
2019-10-15 00:43:41 -07:00
Lakshman Krishnamoorthy
c69e79f1d1 bgpd: Bug fix in "show bgp l2vpn evpn neighbors X.X.X.X routes json"
Fixed memory leak and  incorrect json output. Check the full output in the PR:
https://github.com/FRRouting/frr/pull/5118

Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
2019-10-07 14:33:29 -07:00
Chirag Shah
2c4654a183 bgpd: fix global and per vni knobs display
Not just per vni knobs but when the global
knobs are enabled, display
per vni advertise-svi-ip and advertise-gw-macip
as active.

Ticket:CM-26381
Reviewed By:
Testing Done:

TOR1#show running-config bgpd
router bgp 5587
 ...
 address-family l2vpn evpn
  advertise-all-vni
  advertise-svi-ip
...

TORC11# show bgp l2vpn evpn vni 1004 json
{
  "vni":1004,
  "type":"L2",
  "kernelFlag":"Yes",
  "rd":"27.0.0.11:7",
  "originatorIp":"36.0.0.11",
  "mcastGroup":"0.0.0.0",
  "advertiseGatewayMacip":"Disabled",
  "advertiseSviMacip":"Active",
  "importRts":[
    "5546:1004"
  ],
  "exportRts":[
    "5546:1004"
  ]
}

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-09-24 14:25:38 -07:00
Chirag Shah
cbdbb1cafc bgpd: add advertise-svi-ip in json output
Ticket:CM-26404
Reviewed By:
Testing Done:

TORC1# show bgp l2vpn evpn vni 1004 json
{
  "vni":1004,
  "type":"L2",
  "kernelFlag":"Yes",
  "rd":"37.0.1.11:7",
  "originatorIp":"37.0.1.11",
  "mcastGroup":"0.0.0.0",
  "advertiseGatewayMacip":"No",
  "advertiseSviMacip":"No",
  "importRts":[
    "5546:1004"
  ],
  "exportRts":[
    "5546:1004"
  ]
}

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-09-24 14:25:38 -07:00
Kishore Aramalla
0afbd728ed bgpd: Fixed 'show bgp l2vpn evpn json' to display all routes
Fixed the following:
1. Print the complete header for 'show bgp l2vpn evpn' command
2. Print the Route Distinguisher header
3. Print all relevant routes in json (some were being skipped)

Signed-off-by: Kishore Aramalla <karamalla@vmware.com>
2019-09-18 20:47:50 -07:00
Dinesh G Dutt
3577f1c54f bgpd: Add a new command to only show failed peerings
In a data center, having 32-128 peers is not uncommon. In such a situation, to find a
peer that has failed and why is several commands. This hinders both the automatability of
failure detection and the ease/speed with which the reason can be found. To simplify this
process of catching a failure and its cause quicker, this patch does the following:

1. Created a new function, bgp_show_failed_summary to display the
   failed summary output for JSON and vty
2. Created a new function to display the reset code/subcode. This is now used in the
   failed summary code and in the show neighbors code
3. Added a new variable failedPeers in all the JSON outputs, including the vanilla
   "show bgp summary" family. This lists the failed session count.
4. Display peer, dropped count, estd count, uptime and the reason for failure as the
   output of "show bgp summary failed" family of commands
5. Added three resset codes for the case where we're waiting for NHT, waiting for peer
   IPv6 addr, waiting for VRF to init.

This also counts the case where only one peer has advertised an AFI/SAFI.

The new command has the optional keyword "failed" added to the classical summary command.

The changes affect only one existing output, that of "show [ip] bgp neighbors <nbr>". As
we track the lack of NHT resolution for a peer or the lack of knowing a peer IPv6 addr,
the output of that command will show a "waiting for NHT" etc. as the last reset reason.

This patch includes update to the documentation too.

Signed-off-by: Dinesh G Dutt <5016467+ddutt@users.noreply.github.com>
2019-09-02 14:21:44 +00:00
Donald Sharp
dde42c9b95 bgpd: Allow shortened input for show bgp l2vpn evpn route type e|p
The `show bgp l2vpn evpn route type <es|prefix>` commands
only accepted 2 letters.  You could not type `show bgp l2vpn evpn route type e`
or `show bgp l2vpn evpn route type p` although both are technically legal
since nothing overlaps with them.

Ticket: CM-25988
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-08-23 15:44:32 -04:00