Commit Graph

353 Commits

Author SHA1 Message Date
Anuradha Karuppiah
c36e442c4b zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.

The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).

Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"

Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
  Detection max-moves 5, time 180
EVPN MH:
  mac-holdtime: 60s, neigh-holdtime: 60s
  startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
  uplink-cfg-cnt: 4, uplink-active-cnt: 4
  protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
  Link ups:       0    last: (never)
  Link downs:     1    last: 2020/04/26 20:38:03.53
  PTM status: disabled
  vrf: default
  OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote  Node/s hostd-11 and Ports swp1
  index 58 metric 0 mtu 9152 speed 4294967295
  flags: <UP,BROADCAST,MULTICAST>
  Type: Ethernet
  HWaddr: 00:02:00:00:00:35
  Interface Type bond
  Master interface: bridge
  EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
  protodown: off rc: startup-delay  <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
  Link ups:       0    last: (never)
  Link downs:     3    last: 2020/04/26 20:38:03.52
  PTM status: disabled
  vrf: default
  index 7 metric 0 mtu 9152 speed 10000
  flags: <UP,BROADCAST,MULTICAST>
  Type: Ethernet
  HWaddr: 00:02:00:00:00:35
  Interface Type Other
  Master interface: hostbond1
  protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-10-27 09:34:09 -07:00
Mark Stapp
9bcef951be zebra: replace inet_ntoa
Stop using inet_ntoa - use %pI4 or inet_ntop instead

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-22 13:37:25 -04:00
Donatas Abraitis
2dbe669bdf :* Convert prefix2str to %pFX
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-10-22 09:07:41 +03:00
Chirag Shah
9bee02322f zebra: display rpc error msg to vtysh
Zebra's clear duplicate detect command is rpc converted.
There is condition where cli fails with human readable message.
Using northboun's errmsg buffer to display error message to
user.

Testing:

bharat# clear evpn dup-addr vni 1002 ip 2011:11::11
Error type: generic error
Error description: Requested IP's associated MAC aa:aa:aa:aa:aa:aa is still in duplicate state

bharat# clear evpn dup-addr vni 1002 ip 11.11.11.11
Error type: generic error
Error description: Requested IP's associated MAC aa:aa:aa:aa:aa:aa is still in duplicate state

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2020-10-05 13:57:54 -07:00
Chirag Shah
c7e83a4efe zebra: avoid duplication node in l3vni l2vni-list
With l2vni flap leading to duplicate entry creation
in l3vni's l2vni-list.
Use list sorted add with no duplicates.

root@TORC11:mgmt:~# show evpn vni 4001
VNI: 4001
  Type: L3
  Tenant VRF: vrf1
  State: Up
  ...
  L2 VNIs: 1000 1000 1000 0 0 1002
root@TORC11:mgmt:~# ip link set down vx-1002
root@TORC11:mgmt:~# ip link set up vx-1002
root@TORC11:mgmt:~# show evpn vni 4001
VNI: 4001
  Type: L3
  Tenant VRF: vrf1
  State: Up
  ...
  L2 VNIs: 1000 1000 1000 0 0 1002 1002

Ticket:CM-31545
Reviewed By:
Testing Done:

With Fix:
Multiple time flaps vni counts remained the same.

