]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
5 years agodoc: Cleanup output of new PIM-EVPN doc
Donald Sharp [Tue, 23 Apr 2019 06:14:15 +0000 (02:14 -0400)]
doc: Cleanup output of new PIM-EVPN doc

The PIM-EVPN doc was not rendering very well on the
website.  So Update documentation to allow it to render
better.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #4179 from donaldsharp/mroute_show
Jafar Al-Gharaibeh [Tue, 23 Apr 2019 16:18:22 +0000 (11:18 -0500)]
Merge pull request #4179 from donaldsharp/mroute_show

Mroute show

5 years agoMerge pull request #4177 from donaldsharp/pim_more_sg
Jafar Al-Gharaibeh [Tue, 23 Apr 2019 16:16:57 +0000 (11:16 -0500)]
Merge pull request #4177 from donaldsharp/pim_more_sg

pimd: When creating new upstream state, figure out what we should join

5 years agoMerge pull request #4163 from chiragshah6/evpn_dev2
Sri Mohana Singamsetty [Tue, 23 Apr 2019 16:10:13 +0000 (09:10 -0700)]
Merge pull request #4163 from chiragshah6/evpn_dev2

bgpd: instance delete unimport evpn routes

5 years agoMerge pull request #4183 from ton31337/feature/validate_regexp_for_show_command_as_well
Donald Sharp [Tue, 23 Apr 2019 14:25:56 +0000 (10:25 -0400)]
Merge pull request #4183 from ton31337/feature/validate_regexp_for_show_command_as_well

bgpd: Validate as-path in `show bgp regexp`

5 years agoMerge pull request #4185 from FRRouting/revert-4137-TE
Russ White [Tue, 23 Apr 2019 13:24:29 +0000 (09:24 -0400)]
Merge pull request #4185 from FRRouting/revert-4137-TE

Revert "isisd: Add IS-IS-TE support per Area"

5 years agoRevert "isisd: Add IS-IS-TE support per Area"
Russ White [Tue, 23 Apr 2019 13:24:18 +0000 (09:24 -0400)]
Revert "isisd: Add IS-IS-TE support per Area"

5 years agoMerge pull request #4137 from Orange-OpenSource/TE
Russ White [Tue, 23 Apr 2019 13:23:40 +0000 (09:23 -0400)]
Merge pull request #4137 from Orange-OpenSource/TE

isisd: Add IS-IS-TE support per Area

5 years agoMerge pull request #4162 from opensourcerouting/rip-issues
Donald Sharp [Tue, 23 Apr 2019 12:34:47 +0000 (08:34 -0400)]
Merge pull request #4162 from opensourcerouting/rip-issues

ripd, ripngd: fix cleaning up of offset lists

5 years agobgpd: Validate as-path in `show bgp regexp`
Donatas Abraitis [Thu, 18 Apr 2019 07:17:57 +0000 (10:17 +0300)]
bgpd: Validate as-path in `show bgp regexp`

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agodoc: Update `show ip mroute` command docs.
Donald Sharp [Mon, 22 Apr 2019 23:56:02 +0000 (19:56 -0400)]
doc: Update `show ip mroute` command docs.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Add ability to select on S or G for `show ip mroute`
Donald Sharp [Mon, 22 Apr 2019 23:51:20 +0000 (19:51 -0400)]
pimd: Add ability to select on S or G for `show ip mroute`

Add the ability to select on a S or G for a `show ip mroute`
command.

show ip mroute 225.1.1.111
show ip mroute 4.5.6.7 225.1.1.111

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: When creating new upstream state, figure out what we should join
Donald Sharp [Mon, 22 Apr 2019 21:36:58 +0000 (17:36 -0400)]
pimd: When creating new upstream state, figure out what we should join

Always when creating a new S,G state look at all possible ifchannels
to decide what the mroute should be.

The bug that this is fixing is this:

Suppose two incoming `*,G` joins on swp1, and swp2.
Now suppose that one of those ifchannel `*,G` sends a `*,G S,G RPT Prune`.
We were creating the S,G upstream state as we should but we were
only looking at the S,G ifchannel to decide the S,G mroute we would
be creating.  As such what we need to do is to look over the associated
*,G ifchannels and allow us to associate correct oil needed.

Ticket: CM-24732
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #4173 from mjstapp/fix_linklist_warning
Quentin Young [Mon, 22 Apr 2019 21:11:02 +0000 (17:11 -0400)]
Merge pull request #4173 from mjstapp/fix_linklist_warning

lib: fix warning in linklist api

5 years agolib: fix warning in linklist api
Mark Stapp [Mon, 22 Apr 2019 19:49:16 +0000 (15:49 -0400)]
lib: fix warning in linklist api

Add return value and comment to new/recent linklist api
to clean up compile warning.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #3786 from mjstapp/dplane_intf
Donald Sharp [Mon, 22 Apr 2019 19:29:02 +0000 (15:29 -0400)]
Merge pull request #3786 from mjstapp/dplane_intf

zebra: async interface address programming

5 years agoMerge pull request #4161 from opensourcerouting/nb-performance
Quentin Young [Mon, 22 Apr 2019 19:10:34 +0000 (15:10 -0400)]
Merge pull request #4161 from opensourcerouting/nb-performance

lib: rework management of user pointers in the northbound layer

5 years agozebra: removing old intf address code
Mark Stapp [Tue, 12 Feb 2019 16:10:04 +0000 (11:10 -0500)]
zebra: removing old intf address code

Remove old ioctl and netlink interface-address code
after conversion to async dataplane

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agozebra: Dplane interface address install for non-netlink
Mark Stapp [Fri, 25 Jan 2019 16:31:51 +0000 (11:31 -0500)]
zebra: Dplane interface address install for non-netlink

ioctl-based platform code for interface address installation

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agozebra: add 'is broadcast' accessor for interface data
Mark Stapp [Mon, 4 Feb 2019 20:25:13 +0000 (15:25 -0500)]
zebra: add 'is broadcast' accessor for interface data

