From patchwork Thu Jun 9 13:01:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Fialko X-Patchwork-Id: 112619 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 27723A0555; Thu, 9 Jun 2022 15:01:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ED6BE40689; Thu, 9 Jun 2022 15:01:38 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 6A7F140220 for ; Thu, 9 Jun 2022 15:01:37 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 259Aesmq017914; Thu, 9 Jun 2022 06:01:36 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=Y00oZr3iIfZyiUGItWtXiJNyqIXX/GD4sSwnZdvDRxs=; b=LqteqF26RtUBKStkDnRTnROjXwMeIBKjZZc3epbHy3vS8Qbozr6Yi3bWDNqPIC4lUATR v1o0DGDReJFRWZ6ZCcTsC8UyMuxJgh9k5bqhTm3STsZDeorWj3hzJWUZ0nUKjqjyTg2T SrSTiMEa5ALFHL2hKUICyUEwR6PWGpX8wchHDB3OVyAIq20U3EMotsSihRa3xRMibw4r skqBBEpQyGYxCLMtm8xdA+VGTImmngL+IBrJrmhUA51urK9BlSoAqIBzwqmxFLFPhn3H +YiTwv38l0JdNT7iTR9WPg5Tp+AOsPq2ns+5cJM1bHggRtRBvrkBoNXIwKSlQMlvwoxq cw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3gkfarrhbu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 09 Jun 2022 06:01:36 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 9 Jun 2022 06:01:34 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 9 Jun 2022 06:01:34 -0700 Received: from localhost.localdomain (unknown [10.28.34.39]) by maili.marvell.com (Postfix) with ESMTP id C700A3F7060; Thu, 9 Jun 2022 06:01:32 -0700 (PDT) From: Volodymyr Fialko To: , Radu Nicolau , Akhil Goyal CC: , , Volodymyr Fialko Subject: [PATCH 1/1] examples/ipsec-secgw: add option for descriptors per QP Date: Thu, 9 Jun 2022 15:01:29 +0200 Message-ID: <20220609130129.210099-1-vfialko@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-GUID: UkcA0AUvtQpK_Dsnxn2Uilp5vj-a0sNn X-Proofpoint-ORIG-GUID: UkcA0AUvtQpK_Dsnxn2Uilp5vj-a0sNn X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-09_10,2022-06-09_01,2022-02-23_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Added option to configure number of queue pair descriptors via command line (--desc-nb NUMBER_OF_DESC). When the crypto processing takes longer durations, small queue pair size would result in cryptodev enqueue failures. Larger queue pair size would allow more packets to stay in flight simultaneously and reduce enqueue failures. Signed-off-by: Volodymyr Fialko Acked-by: Anoob Joseph Acked-by: Akhil Goyal --- doc/guides/sample_app_ug/ipsec_secgw.rst | 4 ++++ examples/ipsec-secgw/ipsec-secgw.c | 19 ++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/doc/guides/sample_app_ug/ipsec_secgw.rst b/doc/guides/sample_app_ug/ipsec_secgw.rst index 94197a34f0..2529c95953 100644 --- a/doc/guides/sample_app_ug/ipsec_secgw.rst +++ b/doc/guides/sample_app_ug/ipsec_secgw.rst @@ -151,6 +151,7 @@ The application has a number of command line options:: --reassemble NUM --mtu MTU --frag-ttl FRAG_TTL_NS + --desc-nb NUMBER_OF_DESC Where: @@ -258,6 +259,9 @@ Where: By default, vector pool size depeneds on packet pool size and size of each vector. +* ``--desc-nb NUMBER_OF_DESC``: Number of descriptors per queue pair. + Default value: 2048. + The mapping of lcores to port/queues is similar to other l3fwd applications. For example, given the following command line to run application in poll mode:: diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index 25255e053c..146222a1ec 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -62,7 +62,6 @@ volatile bool force_quit; #define MEMPOOL_CACHE_SIZE 256 -#define CDEV_QUEUE_DESC 2048 #define CDEV_MAP_ENTRIES 16384 #define CDEV_MP_CACHE_SZ 64 #define CDEV_MP_CACHE_MULTIPLIER 1.5 /* from rte_mempool.c */ @@ -78,6 +77,11 @@ volatile bool force_quit; static uint16_t nb_rxd = IPSEC_SECGW_RX_DESC_DEFAULT; static uint16_t nb_txd = IPSEC_SECGW_TX_DESC_DEFAULT; +/* + * Configurable number of descriptors per queue pair + */ +static uint32_t qp_desc_nb = 2048; + #define ETHADDR_TO_UINT64(addr) __BYTES_TO_UINT64( \ (addr)->addr_bytes[0], (addr)->addr_bytes[1], \ (addr)->addr_bytes[2], (addr)->addr_bytes[3], \ @@ -113,6 +117,7 @@ struct flow_info flow_info_tbl[RTE_MAX_ETHPORTS]; #define CMD_LINE_OPT_VECTOR_TIMEOUT "vector-tmo" #define CMD_LINE_OPT_VECTOR_POOL_SZ "vector-pool-sz" #define CMD_LINE_OPT_PER_PORT_POOL "per-port-pool" +#define CMD_LINE_OPT_QP_DESC_NB "desc-nb" #define CMD_LINE_ARG_EVENT "event" #define CMD_LINE_ARG_POLL "poll" @@ -142,6 +147,7 @@ enum { CMD_LINE_OPT_VECTOR_TIMEOUT_NUM, CMD_LINE_OPT_VECTOR_POOL_SZ_NUM, CMD_LINE_OPT_PER_PORT_POOL_NUM, + CMD_LINE_OPT_QP_DESC_NB_NUM, }; static const struct option lgopts[] = { @@ -160,6 +166,7 @@ static const struct option lgopts[] = { {CMD_LINE_OPT_VECTOR_TIMEOUT, 1, 0, CMD_LINE_OPT_VECTOR_TIMEOUT_NUM}, {CMD_LINE_OPT_VECTOR_POOL_SZ, 1, 0, CMD_LINE_OPT_VECTOR_POOL_SZ_NUM}, {CMD_LINE_OPT_PER_PORT_POOL, 0, 0, CMD_LINE_OPT_PER_PORT_POOL_NUM}, + {CMD_LINE_OPT_QP_DESC_NB, 1, 0, CMD_LINE_OPT_QP_DESC_NB_NUM}, {NULL, 0, 0, 0} }; @@ -886,6 +893,7 @@ print_usage(const char *prgname) " [--event-vector]" " [--vector-size SIZE]" " [--vector-tmo TIMEOUT in ns]" + " [--" CMD_LINE_OPT_QP_DESC_NB " NUMBER_OF_DESC]" "\n\n" " -p PORTMASK: Hexadecimal bitmask of ports to configure\n" " -P : Enable promiscuous mode\n" @@ -948,6 +956,8 @@ print_usage(const char *prgname) " --" CMD_LINE_OPT_PER_PORT_POOL " Enable per port mbuf pool\n" " --" CMD_LINE_OPT_VECTOR_POOL_SZ " Vector pool size\n" " (default value is based on mbuf count)\n" + " --" CMD_LINE_OPT_QP_DESC_NB " DESC_NB" + ": Number of descriptors per queue pair (default value: 2048)\n" "\n", prgname); } @@ -1341,6 +1351,9 @@ parse_args(int32_t argc, char **argv, struct eh_conf *eh_conf) case CMD_LINE_OPT_PER_PORT_POOL_NUM: per_port_pool = 1; break; + case CMD_LINE_OPT_QP_DESC_NB_NUM: + qp_desc_nb = parse_decimal(optarg); + break; default: print_usage(prgname); return -1; @@ -1658,7 +1671,7 @@ cryptodevs_init(uint16_t req_queue_num) rte_panic("Failed to initialize cryptodev %u\n", cdev_id); - qp_conf.nb_descriptors = CDEV_QUEUE_DESC; + qp_conf.nb_descriptors = qp_desc_nb; qp_conf.mp_session = socket_ctx[dev_conf.socket_id].session_pool; qp_conf.mp_session_private = @@ -2543,7 +2556,7 @@ calculate_nb_mbufs(uint16_t nb_ports, uint16_t nb_crypto_qp, uint32_t nb_rxq, nb_ports * nb_lcores * MAX_PKT_BURST + nb_ports * nb_txq * nb_txd + nb_lcores * MEMPOOL_CACHE_SIZE + - nb_crypto_qp * CDEV_QUEUE_DESC + + nb_crypto_qp * qp_desc_nb + nb_lcores * frag_tbl_sz * FRAG_TBL_BUCKET_ENTRIES), 8192U);