Commit Graph

361 Commits

Author SHA1 Message Date
Russ White
37a5432422
Merge pull request #3688 from chiragshah6/evpn_dev
zebra: EVPN probe local inactive neigh/arp entry upon mac mobility
2019-02-05 10:48:33 -05:00
Renato Westphal
3524352154
Merge pull request #3698 from donaldsharp/netlink_is_serious_business
Netlink is serious business
2019-02-05 11:52:33 -02:00
Donald Sharp
6cae47ed38 zebra: When the kernel passes up a onlink route respect those flags
Read the onlink flag from the kernel for routes and pass them
up and through to zebra so that we are consistent with what
the kernel is telling us.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-29 22:01:03 -05:00
Donald Sharp
275565fb5a zebra: some v4 attributes were being written 2 times
When the nexthop->type is NEXTHOP_TYPE_IPV4_IFINDEX we
were writing the RTA_PREFSRC 2 times for the build_singlepath
and build_multipath functions.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-29 20:41:18 -05:00
Donald Sharp
e405df7e78 zebra: some v6 attributes were being written twice
Some v6 attributes for the netlink_route_build_singlepath
code were being written two times for the NEXTHOP_TYPE_IPV6_IFINDEX
nexthop type.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-29 20:40:41 -05:00
Chirag Shah
6fe2b0e67f zebra: add kernel neigh update api
The kernel neigh update api helps update neighbor entry,
using changing state and flags parameters.

Ticket:CM-22864
Reviewed By:
Testing Done:

Signed-off-by:Chirag Shah <chirag@cumulusnetworks.com>
2019-01-29 08:02:29 -08:00
Russ White
262d4dda2a
Merge pull request #3508 from chiragshah6/evpn_dev2
zebra: EVPN remote entry delete check local entry presence
2019-01-23 13:44:46 -05:00
Mark Stapp
fc60837278 zebra: openbsd LSP update code
Finish the LSP update code for the async dataplane for
the openbsd platform. Remove synch apis now that we've
converted to the async code path.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-01-22 15:07:24 -05:00
Mark Stapp
16c628de99 zebra: infra for LSP updates using dplane
Adding infra to zebra dplane to support LSP updates. Add
kernel api for LSP updates that uses a dataplane context; add
stub apis for netlink, bsd, and 'null' kernel paths. Add
version of netlink mpls update code that takes a dplane
context struct instead of a zebra lsp struct.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-01-22 12:02:20 -05:00
Donald Sharp
62819462b7 zebra: Cleanup unnecessary check
We self include the enum that has the RTA_EXPIRES in it,
as such this will always be true.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-15 08:55:34 -05:00
Chirag Shah
67fb9374dc zebra: evpn remote delete fetch local entry
An EVPN type-2 entry is in freeze state during remote update,
remote VTEP can send typ-2 withdraw update,
upon receiving an entry delete (withdraw), first check
kernel has in local reachable state. Upon
unfreeze use the local entry to advertise to peers.
Fetch is for both MAC and IP, delete can come for
only MAC or MAC-IP combined route.

The specific entry fetch only required request flag to be set,
dump flag is not required.

Testing Done:
Simulate two VTEPs to do M1, IP1 mobility sequence,
freeze MAC during remote MAC update, subsequently send
withdraw type-2 route from origintating VTEP.
This results in read apis to invoke for local reachable entry.
Zebra updates its cache and upon unfreeze originates type-2.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-12-31 14:40:31 -08:00
Chirag Shah
718f9b0f88 zebra: netlink_request consolidataion
Make netlink_request api generic where it can be used
for dump or querying specific information request.

nelink request nlm flags (NLM_F_ROOT | NLM_F_MATCH) are
used to dump purpose, if client wants to query spcific
MAC or IP using netlink_request does not require to set
them.
nlm struct is passed by the caller of netlink_request,
it can also set the nlm request flags.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-12-31 14:38:32 -08:00
Donald Sharp
220f0f4245 zebra: Allow zebra to only mark up to multipath_num nexthops as ACTIVE
NEXTHOP_FLAG_ACTIVE currently means that the nexthop is considered
good enough to be installed. With current ecmp restrictions this
translation from multipath_num is enforced in the data plane.
The problem with this is of course that every data plane now
becomes concerned about the multipath num and must enforce it
independently.  Currently *bsd does not honor multipath_num at
all and linux marks all nexthops as being installed even when
it honors a multipath_num that is less than the total.

This code change moves the multipath_num enforcement from a dataplane
decision to a zebra nexthop decision.  Thus dataplanes now can
just install those nexthops marked as NEXTHOP_FLAG_ACTIVE
without having to worry about multipath_num.

*BSD will now respect multipath_num and Linux now properly notes
which routes are actually installed or not:

sharpd@donna ~/f/t/topotests> ps -ef | grep frr
frr       6261  1556  0 09:12 ?        00:00:00 /usr/lib/frr/zebra -e 2 --daemon -A 127.0.0.1
frr       6279  1556  0 09:12 ?        00:00:00 /usr/lib/frr/staticd --daemon -A 127.0.0.1