Add flag and accessor corresponding to the interface struct's
'is broadcast' flag.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agolibs: use const in some interface flag accessors
Mark Stapp [Mon, 4 Feb 2019 19:33:06 +0000 (14:33 -0500)]
libs: use const in some interface flag accessors

Use const in several interface struct flag accessors (that just
test flags.)

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agozebra: Use dplane for interface addresses (netlink)
Mark Stapp [Wed, 16 Jan 2019 18:40:31 +0000 (13:40 -0500)]
zebra: Use dplane for interface addresses (netlink)

Start using the dataplane for interface-address programming,
on netlink platforms. Other platforms just stubbed at this
point.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agozebra: add interface-address info for dataplane
Mark Stapp [Thu, 10 Jan 2019 21:05:19 +0000 (16:05 -0500)]
zebra: add interface-address info for dataplane

Add data and accessor apis for interface-address information.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #4025 from AnuradhaKaruppiah/pim-evpn
Jafar Al-Gharaibeh [Mon, 22 Apr 2019 16:44:52 +0000 (11:44 -0500)]
Merge pull request #4025 from AnuradhaKaruppiah/pim-evpn

pim-evpn: Forwarding overlay BUM traffic via multicast VxLAN tunnels in the underlay

5 years agoMerge pull request #4057 from mjstapp/fix_privs_even_more
Quentin Young [Mon, 22 Apr 2019 15:32:50 +0000 (11:32 -0400)]
Merge pull request #4057 from mjstapp/fix_privs_even_more

lib: serialize privs changes

5 years agolibs: control privs changes with refcount
Mark Stapp [Tue, 2 Apr 2019 09:01:27 +0000 (05:01 -0400)]
libs: control privs changes with refcount

Use a refcount to control privs changes. Support process-wide
privs apis, as well as per-pthread apis.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #4166 from donaldsharp/pim_s_g
Jafar Al-Gharaibeh [Mon, 22 Apr 2019 03:57:47 +0000 (22:57 -0500)]
Merge pull request #4166 from donaldsharp/pim_s_g

Pim s g

5 years agoMerge pull request #4170 from AnuradhaKaruppiah/evpn-fix-bgp-locks
Jafar Al-Gharaibeh [Mon, 22 Apr 2019 03:56:53 +0000 (22:56 -0500)]
Merge pull request #4170 from AnuradhaKaruppiah/evpn-fix-bgp-locks

bgpd: lock the tenant-vrf associated with the l2-vni

5 years agoMerge pull request #4156 from ton31337/fix/allow_backslash_in_as-path_regexp
Quentin Young [Sun, 21 Apr 2019 20:48:28 +0000 (16:48 -0400)]
Merge pull request #4156 from ton31337/fix/allow_backslash_in_as-path_regexp

bgpd: Allow backslash in as-path filter lists

5 years agopimd: fix macro backslash alignment
Anuradha Karuppiah [Sat, 20 Apr 2019 14:50:43 +0000 (07:50 -0700)]
pimd: fix macro backslash alignment

Fixed in response to Jafar's comments.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agolib: two extra bytes were being allocated for the SG string
Anuradha Karuppiah [Sat, 20 Apr 2019 14:34:03 +0000 (07:34 -0700)]
lib: two extra bytes were being allocated for the SG string

Fixup in response to Jafar's review comments.

This is actually old code moved in from pimd to lib. But the fixup does
make sense.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agozebra: use "mcast group" instead of just mcast in show and logs
Anuradha Karuppiah [Sat, 20 Apr 2019 14:27:46 +0000 (07:27 -0700)]
zebra: use "mcast group" instead of just mcast in show and logs

Fixup done in response to Jafar's review comments.

root@act-7726-03:~# vtysh -c  "show interface vxlan1000111"
Interface vxlan1000111 is up, line protocol is up
  Link ups:       0    last: (never)
  Link downs:     0    last: (never)
  PTM status: disabled
  vrf: default
  index 95 metric 0 mtu 1500 speed 0
  flags: <UP,BROADCAST,RUNNING,MULTICAST>
  Type: Ethernet
  HWaddr: 7e:1d:c1:d5:d1:cc
  Interface Type Vxlan
  VxLAN Id 1000111 VTEP IP: 6.0.0.28 Access VLAN Id 111
  Mcast Group 239.1.1.111 >>>>>>>>>>
  Master (bridge) ifindex 99
root@act-7726-03:~#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopim: fix order of vxlan mroutes cleanup when pimd is shutdown
Anuradha Karuppiah [Wed, 17 Apr 2019 01:49:28 +0000 (18:49 -0700)]
pim: fix order of vxlan mroutes cleanup when pimd is shutdown

1. vxlan instance cleanup needs to be done before the upstream entries are
force-flushed.
2. also vxlan callbacks need to be ignored post instance-cleanup.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agobgpd: lock the tenant-vrf associated with the l2-vni
Anuradha Karuppiah [Wed, 17 Apr 2019 16:39:03 +0000 (09:39 -0700)]
bgpd: lock the tenant-vrf associated with the l2-vni

The l2vni (bgpevpn instance) was maintaining a back pointer to the
tenant vrf without locking it. This would result in bgp_terminate crashing
as the tenant-vrf is released before the underlay-vrf (vpn->bgp_vrf->l2vnis
is NULL). Call stack -
BGP: [bt 3] /lib/libfrr.so.0(listnode_delete+0x11) [0x7f041c967f51]
BGP: [bt 4] /usr/lib/frr/bgpd(bgp_evpn_free+0x26) [0x55e3428eea46]
BGP: [bt 5] /lib/libfrr.so.0(hash_iterate+0x4a) [0x7f041c95f00a]
BGP: [bt 6] /usr/lib/frr/bgpd(bgp_evpn_cleanup+0x22) [0x55e3428f0a72]
BGP: [bt 7] /usr/lib/frr/bgpd(bgp_free+0x180) [0x55e342955f50]
PIM: vxlan SG (*,239.1.1.111) term mroute-up del
BGP: [bt 8] /usr/lib/frr/bgpd(bgp_delete+0x43a) [0x55e342959d7a]
BGP: [bt 9] /usr/lib/frr/bgpd(sigint+0xee) [0x55e3428d6a5e]

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Reviewed-by: Vivek Venkataraman <vivek@cumulusnetworks.com>
Reviewed-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agodoc: add config sample for pim-evpn
Anuradha Karuppiah [Mon, 8 Apr 2019 22:22:23 +0000 (15:22 -0700)]
doc: add config sample for pim-evpn