root@TORC11:mgmt:~# ip link set down vx-1002
root@TORC11:mgmt:~# ip link set up vx-1002
root@TORC11:mgmt:~# ip link set down vx-1002
root@TORC11:mgmt:~# ip link set up vx-1002
root@TORC11:mgmt:~# net show evpn vni 4001
VNI: 4001
  Type: L3
  Tenant VRF: vrf1
  State: Up
  ...
  L2 VNIs: 1000 1002

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2020-09-28 21:44:30 -07:00
Philippe Guibert
2961d0601c lib, zebra: reuse and adapt ns_list walk functionality
the walk routine is used by vxlan service to identify some contexts in
each specific network namespace, when vrf netns backend is used. that
walk mechanism is extended with some additional paramters to the walk
routine.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-09-11 18:26:23 +02:00
Philippe Guibert
d6bf8f136d zebra: when parsing local entry against dad, retrieve config
when duplicate address detection is observed, some incrementation,
some timing mechanisms need to be done. For that the main evpn
configuration is retrieved. Until now, the VRF that was storing the dad
config parameters was the same VRF that hosted the VXLAN interface. With
netns backend, this is not true, as the VXLAN interface is in the
same VRF as the bridge interface. The modification takes same definition
as in BGP, that is to say that there is a single bgp evpn instance, and
this is that instance that will give the correct config settings.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-09-11 18:26:23 +02:00
Philippe Guibert
6265fbe55c zebra: fdb and neighbor table are read for all zns
all network namespaces are read so as to collect interesting fdb and
neighbor tables for EVPN.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-08-18 09:25:06 -07:00
Philippe Guibert
a237058f59 zebra: zvni_map_to_svi() adaptation for other network namespaces
the function is called with all the network namespaces.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-08-18 09:25:06 -07:00
Philippe Guibert
07509878e3 zebra: importation of bgp evpn rt5 from vni with other netns
With vrf-lite mechanisms, it is possible to create layer 3 vnis by
creating a bridge interface in default vr, by creating a vxlan interface
that is attached to that bridge interface, then by moving the vxlan
interface to the wished vrf.
With vrf-netns mechanism, it is slightly different since bridged
interfaces can not be separated in different network namespaces. To make
it work, the setup consists in :
- creating a vxlan interface on default vrf.
- move the vxlan interface to the wished vrf ( with an other netns)
- create a bridge interface in the wished vrf
- attach the vxlan interface to that bridged interface

from that point, if BGP is enabled to advertise vnis in default vrf,
then vxlan interfaces are discovered appropriately in other vrfs,
provided that the link interface still resides in the vrf where l2vpn is
advertised.
to import ipv4 entries from a separate vrf, into the l2vpn, the
configuration of vni in the dedicated vrf + the advertisement of ipv4
entries in bgp vrf will import the entries in the bgp l2vpn.

the modification consists in parsing the vxlan interfaces in all network
namespaces, where the link resides in the same network namespace as the
bgp core instance where bgp l2vpn is enabled.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-08-18 09:25:06 -07:00
Pat Ruddy
2bdd4461c1 zebra: clean up SA warning in EVPN code
Use asserts rather thank test where the values should definitely
not be NULL.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-08-12 18:03:21 +01:00
Pat Ruddy
8b5fdf2e66 zebra: extract core EVPN functions from zebra_vxlan.c
extract the core EVPN functions from zebra_vxlan.c and put them in
a new file zebra_evpn.c.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-08-12 12:39:34 +01:00
Pat Ruddy
6006414dc9 zebra: clone zebra_vxlan.c to zebra_evpn.c
clone zebra_vxlan.c to create a file zebra_evpn.c for core
EVPN functions whilst retaining the history of zebra_vxlan.c

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-08-12 12:39:34 +01:00
Pat Ruddy
33064a6289 zebra: extract neighbor processing from kernel_neigh_del
extract the neighbor uninstall part of
zebra_vxlan_handle_kernel_neigh_del into a new function
zebra_evpn_neigh_del_ip in zebra_evpn_neigh.c.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-08-12 12:39:34 +01:00
Pat Ruddy
32fe7dfd9b zebra: extract neighbor processing from process_remote_macip_del
extract the neighbor uninstall  part of process_remote_macip_add
into a new function zebra_evpn_neigh_remote_uninstall in
zebra_evpn_neigh.c.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-08-12 12:39:34 +01:00
Pat Ruddy
224315f3e4 zebra: extract neigbor processing from zevpn_gw_macip_add
extract the neighbor part of process_remote_macip_add into a new
function zebra_evpn_neigh_gw_macip_add in zebra_evpn_neigh.c.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-08-12 12:39:34 +01:00
Pat Ruddy
036daaca3e zebra: extract neigbor processing from remote_macip_add
extract the neighbor part of process_remote_macip_add into a new
function process_neigh_remote_macip_add in zebra_evpn_neigh.c.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-08-12 12:39:34 +01:00
Pat Ruddy
7cbae20ade zebra: extract neighbor functions from zebra_vxlan.c
Move neighbor processing functions to new zebra_evpn_neigh.c

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-08-12 12:39:34 +01:00
Pat Ruddy
6336e12b94 zebra: clone zebra_vxlan.c to zebra_evpn_neigh.c
clone zebra_vxlan.c to create a file zebra_evpn_neigh.c for neighbor
dB functions whilst retaining the history of zebra_vxlan.c

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-08-12 12:39:34 +01:00
Pat Ruddy
7bce35354f zebra: extract gateway mac add from zebra_vxlan.c
extract mac_gateway add code from zevi_gw_macip_add and move it to
a new generic function zebra_evpn_mac_gw_macip_add in zebra_evpn_mac.c

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-08-12 12:39:34 +01:00
Pat Ruddy
ad6ca5f423 zebra: extract local mac del from zebra_vxlan.c
extract generic local mac add code from zebra_vxlan_local_mac_del
into a new function zebra_evpn_del_local_mac in zebra_evpn_mac.c

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-08-12 12:39:34 +01:00
Pat Ruddy
d9d3455e09 zebra: extract local mac add code from vxlan
extract the local mac add code from zebra_vxlan_local_mac_add_update
and create a new generic local mac add function
zebra_evpn_add_update_local_mac

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-08-12 12:39:34 +01:00
Pat Ruddy
19fdd1be29 zebra: split out mac_add code from process_remote_macip_add
Move MAC add code from process_remote_macip_add in zebra_vxlan.c
to a generic function process_mac_remote_macip_add in
zebra_evpn_mac.c

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-08-12 12:39:33 +01:00
Pat Ruddy
b299808662 zebra: extract evpn mac functions from zebra_vxlan.c
Move MAC dB specific functions to zebra_evpn_mac.c

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-08-12 12:39:33 +01:00
Pat Ruddy
24268cd07e zebra: clone zebra_vxlan.c to zebra_evpn_mac.c
clone zebra_vxlan.c to create a file zebra_evpn_mac.c for MAC dB
functions whilst retaining the history of zebra_vxlan.c

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-08-12 12:39:33 +01:00
Pat Ruddy
87d76d5403 zebra: rename vni to evpn where appropriate
The main zebra_vni_t hash structure has been renamed to zebra_evpn_t
to allow for other transport underlays. Rename functions and variables
to reflect this change.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-08-12 12:39:33 +01:00
Mark Stapp
b7895aad82 zebra: clean up SA warning in vxlan code
Resolve an SA warning in the vxlan code.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-08-11 08:39:25 -04:00
Anuradha Karuppiah
4a7d61409d zebra: add ESI to the "show evpn mac vni <> mac <> json" output
Sample output -
=============
anuradhak-VirtualBox# anuradhak-VirtualBox# show evpn mac vni 1000 mac 00:00:00:00:00:22 json

