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 034DF459AD; Mon, 16 Sep 2024 13:26:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1A964025F; Mon, 16 Sep 2024 13:26:46 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 1770D40150 for ; Mon, 16 Sep 2024 13:26:44 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48FMq4Il014237; Mon, 16 Sep 2024 04:26:43 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=pfpt0220; bh=TDjnLwQHmmZA9FZWge7gsK+ 7X+ZP1HkIyMjW95GWao8=; b=dzDE58dEnNNdj6Liki9VbAulym0c/BPD+nCXAF+ ERT56WIowT4x7Fm8HhzmBKM7+G/BPfB/eDAtDQ7tFbg5GJGkOhyoZz8aDqcaiMyk Q7AXhIKOB+jnN/mQ+iPs2O/e4CvfkhIIEEn6rnqNrBm2tcIvOaFAz2jA89bdBSlO 1V9NUDNId9e31tUci2MZfR8OCgljQfLzGloXXFM5M/ysgiEVfj5dCuNj3qVF92K8 XOav9lB3YLoH2dpMBlA5DNcjHJAvZU4wE0GSoTxJMBDFZ7KGjjeSKEi5PfA1mwtP bthakcWrMNFlSKm8kGYGLR1n1i0ikO9QicvthjT192d36Eg== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 41n7ujnj2t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 Sep 2024 04:26:43 -0700 (PDT) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 16 Sep 2024 04:26:41 -0700 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 16 Sep 2024 04:26:41 -0700 Received: from localhost.localdomain (unknown [10.28.36.102]) by maili.marvell.com (Postfix) with ESMTP id F41013F704E; Mon, 16 Sep 2024 04:26:39 -0700 (PDT) From: Akhil Goyal To: CC: , , , Akhil Goyal Subject: [PATCH] examples/l2fwd-macsec: enable extended packet number Date: Mon, 16 Sep 2024 16:56:36 +0530 Message-ID: <20240916112636.3158391-1-gakhil@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: uN7areyKdeo-oW-NizXjh1CFzsJ2UBh_ X-Proofpoint-ORIG-GUID: uN7areyKdeo-oW-NizXjh1CFzsJ2UBh_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_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 Enabled the extended packet number(XPN) case so that traffic runs for longer duration without raising interrupt for PN threshold as the application currently does not handle rekeying. Signed-off-by: Akhil Goyal --- examples/l2fwd-macsec/main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/l2fwd-macsec/main.c b/examples/l2fwd-macsec/main.c index 294ee113e3..b262d3ba0b 100644 --- a/examples/l2fwd-macsec/main.c +++ b/examples/l2fwd-macsec/main.c @@ -446,7 +446,8 @@ fill_macsec_sc_conf(uint16_t portid, struct rte_security_macsec_sc *sc_conf) } sc_conf->sc_tx.active = 1; sc_conf->sc_tx.sci = mcs_port_params[portid].sci; - if (mcs_port_params[portid].xpn > 0) + if (mcs_port_params[portid].alg == RTE_SECURITY_MACSEC_ALG_GCM_XPN_128 || + mcs_port_params[portid].alg == RTE_SECURITY_MACSEC_ALG_GCM_XPN_256) sc_conf->sc_tx.is_xpn = 1; } else { for (i = 0; i < RTE_SECURITY_MACSEC_NUM_AN; i++) { @@ -456,7 +457,8 @@ fill_macsec_sc_conf(uint16_t portid, struct rte_security_macsec_sc *sc_conf) } } sc_conf->sc_rx.active = 1; - if (mcs_port_params[portid].xpn > 0) + if (mcs_port_params[portid].alg == RTE_SECURITY_MACSEC_ALG_GCM_XPN_128 || + mcs_port_params[portid].alg == RTE_SECURITY_MACSEC_ALG_GCM_XPN_256) sc_conf->sc_rx.is_xpn = 1; } } @@ -1008,7 +1010,7 @@ l2fwd_macsec_default_options(struct l2fwd_macsec_options *options) if ((options->rx_portmask & (1 << portid)) != 0) mcs_port_params[portid].dir = RTE_SECURITY_MACSEC_DIR_RX; - mcs_port_params[portid].alg = RTE_SECURITY_MACSEC_ALG_GCM_128; + mcs_port_params[portid].alg = RTE_SECURITY_MACSEC_ALG_GCM_XPN_128; memcpy(mcs_port_params[portid].sa_key.data, key, 16); mcs_port_params[portid].sa_key.len = 16; memcpy(mcs_port_params[portid].salt, salt, MCS_SALT_LEN); -- 2.25.1