Sample l2-vni config via ifupdown2 -
auto vx-10100
iface vx-10100
vxlan-id 10100
bridge-access 100
vxlan-local-tunnelip 27.0.0.11
vxlan-mcastgrp 239.1.1.100 >>>>>>>>>.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: cleanup unncessary null pointer check
Anuradha Karuppiah [Sat, 6 Apr 2019 15:37:13 +0000 (08:37 -0700)]
pimd: cleanup unncessary null pointer check

This was resulting in static analyzer warnings for subsequent usage
of the same pointer -

pimd/pim_vxlan.c:962:36: warning: Access to field 'info' results in a
dereference of a null pointer (loaded from variable 'ifp')
        pim_ifp = (struct pim_interface *)ifp->info;
                                          ^~~~~~~~~
1 warning generated.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: create pimreg implicity if ipmr-lo is the first pim device
Anuradha Karuppiah [Sat, 6 Apr 2019 14:52:11 +0000 (07:52 -0700)]
pimd: create pimreg implicity if ipmr-lo is the first pim device

On the first pim interface creation pimreg needs to be implicitly
created.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: hidden command to set MLAG parameters
Anuradha Karuppiah [Tue, 26 Mar 2019 20:47:54 +0000 (13:47 -0700)]
pimd: hidden command to set MLAG parameters

The MLAG component on the switch is expected to provide some
properties (such as peerlink-rif) to bootstrap the anycast-VTEP
functionality. The final interface for this is being defined as
a part of the pim-mlag functionality.

This commit provides a hidden command to test the anycast-VTEP
functionality independent of the MLAG component.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: display commands for the pim-vxlan-sg database and worklist
Anuradha Karuppiah [Mon, 25 Mar 2019 00:39:22 +0000 (17:39 -0700)]
pimd: display commands for the pim-vxlan-sg database and worklist

Sample output:
root@TORS1:~# vtysh -c "show ip pim vxlan-groups"
Codes: I -> installed
Source          Group           Input           Output          Flags
27.0.0.7        239.1.1.101     lo                              I
*               239.1.1.100     -               ipmr-lo         I
*               239.1.1.101     -               ipmr-lo         I
27.0.0.7        239.1.1.100     lo                              I
root@TORS1:~#

root@TORS1:~# vtysh -c "show ip pim vxlan-work"
Codes: I -> installed
Source          Group           Input           Flags
27.0.0.7        239.1.1.100     lo                              I
PS: note the worklist dump is a hidden command

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: cli changes for pim-debug-vxlan
Anuradha Karuppiah [Mon, 25 Mar 2019 00:34:45 +0000 (17:34 -0700)]
pimd: cli changes for pim-debug-vxlan

Sample:
root@TORC12:~# vtysh -c "show run" |grep "debug pim vxlan"
debug pim vxlan
root@TORC12:~# vtysh -c "show debug" |grep "pim vxlan"
debug pim vxlan
root@TORC12:~#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: use VTEP-PIP as pim-register's ip header SIP
Anuradha Karuppiah [Mon, 25 Mar 2019 00:15:39 +0000 (17:15 -0700)]
pimd: use VTEP-PIP as pim-register's ip header SIP

The unique physical IP is used as the SIP in the ip header to ensure
that pim-register-stop makes it back to the right MLAG switch.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: VxLAN-AA base APIs
Anuradha Karuppiah [Sun, 24 Mar 2019 23:53:32 +0000 (16:53 -0700)]
pimd: VxLAN-AA base APIs

1. peerlink-rif as OIF in origination mroutes -
Hosts are multi-homed to the anycast-VTEP pair and can send BUM traffic to
either switch. But the RP would have only joined one MLAG switch for
pulling down the MDT. To make that work we add the peerlink/ISL as
an OIF to origination mroutes (TORC11<=>TORC12 is an anycast VTEP pair) -
root@TORC11:~# ip mr |grep "(36.0.0.9, 239.1.1.100)"
(36.0.0.9, 239.1.1.100)  Iif: peerlink-3.4094 Oifs: peerlink-3.4094 uplink-1
root@TORC11:~#
root@TORC12:~# ip mr |grep "(36.0.0.9, 239.1.1.100)"
(36.0.0.9, 239.1.1.100)  Iif: peerlink-3.4094 Oifs: peerlink-3.4094
root@TORC12:~#

2. VTEP-PIP as register source -
TORC11 and TORC12 share the same anycast VTEP IP (36.0.0.9 in the above
example). And that is the source registered by both VTEPs for all the BUM
mcast-groups. However to allow the pim register start machine to close
the SIP in the register-pkt's IP header must be set to an unique IP address.
This is the VTEP PIP.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: handling termination device in the MFC
Anuradha Karuppiah [Sun, 24 Mar 2019 19:31:50 +0000 (12:31 -0700)]
pimd: handling termination device in the MFC

1. special handling of term device in orig mroutes -
The multicast-vxlan termination device ipmr-lo is added to the (*, G)
mroute -
(0.0.0.0, 239.1.1.100)          Iif: uplink-1   Oifs: uplink-1 ipmr-lo
This means that it will be inherited into all the SG entries including the
origination mroute. However we cannot terminate the traffic we originate
so some special handling is needed to exclude the termination device
in the origination entries -
27.0.0.7, 239.1.1.100)          Iif: lo         Oifs: uplink-1

