Commit Graph

603 Commits

Author SHA1 Message Date
Donald Sharp
2e4e3ba10b zebra: Delete the malloced memory under show zebra
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-16 19:01:12 -04:00
Donald Sharp
88b0baa648 zebra: move allow_delete to zrouter.allow_delete
Instead of having global allow_delete move it to
where it belongs in the zrouter data structure.

Additionally show this data in `show zebra`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-01 07:59:53 -04:00
Russ White
5295200043
Merge pull request #11474 from donaldsharp/dp-dpdk
Dp dpdk
2022-06-28 07:33:22 -04:00
Donald Sharp
385d37ab31 zebra: Add ability for netconf dplane to handle global values
Add the ability for the netconf dplane code to handle
the global NETCONFA_IFINDEX_DEFAULT and NETCONF_IFINDEX_ALL
values.  Then store our interested values when we get
them from the kernel as well as being able to display
them to the end operator.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-27 16:30:20 -04:00
Anuradha Karuppiah
59f47eb010 zebra: expand pbr rule action for dataplane programming
PBR rules are installed as match, action rules in most dataplanes. This
requires the action to be resolved via a GW. And the GW to be subsequently
resolved to {SMAC, DMAC}.

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2022-06-27 07:56:55 -04:00
Anuradha Karuppiah
4cf4fad153 zebra: add support for maintaining local neigh entries
Currently specific local neighbors (attached to SVIs) are maintatined
in an EVPN specific database. There is a need to maintain L3 neighbors
for other purposes including MAC resolution for PBR nexthops.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
   Cleanup compile and fix crash
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2022-06-27 07:56:55 -04:00
Donald Sharp
c704cb44a9 lib, zebra: Notice when a nexthop is set linkdown
When a nexthop is set RTNH_F_LINKDOWN, start noticing
that this flag is set.  Allow FRR to know about this
flag but at this point do not do anything with it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-23 11:23:37 -04:00
Donald Sharp
c9af62e314 zebra: Add a configurable knob zebra nexthop-group keep (1-3600)
Allow end operator to set how long a nexthop-group is kept around
in the system after it is no-longer being used.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-16 14:47:19 -04:00
Donald Sharp
35729f38fa zebra: Add a timer to nexthop group deletion
Before deleting nexthop groups, that are installed,
from the system, start a timer and hold the nexthop
group for that time.

Suppose you have this scenario

a) create a static route with 1 x ecmp
      creates a nhg with 1 x ecmp
b) create a static route with 2 x ecmp
      creates a nhg with 2 x ecmp
      deletes a's nhg
c) create a static route with 3 x ecmp
      creates a nhg with 3 x ecmp
      deletes b's nhg
