On Thu, 12 Mar 2026 16:05:35 +0100 Vincent Jardin <[email protected]> wrote:
> > > > > + if (!rte_eth_dev_is_valid_port(port_id)) > > > + return -ENODEV; > > > > Ditto checks for port_id should be at ethdev > > This function is a PMD-specific API declared in rte_pmd_mlx5.h, not an ethdev > op. > application -> rte_pmd_mlx5_pp_rate_table_query() -> mlx5 internals > > Therefore, the function must validate its own inputs: > - port_id validity (via rte_eth_dev_get_by_name() / > rte_eth_dev_is_valid_port()) > - info != NULL > > Adding a generic ethdev op (ex eth_rate_table_query_t) for a concept > only one driver supports would be over-engineering. If other drivers later > expose a similar rate table concept, that would be the time to factor out a > generic ethdev API. OK, but I have a different point view than most DPDK developers. Allowing and having driver specific API's in the first place was a mistake. It encourages one off API's and makes applications locked in to a specific NIC; which is good for NIC vendors but bad design pattern.