2. special handling of term device on the MLAG pair -
Both MLAG switches pull down BUM-MDT traffic but only one (the DF) can
terminate the traffic. The non-DF must not exclude the termination device
from the MFC to prevent dups to the overlay.
DF -
root@TORC11:~# ip mr |grep "(0.0.0.0, 239.1.1.100)"
(0.0.0.0, 239.1.1.100)           Iif: uplink-1   Oifs: uplink-1 ipmr-lo  State: resolved
root@TORC11:~#
non-DF -
root@TORC12:~# ip mr |grep "(0.0.0.0, 239.1.1.100)"
(0.0.0.0, 239.1.1.100)           Iif: uplink-1   Oifs: uplink-1  State: resolved
root@TORC12:~#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: setup multicast vxlan tunnel termination device
Anuradha Karuppiah [Sun, 24 Mar 2019 15:50:50 +0000 (08:50 -0700)]
pimd: setup multicast vxlan tunnel termination device

An interface needs to be designated as "termination device" and added to
the termination mroute's OIL. This is used by kernel and ASIC backends
to vxlan-decaps matching flows.

The default termination device is expected to have the prefix (start
sub-string) "ipmr-lo". This can be made configurable if needed -
root@TORS1:~# ip -d link show ipmr-lo
28: ipmr-lo: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default
    link/ether 12:5a:ae:74:51:a2 brd ff:ff:ff:ff:ff:ff promiscuity 0
    dummy addrgenmode eui64
root@TORS1:~# ip mr

This commit includes the changes to enable pim implicitly on the device
and set it up as the vxlan-term device per-pim-instance.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: update vxlan mroute entries when the lo or peerlink vif is updated
Anuradha Karuppiah [Sat, 23 Mar 2019 15:25:20 +0000 (08:25 -0700)]
pimd: update vxlan mroute entries when the lo or peerlink vif is updated

For vxlan origination mroutes the IIF is pinned to
a. lo for single VTEPs
b. peerlink-rif for anycast VTEPs

This commit includes the changes to react to  pim-vifi add/del for these
devices.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: add termination mroutes for each vxlan multicast tunnels
Anuradha Karuppiah [Sat, 23 Mar 2019 14:47:47 +0000 (07:47 -0700)]
pimd: add termination mroutes for each vxlan multicast tunnels

To terminate a multicast VxLAN tunnel entry we setup a mroute with
ipmr-lo in the OIL -
(0.0.0.0, 239.1.1.100)           Iif: uplink-1   Oifs: uplink-1 ipmr-lo

This is done by the vxlan component that add ipmr-lo as a local
member to termination SG entries. In addition termination entries
are also subject to MLAG DF election on the anycast VxLAN-AA setup.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: MLAG flag defintions in the PIM upstream entries
Anuradha Karuppiah [Sat, 23 Mar 2019 14:16:07 +0000 (07:16 -0700)]
pimd: MLAG flag defintions in the PIM upstream entries

Two flags have been introduced per-upstream entry -
1. XXX_MLAG_VXLAN - This indicates that MLAG DF (designated-forwarded)
election is needed on the entry. In the case of pim-evpn this flag is set
for termination (*, G) entries and will be inherited by the (S, G) entries
that are created as a result of SPT switchover on the G.

2. XXX_MLAG_NON_DF - This is set on entries that have lost the
DF election. Such entries are primarily used for blackholing traffic on
one of the MLAG switches. On a hardware accelerated switch this blackholing
happens in the ASIC preventing (non-needed) traffic hitting the CPU.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: register local VTEP-IP for each BUM MDT via NULL registers
Anuradha Karuppiah [Fri, 22 Mar 2019 20:38:50 +0000 (13:38 -0700)]
pimd: register local VTEP-IP for each BUM MDT via NULL registers

For multicast vxlan tunnels we register the local VTEP-IP independent
of the prescence of BUM traffic i.e. we prime the pump. This
is acheived via NULL registers.

VxLAN orig entries with upstream in a PIM_REG_JOIN state are linked to
a work list for periodic NULL register transmission. Once the SPT setup
is complete the upstream-entry moves to a PIM_REG_PRUNE state and is
remved from the VxLAN work list.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: add peerlink-rif to the origination-mroute's OIL
Anuradha Karuppiah [Fri, 22 Mar 2019 19:40:39 +0000 (12:40 -0700)]
pimd: add peerlink-rif to the origination-mroute's OIL

In a PIM MLAG setup (say L11<->L12 is the anycast VTEP pair) the RP
can choose to join either MLAG switch as the anycast VTEP-IP is
present on both. Let's say the RP joins L11.

Hosts are dual connected to L11<->L12 and can send traffic to either
switch. Let's say a host sends broadcast traffic to L12; now L12
must encapsulate and send the traffic toward L11. To do that the
origination-mroute on L12 must include the ISL in its OIL -
(36.0.0.9, 239.1.1.100)   Iif: peerlink-3.4094 Oifs: peerlink-3.4094

L11 has a similar mroute -
(36.0.0.9, 239.1.1.100)  Iif: peerlink-3.4094 Oifs: peerlink-3.4094 uplink-1
This mroute is used to rx traffic on peerlink-3.4094 and send it out of
uplink-1. Note that this mroute also includes the peerlink-rif in its
OIL. Explicit removal of IIF from OIL is done by the kernel (and other
dataplanes) to prevent traffic looping.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: support for vxlan origination-upstream entries
Anuradha Karuppiah [Fri, 22 Mar 2019 18:44:10 +0000 (11:44 -0700)]
pimd: support for vxlan origination-upstream entries

For every (local-vtep-ip, bum-mcast-grp) registered by evpn an origination
mroute is setup by pimd. The purpose of this mroute is to forward vxlan
encapsulated BUM -
Sample mroute (single VTEP):
(27.0.0.7, 239.1.1.100)     Iif: lo      Oifs: uplink-1
Sample mroute (anycast VTEP):
(36.0.0.9, 239.1.1.100)          Iif: peerlink-3.4094\
                                       Oifs: peerlink-3.4094 uplink-1

This commit is part-1 of orignation mroute setup and includes setup
of upstream entries with vxlan properties.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: header changes for pim-vxlan staggered processing
Anuradha Karuppiah [Fri, 22 Mar 2019 17:31:20 +0000 (10:31 -0700)]
pimd: header changes for pim-vxlan staggered processing

