Skip to content

Commit d616e75

Browse files
author
Akhil Goyal
committed
examples/l2fwd-macsec: enable extended packet number
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 <[email protected]>
1 parent ec05d61 commit d616e75

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

examples/l2fwd-macsec/main.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,8 @@ fill_macsec_sc_conf(uint16_t portid, struct rte_security_macsec_sc *sc_conf)
446446
}
447447
sc_conf->sc_tx.active = 1;
448448
sc_conf->sc_tx.sci = mcs_port_params[portid].sci;
449-
if (mcs_port_params[portid].xpn > 0)
449+
if (mcs_port_params[portid].alg == RTE_SECURITY_MACSEC_ALG_GCM_XPN_128 ||
450+
mcs_port_params[portid].alg == RTE_SECURITY_MACSEC_ALG_GCM_XPN_256)
450451
sc_conf->sc_tx.is_xpn = 1;
451452
} else {
452453
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)
456457
}
457458
}
458459
sc_conf->sc_rx.active = 1;
459-
if (mcs_port_params[portid].xpn > 0)
460+
if (mcs_port_params[portid].alg == RTE_SECURITY_MACSEC_ALG_GCM_XPN_128 ||
461+
mcs_port_params[portid].alg == RTE_SECURITY_MACSEC_ALG_GCM_XPN_256)
460462
sc_conf->sc_rx.is_xpn = 1;
461463
}
462464
}
@@ -1008,7 +1010,7 @@ l2fwd_macsec_default_options(struct l2fwd_macsec_options *options)
10081010
if ((options->rx_portmask & (1 << portid)) != 0)
10091011
mcs_port_params[portid].dir = RTE_SECURITY_MACSEC_DIR_RX;
10101012

1011-
mcs_port_params[portid].alg = RTE_SECURITY_MACSEC_ALG_GCM_128;
1013+
mcs_port_params[portid].alg = RTE_SECURITY_MACSEC_ALG_GCM_XPN_128;
10121014
memcpy(mcs_port_params[portid].sa_key.data, key, 16);
10131015
mcs_port_params[portid].sa_key.len = 16;
10141016
memcpy(mcs_port_params[portid].salt, salt, MCS_SALT_LEN);

0 commit comments

Comments
 (0)