]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
15 months agobgpd: factorise ipv6 vpn nexthop encoding
Philippe Guibert [Mon, 13 Feb 2023 11:17:28 +0000 (12:17 +0100)]
bgpd: factorise ipv6 vpn nexthop encoding

Because mp_nexthop_len attribute value stands for the length
to encode in the stream, simplify the way the nexthop is
forged.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
15 months agoMerge pull request #12802 from sri-mohan1/sri-bable
Donald Sharp [Wed, 15 Feb 2023 12:24:35 +0000 (07:24 -0500)]
Merge pull request #12802 from sri-mohan1/sri-bable

babeld: changes for code maintainability

15 months agoMerge pull request #12494 from louis-6wind/ext_admin_group
Olivier Dugeon [Wed, 15 Feb 2023 08:42:03 +0000 (09:42 +0100)]
Merge pull request #12494 from louis-6wind/ext_admin_group

lib,zebra,isisd: add support for extended admin group RFC7308

15 months agoMerge pull request #12728 from opensourcerouting/feature/bgp_neighbor_path-attribute_...
Russ White [Tue, 14 Feb 2023 16:22:16 +0000 (11:22 -0500)]
Merge pull request #12728 from opensourcerouting/feature/bgp_neighbor_path-attribute_treat_as_withdraw

bgpd: Add neighbor path-attribute treat-as-withdraw command

15 months agoMerge pull request #12789 from donaldsharp/version_cleanup
David Lamparter [Tue, 14 Feb 2023 16:19:07 +0000 (17:19 +0100)]
Merge pull request #12789 from donaldsharp/version_cleanup

15 months agoMerge pull request #12796 from donaldsharp/routemap_debugging
Russ White [Tue, 14 Feb 2023 14:35:06 +0000 (09:35 -0500)]
Merge pull request #12796 from donaldsharp/routemap_debugging

Routemap debugging

15 months agoMerge pull request #12790 from donaldsharp/vrrp_crash
Russ White [Tue, 14 Feb 2023 14:29:42 +0000 (09:29 -0500)]
Merge pull request #12790 from donaldsharp/vrrp_crash

vrrpd: give null when using null ifp to lookup vr

15 months agoMerge pull request #12364 from sworleys/SVD-DVNI-PR
Russ White [Tue, 14 Feb 2023 14:16:41 +0000 (09:16 -0500)]
Merge pull request #12364 from sworleys/SVD-DVNI-PR

Single Vxlan Device/Multiple Vlan Aware Bridges/Downstream VNI

15 months agobabeld: changes for code maintainability
sri-mohan1 [Tue, 14 Feb 2023 10:29:29 +0000 (15:59 +0530)]
babeld: changes for code maintainability

These changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
15 months agotests: add iproute2 API guard to svd test
Stephen Worley [Mon, 13 Feb 2023 23:09:54 +0000 (18:09 -0500)]
tests: add iproute2 API guard to svd test

Add a iproute2 API guard to the SVD test using `bridge fdb get`.

While it SHOULD be present on most systems based on their kernel
version it may not be present due to kernel/iproute2 version mismatch
weirdness.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agotests: fix SVD topotest, new evpn vni json output
Stephen Worley [Thu, 9 Feb 2023 21:45:46 +0000 (16:45 -0500)]
tests: fix SVD topotest, new evpn vni json output

The output of `show evpn vni [VNI] json` changed,
so updated the test with the new keys/output.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agodoc: remove "new way" for SVD docs
Stephen Worley [Thu, 9 Feb 2023 20:34:38 +0000 (15:34 -0500)]
doc: remove "new way" for SVD docs

remove "new way" for SVD docs as this could become
stale and become the "old way" at some point.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agotests: add topotest to cover SVD flood entry
Stephen Worley [Thu, 9 Feb 2023 20:30:32 +0000 (15:30 -0500)]
tests: add topotest to cover SVD flood entry

Add a topotest to cover making sure SVD flood entries
are installed with SVD.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agozebra: add VNI info to flood entry
Stephen Worley [Thu, 9 Feb 2023 19:57:31 +0000 (14:57 -0500)]
zebra: add VNI info to flood entry

When we are installing the flood entry for a vtep in SVD,
ensure VNI is set on the ctx object so that it gets
sent to the kernel and set appropriately with src_vni.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agozebra: Fix for mcast-group update and delete per vni for svd
sharathr [Tue, 19 Oct 2021 11:01:50 +0000 (04:01 -0700)]
zebra: Fix for mcast-group update and delete per vni for svd

Ticket: 2698649
Testing Done: precommit and evpn-min

Problem:
When the mcast-group is updated, the changes were being read from the netlink
and populated by zebra, but when kernel sends the delete of fdb delete for the
group, we are deleting the mcast-group that we newly updated. This is because,
currently we blindly reset the mcast-group during fdb delete without checking
for mcast-group associated to the vni.

Fix is to separate add/update and delete mcast-group functions and to check
for mcast-group before resetting during delete.

Signed-off-by: sramamurthy <sramamurthy@nvidia.com>
15 months agozebra: fix for unexpected fdb entry showing up during ifdown/ifup events
sharathr [Fri, 8 Oct 2021 14:27:50 +0000 (07:27 -0700)]
zebra: fix for unexpected fdb entry showing up during ifdown/ifup events

