Do not allow allow unsupported offload to be passed to PMD since in can result in inconsistent NIC configuration and processing in the driver.
All PMDs are converted to the new offload API and must report its capabilties correctly. Both device and queue offloads are listed in [rt]x_offload_capa so the check should pass despite of which level the offload is supported on. Fixes: 0330605295cf ("ethdev: new Rx/Tx offloads API") Signed-off-by: Andrew Rybchenko <arybche...@solarflare.com> --- lib/librte_ethdev/rte_ethdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 3528ba179..54e1ee771 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -1171,6 +1171,7 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, local_conf.rxmode.offloads, dev_info.rx_offload_capa, __func__); + return -EINVAL; } if ((local_conf.txmode.offloads & dev_info.tx_offload_capa) != local_conf.txmode.offloads) { @@ -1181,6 +1182,7 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, local_conf.txmode.offloads, dev_info.tx_offload_capa, __func__); + return -EINVAL; } /* Check that device supports requested rss hash functions. */ -- 2.17.0