[PATCH dpdk 2/2] rib: add mode to include top-level route in traversal
Robin Jarry
rjarry at redhat.com
Fri Oct 2 11:50:04 CEST 2026
Hey Vladimir,
Medvedkin, Vladimir, Sep 30, 2026 at 19:12:
> I'd suggest to reflect changes in release notes. Please find other
> comments inline.
Will do.
>> + while ((node = rte_rib6_get_nxt(rib, 0, 0, node, RTE_RIB6_GET_NXT_ALL)) != NULL)
> second arg should be &unspec
>> + num++;
>> + RTE_TEST_ASSERT(num == 2, "Invalid number of routes\n");
>> +
>> + num = 0;
>> + node = NULL;
>> + while ((node = rte_rib6_get_nxt(rib, 0, 0, node, RTE_RIB6_GET_NXT_ALL_TOP)) != NULL)
> same here
Indeed, good catch. Although for some reason, the test passes :s
>> +static bool
>> +depth_match(struct rte_rib_node *node, uint8_t depth, int flag)
>
> 3d arg enum rte_rib_nxt_mode mode?
Yes, better.
>> @@ -195,7 +203,7 @@ rte_rib_get_nxt(struct rte_rib *rib, uint32_t ip,
>> tmp = tmp->parent;
>> if (is_valid_node(tmp) &&
>> (is_covered(tmp->ip, ip, depth) &&
>> - (tmp->depth > depth)))
>> + (depth_match(tmp, depth, mode))))
> extra parenthesis, same for v6
I wanted to stick to the style of the line above which also has an
extraneous parenthesis. I'll remove it.
>> @@ -125,6 +127,8 @@ rte_rib_lookup_exact(struct rte_rib *rib, uint32_t ip, uint8_t depth);
>> * get all prefixes from subtrie
>> * -RTE_RIB_GET_NXT_COVER
>> * get only first more specific prefix even if it have more specifics
>> + * -RTE_RIB_GET_NXT_ALL_TOP
>> + * get the top-level exact matching prefix, if any
>
> RTE_RIB_GET_NXT_ALL_TOP is effectively RTE_RIB_GET_NXT_ALL + exact
> match. Better definition would be something like:
>
> get all prefixes from the subtrie, including the ip/depth prefix itself
> if present. Top prefix is returned last.
Ack.
--
Robin
# Prices subject to change without notice.
More information about the dev
mailing list