DPDK patches and discussions
 help / color / mirror / Atom feed
From: Igor Russkikh <Igor.Russkikh@aquantia.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Cc: "ferruh.yigit@intel.com" <ferruh.yigit@intel.com>,
	Pavel Belous <Pavel.Belous@aquantia.com>,
	John McNamara <john.mcnamara@intel.com>,
	Konstantin Ananyev <konstantin.ananyev@intel.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	Akhil Goyal <akhil.goyal@nxp.com>,
	Declan Doherty <declan.doherty@intel.com>,
	Igor Russkikh <Igor.Russkikh@aquantia.com>
Subject: [dpdk-dev] [RFC 3/5] app/testpmd: macsec off command
Date: Fri, 31 May 2019 16:14:52 +0000	[thread overview]
Message-ID: <3abfda8b6646fde5b6c411a2e141bd04a4ec03c5.1559319237.git.igor.russkikh@aquantia.com> (raw)
In-Reply-To: <4595add642bf8ca1114488657d12a973b966e8f5.1559319237.git.igor.russkikh@aquantia.com>

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(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index dbee3d958c2e..af7c2853fd2c 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -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);
-- 
2.17.1


  parent reply	other threads:[~2019-05-31 16:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31 16:14 [dpdk-dev] [RFC 1/5] security: MACSEC infrastructure data declarations Igor Russkikh
2019-05-31 16:14 ` [dpdk-dev] [RFC 2/5] app/testpmd: macsec on command draft via security context Igor Russkikh
2019-05-31 16:14 ` Igor Russkikh [this message]
2019-05-31 16:14 ` [dpdk-dev] [RFC 4/5] app/testpmd: macsec: update set sc command with new interface Igor Russkikh
2019-05-31 16:15 ` [dpdk-dev] [RFC 5/5] net/atlantic: macsec security context draft Igor Russkikh

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=3abfda8b6646fde5b6c411a2e141bd04a4ec03c5.1559319237.git.igor.russkikh@aquantia.com \
    --to=igor.russkikh@aquantia.com \
    --cc=Pavel.Belous@aquantia.com \
    --cc=akhil.goyal@nxp.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=john.mcnamara@intel.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=thomas@monjalon.net \
    /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).