From: Pablo de Lara Date: Thu, 5 Jul 2018 02:07:55 +0000 (+0100) Subject: examples/ipsec-secgw: check for max supported sessions X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0f95a8c7edfa526e77e6bcf557110c82583e34ef;p=dpdk.git examples/ipsec-secgw: check for max supported sessions Signed-off-by: Pablo de Lara Acked-by: Akhil Goyal --- diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index 68b3465024..22249f3ff9 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -1439,6 +1439,12 @@ cryptodevs_init(void) dev_conf.socket_id = rte_cryptodev_socket_id(cdev_id); dev_conf.nb_queue_pairs = qp; + uint32_t dev_max_sess = cdev_info.sym.max_nb_sessions; + if (dev_max_sess < (CDEV_MP_NB_OBJS / 2)) + rte_exit(EXIT_FAILURE, + "Device does not support at least %u " + "sessions", CDEV_MP_NB_OBJS / 2); + if (!socket_ctx[dev_conf.socket_id].session_pool) { char mp_name[RTE_MEMPOOL_NAMESIZE]; struct rte_mempool *sess_mp;