DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Subject: [PATCH v2 03/13] pipeline: remove use of term abort
Date: Fri, 18 Aug 2023 10:45:27 -0700	[thread overview]
Message-ID: <20230818174537.290222-4-stephen@networkplumber.org> (raw)
In-Reply-To: <20230818174537.290222-1-stephen@networkplumber.org>

Replace with cancel.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/pipeline/cli.c    | 20 ++++++++++----------
 lib/pipeline/rte_swx_ctl.c | 29 +++++++++++++++--------------
 lib/pipeline/rte_swx_ctl.h |  8 ++++----
 lib/pipeline/version.map   |  2 +-
 4 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c
index 2ae6cc579ff2..090e5e470106 100644
--- a/examples/pipeline/cli.c
+++ b/examples/pipeline/cli.c
@@ -1778,14 +1778,14 @@ cmd_pipeline_commit(char **tokens,
 	status = rte_swx_ctl_pipeline_commit(ctl, 1);
 	if (status)
 		snprintf(out, out_size, "Commit failed. "
-			"Use \"commit\" to retry or \"abort\" to discard the pending work.\n");
+			"Use \"commit\" to retry or \"cancel\" to discard the pending work.\n");
 }
 
-static const char cmd_pipeline_abort_help[] =
-"pipeline <pipeline_name> abort\n";
+static const char cmd_pipeline_cancel_help[] =
+"pipeline <pipeline_name> cancel\n";
 
 static void
