[RFC,3/5] app/testpmd: macsec off command
Checks
Commit Message
draft on how macsec off command will looks like
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
---
app/test-pmd/cmdline.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
@@ -14173,6 +14173,8 @@ cmd_set_macsec_offload_off_parsed(
int ret = -ENOTSUP;
struct rte_eth_dev_info dev_info;
portid_t port_id = res->port_id;
+ struct rte_security_ctx *ctx;
+ struct rte_eth_dev_info dev_info;
if (port_id_is_invalid(port_id, ENABLED_WARN))
return;
@@ -14181,14 +14183,24 @@ cmd_set_macsec_offload_off_parsed(
return;
}
- rte_eth_dev_info_get(port_id, &dev_info);
- if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MACSEC_INSERT) {
-#ifdef RTE_LIBRTE_IXGBE_PMD
- ret = rte_pmd_ixgbe_macsec_disable(port_id);
-#endif
+ if (!macsec_session) {
+ printf("MACsec is not active\n", port_id);
+ return;
+ }
+
+ ctx = rte_eth_dev_get_sec_ctx(port_id);
+ if (!ctx) {
+ ret = -ENOTSUP;
+ goto done;
}
+
+ /* Use of the same mempool for session header and private data */
+ ret = rte_security_session_destroy(ctx, macsec_session);
+
+done:
switch (ret) {
case 0:
+ /* TBD: Remove this offload bit? */
ports[port_id].dev_conf.txmode.offloads &=
~DEV_TX_OFFLOAD_MACSEC_INSERT;
cmd_reconfig_device_queue(port_id, 1, 1);