donna.cumulusnetworks.com(config)# do show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route

K>* 0.0.0.0/0 [0/106] via 10.0.2.2, enp0s3, 00:00:45
S>* 4.4.4.4/32 [1/0] via 10.0.2.1, enp0s3, 00:00:02
  *                  via 192.168.209.1, enp0s8, 00:00:02
                     via 192.168.210.1, enp0s9 inactive, 00:00:02
C>* 10.0.2.0/24 is directly connected, enp0s3, 00:00:45
C>* 192.168.209.0/24 is directly connected, enp0s8, 00:00:45
C>* 192.168.210.0/24 is directly connected, enp0s9, 00:00:45
donna.cumulusnetworks.com(config)#

sharpd@donna ~/f/t/topotests> ip route show
default via 10.0.2.2 dev enp0s3 proto dhcp metric 106
4.4.4.4 proto 196 metric 20
	nexthop via 10.0.2.1 dev enp0s3 weight 1
	nexthop via 192.168.209.1 dev enp0s8 weight 1
10.0.2.0/24 dev enp0s3 proto kernel scope link src 10.0.2.15 metric 106
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown
192.168.209.0/24 dev enp0s8 proto kernel scope link src 192.168.209.2 metric 105
192.168.210.0/24 dev enp0s9 proto kernel scope link src 192.168.210.2 metric 103
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-12-13 09:21:26 -05:00
Don Slice
f17b99ed17 zebra: handle neighbor delete from kernel for ipv4 link-local
Problem reported that kernel neighbor entries could end up in "FAILED"
state when the neighbor entry was deleted.  This fix handles the
notification of the event from netlink messages and re-inserts the
deleted entry.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-11-29 22:01:47 +01:00
Mark Stapp
78e54ded79 zebra: Fix netlink installation of recursive ecmp routes
Recursive multipath nexthops were broken by the initial async
dataplane - we were trying to install an extra, invalid
nexthop.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-11-13 10:21:16 -05:00
Mark Stapp
2577906481 zebra: revise struct names to resolve review comments
Use standard type naming and remove use of typedef to resolve
some review comments.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-10-25 08:57:04 -04:00
Mark Stapp
14c8b173d2 zebra: remove old apis after new dplane work
Replaced or out-grew a few zebra internal apis during async
dataplane work; removing them.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-10-25 08:57:04 -04:00
Mark Stapp
f183e380fa zebra: add handy res2str utility
Add a 2str utility for dplane result codes; use it in
a debug or two.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-10-25 08:57:04 -04:00
Mark Stapp
fe2c53d4ea zebra: Fix style issues
Clean up a couple of checkstyle reports in the dataplane
commit.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-10-25 08:34:30 -04:00
Mark Stapp
5709131cec zebra: resolve style issues in dplane commit
Resolve (most) style issues in the initial zebra dataplane
commit branch.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-10-25 08:34:30 -04:00
Mark Stapp
7cdb1a8445 zebra: start dataplane layer work
Reduce or eliminate use of global zebra_ns structs in
a couple of netlink/kernel code paths, so that those paths
can potentially be made asynch eventually.

Slide netlink_talk_info into place to remove dependency on core
zebra structs; add accessors for dplane context block

Start init of route context from zebra core re and rn structs;
start queueing and event handling for incoming route updates.

Expose netlink apis that don't rely on zebra core structs;
add parallel route-update code path using the dplane ctx;
simplest possible event loop to process queued route'
updates.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-10-25 08:34:30 -04:00
F. Aragon
3659007663
zebra: dead code (Coverity 1473593)
Conditional code in netlink_macfdb_update() introduced in 2232a77c used
the 'dst_present' variable because not all cases were covered. Now it is
not necessary.

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-09-25 16:56:08 +02:00
Russ White
a1b32de24e
Merge pull request #3052 from donaldsharp/dplane_2
Dplane 2
2018-09-24 10:54:16 -04:00
Mark Stapp
85a75f1e77 zebra: Start abstraction of zebra_dplane_info for context passing
Reduce or eliminate use of global zebra_ns structs in
a couple of netlink/kernel code paths, so that those paths
can potentially be made asynch eventually.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-19 18:34:25 -04:00
Mark Stapp
ea1c14f680 zebra: Create zebra_dplane.c and .h
Add first sketchy 'dplane' files.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-19 18:29:55 -04:00
vivek
a37f4598d7 zebra: Use boolean for certain VxLAN-EVPN flags
Use boolean variables instead of unsigned int for certain VxLAN-EVPN
flags which are really used as boolean.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Reviewed-by:   Chirag Shah <chirag@cumulusnetworks.com>

