Commit Graph

22862 Commits

Author SHA1 Message Date
Anuradha Karuppiah
fe8293c326 bgpd: add config knobs to disable rx and tx of ead-per-evi routes
Some vendors only advertise EAD-per-ES routes i.e. they do not
advertise EAD-per-EVI routes. To interop with these vendors we need
to relax the dependancy on EAD-per-EVI routes to activate a remote ES-PE.

Sample config -
>>>>>>>>>>>>>>>>>>>>>>>>>>>>
router bgp 5553
 address-family l2vpn evpn
  disable-ead-evi-rx
>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Ticket: CM-31177

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-12-11 09:39:04 -08:00
Duncan Eastoe
164d8e8608 zebra: routes stuck with 'q' when using dplane FPM
New work enqueued to the dplane_fpm_nl provider is initially de-queued
and re-enqueued, in fpm_nl_process(), to be processed by the provider's
own thread.

After performing this initial de-queue/enqueue we return to
dplane_thread_loop() and check the dplane_fpm_nl output queue for any
work which has been completed.

Since this work is being processed in another thread it is very likely
that there will be some (or all) work still outstanding at this point.
The dataplane thread finishes up any other tasks and then waits until
it is next scheduled. In the meantime the dplane_fpm_nl thread is
processing its work queue until completion.

The issue arises here as the dataplane thread is not explicitly
re-scheduled once dplane_fpm_nl has drained its work queue and
populated its output queue with completed work.

This completed work can sit in the output queue for an indeterminate
period of time, depending upon when the dataplane thread is next
scheduled for other work. If the RIB has reached a stable state then
this could be a significant period of time. During this period zebra
marks these routes as queued, even though they have actually been
processed by all dataplane providers.

An un-related RIB change which triggers a FIB update will result in
the dataplane thread being scheduled and this completed work then
being processed. At this point the routes will then no longer be
marked as queued by zebra. However this new FIB update might itself
then fall victim to the same scenario!

We can observe the above behaviour in these detailed dplane logs.

    11:24:47 zebra[7282]: dplane: incoming new work counter: 2
    11:24:47 zebra[7282]: dplane enqueues 2 new work to provider 'Kernel'
    11:24:47 zebra[7282]: dplane provider 'Kernel': processing
    11:24:47 zebra[7282]: Dplane NEIGH_DISCOVER, ip 192.168.2.2, ifindex 9
    11:24:47 zebra[7282]: Dplane NEIGH_DISCOVER, ip 192.168.2.2, ifindex 9
    11:24:47 zebra[7282]: dplane dequeues 2 completed work from provider Kernel
    11:24:47 zebra[7282]: dplane enqueues 2 new work to provider 'dplane_fpm_nl'
    11:24:47 zebra[7282]: dplane dequeues 1 completed work from provider dplane_fpm_nl
    11:24:47 zebra[7282]: dplane has 1 completed, 0 errors, for zebra main

2 contexts (all incoming work) have been queued to dplane_fpm_nl - all good.
1 completed context was de-queued, so there is outstanding work.

    11:24:58 zebra[7282]: dplane: incoming new work counter: 2
    11:24:58 zebra[7282]: dplane enqueues 2 new work to provider 'Kernel'
    11:24:58 zebra[7282]: dplane provider 'Kernel': processing
    11:24:58 zebra[7282]: ID (193) Dplane nexthop update ctx 0x55c429b6fed0 op NH_INSTALL
    11:24:58 zebra[7282]: 0:5.5.5.5/32 Dplane route update ctx 0x55c429b79690 op ROUTE_INSTALL
    11:24:58 zebra[7282]: dplane dequeues 2 completed work from provider Kernel
    11:24:58 zebra[7282]: dplane enqueues 2 new work to provider 'dplane_fpm_nl'
    11:24:58 zebra[7282]: dplane dequeues 2 completed work from provider dplane_fpm_nl
    11:24:58 zebra[7282]: dplane has 2 completed, 0 errors, for zebra main

A further 2 contexts (all incoming work) have been queued to dplane_fpm_nl - all good.
2 completed contexts were de-queued, which sounds good as that is what we en-queued.
However, there is an outstanding context from earlier, so there is still outstanding
work.

Indeed the new 5.5.5.5/32 route is marked as queued:

    O>q 5.5.5.5/32 [110/10] via 192.168.2.2, dp0p1s3, weight 1, 00:01:19