pim-vxlan work is maintained in a lists and processing staggered. One
such work is the generation of periodic null registers for the local
VTEP-IP.

This info is instance agnostic and maintained in a global cache.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: header changes to cache MLAG information needed for pim-vxlan
Anuradha Karuppiah [Fri, 22 Mar 2019 17:22:42 +0000 (10:22 -0700)]
pimd: header changes to cache MLAG information needed for pim-vxlan

This information will come in from a MLAG component. Hidden commands
will also be provided for testing the interface independent of the
separate MLAG component.

PS: It is possible that this cache will be merged with the base
pim-mlag datastructures once they are available.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: vxlan definitions for creation origination and terminatiom mroutes
Anuradha Karuppiah [Fri, 22 Mar 2019 17:10:28 +0000 (10:10 -0700)]
pimd: vxlan definitions for creation origination and terminatiom mroutes

pim vxlan component will create upstream entries and OIFs for
multicast VxLAN tunnel origination and termination in single-VTEP
and anycast-VTEP (MLAG) setups.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: extern pim_null_register_send
Anuradha Karuppiah [Fri, 22 Mar 2019 17:01:40 +0000 (10:01 -0700)]
pimd: extern pim_null_register_send

pim_vxlan will use this for registering the local-VTEP-IP wth the RP
independent of the presence of BUM traffic.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: API for enabling pim on the vxlan term device ipmr-lo
Anuradha Karuppiah [Fri, 22 Mar 2019 16:48:17 +0000 (09:48 -0700)]
pimd: API for enabling pim on the vxlan term device ipmr-lo

ipmr-lo is a dummy netdev with no additional addressing requirements -
root@TORS1:~# ip -d link show ipmr-lo
28: ipmr-lo: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default
    link/ether 12:5a:ae:74:51:a2 brd ff:ff:ff:ff:ff:ff promiscuity 0
    dummy addrgenmode eui64
root@TORS1:~#

This device is used by pim-vxlan to signify multicast-vxlan-tunnel
termination.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: add new OIF type in prep for vxlan support
Anuradha Karuppiah [Thu, 3 Jan 2019 17:45:35 +0000 (09:45 -0800)]
pimd: add new OIF type in prep for vxlan support

In an anycast VTEP setup the peerlink-rif (ISL) is added as a OIF to the
tunnel origination mroute. A new OIF protocol, VxLAN, has been added to
allow that functionalty.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: definition of pim-evpn origination and termination devices
Anuradha Karuppiah [Fri, 22 Mar 2019 15:53:39 +0000 (08:53 -0700)]
pimd: definition of pim-evpn origination and termination devices

Two devices have special significance to multicast VxLAN tunnels -
1. tunnel origination device -
This device is used as the source device to vxlan-encapsulate BUM traffic.
In the case of the default-vrf this is lo. And in the case of non-default
VRF this is vrf-net-device. This patchset is limited to default-VRF
underlay so all subsequent references of origination-dev are to lo. But it
is possible in the future to extend support to non-default VRFs.
Sample origination mroute on single-VTEP:
(27.0.0.7, 239.1.1.100)          Iif: lo         Oifs: uplink-1

In the case of MLAG we need to mroute traffic form the MLAG-peer so
we force the IIF to the ISL.
Sample origination mroute on MLAG-VTEP:
(36.0.0.9, 239.1.1.100)          Iif: peerlink-3.4094 Oifs: peerlink-3.4094 uplink-1

2. tunnel termination device -
This device is used in the OIL to indicate that packets matching the flow
must be vxlan terminated and overlay packets subsequently forward to the
tenants. A special device has been created for this purpose called ipmr-lo.
This is a simple dummy interface from the kernel perspective which has
special siginficance only to pimd which implicitly enabled pim on the
device and adds it to the termination mroutes.
Sample termination mroute:
(0.0.0.0, 239.1.1.100)           Iif: uplink-1   Oifs: uplink-1 ipmr-lo

PS: currently we default the termination device name to "ipmr-lo" but in
the future it is possible to provide a config command to set the
termination device.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: add new source types for vxlan orgination and termination mroutes
Anuradha Karuppiah [Thu, 21 Mar 2019 23:00:30 +0000 (16:00 -0700)]
pimd: add new source types for vxlan orgination and termination mroutes

PIM VxLAN handling will create two types of upstream entries and
maintain app-specific properties against the entry.

This commit provides the header definitions for that.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: per-SG control to allow any router to register itself as source
Anuradha Karuppiah [Tue, 26 Mar 2019 20:44:36 +0000 (13:44 -0700)]
pimd: per-SG control to allow any router to register itself as source

In a VxLAN-AA setup both the anycast VTEPS can send VxLAN encapsulated
traffic. This is despite the fact that the it is not-DR on the IIF
associated with the originating mroute.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: provide a per-SG control to disabled register encapsulation of data
Anuradha Karuppiah [Tue, 26 Mar 2019 20:43:23 +0000 (13:43 -0700)]
pimd: provide a per-SG control to disabled register encapsulation of data

In a MLAG setup both of the VTEPs can rx and reg-encapsulate BUM traffic
toward the RP. To prevent these duplicates we need a mechanism to disable
register encaps on specific mroutes.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: allow mroutes with IIF in the OIL
Anuradha Karuppiah [Tue, 26 Mar 2019 20:38:53 +0000 (13:38 -0700)]
pimd: allow mroutes with IIF in the OIL

This is specifically needed to allow pim-evpn mroutes in the MLAG setup -
(36.0.0.11, 239.1.1.100)   Iif: peerlink.4094   Oifs: uplink-1, peerlink.4094

I could have gone the other way and disabled PIM_ENFORCE_LOOPFREE_MFC but
that opens the door too wide. Relaxing the checks for mlag-specific mroutes
seemed like the safer choice.

