From: Pablo de Lara Date: Wed, 21 Jun 2017 05:07:30 +0000 (+0100) Subject: cryptodev: remove socket id check X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=804f169c246f37662780b0463f49b053034b89a6;p=dpdk.git cryptodev: remove socket id check Socket id parsed from the user was checked if it was in the range of available sockets. This check is unnecessary, as the socket specified might not have memory anyway, so it will fail at memory allocation. Therefore, the best solution is to remove this check. Signed-off-by: Pablo de Lara Acked-by: Declan Doherty --- diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index b65cd9ce97..81fd2bf1cc 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -233,22 +233,6 @@ rte_crypto_auth_operation_strings[] = { [RTE_CRYPTO_AUTH_OP_GENERATE] = "generate" }; -static uint8_t -number_of_sockets(void) -{ - int sockets = 0; - int i; - const struct rte_memseg *ms = rte_eal_get_physmem_layout(); - - for (i = 0; ((i < RTE_MAX_MEMSEG) && (ms[i].addr != NULL)); i++) { - if (sockets < ms[i].socket_id) - sockets = ms[i].socket_id; - } - - /* Number of sockets = maximum socket_id + 1 */ - return ++sockets; -} - /** Parse integer from integer argument */ static int parse_integer_arg(const char *key __rte_unused, @@ -325,12 +309,6 @@ rte_cryptodev_parse_vdev_init_params(struct rte_crypto_vdev_init_params *params, params); if (ret < 0) goto free_kvlist; - - if (params->socket_id >= number_of_sockets()) { - CDEV_LOG_ERR("Invalid socket id specified to create " - "the virtual crypto device on"); - goto free_kvlist; - } } free_kvlist: