ethdev: limit maximum number of queues
authorThomas Monjalon <thomas@monjalon.net>
Wed, 27 Nov 2019 12:22:56 +0000 (13:22 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 27 Nov 2019 15:04:40 +0000 (16:04 +0100)
commit20bbb9e0450f2ccda374584173dc0a5cd93c9f06
treeb29b06c5aaa446803388c24459a30aef6bd38bbd
parent2d0cfc0e0528bb6be3676032a2d0573d7c3b3999
ethdev: limit maximum number of queues

A buffer overflow happens in testpmd with some drivers
since the queue arrays are limited to RTE_MAX_QUEUES_PER_PORT.

The advertised capabilities of mlx4, mlx5 and softnic
for the number of queues were the maximum number: UINT16_MAX.
They must be limited by the configured RTE_MAX_QUEUES_PER_PORT
that applications expect to be respected.

The limitation is applied at ethdev level (function rte_eth_dev_info_get),
in order to force the configured limit for all drivers.

Fixes: 14b53e27b30e ("ethdev: fix crash with multiprocess")
Cc: stable@dpdk.org
Reported-by: Raslan Darawsheh <rasland@mellanox.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
lib/librte_ethdev/rte_ethdev.c