-cmd_pipeline_abort(char **tokens,
+cmd_pipeline_cancel(char **tokens,
 	uint32_t n_tokens,
 	char *out,
 	size_t out_size,
@@ -1806,7 +1806,7 @@ cmd_pipeline_abort(char **tokens,
 		return;
 	}
 
-	rte_swx_ctl_pipeline_abort(ctl);
+	rte_swx_ctl_pipeline_cancel(ctl);
 }
 
 static const char cmd_pipeline_regrd_help[] =
@@ -3474,8 +3474,8 @@ cmd_help(char **tokens,
 			"\tpipeline selector group member delete\n"
 			"\tpipeline selector show\n"
 			"\tpipeline learner default\n"
+			"\tpipeline cancel\n"
 			"\tpipeline commit\n"
-			"\tpipeline abort\n"
 			"\tpipeline regrd\n"
 			"\tpipeline regwr\n"
 			"\tpipeline meter profile add\n"
@@ -3648,9 +3648,9 @@ cmd_help(char **tokens,
 
 	if ((strcmp(tokens[0], "pipeline") == 0) &&
 		(n_tokens == 2) &&
-		(strcmp(tokens[1], "abort") == 0)) {
+		(strcmp(tokens[1], "cancel") == 0)) {
 		snprintf(out, out_size, "\n%s\n",
-			cmd_pipeline_abort_help);
+			cmd_pipeline_cancel_help);
 		return;
 	}
 
@@ -3934,8 +3934,8 @@ cli_process(char *in, char *out, size_t out_size, void *obj)
 		}
 
 		if ((n_tokens >= 3) &&
-			(strcmp(tokens[2], "abort") == 0)) {
-			cmd_pipeline_abort(tokens, n_tokens, out,
+			(strcmp(tokens[2], "cancel") == 0)) {
+			cmd_pipeline_cancel(tokens, n_tokens, out,
 				out_size, obj);
 			return;
 		}
diff --git a/lib/pipeline/rte_swx_ctl.c b/lib/pipeline/rte_swx_ctl.c
index 857770d297a4..41d07e9b3a19 100644
--- a/lib/pipeline/rte_swx_ctl.c
+++ b/lib/pipeline/rte_swx_ctl.c
@@ -2063,7 +2063,7 @@ table_rollback(struct rte_swx_ctl_pipeline *ctl, uint32_t table_id)
  * failed commit operation to remove ALL the pending work for ALL the tables.
  */
 static void
-table_abort(struct rte_swx_ctl_pipeline *ctl, uint32_t table_id)
+table_cancel(struct rte_swx_ctl_pipeline *ctl, uint32_t table_id)
 {
 	struct table *table = &ctl->tables[table_id];
 
@@ -2366,7 +2366,7 @@ selector_rollback(struct rte_swx_ctl_pipeline *ctl, uint32_t selector_id)
 }
 
 static void
-selector_abort(struct rte_swx_ctl_pipeline *ctl, uint32_t selector_id)
+selector_cancel(struct rte_swx_ctl_pipeline *ctl, uint32_t selector_id)
 {
 	struct selector *s = &ctl->selectors[selector_id];
 	uint32_t group_id;
@@ -2545,7 +2545,7 @@ learner_rollfwd_finalize(struct rte_swx_ctl_pipeline *ctl, uint32_t learner_id)
 }
 
 static void
-learner_abort(struct rte_swx_ctl_pipeline *ctl, uint32_t learner_id)
+learner_cancel(struct rte_swx_ctl_pipeline *ctl, uint32_t learner_id)
 {
 	struct learner *l = &ctl->learners[learner_id];
 
@@ -2554,7 +2554,8 @@ learner_abort(struct rte_swx_ctl_pipeline *ctl, uint32_t learner_id)
 }
 
 int
-rte_swx_ctl_pipeline_commit(struct rte_swx_ctl_pipeline *ctl, int abort_on_fail)
+rte_swx_ctl_pipeline_commit(struct rte_swx_ctl_pipeline *ctl,
+			    int cancel_on_fail)
 {
 	struct rte_swx_table_state *ts;
 	int status = 0;
@@ -2622,25 +2623,25 @@ rte_swx_ctl_pipeline_commit(struct rte_swx_ctl_pipeline *ctl, int abort_on_fail)
 rollback:
 	for (i = 0; i < ctl->info.n_tables; i++) {
 		table_rollback(ctl, i);
-		if (abort_on_fail)
-			table_abort(ctl, i);
+		if (cancel_on_fail)
+			table_cancel(ctl, i);
 	}
 
 	for (i = 0; i < ctl->info.n_selectors; i++) {
 		selector_rollback(ctl, i);
-		if (abort_on_fail)
-			selector_abort(ctl, i);
+		if (cancel_on_fail)
+			selector_cancel(ctl, i);
 	}
 
-	if (abort_on_fail)
+	if (cancel_on_fail)
 		for (i = 0; i < ctl->info.n_learners; i++)
-			learner_abort(ctl, i);
+			learner_cancel(ctl, i);
 
 	return status;
 }
 
 void
-rte_swx_ctl_pipeline_abort(struct rte_swx_ctl_pipeline *ctl)
+rte_swx_ctl_pipeline_cancel(struct rte_swx_ctl_pipeline *ctl)
 {
 	uint32_t i;
 
@@ -2648,13 +2649,13 @@ rte_swx_ctl_pipeline_abort(struct rte_swx_ctl_pipeline *ctl)
 		return;
 
 	for (i = 0; i < ctl->info.n_tables; i++)
-		table_abort(ctl, i);
+		table_cancel(ctl, i);
 
 	for (i = 0; i < ctl->info.n_selectors; i++)
-		selector_abort(ctl, i);
+		selector_cancel(ctl, i);
 
 	for (i = 0; i < ctl->info.n_learners; i++)
-		learner_abort(ctl, i);
+		learner_cancel(ctl, i);
 }
 
 static int
diff --git a/lib/pipeline/rte_swx_ctl.h b/lib/pipeline/rte_swx_ctl.h
index 6ef2551ab534..14973b74172b 100644
--- a/lib/pipeline/rte_swx_ctl.h
+++ b/lib/pipeline/rte_swx_ctl.h
@@ -1045,7 +1045,7 @@ rte_swx_ctl_pipeline_learner_default_entry_add(struct rte_swx_ctl_pipeline *ctl,
  *
  * @param[in] ctl
  *   Pipeline control handle.
- * @param[in] abort_on_fail
+ * @param[in] revert_on_fail
  *   When non-zero (false), all the scheduled work is discarded after a failed
  *   commit. Otherwise, the scheduled work is still kept pending for the next
  *   commit.
@@ -1056,10 +1056,10 @@ rte_swx_ctl_pipeline_learner_default_entry_add(struct rte_swx_ctl_pipeline *ctl,
 __rte_experimental
 int
 rte_swx_ctl_pipeline_commit(struct rte_swx_ctl_pipeline *ctl,
-			    int abort_on_fail);
+			    int revert_on_fail);
 
 /**
- * Pipeline abort
+ * Pipeline cancel
  *
  * Discard all the scheduled table work.
  *
@@ -1068,7 +1068,7 @@ rte_swx_ctl_pipeline_commit(struct rte_swx_ctl_pipeline *ctl,
  */
 __rte_experimental
 void
-rte_swx_ctl_pipeline_abort(struct rte_swx_ctl_pipeline *ctl);
+rte_swx_ctl_pipeline_cancel(struct rte_swx_ctl_pipeline *ctl);
 
 /**
  * Pipeline table entry read
diff --git a/lib/pipeline/version.map b/lib/pipeline/version.map
index 6997b69340ef..1ddd598fa079 100644
--- a/lib/pipeline/version.map
+++ b/lib/pipeline/version.map
@@ -62,7 +62,7 @@ EXPERIMENTAL {
 	# added in 20.11
 	rte_swx_ctl_action_arg_info_get;
 	rte_swx_ctl_action_info_get;
-	rte_swx_ctl_pipeline_abort;
+	rte_swx_ctl_pipeline_cancel;
 	rte_swx_ctl_pipeline_commit;
 	rte_swx_ctl_pipeline_create;
 	rte_swx_ctl_pipeline_free;
-- 
2.39.2


  parent reply	other threads:[~2023-08-18 17:47 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-18  2:52 [PATCH 00/14] " Stephen Hemminger
2023-08-18  2:52 ` [PATCH 01/14] jobstats: change jobstats_abort to jobstats_cancel Stephen Hemminger
2023-08-18  9:08   ` Bruce Richardson
2023-08-18 16:10     ` Stephen Hemminger
2023-08-18  2:52 ` [PATCH 02/14] all: remove use of word abort Stephen Hemminger
2023-08-18  4:04   ` Honnappa Nagarahalli
2023-08-18  2:52 ` [PATCH 03/14] pipeline: remove use of term abort Stephen Hemminger
2023-08-18  2:52 ` [PATCH 04/14] net/vmxnet3: replace abort() with rte_panic() Stephen Hemminger
2023-08-18  2:52 ` [PATCH 05/14] event/dlb2: remove word abort in comments Stephen Hemminger
2023-08-18  2:52 ` [PATCH 06/14] net/vdev_netvsc: replace use of term abort Stephen Hemminger
2023-08-18  2:52 ` [PATCH 07/14] net/netvsc: replace abort with cancel Stephen Hemminger
2023-08-18  2:52 ` [PATCH 08/14] net/ionic: remove word aborting Stephen Hemminger
2023-08-18  2:52 ` [PATCH 09/14] net/bnx2x: replace abort with cancel Stephen Hemminger
2023-08-18  2:52 ` [PATCH 10/14] net/mlx5: " Stephen Hemminger
2023-08-18  2:52 ` [PATCH 11/14] net/softnic: " Stephen Hemminger
2023-08-18  2:52 ` [PATCH 12/14] net/mlx4: remove word abort Stephen Hemminger
2023-08-18  2:52 ` [PATCH 13/14] sfc: remove use of term abort Stephen Hemminger
2023-08-18  2:52 ` [PATCH 14/14] net/axgbe: replace word abort Stephen Hemminger
2023-08-18 17:45 ` [PATCH v2 00/13] Replace us of term abort Stephen Hemminger
2023-08-18 17:45   ` [PATCH v2 01/13] jobstats: change jobstats_abort to jobstats_cancel Stephen Hemminger
2023-08-18 17:45   ` [PATCH v2 02/13] all: remove use of word abort Stephen Hemminger
2023-08-18 17:45   ` Stephen Hemminger [this message]
2023-08-18 17:45   ` [PATCH v2 04/13] net/vmxnet3: replace abort() with rte_panic() Stephen Hemminger
2023-08-18 17:45   ` [PATCH v2 05/13] event/dlb2: remove word abort in comments Stephen Hemminger
2023-08-18 17:45   ` [PATCH v2 06/13] net/vdev_netvsc: replace use of term abort Stephen Hemminger
2023-08-18 17:45   ` [PATCH v2 07/13] net/netvsc: replace abort with cancel Stephen Hemminger
2023-08-18 22:26     ` Long Li
2023-08-18 17:45   ` [PATCH v2 08/13] net/ionic: remove word aborting Stephen Hemminger
2023-08-18 17:45   ` [PATCH v2 09/13] net/bnx2x: replace abort with cancel Stephen Hemminger
2023-08-18 17:45   ` [PATCH v2 10/13] net/mlx5: " Stephen Hemminger
2023-08-18 17:45   ` [PATCH v2 11/13] net/softnic: " Stephen Hemminger
2023-08-18 17:45   ` [PATCH v2 12/13] net/mlx4: remove word abort Stephen Hemminger
2023-08-18 17:45   ` [PATCH v2 13/13] net/axgbe: replace " Stephen Hemminger
2023-08-30 16:49   ` [PATCH v2 00/13] Replace us of term abort Thomas Monjalon
2023-09-06 19:39     ` Stephen Hemminger
2023-09-06 21:19       ` Thomas Monjalon
2023-09-06 23:03         ` Stephen Hemminger

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=20230818174537.290222-4-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    /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).