On 7/23/25 3:12 PM, Dima Chumak via dev wrote:
> Make internal function is_standard_table_id() public to be used by the
> next patches in the series.
> 
> Signed-off-by: Dima Chumak <[email protected]>
> ---
>  lib/route-table-bsd.c  | 6 ++++++
>  lib/route-table-stub.c | 6 ++++++
>  lib/route-table.c      | 6 +++---
>  lib/route-table.h      | 1 +
>  4 files changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/route-table-bsd.c b/lib/route-table-bsd.c
> index 34d42cfab73b..a4eccb913916 100644
> --- a/lib/route-table-bsd.c
> +++ b/lib/route-table-bsd.c
> @@ -43,6 +43,12 @@ VLOG_DEFINE_THIS_MODULE(route_table_bsd);
>  #define RT_ROUNDUP(l) ((l) > 0 ? ROUND_UP((l), sizeof(long)) : sizeof(long))
>  #endif
>  
> +bool
> +route_table_is_standard_id(uint32_t table_id)
> +{
> +    return !table_id;
> +}
> +
>  bool
>  route_table_fallback_lookup(const struct in6_addr *ip6_dst, char name[],
>                              struct in6_addr *gw6)
> diff --git a/lib/route-table-stub.c b/lib/route-table-stub.c
> index dd0b096d4998..75e5bf37e3b5 100644
> --- a/lib/route-table-stub.c
> +++ b/lib/route-table-stub.c
> @@ -18,6 +18,12 @@
>  #include "ovs-router.h"
>  #include "route-table.h"
>  
> +bool
> +route_table_is_standard_id(uint32_t table_id)
> +{
> +    return !table_id;
> +}
> +
>  bool
>  route_table_fallback_lookup(const struct in6_addr *ip6_dst OVS_UNUSED,
>                              char name[] OVS_UNUSED,
> diff --git a/lib/route-table.c b/lib/route-table.c
> index 2bbb51c08f7e..4b93339c93c9 100644
> --- a/lib/route-table.c
> +++ b/lib/route-table.c
> @@ -519,8 +519,8 @@ route_table_parse(struct ofpbuf *buf, void *change)
>                                 nlmsg, rtm, NULL, change);
>  }
>  
> -static bool
> -is_standard_table_id(uint32_t table_id)
> +bool
> +route_table_is_standard_id(uint32_t table_id)

Do we even need this function in the route-table.c at all?

By the end of the set it is only used here for tracking default
tables as irrelevant while handling messages from the kernel.
But I'm not really sure why those are irrelevant?  And I'm not
sure why we're not re-dumping those tables when we get a rule
change pointing to them.

It seems to me like these checks should be removed and we only
need a variant of this function in the ovs-router module.
We only need a few build time assertions that RT_ and CLS_
definitions are the same.  That can be done here in the route
table module.

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to