This remains the case until we trigger a FIB update by installation of the
(eg.) 10.10.10.10/32 route:

    11:26:41 zebra[7282]: dplane: incoming new work counter: 2
    11:26:41 zebra[7282]: dplane enqueues 2 new work to provider 'Kernel'
    11:26:41 zebra[7282]: dplane provider 'Kernel': processing
    11:26:41 zebra[7282]: ID (195) Dplane nexthop update ctx 0x55c429b78ce0 op NH_INSTALL
    11:26:41 zebra[7282]: 0:10.10.10.10/32 Dplane route update ctx 0x55c429b7a040 op ROUTE_INSTALL
    11:26:41 zebra[7282]: dplane dequeues 2 completed work from provider Kernel
    11:26:41 zebra[7282]: dplane enqueues 2 new work to provider 'dplane_fpm_nl'
    11:26:41 zebra[7282]: dplane dequeues 2 completed work from provider dplane_fpm_nl
    11:26:41 zebra[7282]: dplane has 2 completed, 0 errors, for zebra main
    11:26:41 zebra[7282]: zebra2proto: Please add this protocol(2) to proper rt_netlink.c handling
    11:26:41 zebra[7282]: Nexthop dplane ctx 0x55c429b6fed0, op NH_INSTALL, nexthop ID (193), result SUCCESS
    11:26:41 zebra[7282]: default(0:254):5.5.5.5/32 Processing dplane result ctx 0x55c429b79690, op ROUTE_INSTALL result SUCCESS

We observe the same 2 enqueues and 2 dequeues as before, which again suggests
that there is outstanding work.

As expected, the 5.5.5.5/32 route is no longer marked as queued:

    O>* 5.5.5.5/32 [110/10] via 192.168.2.2, dp0p1s3, weight 1, 00:02:06

But the 10.10.10.10/32 route is, as we have not yet processed the completed
context:

    C>q 10.10.10.10/32 is directly connected, lo, 00:26:05

Signed-off-by: Duncan Eastoe <duncan.eastoe@att.com>
2020-12-11 15:04:15 +00:00
Duncan Eastoe
53706b4e51 zebra: dplane API to get provider output q length
Returns the current number of (completed) contexts in the provider's
output queue (dp_ctx_out_q), allowing access to this data from the
provider itself.

Signed-off-by: Duncan Eastoe <duncan.eastoe@att.com>
2020-12-11 15:04:11 +00:00
Renato Westphal
9c47491551
Merge pull request #7711 from volta-networks/fix_ldpsync_client_close_callback
isisd, ospfd: update 'client close' callback to 'ldp fail' api
2020-12-11 11:25:53 -03:00
Donatas Abraitis
105227afe7 doc: Add paragraph about bgp suppress-duplicates command
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-12-11 14:51:07 +02:00
Donatas Abraitis
2beb3d3967 tests: Check if we are not sending duplicate BGP UPDATEs
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-12-11 14:51:07 +02:00
Donatas Abraitis
2adac2562a bgpd: Do not send BGP UPDATE if the route actually not changed
Reference: https://www.cmand.org/communityexploration

                     --y2--
                    /  |   \
  c1 ---- x1 ---- y1   |   z1
                    \  |   /
                     --y3--

1. z1 announces 192.168.255.254/32 to y2, y3.
2. y2 and y3 tags this prefix at ingress with appropriate
communities 65004:2 (y2) and 65004:3 (y3).
3. x1 filters all communities at the egress to c1.
4. Shutdown the link between y1 and y2.
5. y1 will generate a BGP UPDATE message regarding the next-hop change.
6. x1 will generate a BGP UPDATE message regarding community change.

To avoid sending duplicate BGP UPDATE messages we should make sure
we send only actual route updates. In this example, x1 will skip
BGP UPDATE to c1 because the actual route is the same
(filtered communities - nothing changes).

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-12-11 14:51:05 +02:00
Duncan Eastoe
7545bda0a4 dplane_fpm_nl: queue peak counter never increments
The context queue length peak counter is always set to its current
value, hence never increments.

