frr/pbrd
Rajesh Varatharaj aa12c72c2a pbrd: Fix PBR handling for last rule deletion
Issue:
Previously, the PBR common was updated for every rule update or deletion

example:
let say we have three rule 11, 12, 13 and if we are removing rule 12. in the current code
we are making the entire map "valid" to false.

pbr-map MAP1 seq 11
match src-ip 90.1.1.2/32
set nexthop 20.1.1.2 swp1

pbr-map MAP1 seq 12
match src-ip 90.1.1.3/32
set nexthop 20.1.1.2 swp1

pbr-map MAP1 seq 13
match src-ip 90.1.1.4/32
set nexthop 20.1.1.2 swp1

no pbr-map MAP1 seq 12 ==> turns whole map valid to false.

r1(config)# end
r1# show pbr map
  pbr-map MAP1 valid: no
    Seq: 11 rule: 310
        Installed: yes Reason: Valid
        SRC IP Match: 90.1.1.2/32
        nexthop 20.1.1.2 swp1
          Installed: yes Tableid: 10002
    Seq: 13 rule: 312
        Installed: yes Reason: Valid
        SRC IP Match: 90.1.1.4/32
        nexthop 20.1.1.2 swp1
          Installed: yes Tableid: 10004

Fix:
Now, the PBR common will only be updated when the last rule is being deleted.
This change ensures that we only send a delete request to Zebra once, and only
set the valid and installed flags to false when the last rule is deleted.
This optimizes the handling of PBR rules and reduces unnecessary interactions with Zebra

Testing: UT in MR notes

Ticket: #
Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
2024-01-23 09:04:34 -08:00
..
.gitignore *: cleanup .gitignore files 2018-09-08 21:30:42 +02:00
Makefile pbrd: Add PBR to FRR 2018-04-06 13:22:43 -04:00
pbr_debug.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
pbr_debug.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
pbr_main.c pbrd: Cleanup zclient on shutdown 2023-11-13 09:15:43 -05:00
pbr_map.c pbrd: Free Memory in pbr_map_delete 2023-09-05 12:58:18 +04:00
pbr_map.h pbrd: Correct Handling of Sequence Deletion 2023-08-20 07:07:36 +04:00
pbr_memory.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
pbr_memory.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
pbr_nht.c pbrd: Fix PBR handling for last rule deletion 2024-01-23 09:04:34 -08:00
pbr_nht.h *: Let's use the native IFNAMSIZ instead of INTERFACE_NAMSIZ 2023-11-21 08:08:29 -05:00
pbr_vrf.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
pbr_vrf.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
pbr_vty.c pbrd: fix map seq installed flag in json 2023-12-05 11:30:50 -08:00
pbr_vty.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
pbr_zebra.c pbrd: replace receive_notify with request 2023-11-23 14:57:36 +01:00
pbr_zebra.h pbrd: Cleanup zclient on shutdown 2023-11-13 09:15:43 -05:00
subdir.am build, vtysh: extract vtysh commands from .xref 2022-10-26 17:12:34 +01:00