From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4CC40A04FF; Tue, 22 Mar 2022 18:59:29 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2E104427F5; Tue, 22 Mar 2022 18:59:22 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 99486427FA for ; Tue, 22 Mar 2022 18:59:20 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 22MG9rZu022265; Tue, 22 Mar 2022 10:59:19 -0700 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-transfer-encoding : content-type; s=pfpt0220; bh=uFu4bqbN1aK9VKCg4R3y+xoC4ad/kbKhxbjEKiIERps=; b=Z3J0K7nO09MIGssg/+AB7+1b1ar+jkxytgOU2V3CCfV3X2nDg/OchiIgc+gX9whrnjE7 +lTe94DgSPoAicHIi55ValeohFEQPp4zpg8XMfp767z+F5WJijgHOOfKY2BtOOfXqkbD MzCEb6y3sQlFB4JrJH1iHw6isH4HZGe5aigDiMDG/a+TXyl3U30mpuUiiidOXR64R3LL qfL5fe8D2sjdmUuOJG41EaBTcz7XeMY1EKqxLXoqQLR8FuERGu5FEZedpwRRXCemg4YE dwS4Oa8m+gk23IrmM6uMBGcP1ovFCL2Rla9W4Gq3iodY+vljb5oGvaXLYKVCcd1WcsWS /A== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3eyhqw0j5v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 22 Mar 2022 10:59:19 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 22 Mar 2022 10:59:18 -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; Tue, 22 Mar 2022 10:59:18 -0700 Received: from localhost.localdomain (unknown [10.28.34.24]) by maili.marvell.com (Postfix) with ESMTP id 50E243F705E; Tue, 22 Mar 2022 10:59:15 -0700 (PDT) From: Nithin Dabilpuram To: , Radu Nicolau , Akhil Goyal CC: , , Nithin Dabilpuram Subject: [PATCH 3/7] examples/ipsec-secgw: allow larger burst size for vectors Date: Tue, 22 Mar 2022 23:28:41 +0530 Message-ID: <20220322175902.363520-3-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220322175902.363520-1-ndabilpuram@marvell.com> References: <20220322175902.363520-1-ndabilpuram@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: _4T8gBsYM5TBY6V1K9rtC4XfFbVAYPWW X-Proofpoint-ORIG-GUID: _4T8gBsYM5TBY6V1K9rtC4XfFbVAYPWW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-22_07,2022-03-22_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 Allow larger burst size of vector event mode instead of restricting to 32. Also restructure traffic type struct to have num pkts first so that it is always in first cacheline. Also cache align traffic type struct. Since MAX_PKT_BURST is not used by vector event mode worker, define another macro for its burst size so that poll mode perf is not effected. Signed-off-by: Nithin Dabilpuram --- examples/ipsec-secgw/ipsec-secgw.c | 2 +- examples/ipsec-secgw/ipsec-secgw.h | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index e8f9e90..7e01495 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -1858,7 +1858,7 @@ parse_args(int32_t argc, char **argv, struct eh_conf *eh_conf) case CMD_LINE_OPT_VECTOR_SIZE_NUM: ret = parse_decimal(optarg); - if (ret > MAX_PKT_BURST) { + if (ret > MAX_PKT_BURST_VEC) { printf("Invalid argument for \'%s\': %s\n", CMD_LINE_OPT_VECTOR_SIZE, optarg); print_usage(prgname); diff --git a/examples/ipsec-secgw/ipsec-secgw.h b/examples/ipsec-secgw/ipsec-secgw.h index 24f11ad..c347175 100644 --- a/examples/ipsec-secgw/ipsec-secgw.h +++ b/examples/ipsec-secgw/ipsec-secgw.h @@ -10,6 +10,11 @@ #define NB_SOCKETS 4 #define MAX_PKT_BURST 32 +#define MAX_PKT_BURST_VEC 256 + +#define MAX_PKTS \ + ((MAX_PKT_BURST_VEC > MAX_PKT_BURST ? \ + MAX_PKT_BURST_VEC : MAX_PKT_BURST) * 2) #define RTE_LOGTYPE_IPSEC RTE_LOGTYPE_USER1 @@ -48,12 +53,12 @@ #define MBUF_PTYPE_TUNNEL_ESP_IN_UDP (RTE_PTYPE_TUNNEL_ESP | RTE_PTYPE_L4_UDP) struct traffic_type { - const uint8_t *data[MAX_PKT_BURST * 2]; - struct rte_mbuf *pkts[MAX_PKT_BURST * 2]; - void *saptr[MAX_PKT_BURST * 2]; - uint32_t res[MAX_PKT_BURST * 2]; uint32_t num; -}; + struct rte_mbuf *pkts[MAX_PKTS]; + const uint8_t *data[MAX_PKTS]; + void *saptr[MAX_PKTS]; + uint32_t res[MAX_PKTS]; +} __rte_cache_aligned; struct ipsec_traffic { struct traffic_type ipsec; -- 2.8.4