{
  "00:00:00:00:00:22":{
    "type":"remote",
    "remoteVtep":"0.0.0.0",
    "localSequence":0,
    "remoteSequence":0,
    "detectionCount":0,
    "isDuplicate":false,
    "syncNeighCount":0,
    "esi":"03:44:38:39:ff:ff:02:00:00:02", >>>>>>>>>>>>>>>>
    "neighbors":"none"
  }
}

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-08-05 06:46:13 -07:00
Anuradha Karuppiah
9e0c2fd182 bgpd, zebra: remove strcpy, strlen and sprintf calls
Replace with safe copy functions - strlcpy, strlcat, strnlen and
snprintf.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-08-05 06:46:13 -07:00
Anuradha Karuppiah
b169fd6fd5 zebra: support for MAC-IP sync routes
MAC-IP routes are used for syncing local entries across redundant
switches in an EVPN-MH setup. A path from a peer that has a local
ES as destination is tagged as a SYNC path. The SYNC path results in the
addition of local MAC and/or local neigh entry in zebra and in the
dataplane.

Implementation overview
=======================
1. Three new flags "local-inactive", "peer-active" and "peer-proxy"
are maintained per-local-MAC and per-local-Neigh entry.
2. The "peer-XXX" flags are set and cleared via SYNC path updates
from BGP. Proxy sync paths result in the setting of "peer-proxy" flag
(and non-proxies result in the "peer-active").
3. A neigh entry that has a "peer-XXX" flag set is programmed as
"static" in the dataplane.
4. A MAC entry that has a "peer-XXX" flag set or is referenced by
a sync-neigh entry (that has a "peer-XXX" flags set) is programmed
as "static" in the dataplane.
5. The sync-seq number is used to normalize the MM seq number across
all the redundant switches i.e. the max MM seq number across all
switches is used by each of the switches. This commit also includes
the changes needed for extended MM seq syncing.
6. A MAC/neigh entry has to be local-active or peer-active to sent to
BGP. An entry that is NOT local-active is sent with the proxy flag (so
BGP can "proxy" advertise it).
7. The "peer-active" flag is aged out by zebra by using a hold_timer
(this is instead of being abruptly dropped on SYNC path delete). This
age-out is needed to handle peer-switch restart (procedures are specified
in draft-rbickhart-evpn-ip-mac-proxy-adv). The holdtime needs to be
sufficiently long to allow an external neighmgr daemon or the dataplane
component to independently probe and establish local reachability of a
host. The MAC and neigh hold time values are configurable.
PS: In the future this probing may happen in FRR itself.

