[01/14] jobstats: change jobstats_abort to jobstats_cancel

Message ID 20230818025249.33994-2-stephen@networkplumber.org (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series remove use of term abort |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/iol-testing fail build patch failure

Commit Message

Stephen Hemminger Aug. 18, 2023, 2:52 a.m. UTC
  The term abort is on the "Replace now" list of words.
Use cancel instead.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/l2fwd-jobstats/main.c | 2 +-
 lib/jobstats/rte_jobstats.c    | 2 +-
 lib/jobstats/rte_jobstats.h    | 9 ++++++++-
 lib/jobstats/version.map       | 2 +-
 4 files changed, 11 insertions(+), 4 deletions(-)
  

Comments

Bruce Richardson Aug. 18, 2023, 9:08 a.m. UTC | #1
On Thu, Aug 17, 2023 at 07:52:36PM -0700, Stephen Hemminger wrote:
> The term abort is on the "Replace now" list of words.
> Use cancel instead.
> 
I see cancel generally being used as a replacement throughout this
patchset, but I wonder if the use of th term could be confusing as it
doesn't strictly match the term "abort" at least to my mind.

When an operation is aborted, (to me anyway) it generally means that the
operation is just stopped at whatever point it is at, and nothing more is
done. However, when an operation is cancelled, that would imply to me that
the operation is not only stopped, but whatever tasks were already done by
that operation are undone. Would others share this understanding? If so, we
should make the rollback/no-rollback behaviour clear.

/Bruce
  
Stephen Hemminger Aug. 18, 2023, 4:10 p.m. UTC | #2
On Fri, 18 Aug 2023 10:08:58 +0100
Bruce Richardson <bruce.richardson@intel.com> wrote:

> On Thu, Aug 17, 2023 at 07:52:36PM -0700, Stephen Hemminger wrote:
> > The term abort is on the "Replace now" list of words.
> > Use cancel instead.
> >   
> I see cancel generally being used as a replacement throughout this
> patchset, but I wonder if the use of th term could be confusing as it
> doesn't strictly match the term "abort" at least to my mind.
> 
> When an operation is aborted, (to me anyway) it generally means that the
> operation is just stopped at whatever point it is at, and nothing more is
> done. However, when an operation is cancelled, that would imply to me that
> the operation is not only stopped, but whatever tasks were already done by
> that operation are undone. Would others share this understanding? If so, we
> should make the rollback/no-rollback behaviour clear.
> 
> /Bruce

It seemed like the best of the alternatives proposed here: 
https://inclusivenaming.org/word-lists/tier-1/abort/

Recommended Replacements
	User-Initiated Termination
	Force quit
	Cancel
	System-Initiated Termination
	Fail
	Close (app, program, connection)
	End
	Halt
	Hard stop
	Stop (something you triggered)

I don't think the rollback semantics are implied by either word.
They should be spelled out more though.
  

Patch

diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index 2653db473538..a3b604e307e1 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -534,7 +534,7 @@  l2fwd_main_loop(void)
 			if (likely(repeats != 1))
 				rte_jobstats_finish(&qconf->idle_job, qconf->idle_job.target);
 			else
-				rte_jobstats_abort(&qconf->idle_job);
+				rte_jobstats_cancel(&qconf->idle_job);
 
 			rte_timer_manage();
 			rte_jobstats_context_finish(&qconf->jobs_context);
diff --git a/lib/jobstats/rte_jobstats.c b/lib/jobstats/rte_jobstats.c
index af565a14eaf3..d8c17f135471 100644
--- a/lib/jobstats/rte_jobstats.c
+++ b/lib/jobstats/rte_jobstats.c
@@ -139,7 +139,7 @@  rte_jobstats_start(struct rte_jobstats_context *ctx, struct rte_jobstats *job)
 }
 
 int
-rte_jobstats_abort(struct rte_jobstats *job)
+rte_jobstats_cancel(struct rte_jobstats *job)
 {
 	struct rte_jobstats_context *ctx;
 	uint64_t now, exec_time;
diff --git a/lib/jobstats/rte_jobstats.h b/lib/jobstats/rte_jobstats.h
index 45b460e6030a..89294d181592 100644
--- a/lib/jobstats/rte_jobstats.h
+++ b/lib/jobstats/rte_jobstats.h
@@ -218,7 +218,14 @@  rte_jobstats_start(struct rte_jobstats_context *ctx, struct rte_jobstats *job);
  *  -EINVAL if job is NULL or job was not started (it have no context).
  */
 int
-rte_jobstats_abort(struct rte_jobstats *job);
+rte_jobstats_cancel(struct rte_jobstats *job);
+
+__rte_deprecated
+static inline int
+rte_jobstats_abort(struct rte_jobstats *job)
+{
+	return rte_jobstats_cancel(job);
+}
 
 /**
  * Mark that *job* finished its execution. Context in which it was executing
diff --git a/lib/jobstats/version.map b/lib/jobstats/version.map
index 3b8f9d6ac464..c334033a6048 100644
--- a/lib/jobstats/version.map
+++ b/lib/jobstats/version.map
@@ -1,7 +1,7 @@ 
 DPDK_24 {
 	global:
 
-	rte_jobstats_abort;
+	rte_jobstats_cancel;
 	rte_jobstats_context_finish;
 	rte_jobstats_context_init;
 	rte_jobstats_context_reset;