This commit provides the infrastructure to relax checks on a per-mroute
basis.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years ago pimd: provide a mechanism to pin the IIF for an SG entry
Anuradha Karuppiah [Tue, 26 Mar 2019 20:36:43 +0000 (13:36 -0700)]
 pimd: provide a mechanism to pin the IIF for an SG entry

In the case of vxlan origination entries IIF is set to -
1. lo for single VTEPs
2. MLAG-ISL for VTEPs multihomed via MLAG.

This commit creates the necessary infrastructure by -
1. allowing the IIF to be set statically (without RPF lookup)
2. and by preventing next-hop-tracking registration

PS: Note that I have skipped additional checks in pim_upstream_del
intentionally i.e. an attempt will be made to remove nexthop-tracking
for the upstream entry (with STATIC_IIF) which will fail because of the
up-entry not being in the nh's hash table. Ideally we should maintain
a nh pointer in the up-entry to prevent this unnecessary processing.
In the abscence of that I wanted to avoid spraying STATIC_IIF checks
all over.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: provide an api to force stop kat on an upstream entry
Anuradha Karuppiah [Thu, 21 Mar 2019 17:00:54 +0000 (10:00 -0700)]
pimd: provide an api to force stop kat on an upstream entry

In the case of pim vxlan we create and keep upstream entries alive
in the abscence of traffic. So we need a mechanism to purge entries
abruptly on vxlan SG delete without having to wait for the entry
to age out.

These are again just the infrastructure changes needed for it.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: provide an upstream control to prevent KAT expiry
Anuradha Karuppiah [Thu, 21 Mar 2019 16:27:03 +0000 (09:27 -0700)]
pimd: provide an upstream control to prevent KAT expiry

For vxlan BUM MDTs we prime the pump and register the local-VTEP-ip
as source even before the first BUM packet is rxed. This commit provides
the infrastructure changes needed for that.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: handle VxLAN SG notifications from zebra
Anuradha Karuppiah [Thu, 21 Mar 2019 15:49:09 +0000 (08:49 -0700)]
pimd: handle VxLAN SG notifications from zebra

zebra sends (S, G) and (*, G) entries for BUM mcast groups to pimd. This
commit includes the changes to handle the notifications and trigger the
creation of (S, G) base cache in pimd.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agopimd: initial infrastructure to maintain VxLAN SG database
Anuradha Karuppiah [Tue, 19 Mar 2019 22:54:02 +0000 (15:54 -0700)]
pimd: initial infrastructure to maintain VxLAN SG database

These entries will be used over the subsequent commits for
1. vxlan-tunnel-termination handling - setup MDT to rx VxLAN encapsulated
BUM traffic.
2. vxlan-tunnel-origination handling - register local-vtep-ip as a
multicast source.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agolib, zebra: changes to propagate vxlan mcast SG entries to pimd
Anuradha Karuppiah [Tue, 19 Mar 2019 20:56:46 +0000 (13:56 -0700)]
lib, zebra: changes to propagate vxlan mcast SG entries to pimd

These updates act as triggers to pimd to -
1. join the MDT for rxing VxLAN encapsulated BUM traffic
2. register the local-vtep-ip as a source for the MDT

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agozebra: trigger SG update on l2-vni<=>mcast-grp changes
Anuradha Karuppiah [Tue, 19 Mar 2019 20:26:22 +0000 (13:26 -0700)]
zebra: trigger SG update on l2-vni<=>mcast-grp changes

