From: Akhil Goyal <gakhil@marvell.com>
To: <dev@dpdk.org>
Cc: <thomas@monjalon.net>, <olivier.matz@6wind.com>,
<orika@nvidia.com>, <david.marchand@redhat.com>,
<hemant.agrawal@nxp.com>, <vattunuru@marvell.com>,
<ferruh.yigit@amd.com>, <andrew.rybchenko@oktetlabs.ru>,
<jerinj@marvell.com>, <adwivedi@marvell.com>
Subject: [PATCH v2 11/13] test/security: verify MACsec Rx rekey
Date: Wed, 7 Jun 2023 20:49:38 +0530 [thread overview]
Message-ID: <20230607151940.223417-12-gakhil@marvell.com> (raw)
In-Reply-To: <20230607151940.223417-1-gakhil@marvell.com>
From: Ankur Dwivedi <adwivedi@marvell.com>
This patch enables the Rx rekey test case for MACSEC.
Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
---
app/test/test_security_inline_macsec.c | 50 +++++++++++++++++++++++++-
1 file changed, 49 insertions(+), 1 deletion(-)
diff --git a/app/test/test_security_inline_macsec.c b/app/test/test_security_inline_macsec.c
index 2172f61199..d832dfc170 100644
--- a/app/test/test_security_inline_macsec.c
+++ b/app/test/test_security_inline_macsec.c
@@ -906,8 +906,14 @@ test_macsec(const struct mcs_test_vector *td[], enum mcs_op op, const struct mcs
if (op == MCS_DECAP || op == MCS_ENCAP_DECAP ||
op == MCS_VERIFY_ONLY || op == MCS_AUTH_VERIFY) {
for (an = 0; an < RTE_SECURITY_MACSEC_NUM_AN; an++) {
+ if (opts->rekey_en && an ==
+ (opts->rekey_td->secure_pkt.data[tci_off] &
+ RTE_MACSEC_AN_MASK))
+ fill_macsec_sa_conf(opts->rekey_td, &sa_conf,
+ RTE_SECURITY_MACSEC_DIR_RX, an, tci_off);
+ else
/* For simplicity, using same SA conf for all AN */
- fill_macsec_sa_conf(td[i], &sa_conf,
+ fill_macsec_sa_conf(td[i], &sa_conf,
RTE_SECURITY_MACSEC_DIR_RX, an, tci_off);
id = rte_security_macsec_sa_create(ctx, &sa_conf);
if (id < 0) {
@@ -1054,6 +1060,9 @@ test_macsec(const struct mcs_test_vector *td[], enum mcs_op op, const struct mcs
}
tx_sa_id[0][0] = (uint16_t)id;
break;
+ case RTE_ETH_EVENT_MACSEC_RX_SA_PN_SOFT_EXP:
+ printf("Received RTE_ETH_EVENT_MACSEC_RX_SA_PN_SOFT_EXP event\n");
+ break;
default:
printf("Received unsupported event\n");
}
@@ -1951,6 +1960,41 @@ test_inline_macsec_rekey_tx(const void *data __rte_unused)
return all_err;
}
+static int
+test_inline_macsec_rekey_rx(const void *data __rte_unused)
+{
+ const struct mcs_test_vector *cur_td;
+ struct mcs_test_opts opts = {0};
+ int err, all_err = 0;
+ int i, size;
+
+ opts.val_frames = RTE_SECURITY_MACSEC_VALIDATE_STRICT;
+ opts.protect_frames = true;
+ opts.sa_in_use = 1;
+ opts.nb_td = 1;
+ opts.sectag_insert_mode = 1;
+ opts.mtu = RTE_ETHER_MTU;
+ opts.rekey_en = 1;
+
+ size = (sizeof(list_mcs_rekey_vectors) / sizeof((list_mcs_rekey_vectors)[0]));
+ for (i = 0; i < size; i++) {
+ cur_td = &list_mcs_rekey_vectors[i];
+ opts.rekey_td = &list_mcs_rekey_vectors[++i];
+ err = test_macsec(&cur_td, MCS_DECAP, &opts);
+ if (err) {
+ printf("Rx rekey test case %d failed\n", i);
+ err = -1;
+ } else {
+ printf("Rx rekey test case %d passed\n", i);
+ err = 0;
+ }
+ all_err += err;
+ }
+
+ printf("\n%s: Success: %d, Failure: %d\n", __func__, size + all_err, -all_err);
+ return all_err;
+}
+
static int
ut_setup_inline_macsec(void)
{
@@ -2184,6 +2228,10 @@ static struct unit_test_suite inline_macsec_testsuite = {
"MACsec re-key Tx",
ut_setup_inline_macsec, ut_teardown_inline_macsec,
test_inline_macsec_rekey_tx),
+ TEST_CASE_NAMED_ST(
+ "MACsec re-key Rx",
+ ut_setup_inline_macsec, ut_teardown_inline_macsec,
+ test_inline_macsec_rekey_rx),
TEST_CASES_END() /**< NULL terminate unit test array */
},
--
2.25.1
next prev parent reply other threads:[~2023-06-07 15:21 UTC|newest]
Thread overview: 166+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-14 18:46 [PATCH 0/3] security: support MACsec Akhil Goyal
2022-08-14 18:46 ` [PATCH 1/3] net: add MACsec header Akhil Goyal
2022-09-22 15:29 ` Akhil Goyal
2022-09-26 12:51 ` Olivier Matz
2022-09-26 13:41 ` [EXT] " Akhil Goyal
2022-09-27 8:36 ` Akhil Goyal
2022-08-14 18:46 ` [PATCH 2/3] security: support MACsec Akhil Goyal
2022-09-22 15:37 ` Akhil Goyal
2022-08-14 18:46 ` [PATCH 3/3] ethdev: add MACsec flow item Akhil Goyal
2022-08-15 12:49 ` Ori Kam
2022-09-28 12:22 ` [PATCH v2 0/3] security: support MACsec Akhil Goyal
2022-09-28 12:22 ` [PATCH v2 1/3] net: add MACsec header Akhil Goyal
2022-09-28 13:04 ` Olivier Matz
2022-09-28 13:44 ` Thomas Monjalon
2022-09-28 14:23 ` Ori Kam
2022-09-28 12:22 ` [PATCH v2 2/3] ethdev: add MACsec flow item Akhil Goyal
2022-09-28 12:22 ` [PATCH v2 3/3] security: support MACsec Akhil Goyal
2022-09-28 12:45 ` [PATCH 0/5] Support and test inline MACsec for cnxk Akhil Goyal
2022-09-28 12:45 ` [PATCH 1/5] common/cnxk: add ROC APIs for MACsec Akhil Goyal
2022-09-28 12:45 ` [PATCH 2/5] common/cnxk: derive hash key " Akhil Goyal
2022-09-28 12:45 ` [PATCH 3/5] net/cnxk: support MACsec Akhil Goyal
2022-09-28 12:45 ` [PATCH 4/5] test/security: add inline MACsec cases Akhil Goyal
2023-05-23 19:49 ` [PATCH 00/13] Add MACsec unit test cases Akhil Goyal
2023-05-23 19:49 ` [PATCH 01/13] security: add direction in SA/SC configuration Akhil Goyal
2023-05-23 19:49 ` [PATCH 02/13] security: add MACsec packet number threshold Akhil Goyal
2023-05-23 21:29 ` Stephen Hemminger
2023-05-24 7:12 ` [EXT] " Akhil Goyal
2023-05-24 8:09 ` Akhil Goyal
2023-05-23 19:49 ` [PATCH 03/13] test/security: add inline MACsec cases Akhil Goyal
2023-05-23 19:49 ` [PATCH 04/13] test/security: add MACsec integrity cases Akhil Goyal
2023-05-23 19:49 ` [PATCH 05/13] test/security: verify multi flow MACsec Akhil Goyal
2023-05-23 19:49 ` [PATCH 06/13] test/security: add MACsec VLAN cases Akhil Goyal
2023-05-23 19:49 ` [PATCH 07/13] test/security: add MACsec negative cases Akhil Goyal
2023-05-23 19:49 ` [PATCH 08/13] test/security: verify MACsec stats Akhil Goyal
2023-05-23 19:49 ` [PATCH 09/13] test/security: verify MACsec interrupts Akhil Goyal
2023-05-23 19:49 ` [PATCH 10/13] test/security: verify MACsec Tx HW rekey Akhil Goyal
2023-05-23 19:49 ` [PATCH 11/13] test/security: verify MACsec Rx rekey Akhil Goyal
2023-05-23 19:49 ` [PATCH 12/13] test/security: verify MACsec anti replay Akhil Goyal
2023-05-23 19:49 ` [PATCH 13/13] test/security: remove no MACsec support case Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 00/13] Add MACsec unit test cases Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 01/13] security: add direction in SA/SC configuration Akhil Goyal
2023-06-07 15:21 ` Akhil Goyal
2023-06-07 19:49 ` David Marchand
2023-06-08 6:58 ` [EXT] " Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 02/13] security: add MACsec packet number threshold Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 03/13] test/security: add inline MACsec cases Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 04/13] test/security: add MACsec integrity cases Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 05/13] test/security: verify multi flow MACsec Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 06/13] test/security: add MACsec VLAN cases Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 07/13] test/security: add MACsec negative cases Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 08/13] test/security: verify MACsec stats Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 09/13] test/security: verify MACsec interrupts Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 10/13] test/security: verify MACsec Tx HW rekey Akhil Goyal
2023-06-07 15:19 ` Akhil Goyal [this message]
2023-06-07 15:19 ` [PATCH v2 12/13] test/security: verify MACsec anti replay Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 13/13] test/security: remove no MACsec support case Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 00/13] Add MACsec unit test cases Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 01/13] security: add direction in SA/SC configuration Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 02/13] security: add MACsec packet number threshold Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 03/13] test/security: add inline MACsec cases Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 04/13] test/security: add MACsec integrity cases Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 05/13] test/security: verify multi flow MACsec Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 06/13] test/security: add MACsec VLAN cases Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 07/13] test/security: add MACsec negative cases Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 08/13] test/security: verify MACsec stats Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 09/13] test/security: verify MACsec interrupts Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 10/13] test/security: verify MACsec Tx HW rekey Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 11/13] test/security: verify MACsec Rx rekey Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 12/13] test/security: verify MACsec anti replay Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 13/13] test/security: remove no MACsec support case Akhil Goyal
2023-06-08 17:19 ` [PATCH v3 00/13] Add MACsec unit test cases Akhil Goyal
2022-09-28 12:45 ` [PATCH 5/5] test/security: add more MACsec cases Akhil Goyal
2023-05-23 20:03 ` [PATCH 00/15] net/cnxk: add MACsec support Akhil Goyal
2023-05-23 20:03 ` [PATCH 01/15] common/cnxk: add ROC MACsec initialization Akhil Goyal
2023-05-26 9:29 ` Jerin Jacob
2023-05-23 20:03 ` [PATCH 02/15] common/cnxk: add MACsec SA configuration Akhil Goyal
2023-05-26 10:16 ` Jerin Jacob
2023-05-23 20:03 ` [PATCH 03/15] common/cnxk: add MACsec SC configuration APIs Akhil Goyal
2023-05-23 20:03 ` [PATCH 04/15] common/cnxk: add MACsec secy and flow configuration Akhil Goyal
2023-05-23 20:03 ` [PATCH 05/15] common/cnxk: add MACsec PN and LMAC mode configuration Akhil Goyal
2023-05-26 10:20 ` Jerin Jacob
2023-05-23 20:03 ` [PATCH 06/15] common/cnxk: add MACsec stats Akhil Goyal
2023-05-23 20:03 ` [PATCH 07/15] common/cnxk: add MACsec interrupt APIs Akhil Goyal
2023-05-23 20:03 ` [PATCH 08/15] common/cnxk: add MACsec port configuration Akhil Goyal
2023-05-23 20:03 ` [PATCH 09/15] common/cnxk: add MACsec control " Akhil Goyal
2023-05-26 10:23 ` Jerin Jacob
2023-05-23 20:03 ` [PATCH 10/15] common/cnxk: add MACsec FIPS mbox Akhil Goyal
2023-05-23 20:03 ` [PATCH 11/15] common/cnxk: derive hash key for MACsec Akhil Goyal
2023-05-23 20:03 ` [PATCH 12/15] net/cnxk: add MACsec initialization Akhil Goyal
2023-05-23 20:03 ` [PATCH 13/15] net/cnxk: create/destroy MACsec SC/SA Akhil Goyal
2023-05-23 20:04 ` [PATCH 14/15] net/cnxk: add MACsec session and flow configuration Akhil Goyal
2023-05-23 20:04 ` [PATCH 15/15] net/cnxk: add MACsec stats Akhil Goyal
2023-06-13 9:46 ` Jerin Jacob
2023-06-07 15:28 ` [PATCH v2 00/15] net/cnxk: add MACsec support Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 01/15] common/cnxk: add ROC MACsec initialization Akhil Goyal
2023-06-12 15:51 ` Jerin Jacob
2023-06-07 15:28 ` [PATCH v2 02/15] common/cnxk: add MACsec SA configuration Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 03/15] common/cnxk: add MACsec SC configuration APIs Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 04/15] common/cnxk: add MACsec secy and flow configuration Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 05/15] common/cnxk: add MACsec PN and LMAC mode configuration Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 06/15] common/cnxk: add MACsec stats Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 07/15] common/cnxk: add MACsec interrupt APIs Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 08/15] common/cnxk: add MACsec port configuration Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 09/15] common/cnxk: add MACsec control " Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 10/15] common/cnxk: add MACsec FIPS mbox Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 11/15] common/cnxk: derive hash key for MACsec Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 12/15] net/cnxk: add MACsec initialization Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 13/15] net/cnxk: create/destroy MACsec SC/SA Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 14/15] net/cnxk: add MACsec session and flow configuration Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 15/15] net/cnxk: add MACsec stats Akhil Goyal
2023-06-13 7:15 ` [PATCH v3 00/15] net/cnxk: add MACsec support Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 01/15] common/cnxk: add ROC MACsec initialization Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 02/15] common/cnxk: add MACsec SA configuration Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 03/15] common/cnxk: add MACsec SC configuration APIs Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 04/15] common/cnxk: add MACsec secy and flow configuration Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 05/15] common/cnxk: add MACsec PN and LMAC mode configuration Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 06/15] common/cnxk: add MACsec stats Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 07/15] common/cnxk: add MACsec interrupt APIs Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 08/15] common/cnxk: add MACsec port configuration Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 09/15] common/cnxk: add MACsec control " Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 10/15] common/cnxk: add MACsec FIPS mbox Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 11/15] common/cnxk: derive hash key for MACsec Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 12/15] net/cnxk: add MACsec initialization Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 13/15] net/cnxk: create/destroy MACsec SC/SA Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 14/15] net/cnxk: add MACsec session and flow configuration Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 15/15] net/cnxk: add MACsec stats Akhil Goyal
2023-06-13 10:19 ` [PATCH v4 00/15] net/cnxk: add MACsec support Akhil Goyal
2023-06-13 10:19 ` [PATCH v4 01/15] common/cnxk: add ROC MACsec initialization Akhil Goyal
2023-06-13 10:19 ` [PATCH v4 02/15] common/cnxk: add MACsec SA configuration Akhil Goyal
2023-06-13 10:19 ` [PATCH v4 03/15] common/cnxk: add MACsec SC configuration APIs Akhil Goyal
2023-06-13 10:19 ` [PATCH v4 04/15] common/cnxk: add MACsec secy and flow configuration Akhil Goyal
2023-06-13 10:19 ` [PATCH v4 05/15] common/cnxk: add MACsec PN and LMAC mode configuration Akhil Goyal
2023-06-13 10:20 ` [PATCH v4 06/15] common/cnxk: add MACsec stats Akhil Goyal
2023-06-13 10:20 ` [PATCH v4 07/15] common/cnxk: add MACsec interrupt APIs Akhil Goyal
2023-06-13 10:20 ` [PATCH v4 08/15] common/cnxk: add MACsec port configuration Akhil Goyal
2023-06-13 10:20 ` [PATCH v4 09/15] common/cnxk: add MACsec control " Akhil Goyal
2023-06-13 10:20 ` [PATCH v4 10/15] common/cnxk: add MACsec FIPS mbox Akhil Goyal
2023-06-13 10:20 ` [PATCH v4 11/15] common/cnxk: derive hash key for MACsec Akhil Goyal
2023-06-13 10:20 ` [PATCH v4 12/15] net/cnxk: add MACsec initialization Akhil Goyal
2023-06-13 10:20 ` [PATCH v4 13/15] net/cnxk: create/destroy MACsec SC/SA Akhil Goyal
2023-06-13 10:20 ` [PATCH v4 14/15] net/cnxk: add MACsec session and flow configuration Akhil Goyal
2023-06-13 10:20 ` [PATCH v4 15/15] net/cnxk: add MACsec stats Akhil Goyal
2023-06-13 15:26 ` Jerin Jacob
2023-06-14 13:08 ` [PATCH v5 00/15] net/cnxk: add MACsec support Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 01/15] common/cnxk: add ROC MACsec initialization Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 02/15] common/cnxk: add MACsec SA configuration Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 03/15] common/cnxk: add MACsec SC configuration APIs Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 04/15] common/cnxk: add MACsec secy and flow configuration Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 05/15] common/cnxk: add MACsec PN and LMAC mode configuration Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 06/15] common/cnxk: add MACsec stats Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 07/15] common/cnxk: add MACsec interrupt APIs Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 08/15] common/cnxk: add MACsec port configuration Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 09/15] common/cnxk: add MACsec control " Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 10/15] common/cnxk: add MACsec FIPS mbox Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 11/15] common/cnxk: derive hash key for MACsec Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 12/15] net/cnxk: add MACsec initialization Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 13/15] net/cnxk: create/destroy MACsec SC/SA Akhil Goyal
2023-06-14 13:09 ` [PATCH v5 14/15] net/cnxk: add MACsec session and flow configuration Akhil Goyal
2023-06-14 13:09 ` [PATCH v5 15/15] net/cnxk: add MACsec stats Akhil Goyal
2023-06-15 7:03 ` Jerin Jacob
2022-09-28 12:52 ` [PATCH v2 0/3] security: support MACsec Akhil Goyal
2022-09-28 18:24 ` [PATCH v3 " Akhil Goyal
2022-09-28 18:24 ` [PATCH v3 1/3] net: add MACsec header Akhil Goyal
2022-09-28 18:24 ` [PATCH v3 2/3] ethdev: add MACsec flow item Akhil Goyal
2022-09-28 18:24 ` [PATCH v3 3/3] security: support MACsec Akhil Goyal
2022-09-28 20:04 ` [PATCH v3 0/3] " Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230607151940.223417-12-gakhil@marvell.com \
--to=gakhil@marvell.com \
--cc=adwivedi@marvell.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=hemant.agrawal@nxp.com \
--cc=jerinj@marvell.com \
--cc=olivier.matz@6wind.com \
--cc=orika@nvidia.com \
--cc=thomas@monjalon.net \
--cc=vattunuru@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).