d) create a different route with 1 x ecmp
      creates another 1 x ecmp ( since a's ecmp was deleted )
e) create a different route with 2 x ecmp
      creates another 2 x ecmp ( since b's ecmp was deleted )

If you don't delete the nhg, start a timer, the nhg's used
in steps a and b can be reused for steps d and e.  This reduces
overhead work with zebra <-> kernel interactions and improves
the speed of the system.

So modify the code to note that an installed nexthop group should
be kept around a bit and hopefully reused.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-16 14:47:19 -04:00
Donatas Abraitis
70dd370f5a *: Use autocomplete for route-maps under commands that require it
For example:

```
donatas-laptop# show bgp ipv4 unicast neighbors 127.0.0.2 advertised-routes route-map ?
  RMAP_NAME  Name of the route map
       testas2 testas

donatas-laptop(config)# router bgp
donatas-laptop(config-router)# address-family ipv4
donatas-laptop(config-router-af)# redistribute connected route-map ?
  RMAP_NAME  Pointer to route-map entries
       testas2 testas

donatas-laptop(config-router-af)# network 192.168.0.0/23 route-map ?
  RMAP_NAME  Name of the route map
       testas2 testas
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-13 21:00:51 +03:00
Loganaden Velvindron
0c99696f30 zebra: Add startup message and display netlink buffer size.
Add startup message and display netlink buffer size.

Signed-off-by: Loganaden Velvindron <logan@cyberstorm.mu>
2022-05-13 14:58:18 +04:00
David Lamparter
46a3bfa695
Merge pull request #10988 from AbhishekNR/ipv6_mroute_cli 2022-04-29 10:23:37 +02:00
David Lamparter
0cbed9511a lib, zebra, pimd: clean up/fix VRF DECLVAR macros
There's a common pattern of "get VRF context for CLI node" here, which
first got a helper macro in zebra that then permeated into pimd.

Unfortunately the pimd copy wasn't quite adjusted correctly and thus
caused two coverity warnings (CID 1517453, CID 1517454).

Fix the PIM one, and clean up by providing a common base macro in
`lib/vty.h`.

Also rename the macros (add `_VRF`) to make more clear what they do.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-28 11:09:26 +02:00
Abhishek N R
1d06e3547a zebra: Removed show_ipv6_mroute cli from zebra_vty.c
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-04-28 01:43:19 -07:00
David Lamparter
6c90403bb1 zebra: show ip nht mrib
Prints the SAFI_MULTICAST NHT state in zebra.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-27 14:57:18 +02:00
Russ White
5d97021ba3
Merge pull request #10427 from sworleys/Protodown-Reason-Upstream
Add Support for Setting Protodown Reason Code
2022-03-15 19:58:16 -04:00
Donald Sharp
04442fdbea zebra: Add ECMP supported to show zebra
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-11 14:25:23 -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
anlan_cs
4d4c404bf6 *: Add necessary new line for output of vty_out()
Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-02-27 10:59:19 +08:00
Donald Sharp
530c9fc4f5 zebra: Convert some show zebra output to a table
Make the output a bit easier to interpret and use by
converting to usage of a table.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-04 10:29:38 -05:00
Donald Sharp
954e1a2bc9 zebra: Add knowledge about RA and RFC 5549 to show zebra
Add to `show zebra` whether or not RA is compiled into FRR
and whether or not BGP is using RFC 5549 at the moment.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-04 10:29:38 -05:00
Donald Sharp
281686819d zebra: Add evpn status to show zebra
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-04 10:29:38 -05:00
Donald Sharp
1777ba2ac4 zebra: Add os and version to show zebra
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-04 10:29:38 -05:00
Donald Sharp
090ee85656 zebra: Add kernel nexthop group support to show zebra
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-04 10:29:38 -05:00
Donald Sharp
1a97e35eb8 zebra: Add MPLS status to show zebra
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-04 10:29:38 -05:00
Donald Sharp
9783de6faf zebra: Add if v4/v6 forwarding is turned on/off to show zebra
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-04 10:29:38 -05:00
Donald Sharp
dd42779ff9 zebra: Add to show zebra the type of vrf devices being used
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-04 10:29:38 -05:00
Donald Sharp
88fd4cb8ca zebra: Add ability to know when FRR is not asic offloaded
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-04 10:29:38 -05:00
Mark Stapp
b86c1f4fcc zebra: name the route_entry opaque struct more specifically
The name 'opaque' is a little general - call the route_entry
struct 're_opaque' to make it more specific.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2022-01-31 08:50:50 -05:00
Russ White
05786ac774
Merge pull request #9644 from opensourcerouting/ospf-opaque-attrs
OSPF opaque route attributes
2022-01-18 09:08:38 -05:00
Renato Westphal
5b5d66c431 lib, ospfd, ospf6d, zebra: add OSPF opaque route attributes
Update ospfd and ospf6d to send opaque route attributes to
zebra. Those attributes are stored in the RIB and can be viewed
using the "show ip[v6] route" commands (other than that, they are
completely ignored by zebra).

Example:
```
debian# show ip route 192.168.1.0/24
Routing entry for 192.168.1.0/24
  Known via "ospf", distance 110, metric 20, best
  Last update 01:57:08 ago
  * 10.0.1.2, via eth-rt2, weight 1
    OSPF path type        : External-2
    OSPF tag              : 0

debian#
debian# show ip route 192.168.1.0/24 json
{
  "192.168.1.0\/24":[
    {
      "prefix":"192.168.1.0\/24",
      "prefixLen":24,
      "protocol":"ospf",
      "vrfId":0,
      "vrfName":"default",
      "selected":true,
      [snip]
      "ospfPathType":"External-2",
      "ospfTag":"0"
    }
  ]
}
```

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2022-01-15 17:22:27 +01:00
Lou Berger
4b7d297d4b
Merge pull request #9750 from mjstapp/zebra_installed_nhg_id
zebra: add installed nexthop-group id value
2021-12-21 10:31:04 -05:00
Stephen Worley
f6f16b6073 zebra: add optional NHG ID output to show ip ro
Add optional NHG ID output to `show ip route` dumps. We have
this in json output already as nexthopGroupID but nice
to have the option in a normal dump as well. Not including in main
output for now to avoid breaking screen scrapers.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2021-12-02 11:28:37 -05:00
Donatas Abraitis
c48349e346 *: Remove redundand braces for single statement blocks
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-27 11:20:59 +02:00
Donatas Abraitis
962af8a8cd zebra: Convert vty_out to vty_json for JSON
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-25 17:49:46 +02:00
Mark Stapp
002930f7bb zebra: add installed nexthop-group id value
In some cases, zebra may install a nexthop-group id that is
different from the id of the nhe struct attached to a
route-entry. This happens for a singleton recursive nexthop,
for example, where a route is installed with the resolving
nexthop's id.

The installed value is the most useful value - that corresponds
to information in the kernel on linux/netlink platforms that
support nhgs. Display both values if they differ in ascii
output, and include both values in the json form.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2021-11-23 11:23:26 -05:00
Donatas Abraitis
08edf9c6af zebra: Replace inet_ntop to %pI4/6 for JSON outputs
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-18 18:45:41 +02:00
Quentin Young
0c124f75db
Merge pull request #9440 from dlqs/dplanehook2 2021-10-26 15:26:32 -04:00
Donald Sharp
d9654571f9
Merge pull request #9316 from ton31337/fix/send_best_path_reason_for_zebra
bgpd: Send BGP best path reason to Zebra
2021-10-25 11:09:20 -04:00
Russ White
4dfa838afa
Merge pull request #9656 from chiragshah6/mdev
zebra: add resolver flag for nexthop in json
2021-10-19 19:16:14 -04:00
Donald Lee
310dd2b362 zebra: Add vty cmd zebra on-rib-process script SCRIPT
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-10-20 00:56:00 +08:00
Donatas Abraitis
1d7260a1b5 bgpd: Send BGP best path reason to Zebra
```
exit1-debian-9# show ip route 172.16.16.1/32
Routing entry for 172.16.16.1/32
  Known via "bgp", distance 20, metric 0, best
  Last update 00:00:28 ago
  * 192.168.0.2, via eth1, weight 1
    AS-Path          : 65003
    Communities      : first 65001:2 65001:3
    Large-Communities: 65001:1:1 65001:1:2 65001:1:3
    Selection reason : First path received
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-14 16:52:47 +03:00
David Lamparter
c5726f0314
Merge pull request #9676 from donaldsharp/import_register 2021-10-13 22:28:03 +02:00
Russ White
99497bc4ee
Merge pull request #9471 from pguibert6WIND/table_manager_alloc2
zebra: extend table manager per vrf, add vty configuration
2021-10-08 13:49:54 -04:00
Chirag Shah
1b3ac4c7ca zebra: add nhg id to show ip route json
Add json field nexthop group id to
'show ip route json'.

Testing Done:
{
  "27.0.0.14\/32":[
    {
      "prefix":"27.0.0.14\/32",
      "protocol":"bgp",
      "selected":true,
      "destSelected":true,
      "distance":20,
      "metric":0,
      "installed":true,
      "table":254,
      "internalStatus":16,
      "internalFlags":8,
      "internalNextHopNum":2,
      "internalNextHopActiveNum":2,
      "nexthopGroupId":103,     <---- New field
      "uptime":"00:04:37",
      "nexthops":[
        {
          "ip":"fe80::202:ff:fe00:11",
          "interfaceName":"uplink-1",
        },
        {
          "ip":"fe80::202:ff:fe00:1d",
          "interfaceName":"uplink-2",
        }
      ]
    }
  ]
}

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2021-10-03 16:20:46 -07:00
Chirag Shah
6ba578ef29 zebra: add resolver for nexthop in json
zebra rib 'show ip route json' lists all nexthops in a flat list.
To identify the recursively resolved
nexthops relation adding a flag "resolver" as delimiter
to identify recursively resolved nexthop in the list.

Testing Done:
{
  "1.1.1.0\/24":[
    {
      "prefix":"1.1.1.0\/24",
      "protocol":"static",
       ....
      "nexthops":[
        {
          "flags":5,
          "ip":"27.0.0.14",
          "afi":"ipv4",
          "active":true,
          "recursive":true,
          "weight":1
        },
        {
          "flags":3,
          "fib":true,
          "ip":"fe80::202:ff:fe00:11",
          "afi":"ipv6",
          "interfaceIndex":12,
          "interfaceName":"uplink-1",
          "resolver":true,  <-- Resolver for recursive true flag nh
          "active":true,
          "weight":1
        },
      ]
    }
  ]
}

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2021-09-27 16:05:08 -07:00
Donald Sharp
d597533a9d zebra: Start carrying safi for rnh processing
PIM is going to need to be able to send down the address it is
trying to resolve in the multicast rib.  We need a way to signal
this to the end developer.  Start the conversion by adding the
ability to have a safi.  But only allow SAFI_UNICAST at the moment.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-27 12:38:08 -04:00
Donald Sharp
6071e5e96e zebra: remove 'enum rnh_type' from system
This code is now dead code since there are not two
nexthop resolution types.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-27 12:38:08 -04:00
Donald Sharp
7272e2a461 zebra: remove import check resolution from zebra
The entirety of the import checking no longer needs to be
in zebra as that no-one is calling it.  Remove the code.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-27 12:38:08 -04:00
Donald Sharp
4aabcba0f1 zebra: Being able to use the default route is a boolean not an int
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-27 12:38:08 -04:00