CLI changes to display sync info
================================
MAC
===
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
root@torm-11:mgmt:~# net show evpn mac vni 1000
Number of MACs (local and remote) known for this VNI: 6
Flags: N=sync-neighs, I=local-inactive, P=peer-active, X=peer-proxy
MAC               Type   Flags Intf/Remote ES/VTEP            VLAN  Seq #'s
00:02:00:00:00:25 local        vlan1000                       1000  0/0
02:02:00:00:00:02 local  PI    hostbond1                      1000  0/0
02:02:00:00:00:06 remote       03:00:00:00:00:02:11:00:00:01        0/0
02:02:00:00:00:01 local  X     hostbond1                      1000  0/0
00:00:00:00:00:11 local  PI    hostbond1                      1000  0/0
02:02:00:00:00:05 remote       03:00:00:00:00:02:11:00:00:01        0/0
root@torm-11:mgmt:~#
root@torm-11:mgmt:~# net show evpn mac vni 1000 mac 00:00:00:00:00:11
MAC: 00:00:00:00:00:11
 ESI: 03:00:00:00:00:01:11:00:00:01
 Intf: hostbond1(58) VLAN: 1000
 Sync-info: neigh#: 0 local-inactive peer-active >>>>>>>>>>>>
 Local Seq: 0 Remote Seq: 0
 Neighbors:
    No Neighbors
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
neigh
=====
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
root@torm-11:mgmt:~# net show evpn arp vni 1003
Number of ARPs (local and remote) known for this VNI: 4
Flags: I=local-inactive, P=peer-active, X=peer-proxy
Neighbor             Type   Flags State    MAC               Remote ES/VTEP                 Seq #'s
2001:fee1:0:3::6     local        active   00:02:00:00:00:25                                0/0
45.0.3.66            local  P     active   00:02:00:00:00:66                                0/0
45.0.3.6             local        active   00:02:00:00:00:25                                0/0
fe80::202:ff:fe00:25 local        active   00:02:00:00:00:25                                0/0
root@torm-11:mgmt:~#
root@torm-11:mgmt:~# net show evpn arp vni 1003 ip 45.0.3.66
IP: 45.0.3.66
 Type: local
 State: active
 MAC: 00:02:00:00:00:66
 Sync-info: peer-active >>>>>>>>>>>>>>>>
 Local Seq: 0 Remote Seq: 0
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-08-05 06:46:13 -07:00
Anuradha Karuppiah
f188e68e5c zebra: debug flags for MAC-IP sync
Filters for zebra debug logs.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-08-05 06:46:13 -07:00
Anuradha Karuppiah
ce5160c081 zebra: Ethernet segment management and support for MAC-ECMP
1. Local ethernet segments are configured in zebra by attaching a
local-es-id and sys-mac to a access interface -
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
!
interface hostbond1
 evpn mh es-id 1
 evpn mh es-sys-mac 00:00:00:00:01:11
!
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
This info is then sent to BGP and used for the generation of EAD-per-ES
routes.

2. Access VLANs associated with an (ES) access port are translated into
ES-EVI objects and sent to BGP. This is used by BGP for the
generation of EAD-EVI routes.

3. Remote ESs are imported by BGP and sent to zebra. A list of VTEPs
is maintained per-remote ES in zebra. This list is used for the creation
of the L2-NHG that is used for forwarding traffic.

4. MAC entries with a non-zero ESI destination use the L2-NHG associated
with the ESI for forwarding traffic over the VxLAN overlay.

Please see zebra_evpn_mh.h for the datastruct organization details.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-08-05 06:46:12 -07:00
Pat Ruddy
bd23c84036 evpn-netns: Revert PR5077, has been re-worked post-refactor
Revert "zebra: support for macvlan interfaces"

