|SUCCESS| [v2,7/7] eal: configure initial device probing

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Thu Mar 26 17:12:39 CET 2026


Test-Label: ai-code-review
Test-Status: SUCCESS
https://dpdk.org/patch/162732

_AI Code Review_

=== Patch Review: series.patch (via Claude) ===
Review date: 2026-03-26

I'll review this DPDK patch series focusing on correctness bugs, coding style, and guideline violations.

commit 20260326102424.2361945-8-david.marchand at redhat.com
Author: David Marchand <david.marchand at redhat.com>

eal: configure initial device probing

This patch adds EAL options to control automatic device probing during 
initialization, allowing applications to disable automatic probing and 
use explicit allow lists instead.

> diff --git a/lib/eal/common/eal_common_bus.c b/lib/eal/common/eal_common_bus.c
> index 2ca0af7914..47ba303468 100644
> --- a/lib/eal/common/eal_common_bus.c
> +++ b/lib/eal/common/eal_common_bus.c
> @@ -250,18 +250,23 @@ RTE_EXPORT_INTERNAL_SYMBOL(rte_bus_is_ignored_device)
>  bool
>  rte_bus_is_ignored_device(const struct rte_bus *bus, const char *dev_name)
>  {
> +	const struct internal_config *internal_conf = eal_get_internal_configuration();
>  	struct rte_devargs *devargs = rte_bus_find_devargs(bus, dev_name);
> +	enum rte_bus_scan_mode scan_mode = bus->conf.scan_mode;
>  
> -	switch (bus->conf.scan_mode) {
> -	case RTE_BUS_SCAN_ALLOWLIST:
> +	if (scan_mode == RTE_BUS_SCAN_UNDEFINED) {
> +		if (internal_conf->no_auto_probing != 0)

The comparison "!= 0" is unnecessary. The coding style guide section 2.10
states: "Do not explicitly compare an integer value with 0 or NULL."

Does this code need the explicit zero check instead of the simpler form:

	if (internal_conf->no_auto_probing)

> +			scan_mode = RTE_BUS_SCAN_ALLOWLIST;
> +		else
> +			scan_mode = RTE_BUS_SCAN_BLOCKLIST;
> +	}
> +
> +	if (scan_mode == RTE_BUS_SCAN_ALLOWLIST) {
>  		if (devargs && devargs->policy == RTE_DEV_ALLOWED)
>  			return false;
> -		break;
> -	case RTE_BUS_SCAN_UNDEFINED:
> -	case RTE_BUS_SCAN_BLOCKLIST:
> +	} else {
>  		if (devargs == NULL || devargs->policy != RTE_DEV_BLOCKED)
>  			return false;
> -		break;
>  	}
>  	return true;
>  }
> diff --git a/lib/eal/common/eal_internal_cfg.h b/lib/eal/common/eal_internal_cfg.h
> index 95d327a613..fac45cbe66 100644
> --- a/lib/eal/common/eal_internal_cfg.h
> +++ b/lib/eal/common/eal_internal_cfg.h
> @@ -104,6 +104,7 @@ struct internal_config {
>  	struct simd_bitwidth max_simd_bitwidth;
>  	/**< max simd bitwidth path to use */
>  	size_t huge_worker_stack_size; /**< worker thread stack size */
> +	unsigned int no_auto_probing; /**< true to switch from block-listing to allow-listing */

The member no_auto_probing is declared as "unsigned int" but the comment 
describes it as a boolean. In DPDK, boolean values should use the bool 
type from stdbool.h. Does this code need to be an unsigned int, or can it 
be declared as bool?

Also, section 5.3.3 of the coding style requires post-line comments to be
aligned at tab stops. Does this comment need alignment adjustment with the
one above it?


More information about the test-report mailing list