Commit Graph

587 Commits

Author SHA1 Message Date
Renato Westphal
cbdb74116f bgpd: remove 'network' commands from the BGP_IPV6L node
These commands don't belong in the BGP_IPV6L_NODE node anymore. A similar
change was done for BGP_IPV4L_NODE in commit 9bedbb1e5.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-09 20:15:14 -03:00
Donald Sharp
445c24803d bgpd: Fixup json with RouteDistinguishers
The json option for displaying a bgp table
with route Distinguishers in it was not properly
working.  This code cleans this issue up.

Additionally attempt to make the code a bit
easier to read and handle.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-05 10:12:00 -04:00
Donald Sharp
98ce9a06b4 bgpd: Cleanup bgp_show_table to be easier on the eyes
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-05 10:11:49 -04:00
Lou Berger
1ae44dfcba bgpd: unify 'show bgp' with RD with normal unicast bgp show
Signed-off-by: Lou Berger <lberger@labn.net>
2017-10-05 10:11:49 -04:00
Vincent JARDIN
04d14c8be1 scan-build: fix warning
Do not change the implementation, just fix scan-build/clang warning.
2017-10-02 09:14:03 +02:00
Lou Berger
2d9c2ae397 Merge pull request #1261 from dwalton76/bgpd-4byte-display
bgpd: fix 4-byte AS display in bestpath-from-AS
2017-09-28 17:50:19 -04:00
Renato Westphal
67c0a9206c Merge pull request #1180 from dwalton76/ipv6-static-route-null0
Ipv6 static route null0
2017-09-27 13:42:53 -03:00
Daniel Walton
fb2b09347d bgpd: fix 4-byte AS display in bestpath-from-AS
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

