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 2D5F0A0093; Thu, 21 Apr 2022 15:32:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 227C342803; Thu, 21 Apr 2022 15:32:22 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id B4B8642803 for ; Thu, 21 Apr 2022 15:32:20 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 23LDCRWJ027250; Thu, 21 Apr 2022 06:32:20 -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-type; s=pfpt0220; bh=1jo4PjwvVmR+RHtLXovImW/TYiZcBBPTNjgmfN+twCg=; b=IFp6jzs/alsb7N0tN4tgBiCTR1LOi3HxYybn8EnyoOMgQ9mBP/S2J8LR7wwCgNBz0n8F CJTTuFV361eRYdCo2XLqQ4WsazE7Bvyyxw1MxWj0NmO8MAEsiZr6aETUw8LsxF5MHilz gf0xDY4yCc+TlMJgTm6fjCpaUGE6fXW1gOYx6DT5R8FFWj+RXJ67ri2Nh+SwaOuzhdd/ S19JR1mrEzU3xwNyyzL6GAxHpbtq+1r152t7v0cv3K3J8yv+2rgss/U7lHbkl3Slakid TMiP/r6ftlyiBHDryxl1rTdDRuVZVSeP0/Ega1fPqCYSxBjiT4inObHWiL+jIl5NXkHk Cw== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3fhtapj4b2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 21 Apr 2022 06:32: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; Thu, 21 Apr 2022 06:32: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; Thu, 21 Apr 2022 06:32:18 -0700 Received: from hyd1588t430.marvell.com (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id E67EA3F7083; Thu, 21 Apr 2022 06:32:14 -0700 (PDT) From: Nithin Dabilpuram To: , , Radu Nicolau , Akhil Goyal CC: , , Nithin Dabilpuram Subject: [PATCH v2 4/7] examples/ipsec-secgw: allow larger burst size for vectors Date: Thu, 21 Apr 2022 19:01:56 +0530 Message-ID: <20220421133200.22558-4-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20220421133200.22558-1-ndabilpuram@marvell.com> References: <20220322175902.363520-1-ndabilpuram@marvell.com> <20220421133200.22558-1-ndabilpuram@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-GUID: DljNQ-ohld19dfZ8GtPtY7nIk_HQHr25 X-Proofpoint-ORIG-GUID: DljNQ-ohld19dfZ8GtPtY7nIk_HQHr25 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-21_01,2022-04-21_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 d6a4959..88984a6 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -1317,7 +1317,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 fceb835..2edf631 100644 --- a/examples/ipsec-secgw/ipsec-secgw.h +++ b/examples/ipsec-secgw/ipsec-secgw.h @@ -11,6 +11,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 @@ -49,12 +54,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