Signed-off-by: Duncan Eastoe <duncan.eastoe@att.com>
2020-12-11 12:09:56 +00:00
Donatas Abraitis
adf086ec58 bgpd: Print afi/safi as strings when handling update/withdraw in zlog_debug
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-12-11 11:44:38 +02:00
Donatas Abraitis
c386cdd8c9 bgpd: Print afi/safi as strings when handling capability in zlog_debug
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-12-11 11:41:30 +02:00
Yash Ranjan
08d8fa4587 ospf6d: Fix for "show ipv6 ospf6 database link"
Some prefixes were not shown in the link database
show command, due to issues with pointer calculation.

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
2020-12-10 21:25:41 -08:00
Yash Ranjan
8044f7aa55 ospf6d: Fix for "show ipv6 ospf6 database intra-prefix"
Some prefixes were not shown in the intra-prefix database
show command, due to issues with pointer calculation.

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
2020-12-10 21:25:41 -08:00
nguggarigoud
938d5980d1 tests: Optimised static routing testsuits
1. Removed bgp specific triggers.
2. Removed repeatativ steps.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2020-12-10 16:44:48 -08:00
naveen
d33a0fcf6f tests : Enhanced scripts to handle support bundle behaviour
1. Added Expected False to not true cases.

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-12-10 16:44:48 -08:00
naveen
88fedaaa7b tests: Adding static routing topojson automation suites.
Adding API's required for EVPN suite.

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-12-10 16:44:48 -08:00
naveen
72babe7cf3 tests: Incorporated new static route del behaviour
Updated 2 testcases with static  route deletion with
admin distance as a key.

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-12-10 16:44:48 -08:00
naveen
93792f5dd0 tests: Updated verify_bgp_rib api for multipaths.
verify_bgp_rib is updated in bgp.py file to
handle multi paths.

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-12-10 16:44:48 -08:00
Naveen
03cb898f46 tests: Updated doctstring for start & stop router
Actual path for configs is /tmp/topotest/<suite>/<router>
common_config.py is updated.

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-12-10 16:44:48 -08:00
Naveen Guggarigoudar
f8f6dbe9f7 tests: Enhanced the lib bgp.py for nexthop check
1. Enhanced the lib bgp.py for nexthop check

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-12-10 16:44:48 -08:00
naveen
eee0457da7 tests: Enhanced lib by removing unnecessary sleep
1. libs modified are bgp.py and common_config.py

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-12-10 16:44:48 -08:00
naveen
ee51a3d9ec tests: Enchanced static routing testsuits
1. BGP timers are modified to reduce the run time.
2. Static sleeps are removed from the scripts.

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-12-10 16:44:48 -08:00
naveen
0705f3120d tests: Adding static routing topojson automation suites.
1. Enhanced framework to
a. Verify fib active routes(lib/common_config.py).
b. Verify bgp multi path routes(lib/bgp.py).
c. Create mininet nodes with different names(lib/topojson.py).

4. 12 Test cases of static routing with ibgp.
Test suite execution time is ~30 minutes.

