[RFC] ethdev: simplify representor info get API

Stephen Hemminger stephen at networkplumber.org
Mon Aug 31 18:46:54 CEST 2026


On Mon, 31 Aug 2026 18:29:05 +0200
Dariusz Sosnowski <dsosnowski at nvidia.com> wrote:

> * Background on rte_eth_representor_info_get()
> 
> rte_eth_representor_info_get() experimental function was added
> to ethdev public API in 21.05 DPDK release [1].

You know the API shouldn't have stayed experimental so long.
There is no good reason for API to stay experimental across multiple LTS releases!

The code would be much simpler if you use sentinel values rather than
carrying around all the XX_valid flag values.

With int fields and -1 (or a named RTE_ETH_REPRESENTOR_UNSPEC),
 the whole comparator collapses to something like:


static bool field_match(int a, int b)
{
	return a == -1 || b == -1 || a == b;
}

return field_match(info.controller, other->controller) &&
       field_match(info.pf, other->pf) &&
       info.type == other->type &&
       (info.type != RTE_ETH_REPRESENTOR_VF || field_match(info.vf, other->vf)) &&


More information about the dev mailing list