From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 31537A055F; Thu, 27 Feb 2020 17:22:03 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 199021BFDD; Thu, 27 Feb 2020 17:19:42 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 978551C065 for ; Thu, 27 Feb 2020 17:19:30 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01RFsgar002477; Thu, 27 Feb 2020 08:19:30 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0818; bh=tMH+Dp+xtK4eEWBo3JHpE9WDU479l5rBCrab27k2k3s=; b=o4bMkSX/ef80LYYDE8+nPbHx/jQ8XoXCym6tr4rEjrXjVmWjxCIzeV3Q6SuBCg1h1yJV ZinaGx5DKCMh/rz9Rpo0dzsiL/W48EuJf+OvgIuu2Itk+KxZ/v3kk9tUDFH4rp1pZOlB Lb2WjwJz9xYpbJcXv8QfpJe7E0OB6lTIF+uMSJyanTABY8pt4Km5xaWO3FKkIgvbNXQ9 zhEsXboDbJs9w13o7VzPfy949Lj6C5crE0MRaPOBcROrrgCttCyXJ9mK0K08LeFXuYn5 MYeq59eZQSIygh2rQu0Sj7A+HL90yODO6u5vdW/pfAkN+PozoY6uYqsYmHDGHRDB6Jhn qA== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2ydchth8gs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 27 Feb 2020 08:19:30 -0800 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 27 Feb 2020 08:19:28 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 27 Feb 2020 08:19:28 -0800 Received: from luke.marvell.com (unknown [10.95.130.81]) by maili.marvell.com (Postfix) with ESMTP id 622583F7041; Thu, 27 Feb 2020 08:19:25 -0800 (PST) From: Lukasz Bartosik To: Akhil Goyal , Radu Nicolau , Thomas Monjalon CC: Jerin Jacob , Narayana Prasad , Ankur Dwivedi , Anoob Joseph , Archana Muniganti , Tejasree Kondoj , Vamsi Attunuru , "Konstantin Ananyev" , Date: Thu, 27 Feb 2020 17:18:37 +0100 Message-ID: <1582820317-7333-16-git-send-email-lbartosik@marvell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582820317-7333-1-git-send-email-lbartosik@marvell.com> References: <1582185727-6749-1-git-send-email-lbartosik@marvell.com> <1582820317-7333-1-git-send-email-lbartosik@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-02-27_05:2020-02-26, 2020-02-27 signatures=0 Subject: [dpdk-dev] [PATCH v5 15/15] examples/ipsec-secgw: reserve crypto queues in event mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Reserve minimum number of crypto queues equal to number of ports. This is to fulfill inline protocol offload requirements. Signed-off-by: Anoob Joseph Signed-off-by: Lukasz Bartosik --- examples/ipsec-secgw/ipsec-secgw.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index 5335c4c..ce36e6d 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -1930,7 +1930,7 @@ check_cryptodev_mask(uint8_t cdev_id) } static uint16_t -cryptodevs_init(void) +cryptodevs_init(uint16_t req_queue_num) { struct rte_cryptodev_config dev_conf; struct rte_cryptodev_qp_conf qp_conf; @@ -1993,6 +1993,7 @@ cryptodevs_init(void) i++; } + qp = RTE_MIN(max_nb_qps, RTE_MAX(req_queue_num, qp)); if (qp == 0) continue; @@ -2761,7 +2762,16 @@ main(int32_t argc, char **argv) sess_sz = max_session_size(); - nb_crypto_qp = cryptodevs_init(); + /* + * In event mode request minimum number of crypto queues + * to be reserved equal to number of ports. + */ + if (eh_conf->mode == EH_PKT_TRANSFER_MODE_EVENT) + nb_crypto_qp = rte_eth_dev_count_avail(); + else + nb_crypto_qp = 0; + + nb_crypto_qp = cryptodevs_init(nb_crypto_qp); if (nb_bufs_in_pool == 0) { RTE_ETH_FOREACH_DEV(portid) { -- 2.7.4