Commit Graph

28014 Commits

Author SHA1 Message Date
Chirag Shah
db88997872 zebra: maintain list of nhs in rmac db
Keep the list of remote-vteps/nexthops in
rmac db.

Problem:
In CLAG deployment there might be a situation
where CLAG secondary sends individual ip as nexthop
along with anycast mac as RMAC. This combination
is updated in zebra's rmac cache.
Upon recovery at clag secondary sends withdrawal
of the incorrect rmac and nexthop mapping.
The RMAC entry mapping to nh is not cleaned up properly
in the zebra rmac cache.

Fix:
Zebra rmac db needs to maintain a list of nexthops.
When a bgp withdrawal for rmac to nexthop mapping
is received, remove the old nexthop from the rmac's nh
list and if the host reference still remains for
the RMAC,fall back to the nexthop one remaining in
the list.
At most you expect two nexthops mapped to RMAC
(in clag deployment).

Ticket: 2798406
Reviewed By:
Testing Done:

CLAG primary and secondary have advertise-pip enabled
advertise type-5 route (default route) with
individual IP as nh and individual svi mac as rmac.

- disable advertise pip on both clag devices, this
results in advertisement of routes with anycast ip as nh
and anycast mac as rmac.

- disable peerlink on clag primary, this triggers
clag secondary to (transitory) send bgp update with
individual ip as nh and anycast mac as rmac.

- At the remote vtep:
Check the zebra's rmac cache/nh mapping correctly
and points to anycast rmac and anycast ip as nh of the
clag system.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2022-03-10 17:27:15 -08:00
Donald Sharp
37a9cb28ab
Merge pull request #10749 from opensourcerouting/live-log-polish
lib, vtysh: apply some polish to live-log feature
2022-03-10 19:41:48 -05:00
Donald Sharp
43a10ccd3a
Merge pull request #10764 from ton31337/fix/add_missing_new_line_for_cli
ospfd,ospf6d: Add missing newline for `graceful-restart prepare` CLI
2022-03-10 19:33:02 -05:00
David Lamparter
f1bfeadcc1
Merge pull request #10707 from mobash-rasool/pimv6-register-recv 2022-03-10 19:00:45 +01:00
Donald Sharp
6240377270 bgpd: Do not fail when going from GR mode to GR
If you enter:

router bgp 325
  bgp graceful-restart
  bgp graceful-restart
!

The second command entered will fail.  This is not
something that should be failing as that it's a no-op.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-10 09:33:57 -05:00
Mobashshera Rasool
e782863dfc pim6d: Replace pim_br_unknown with PIMADDR_ANY
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-10 03:24:52 -08:00
Mobashshera Rasool
a141ea61e7 pim6d: Handle B bit changes for IPv6
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-10 03:24:52 -08:00
Mobashshera Rasool
c7842d245e pim6d: Parsing pimv6 register msg
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-10 03:24:46 -08:00
Mobashshera Rasool
d1fd950aa0 pim6d: Abstract api to get src and dst from ip hdr
IPv4 uses "struct ip" and IPv6 uses "struct ip6_hdr" as
headers. Get the src and dst in pim_sgaddr.
Added api pim_sgaddr_from_iphdr to do so.

