GalaxyGorilla [Thu, 22 Oct 2020 10:05:39 +0000 (10:05 +0000)]
ospfd: Make use of adjacency SIDs in TI-LFA
When P and Q spaces are adjacent then it makes sense to use adjacency SIDs to
from the P node to the Q node. There are some other corner cases where this
makes also sense like when a P/Q node adjacent to root node.
GalaxyGorilla [Tue, 13 Oct 2020 11:53:04 +0000 (11:53 +0000)]
ospfd: Add support for reverse SPF (P2P only)
A reverse SPF is important in the context of TI-LFA, e.g. for
computing so called Q spaces. In case the weights of the links are
symmetric there is no difference to the 'normal' SPF and hence this
patch is really just needed for the case with asymmetric link
weights.
Donald Sharp [Sun, 17 Jan 2021 21:08:03 +0000 (16:08 -0500)]
bgpd: Use uint32_t for size value instead of int in ecommunity struct
The `struct ecommunity` structure is using an int for a size value.
Let's switch it over to a uint32_t for size values since a size
value for data can never be negative.
Donald Sharp [Sun, 17 Jan 2021 12:51:09 +0000 (07:51 -0500)]
zebra: Tell SA that we are intentionally ignoring the return
Calling fpm_nl_enqueue we should expect a it fit or not
return value on the outgoing stream. This is not necessary
to check here because the while loop where we are checking this
already has ensured that the data being written will fit.
CID -> 1499854 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Donald Sharp [Sun, 17 Jan 2021 12:43:44 +0000 (07:43 -0500)]
bgpd: attr is already derefed cannot be null here
In the function bgp_adj_out_set_subgroup, the attr pointer
is already derefed in all paths leading to a test for NULL.
You cannot pass a NULL attribute in since the whole function
would just immediately crash.
CID -> 1500604 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Donald Sharp [Sat, 16 Jan 2021 13:29:49 +0000 (08:29 -0500)]
tests: Set default timers to 3/10 for bgp using create_router_bgp
Tests were timing out in our test system due to lost packets and
flakiness of the lower end systems. Just set the timers to 3/10
and give them plenty of time to converge.
Renato Westphal [Fri, 15 Jan 2021 15:04:24 +0000 (12:04 -0300)]
ldpd: fix sporadic failures in the ldp-topo1 topotest
Commit 220e848cc5 introduced an optimization that would prevent ldpd
from sending redundant label mappings when it receives notifications
from zebra about routes that didn't effectively change (such
notifications can happen under certain circumstances).
The problem is that that commit didn't take into account the metric
of the received routes, so it would dismiss a notification of a
route with a better metric taking the place of another route in the
RIB, preventing the newly selected route from receiving the label
mappings it needs.
Revert 220e848cc5 temporarily to fix sporadic failures in the CI
system until we have a better solution.
Duncan Eastoe [Fri, 15 Jan 2021 16:06:17 +0000 (16:06 +0000)]
zebra: set nlmsg_pid in netlink msgs sent by 'fpm'
Use nl_pid from the netlink socket used for programming the kernel
(netlink_dplane) in netlink route messages sent by the 'fpm' module.
This makes 'fpm' consistent with 'dplane_fpm_nl' which already
behaves this way, and allows FPM server implementations to determine
route origin via nlmsg_pid.
Donald Sharp [Fri, 15 Jan 2021 13:14:49 +0000 (08:14 -0500)]
bgpd: Allow peer-groups to have `ttl-security hops` configured
The command `neighbor PGROUP ttl-security hops X` was being
accepted but ignored. Allow it to be stored. I am still
not sure that this is applied correctly, but that is another
problem.
Fixes: #7848 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Donald Sharp [Fri, 15 Jan 2021 01:29:14 +0000 (20:29 -0500)]
tests: Start the ability to mark tests
Add the ability for our topotests to take advantage of pytest `mark`ing.
This effectively allows you to tell pytest to run against certain sets
of tests. For a demonstration purpose I've added in marks for:
babel
eigrp
ldp
ospf
pim
rip
And setup tests to run against those tests that only test those protocols.
You can run against eigrp tests by running `pytest -k eigrp`
Other combinations are also available based upon simple boolean logic.
Just read the pytest.mark documentation.
Donald Sharp [Thu, 14 Jan 2021 20:51:39 +0000 (15:51 -0500)]
bgpd: Temp fix to allow numbered peers to be part of a peer group
Talking w/ Chirag and he indicated that we can just backout the command
to the original and things would `work` and they do( at least a quick test does )
Dewi Morgan [Thu, 14 Jan 2021 14:01:26 +0000 (14:01 +0000)]
bgpd: clear max prefix overflow on de-config
A bgp neighbor remains in Idle state in the event that the number
of received prefixes exceeds the configured maximum prefix for the
neighbor. The neighbor remains in idle state even after de-configuring
the maximum prefix limit for the neighbor.
The fix is to clear the neighbor overflow state if set, after
de-configuring the neighbor maximum-prefix commnd.
This allows the neighbor to establish without having to perform a
clear operation. It also avoids the misleading neigbor summary
indicating that the neighbor is in prefix overflow state (PfxCt)
when no limit is configured for the neighbor.
Signed-off-by: Dewi Morgan <dewi.morgan@intl.att.com>
Chirag Shah [Wed, 13 Jan 2021 17:02:32 +0000 (09:02 -0800)]
staticd: handle when condition check in nb callbacks
At present, libyang validate api takes longer time to complete
for a transaction to complete if the same config is re-applied.
For instance if set of static routes are reapplied the config
completion takes longer than it took initial time.
One of the solution is to remove when statement from staticd nexthop yang OM.
When condition adds peformance toll on libyang's validate api.
The same when condition checks are done in frr northbound
validation phase (which are must faster).
With this change, if the same static routes are configured
agian and again, the time to completion does not go up and
perfomance does not degrade.
Ticket:CM-32530
Testing Done:
Configure 400 static routes across two vrfs and keep re-applying them.
The time to complete the config remains in few seconds.
Before:
root@bharat:~/stash/frr4# time vtysh -f static_route_cfg
real 0m19.877s
user 0m0.263s
sys 0m0.014s
After:
root@bharat:~/stash/frr4# time vtysh -f static_route_cfg
real 0m3.857s
user 0m0.239s
sys 0m0.034s
Co-developed-by: VishalDhingra <vdhingra@vmware.com> Signed-off-by: Chirag Shah <chirag@nvidia.com>
Chirag Shah [Wed, 13 Jan 2021 16:41:25 +0000 (08:41 -0800)]
yang: remove when condition from static nexthop om
Remove when conditions from the yang OM as it degrades
the performance in libyang.
Instead do the same when conditional check in frr northbound
validate phase. Reject the config if condiion do not meet.
Ticket:CM-32530
Testing Done:
Co-developed-by: VishalDhingra <vdhingra@vmware.com> Signed-off-by: Chirag Shah <chirag@nvidia.com>
Don Slice [Tue, 12 Jan 2021 16:05:23 +0000 (11:05 -0500)]
tools: ignore missing seq nums in prefix and access lists in frr-reload.py
If frr.conf contains a prefix-list or access-list without a seq number,
frr-reload needs to be aware that it should not delete/add if the running
config contains a seq number.
Ticket: CM-32623 Signed-off-by: Don Slice <dslice@nvidia.com>
Don Slice [Tue, 12 Jan 2021 15:41:17 +0000 (10:41 -0500)]
tools: apply black formatting changes to frr-reload.py
Since new workflow instructions state to run black against
python change and it found formatting changes required that
were not part of my change set, committing those changes
separately.
Donnie Savage [Fri, 11 Dec 2020 20:16:58 +0000 (15:16 -0500)]
eigrpd: Move `struct eigrp_master` to eigrpd.h
The `struct eigrp_master` data structure belongs in the
eigrpd.h file. Move it over, in addition start forward
thinking about the different TLV versions so we can
track them better in the future.
Signed-off-by: Donald Sharp <sharpd@nvidia.com> Signed-off-by: Donnie Savage <diivious@hotmail.com>
Steps to reproduce:
--------------------------
1. Bring up the base config as per the topology
2. Configure OSPF on all the routers of the topology.
3. Configure 5 static routes from the same network on R0 , 5 static routes from different networks and redistribute in R0
4. Configure External Route summary in R0 to summarise 5 routes to one route.
5. Delete the configured summary
6. configure the summary again and delete static routes .
7. Add back static routes.
8. Configure new static route which is matching the configured summary.
9. Delete one of the static route.
10. Configure redistribute connected and configure ospf external summary address to summarise the connected routes.
11. Clear ospf process and check for any errors.
[New LWP 2346]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/lib/frr/ospfd'.
Program terminated with signal SIGABRT, Aborted.
54 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
0 0x00007f296f278428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
1 0x00007f296f27a02a in __GI_abort () at abort.c:89
2 0x00007f296fca4110 in core_handler (signo=11, siginfo=0x7ffcd52044f0, context=<optimized out>) at lib/sigevent.c:254
3 <signal handler called>
4 0x000055949b9dfdff in ospf_lsdb_lookup (lsdb=lsdb@entry=0x55949bfd3688, lsa=lsa@entry=0x55949bfe1290) at ospfd/ospf_lsdb.c:179
5 0x000055949ba28fbe in ospf_ls_retransmit_lookup (lsa=0x55949bfe1290, nbr=0x55949bfd3610) at ospfd/ospf_flood.c:918
6 ospf_ls_retransmit_delete_nbr_if (oi=oi@entry=0x55949bfd2590, lsa=lsa@entry=0x55949bfe1290) at ospfd/ospf_flood.c:932
7 0x000055949ba2916b in ospf_ls_retransmit_delete_nbr_if (lsa=0x55949bfe1290, oi=0x55949bfd2590) at ospfd/ospf_flood.c:928
8 ospf_ls_retransmit_delete_nbr_as (ospf=ospf@entry=0x55949bfbdb30, lsa=lsa@entry=0x55949bfe1290) at ospfd/ospf_flood.c:959
9 0x000055949b9dcd7e in ospf_discard_from_db (ospf=ospf@entry=0x55949bfbdb30, lsdb=<optimized out>, lsa=lsa@entry=0x55949bfe1630) at ospfd/ospf_lsa.c:2552
10 0x000055949b9df1b3 in ospf_maxage_lsa_remover (thread=0x55949bfde930) at ospfd/ospf_lsa.c:2848
11 0x00007f296fcb1770 in thread_call (thread=0x55949bfde930) at lib/thread.c:1557
12 0x00007f296fcb19d6 in funcname_thread_execute (m=0x55949be0a630, func=func@entry=0x55949b9df0a0 <ospf_maxage_lsa_remover>, arg=arg@entry=0x55949bfbdb30, val=val@entry=0,
funcname=funcname@entry=0x55949ba31b41 "ospf_maxage_lsa_remover", schedfrom=schedfrom@entry=0x55949ba31917 "ospfd/ospf_lsa.c", fromln=3364) at lib/thread.c:1628
13 0x000055949b9de90b in ospf_flush_self_originated_lsas_now (ospf=ospf@entry=0x55949bfbdb30) at ospfd/ospf_lsa.c:3364
14 0x000055949ba19a55 in ospf_process_refresh_data (ospf=0x55949bfbdb30, reset=reset@entry=true) at ospfd/ospfd.c:138
15 0x000055949ba1aeef in ospf_process_reset (ospf=<optimized out>) at ospfd/ospfd.c:206
16 0x000055949ba0729b in clear_ip_ospf_process_magic (self=<optimized out>, vty=<optimized out>, argc=<optimized out>, argv=<optimized out>, instance_str=<optimized out>,
instance=<optimized out>) at ospfd/ospf_vty.c:11930
17 clear_ip_ospf_process (self=<optimized out>, vty=0x55949bfe2600, argc=<optimized out>, argv=<optimized out>) at ./ospfd/ospf_vty_clippy.c:306
18 0x00007f296fc66523 in cmd_execute_command_real (vline=vline@entry=0x55949bfd2fb0, vty=vty@entry=0x55949bfe2600, cmd=cmd@entry=0x0, filter=FILTER_RELAXED) at lib/command.c:1060
19 0x00007f296fc6869a in cmd_execute_command (vline=vline@entry=0x55949bfd2fb0, vty=vty@entry=0x55949bfe2600, cmd=0x0, vtysh=vtysh@entry=0) at lib/command.c:1119
20 0x00007f296fc68817 in cmd_execute (vty=vty@entry=0x55949bfe2600, cmd=cmd@entry=0x55949bfe7f80 "clear ip ospf pro", matched=matched@entry=0x0, vtysh=vtysh@entry=0)
at lib/command.c:1275
21 0x00007f296fcb6c13 in vty_command (vty=vty@entry=0x55949bfe2600, buf=0x55949bfe7f80 "clear ip ospf pro") at lib/vty.c:514
22 0x00007f296fcb6ea6 in vty_execute (vty=vty@entry=0x55949bfe2600) at lib/vty.c:1281
23 0x00007f296fcb97f4 in vtysh_read (thread=<optimized out>) at lib/vty.c:2123
24 0x00007f296fcb1770 in thread_call (thread=thread@entry=0x7ffcd5209590) at lib/thread.c:1557
25 0x00007f296fc82e78 in frr_run (master=0x55949be0a630) at lib/libfrr.c:1026
26 0x000055949b9d0f07 in main (argc=1, argv=0x7ffcd52098b8) at ospfd/ospf_main.c:230
Donald Sharp [Tue, 5 Jan 2021 20:56:12 +0000 (15:56 -0500)]
zebra: notify installing protocol when nexthops cannot be resolved
In the case where a routes nexthops cannot be resolved as part
of route processing, immmediately notify the upper level protocol
that their routes failed to install if they are interested in
being informed about this issue.