This reverts commit bf69e212fd.

Revert "doc: add some documentation about bgp evpn netns support"

This reverts commit 89b97c33d7.

Revert "zebra: dynamically detect vxlan link interfaces in other netns"

This reverts commit de0ebb2540.

Revert "bgpd: sanity check when updating nexthop from bgp to zebra"

This reverts commit ee9633ed87.

Revert "lib, zebra: reuse and adapt ns_list walk functionality"

This reverts commit c4d466c830.

Revert "zebra: local mac entries populated in correct netnamespace"

This reverts commit 4042454891.

Revert "zebra: when parsing local entry against dad, retrieve config"

This reverts commit 3acc394bc5.

Revert "bgpd: evpn nexthop can be changed by default"

This reverts commit a2342a2412.

Revert "zebra: zvni_map_to_vlan() adaptation for all namespaces"

This reverts commit db81d18647.

Revert "zebra: add ns_id attribute to mac structure"

This reverts commit 388d5b438e.

Revert "zebra: bridge layer2 information records ns_id where bridge is"

This reverts commit b5b453a2d6.

Revert "zebra, lib: new API to get absolute netns val from relative netns val"

This reverts commit b6ebab34f6.

Revert "zebra, lib: store relative default ns id in each namespace"

This reverts commit 9d3555e06c.

Revert "zebra, lib: add an internal API to get relative default nsid in other ns"

This reverts commit 97c9e7533b.

Revert "zebra: map vxlan interface to bridge interface with correct ns id"

This reverts commit 7c990878f2.

Revert "zebra: fdb and neighbor table are read for all zns"

This reverts commit f8ed2c5420.

Revert "zebra: zvni_map_to_svi() adaptation for other network namespaces"

This reverts commit 2a9dccb647.

Revert "zebra: display interface slave type"

This reverts commit fc3141393a.

Revert "zebra: zvni_from_svi() adaptation for other network namespaces"

This reverts commit 6fe516bd4b.

Revert "zebra: importation of bgp evpn rt5 from vni with other netns"

This reverts commit 28254125d0.

Revert "lib, zebra: update interface name at netlink creation"

This reverts commit 1f7a68a2ff.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-08-05 06:46:12 -07:00
Russ White
996b789193
Merge pull request #6758 from chiragshah6/yang_nb6
EVPN northbound conversion for vrf l3vni mapping command
2020-07-28 07:22:24 -04:00
Chirag Shah
92475ca487 zebra: vrf disable clean up evpn rmac nxthp cache
In networking restart event, l3vni (vxlan) interface followed by
associated vrf interfaces go down/deleted.
L3vni (oper) down event (from zebra to bgp) triggers to
clean up/un-import evpn routes (one-by-one) from the vrf table,
zebra internally removes the route entry from nexthop and RMAC hash.
When all the routes references in nexthop and RMAC db removed,
both (nexthop/rmac) are suppose to be uninstalled from the
bridge fdb and neigh table.
While evpn routes removal in progress, a vrf disable event removes
l3vni to its vrf association.
Subsequent bgp to evpn routes removal does not clean up thus evpn routes
reference to nexthop and RMAC remains in zebra hash.
bridge fdb and neigh tables are flushed out since networking restart brings down
all interfaces which results in flush of fdb and neigh tables.
By product is the zebra does not install nexthop and rmac when routes are re-imported
into vrf in VNI/VRF up event.

The fix is in vrf disable event to flush all l3vni's nexthop and rmac db.

Ticket:CM-30338
Reviewed By:CCR-10489
Testing Done:

Performed multiple networking restart and checked neigh and
bridge fdb tables for respective nexthop and router mac entry
programmed.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-07-20 20:58:20 -07:00
Chirag Shah
e2bcfa3946 zebra: evpn l3vni map to vrf nb changes
The set of northbound changes for l3vni configuration
command under vrf.

vrf x
 vni 1000 prefix-routes-only