Signed-off-by: Mobashshera Rasool <mrasool@vmwaer.com>
2022-03-10 03:01:47 -08:00
Mobashshera Rasool
829ab02106 doc: Add the document for PIMv6
This PR is raised to add the documentation for MLD and PIMv6.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-10 02:12:54 -08:00
Stephen Worley
47c1d76a6c zebra: cleanup protodown netlink logs
Cleanup the logs in the netlink code for setting
protodown on/off to be more useful to a user parsing them
after an issue.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 18:02:45 -05:00
Stephen Worley
7140b00cb0 zebra: use SET/UNSET/CHECK/COND in protodown code
Use the SET/UNSET/CHECK/COND macros for flag bifields
where appropriate throught the protodown code base.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 18:02:44 -05:00
Stephen Worley
26a64ff9ca zebra: include old reason in evpn-mh bond update
Ensure we include the old reason when we are updating the reason
code for a evpn-mh bond member. Now that this is a common API
it could include things external to EVPN in this reason code
bitfield (ex: vrrp).

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 18:02:44 -05:00
Stephen Worley
ed7a1622c3 zebra: make netlink protodown func more readable
Make the netlink protodown static function for checking
if the only bit set for protodown reason is FRR's more
easily readable to someone not familiar with the code.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 18:02:44 -05:00
Stephen Worley
00d57e6dd5 zebra: clear dplane flags on failure for protodown
Make sure we clear our dplane flags for SET/UNSET
on failure so that we try again.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 18:02:44 -05:00
Stephen Worley
a3ea8493a8 zebra: simplify reason code printing in show
Simplify the code for printing the reason codes via
show command. Just remove the trailing comma last
before printing.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 18:02:44 -05:00
Stephen Worley
3db9f2db2b zebra: cleanup protodown api logs
Cleanup the logs in the api for setting protodown on/off
that zapi and others use. Make them more useful to a user parsing
them after an issue.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 18:02:44 -05:00
Stephen Worley
ddfea8a233 zebra: wrap macro zif argument in parans
Missing parenthesis for macro ZIF argument.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 18:02:44 -05:00
Stephen Worley
b1da028e45 zebra: avoid initialization in ctx_intf_init
Avoid initialization in dplane_ctx_intf_init() so
the compiler can warn us about using unintialized data.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 18:02:44 -05:00
Stephen Worley
4b82b95488 zebra: evpn-mh bonds protodown check for set
When we are processing a bond member's protodown we get from
the dataplane, check to make sure we haven't already queued
up a set. If we have, it's likely this is just a notification
we get from the kernel after we set protodown and before we have
processed the result in our dplane pthread.

This change is needed now that we set protodown via the dplane
pthread.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 18:02:44 -05:00
Stephen Worley
cb5b31f5d0 zebra: evpn-mh use protodown update reason api
When setting the protodown reason use the update api
where we can directly update the entire reason bitfield
since we have to set more than one.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 18:02:44 -05:00
Stephen Worley
321c80d6b2 zebra: extern setting protodown reason directly
Extern the api for setting the protodown reason code
bitfield directly. Some places may want to completely update the
bitfield with more than one reason at a time.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 18:02:44 -05:00
Stephen Worley
ab465d24bd zebra: only clear pd_reason on shutdown/sweep
Only clear protodown reason on shutdown/sweep, retain protodown
state.

This is to retain traditional and expected behavior with daemons
like vrrpd setting protodown. They expet it to be set on shutdown
and retained on bring up to prevent traffic from being dropped.

We must cleanup our reason code though to prevent us from blocking
others.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 18:02:44 -05:00
Stephen Worley
97c7263373 zebra: add boilerplate protodown updates for *bsd
Add boilerplate for someone to come and add protdown updates
for bsd platforms if it ever exists.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 18:02:44 -05:00
Stephen Worley
3393afc990 doc: add user doc for sharp protodown
Add user doc for setting protodown on an interface with
sharpd.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 18:02:44 -05:00
Stephen Worley
0605d4b846 tests: add protodown topotest using sharpd
Add a protodown topotest using sharpd.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 18:02:44 -05:00
Stephen Worley
e4d87b5894 zebra: remove old protodown dplane path
Remove the old protodown dplane path install on the main thread.
This is now dead code.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 18:02:44 -05:00
Stephen Worley
d89b300829 zebra: use a macro for check protodown
Add a helper macro for checking if interface is protodown,
typing this out is annoying.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 18:02:44 -05:00
Stephen Worley
0dcd8506f2 zebra: clear protodown_rc on shutdown and sweep
Add functionality to clear any reason code set on shutdown
of zebra when we are freeing the interface, in case a bad
client didn't tell us to clear it when the shutdown.

Also, in case of a crash or failure to do the above, clear reason
on startup if it is set.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 18:02:42 -05:00
Stephen Worley
71ef5cbb95 zebra: add enum set/unset states for queing
Add enums for set/unset of prodown state to handle the mainthread
knowing an update is already queued without actually marking it
as complete.

This is to make the logic confirm a bit more with other parts of the code
where we queue dplane updates and not update our internal structs until
success callback is received.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 17:52:44 -05:00
Stephen Worley
c40e1b1cfb zebra: add command for setting protodown bit
Add command for use to set protodown via frr.conf in
the case our default conflicts with another application
they are using.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 17:52:44 -05:00
Stephen Worley
f9a1140c9a sharpd: add support for setting protodown
Add support for setting protodown via sharpd. This is just useful
for testing. We can make use of this in topotests.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 17:52:44 -05:00
Stephen Worley
5d41413833 zebra: add support for protodown reason code
Add support for setting the protodown reason code.

829eb208e8

These patches handle all our netlink code for setting the reason.