Ticket: 2674793
Testing Done:  precommit, evpn-min and evpn-smoke

The problem in this case is whenever we are triggering ifdown
followed by ifup of bridge, we see that remote mac entries
are programmed with vlan-1 in the fdb from zebra and never cleaned up.
bridge has vlan_default_pvid 1 which means any port that gets added
will initially have vlan 1 which then gets deleted by ifupdown2 and
the proper vlan gets added.

The problem lies in zebra where we are not cleaning up the remote
macs during vlan change.

Fix is to uninstall the remote macs and then install them
during vlan change.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agozebra: Clean remote FDB entries upon VNI removal
vivek [Mon, 26 Apr 2021 05:37:48 +0000 (22:37 -0700)]
zebra: Clean remote FDB entries upon VNI removal

When the VLAN-VNI mapping is configured via a map and not using
individual VXLAN interfaces, upon removal of a VNI ensure that the
remote FDB entries are uninstalled correctly.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
Ticket: #2613048
Reviewed By:
Testing Done:
1. Manual verification - logs in the ticket
2. Precommit (user job #171) and evpn-min (user job #170)

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agozebra: svd and mvab bug fixes
sharathr [Thu, 23 Sep 2021 07:17:57 +0000 (00:17 -0700)]
zebra: svd and mvab bug fixes

Ticket: 27303282724075
Reviewed By: CCR-11741, CCR-11746
Testing Done: Unit Test

2730328: At high bridge-vids count, VNI devices are not added in FRR if
FRR restarts after loading e/n/i
The issue is the wrt buffer overflow for netlink_recv_msg.
We have defined the kernel recv message buffer in stack which is of size 32768 (32K).

When the configuration is applied without FRR restart things work fine
because the recv message from kernel is well within the limit of 32K.
However with this configuration, when the FRR was restarted I could see that
some recv messages were crossing the 32K limit and hence weren't processed.
Below error logs were seen when frr was restarted with the confuguration.
2021/08/09 05:59:55 ZEBRA: [EC 4043309092] netlink-cmd (NS 0) error: data remnant size 32768
Fix is to increase the buffer size by another 2K

2724075: evpn mh/SVD - some of the remote neighs/macs aren't installed
in kernel post ifdown/ifup bridge

The issue was specific to SVD. During ifdown/ifup of the bridge,
I could see that the access-bd was not associated with the vni and hence
the remote neighs were not getting programmed in the kernel.
Fix is to reference (or associate) vxlan vni to the access-bd when
the vni is reported up. With this fix, I was able to see the remote
neighs getting programmed to the kernel.

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
15 months agolib: make htonll/ntohll compile time and readable
Stephen Worley [Sat, 10 Dec 2022 00:27:20 +0000 (19:27 -0500)]
lib: make htonll/ntohll compile time and readable

Make the htonll/ntohll functions compile time determined
since we have MACROS to determine endianess and bonus
points it makes it more readable.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agolib: remove unneeded parans on labl2str return
Stephen Worley [Sat, 10 Dec 2022 00:02:03 +0000 (19:02 -0500)]
lib: remove unneeded parans on labl2str return

Remove unneeded parans on labl2str return.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agozebra: clang-format style fixes
Stephen Worley [Fri, 9 Dec 2022 23:51:22 +0000 (18:51 -0500)]
zebra: clang-format style fixes

clang-format style fixes

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agosharpd: clang-format style fix
Stephen Worley [Fri, 9 Dec 2022 23:49:54 +0000 (18:49 -0500)]
sharpd: clang-format style fix

clang-format style fix

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agozebra: ignore GETVLAN errors at startup
Stephen Worley [Fri, 9 Dec 2022 23:40:37 +0000 (18:40 -0500)]
zebra: ignore GETVLAN errors at startup

ignore GETVLAN errors at startup like we are doing
for nexthop groups. Older platforms don't support the API.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agolib: add asserts to appease the SA
Stephen Worley [Fri, 9 Dec 2022 22:42:56 +0000 (17:42 -0500)]
lib: add asserts to appease the SA

I don't believe label can be NULL in any calling path
but SA thinks so so let's just assert here to be safe
anyway and make it happy.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agobgpd: SA set labels/num_labels to NULL/0
Stephen Worley [Fri, 9 Dec 2022 22:23:32 +0000 (17:23 -0500)]
bgpd: SA set labels/num_labels to NULL/0

Static Analysis caught a bug where we could be reading
garbage values for labels/num_lables. Fix that by
ensuring it's set to NULL/0 per loop of the mpath.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agozebra: state value never used SA fix
Stephen Worley [Fri, 9 Dec 2022 22:19:33 +0000 (17:19 -0500)]
zebra: state value never used SA fix

SA caught a value that wasn't being used after set. Remove it.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agozebra: log if RTNLGRP_BRVLAN register fails
Stephen Worley [Fri, 9 Dec 2022 21:59:34 +0000 (16:59 -0500)]
zebra: log if RTNLGRP_BRVLAN register fails

Log a notice if the RTNLGRP_BRVLAN netlink membership registration
fails.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agozebra: ignore zero_mac without VNI deletes
Stephen Worley [Tue, 22 Nov 2022 21:41:54 +0000 (16:41 -0500)]
zebra: ignore zero_mac without VNI deletes

Ignore zebra_mac updates if they do not contain a VNI for vxlan
interface. We don't have anything we can do with them.

'''
==443593== Process terminating with default action of signal 6 (SIGABRT): dumping core
==443593==    at 0x4E1156C: __pthread_kill_implementation (in /usr/lib64/libc.so.6)
==443593==    by 0x4DC4D15: raise (in /usr/lib64/libc.so.6)
==443593==    by 0x49823C7: core_handler (sigevent.c:261)
==443593==    by 0x4DC4DBF: ??? (in /usr/lib64/libc.so.6)
==443593==    by 0x4E1156B: __pthread_kill_implementation (in /usr/lib64/libc.so.6)
==443593==    by 0x4DC4D15: raise (in /usr/lib64/libc.so.6)
==443593==    by 0x4D987F2: abort (in /usr/lib64/libc.so.6)
==443593==    by 0x49C3064: _zlog_assert_failed (zlog.c:700)
==443593==    by 0x4F5E6D: zebra_vxlan_if_vni_find (zebra_vxlan_if.c:661)
==443593==    by 0x4EEAC3: zebra_vxlan_check_readd_vtep (zebra_vxlan.c:4244)
==443593==    by 0x450967: netlink_macfdb_change (rt_netlink.c:3722)
==443593==    by 0x450011: netlink_neigh_change (rt_netlink.c:4458)
'''

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agotests: fix mpls_label2str() in make check
Stephen Worley [Mon, 21 Nov 2022 23:43:26 +0000 (18:43 -0500)]
tests: fix mpls_label2str() in make check

Fix ospfd unit tests in make check that had not been
updated to the new lib function.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agodoc: add docs for `show evpn access-vlan`
Stephen Worley [Mon, 21 Nov 2022 22:58:48 +0000 (17:58 -0500)]
doc: add docs for `show evpn access-vlan`

Add docs for `show evpn access-vlan`

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agotests: skip SVD/DVNI tests for < 5.7 kernel
Stephen Worley [Mon, 21 Nov 2022 22:15:31 +0000 (17:15 -0500)]
tests: skip SVD/DVNI tests for < 5.7 kernel

Skip the SVD/DVNI topotests if the kernel version is
not at least 5.7.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agotests: add first dvni topotests
Stephen Worley [Mon, 21 Nov 2022 22:03:07 +0000 (17:03 -0500)]
tests: add first dvni topotests

Add first of dvni topotests. Covers just basic usage of importing
wildcard VNI and installing it via lwt encap.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agozebra: encode dvni with nexthop groups
Stephen Worley [Mon, 21 Nov 2022 16:23:18 +0000 (11:23 -0500)]
zebra: encode dvni with nexthop groups

Move dvni encoding to common code and add support
for encoding it using nexthop groups.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agozebra: account for non-evpn ecmp
Stephen Worley [Wed, 16 Nov 2022 18:15:32 +0000 (13:15 -0500)]
zebra: account for non-evpn ecmp

Account for non-evpn nexthops in ecmp groups when
doing the DVNI check.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agozebra: use new vni_info->access_vlan structs
Stephen Worley [Wed, 31 Aug 2022 16:35:57 +0000 (12:35 -0400)]
zebra: use new vni_info->access_vlan structs

Use new vni_info->access_vlan struct accessors
for network mac add code.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agozebra: handle ipv6-mapped-ipv4 with DVNI
Stephen Worley [Tue, 15 Jun 2021 03:43:05 +0000 (23:43 -0400)]
zebra: handle ipv6-mapped-ipv4 with DVNI

Properly handle ipv6-mapped-ipv4 with DVNI by converting
the address to ipv4 and setting that as the DST field for
the encap.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agozebra: make next-hop svd command hidden for now
Stephen Worley [Fri, 11 Jun 2021 19:31:20 +0000 (15:31 -0400)]
zebra: make next-hop svd command hidden for now

The `show evpn next-hop svd *` command doesn't provide much
for users right now. Make it hidden so we can still debug
the tables with it.

Also remove SVD output from `show evpn next-hop vni all`.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agozebra: dont install implicit NULL labels non-vni
Stephen Worley [Fri, 4 Jun 2021 15:50:40 +0000 (11:50 -0400)]
zebra: dont install implicit NULL labels non-vni

Don't install implict NULL labels with non-vni label'd
routes.

This returns behavior to how it was before adding the DVNI code.

Ticket: #2677036
Testing Done: precommit, manual
Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agozebra: handle STP state change for SVD per vlan ID
Stephen Worley [Wed, 28 Apr 2021 19:45:29 +0000 (15:45 -0400)]
zebra: handle STP state change for SVD per vlan ID

Read in STP state changes for a Single Vxlan Device
via bridge vlan netlink messages. Map the vlanid to a
VNI in the SVD table and treat it similar to how
we handle proto down of the Vxlan device traditionally
in a non-SVD device scenario.

Forwarding == Interface UP
Blocking == Interface DOWN

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agozebra: subscribe to bridge vlan netlink messages
Stephen Worley [Wed, 28 Apr 2021 19:39:51 +0000 (15:39 -0400)]
zebra: subscribe to bridge vlan netlink messages

Add code to subscribe toe bridge vlan messaging code
and appropriate debug output for it.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agolinux: update if_bridge include to newer version
Stephen Worley [Fri, 23 Apr 2021 17:25:42 +0000 (13:25 -0400)]
linux: update if_bridge include to newer version

Update included if_bridge file to newer version.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agobgpd: disable NHGs with D-VNI
Stephen Worley [Thu, 8 Apr 2021 23:22:38 +0000 (19:22 -0400)]
bgpd: disable NHGs with D-VNI

Disable the use of NHGs with D-VNI for now. We don't support them.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agobgpd: add mpath label stack helper functions for dvni
Stephen Worley [Thu, 8 Apr 2021 23:20:53 +0000 (19:20 -0400)]
bgpd: add mpath label stack helper functions for dvni

Add some bgp_path_info helper functions for getting the correct l3vni
label, getting the vni from the label stack, and determinging if
the mpath is D-VNI based.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agozebra: add show commands for SVD global neigh table
Stephen Worley [Thu, 8 Apr 2021 18:27:57 +0000 (14:27 -0400)]
zebra: add show commands for SVD global neigh table

Add some show commands and expand some already existing
commands so we can get debug info from the SVD global
neigh table inside zebra.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agozebra: nhg resolution handler for d-vni
Stephen Worley [Mon, 5 Apr 2021 21:16:38 +0000 (17:16 -0400)]
zebra: nhg resolution handler for d-vni

Add code in the nhg resolution path for determining if Downstream
VNI is in play. This is the only place in all of zebra where
we should be arbitrarily setting the ifindex/labels since
this is where new nhgs are created/destroyed. If something
changes, it must happen here.

We determine if D-VNI is being used by matching the carried
label (VNI) on the nexthop with the vrf VNI from the route.
If they do not match, we can assume this is a D-VNI labeled
nexthop.

We loop through all of the group to see if any are D-VNI. If even
one is, we must treat them all as such. Otherwise, fallback to
traditional EVPN route handling and remove all the labels.

If they are going to be treated as D-VNI we retain the labels and
verify the underlying VRF vxlan interface is a Single VXlan Device.
If it is not, we cannot use D-VNI. If it is, continue on. The VNI label
will encapped via LWTUNNEL and sent to the kernel.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agozebra: install neigh entries on SVD
Stephen Worley [Thu, 1 Apr 2021 16:00:04 +0000 (12:00 -0400)]
zebra: install neigh entries on SVD

Install neigh entries always on SVD if it exists in
zebra. If zebra is using a Single Vxlan Device, we must
duplicate the install of our neigh entries to it so that
vxlan communication can also work across it in the downstream VNI
case.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agolib,sharpd: add ability for sharpd to install vni labels
Stephen Worley [Thu, 1 Apr 2021 15:55:05 +0000 (11:55 -0400)]
lib,sharpd: add ability for sharpd to install vni labels

Add the ability for sharpd to install vni labels for testing.

This patch is just for testing/dev work purposes with evpn.
It adds some code to vty for nexthop-groups so we can explicitly
add a label to nexthops and then let sharpd encode them to zebra.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agozebra: encode vni label via lwt encap
Stephen Worley [Thu, 1 Apr 2021 15:50:31 +0000 (11:50 -0400)]
zebra: encode vni label via lwt encap

Encode the vni label during route install on linux
systems via lwt encap 64bit LWTUNNEL_IP_ID. The kernel expects
this in network byte order, so we convert it.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agobgpd: send L3VNI as route labels to zebra
Stephen Worley [Thu, 1 Apr 2021 15:43:23 +0000 (11:43 -0400)]
bgpd: send L3VNI as route labels to zebra

Add functionality to always send the L3VNI to zebra as a label
on the route. It will be zebra's job to determine how to use it (i.e.
via Single Vxlan Device or not).