An SG entry is added (if one doesn't already exist) when a l2-VNI is
associated with a mcast-grp and local-vtep-ip.

And viceversa; when the last l2-vni using a MDT is removed the SG
entry is deleted.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agozebra: vxlan (S, G) cache management
Anuradha Karuppiah [Tue, 19 Mar 2019 20:15:23 +0000 (13:15 -0700)]
zebra: vxlan (S, G) cache management

Based code for adding (S, G) entries. These entries are created when
a mcast-group and local-VTEP-IP is associated with and L2 VNI.

The parent (*, G) entries are created implicitly on the (S, G) addition
and play the role of termination entries.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agozebra: maintain mcast tunnel origination and termination SG entries
Anuradha Karuppiah [Tue, 26 Mar 2019 20:30:29 +0000 (13:30 -0700)]
zebra: maintain mcast tunnel origination and termination SG entries

Each multicast tunnel is associated with a -
1. Tunnel origination mroute that is used for forwarding the
VxLAN encapsulated flow -
S - local VTEP-IP
G - BUM mcast-group
2. And a tunnel termination entry -
S - * (any remote VTEP)
G - BUM mcast-group

Multiple L2 VNIs can share the same BUM mcast group (and local-VTEP-IP).
Zebra maintains an mcast (SG) hash table to pass this info to pimd for
subsequent MDT setup.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agolib: return listnode on add for subsequent efficent del
Anuradha Karuppiah [Tue, 19 Mar 2019 18:39:51 +0000 (11:39 -0700)]
lib: return listnode on add for subsequent efficent del

Having to lookup the DLL node to delete it defeats one purpose of using
DLLs.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agolib: move SG prefix2str APIs from pimd to lib
Anuradha Karuppiah [Tue, 19 Mar 2019 18:36:41 +0000 (11:36 -0700)]
lib: move SG prefix2str APIs from pimd to lib

This is to allow zebra to use these APIs instead of re-defining.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agozebra: install flood FDB entry only if the remote VTEP asked for HER
Anuradha Karuppiah [Tue, 19 Mar 2019 17:37:22 +0000 (10:37 -0700)]
zebra: install flood FDB entry only if the remote VTEP asked for HER

Remote VTEPs advertise the flood mode via IMET and the ingress VTEP
needs to perform head-end-replication of BUM packets to it only if the
PMSI tunnel type is set to ingress-replication. If a type-3 route is not
rxed or rxed with a mode other than ingress-replication we can skip
installation of the flood fdb entry for that L2-VNI. In that case the
remote VTEP is either not interested in BUM traffic or is using a
"static-config" based replication mode like PIM.

Sample output with HER -
=======================
root@TORS1:~# vtysh -c "show evpn vni 1000" |grep "Remote\|flood"
 Remote VTEPs for this VNI:
  27.0.0.8 flood: HER
root@TORS1:~#

Sample output with PIM-SM -
=========================
root@TORS2:~# vtysh -c "show evpn vni 1000" |grep "Remote\|flood"
 Remote VTEPs for this VNI:
  27.0.0.7 flood: -
root@TORS2:~#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agobgpd: propagate flood mode to zebra based on the tunnel-type in the IMET route
Anuradha Karuppiah [Tue, 19 Mar 2019 18:29:04 +0000 (11:29 -0700)]
bgpd: propagate flood mode to zebra based on the tunnel-type in the IMET route

IMET/type-3 routes are used by VTEPs to advertise the flood mode for BUM
traffic via the PMSI tunnel attribute. If a type-3 route is not rxed from
a remote-VTEP we default to "no-head-end-rep" for that remote-VTEP. In such
cases static-config such as PIM is likely used for BUM flooding.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agobgpd: suppress IMET route generation if flood mode is PIM-SM
Anuradha Karuppiah [Tue, 26 Mar 2019 20:26:33 +0000 (13:26 -0700)]
bgpd: suppress IMET route generation if flood mode is PIM-SM

IMET route is optional if the flood mode is PIM-SM and serves
no functional purpose. So this change limits type-3 route generation
to flood-mode=head-end-replication.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agobgpd: maintain flood mcast group per-l2-vni
Anuradha Karuppiah [Tue, 19 Mar 2019 18:08:24 +0000 (11:08 -0700)]
bgpd: maintain flood mcast group per-l2-vni

If PIM-SM if used for BUM flooding the multicast group address can be
configured per-vxlan-device. BGP receives this config from zebra via
the L2 VNI add/update.

Sample output -
root@TORS1:~# vtysh -c "show bgp l2vpn evpn vni 1000" |grep Mcast
  Mcast group: 239.1.1.100
root@TORS1:~#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agozebra: maintain the mcast-grp per-l2vni
Anuradha Karuppiah [Tue, 19 Mar 2019 16:10:47 +0000 (09:10 -0700)]
zebra: maintain the mcast-grp per-l2vni

This info is propagated to bgpd for appropriate IMET route generation.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agozebra: process mcast-grp rxed in the vxlan-device
Anuradha Karuppiah [Tue, 19 Mar 2019 15:57:04 +0000 (08:57 -0700)]
zebra: process mcast-grp rxed in the vxlan-device

BUP mcast IP address is maintained per-vxlan-device.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agozebra: header changes for l2 vni bum-mcast-grp handling
Anuradha Karuppiah [Mon, 18 Mar 2019 19:35:45 +0000 (12:35 -0700)]
zebra: header changes for l2 vni bum-mcast-grp handling

The multicast group ip address for BUM traffic is configurable per-l2-vni.
One way to configure that is to setup a vxlan device that per-l2-vni and
specify the address against that vxlan device -
root@TORS1:~# vtysh -c "show interface vx-1000" |grep -i vxlan
  Interface Type Vxlan
  VxLAN Id 1000 VTEP IP: 27.0.0.15 Access VLAN Id 1000 Mcast 239.1.1.100
root@TORS1:~# vtysh -c "show evpn vni 1000" |grep Mcast
 Mcast group: 239.1.1.100
root@TORS1:~#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agoripd: unlink if-rmap container from global list before removing it
Renato Westphal [Fri, 19 Apr 2019 19:54:29 +0000 (16:54 -0300)]
ripd: unlink if-rmap container from global list before removing it

This solves a crash that happens if the "route-map" command is used
after "router rip" + "no router rip" + "router rip".

Once interface route-maps are converted to the new northbound model,
we'll be able to remove the if_rmap_ctx_list global list (which is
an ugly hack to make things work right now).

Bug found by the CLI fuzzer.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd, ripngd: fix cleaning up of offset lists
Renato Westphal [Thu, 18 Apr 2019 15:32:19 +0000 (12:32 -0300)]
ripd, ripngd: fix cleaning up of offset lists

We should never attempt to remove a list item in the "del" callback
of the list. This is already performed by the list_delete() function,
doing it twice leads to crashes or memory corruption.

Introduce the offset_list_free() function so that we can separate the
removal and deallocation of offset lists into separate functions,
without code duplication. offset_list_del() will be used by the
northbound callbacks to remove offset lists, while offset_list_free()
will be used by rip_clean() to clean up all RIP offset lists using
list_delete(). Do the same for ripngd.

This is a fallout from the ripd/ripngd northbound conversion.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoMerge pull request #4165 from dslicenc/rnh-invalid-nexthops
Mark Stapp [Fri, 19 Apr 2019 18:11:22 +0000 (14:11 -0400)]
Merge pull request #4165 from dslicenc/rnh-invalid-nexthops

zebra: stop sending invalid nexthops to clients

5 years agozebra: stop sending invalid nexthops to clients
Don Slice [Mon, 15 Apr 2019 18:27:00 +0000 (18:27 +0000)]
zebra: stop sending invalid nexthops to clients

Found that zebra_rnh_apply_nht_rmap would set the
NEXTHOP_FLAG_ACTIVE if not blocked by the route-map, even
if the flag was not active prior to the check.  This fix
changes the flag used to denote the nexthop is filtered so
that proper active state can be retained. Additionally,
found two cases where we would send invalid nexthops via
send_client, which would also cause this crash.  All three
fixed in this commit.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
5 years agoMerge pull request #4164 from opensourcerouting/rm-ports
Quentin Young [Fri, 19 Apr 2019 16:03:40 +0000 (12:03 -0400)]
Merge pull request #4164 from opensourcerouting/rm-ports

ports: remove abandoned ports subdirectory

5 years agoMerge pull request #4154 from donaldsharp/zebra_run_once
Mark Stapp [Fri, 19 Apr 2019 15:57:39 +0000 (11:57 -0400)]
Merge pull request #4154 from donaldsharp/zebra_run_once

Zebra: run nht once

