numam-dpdk/lib
Julien Meunier 3dd4435cf4 cryptodev: fix checks related to device id
Each cryptodev are indexed with dev_id in the global rte_crypto_devices
variable. nb_devs is incremented / decremented each time a cryptodev is
created / deleted. The goal of nb_devs was to prevent the user to get an
invalid dev_id.

Let's imagine DPDK has configured N cryptodevs. If the cryptodev=1 is
removed at runtime, the latest cryptodev N cannot be accessible, because
nb_devs=N-1 with the current implementaion.

In order to prevent this kind of behavior, let's remove the check with
nb_devs and iterate in all the rte_crypto_devices elements: if data is
not NULL, that means a valid cryptodev is available.

Also, remove max_devs field and use RTE_CRYPTO_MAX_DEVS in order to
unify the code.

Fixes: d11b0f30df ("cryptodev: introduce API and framework for crypto devices")
Cc: stable@dpdk.org

Signed-off-by: Julien Meunier <julien.meunier@nokia.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-10-23 16:57:06 +02:00
..
librte_acl remove useless include of EAL memory config header 2019-10-09 10:22:24 +02:00
librte_bbdev bbdev: extend API for 5G FEC 2019-07-05 15:28:14 +02:00
librte_bitratestats
librte_bpf bpf: hide internal program argument type 2019-10-12 14:27:19 +02:00
librte_cfgfile cfgfile: use calloc 2019-07-19 00:48:43 +02:00
librte_cmdline build: allow stricter fallthrough warnings 2019-10-24 01:02:30 +02:00
librte_compressdev compressdev: clarify destination buffer size 2019-07-29 10:18:24 +02:00
librte_cryptodev cryptodev: fix checks related to device id 2019-10-23 16:57:06 +02:00
librte_distributor distributor: fix livelock on flush 2019-07-29 23:23:37 +02:00
librte_eal eal: remove dead code on NUMA node detection 2019-10-24 14:15:28 +02:00
librte_efd eal: hide shared memory config 2019-07-06 10:32:34 +02:00
librte_ethdev ethdev: add symmetric Toeplitz hash 2019-10-07 15:00:58 +02:00
librte_eventdev eventdev: add Tx flag for packets with same destination 2019-10-18 10:03:08 +02:00
librte_flow_classify flow_classify: fix out-of-bounds access 2019-07-10 23:41:25 +02:00
librte_gro net: move TCP flags from ethdev header 2019-07-03 12:57:30 +02:00
librte_gso net: add rte prefix to UDP structure 2019-05-24 13:34:46 +02:00
librte_hash hash: replace license text with SPDX tag 2019-07-29 13:31:45 +02:00
librte_ip_frag ip_frag: remove remaining IP checkum offload flag 2019-07-16 13:23:04 +02:00
librte_ipsec net: add missing rte prefix for ESP tail 2019-10-08 12:14:31 +02:00
librte_jobstats
librte_kni kni: support allmulticast mode set 2019-10-15 21:16:32 +02:00
librte_kvargs remove experimental tags from all symbol definitions 2019-06-29 19:04:43 +02:00
librte_latencystats latency: check status of getting ethdev info 2019-10-07 14:45:35 +02:00
librte_lpm replace license text with SPDX tag on PPC files 2019-08-05 17:17:09 +02:00
librte_mbuf mbuf: add bulk free function 2019-10-24 02:45:40 +02:00
librte_member eal: hide shared memory config 2019-07-06 10:32:34 +02:00
librte_mempool mempool: clarify default populate function 2019-10-16 10:41:21 +02:00
librte_meter enforce experimental tag at beginning of declarations 2019-06-29 19:04:48 +02:00
librte_metrics metrics: add function to deinitialise library 2019-07-16 12:45:30 +02:00
librte_net net: add missing rte prefix for ESP tail 2019-10-08 12:14:31 +02:00
librte_pci
librte_pdump pdump: check status of getting ethdev info 2019-10-07 14:45:35 +02:00
librte_pipeline examples/ip_pipeline: add config flexibility to TM 2019-07-22 15:42:59 +02:00
librte_port
librte_power lib: add reasons for components being disabled 2019-07-02 23:21:05 +02:00
librte_rawdev rawdev: allow devices to skip extra memory allocation 2019-07-04 09:33:59 +02:00
librte_rcu rcu: fix reference to offline function 2019-10-21 21:21:30 +02:00
librte_reorder eal: hide shared memory config 2019-07-06 10:32:34 +02:00
librte_ring ring: add reset function for flushing 2019-07-17 19:51:56 +02:00
librte_sched sched: remove redundant macros 2019-07-22 15:44:16 +02:00
librte_security security: add HFN override option in PDCP 2019-10-09 11:50:12 +02:00
librte_stack stack: enable lock-free implementation for aarch64 2019-10-21 10:15:57 +02:00
librte_table table: fix crash in LPM IPv6 2019-07-04 23:44:58 +02:00
librte_telemetry telemetry: fix build with gcc 9 2019-07-04 18:48:04 +02:00
librte_timer timer: fix null access if not initialized 2019-07-18 23:14:53 +02:00
librte_vhost vhost: fix vring memory partially mapped 2019-10-07 15:00:57 +02:00
Makefile cfgfile: use log for error messages 2019-07-19 00:47:50 +02:00
meson.build build: process dependencies before main build check 2019-10-24 01:02:28 +02:00