Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zebra: fix an issue: dplane failed to limit the maximum length of the…
… queue There is an issue where the "dplane" cannot effectively restrict the number of temporary caches for the contexts (ctx) under certain conditions. This issue occurs because when a ctx workqueue is processed and completed, the ctx is moved to another queue (rib_dplane_q), during which its memory is not immediately released. The memory for the ctx is only released after the rib_process_dplane_results function has completed processing. However, before this happens, the count in zdplane_info.dg_routes_queued is decreased, which leads the meta_queue_process function to mistakenly believe that enough space has been cleared, thus allowing more new ctxs to be created and enqueued. This results in the number of ctxs in the system not being limited as expected by the value set by dplane_get_in_queue_limit. The fix attempts to adjust the timing of when zdplane_info.dg_routes_queued is decremented. The modification is made so that zdplane_info.dg_routes_queued is decreased only once rib_process_dplane_results has completely processed a ctx and the actual memory release process for it has begun. This way, it ensures that there is sufficient space for new ctxs to be enqueued. Signed-off-by: hanyu.zly <hanyu.zly@alibaba-inc.com>
- Loading branch information