For protodown reason we only set `frr` as the reason externally
but internally we have more descriptive reasoning available via
`show interface IFNAME`. The kernel only provides a bitwidth of 32
that all userspace programs have to share so this makes the most sense.

Since this is new functionality, it needs to be added to the dplane
pthread instead. So these patches, also move the protodown setting we
were doing before into the dplane pthread. For this, we abstract it a
bit more to make it a general interface LINK update dplane API. This
API can be expanded to support gernal link creation/updating when/if
someone ever adds that code.

We also move a more common entrypoint for evpn-mh and from zapi clients
like vrrpd. They both call common code now to set our internal flags
for protodown and protodown reason.

Also add debugging code for dumping netlink packets with
protodown/protodown_reason.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 17:52:44 -05:00
Stephen Worley
8e23507a63 include: bump if_netlink.h version for protodown
Bump if_netlink.h UAPI files for protodown netlink
processing.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 17:52:44 -05:00
Russ White
82aca4ae4f
Merge pull request #10662 from chiragshah6/evpn_dev1
zebra: netlink protodown event handling for vxlan device
2022-03-09 16:37:30 -05:00
Donatas Abraitis
4a3c92de3c ospfd,ospf6d: Add missing newline for graceful-restart prepare CLI
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-09 22:56:53 +02:00
Donald Sharp
4f138d5d8a
Merge pull request #10694 from opensourcerouting/pim6-nht-reenable
pim6d: reenable NHT code
2022-03-09 11:51:18 -05:00
Mark Stapp
bc5302b1b1
Merge pull request #10635 from anlancs/staticd-cross
zebra: let same host route cross VRF
2022-03-09 11:05:59 -05:00
David Lamparter
e3c54a9383
Merge pull request #10079 from mjstapp/fix_intf_del_nhgs 2022-03-09 10:15:00 +01:00
anlan_cs
3f04f9cf24 zebra: let /32 host route with same IP cross VRF
Contraints of host routes are too strict in current code:
Host routes with same destination address and nexthop address are forbidden
even when cross VRFs.

Currently host routes with different destination and nexthop address can cross
VRFs, it is ok. But host routes with same addresses are forbidden to cross VRFs,
it is wrong.

Since different VRFs can have the same addresses, leak specific host route with
the same nexthop address ( it means destination address is same to nexthop
address ) to other VRFs is a normal case.

This commit relaxes that contraints. Host routes with same destination address
and nexthop address are forbidden only when not cross VRFs.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-03-09 07:22:11 +08:00
Mark Stapp
2472d3e876 zebra: shutdown doesn't uninstall zebra's NHGs
When an interface goes down, it signals any related NHGs to
re-validate themselves. During zebra shutdown, ensure we remove
any NHGs we've installed.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2022-03-08 16:16:55 -05:00
Donatas Abraitis
1e02f2f9ab pimd: Add IGMP total groups and total source groups to statistics
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-08 19:07:57 +02:00
Russ White
82934a6a32
Merge pull request #10701 from rampxxxx/feat_isis_json_show_cmds
Feat isis json show cmds
2022-03-08 11:15:25 -05:00
Russ White
5e412c5e73
Merge pull request #10722 from chiragshah6/evpn_dev3
zebra: fix crash in evpn neigh cleanup all
2022-03-08 11:00:29 -05:00
anlan_cs
c2fd85a854 zebra: remove unnecessary assignment
In `zebra_evpn_neigh_gw_macip_add()`, it sets `mac->flags` to "ZEBRA_MAC_DEF_GW"
for "advertise-default-gw" mode. But this set is redundant because this "mac"
is already set by `zebra_evpn_mac_gw_macip_add()`.

So remove this redundant assignment.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-03-08 22:58:22 +08:00
David Lamparter
838a8858d1
Merge pull request #10646 from mobash-rasool/pim-rp-changes-new 2022-03-08 12:26:37 +01:00
David Lamparter
578f7f5473
Merge pull request #10754 from mobash-rasool/yang-fix 2022-03-08 12:24:16 +01:00
Mobashshera Rasool
ded5024af4 pim6d: Modify apis in pim_rpf.c for PIMv4/PIMv6
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00
Mobashshera Rasool
fd5540ead6 pim6d: Modify pim_rp_find_exact and pim_rp_find_match_group
Modify the apis to accomodate IPv4 and IPv6 addreses for RP.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00
Mobashshera Rasool
9dca52b924 pim6d: Modify pim_rp_del for PIMv4/PIMv6
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-08 00:57:51 -08:00