Commit Graph

17715 Commits

Author SHA1 Message Date
Donald Sharp
7ec5e2bf70
Merge pull request #4514 from opensourcerouting/warnings-20190612
*: kill more warnings
2019-06-17 15:19:42 -04:00
David Lamparter
7925535457
Document FRR service manipulation (#4528)
Document FRR service manipulation
2019-06-17 21:16:55 +02:00
Ameya Dharkar
c5431822de Zebra: Address review comments for RMAC FPM feature 1
Address minor review comments.

Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
2019-06-17 12:05:38 -07:00
Ameya Dharkar
9da60d0a19 Zebra: Build nelink message for RMAC updates
- Function "zfpm_netlink_encode_mac()" builds a netlink message for RMAC updates.

- To build a netlink message for RMAC updates, we use "ndmsg" in rtlink.

- FPM Message structure is:
  FPM header -> nlmsg header -> ndmsg fields -> ndmsg attributes

- Netlink message will look like:
  {'ndm_type': 0, 'family': 7, '__pad': (), 'header': {'flags': 1281,
   'length':64, 'type': 28, 'pid': 0, 'sequence_number': 0}, 'state': 2,
   'flags': 22, 'attrs': [('NDA_LLADDR', 'b2:66:eb:b9:5b:d3'),
   ('NDA_DST', '10.100.0.2'), ('NDA_MASTER', 11), ('NDA_VNI', 1000)],
   'ifindex': 18}

- Message details:
  nlmsghdr.nlmsg_type = RTM_NEWNEIGH(28) or RTM_DELNEIGH(29)
  nlmsghdr.nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE | NLM_F_REPLACE for "add" ,
  			 "NLM_F_REQUEST" for delete.
  ndmsg.ndm_family = AF_BRIDGE
  ndmsg.ndm_ifindex = vxlan_if (ifindex)
  ndmsg.ndm_state = NUD_REACHABLE
  ndmsg.ndm_flags |= NTF_SELF | NTF_MASTER | NTF_EXT_LEARNED
  Attribute "NDA_LLADDR" for MAC address
  Attribute "NDA_DST" for remote vtep ip
  Attribute "NDA_MASTER" for bridge interface ifindex.
  Attribute "NDA_VNI" for VNI id.

Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
2019-06-17 12:05:38 -07:00
Ameya Dharkar
fbe748e59f Zebra: Handle FPM connection up/down events
- When the connection with the FPM socket is established, iterate through all the
  L3VNIs and send all the RMACs for FPM processing zfpm_conn_up_thread_cb"

- We have already handled connection down even in previous commits. When the FPM
  connection goes down, empty mac_q and FPM mac info hash table
  "zfpm_conn_down_thread_cb"

Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
2019-06-17 12:05:38 -07:00
Ameya Dharkar
21d814eb0b Zebra: FPM processing of mac_q and dest_q
- FPM write thread calls "zfpm_build_updates()" to process mac_q and dest_q and
  to write update buffer over the FPM socket.

- "zfpm_build_updates()" processes all the update queues one by one in a while
  loop. It will break the while loop and return if Queue processing function
  returns "FPM_WRITE_STOP" OR FPM write buffer is full OR all the queues are
  empty (no more update to process).

- "zfpm_build_route_updates()" dequeues and processes route nodes from "dest_q".

- "zfpm_build_mac_updates()" dequeues and processes MAC nodes from "mac_q"

- These queue processing functions return with "FPM_WRITE_STOP" if the write
  buffer is full. Return value is "FPM_GOTO_NEXT_Q" if enough updates are
  processed from this queue and we want to move on to the next queue.

- In each call, a queue processing function will process max
  "FPM_QUEUE_PROCESS_LIMIT (10000)" updates to avoid starvation of other queues.

Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
2019-06-17 12:05:38 -07:00
Ameya Dharkar
a780a73896 Zebra: Handle RMAC add/delete operation and add fpm_mac_info_t
- Define a hook "zebra_mac_update" which can be registered by multiple
  data plane components (e.g. FPM, dplane).

DEFINE_HOOK(zebra_rmac_update, (zebra_mac_t *rmac, zebra_l3vni_t *zl3vni, bool
	    delete, const char *reason), (rmac, zl3vni, delete, reason))

- While performing RMAC add/delete for an L3VNI, call "zebra_mac_update" hook.

- This hook call triggers "zfpm_trigger_rmac_update". In this function, we do a
  lookup for the RMAC in fpm_mac_info_table. If already present, this node is
  updated with the latest RMAC info. Else, a new fpm_mac_info_t node is created
  and inserted in the queue and hash data structures.

Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
2019-06-17 12:05:38 -07:00
Ameya Dharkar
e5218ec873 Zebra: Data structures for RMAC processing in FPM
- FPM MAC structure: This data structure will contain all the information
required for FPM message generation for an RMAC.

struct fpm_mac_info_t {
	struct ethaddr macaddr;
	uint32_t zebra_flags; /* Could be used to build FPM messages */
	vni_t vni;
	ifindex_t vxlan_if;
	ifindex_t svi_if; /* L2 or L3 Bridge interface */
	struct in_addr r_vtep_ip; /* Remote VTEP IP */
	/* Linkage to put MAC on the FPM processing queue. */
	TAILQ_ENTRY(fpm_mac_info_t) fpm_mac_q_entries;
	uint8_t fpm_flags;
};

- Queue structure for FPM processing:
    For FPM processing, we build a queue of "fpm_mac_info_t". When RMAC is
    added or deleted from zebra, fpm_mac_info_t node is enqueued in this queue
    for the corresponding operation. FPM thread will dequeue these nodes one by
    one to generate a netlink message.

    TAILQ_HEAD(zfpm_mac_q, fpm_mac_info_t) mac_q;

- Hash table for "fpm_mac_info_t"
    When zebra tries to enqueue fpm_mac_info_t for a new RMAC add/delete
    operation, it is possible that this RMAC is already present in the queue. So,
    to avoid multiple messages for duplicate RMAC nodes, insert fpm_mac_info_t
    into a hash table.

    struct hash *fpm_mac_info_table;

    - Before enqueueing any MAC, try to fetch the fpm_mac_info_t from the hash
      table first.
    - Entry is deleted from the hash table when the node is dequeued.
    - For hash table key generation, parameters used are "mac adress" and "vni"
      This will provide a fairly unique key for a MAC(fpm_mac_info_hash_keymake).
    - Compare function uses "mac address", "RVTEP address" and "VNI" as the key
      which is sufficient to distinguish any two RMACs. This compare function is
      used for fpm_mac_info_t lookup (zfpm_mac_info_cmp).

Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
2019-06-17 12:05:38 -07:00
Mark Stapp
53c2c3c378
Merge pull request #4538 from dslicenc/int_vrf_all_brief
zebra: add ability to "show interface vrf all brief"
2019-06-17 14:46:01 -04:00
Quentin Young
dec5b24733
Merge pull request #4505 from ton31337/feature/autocomplete_bgp_peer-group
bgpd: List all groups dynamically for commands with peer-group
2019-06-17 13:53:48 -04:00
Quentin Young
1c0d3d8ec3
Merge pull request #4537 from mjstapp/fix_mpls_config_doc
doc: add config file name for mpls config
2019-06-17 13:52:13 -04:00
Don Slice
a5c7809c8b zebra: add ability to "show interface vrf all brief"
Found that the "show interface brief" command was missing the
ability to specify all vrfs.   Added that capability via this
fix.

Ticket: CM-25139
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-06-17 17:18:53 +00:00
Sri Mohana Singamsetty
c861502591
Merge pull request #4517 from chiragshah6/mdev
bgpd: show bgp vrfs formatting
2019-06-17 10:10:13 -07:00
Quentin Young
5b8235aa0e doc: add service control instructions
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-06-17 16:48:24 +00:00
Mark Stapp
e25aa97637 doc: add config file name for mpls config
We say something about what needs to be configured - but don't
name the file where the change needs to go.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-06-17 12:08:06 -04:00
Mark Stapp
a1b82d0c66
Merge pull request #4532 from donaldsharp/fuzzing
zebra: Fuzzing code has gotten a bit out of date
2019-06-17 10:11:59 -04:00
vishaldhingra
5101feceae bgpd: Added the as-set option for IPV6 agg. route
FRR has no option for the as-set for aggregate route
under IPV6 address family. Added the command to
configure the as-set option for IPV6.

Signed-off-by: vishaldhingra <vdhingra@vmware.com>
2019-06-17 01:32:30 -07:00
Donald Sharp
96b43ab3ff zebra: Fuzzing code has gotten a bit out of date
Update the fuzzing code to compile again.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-15 08:25:25 -04:00
Donald Sharp
3acae086ba zebra: Handle 5549 neighbor entry failure state
If we get a neighbor entry for 5549 failure notice
from the kernel that means that something has probably
gone terribly wrong.  Let's notice and not reinstall.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-14 21:47:27 -04:00
Donald Sharp
8a3e7e9ed9 pimd: Add debugs for channel_oil creation and deletion
Add some debugs so we can see channel oil creation and deletion
events.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-14 19:22:43 -04:00
Donald Sharp
9bf5f19cae pimd: Display ifp name in pim_channel_oil_dump
The vifi being displayed is just confusing.  Display the
actual interface name being used in the mroute.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-14 19:01:46 -04:00
David Lamparter
ce746edebb
lib: Prevent infinite loop in fd handling (#4516)
lib: Prevent infinite loop in fd handling
2019-06-14 23:48:36 +02:00
David Lamparter
277aee6fc9
eliminate snprintf from AF_INET/AF_INET6 prefix2str, add prefix2str test (#4521)
eliminate snprintf from AF_INET/AF_INET6 prefix2str, add prefix2str test
2019-06-14 21:48:34 +02:00
Quentin Young
df6f605507 doc: add vrrpd service line
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-06-14 17:37:00 +00:00
David Lamparter
6b83b39559
Merge pull request #4523 from LabNConsulting/working/master/issue4515
tests/topotests: bgp_l3vpn_to_bgp_vrf address issue #4515
2019-06-14 18:28:04 +02:00
Donald Sharp
6dc2e4358f
Merge pull request #4526 from CHKDSK88/endian
eigrpd: Fix endianness issue in packets
2019-06-14 12:05:41 -04:00
Chirag Shah
efb4077a9c bgpd: show bgp vrfs formatting
show bgp vrfs command is formatted with couple
of things.

show bgp vrfs to inclue bgp vrf instance's
SVI interface.
Move L3vni, RMAC and SVI value in next line.

Ticket:CM-25317
Reviewed By:CCR-8816
Testing Done:

New Output:
TORS1# show bgp vrfs
Type  Id     routerId          #PeersVfg  #PeersEstb  Name
             L3-VNI            RouterMAC              Interface
DFLT  0      27.0.0.15         2          2           default
             0                 00:00:00:00:00:00      unknown
 VRF  31     45.0.8.2          0          0           vrf3
             4003              00:02:00:00:00:4e      vlan4003
 VRF  35     45.0.2.2          0          0           vrf1
             4001              00:02:00:00:00:4e      vlan4001
 VRF  25     45.0.6.2          0          0           vrf2
             4002              00:02:00:00:00:4e      vlan4002

Total number of VRFs (including default): 4

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-06-14 08:47:26 -07:00
Pawel Dembicki
e296eae4f3 eigrpd: Fix endianness issue in packets
Net prefixes in eigrp update packets is created and read
without check host endianness.

This patch use ntohl and htonl to read and write ip prefix
from and to packet.

Tested: x86, powerpc

Signed-off-by: Pawel Dembicki <p.dembicki@wb.com.pl>
2019-06-14 13:04:07 +02:00
Sri Mohana Singamsetty
0590d2d209
Merge pull request #4512 from mjstapp/fix_bgp_auto_rid
bgpd: auto router-id should not change configured vpn RD/RT
2019-06-13 17:55:59 -07:00
Lou Berger
dc06452e68 tests/topotests: bgp_l3vpn_to_bgp_vrf double the amount of time to wait during scaling tests
Signed-off-by: Lou Berger <lberger@labn.net>
2019-06-13 21:01:30 +00:00
Lou Berger
5beabde635
Merge pull request #4499 from kssoman/core
bgpd: Process core when bgp instance is deleted
2019-06-13 16:08:11 -04:00
David Lamparter
0688fd81d0
bgpd, lib: Add iana_afi2str and iana_safi2str for eye pleasing strings (#4439)
bgpd, lib: Add iana_afi2str and iana_safi2str for eye pleasing strings
2019-06-13 22:06:49 +02:00
Donald Sharp
a0b36ae673 lib: Add function name to show thread poll
When displaying `show thread poll` data add the
function we are supposed to call when the poll
event happens.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-13 15:14:04 -04:00
Donald Sharp
1ef14bee7a lib: Add check for non-preexisting thread
When adding a read/write poll event and we are using a developmental
build add a bit of code to ensure that we do not already have an read
or write event scheduled.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-13 15:14:04 -04:00
Donald Sharp
45f3d59084 lib: Prevent infinite loop in fd handling
If we have a case where have created a fd for i/o and we have
removed the handling thread but still have the fd in the poll
data structure, there existed a case where we would get
the handle this fd return from poll but we would immediately
do nothing with it because we didn't have a thread to hand
the event to.

This leads to an infinite loop.  Prevent the infinite loop
from happening and log the problem.

We still need to find the cause of this happening.  But
let's prevent the system from melting down in the mean time.

Fixes: #2796
Signed-off-by: David Lamparter <equinox@diac24.net>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-13 15:14:04 -04:00
Quentin Young
42aac9b2ab
Merge pull request #4500 from opensourcerouting/clippy-improve
clippy: batch of improvements
2019-06-13 15:06:24 -04:00
David Lamparter
6dcef54cbf bgpd: fix uninitialized & wrong endian NOTIFY
notify_data_remote_as4 would contain garbage if optlen == 0, and also
as4 is in host byte order while the notify needs network byte order.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-13 20:43:13 +02:00
David Lamparter
ed4e30ede4 bgpd/rfapi: fix clang-SA warning
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-13 20:43:13 +02:00
Quentin Young
17bf75735c tests: add prefix2str test
Only tests IPv4 and IPv6 right now.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-06-13 18:30:28 +00:00
Quentin Young
096873bd46
Merge pull request #4509 from opensourcerouting/spanish-intquisition
lib: make printfrr int64_t usable
2019-06-13 14:00:50 -04:00
Quentin Young
ec466f6546 lib: remove snprintf from prefix2str
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-06-13 17:08:05 +00:00
Soman K S
7bfdba5412 bgpd: Process core when prefix list is applied
* Added debug logs and assert to get more information when bgp process
  core is observed

Signed-off-by: Soman K S <somanks@vmware.com>
2019-06-13 10:04:50 -07:00
Donald Sharp
6a81b60a94
Merge pull request #4502 from opensourcerouting/topotest-backward-compat
topotests: backward compatibility fix
2019-06-13 09:19:02 -04:00
Mark Stapp
a8baba69ae
Merge pull request #4448 from opensourcerouting/cxx-container-of
lib: const-unaware container_of for C++
2019-06-13 08:38:05 -04:00
David Lamparter
bb53f1bc66 ldpd: fix clang-SA warning in packet reading
clang-SA thinks we can skip the SA but have something allocated in buf.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-13 13:35:33 +02:00
David Lamparter
3239e3ca3b ospfd: fix clang-SA warning
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-13 13:35:33 +02:00
David Lamparter
e8ef2be65b build: improve ranlib -D autoconf test
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-13 13:35:33 +02:00
David Lamparter
c7405ee25c ripd, ripngd: fix OpenBSD compiler warning
The fact that the OpenBSD RB_TREE stuff results in a compiler warning on
OpenBSD - and OpenBSD alone - is pretty funny, I have to say...

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-13 13:35:33 +02:00
David Lamparter
2618a52ed3 *: config.h or zebra.h is the first #include
This is mostly relevant for Solaris, where config.h sets up some #define
that affect overall header behaviour, so it needs to be before anything
else.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-13 13:35:33 +02:00
David Lamparter
899e4095d1 bgpd: fix clang format warning
... by simplifying the code to use %pI6 instead.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-13 13:35:28 +02:00