mirror_frr/zebra
Rajasekar Raja a8efa994da zebra: backpressure - Zebra push back on Buffer/Stream creation
Currently, the way zebra works is it creates pthread per client (BGP is
of interest in this case) and this thread loops itself in zserv_read()
to check for any incoming data. If there is one, then it reads,
validates and adds it in the ibuf_fifo signalling the main thread to
process the message. The main thread when it gets a change, processes
the message, and invokes the function pointer registered in the header
command. (Ex: zserv_handlers).

Finally, if all of this was successful, this task reschedules itself and
loops in zserv_read() again

However, if there are already items on ibuf FIFO, that means zebra is
slow in processing. And with the current mechanism if Zebra main is
busy, the ibuf FIFO keeps growing holding up the memory.

Show memory zebra:(Example: 15k streams hoarding ~160 MB of data)
--- qmem libfrr ---
Stream             :       44 variable   3432352    15042 161243800

Fix:
Client IO Thread: (zserv_read)
 - Stop doing the read events when we know there are X number of items
   on the FIFO already.(X - zebra zapi-packets <1-10000> (Default-1000)

 - Determine the number of items on the zserv->ibuf_fifo. Subtract this
   from the work items and only pull the number of items off that would
   take us to X items on the ibuf_fifo again.

 - If the number of items in the ibuf_fifo has reached to the maximum
      * Either initially when zserv_read() is called (or)
      * when processing the remainders of the incoming buffer
   the client IO thread is woken by the the zebra main.

Main thread: (zserv_process_message)
If the client ibuf always schedules a wakeup to the client IO to read
more items from the socked buffer. This way we ensure
 - Client IO thread always tries to read the socket buffer and add more
   items to the ibuf_fifo (until max limit)
 - hidden config change (zebra zapi-packets <>) is taken into account

Ticket: #3390099

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
2024-03-07 15:16:33 -08:00
..
dpdk zebra: changes for code maintainability 2024-02-22 12:06:47 +05:30
.gitignore zebra: Add fpm_listener 2024-03-04 11:06:35 -05:00
connected.c zebra: Add connected with noprefixroute 2023-12-06 09:27:52 -05:00
connected.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
debug_nl.c zebra: debug ifname in netlink link debugs 2023-10-20 11:20:25 -04:00
debug.c zebra: add zebra to mgmtd oper-state 2023-12-28 17:53:40 +00:00
debug.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
dplane_fpm_nl.c Merge pull request #15476 from donaldsharp/dplane_thread_issue_i_believe 2024-03-05 14:53:41 +02:00
fpm_listener.c zebra: Add fpm_listener 2024-03-04 11:06:35 -05:00
ge_netlink.c zebra: Fetch actual SRv6 encap src addr on startup 2023-12-14 14:58:35 +01:00
ge_netlink.h zebra: Fetch actual SRv6 encap src addr on startup 2023-12-14 14:58:35 +01:00
if_ioctl.c *: Remove sys/ioctl.h from zebra.h 2024-01-04 14:42:17 -05:00
if_netlink.c zebra: fix speed set to UINT32_MAX 2024-01-29 14:52:32 +01:00
if_netlink.h zebra: Move protodown_r_bit to a better spot 2023-07-05 11:49:36 -04:00
if_socket.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
if_sysctl.c lib: remove net/route.h it is not used 2024-01-09 12:50:40 -05:00
interface.c zebra: Move nhg reinstallation into if_up proper 2024-02-08 12:22:09 -05:00
interface.h zebra: Remove ifp_nhg_XXX functions completely 2024-02-08 11:56:40 -05:00
ioctl.c *: Remove sys/ioctl.h from zebra.h 2024-01-04 14:42:17 -05:00
ioctl.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
ipforward_proc.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
ipforward_sysctl.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
ipforward.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
irdp_interface.c zebra: convert interface configuration output to NB 2024-01-28 23:28:40 +02:00
irdp_main.c *: convert struct interface->connected to DLIST 2023-11-22 23:00:30 +01:00
irdp_packet.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
irdp.h *: Rename struct thread to struct event 2023-03-24 08:32:17 -04:00
kernel_netlink.c *: zebra.h should not have fcntl.h 2024-01-09 12:50:40 -05:00
kernel_netlink.h zebra: Add Generic Netlink socket 2023-12-14 14:56:44 +01:00
kernel_socket.c lib: remove net/route.h it is not used 2024-01-09 12:50:40 -05:00
kernel_socket.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
label_manager.c zebra: Cleanup linked list on shutdown in label manager 2023-12-11 15:26:20 -05:00
label_manager.h zebra: Cleanup linked list on shutdown in label manager 2023-12-11 15:26:20 -05:00
main.c zebra: convert to mgmtd 2024-01-28 23:28:40 +02:00
Makefile
netconf_netlink.c *: zebra.h should not have fcntl.h 2024-01-09 12:50:40 -05:00
netconf_netlink.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
redistribute.c zebra: Move nhg reinstallation into if_up proper 2024-02-08 12:22:09 -05:00
redistribute.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
rib.h zebra: Reorg struct route_entry to have important bits first 2024-02-05 14:17:55 -05:00
router-id.c zebra: convert to mgmtd 2024-01-28 23:28:40 +02:00
router-id.h zebra: convert vrf configuration output to NB 2024-01-28 23:28:40 +02:00
rt_netlink.c lib, nhrpd: Move neighbor reg/unreg to lib/zclient.c 2024-01-22 12:14:59 -05:00
rt_netlink.h zebra: support route replace semantics in FPM 2023-09-04 15:38:03 -03:00
rt_socket.c lib: remove net/route.h it is not used 2024-01-09 12:50:40 -05:00
rt.h *: Introduce Local Host Routes to FRR 2023-11-01 17:13:06 -04:00
rtadv.c zebra: convert to mgmtd 2024-01-28 23:28:40 +02:00
rtadv.h zebra: convert interface ipv6 nd dnssl command to NB 2024-01-28 23:28:40 +02:00
rtread_netlink.c Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
rtread_sysctl.c lib: remove net/route.h it is not used 2024-01-09 12:50:40 -05:00
rule_netlink.c *: Remove netlink headers from lib/zebra.h 2023-11-07 06:46:19 -05:00
rule_netlink.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
rule_socket.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
sample_plugin.c *: Convert struct event_master to struct event_loop 2023-03-24 08:32:17 -04:00
subdir.am zebra: Add show fpm status [json] command 2024-03-04 11:06:35 -05:00
table_manager.c lib, mgmtd, zebra: cleanup of zebra conversion to mgmtd 2024-01-28 23:46:38 +02:00
table_manager.h zebra: convert table range command to NB 2024-01-28 23:28:40 +02:00
tc_netlink.c *: Remove netlink headers from lib/zebra.h 2023-11-07 06:46:19 -05:00
tc_netlink.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
tc_socket.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
testrib.conf
zapi_msg.c lib,zebra: add zapi message to control noarp flag 2024-01-24 10:05:29 +01:00
zapi_msg.h lib, nhrpd: Move neighbor reg/unreg to lib/zclient.c 2024-01-22 12:14:59 -05:00
zebra_affinitymap.c zebra: rework affinity-map update hook 2024-01-19 03:47:11 +02:00
zebra_affinitymap.h lib,zebra: add affinity-map configuration hooks 2023-02-10 13:52:01 +01:00
zebra_cli.c zebra: coverity fixes 2024-02-04 22:28:33 +02:00
zebra_cli.h zebra: convert to mgmtd 2024-01-28 23:28:40 +02:00
zebra_dplane.c zebra: ctx has to be non NULL at this point 2024-01-04 11:13:31 +01:00
zebra_dplane.h zebra: Add code to set SRv6 encap source addr in dplane 2023-12-14 14:56:44 +01:00
zebra_errors.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_errors.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_evpn_mac.c zebra: changes for code maintainability 2024-02-28 13:24:17 +05:30
zebra_evpn_mac.h *: Rename struct thread to struct event 2023-03-24 08:32:17 -04:00
zebra_evpn_mh.c zebra: convert to mgmtd 2024-01-28 23:28:40 +02:00
zebra_evpn_mh.h zebra: Use uint16_t for DF preference 2024-02-06 14:03:36 +02:00
zebra_evpn_neigh.c *: Remove netlink headers from lib/zebra.h 2023-11-07 06:46:19 -05:00
zebra_evpn_neigh.h *: Convert THREAD_XXX macros to EVENT_XXX macros 2023-03-24 08:32:17 -04:00
zebra_evpn_vxlan.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
zebra_evpn.c zebra: changes for code maintainability 2024-02-26 14:21:12 +05:30
zebra_evpn.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
zebra_fpm_dt.c *: Remove netlink headers from lib/zebra.h 2023-11-07 06:46:19 -05:00
zebra_fpm_netlink.c *: Remove netlink headers from lib/zebra.h 2023-11-07 06:46:19 -05:00
zebra_fpm_private.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_fpm_protobuf.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_fpm.c *: Remove netlink headers from lib/zebra.h 2023-11-07 06:46:19 -05:00
zebra_gr.c *: Introduce Local Host Routes to FRR 2023-11-01 17:13:06 -04:00
zebra_l2_bridge_if.c *: Add a hash_clean_and_free() function 2023-03-21 08:54:21 -04:00
zebra_l2_bridge_if.h zebra: multiple vlan aware bridge data structure and related changes 2023-02-13 18:12:04 -05:00
zebra_l2.c zebra: Fix crashes in interface change 2023-08-17 09:43:06 -04:00
zebra_l2.h zebra: Use zebra dplane for RTM link and addr 2023-07-05 13:03:14 -04:00
zebra_mlag_private.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
zebra_mlag_vty.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_mlag_vty.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_mlag.c *: Let's use the native IFNAMSIZ instead of INTERFACE_NAMSIZ 2023-11-21 08:08:29 -05:00
zebra_mlag.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_mpls_netlink.c *: remove sys/stat.h from zebra.h 2024-01-09 12:39:23 -05:00
zebra_mpls_null.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_mpls_openbsd.c *: sys/uio.h does not need to be in zebra.h 2024-01-04 15:34:22 -05:00
zebra_mpls_vty.c zebra: add 'mpls label dynamic-block' command 2023-10-18 09:41:02 +02:00
zebra_mpls.c Merge pull request #12600 from donaldsharp/local_routes 2023-12-05 11:00:44 -05:00
zebra_mpls.h zebra: Unregister mpls hooks on zebra shutdown 2023-11-21 12:41:18 -05:00
zebra_mroute.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_mroute.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_nb_config.c lib: fix nb callbacks for containers inside choice case 2024-02-24 01:39:18 +02:00
zebra_nb_rpcs.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_nb_state.c zebra: implement zif-type oper state leaf 2024-02-20 18:06:49 +02:00
zebra_nb.c Merge pull request #15397 from idryzhov/zebra-oper 2024-03-05 11:41:35 -05:00
zebra_nb.h Merge pull request #15397 from idryzhov/zebra-oper 2024-03-05 11:41:35 -05:00
zebra_neigh.c zebra: Remove static ARP entries on interface down events 2023-11-06 15:00:59 +02:00
zebra_neigh.h zebra: Remove static ARP entries on interface down events 2023-11-06 15:00:59 +02:00
zebra_netns_id.c *: zebra.h should not have fcntl.h 2024-01-09 12:50:40 -05:00
zebra_netns_id.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_netns_notify.c *: zebra.h should not have fcntl.h 2024-01-09 12:50:40 -05:00
zebra_netns_notify.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_nhg_private.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_nhg.c zebra: When reinstalling a NHG, set REINSTALL flag 2024-02-08 12:32:26 -05:00
zebra_nhg.h zebra: When reinstalling a NHG, set REINSTALL flag 2024-02-08 12:32:26 -05:00
zebra_ns.c zebra: convert vrf configuration output to NB 2024-01-28 23:28:40 +02:00
zebra_ns.h zebra: convert vrf configuration output to NB 2024-01-28 23:28:40 +02:00
zebra_opaque.c zebra: clean up coverity warning in opaque api 2023-06-26 13:19:23 -04:00
zebra_opaque.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_pbr.c *: Let's use the native IFNAMSIZ instead of INTERFACE_NAMSIZ 2023-11-21 08:08:29 -05:00
zebra_pbr.h *: Let's use the native IFNAMSIZ instead of INTERFACE_NAMSIZ 2023-11-21 08:08:29 -05:00
zebra_ptm_redistribute.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_ptm_redistribute.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_ptm.c zebra: convert to mgmtd 2024-01-28 23:28:40 +02:00
zebra_ptm.h zebra: convert to mgmtd 2024-01-28 23:28:40 +02:00
zebra_pw.c zebra: Properly unregister hook on shutdown 2023-12-11 15:22:07 -05:00
zebra_pw.h zebra: Properly unregister hook on shutdown 2023-12-11 15:22:07 -05:00
zebra_rib.c Merge pull request #15216 from donaldsharp/zebra_opaque_mem_leak 2024-02-02 10:54:20 -06:00
zebra_rnh.c Merge pull request #12600 from donaldsharp/local_routes 2023-12-05 11:00:44 -05:00
zebra_rnh.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_routemap_nb_config.c zebra: remove checks for src address existence when using "set src" 2021-08-02 18:35:30 +03:00
zebra_routemap_nb.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_routemap_nb.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_routemap.c zebra: convert to mgmtd 2024-01-28 23:28:40 +02:00
zebra_routemap.h zebra: convert vrf configuration output to NB 2024-01-28 23:28:40 +02:00
zebra_router.c zebra: support yielding between oper state routes query 2023-12-28 17:53:40 +00:00
zebra_router.h zebra: support yielding between oper state routes query 2023-12-28 17:53:40 +00:00
zebra_script.c zebra: Add code to set SRv6 encap source addr in dplane 2023-12-14 14:56:44 +01:00
zebra_script.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_snmp.c *: Introduce Local Host Routes to FRR 2023-11-01 17:13:06 -04:00
zebra_srte.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_srte.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_srv6_vty.c zebra: Add encap source address to SRv6 config write function 2023-12-14 14:58:35 +01:00
zebra_srv6_vty.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_srv6.c zebra: Fetch actual SRv6 encap src addr on startup 2023-12-14 14:58:35 +01:00
zebra_srv6.h zebra, lib, vtysh: Add CLI cmd to set/unset SRv6 encap source address 2023-12-14 14:58:33 +01:00
zebra_tc.c zebra: Set Free Functions for Traffic Control Hash Tables 2023-11-29 16:33:54 +04:00
zebra_tc.h zebra: Set Free Functions for Traffic Control Hash Tables 2023-11-29 16:33:54 +04:00
zebra_trace.c zebra: Add initial zebra tracepoint support 2022-04-20 09:39:47 -04:00
zebra_trace.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_vrf.c zebra: convert to mgmtd 2024-01-28 23:28:40 +02:00
zebra_vrf.h zebra: convert to mgmtd 2024-01-28 23:28:40 +02:00
zebra_vty.c zebra: When reinstalling a NHG, set REINSTALL flag 2024-02-08 12:32:26 -05:00
zebra_vxlan_if.c *: Add a hash_clean_and_free() function 2023-03-21 08:54:21 -04:00
zebra_vxlan_if.h zebra: Fix for mcast-group update and delete per vni for svd 2023-02-13 18:12:05 -05:00
zebra_vxlan_private.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
zebra_vxlan.c Merge pull request #15399 from louis-6wind/fix-macvlan-crash 2024-02-27 18:31:28 +02:00
zebra_vxlan.h zebra: fix vni NB conversion 2024-01-28 23:28:40 +02:00
zserv.c zebra: backpressure - Zebra push back on Buffer/Stream creation 2024-03-07 15:16:33 -08:00
zserv.h *: create a single registry of daemons' default port values 2024-02-01 11:40:02 -05:00