|WARNING| [RFC,5/5] app/test-fib: add lookup across a group of FIBs

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Tue Nov 24 19:29:54 CET 2026


Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/173137

_AI Code Review_

warning: review has no Review-Result line, severity inferred from prose (response may be truncated)
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-24

**Patch 3/5 -- fib: add group of FIBs with bulk lookup across them**

**Error: ABI break in `struct rte_fib_conf`**

```c
	unsigned int flags; /**< Optional feature flags from RTE_FIB_F_* */
+	/** Group the FIB belongs to (NULL = no group) */
+	struct rte_fib_group *group;
```

`struct rte_fib_conf` is allocated by the caller and passed by pointer to the stable `rte_fib_create()`. An application built against the old layout passes a smaller struct. The new code then reads `conf->group` past its end and dereferences it:

```c
+	if ((conf->group != NULL) && ((conf->type != conf->group->type) ||
```

The result is a garbage-pointer dereference or a spurious `EINVAL` for unmodified binaries. Patches 1/2 zero-initialize the in-tree users, but that does not help out-of-tree binaries.

Options:
- Defer the field to an ABI-breaking release, with a deprecation notice.
- Pass the group through a new experimental entry point instead, e.g. `rte_fib_create_in_group()` or an `rte_fib_group_attach()`-style call.

**Warning: no release notes for the new API**

Four new experimental public functions are added (`rte_fib_group_create`, `rte_fib_group_free`, `rte_fib_group_lookup_bulk`, `rte_fib_group_select_lookup`), plus a public struct. The current release notes are not updated.

**Info: negative `n` becomes a huge count**

`rte_fib_group_lookup_bulk()` takes `int n` and passes it unchecked to a callback taking `const unsigned int n`. A negative `n` turns into a huge loop bound. This mirrors the existing `rte_fib_lookup_bulk()`, but the new function could reject `n < 0` in its `FIB_RETURN_IF_TRUE` check.

**Info: unused variables on big-endian builds**

In `dir24_8_lookup_bulk_multi_be()`, `le_ips` and `i` are unused on big-endian builds (`#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN` branch) and will trigger unused-variable warnings there. Move the declarations into the `#else` branch.

**Info: test leaks on assertion failure**

In `check_group()`, an assertion failure after `rte_fib_group_create()` or `rte_fib_create()` returns without freeing the group or the FIBs. Later test cases may then fail on duplicate names. This is test-only code.

**Patch 5/5 -- app/test-fib: add lookup across a group of FIBs**

**Error: resource leaks on error paths in `run_v4_group()`**

Each early return skips the cleanup at the end of the function:

- When `rte_fib_group_select_lookup()` fails, `grp` is never freed:
  ```c
  +	if (ret != 0) {
  +		printf("Can not init lookup function\n");
  +		return ret;
  ```
- When one of the three allocations fails, the others (and `grp`) leak:
  ```c
  +	if ((fibs == NULL) || (fib_ids == NULL) || (dps == NULL)) {
  +		printf("Can not alloc the FIB group tables\n");
  +		return -ENOMEM;
  ```
- On `rte_fib_create()` or `rte_fib_add()` failure, and on the `FAIL` comparison path, all previously created FIBs, `grp`, `fibs`, `fib_ids` and `dps` leak.

Use a single cleanup label that frees the non-NULL FIBs, the group and the three arrays. Allocating `fibs` with `rte_calloc` makes the partial FIB cleanup straightforward.

**Info: `rte_mal


More information about the test-report mailing list