From: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
To: dev@dpdk.org
Cc: jasvinder.singh@intel.com, yogesh.jangra@intel.com
Subject: [PATCH 20/21] net/softnic: add pipeline mirroring CLI command
Date: Thu, 4 Aug 2022 16:58:38 +0000 [thread overview]
Message-ID: <20220804165839.1074817-21-cristian.dumitrescu@intel.com> (raw)
In-Reply-To: <20220804165839.1074817-1-cristian.dumitrescu@intel.com>
Add CLI command for pipeline mirroring configuration.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Yogesh Jangra <yogesh.jangra@intel.com>
---
drivers/net/softnic/rte_eth_softnic_cli.c | 96 +++++++++++++++++++++++
1 file changed, 96 insertions(+)
diff --git a/drivers/net/softnic/rte_eth_softnic_cli.c b/drivers/net/softnic/rte_eth_softnic_cli.c
index a391ce1139..61221b2f2e 100644
--- a/drivers/net/softnic/rte_eth_softnic_cli.c
+++ b/drivers/net/softnic/rte_eth_softnic_cli.c
@@ -2111,6 +2111,94 @@ cmd_softnic_pipeline_stats(struct pmd_internals *softnic,
}
}
+/**
+ * pipeline <pipeline_name> mirror session <session_id> port <port_id> clone fast | slow
+ * truncate <truncation_length>
+ */
+static void
+cmd_softnic_pipeline_mirror_session(struct pmd_internals *softnic,
+ char **tokens,
+ uint32_t n_tokens,
+ char *out,
+ size_t out_size)
+{
+ struct rte_swx_pipeline_mirroring_session_params params;
+ struct pipeline *p;
+ uint32_t session_id = 0;
+ int status;
+
+ if (n_tokens != 11) {
+ snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
+ return;
+ }
+
+ if (strcmp(tokens[0], "pipeline")) {
+ snprintf(out, out_size, MSG_ARG_NOT_FOUND, "pipeline");
+ return;
+ }
+
+ p = softnic_pipeline_find(softnic, tokens[1]);
+ if (!p) {
+ snprintf(out, out_size, MSG_ARG_INVALID, "pipeline_name");
+ return;
+ }
+
+ if (strcmp(tokens[2], "mirror")) {
+ snprintf(out, out_size, MSG_ARG_NOT_FOUND, "mirror");
+ return;
+ }
+
+ if (strcmp(tokens[3], "session")) {
+ snprintf(out, out_size, MSG_ARG_NOT_FOUND, "session");
+ return;
+ }
+
+ if (parser_read_uint32(&session_id, tokens[4])) {
+ snprintf(out, out_size, MSG_ARG_INVALID, "session_id");
+ return;
+ }
+
+ if (strcmp(tokens[5], "port")) {
+ snprintf(out, out_size, MSG_ARG_NOT_FOUND, "port");
+ return;
+ }
+
+ if (parser_read_uint32(¶ms.port_id, tokens[6])) {
+ snprintf(out, out_size, MSG_ARG_INVALID, "port_id");
+ return;
+ }
+
+ if (strcmp(tokens[7], "clone")) {
+ snprintf(out, out_size, MSG_ARG_NOT_FOUND, "clone");
+ return;
+ }
+
+ if (!strcmp(tokens[8], "fast"))
+ params.fast_clone = 1;
+ else if (!strcmp(tokens[8], "slow"))
+ params.fast_clone = 0;
+ else {
+ snprintf(out, out_size, MSG_ARG_INVALID, "clone");
+ return;
+ }
+
+ if (strcmp(tokens[9], "truncate")) {
+ snprintf(out, out_size, MSG_ARG_NOT_FOUND, "truncate");
+ return;
+ }
+
+ if (parser_read_uint32(¶ms.truncation_length, tokens[10])) {
+ snprintf(out, out_size, MSG_ARG_INVALID, "truncation_length");
+ return;
+ }
+
+ status = rte_swx_ctl_pipeline_mirroring_session_set(p->p, session_id, ¶ms);
+ if (status) {
+ snprintf(out, out_size, "Command failed!\n");
+ return;
+ }
+}
+
/**
* thread <thread_id> pipeline <pipeline_name> enable [ period <timer_period_ms> ]
*/
@@ -2395,6 +2483,14 @@ softnic_cli_process(char *in, char *out, size_t out_size, void *arg)
cmd_softnic_pipeline_stats(softnic, tokens, n_tokens, out, out_size);
return;
}
+
+ if ((n_tokens >= 4) &&
+ !strcmp(tokens[2], "mirror") &&
+ !strcmp(tokens[3], "session")) {
+ cmd_softnic_pipeline_mirror_session(softnic, tokens, n_tokens,
+ out, out_size);
+ return;
+ }
}
if (strcmp(tokens[0], "thread") == 0) {
--
2.34.1
next prev parent reply other threads:[~2022-08-04 17:01 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-04 16:58 [PATCH 00/21] net/softnic: replace the legacy pipeline with SWX pipeline Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 01/21] net/softnic: remove the traffic manager support Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 02/21] net/softnic: remove flow support Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 03/21] net/softnic: remove the meter support Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 04/21] net/softnic: remove cryptodev support Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 05/21] net/softnic: remove tap support Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 06/21] net/softnic: remove the legacy pipeline CLI commands Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 07/21] net/softnic: replace the legacy pipeline with the SWX pipeline Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 08/21] net/softnic: remove the list of Ethernet devices Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 09/21] net/softnic: remove unused text parsing functions Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 10/21] net/softnic: add pipeline code generation CLI command Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 11/21] net/softnic: add pipeline library build " Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 12/21] net/softnic: add pipeline " Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 13/21] net/softnic: add pipeline table CLI commands Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 14/21] net/softnic: add pipeline selector " Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 15/21] net/softnic: add pipeline learner " Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 16/21] net/softnic: add pipeline commit and abort " Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 17/21] net/softnic: add the pipeline register read/write " Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 18/21] net/softnic: add the pipeline meter " Cristian Dumitrescu
2022-08-04 16:58 ` [PATCH 19/21] net/softnic: add pipeline statistics CLI command Cristian Dumitrescu
2022-08-04 16:58 ` Cristian Dumitrescu [this message]
2022-08-04 16:58 ` [PATCH 21/21] net/softnic: update the default device program Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 00/21] net/softnic: replace the legacy pipeline with SWX pipeline Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 01/21] net/softnic: remove the traffic manager support Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 02/21] net/softnic: remove flow support Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 03/21] net/softnic: remove the meter support Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 04/21] net/softnic: remove cryptodev support Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 05/21] net/softnic: remove tap support Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 06/21] net/softnic: remove the legacy pipeline CLI commands Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 07/21] net/softnic: replace the legacy pipeline with the SWX pipeline Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 08/21] net/softnic: remove the list of Ethernet devices Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 09/21] net/softnic: remove unused text parsing functions Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 10/21] net/softnic: add pipeline code generation CLI command Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 11/21] net/softnic: add pipeline library build " Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 12/21] net/softnic: add pipeline " Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 13/21] net/softnic: add pipeline table CLI commands Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 14/21] net/softnic: add pipeline selector " Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 15/21] net/softnic: add pipeline learner " Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 16/21] net/softnic: add pipeline commit and abort " Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 17/21] net/softnic: add the pipeline register read/write " Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 18/21] net/softnic: add the pipeline meter " Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 19/21] net/softnic: add pipeline statistics CLI command Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 20/21] net/softnic: add pipeline mirroring " Cristian Dumitrescu
2022-08-26 13:17 ` [PATCH V2 21/21] net/softnic: update the default device program Cristian Dumitrescu
2022-09-01 14:20 ` [PATCH V3 00/21] net/softnic: replace the legacy pipeline with SWX pipeline Cristian Dumitrescu
2022-09-01 14:20 ` [PATCH V3 01/21] net/softnic: remove the traffic manager support Cristian Dumitrescu
2022-09-01 14:20 ` [PATCH V3 02/21] net/softnic: remove flow support Cristian Dumitrescu
2022-11-30 11:18 ` Ferruh Yigit
2022-12-01 11:27 ` Dumitrescu, Cristian
2022-09-01 14:20 ` [PATCH V3 03/21] net/softnic: remove the meter support Cristian Dumitrescu
2022-09-01 14:20 ` [PATCH V3 04/21] net/softnic: remove cryptodev support Cristian Dumitrescu
2022-09-01 14:20 ` [PATCH V3 05/21] net/softnic: remove tap support Cristian Dumitrescu
2022-09-01 14:20 ` [PATCH V3 06/21] net/softnic: remove the legacy pipeline CLI commands Cristian Dumitrescu
2022-09-01 14:20 ` [PATCH V3 07/21] net/softnic: replace the legacy pipeline with the SWX pipeline Cristian Dumitrescu
2022-09-01 14:20 ` [PATCH V3 08/21] net/softnic: remove the list of Ethernet devices Cristian Dumitrescu
2022-09-01 14:20 ` [PATCH V3 09/21] net/softnic: remove unused text parsing functions Cristian Dumitrescu
2022-09-01 14:20 ` [PATCH V3 10/21] net/softnic: add pipeline code generation CLI command Cristian Dumitrescu
2022-09-01 14:20 ` [PATCH V3 11/21] net/softnic: add pipeline library build " Cristian Dumitrescu
2022-09-01 14:20 ` [PATCH V3 12/21] net/softnic: add pipeline " Cristian Dumitrescu
2022-09-01 14:20 ` [PATCH V3 13/21] net/softnic: add pipeline table CLI commands Cristian Dumitrescu
2022-09-01 14:20 ` [PATCH V3 14/21] net/softnic: add pipeline selector " Cristian Dumitrescu
2022-09-01 14:20 ` [PATCH V3 15/21] net/softnic: add pipeline learner " Cristian Dumitrescu
2022-09-01 14:20 ` [PATCH V3 16/21] net/softnic: add pipeline commit and abort " Cristian Dumitrescu
2022-09-01 14:20 ` [PATCH V3 17/21] net/softnic: add the pipeline register read/write " Cristian Dumitrescu
2022-09-01 14:20 ` [PATCH V3 18/21] net/softnic: add the pipeline meter " Cristian Dumitrescu
2022-09-01 14:20 ` [PATCH V3 19/21] net/softnic: add pipeline statistics CLI command Cristian Dumitrescu
2022-09-01 14:20 ` [PATCH V3 20/21] net/softnic: add pipeline mirroring " Cristian Dumitrescu
2022-09-01 14:20 ` [PATCH V3 21/21] net/softnic: update the default device program Cristian Dumitrescu
2022-09-21 11:48 ` [PATCH V3 00/21] net/softnic: replace the legacy pipeline with SWX pipeline 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=20220804165839.1074817-21-cristian.dumitrescu@intel.com \
--to=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
--cc=jasvinder.singh@intel.com \
--cc=yogesh.jangra@intel.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).