Ticket: CM-22288
Reviewed By: CCR-7832
Testing Done:
Along with a subsequent, related commit
2018-09-18 10:41:53 -04:00
vivek
d63c1b18b4 zebra: Remove unused parameter in MAC delete
When a MAC moves from local to remote, a replace is allowed, EVPN
no longer has to delete the local MAC before installing the remote
MAC.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Reviewed-by:   Chirag Shah <chirag@cumulusnetworks.com>
2018-09-18 10:41:53 -04:00
Donald Sharp
5523c15692 zebra: Send correct default vrf tableid for MROUTE stats
So the linux kernel uses the RT_TABLE_MAIN for the table
id used for ip routing.  The multicast routing tables use
RT_TABLE_DEFAULT.  We changed the internal code of zebra_vrf
a few months back to use RT_TABLE_MAIN as the tableid to
use.  This caused the pim sg stats to stop working because
of the kernel bug where it uses a different table
for ip routing and ip multicast.

Put a bit of a special case in to do the right thing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-17 09:22:31 -04:00
Donald Sharp
c25e2f1ad1 zebra: Newer kernels send data about mroute changes
Newer linux kernels apparently send data down the netlink
bus for the creation of mroutes.  Add a bit of code
to notice this and to handle it appropriately( ie do
nothing at this point in time ) as that the correct
place to do this is in the pim socket in pimd.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-14 17:54:11 -04:00
Donald Sharp
87b5d1b098 zebra: Print out netlink message type instead of number
When we are displaying data about a netlink message
in debugs or errors, print out the message type
as a string instead of a number.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-14 17:48:51 -04:00
Quentin Young
e914ccbe9c zebra: ZEBRA_[ERR|WARN] -> EC_ZEBRA
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13 19:23:29 +00:00
Donald Sharp
6efca3442f
Merge pull request #3007 from pacovn/static_analysis__shadow_variables2
lib vtysh zebra: variable shadowing fixes
2018-09-13 08:38:32 -04:00
David Lamparter
e991eff5b5 Merge remote-tracking branch 'frr/master' into warnings
Conflicts:
	zebra/if_ioctl_solaris.c
	zebra/rtread_getmsg.c

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-09-12 21:58:39 +02:00
F. Aragon
c683bd446c
lib vtysh zebra: variable shadowing fixes
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-09-12 12:27:38 +02:00
Quentin Young
364fed6b07 zebra: fix includes
Add and remove error related includes as necessary.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-06 20:56:41 +00:00
Quentin Young
9df414feeb zebra: flog_warn conversion
Convert Zebra to user error subsystem.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-06 20:56:38 +00:00
Christian Franke
da82f6b42a zebra: add RTPROT_FABRICD route type 197
Add an iproute2 route type for fabricd

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05 11:38:12 +02:00
Donald Sharp
5b4256ca42 zebra: Fix crash in mroute debug
There exists a possibility that the ifindex we are passed
does not exist and as such we should check for it not
resolving as part of the debug.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-28 10:35:35 -04:00
Stephen Worley
87da6a6019 zebra: Add support for static encap mpls labels
We were ignoring mpls labels encapped with static routes.
Added support for single and multipath labels.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-25 13:19:07 -04:00
Martin Winter
09890489cc
Merge pull request #2122 from donaldsharp/zebra_nhs
Create Staticd
2018-08-08 08:07:24 -07:00
Renato Westphal
c3d098ab30
Merge pull request #2726 from sworleys/Netlink-Filter-AFI
zebra: Ignore AF_ETHERNET and AF_MPLS in route change as well
2018-08-06 20:26:46 -03:00
Donald Sharp
51c4ed0a0e staticd, zebra: Fix up code warnings
CI found a couple of warnings that needed to be cleaned up.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-07-29 13:06:49 -04:00
Donald Sharp
40ecd8e46d lib, zebra: Allow protocols to use Distance as part of RR semantics
Allow protocols to specify to zebra that they would like zebra
to use the distance passed down as part of determine sameness for
Route Replace semantics.

This will be used by the static daemon to allow it to have
backup static routes with greater distances.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-07-29 12:43:23 -04:00
Stephen Worley
2e2b0fb3c2
Merge branch 'master' into Netlink-Prefix-Len-Check 2018-07-26 15:34:56 -04:00
Stephen Worley
e17d9b2dfe zebra: Make prefix length check return error
Prefix length validation checks should be returning an error
rather than 0. Switch to that and make them error messages.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2018-07-26 15:10:53 -04:00
Stephen Worley
8122787440 zebra: Format log for address family check
Switched the address family check to use unsigned format.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2018-07-25 14:08:24 -04:00
Stephen Worley
de1cd6b913 zebra: Ignore AF_ETHERNET and AF_MPLS in route_change as well
Remove AF_ETHERNET and AF_MPLS as valid address families for route
changes.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2018-07-25 14:02:00 -04:00
Russ White
4dbd617abd
Merge pull request #2704 from sworleys/Netlink-Nexthop-Hang
zebra: Add check for nexthop loop to prevent hanging
2018-07-24 19:42:11 -04:00
Russ White
bbc7adf1b4
Merge pull request #2665 from chiragshah6/evpn_dev
bgpd: support evpn nd ext community
2018-07-24 11:55:08 -04:00
Stephen Worley
758297039c Change log statements to use unsigned format
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2018-07-24 11:14:07 -04:00