The l3VNI according to rfc should always be the second for a type2 route
and be the only one available for a type5. Hence, we can just grab the
last label in the stack here and add it onto the route.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agolib: add label_type as field in zapi_nexthop
Stephen Worley [Mon, 5 Apr 2021 21:12:01 +0000 (17:12 -0400)]
lib: add label_type as field in zapi_nexthop

Add the ability to specify the label type along with the labels
you are passing to zebra in zapi_nexthop. This is needed as we
abstract the label code to be re-used by evpn as well as mpls.

Protocols need to be able to set the type of label they have attached.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agolib,zebra,bgpd,staticd: use label code to store VNI info
Stephen Worley [Thu, 1 Apr 2021 15:31:44 +0000 (11:31 -0400)]
lib,zebra,bgpd,staticd: use label code to store VNI info

Use the already existing mpls label code to store VNI
info for vxlan. VNI's are defined as labels just like mpls,
we should be using the same code for both.

This patch is the first part of that. Next we will need to
abstract the label code to not be so mpls specific. Currently
in this, we are just treating VXLAN as a label type and storing
it that way.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agolib: add has_label function for nexthop groups
Stephen Worley [Mon, 5 Apr 2021 21:13:01 +0000 (17:13 -0400)]
lib: add has_label function for nexthop groups