Before
======
cel-redxp-10# show ip bgp 20.1.3.0/24
BGP routing table entry for 20.1.3.0/24
Paths: (1 available, best #1, table Default-IP-Routing-Table)
  Advertised to non peer-group peers:
  top1(10.1.1.2) bottom0(20.1.2.2)
  4294967292
    20.1.2.2 from bottom0(20.1.2.2) (20.1.1.1)
      Origin IGP, metric 0, localpref 100, valid, external,
bestpath-from-AS -4, best
      Community: 99:1
      AddPath ID: RX 0, TX 92
      Last update: Wed Sep 27 16:02:34 2017

cel-redxp-10#

After
=====
cel-redxp-10# show ip bgp 20.1.3.0/24
BGP routing table entry for 20.1.3.0/24
Paths: (1 available, best #1, table Default-IP-Routing-Table)
  Advertised to non peer-group peers:
  bottom0(20.1.2.2)
  4294967292
    20.1.2.2 from bottom0(20.1.2.2) (20.1.1.1)
      Origin IGP, metric 0, localpref 100, valid, external,
bestpath-from-AS 4294967292, best
      Community: 99:1
      AddPath ID: RX 0, TX 2
      Last update: Wed Sep 27 16:07:09 2017

cel-redxp-10#
2017-09-27 16:07:24 +00:00
Donald Sharp
65d4e0c69b bgpd: Reduce multiaccess_check_v4 overhead for subgroups
Perf results at scale( >1k peers) showed a non-trivial
amount of time spent in bgp_multiaccess_check_v4.  Upon
function examination we are looking up the nexthops
connected node in each call as well as having to unlock
it after each iteration.  Rewrite to lookup the nexthop
node once.

This should reduce the node lookup by aproximately 1/2
which should yield some performance results.  There are
probably better things to do here but would require
deeper thought.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-26 20:06:13 -04:00
Philippe Guibert
197cb53000 bgpd: vty command fixup for evpn rt5
evpn vty command can be used to configure evpn rt5 entries.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2017-09-25 18:31:11 +02:00
Donald Sharp
b96879c0d1 bgpd: Add large community json support
Add the ability to display large commnunity json support

Fixes: 1191
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-19 13:57:35 -04:00
Renato Westphal
a2addae8fe *: use clang's 'ForEachMacros' format style option
This fixes the broken indentation of several foreach loops throughout
the code.

From clang's documentation[1]:
  ForEachMacros: A vector of macros that should be interpreted as foreach
  loops instead of as function calls.

[1] http://clang.llvm.org/docs/ClangFormatStyleOptions.html

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-09-15 14:53:46 -03:00
Daniel Walton
d114b977e9 *: support keywords that begin with uppercase letter
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

VARIABLE tokens must be all uppercase, this allows us to support WORD
tokens that begin with an uppercase letter.  The "Null0" keyword is an
example of where this is needed.

The only VARIABLE we had that wasn't already all uppercase was
ASN:nn_or_IP-address:nn
2017-09-14 18:07:30 +00:00
David Lamparter
be054588b4 bgpd: fix compiler warning
bgp_route.c:6393:7: error: ‘len’ may be used uninitialized in this function
gcc 5.4.0 isn't intelligent enough to notice it's set on all paths.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-09-07 15:31:50 +02:00
Renato Westphal
5ba345ccb2 Merge pull request #1047 from dwalton76/bgpd-draft-ietf-grow-bgp-gshut-10
bgpd: implement draft-ietf-grow-bgp-gshut-10
2017-09-05 10:20:49 -03:00
Renato Westphal
b3c18264e4 Merge pull request #1079 from qlyoung/fix-style-a
*: fix style
2017-08-31 13:22:55 -03:00
Jafar Al-Gharaibeh
959768e8d0 Merge pull request #1044 from donaldsharp/combination
Coverity Cleanup of Stuff
2017-08-31 10:25:55 -05:00
Quentin Young
60466a63f2
*: fix style
Fixes style nits introduced by recent pull requests.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-08-30 11:27:11 -04:00
Donald Sharp
32592ffb4f Merge pull request #1056 from opensourcerouting/oldbits-0
"pathspace" options, vtysh-suid-cleanups, "vty_frame()"
2017-08-29 17:48:36 -04:00
Donald Sharp
9af1a43159 Merge pull request #1073 from LabNConsulting/working/master/patch/fix-pr939-bgp-race
Fix bgpd race
2017-08-29 17:21:12 -04:00
Lou Berger
b3e1dd3ca4 bgp: add asserts to catch unsupported double enqueue of an RN on a bgp_process_queue
Signed-off-by: Lou Berger <lberger@labn.net>
2017-08-29 15:30:34 -04:00
Lou Berger
ac021f4046 bgp: fix handling of bgp_process_queue to allow for RNs added
during callback.  Issue introduced in PR #939.

Signed-off-by: Lou Berger <lberger@labn.net>
2017-08-29 15:27:21 -04:00
Lou Berger
cfe8d15a80 bgp: refactor bgp_process_queue to be consistent and cleanup related event queuing
Signed-off-by: Lou Berger <lberger@labn.net>
2017-08-29 15:26:49 -04:00
David Lamparter
ea47320b1d bgpd: remove some deep nesting
Some of this was so egregiously stupid, I couldn't look at it without
gouging my eyes out...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-29 08:36:03 +02:00
David Lamparter
2b79110731 bgpd: get rid of afi_header_vty_out() & co.
afi_header_vty_out() is easily replaced with vty_frame(), which means we
can drop a whole batch of "int *write" args as well as the entirety of
bgp_config_write_family_header().

=> AFI/SAFI config writing is now a lot simpler.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-29 08:36:03 +02:00
Mitesh Kanjariya
09fdc88c8c Merge branch 'master' into dev-master 2017-08-28 18:19:03 -07:00
Daniel Walton
31d5efe2ea Merge branch 'master' of https://github.com/dwalton76/frr into bgpd-draft-ietf-grow-bgp-gshut-10
Conflicts:
	bgpd/bgp_route.c
2017-08-28 06:59:38 -07:00
David Lamparter
0f1bbcb287 Merge pull request #1034 from dwalton76/bgpd-mpls-fec-allocate
Bgpd mpls fec allocate
2017-08-27 19:18:58 +02:00
Daniel Walton
7f32323620 bgpd: implement draft-ietf-grow-bgp-gshut-10
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-08-25 18:27:49 +00:00
Renato Westphal
0af35d90a1 *: fix assorted issues detected by Coverity Scan
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-08-24 21:49:39 -03:00
Donald Sharp
27c5d4de93 Merge pull request #1031 from opensourcerouting/small-bits
small bits
2017-08-24 08:58:46 -04:00
Renato Westphal
744899219f *: use zapi_route to send/receive redistributed routes as well
Some differences compared to the old API:
* Now the redistributed routes are sent using address-family
  independent messages (ZEBRA_REDISTRIBUTE_ROUTE_ADD and
  ZEBRA_REDISTRIBUTE_ROUTE_DEL). This allows us to unify the ipv4/ipv6
  zclient callbacks in the client daemons and thus remove a lot of
  duplicate code;

* Now zebra sends all nexthops of the redistributed routes to the client
  daemons, not only the first one. This shouldn't have any noticeable
  performance implications and will allow us to remove an ugly exception
  we had for ldpd (which needs to know all nexthops of the redistributed
  routes). The other client daemons can simply ignore the nexthops if
  they want or consult just the first one (e.g. ospfd/ospf6d/ripd/ripngd).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-08-23 20:25:45 -03:00
David Lamparter
8d0ab76de1 bgpd: fix stats counting for IPv6
Fixes: #991
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-24 00:18:53 +02:00
Daniel Walton
e889891d8b bgpd: 'show ip bgp regex' needs to be VRF aware
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-08-22 19:33:22 +00:00
Daniel Walton
7b2ff25031 bgpd: remove json option from 'sh ip bgp' commands that do not support it
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-08-22 19:11:31 +00:00
Daniel Walton
318cac96ef bgpd: Memory wasting in zebra by non used MPLS FECs
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-08-22 18:14:50 +00:00
Mitesh Kanjariya
0291c246db fix coding style
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-18 22:43:09 -07:00
Mitesh Kanjariya
57f7feb64f Fix coding style.
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-18 17:33:56 -07:00
Jorge Boncompte
aac2483887 bgpd: bgp process queue optimization
There are several code paths that dump nodes to the queue for route
processing in a loop. This patch tries to reduce memory allocations/freeing
(work item, list node) and thread scheduling overhead by batching the nodes
in a simple queue list.

In the past when route processing wasn't event driven (bgp_scan()), this used
to have a noticeable impact in table loading, convergence time and memory heap
fragmentation due to reduced alloc's/free's.

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
2017-08-17 17:58:35 +02:00
Jorge Boncompte
92375c917e bgpd: inline bgp_lock()/bgp_unlock()
Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
2017-08-17 17:47:07 +02:00
vivek
b682f6de5a zebra: Fix MAC change handling for a neighbor
When the MAC changes for a local neighbor, ensure that the neighbor data
structure as well as the link between the neighbor and MAC data structures
is updated correctly.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Mitesh Kanjariya <mitesh@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-17565
Reviewed By: CCR-6605
Testing Done: Manual, evpn-smoke
2017-08-17 03:54:38 -07:00
vivek
cb499ebbaa bgpd: Register for label only the default instance
Ensure that the registration for the "in" label for a unicast prefix
is done only in the default instance. The zebra label manager as well
as other code in BGP only has support for assigning labels in the
default instance.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-17110
Reviewed By: CCR-6588
Testing Done: Manual tests, mpls
2017-08-17 02:54:54 -07:00
Mitesh Kanjariya
c6462ff4b3 bgpd: Fix json output
Ticket: CM-17259
Review: CCR-6512
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-17 01:42:53 -07:00
Mitesh Kanjariya
9c92b5f768 bgpd: Json support for evpn commands
Ticket:CM-16241
Reviewed By:CCR-6451
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-17 01:29:07 -07:00
Mitesh Kanjariya
db0e1937ca bgpd: Ignore EVPN routes from CLAG peer when VNI comes up
There are two parts to this commit:
1. create a database of self tunnel-ip for used in martian nexthop check
In a CLAG setup, the tunnel-ip (VNI UP) notification comes before the clag-anycast-ip comes up in the system.
This was causing our self next hop check to fail and we were instaling routes with martian nexthop in zebra.
We need to keep this info in a seperate database for all local tunnel-ip.
This database will be used in parallel with the self next hop database to martian nexthop checks.
2. When a local VNI comes up, update the tunnel-ip database and filter routes in the RD table if necessary
In case of EVPN we might receive routes from clag peer before the clag-anycast ip and VNI is up on the system.
We will store the routes in the RD table for later processing.
When VNI comes UP, we loop thorugh all the routes and install them in zebra if required.
However, we were missing the martian nexthop check in this code path.
From now onwards, when a VNI comes UP,
we will first update the tunnel-ip database
We then loop through all the routes in RD table and apply martian next hop filter if required.

Things not covered in this commit but are required:

This processing is needed in general when an address becomes a connected address.
We need to loop through all the routes in BGP and apply martian nexthop filter if necessary.
This will be taken care in a seperate bug

Ticket:CM-17271/CM-16911
Reviewed By: ccr-6542
Testing Done: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-16 23:19:58 -07:00
Donald Sharp
b03b88986e lib, bgpd: Distinguish between AF_EVPN and AF_ETHERNET
Create AF_EVPN for internal use and start using it.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2017-08-08 10:34:31 -04:00
Donald Sharp
4192df64c9 bgpd: Fix output of interface based 'show bgp ..' commands
When issuing a 'show ip bgp' command and the nexthop is
a interface, if the interface name was greater than 7 characters
we would arbitrarily start a new-line and setup the next
line to start at the wrong spot.

Modify the interface field to allow 16 characters than 7( to
match v6 display ), and if the interface name is greater than
16 characters properly setup the next line for display

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-08 10:28:54 -04:00
Daniel Walton
8a89316378 bgpd: show bgp ipv4 label-unicast does not provide any output
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-16957
2017-08-08 10:28:54 -04:00
Mitesh Kanjariya
16f7ce2b1e bgpd: Added support for vni filtering
1. provision to add match clause with a vni under route-map

Ticket: CM-16349
Review: CCR-6190
Unit-test: Manual (logs attached to ticket)

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-08 10:09:37 -04:00
Mitesh Kanjariya
d37ba5499e bgpd, lib, vtysh: Added support for mac filtering in route-maps
1. Added support to create mac filters
2. Enabled route-map commands for EVPN address family
3. Provision to add mac filters under match clause in route-maps

Ticket: CM-16349
Review: CCR-6190
Unit-test: Manual (logs attached to ticket)

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-08 10:09:37 -04:00