5 years agodoc: Cleanup documentation for new pim commands
Donald Sharp [Thu, 18 Apr 2019 20:41:35 +0000 (16:41 -0400)]
doc: Cleanup documentation for new pim commands

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Add ability to select join S,G for 'show ip pim join`
Donald Sharp [Thu, 18 Apr 2019 20:23:02 +0000 (16:23 -0400)]
pimd: Add ability to select join S,G for 'show ip pim join`

Add a bit of code to allow us to look at specified S,G for
the upstream available to us.

If one item is listed we assume Group, if both we assume Source
then Group.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Add ability to select upstream on S,G for `show ip pim upstream`
Donald Sharp [Thu, 18 Apr 2019 20:09:03 +0000 (16:09 -0400)]
pimd: Add ability to select upstream on S,G for `show ip pim upstream`

Add a bit of code to allow us to look at specified S,G for
the upstreams available to us.

If one item is listed we assume Group, if both we assume Source then
Group.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Update flag output for route entry dump
Donald Sharp [Wed, 17 Apr 2019 15:47:48 +0000 (11:47 -0400)]
zebra: Update flag output for route entry dump

Update the nexthop flag output for the route entry dump to
include all possible flag states be output.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Run nexthop_active_check once
Donald Sharp [Tue, 16 Apr 2019 13:06:35 +0000 (09:06 -0400)]
zebra: Run nexthop_active_check once

We currently run nexthop_active_check multiple times.  Make the
code run once and figure out state from that.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Double check is not necessary in nexthop_active_update
Donald Sharp [Tue, 16 Apr 2019 13:07:12 +0000 (09:07 -0400)]
zebra: Double check is not necessary in nexthop_active_update

The nexthop_active_update command looks at each individual
nexthop and decides if it has changed.  If any nexthop
has changed we will set the re->status to ROUTE_ENTRY_CHANGED
and ROUTE_ENTRY_NEXTHOPS_CHANGED.

Additionally the test for old_nh_num != curr_active
makes no sense because suppose we have several events
we are processing at the same time and a total ecmp
of 16 but 14 are active at the start and 14 are active
at the end but different interfaces are up or down.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib, zebra: Remove unused flag
Donald Sharp [Tue, 16 Apr 2019 12:37:24 +0000 (08:37 -0400)]
lib, zebra: Remove unused flag

The NEXTHOP_FLAG_FILTERED went away when we started treating
static routes like every other route in the system.  This was
a special case for handling static route code that just didn't
get finished cleaning up.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: nexthop_active_update does not need set
Donald Sharp [Tue, 16 Apr 2019 12:09:56 +0000 (08:09 -0400)]
zebra: nexthop_active_update does not need set

We are effectively calling nexthop_active_update() on every
route entry being processed for installation at least 2 times.
This is a bit ridiculous.  We need to resolve the nexthops
when we know a route has changed in some manner, so do so.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #4116 from nitinsoniism/show_l2vpn_evpn_route_detail
Sri Mohana Singamsetty [Thu, 18 Apr 2019 18:22:50 +0000 (08:22 -1000)]
Merge pull request #4116 from nitinsoniism/show_l2vpn_evpn_route_detail

bgpd: new show cmd - bgp l2vpn evpn route detail

5 years agolib: Add a counter for number of nexthops
Donald Sharp [Fri, 15 Feb 2019 16:02:44 +0000 (11:02 -0500)]
lib: Add a counter for number of nexthops

Add a ability to count the number of nexthops in a nexthop_group.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agotests: bgp_l3vpn_to_bgp_vrf were bailing to quickly
Donald Sharp [Thu, 18 Apr 2019 00:47:44 +0000 (20:47 -0400)]
tests: bgp_l3vpn_to_bgp_vrf were bailing to quickly

The tests are not coming up consistently on my test box.  Add a bit of wait
time to test to allow normal bgp when the first attempt doesn't come up.
Especially since bgp timeouts are 120 seconds with non datacenter compiles.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #4141 from opensourcerouting/nb-minor-fixes
Mark Stapp [Thu, 18 Apr 2019 17:48:15 +0000 (13:48 -0400)]
Merge pull request #4141 from opensourcerouting/nb-minor-fixes

northbound minor fixes and improvements

5 years agoports: remove abandoned ports subdirectory
Renato Westphal [Thu, 18 Apr 2019 17:05:07 +0000 (14:05 -0300)]
ports: remove abandoned ports subdirectory

This subdirectory is outdated in all possible ways. Remove it.

FRR already has a FreeBSD port and it's maintained separately.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoMerge pull request #4160 from pguibert6WIND/optionZforgotten
Renato Westphal [Thu, 18 Apr 2019 16:18:42 +0000 (13:18 -0300)]
Merge pull request #4160 from pguibert6WIND/optionZforgotten

bgpd: add the -Z option to run bgp without zebra

5 years agolib: make nb_candidate_edit() more flexible
Renato Westphal [Mon, 15 Apr 2019 22:04:30 +0000 (19:04 -0300)]
lib: make nb_candidate_edit() more flexible

Certain operations, like removing non-presence containers or
modifying list keys, are not considered to be valid from the
perspective of the northbound layer. This is because we want to
implement a minimum set of northbound configuration callbacks and
use them to process all possible configuration changes.

The removal of a np-container [1], for example, can be processed by
calling the "delete" callback of all of its child nodes (recursion
is used for np-container child nodes). Similarly, the modification
of a list key can be processed as if the corresponding list entry
was removed and readded with updated key values. This strategy saves
us the burden of implementing lots of extra configuration callbacks.

That said, the nb_operation_is_valid() function shouldn't be used
for anything other than checking which callbacks are valid for
which YANG nodes. Using it in the nb_candidate_edit() function
is inappropriate as we want as much flexibility as possible when
editing a candidate configuration. We should allow CLI commands,
for example, to remove np-containers (the northbound layer will then
figure out which callbacks need to be called when this candidate
is committed). Remove the check.

[1] We can't do the same for presence containers since they have a
"create" callback associated with them.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>