Add a function nexthop_group_has_label() for determining
if even a single nexthop in the group has a label on it.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agolib: add 64bit versions of htonl/ntohl
Stephen Worley [Thu, 1 Apr 2021 15:22:40 +0000 (11:22 -0400)]
lib: add 64bit versions of htonl/ntohl

Add 64bit version of htonl/ntohl.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agotests: add new topotest for single vxlan device config
Sharath Ramamurthy [Mon, 27 Sep 2021 13:27:02 +0000 (13:27 +0000)]
tests: add new topotest for single vxlan device config

Add new topo tests for validating mac learning, bridging and routing
with single vxlan device configuration

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
15 months agozebra: Add documentation for Single Vxlan Device support
Sharath Ramamurthy [Wed, 18 Aug 2021 06:08:19 +0000 (11:38 +0530)]
zebra: Add documentation for Single Vxlan Device support

Add documentation for single vxlan device suppport and configuration
commands

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
15 months agozebra: fix for issues found during static analysis
Sharath Ramamurthy [Sun, 8 Aug 2021 05:58:07 +0000 (11:28 +0530)]
zebra: fix for issues found during static analysis

This patch addresses fix for issues found during static analysis.
rt_netlink - initialise vtep if there is NDA_DST attribute
if_netlink - initialise vni_start and vni_end

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
15 months agozebra: check for vni before comparison in zl3vni_map_to_vxlan_if_ns
Sharath Ramamurthy [Sat, 7 Aug 2021 17:01:36 +0000 (22:31 +0530)]
zebra: check for vni before comparison in zl3vni_map_to_vxlan_if_ns