5. 12 Test cases of static routing with ebgp.
Test suite execution time is ~30 minutes.

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-12-10 16:44:48 -08:00
Karen Schoener
c3783ac077 isisd, ospfd: update 'client close' callback to 'ldp fail' api
Update 'client close' callback to 'ldp fail' api.

Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-12-10 13:35:34 -05:00
Quentin Young
56df11cb85 debian: work around NetDef CI missing lua packages
Scripting must be explicitly enabled now when building packages via the
pkg.frr.lua Debian profile

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-10 13:09:56 -05:00
Donald Sharp
7ed5844bef zebra: Allow show zebra client to give clues about route update status
When entering `show zebra client` allow the display of the client->notify_status
for route updates.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-12-10 12:59:14 -05:00
Donald Sharp
4f4ba68cc3 doc: Update doc for new global command bgp suppress-fib-pending
Document this silliness.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-12-10 12:59:14 -05:00
Donald Sharp
9acb67cbf8 bgpd: Add global bgp suppress-fib-pending command
On top of the recent `bgp suppress-fib-pending which
was at a BGP_NODE level, add this command at the CONFIG_NODE
level as well and allow the command to apply to all instances
of bgp running.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-12-10 12:59:14 -05:00
Russ White
101ad544fa
Merge pull request #7678 from donaldsharp/aspath_to_zebra
Aspath to zebra
2020-12-10 10:38:14 -05:00
Donald Sharp
9696432fe5
Merge pull request #7677 from opensourcerouting/acl-back-compat
lib: restore previous access/prefix list behaviour
2020-12-10 08:14:34 -05:00
Donald Sharp
b2c7cf18b2
Merge pull request #7706 from slankdev/slankdev-unexpose-lm-func-1
zebra: unexpose label-manager util-funcs as static
2020-12-10 07:43:02 -05:00
Rafael Zalamena
80de739725
Merge pull request #7708 from ton31337/fix/doc_hash_cmp
doc: update doc comment on hash_cmp (round 2)
2020-12-10 09:22:22 -03:00
Rafael Zalamena
0c7e0f2f70
Merge pull request #7697 from pguibert6WIND/zebra_crash_startup_zns
zebra: anticipate zns creation at vrf creation when backend is vrf-lite
2020-12-10 09:10:34 -03:00
Rafael Zalamena
551e30a5ff
Merge pull request #7492 from Niral-Networks/niral_ospfv3_fix_redist
ospf6d : Code refactoring for route redistribution.
2020-12-10 09:01:12 -03:00
Donatas Abraitis
be268ed646 doc: update doc comment on hash_cmp (round 2)
Related: c8aad9c3a4

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-12-10 11:20:42 +02:00
Donatas Abraitis
b6f2da4f81
Merge pull request #7649 from qlyoung/fix-doc-comment-hashcmp
lib: update doc comment on hash_cmp
2020-12-10 11:07:06 +02:00
Donatas Abraitis
82b773e63b
Merge pull request #7524 from donaldsharp/zebra_route_map_tighten
zebra: deny when route map is specified but does not exist yet
2020-12-10 11:01:25 +02:00
Donatas Abraitis
ae86e45faf
Merge pull request #7705 from chiragshah6/mdev
bgpd: local routes use non-default distance
2020-12-10 10:58:59 +02:00
Donald Sharp
6f4249f9b7
Merge pull request #7703 from volta-networks/fix_ldpsync_remove_hello
ldpd, isisd, ospfd: Remove periodic ldp-sync hello message
2020-12-09 20:21:11 -05:00
Hiroki Shirokura
d3d9639d9a zebra: unexpose label-manager util-funcs as static
Following functions which is a piece of label-maanager implementation
isn't called from out side of its file. And all lines of label-manager
are coded on zebra/label_manager.c at this time. So these functions
should be unexposed.

Functions:
- create_label_chunk
- assign_label_chunk
- delete_label_chunk
- release_label_chunk

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2020-12-10 09:56:55 +09:00
Chirag Shah
1c00fb274c bgpd: local routes use non-default distance
Use user provided AD for local routes (aggregate).

 address-family ipv4 unicast
  distance bgp 20 200 210
  network 47.2.2.8/30
  aggregate-address 51.1.0.0/16

Testing Done:

Before aggr route uses default 200 AD even user provided local AD.
B>* 51.1.0.0/16 [200/0] unreachable (blackhole), weight 1, 00:01:14

After:
B>* 51.1.0.0/16 [210/0] unreachable (blackhole), weight 1, 00:00:01

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2020-12-09 16:28:17 -08:00
Donald Sharp
dc29bb3b6b
Merge pull request #7685 from mjstapp/fix_nhrp_int_sa
nhrpd: fix SA warning in nhrp_interface
2020-12-09 15:02:42 -05:00
Karen Schoener
4d1e5644b7 ldpd, isisd, ospfd: Remove periodic ldp-sync hello message
Removing the obsolete ldp-sync periodic 'hello' message.

When ldp-sync is configured, IGPs take action if the LDP process goes down.

The IGPs have been updated to use the zapi client close callback to detect
the LDP process going down.

Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-12-09 14:11:38 -05:00
Mark Stapp
1c6a23c859
Merge pull request #7699 from opensourcerouting/ldpd-printfrr-issue
ldpd: fix printfrr format specifiers in the child processes
2020-12-09 13:36:28 -05:00
Mark Stapp
00fcf0fe2e
Merge pull request #7700 from opensourcerouting/isisd-null-check
isisd: fix null pointer dereference when parsing LSP
2020-12-09 13:34:11 -05:00
Donald Sharp
327c3aad2a
Merge pull request #7686 from volta-networks/fix_ldpsync_igps_detect_client_close
isisd, ospfd: IGPs detect LDP down via zapi client close message
2020-12-09 11:49:22 -05:00
Renato Westphal
df2c1f3d42 isisd: fix null pointer dereference when parsing LSP
In some extraordinary circumstances an LSP might not have any
TLV. Add a null check to prevent a crash when that happens.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-12-09 12:21:33 -03:00
Renato Westphal
5f004539b8 ldpd: fix printfrr format specifiers in the child processes
In ldpd, the child processes send IPC messages to the main process to
perform logging in their behalf (access to the file descriptor used
for logging needs to be serialized). This commit fixes a problem
that was preventing the printfrr format specifiers from working in
the child processes, since vsnprintf() was being used instead of
vsnprintfrr() before sending the log messages to the parent process.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-12-09 11:55:10 -03:00
Karen Schoener
cb135cc943 isisd, ospfd: IGPs detect LDP down via zapi client close message
When ldp-sync is configured, IGPs take action if the LDP process goes down.

Currently, IGPs detect the LDP process is down if they do not receive a
periodic 'hello' message from LDP within 1 second.

Intermittently, this heartbeat mechanism causes false topotest failures.
When the failure occurs, LDP is busy receiving messages from zebra for a
few seconds.  During this time, LDP does not send the expected periodic
message.

With this change, IGPs detect LDP down via zapi client close message.

Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-12-09 08:41:42 -05:00
Philippe Guibert
91b1421e84 zebra: anticipate zns creation at vrf creation when backend is vrf-lite
in the case the namespace pointer is already available, feed it at vrf
creation. this prevents from crashing if the netlink parsing already
began, and the vrf-lite is not enabled yet.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-12-09 13:26:20 +00:00
Mark Stapp
e386d2b154
Merge pull request #7690 from donaldsharp/nht_show_is_not_not_not
zebra, tests: Fix `show ip nht`
2020-12-09 07:58:37 -05:00