ethdev: validate offloads set by PMD
authorPavan Nikhilesh <pbhagavatula@marvell.com>
Mon, 11 Nov 2019 13:19:07 +0000 (18:49 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 11 Nov 2019 15:15:37 +0000 (16:15 +0100)
commit1daa33805824e2fb6c93723604750d7b4013a355
tree506f4fedfa2fc573782dc2ba4600a97113e1561d
parent5d308972954cbad07d469e9b708aa517787e9948
ethdev: validate offloads set by PMD

Some PMDs cannot work when certain offloads are enable/disabled, as a
workaround PMDs auto enable/disable offloads internally and expose it
through dev->data->dev_conf.rxmode.offloads.

After device specific dev_configure is called compare the requested
offloads to the offloads exposed by the PMD and, if the PMD failed
to enable a given offload then log it and return -EINVAL from
rte_eth_dev_configure, else if the PMD failed to disable a given offload
log and continue with rte_eth_dev_configure.

Suggested-by: Andrew Rybchenko <arybchenko@solarflare.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
lib/librte_ethdev/rte_ethdev.c