Check for vni before doing comparion during vxlan vni search in zl3vni_map_to_vxlan_if_ns

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
15 months agozebra: add zebra_vxlan_if.h header file to noinst_HEADER
Sharath Ramamurthy [Wed, 4 Aug 2021 09:26:40 +0000 (14:56 +0530)]
zebra: add zebra_vxlan_if.h header file to noinst_HEADER

zebra_vxlan_if.h header file was missed in noinst_HEADERS resulting
in build failure for some platforms.

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
15 months agozebra: add zebra_l2_bridge_if.h header file to noinst_HEADER
Stephen Worley [Wed, 18 May 2022 17:16:55 +0000 (13:16 -0400)]
zebra: add zebra_l2_bridge_if.h header file to noinst_HEADER

zebra_l2_bridge_if.h header file was missed in noinst_HEADERS resulting
in build failure for some platforms.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
15 months agozebra: Add ifdump vty json extension for vxlan/vni
Sharath Ramamurthy [Wed, 4 Aug 2021 06:46:25 +0000 (12:16 +0530)]
zebra: Add ifdump vty json extension for vxlan/vni

This patch adds dump for vxlan/vni for vxlan devices in if_dump_vty_json

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
15 months agozebra: Bug fixes in fdb read for flooded traffic and remote fdb cleanup upon vni...
Sharath Ramamurthy [Tue, 27 Jul 2021 16:29:00 +0000 (21:59 +0530)]
zebra: Bug fixes in fdb read for flooded traffic and remote fdb cleanup upon vni removal

This patch addresses following issues,
- When the VLAN-VNI mapping is configured via a map and not using
  individual VXLAN interfaces, upon removal of a VNI ensure that the
  remote FDB entries are uninstalled correctly.

- When VNI configuration is performed using VLAN-VNI mapping (i.e., without
  individual VXLAN interfaces) and flooded traffic is handled via multicast,
  the multicast group corresponding to the VNI needs to be explicitly read
  from the bridge FDB. This is relevant in the case of netlink interface to
  the kernel and for the scenario where a new VNI is provisioned or comes up.

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
15 months agozebra: Handle vni determination for non-vlan-aware bridges
Sharath Ramamurthy [Tue, 27 Jul 2021 16:20:47 +0000 (21:50 +0530)]
zebra: Handle vni determination for non-vlan-aware bridges

This patch addresses following

- Remove unused VLAN Id parameter when trying to determine the VNI associated
  with a non-VLAN aware bridge. Also, add a check to ensure that in this case,
  we have a per-VNI VXLAN interface. Due to sequence of events, it is possible
  that we may have VLAN-VNI mappings, in which case the code should return
  gracefully.

- With support for a container VXLAN interface that has VLAN-VNI mappings,
  the VXLAN interface itself may be up but a particular VNI might have
  been removed. Ensure that VNI mapping exists before proceeding with
  further processing.

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
15 months agozebra: Bug fixes in vtysh doc string, mcast group handling and vni deletion handling...
Sharath Ramamurthy [Tue, 27 Jul 2021 15:45:09 +0000 (21:15 +0530)]
zebra: Bug fixes in vtysh doc string, mcast group handling and vni deletion handling with single vxlan device

This patch addresses following bug fixes

- Fix vtysh doc string in "show evpn access-vlan..." command
- Multicast group handling was little complex. This change avoids calling
  multiple functions and directly calls the zebra_vxlan_if_update_vni for
  mcast group updates.