{
  "frr-vrf:lib": {
    "vrf": [
      {
        "name": "vrf1",
        "frr-zebra:zebra": {
          "l3vni-id": 4001
        }
      },
      {
        "name": "vrf2",
        "frr-zebra:zebra": {
          "l3vni-id": 4002,
          "prefix-only": true
        }
      }
    ]
  }
}

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-07-20 18:33:38 -07:00
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
Philippe Guibert
bf69e212fd zebra: support for macvlan interfaces
mac vlan interfaces are supported in different network namespaces.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-05-18 14:11:03 +02:00
Philippe Guibert
c4d466c830 lib, zebra: reuse and adapt ns_list walk functionality
the walk routine is used by vxlan service to identify some contexts in
each specific network namespace, when vrf netns backend is used. that
walk mechanism is extended with some additional paramters to the walk
routine.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-05-18 14:11:03 +02:00
Philippe Guibert
4042454891 zebra: local mac entries populated in correct netnamespace
MAC address neighbours are read on the same netnamespace where the vxlan
interface is.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-05-18 14:11:03 +02:00
Philippe Guibert
3acc394bc5 zebra: when parsing local entry against dad, retrieve config
when duplicate address detection is observed, some incrementation,
some timing mechanisms need to be done. For that the main evpn
configuration is retrieved. Until now, the VRF that was storing the dad
config parameters was the same VRF that hosted the VXLAN interface. With
netns backend, this is not true, as the VXLAN interface is in the
same VRF as the bridge interface. The modification takes same definition
as in BGP, that is to say that there is a single bgp evpn instance, and
this is that instance that will give the correct config settings.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-05-18 14:11:03 +02:00
Philippe Guibert
db81d18647 zebra: zvni_map_to_vlan() adaptation for all namespaces
this change is needed when a MAC/IP entry is learned by zebra, and the
entry happens to be in a different namespace. So that the entry be
active, the correct vni match has to be found.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-05-18 14:11:03 +02:00
Philippe Guibert
f8ed2c5420 zebra: fdb and neighbor table are read for all zns
all network namespaces are read so as to collect interesting fdb and
neighbor tables for EVPN.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-05-18 14:11:03 +02:00
Philippe Guibert
388d5b438e zebra: add ns_id attribute to mac structure
this information is necessary for local information, because the
interface associated to the mac address is stored with its ifindex, and
the ifindex may not be enough to get to the right interface when it
comes with multiple network namespaces.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-05-18 14:11:03 +02:00
Philippe Guibert
2a9dccb647 zebra: zvni_map_to_svi() adaptation for other network namespaces
the function is called with all the network namespaces.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-05-18 14:11:03 +02:00
Philippe Guibert
6fe516bd4b zebra: zvni_from_svi() adaptation for other network namespaces
other network namespaces are parsed because bridge interface can be
bridged with vxlan interfaces with a link in the default vrf that hosts
l2vpn.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-05-18 14:11:03 +02:00
Philippe Guibert
28254125d0 zebra: importation of bgp evpn rt5 from vni with other netns
With vrf-lite mechanisms, it is possible to create layer 3 vnis by
creating a bridge interface in default vr, by creating a vxlan interface
that is attached to that bridge interface, then by moving the vxlan
interface to the wished vrf.
With vrf-netns mechanism, it is slightly different since bridged
interfaces can not be separated in different network namespaces. To make
it work, the setup consists in :
- creating a vxlan interface on default vrf.
- move the vxlan interface to the wished vrf ( with an other netns)
- create a bridge interface in the wished vrf
- attach the vxlan interface to that bridged interface

from that point, if BGP is enabled to advertise vnis in default vrf,
then vxlan interfaces are discovered appropriately in other vrfs,
provided that the link interface still resides in the vrf where l2vpn is
advertised.
to import ipv4 entries from a separate vrf, into the l2vpn, the
configuration of vni in the dedicated vrf + the advertisement of ipv4
entries in bgp vrf will import the entries in the bgp l2vpn.

the modification consists in parsing the vxlan interfaces in all network
namespaces, where the link resides in the same network namespace as the
bgp core instance where bgp l2vpn is enabled.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-05-18 14:11:03 +02:00
Pat Ruddy
1cc5b09394 zebra: fix json for show evpn arp-cache vni vtep
The function zebra_vxlan_print_neigh_vni_vtep does not create
a json object when json has been requested from the CLI and as a
result it prints out the information in normal CLI format.
Fix is to allocate the json object when required.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-04-29 12:29:09 +01: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
Chirag Shah
e20755b23e zebra: clear dup detect cleanup for nb conversion
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16 08:13:15 -07:00