On 10/24/23 21:35, Han Zhou wrote:
> Enhance MAC_Binding aging to allow CIDR-based threshold configurations.
> This enables distinct threshold settings for different IP ranges,
> applying the longest prefix matching for overlapping ranges.
> 
> A common use case involves setting a default threshold for all IPs, while
> disabling aging for a specific range and potentially excluding a subset
> within that range.
> 
> Signed-off-by: Han Zhou <hz...@ovn.org>
> ---
>  northd/aging.c  | 297 +++++++++++++++++++++++++++++++++++++++++++++---
>  northd/aging.h  |   3 +
>  northd/northd.c |  11 +-
>  ovn-nb.xml      |  63 +++++++++-
>  tests/ovn.at    |  60 ++++++++++
>  5 files changed, 413 insertions(+), 21 deletions(-)
> 
> diff --git a/northd/aging.c b/northd/aging.c
> index f626c72c8ca3..e5868211a63b 100644
> --- a/northd/aging.c
> +++ b/northd/aging.c
> @@ -47,12 +47,253 @@ aging_waker_schedule_next_wake(struct aging_waker 
> *waker, int64_t next_wake_ms)
>      }
>  }
>  
> +struct threshold_entry {
> +    union {
> +        ovs_be32 ipv4;
> +        struct in6_addr ipv6;
> +    } prefix;
> +    bool is_v4;

Hi, Han.  Thanks for the patch!

Not a full review, but I wonder if it would be cleaner to replace
all the structure members above with a single 'struct in6_addr prefix;'
and store ipv4 addresses as ipv6-mapped ipv4.  This will allow to use
a single array for storing the entries as well.  May save some lines
of code.

What do you think?

Also, this patch, probably, needs a NEWS entry.

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to