- When a vlan-vni map is removed, the removed vni deletion was happening
  in FRR with SVD config. This was resulting in stale vni and not
  resulting propagation of the vni deletion.
  During vni cleanup (zebra_vxlan_if_vni_clean) zebra_vxlan_if_vni_del
  was called for vni delete which is not correct. We should be calling
  zebra_vxlan_if_vni_entry_del for the given vni entry.

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
15 months agozebra: Refactoring changes for zebra_evpn_map_vlan zebra_evpn_from_svi and zl3vni_fro...
Sharath Ramamurthy [Tue, 27 Jul 2021 09:24:40 +0000 (14:54 +0530)]
zebra: Refactoring changes for zebra_evpn_map_vlan zebra_evpn_from_svi and zl3vni_from_svi

Today to find the vni for a given (vlan, bridge) we walk over all interfaces
and filter the vxlan device associated with the bridge. With multiple vlan aware
bridge changes, we can derive the vni directly by looking up the hash table i.e.
the vlan_table of the associated (vlan, bridge) which would give the vni.

During vrf_terminate() call zebra_l2_bridge_if_cleanup if the interface
that we are removing is of type bridge. In this case, we walk over all
the vlan<->access_bd association and clean them up.

zebra_evpn_t is modified to record (vlan, bridge) details and the
corresponding vty is modified to print the same.
zevpn_bridge_if_set and zl3vni_bridge_if_set is used to set/unset the
association.

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
15 months agozebra: multiple vlan aware bridge data structure and related changes
Sharath Ramamurthy [Tue, 27 Jul 2021 08:58:59 +0000 (14:28 +0530)]
zebra: multiple vlan aware bridge data structure and related changes

Multiple vlan aware bridge data structure changes and its corresponding bridge
handling changes.
A new vlan-table is maintained for each bridge which records the zebra_l2_bridge_vlan
entry. zebra_l2_bridge_vlan maps vlan to access_bd associated to this bridge.

Existing zebra_evpn_access_bd structure is vlan aware which is now modified to be
(vlan, bridge) aware.

Whenever a new access_bd is instantiated, a corresponding entry is also recorded
in the zebra l2 bridge for the vlan.
When the access_bd is dereferenced or whenever a bridge is deleted, the
association is cleaned up.

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
15 months agozebra: single vxlan device vni handling
Sharath Ramamurthy [Tue, 27 Jul 2021 08:48:05 +0000 (14:18 +0530)]
zebra: single vxlan device vni handling

This change brings in following functionality
- netlink_bridge_vxlan_vlan_vni_map_update for single vxlan devices
  This function is responsible for reading the vlan-vni map information
  received from netlink and populating a new hash_table with the vlan-vni
  data. Once all the vlan-vni data is collected, zebra_vxlan_if_vni_table_add_update
  is called to update vni_table in vxlan interface and process each of the
  vlan-vni data.
- refactoring changes for zevpn_build_hash_table
- existing zevpn_build_hash_table was walking over all the vxlan interfaces
  and then processing the vni for each of them. In case of single vxlan device,
  we will have more than one vni entries. This function is abstracted so that
  it iterates over all the vni entries for single vxlan device. For traditional
  vxlan device the zebra_vxlan_if_vni_iterate would only process single vni
  associated with that device.

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
15 months agozebra: vxlan interface handling changes
Sharath Ramamurthy [Tue, 27 Jul 2021 08:20:55 +0000 (13:50 +0530)]
zebra: vxlan interface handling changes

This change modifies zebra_vxlan_if_up/down/add/update and del functionality
to be per vni based.

zebra_vxlan_if_add/update/del and zebra_vxlan_if_up/down now handles
the vni operations based on vxlan device type (single or traditional vxlan device).

zebra_vxlan_if_vni_table_add_update
- This function handles the vlan-vni map update received from the netlink
  interface to single vxlan device vni_table hash table.

zebra_vxlan_if_vni_mcast_group_update
- This function handles the new multicast group update received from
  the netlink interface to single vxlan device vni_table hash table.

For traditional vxlan interfaces, the vni and mcast group
handling follows the traditional approach.

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
15 months agozebra: vxlan interface refactoring changes
Sharath Ramamurthy [Tue, 27 Jul 2021 08:10:48 +0000 (13:40 +0530)]
zebra: vxlan interface refactoring changes

This change refactors the zebra_vxlan_if related functionality
to a new zebra_vxlan_if.c file. zebra_vxlan_if_up/down,
zebra_vxlan_if_add/update/del is moved zebra_vxlan_if.c

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
15 months agozebra: single vxlan device dataplace vni update changes
Sharath Ramamurthy [Tue, 27 Jul 2021 07:52:11 +0000 (13:22 +0530)]
zebra: single vxlan device dataplace vni update changes

dplane_mac_info and dplane_neigh_info is modified to be vni aware.
dplane_rem_mac_add/del dplane_mac_init is modified to be vni aware.

During dplane context update (mac and neigh), we use the vni information
and if set, corresponding netlink attribute NDA_SRC_VNI is set and passed to the
dplane.

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
15 months agozebra: multiple vlan aware bridge datastructure changes and vxlan device iftype deriv...
Sharath Ramamurthy [Tue, 27 Jul 2021 07:47:52 +0000 (13:17 +0530)]
zebra: multiple vlan aware bridge datastructure changes and vxlan device iftype derivation from netlink

This change set introduces data structure changes required for multiple vlan aware bridge
functionality. A new structure zebra_l2_bridge_if encapsulates the vlan to access_bd
association of the bridge. A vlan_table hash_table is used to record each instance
of the vlan to access_bd of the bridge via zebra_l2_bridge_vlan structure.

vxlan iftype derivation: netlink attribute IFLA_VXLAN_COLLECT_METADATA is used
to derive the iftype of the vxlan device. If the attribute is present, then the
vxlan interface is treated as single vxlan device, otherwise it would default to
traditional vxlan device.

zebra_vxlan_check_readd_vtep, zebra_vxlan_dp_network_mac_add/del is modified to
be vni aware.

mac_fdb_read_for_bridge - is modified to be (vlan, bridge) aware

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
15 months agozebra: data structure changes for single vxlan device
Sharath Ramamurthy [Tue, 27 Jul 2021 07:44:15 +0000 (13:14 +0530)]
zebra: data structure changes for single vxlan device

This changeset introduces the data structure changes needed for
single vxlan device functionality. A new struct zebra_vxlan_vni_info
encodes the iftype and vni information for vxlan device.

The change addresses related access changes of the new data structure
fields from different files

zebra_vty is modified to take care of the vni dump information according
to the new vni data structure for vxlan devices.

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
15 months agodoc: Add documentation for `debug routemap [detail]`
Donald Sharp [Mon, 13 Feb 2023 14:39:57 +0000 (09:39 -0500)]
doc: Add documentation for `debug routemap [detail]`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agozebra: Add access-list lookup failures to debug routemap detail
Donald Sharp [Mon, 13 Feb 2023 14:35:55 +0000 (09:35 -0500)]
zebra: Add access-list lookup failures to debug routemap detail

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agozebra: Add prefix-list lookup failures to routemap debug detail
Donald Sharp [Mon, 13 Feb 2023 14:34:38 +0000 (09:34 -0500)]
zebra: Add prefix-list lookup failures to routemap debug detail

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agoospfd: Warn operator about prefix lists not existing in routemaps
Donald Sharp [Mon, 13 Feb 2023 14:32:25 +0000 (09:32 -0500)]
ospfd: Warn operator about prefix lists not existing in routemaps

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agoospfd: Add access-list lookup failures to routemap code
Donald Sharp [Mon, 13 Feb 2023 14:30:44 +0000 (09:30 -0500)]
ospfd: Add access-list lookup failures to routemap code

When using access-list and the access-list is not specified
let's give the operator some clue about what is going on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agobgpd: Add useful information to prefix list lookup failures in routemaps
Donald Sharp [Mon, 13 Feb 2023 14:26:30 +0000 (09:26 -0500)]
bgpd: Add useful information to prefix list lookup failures in routemaps

When a routemap lookup of the prefix fails, add some useful data to
the end operator about what has just gone wrong when they are
using `debug routemap detail`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agobgpd: Add access list lookup failure to `debug routemap detail`
Donald Sharp [Mon, 13 Feb 2023 14:22:36 +0000 (09:22 -0500)]
bgpd: Add access list lookup failure to `debug routemap detail`

Let's give the operator some inkling as to why a routemap is
not working the way they thing it should be when something
goes wrong using it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agolib: Add `debug routemap [detail]`
Donald Sharp [Mon, 13 Feb 2023 14:14:56 +0000 (09:14 -0500)]
lib: Add `debug routemap [detail]`

Add the ability to turn on `debug routemap detail` for FRR.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agolib: Start partitioning of rmap_debug to allow detail level
Donald Sharp [Mon, 13 Feb 2023 14:06:56 +0000 (09:06 -0500)]
lib: Start partitioning of rmap_debug to allow detail level

Change the bool to a uint32_t and setup a flag to test
for and set against.  Future commits will allow
a debug detail which should be used by match/set statements
to give further context of what is going on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agobgpd: Add warning when access list does not exist in route-map
Donald Sharp [Sun, 12 Feb 2023 17:33:49 +0000 (12:33 -0500)]
bgpd: Add warning when access list does not exist in route-map

When using `match ip[v6] next-hop <Access-list>` warn
when creating the access-list that the access list does
not yet exist and nothing can be done with it yet.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agozebra: Use string for type instead of number
Donald Sharp [Sun, 12 Feb 2023 17:28:10 +0000 (12:28 -0500)]
zebra: Use string for type instead of number

Let's make it easier to debug instead of guessing

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agovrrpd: give null when using null ifp to lookup vr
Quentin Young [Mon, 28 Oct 2019 15:41:38 +0000 (15:41 +0000)]
vrrpd: give null when using null ifp to lookup vr

This is still causing crashes somehow.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
15 months agolib, zebra: Consolidate ZEBRA_TABLE_MAX_DISTANCE values
Donald Sharp [Fri, 10 Feb 2023 14:04:44 +0000 (09:04 -0500)]
lib, zebra: Consolidate ZEBRA_TABLE_MAX_DISTANCE values

Currently `ip import-table 33` imports routes with
a distance of 15, as defined by zebra.h.  zebra_rib.c
on the other hand believes the default value for the table
is 150.  Let's make them agree with each other.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agolib, zebra: Use defines for distance
Donald Sharp [Fri, 10 Feb 2023 13:54:56 +0000 (08:54 -0500)]
lib, zebra: Use defines for distance

Use the defines for distance that are in zebra.h.  We could
easily have a cluster where we don't agree with ourselves.  So
let's convert zebra to use the defines in zebra.h

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agolib, zebra: Move ZEBRA_ON_RIB_PROCESS_HOOK_CALL
Donald Sharp [Fri, 10 Feb 2023 13:39:33 +0000 (08:39 -0500)]
lib, zebra: Move ZEBRA_ON_RIB_PROCESS_HOOK_CALL

The define of ZEBRA_ON_RIB_PROCESS_HOOK_CALL was in zebra.h
which exposes it to everyone, except zebra is the only daemon
to use this define.  This does not beling in zebra.h

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agolib: Remove include of asm/types.h
Donald Sharp [Fri, 10 Feb 2023 13:35:44 +0000 (08:35 -0500)]
lib: Remove include of asm/types.h

We do not use this, nor should we.  So let's remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agolib: Remove include of linux specific version.h
Donald Sharp [Fri, 10 Feb 2023 13:31:56 +0000 (08:31 -0500)]
lib: Remove include of linux specific version.h

We apparently do not use it and looking at what this
file actually includes, we should not be including this
at all.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agobgpd: Remove extraneous include of version.h
Donald Sharp [Fri, 10 Feb 2023 13:28:59 +0000 (08:28 -0500)]
bgpd: Remove extraneous include of version.h

It's not needed in these compiles.  So let's remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agopimd: Remove extraneous include of version.h
Donald Sharp [Fri, 10 Feb 2023 13:28:46 +0000 (08:28 -0500)]
pimd: Remove extraneous include of version.h

It's not needed in these compiles.  So let's remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agopathd: Remove extraneous include of version.h
Donald Sharp [Fri, 10 Feb 2023 13:28:28 +0000 (08:28 -0500)]
pathd: Remove extraneous include of version.h

It's not needed in these compiles.  So let's remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agobgpd: Remove extraneous include of version.h
Donald Sharp [Fri, 10 Feb 2023 13:27:42 +0000 (08:27 -0500)]
bgpd: Remove extraneous include of version.h

It's not needed in these compiles.  So let's remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agodoc: add extended admin-group user documentation
Louis Scalbert [Tue, 13 Dec 2022 13:03:34 +0000 (14:03 +0100)]
doc: add extended admin-group user documentation

Add the extended admin-group user documentation using affinity-maps.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agotests: add extended admin-group test in isis_te_topo1
Louis Scalbert [Fri, 9 Dec 2022 13:11:50 +0000 (14:11 +0100)]
tests: add extended admin-group test in isis_te_topo1

Add extended admin-group test in isis_te_topo1

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agoMerge pull request #12776 from patrasar/Issue_12755
Donald Sharp [Fri, 10 Feb 2023 13:07:32 +0000 (08:07 -0500)]
Merge pull request #12776 from patrasar/Issue_12755

pim6d: Modify "show ipv6 mld join json" o/p

15 months agolib,isisd: add extended admin-group info into the ted
Louis Scalbert [Fri, 9 Dec 2022 11:34:50 +0000 (12:34 +0100)]
lib,isisd: add extended admin-group info into the ted

Add extended admin-group info into the ted.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agolib,zebra: add affinity-map configuration hooks
Louis Scalbert [Wed, 9 Nov 2022 14:17:19 +0000 (15:17 +0100)]
lib,zebra: add affinity-map configuration hooks

Add affinity-map hooks to check the utilization of affinity-map in
link-params before its deletion and to update link-params when the
affinity-map bit-position is updated.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agoisisd: add extended admin-group
Louis Scalbert [Tue, 8 Nov 2022 17:05:02 +0000 (18:05 +0100)]
isisd: add extended admin-group

Add to the Extended IS Reachability TLV the support of Extended
Administrative-Groups (RFC7308)

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agolib: extend sbuf size
Louis Scalbert [Tue, 27 Sep 2022 10:22:24 +0000 (12:22 +0200)]
lib: extend sbuf size

sbuf variable is used among other things to store IS-IS database output.
Future commits will introduce the output of extended access groups in
the "show isis database detail" output.

Extend the sbuf size to have chance to store all information.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agolib,yang,zebra: add extended admin-group support
Louis Scalbert [Tue, 8 Nov 2022 16:59:33 +0000 (17:59 +0100)]
lib,yang,zebra: add extended admin-group support

Add the support of Extended Admin-Group (RFC7308) to the zebra interface
link-params Traffic-Engineering context.

Extended admin-groups can be configured with the affinity-map:

> affinity-map blue bit-position 221
> int eth-rt1
>  link-params
>   affinity blue
>  exit-link-params

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>