Skip to contentSkip to conversation

app/test-compress-perf: report header improvement

PATCH Superseded Artur Trybula 7 participants 32 messages Jun 3, 2019 – Jul 26, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/test-compress-perf: report header improvement

This patch adds extra features to the compress performance test. Some important parameters (memory allocation, number of ops, number of segments) are calculated and printed out on the screen.

---
 app/test-compress-perf/main.c | 105 +++++++++++++++++++++++++++++++---
 1 file changed, 98 insertions(+), 7 deletions(-)
app/test-compress-perf/main.c +98 -7
index c2a45d130..d1578e435 100644
@@ -27,6 +27,18 @@ static enum cleanup_st {
 	ST_DURING_TEST
 } cleanup = ST_CLEAR;
 
+struct performance_tests_results {
+	uint16_t total_segments;
+	uint16_t segment_sz;
+	uint16_t last_segment_sz;
+	uint32_t total_buffs;	      /*number of buffers = number of ops*/
+	uint16_t segments_per_buff;
+	uint16_t segments_per_last_buff;
+	size_t input_data_sz;
+};
+
+static struct performance_tests_results tests_res;
+
 static int
 param_range_check(uint16_t size, const struct rte_param_log2_range *range)
 {
@@ -218,6 +230,13 @@ comp_perf_allocate_memory(struct comp_test_data *test_data)
 				" could not be allocated\n");
 		return -1;
 	}
+
+	tests_res.total_segments = total_segs;
+	tests_res.segment_sz = test_data->seg_sz;
+	tests_res.total_buffs = test_data->total_bufs;
+	tests_res.segments_per_buff = test_data->max_sgl_segs;
+	tests_res.input_data_sz = test_data->input_data_sz;
+
 	return 0;
 }
 
@@ -279,9 +298,11 @@ comp_perf_dump_input_data(struct comp_test_data *test_data)
 
 	if (test_data->input_data_sz > actual_file_sz)
 		RTE_LOG(INFO, USER1,
-		  "%zu bytes read from file %s, extending the file %.2f times\n",
-			test_data->input_data_sz, test_data->input_file,
-			(double)test_data->input_data_sz/actual_file_sz);
+		  "%zu bytes read from file %s, extending the file %.2f times"
+				" to %zu\n",
+			actual_file_sz, test_data->input_file,
+			(double)test_data->input_data_sz/actual_file_sz,
+			test_data->input_data_sz);
 	else
 		RTE_LOG(INFO, USER1,
 			"%zu bytes read from file %s\n",
@@ -349,9 +370,10 @@ prepare_bufs(struct comp_test_data *test_data)
 {
 	uint32_t remaining_data = test_data->input_data_sz;
 	uint8_t *input_data_ptr = test_data->input_data;
-	size_t data_sz;
+	size_t data_sz = 0;
 	uint8_t *data_addr;
 	uint32_t i, j;
+	uint16_t segs_per_mbuf = 0;
 
 	for (i = 0; i < test_data->total_bufs; i++) {
 		/* Allocate data in input mbuf and copy data from input file */
@@ -376,7 +398,7 @@ prepare_bufs(struct comp_test_data *test_data)
 		remaining_data -= data_sz;
 
 		/* Already one segment in the mbuf */
-		uint16_t segs_per_mbuf = 1;
+		segs_per_mbuf = 1;
 
 		/* Chain mbufs if needed for input mbufs */
 		while (segs_per_mbuf < test_data->max_sgl_segs
@@ -453,6 +475,9 @@ prepare_bufs(struct comp_test_data *test_data)
 		}
 	}
 
+	tests_res.segments_per_last_buff = segs_per_mbuf;
+	tests_res.last_segment_sz = data_sz;
+
 	return 0;
 }
 
@@ -467,7 +492,71 @@ free_bufs(struct comp_test_data *test_data)
 	}
 }
 
-
+static void
+print_report_header(void)
+{
+	uint32_t opt_total_segs = DIV_CEIL(tests_res.input_data_sz,
+			MAX_SEG_SIZE);
+
+	if (tests_res.total_buffs > 1) {
+		printf("\nWarning: for the current input parameters number"
+				" of ops is higher than one, which may result"
+				" in sub-optimal performance.\n");
+		printf("To improve the performance (for the current"
+				" input data) following parameters are"
+				" suggested:\n");
+		printf("	• Segment size: %d\n", MAX_SEG_SIZE);
+		printf("	• Number of segments: %u\n", opt_total_segs);
+	} else if (tests_res.total_buffs == 1) {
+		printf("\nWarning: There is only one op with %u segments –"
+				" the compression ratio is the best.\n",
+			tests_res.segments_per_last_buff);
+		if (tests_res.segment_sz < MAX_SEG_SIZE)
+			printf("To reduce compression time, please use"
+					" bigger segment size: %d.\n",
+				MAX_SEG_SIZE);
+		else if (tests_res.segment_sz == MAX_SEG_SIZE)
+			printf("Segment size is optimal for the best"
+					" performance.\n");
+	} else
+		printf("Warning: something wrong happened!!\n");
+
+	printf("\nFor the current input parameters (segment size = %u,"
+			" segments number = %u):\n",
+		tests_res.segment_sz,
+		tests_res.segments_per_buff);
+	printf("	• Total number of segments: %d\n",
+		tests_res.total_segments);
+	printf("	• %u segments %u bytes long, last segment %u"
+			" byte(s) long\n",
+		tests_res.total_segments - 1,
+		tests_res.segment_sz,
+		tests_res.last_segment_sz);
+	printf("	• Number of ops: %u\n", tests_res.total_buffs);
+	printf("	• Total memory allocation: %u\n",
+		(tests_res.total_segments - 1) * tests_res.segment_sz
+		+ tests_res.last_segment_sz);
+	if (tests_res.total_buffs > 1)
+		printf("	• %u ops: %u segments in each,"
+				" segment size %u\n",
+			tests_res.total_buffs - 1,
+			tests_res.segments_per_buff,
+			tests_res.segment_sz);
+	if (tests_res.segments_per_last_buff > 1) {
+		printf("	• 1 op %u segments:\n",
+				tests_res.segments_per_last_buff);
+		printf("		o %u segment size %u\n",
+			tests_res.segments_per_last_buff - 1,
+			tests_res.segment_sz);
+		printf("		o last segment size %u\n",
+			tests_res.last_segment_sz);
+	} else if (tests_res.segments_per_last_buff == 1) {
+		printf("	• 1 op (the last one): %u segment %u"
+				" byte(s) long\n\n",
+			tests_res.segments_per_last_buff,
+			tests_res.last_segment_sz);
+	}
+}
 
 int
 main(int argc, char **argv)
@@ -533,8 +622,9 @@ main(int argc, char **argv)
 	else
 		level = test_data->level.list[0];
 
+	print_report_header();
+
 	printf("Burst size = %u\n", test_data->burst_sz);
-	printf("File size = %zu\n", test_data->input_data_sz);
 
 	printf("%6s%12s%17s%19s%21s%15s%21s%23s%16s\n",
 		"Level", "Comp size", "Comp ratio [%]",
@@ -612,3 +702,4 @@ main(int argc, char **argv)
 	}
 	return ret;
 }
+
Signature · 1 line
2.17.1
#1 lore raw
Quoted 20 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Artur Trybula
Sent: Monday, June 3, 2019 3:54 PM
To: [email protected]; [email protected]; [email protected]; [email protected]
Subject: [dpdk-dev] [PATCH] app/test-compress-perf: report header improvement

This patch adds extra features to the compress performance test. Some important parameters (memory allocation, number of ops, number of segments) are calculated and printed out on the screen.

---
 app/test-compress-perf/main.c | 105
+++++++++++++++++++++++++++++++---
 1 file changed, 98 insertions(+), 7 deletions(-)

......

Quoted 18 lines
app/test-compress-perf/main.c +16 -1
-
+static void
+print_report_header(void)
+{
+	uint32_t opt_total_segs = DIV_CEIL(tests_res.input_data_sz,
+			MAX_SEG_SIZE);
+
+	if (tests_res.total_buffs > 1) {
+		printf("\nWarning: for the current input parameters number"
+				" of ops is higher than one, which may result"
+				" in sub-optimal performance.\n");
+		printf("To improve the performance (for the current"
+				" input data) following parameters are"
+				" suggested:\n");
+		printf("	• Segment size: %d\n", MAX_SEG_SIZE);
+		printf("	• Number of segments: %u\n", opt_total_segs);
+	} else if (tests_res.total_buffs == 1) {

app/test-compress-perf/main.c free_bufs(struct comp_test_data *test_data) · line 520

Quoted 10 lines
app/test-compress-perf/main.c +10 -0
+		printf("\nWarning: There is only one op with %u segments –"
+				" the compression ratio is the best.\n",
+			tests_res.segments_per_last_buff);
+		if (tests_res.segment_sz < MAX_SEG_SIZE)
+			printf("To reduce compression time, please use"
+					" bigger segment size: %d.\n",
+				MAX_SEG_SIZE);
+		else if (tests_res.segment_sz == MAX_SEG_SIZE)
+			printf("Segment size is optimal for the best"
+					" performance.\n");

[Shally] Why these kind of warnings? If total_bufs > 1, then, how behavior would change? Same question for segment size as well?

Quoted 43 lines
app/test-compress-perf/main.c +39 -0
+	} else
+		printf("Warning: something wrong happened!!\n");
+
+	printf("\nFor the current input parameters (segment size = %u,"
+			" segments number = %u):\n",
+		tests_res.segment_sz,
+		tests_res.segments_per_buff);
+	printf("	• Total number of segments: %d\n",
+		tests_res.total_segments);
+	printf("	• %u segments %u bytes long, last segment %u"
+			" byte(s) long\n",
+		tests_res.total_segments - 1,
+		tests_res.segment_sz,
+		tests_res.last_segment_sz);
+	printf("	• Number of ops: %u\n", tests_res.total_buffs);
+	printf("	• Total memory allocation: %u\n",
+		(tests_res.total_segments - 1) * tests_res.segment_sz
+		+ tests_res.last_segment_sz);
+	if (tests_res.total_buffs > 1)
+		printf("	• %u ops: %u segments in each,"
+				" segment size %u\n",
+			tests_res.total_buffs - 1,
+			tests_res.segments_per_buff,
+			tests_res.segment_sz);
+	if (tests_res.segments_per_last_buff > 1) {
+		printf("	• 1 op %u segments:\n",
+				tests_res.segments_per_last_buff);
+		printf("		o %u segment size %u\n",
+			tests_res.segments_per_last_buff - 1,
+			tests_res.segment_sz);
+		printf("		o last segment size %u\n",
+			tests_res.last_segment_sz);
+	} else if (tests_res.segments_per_last_buff == 1) {
+		printf("	• 1 op (the last one): %u segment %u"
+				" byte(s) long\n\n",
+			tests_res.segments_per_last_buff,
+			tests_res.last_segment_sz);
+	}
+}
 
 int
 main(int argc, char **argv)

app/test-compress-perf/main.c main(int argc, char **argv) · line 626

Quoted 5 lines
app/test-compress-perf/main.c +2 -0
@@ -533,8 +622,9 @@ main(int argc, char **argv)
 	else
 		level = test_data->level.list[0];
 
+	print_report_header();
+

[Shally] looks like we're printing input characteristics and possible performance behavior. Is that the intention of this API?

Quoted 12 lines
app/test-compress-perf/main.c +0 -1
 	printf("Burst size = %u\n", test_data->burst_sz);
-	printf("File size = %zu\n", test_data->input_data_sz);
 
 	printf("%6s%12s%17s%19s%21s%15s%21s%23s%16s\n",
 		"Level", "Comp size", "Comp ratio [%]", @@ -612,3 +702,4

@@ main(int argc, char **argv)

app/test-compress-perf/main.c +1 -1
 	}
 	return ret;
 }
+
--

2.17.1

#2 lore raw

-----Original Message-----
From: Shally Verma [mailto:[email protected]]
Sent: Wednesday, June 26, 2019 19:04
To: Trybula, ArturX <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; Dybkowski, AdamX <[email protected]>
Subject: RE: [dpdk-dev] [PATCH] app/test-compress-perf: report header improvement

Quoted 18 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Artur Trybula
Sent: Monday, June 3, 2019 3:54 PM
To: [email protected]; [email protected]; [email protected]; [email protected]
Subject: [dpdk-dev] [PATCH] app/test-compress-perf: report header improvement

This patch adds extra features to the compress performance test. Some important parameters (memory allocation, number of ops, number of segments) are calculated and printed out on the screen.

---
 app/test-compress-perf/main.c | 105
+++++++++++++++++++++++++++++++---
 1 file changed, 98 insertions(+), 7 deletions(-)

......

Quoted 18 lines
app/test-compress-perf/main.c +16 -1
-
+static void
+print_report_header(void)
+{
+	uint32_t opt_total_segs = DIV_CEIL(tests_res.input_data_sz,
+			MAX_SEG_SIZE);
+
+	if (tests_res.total_buffs > 1) {
+		printf("\nWarning: for the current input parameters number"
+				" of ops is higher than one, which may result"
+				" in sub-optimal performance.\n");
+		printf("To improve the performance (for the current"
+				" input data) following parameters are"
+				" suggested:\n");
+		printf("	• Segment size: %d\n", MAX_SEG_SIZE);
+		printf("	• Number of segments: %u\n", opt_total_segs);
+	} else if (tests_res.total_buffs == 1) {

app/test-compress-perf/main.c free_bufs(struct comp_test_data *test_data) · line 520

Quoted 10 lines
app/test-compress-perf/main.c +10 -0
+		printf("\nWarning: There is only one op with %u segments –"
+				" the compression ratio is the best.\n",
+			tests_res.segments_per_last_buff);
+		if (tests_res.segment_sz < MAX_SEG_SIZE)
+			printf("To reduce compression time, please use"
+					" bigger segment size: %d.\n",
+				MAX_SEG_SIZE);
+		else if (tests_res.segment_sz == MAX_SEG_SIZE)
+			printf("Segment size is optimal for the best"
+					" performance.\n");

[Shally] Why these kind of warnings? If total_bufs > 1, then, how behavior would change? Same question for segment size as well?
[Artur] I suppose you mean the second one "Warning: There is only one ...". It's just to preserve the structure of the report for both variants. But I agree, there is nothing wrong if there is only one op. Please notice that each op is processed independently, in most cases it implies lower compression ratio. The best situation is to have all the input data aggregated into one op (even if partitioned across many mbufs).

Quoted 43 lines
app/test-compress-perf/main.c +39 -0
+	} else
+		printf("Warning: something wrong happened!!\n");
+
+	printf("\nFor the current input parameters (segment size = %u,"
+			" segments number = %u):\n",
+		tests_res.segment_sz,
+		tests_res.segments_per_buff);
+	printf("	• Total number of segments: %d\n",
+		tests_res.total_segments);
+	printf("	• %u segments %u bytes long, last segment %u"
+			" byte(s) long\n",
+		tests_res.total_segments - 1,
+		tests_res.segment_sz,
+		tests_res.last_segment_sz);
+	printf("	• Number of ops: %u\n", tests_res.total_buffs);
+	printf("	• Total memory allocation: %u\n",
+		(tests_res.total_segments - 1) * tests_res.segment_sz
+		+ tests_res.last_segment_sz);
+	if (tests_res.total_buffs > 1)
+		printf("	• %u ops: %u segments in each,"
+				" segment size %u\n",
+			tests_res.total_buffs - 1,
+			tests_res.segments_per_buff,
+			tests_res.segment_sz);
+	if (tests_res.segments_per_last_buff > 1) {
+		printf("	• 1 op %u segments:\n",
+				tests_res.segments_per_last_buff);
+		printf("		o %u segment size %u\n",
+			tests_res.segments_per_last_buff - 1,
+			tests_res.segment_sz);
+		printf("		o last segment size %u\n",
+			tests_res.last_segment_sz);
+	} else if (tests_res.segments_per_last_buff == 1) {
+		printf("	• 1 op (the last one): %u segment %u"
+				" byte(s) long\n\n",
+			tests_res.segments_per_last_buff,
+			tests_res.last_segment_sz);
+	}
+}
 
 int
 main(int argc, char **argv)

app/test-compress-perf/main.c main(int argc, char **argv) · line 626

Quoted 5 lines
app/test-compress-perf/main.c +2 -0
@@ -533,8 +622,9 @@ main(int argc, char **argv)
 	else
 		level = test_data->level.list[0];
 
+	print_report_header();
+

[Shally] looks like we're printing input characteristics and possible performance behavior. Is that the intention of this API?
[Artur] That was the idea to have a tool for verification how the data partitioning affects the compression performance. Your description Shally is very accurate: "... printing input characteristics and possible performance behavior" and that is the intention of this API.

Quoted 12 lines
app/test-compress-perf/main.c +0 -1
 	printf("Burst size = %u\n", test_data->burst_sz);
-	printf("File size = %zu\n", test_data->input_data_sz);
 
 	printf("%6s%12s%17s%19s%21s%15s%21s%23s%16s\n",
 		"Level", "Comp size", "Comp ratio [%]", @@ -612,3 +702,4 @@ 

main(int argc, char **argv)

app/test-compress-perf/main.c +1 -1
 	}
 	return ret;
 }
+
--

2.17.1

#3 lore raw
Quoted 75 lines

-----Original Message-----
From: Trybula, ArturX <[email protected]>
Sent: Thursday, June 27, 2019 2:29 PM
To: Shally Verma <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; Dybkowski, AdamX <[email protected]>
Subject: [EXT] RE: [dpdk-dev] [PATCH] app/test-compress-perf: report header improvement

External Email

----------------------------------------------------------------------

-----Original Message-----
From: Shally Verma [mailto:[email protected]]
Sent: Wednesday, June 26, 2019 19:04
To: Trybula, ArturX <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; Dybkowski, AdamX <[email protected]>
Subject: RE: [dpdk-dev] [PATCH] app/test-compress-perf: report header improvement

Quoted 18 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Artur Trybula
Sent: Monday, June 3, 2019 3:54 PM
To: [email protected]; [email protected]; [email protected]; [email protected]
Subject: [dpdk-dev] [PATCH] app/test-compress-perf: report header improvement

This patch adds extra features to the compress performance test. Some important parameters (memory allocation, number of ops, number of segments) are calculated and printed out on the screen.

---
 app/test-compress-perf/main.c | 105
+++++++++++++++++++++++++++++++---
 1 file changed, 98 insertions(+), 7 deletions(-)

......

Quoted 18 lines
app/test-compress-perf/main.c +16 -1
-
+static void
+print_report_header(void)
+{
+	uint32_t opt_total_segs = DIV_CEIL(tests_res.input_data_sz,
+			MAX_SEG_SIZE);
+
+	if (tests_res.total_buffs > 1) {
+		printf("\nWarning: for the current input parameters number"
+				" of ops is higher than one, which may result"
+				" in sub-optimal performance.\n");
+		printf("To improve the performance (for the current"
+				" input data) following parameters are"
+				" suggested:\n");
+		printf("	• Segment size: %d\n", MAX_SEG_SIZE);
+		printf("	• Number of segments: %u\n", opt_total_segs);
+	} else if (tests_res.total_buffs == 1) {

app/test-compress-perf/main.c free_bufs(struct comp_test_data *test_data) · line 520

Quoted 10 lines
app/test-compress-perf/main.c +10 -0
+		printf("\nWarning: There is only one op with %u segments –"
+				" the compression ratio is the best.\n",
+			tests_res.segments_per_last_buff);
+		if (tests_res.segment_sz < MAX_SEG_SIZE)
+			printf("To reduce compression time, please use"
+					" bigger segment size: %d.\n",
+				MAX_SEG_SIZE);
+		else if (tests_res.segment_sz == MAX_SEG_SIZE)
+			printf("Segment size is optimal for the best"
+					" performance.\n");
Quoted 9 lines

[Shally] Why these kind of warnings? If total_bufs > 1, then, how behavior would change? Same question for segment size as well?
[Artur] I suppose you mean the second one "Warning: There is only one ...". It's just to preserve the structure of the report for both variants. But I agree, there is nothing wrong if there is only one op.
Please notice that each op is processed independently, in most cases it implies lower compression ratio. The best situation is to have all the input data aggregated into one op (even if partitioned across many mbufs).

[Shally] Then can we better covert this in terms of "stateless" and "stateful" . Example,
Say it like:
Since test app support stateless mode only, thus if input data is segmented across multiple buffers (i.e. op) Then each will be processed independently (i.e. in stateless mode) . Thus to gain better results, it might be more useful to put all data in one buffer.

Quoted 46 lines
Quoted 46 lines
app/test-compress-perf/main.c +39 -0
+	} else
+		printf("Warning: something wrong happened!!\n");
+
+	printf("\nFor the current input parameters (segment size = %u,"
+			" segments number = %u):\n",
+		tests_res.segment_sz,
+		tests_res.segments_per_buff);
+	printf("	• Total number of segments: %d\n",
+		tests_res.total_segments);
+	printf("	• %u segments %u bytes long, last segment %u"
+			" byte(s) long\n",
+		tests_res.total_segments - 1,
+		tests_res.segment_sz,
+		tests_res.last_segment_sz);
+	printf("	• Number of ops: %u\n", tests_res.total_buffs);
+	printf("	• Total memory allocation: %u\n",
+		(tests_res.total_segments - 1) * tests_res.segment_sz
+		+ tests_res.last_segment_sz);
+	if (tests_res.total_buffs > 1)
+		printf("	• %u ops: %u segments in each,"
+				" segment size %u\n",
+			tests_res.total_buffs - 1,
+			tests_res.segments_per_buff,
+			tests_res.segment_sz);
+	if (tests_res.segments_per_last_buff > 1) {
+		printf("	• 1 op %u segments:\n",
+				tests_res.segments_per_last_buff);
+		printf("		o %u segment size %u\n",
+			tests_res.segments_per_last_buff - 1,
+			tests_res.segment_sz);
+		printf("		o last segment size %u\n",
+			tests_res.last_segment_sz);
+	} else if (tests_res.segments_per_last_buff == 1) {
+		printf("	• 1 op (the last one): %u segment %u"
+				" byte(s) long\n\n",
+			tests_res.segments_per_last_buff,
+			tests_res.last_segment_sz);
+	}
+}
 
 int
 main(int argc, char **argv)
@@ -533,8 +622,9 @@ main(int argc, char **argv)
 	else
 		level = test_data->level.list[0];
 
Quoted 8 lines

app/test-compress-perf/main.c main(int argc, char **argv) · line 626

Quoted 2 lines
app/test-compress-perf/main.c +2 -0
+	print_report_header();
+

[Shally] looks like we're printing input characteristics and possible performance behavior. Is that the intention of this API?
[Artur] That was the idea to have a tool for verification how the data partitioning affects the compression performance. Your description Shally is very accurate: "... printing input characteristics and possible performance behavior" and that is the intention of this API.

[Shally] Then probably we can add this in function description.

Quoted 15 lines

app/test-compress-perf/main.c main(int argc, char **argv)

Quoted 7 lines
app/test-compress-perf/main.c +0 -1
 	printf("Burst size = %u\n", test_data->burst_sz);
-	printf("File size = %zu\n", test_data->input_data_sz);
 
 	printf("%6s%12s%17s%19s%21s%15s%21s%23s%16s\n",
 		"Level", "Comp size", "Comp ratio [%]", @@ -612,3 +702,4

@@

Quoted 7 lines

main(int argc, char **argv)

app/test-compress-perf/main.c +1 -1
 	}
 	return ret;
 }
+
--

2.17.1

#4 lore raw

-----Original Message-----
From: Shally Verma [mailto:[email protected]]
Sent: Thursday, June 27, 2019 13:01
To: Trybula, ArturX <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; Dybkowski, AdamX <[email protected]>
Subject: RE: [dpdk-dev] [PATCH] app/test-compress-perf: report header improvement

Quoted 73 lines

-----Original Message-----
From: Trybula, ArturX <[email protected]>
Sent: Thursday, June 27, 2019 2:29 PM
To: Shally Verma <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; Dybkowski, AdamX <[email protected]>
Subject: [EXT] RE: [dpdk-dev] [PATCH] app/test-compress-perf: report header improvement

External Email

----------------------------------------------------------------------

-----Original Message-----
From: Shally Verma [mailto:[email protected]]
Sent: Wednesday, June 26, 2019 19:04
To: Trybula, ArturX <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; Dybkowski, AdamX <[email protected]>
Subject: RE: [dpdk-dev] [PATCH] app/test-compress-perf: report header improvement

Quoted 19 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Artur Trybula
Sent: Monday, June 3, 2019 3:54 PM
To: [email protected]; [email protected]; [email protected]; [email protected]
Subject: [dpdk-dev] [PATCH] app/test-compress-perf: report header improvement

This patch adds extra features to the compress performance test. Some important parameters (memory allocation, number of ops, number of
segments) are calculated and printed out on the screen.

---
 app/test-compress-perf/main.c | 105
+++++++++++++++++++++++++++++++---
 1 file changed, 98 insertions(+), 7 deletions(-)

......

Quoted 18 lines
app/test-compress-perf/main.c +16 -1
-
+static void
+print_report_header(void)
+{
+	uint32_t opt_total_segs = DIV_CEIL(tests_res.input_data_sz,
+			MAX_SEG_SIZE);
+
+	if (tests_res.total_buffs > 1) {
+		printf("\nWarning: for the current input parameters number"
+				" of ops is higher than one, which may result"
+				" in sub-optimal performance.\n");
+		printf("To improve the performance (for the current"
+				" input data) following parameters are"
+				" suggested:\n");
+		printf("	• Segment size: %d\n", MAX_SEG_SIZE);
+		printf("	• Number of segments: %u\n", opt_total_segs);
+	} else if (tests_res.total_buffs == 1) {

app/test-compress-perf/main.c free_bufs(struct comp_test_data *test_data) · line 520

Quoted 10 lines
app/test-compress-perf/main.c +10 -0
+		printf("\nWarning: There is only one op with %u segments –"
+				" the compression ratio is the best.\n",
+			tests_res.segments_per_last_buff);
+		if (tests_res.segment_sz < MAX_SEG_SIZE)
+			printf("To reduce compression time, please use"
+					" bigger segment size: %d.\n",
+				MAX_SEG_SIZE);
+		else if (tests_res.segment_sz == MAX_SEG_SIZE)
+			printf("Segment size is optimal for the best"
+					" performance.\n");
Quoted 9 lines

[Shally] Why these kind of warnings? If total_bufs > 1, then, how behavior would change? Same question for segment size as well? [Artur] I suppose you mean the second one "Warning: There is only one ...". It's just to preserve the structure of the report for both variants. But I agree, there is nothing wrong if there is only one op. Please notice that each op is processed independently, in most cases it implies lower compression ratio. The best situation is to have all the input data aggregated into one op (even if partitioned across many mbufs).

[Shally] Then can we better covert this in terms of "stateless" and "stateful" . Example, Say it like:
Since test app support stateless mode only, thus if input data is segmented across multiple buffers (i.e. op) Then each will be processed independently (i.e. in stateless mode) . Thus to gain better results, it might be more useful to put all data in one buffer.
[Artur] We started from an idea of simple checking memory allocation. From my point of view we should avoid making it too complex unless there is a clear need. This is a "simple tool" for quick verification what is the effect of the input parameters. It's for developers familiar with the compression. I agree with you that in case of supporting both stateless and stateful compression such information should be printed out.

Quoted 46 lines
Quoted 46 lines
app/test-compress-perf/main.c +39 -0
+	} else
+		printf("Warning: something wrong happened!!\n");
+
+	printf("\nFor the current input parameters (segment size = %u,"
+			" segments number = %u):\n",
+		tests_res.segment_sz,
+		tests_res.segments_per_buff);
+	printf("	• Total number of segments: %d\n",
+		tests_res.total_segments);
+	printf("	• %u segments %u bytes long, last segment %u"
+			" byte(s) long\n",
+		tests_res.total_segments - 1,
+		tests_res.segment_sz,
+		tests_res.last_segment_sz);
+	printf("	• Number of ops: %u\n", tests_res.total_buffs);
+	printf("	• Total memory allocation: %u\n",
+		(tests_res.total_segments - 1) * tests_res.segment_sz
+		+ tests_res.last_segment_sz);
+	if (tests_res.total_buffs > 1)
+		printf("	• %u ops: %u segments in each,"
+				" segment size %u\n",
+			tests_res.total_buffs - 1,
+			tests_res.segments_per_buff,
+			tests_res.segment_sz);
+	if (tests_res.segments_per_last_buff > 1) {
+		printf("	• 1 op %u segments:\n",
+				tests_res.segments_per_last_buff);
+		printf("		o %u segment size %u\n",
+			tests_res.segments_per_last_buff - 1,
+			tests_res.segment_sz);
+		printf("		o last segment size %u\n",
+			tests_res.last_segment_sz);
+	} else if (tests_res.segments_per_last_buff == 1) {
+		printf("	• 1 op (the last one): %u segment %u"
+				" byte(s) long\n\n",
+			tests_res.segments_per_last_buff,
+			tests_res.last_segment_sz);
+	}
+}
 
 int
 main(int argc, char **argv)
@@ -533,8 +622,9 @@ main(int argc, char **argv)
 	else
 		level = test_data->level.list[0];
 
Quoted 8 lines

app/test-compress-perf/main.c main(int argc, char **argv) · line 626

Quoted 2 lines
app/test-compress-perf/main.c +2 -0
+	print_report_header();
+

[Shally] looks like we're printing input characteristics and possible performance behavior. Is that the intention of this API? [Artur] That was the idea to have a tool for verification how the data partitioning affects the compression performance. Your description Shally is very accurate: "... printing input characteristics and possible performance behavior" and that is the intention of this API.

[Shally] Then probably we can add this in function description.
[Artur] To be precise it is not a typical API function. It's an internal (static) function of the perf test.

Quoted 15 lines

app/test-compress-perf/main.c main(int argc, char **argv)

Quoted 7 lines
app/test-compress-perf/main.c +0 -1
 	printf("Burst size = %u\n", test_data->burst_sz);
-	printf("File size = %zu\n", test_data->input_data_sz);
 
 	printf("%6s%12s%17s%19s%21s%15s%21s%23s%16s\n",
 		"Level", "Comp size", "Comp ratio [%]", @@ -612,3 +702,4

@@

Quoted 7 lines

main(int argc, char **argv)

app/test-compress-perf/main.c +1 -1
 	}
 	return ret;
 }
+
--

2.17.1

#5 lore raw
Quoted 112 lines

-----Original Message-----
From: Trybula, ArturX <[email protected]>
Sent: Thursday, June 27, 2019 5:17 PM
To: Shally Verma <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; Dybkowski, AdamX <[email protected]>
Subject: [EXT] RE: [dpdk-dev] [PATCH] app/test-compress-perf: report header improvement

External Email

----------------------------------------------------------------------

-----Original Message-----
From: Shally Verma [mailto:[email protected]]
Sent: Thursday, June 27, 2019 13:01
To: Trybula, ArturX <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; Dybkowski, AdamX <[email protected]>
Subject: RE: [dpdk-dev] [PATCH] app/test-compress-perf: report header improvement

Quoted 5 lines

-----Original Message-----
From: Trybula, ArturX <[email protected]>
Sent: Thursday, June 27, 2019 2:29 PM
To: Shally Verma <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; Dybkowski, AdamX

<[email protected]>

Quoted 63 lines

Subject: [EXT] RE: [dpdk-dev] [PATCH] app/test-compress-perf: report header improvement

External Email

----------------------------------------------------------------------

-----Original Message-----
From: Shally Verma [mailto:[email protected]]
Sent: Wednesday, June 26, 2019 19:04
To: Trybula, ArturX <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; Dybkowski, AdamX <[email protected]>
Subject: RE: [dpdk-dev] [PATCH] app/test-compress-perf: report header improvement

Quoted 19 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Artur Trybula
Sent: Monday, June 3, 2019 3:54 PM
To: [email protected]; [email protected]; [email protected]; [email protected]
Subject: [dpdk-dev] [PATCH] app/test-compress-perf: report header improvement

This patch adds extra features to the compress performance test. Some important parameters (memory allocation, number of ops, number of
segments) are calculated and printed out on the screen.

---
 app/test-compress-perf/main.c | 105
+++++++++++++++++++++++++++++++---
 1 file changed, 98 insertions(+), 7 deletions(-)

......

Quoted 24 lines
app/test-compress-perf/main.c +22 -1
-
+static void
+print_report_header(void)
+{
+	uint32_t opt_total_segs = DIV_CEIL(tests_res.input_data_sz,
+			MAX_SEG_SIZE);
+
+	if (tests_res.total_buffs > 1) {
+		printf("\nWarning: for the current input parameters number"
+				" of ops is higher than one, which may result"
+				" in sub-optimal performance.\n");
+		printf("To improve the performance (for the current"
+				" input data) following parameters are"
+				" suggested:\n");
+		printf("	• Segment size: %d\n", MAX_SEG_SIZE);
+		printf("	• Number of segments: %u\n", opt_total_segs);
+	} else if (tests_res.total_buffs == 1) {
+		printf("\nWarning: There is only one op with %u segments –"
+				" the compression ratio is the best.\n",
+			tests_res.segments_per_last_buff);
+		if (tests_res.segment_sz < MAX_SEG_SIZE)
+			printf("To reduce compression time, please use"
+					" bigger segment size: %d.\n",
Quoted 8 lines

app/test-compress-perf/main.c free_bufs(struct comp_test_data *test_data) · line 520

Quoted 4 lines
app/test-compress-perf/main.c +4 -0
+				MAX_SEG_SIZE);
+		else if (tests_res.segment_sz == MAX_SEG_SIZE)
+			printf("Segment size is optimal for the best"
+					" performance.\n");

[Shally] Why these kind of warnings? If total_bufs > 1, then, how behavior would change? Same question for segment size as well? [Artur] I suppose you mean the second one "Warning: There is only one

...".

Quoted 5 lines

It's just to preserve the structure of the report for both variants. But I agree, there is nothing wrong if there is only one op. Please notice that each op is processed independently, in most cases it implies lower compression ratio. The best situation is to have all the input data aggregated into one op (even if partitioned across many

mbufs).

Quoted 1 line
Quoted 13 lines

[Shally] Then can we better covert this in terms of "stateless" and "stateful" . Example, Say it like:
Since test app support stateless mode only, thus if input data is segmented across multiple buffers (i.e. op) Then each will be processed independently (i.e. in stateless mode) . Thus to gain better results, it might be more useful to put all data in one buffer.
[Artur] We started from an idea of simple checking memory allocation. From my point of view we should avoid making it too complex unless there is a clear need. This is a "simple tool" for quick verification what is the effect of the input parameters. It's for developers familiar with the compression. I agree with you that in case of supporting both stateless and stateful compression such information should be printed out.

[Shally] Okay. I leave it to your comfort. But could you confirm if I understood it correct? I mean keep num_bufs = 1, will result in better history thus better compression.

Quoted 55 lines
Quoted 47 lines
Quoted 47 lines
app/test-compress-perf/main.c +39 -0
+	} else
+		printf("Warning: something wrong happened!!\n");
+
+	printf("\nFor the current input parameters (segment size = %u,"
+			" segments number = %u):\n",
+		tests_res.segment_sz,
+		tests_res.segments_per_buff);
+	printf("	• Total number of segments: %d\n",
+		tests_res.total_segments);
+	printf("	• %u segments %u bytes long, last segment %u"
+			" byte(s) long\n",
+		tests_res.total_segments - 1,
+		tests_res.segment_sz,
+		tests_res.last_segment_sz);
+	printf("	• Number of ops: %u\n", tests_res.total_buffs);
+	printf("	• Total memory allocation: %u\n",
+		(tests_res.total_segments - 1) * tests_res.segment_sz
+		+ tests_res.last_segment_sz);
+	if (tests_res.total_buffs > 1)
+		printf("	• %u ops: %u segments in each,"
+				" segment size %u\n",
+			tests_res.total_buffs - 1,
+			tests_res.segments_per_buff,
+			tests_res.segment_sz);
+	if (tests_res.segments_per_last_buff > 1) {
+		printf("	• 1 op %u segments:\n",
+				tests_res.segments_per_last_buff);
+		printf("		o %u segment size %u\n",
+			tests_res.segments_per_last_buff - 1,
+			tests_res.segment_sz);
+		printf("		o last segment size %u\n",
+			tests_res.last_segment_sz);
+	} else if (tests_res.segments_per_last_buff == 1) {
+		printf("	• 1 op (the last one): %u segment %u"
+				" byte(s) long\n\n",
+			tests_res.segments_per_last_buff,
+			tests_res.last_segment_sz);
+	}
+}
 
 int
 main(int argc, char **argv)
@@ -533,8 +622,9 @@ main(int argc, char **argv)
 	else
 		level = test_data->level.list[0];
 
Quoted 8 lines

app/test-compress-perf/main.c main(int argc, char **argv) · line 626

Quoted 2 lines
app/test-compress-perf/main.c +2 -0
+	print_report_header();
+

[Shally] looks like we're printing input characteristics and possible performance behavior. Is that the intention of this API? [Artur] That was the idea to have a tool for verification how the data partitioning affects the compression performance. Your description Shally is very accurate: "... printing input characteristics and possible performance behavior" and that is the intention of this API.

Quoted 3 lines

[Shally] Then probably we can add this in function description. [Artur] To be precise it is not a typical API function. It's an internal (static) function of the perf test.

[Shally] Oh ya. Then can we change name .. print_report_header() sounds like printing report on test results but here intent is different. Something like print_test_dynamics() seem more applicable?

Quoted 15 lines
Quoted 15 lines

app/test-compress-perf/main.c main(int argc, char **argv)

Quoted 7 lines
app/test-compress-perf/main.c +0 -1
 	printf("Burst size = %u\n", test_data->burst_sz);
-	printf("File size = %zu\n", test_data->input_data_sz);
 
 	printf("%6s%12s%17s%19s%21s%15s%21s%23s%16s\n",
 		"Level", "Comp size", "Comp ratio [%]", @@ -612,3 +702,4

@@

Quoted 7 lines

main(int argc, char **argv)

app/test-compress-perf/main.c +1 -1
 	}
 	return ret;
 }
+
--

2.17.1

#6 lore raw

-----Original Message-----
From: Shally Verma [mailto:[email protected]]
Sent: Thursday, June 27, 2019 16:39
To: Trybula, ArturX <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; Dybkowski, AdamX <[email protected]>
Subject: RE: [dpdk-dev] [PATCH] app/test-compress-perf: report header improvement

Quoted 112 lines

-----Original Message-----
From: Trybula, ArturX <[email protected]>
Sent: Thursday, June 27, 2019 5:17 PM
To: Shally Verma <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; Dybkowski, AdamX <[email protected]>
Subject: [EXT] RE: [dpdk-dev] [PATCH] app/test-compress-perf: report header improvement

External Email

----------------------------------------------------------------------

-----Original Message-----
From: Shally Verma [mailto:[email protected]]
Sent: Thursday, June 27, 2019 13:01
To: Trybula, ArturX <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; Dybkowski, AdamX <[email protected]>
Subject: RE: [dpdk-dev] [PATCH] app/test-compress-perf: report header improvement

Quoted 5 lines

-----Original Message-----
From: Trybula, ArturX <[email protected]>
Sent: Thursday, June 27, 2019 2:29 PM
To: Shally Verma <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; Dybkowski, AdamX

<[email protected]>

Quoted 65 lines

Subject: [EXT] RE: [dpdk-dev] [PATCH] app/test-compress-perf: report header improvement

External Email

--------------------------------------------------------------------
--

-----Original Message-----
From: Shally Verma [mailto:[email protected]]
Sent: Wednesday, June 26, 2019 19:04
To: Trybula, ArturX <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; Dybkowski, AdamX <[email protected]>
Subject: RE: [dpdk-dev] [PATCH] app/test-compress-perf: report header improvement

Quoted 19 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Artur Trybula
Sent: Monday, June 3, 2019 3:54 PM
To: [email protected]; [email protected]; [email protected]; [email protected]
Subject: [dpdk-dev] [PATCH] app/test-compress-perf: report header improvement

This patch adds extra features to the compress performance test. Some important parameters (memory allocation, number of ops, number of
segments) are calculated and printed out on the screen.

---
 app/test-compress-perf/main.c | 105
+++++++++++++++++++++++++++++++---
 1 file changed, 98 insertions(+), 7 deletions(-)

......

Quoted 25 lines
app/test-compress-perf/main.c +23 -1
-
+static void
+print_report_header(void)
+{
+	uint32_t opt_total_segs = DIV_CEIL(tests_res.input_data_sz,
+			MAX_SEG_SIZE);
+
+	if (tests_res.total_buffs > 1) {
+		printf("\nWarning: for the current input parameters number"
+				" of ops is higher than one, which may result"
+				" in sub-optimal performance.\n");
+		printf("To improve the performance (for the current"
+				" input data) following parameters are"
+				" suggested:\n");
+		printf("	• Segment size: %d\n", MAX_SEG_SIZE);
+		printf("	• Number of segments: %u\n", opt_total_segs);
+	} else if (tests_res.total_buffs == 1) {
+		printf("\nWarning: There is only one op with %u segments –"
+				" the compression ratio is the best.\n",
+			tests_res.segments_per_last_buff);
+		if (tests_res.segment_sz < MAX_SEG_SIZE)
+			printf("To reduce compression time, please use"
+					" bigger segment size: %d.\n",
+				MAX_SEG_SIZE);
Quoted 8 lines

app/test-compress-perf/main.c free_bufs(struct comp_test_data *test_data) · line 520

Quoted 3 lines
app/test-compress-perf/main.c +3 -0
+		else if (tests_res.segment_sz == MAX_SEG_SIZE)
+			printf("Segment size is optimal for the best"
+					" performance.\n");

[Shally] Why these kind of warnings? If total_bufs > 1, then, how behavior would change? Same question for segment size as well? [Artur] I suppose you mean the second one "Warning: There is only one

...".

Quoted 6 lines

It's just to preserve the structure of the report for both variants. But I agree, there is nothing wrong if there is only one op. Please notice that each op is processed independently, in most cases it implies lower compression ratio. The best situation is to have all the input data aggregated into one op (even if partitioned across many

mbufs).

Quoted 1 line
Quoted 13 lines

[Shally] Then can we better covert this in terms of "stateless" and "stateful" . Example, Say it like:
Since test app support stateless mode only, thus if input data is
segmented across multiple buffers (i.e. op) Then each will be
processed independently (i.e. in stateless mode) . Thus to gain better results, it might be more useful to put all data in one buffer.
[Artur] We started from an idea of simple checking memory allocation.
From my point of view we should avoid making it too complex unless
there is a clear need. This is a "simple tool" for quick verification
what is the effect of the input parameters. It's for developers
familiar with the compression. I agree with you that in case of
supporting both stateless and stateful compression such information should be printed out.

[Shally] Okay. I leave it to your comfort. But could you confirm if I understood it correct?
I mean keep num_bufs = 1, will result in better history thus better compression.
[Artur] Only stateless compression is implemented. That’s why there is a difference when data is segmented over many ops (num_mufs > 1). In case of stateful compression history really helps to improve the compression ratio.

Quoted 55 lines
Quoted 47 lines
Quoted 47 lines
app/test-compress-perf/main.c +39 -0
+	} else
+		printf("Warning: something wrong happened!!\n");
+
+	printf("\nFor the current input parameters (segment size = %u,"
+			" segments number = %u):\n",
+		tests_res.segment_sz,
+		tests_res.segments_per_buff);
+	printf("	• Total number of segments: %d\n",
+		tests_res.total_segments);
+	printf("	• %u segments %u bytes long, last segment %u"
+			" byte(s) long\n",
+		tests_res.total_segments - 1,
+		tests_res.segment_sz,
+		tests_res.last_segment_sz);
+	printf("	• Number of ops: %u\n", tests_res.total_buffs);
+	printf("	• Total memory allocation: %u\n",
+		(tests_res.total_segments - 1) * tests_res.segment_sz
+		+ tests_res.last_segment_sz);
+	if (tests_res.total_buffs > 1)
+		printf("	• %u ops: %u segments in each,"
+				" segment size %u\n",
+			tests_res.total_buffs - 1,
+			tests_res.segments_per_buff,
+			tests_res.segment_sz);
+	if (tests_res.segments_per_last_buff > 1) {
+		printf("	• 1 op %u segments:\n",
+				tests_res.segments_per_last_buff);
+		printf("		o %u segment size %u\n",
+			tests_res.segments_per_last_buff - 1,
+			tests_res.segment_sz);
+		printf("		o last segment size %u\n",
+			tests_res.last_segment_sz);
+	} else if (tests_res.segments_per_last_buff == 1) {
+		printf("	• 1 op (the last one): %u segment %u"
+				" byte(s) long\n\n",
+			tests_res.segments_per_last_buff,
+			tests_res.last_segment_sz);
+	}
+}
 
 int
 main(int argc, char **argv)
@@ -533,8 +622,9 @@ main(int argc, char **argv)
 	else
 		level = test_data->level.list[0];
 
Quoted 8 lines

app/test-compress-perf/main.c main(int argc, char **argv) · line 626

Quoted 2 lines
app/test-compress-perf/main.c +2 -0
+	print_report_header();
+

[Shally] looks like we're printing input characteristics and
possible performance behavior. Is that the intention of this API?
[Artur] That was the idea to have a tool for verification how the
data partitioning affects the compression performance. Your
description Shally is very accurate: "... printing input
characteristics and possible performance behavior" and that is the intention of this API.

Quoted 3 lines

[Shally] Then probably we can add this in function description. [Artur] To be precise it is not a typical API function. It's an internal (static) function of the perf test.

[Shally] Oh ya. Then can we change name .. print_report_header() sounds like printing report on test results but here intent is different. Something like print_test_dynamics() seem more applicable? [Artur] Both names are ok for me. Depends on your point of view. Ok, I will change it for you.

Quoted 15 lines
Quoted 15 lines

app/test-compress-perf/main.c main(int argc, char **argv)

Quoted 7 lines
app/test-compress-perf/main.c +0 -1
 	printf("Burst size = %u\n", test_data->burst_sz);
-	printf("File size = %zu\n", test_data->input_data_sz);
 
 	printf("%6s%12s%17s%19s%21s%15s%21s%23s%16s\n",
 		"Level", "Comp size", "Comp ratio [%]", @@ -612,3 +702,4

@@

Quoted 7 lines

main(int argc, char **argv)

app/test-compress-perf/main.c +1 -1
 	}
 	return ret;
 }
+
--

2.17.1

#7 lore raw

v2 cover add extra features to test-compress-perf

In reply to Artur Trybula

v2 changes:

- merged with the series "add multiple cores feature to test-compress-perf"
- function renamed: print_report_header() -> print_test_dynamics()

This patch depends on the series "add multiple cores feature to test-compress-perf"
https://patches.dpdk.org/cover/56024/

---

Artur Trybula (1):
app/test-compress-perf: report header improvement

 .../comp_perf_test_common.c                   | 94 ++++++++++++++++++-
 .../comp_perf_test_common.h                   |  3 +
 app/test-compress-perf/main.c                 |  4 +-
 3 files changed, 98 insertions(+), 3 deletions(-)
Signature · 1 line
2.17.1
#8 lore raw

PATCH v2 1/1 app/test-compress-perf: report header improvement

This patch adds extra features to the compress performance test. Some important parameters (memory allocation, number of ops, number of segments) are calculated and printed out on the screen.

---
 .../comp_perf_test_common.c                   | 94 ++++++++++++++++++-
 .../comp_perf_test_common.h                   |  3 +
 app/test-compress-perf/main.c                 |  4 +-
 3 files changed, 98 insertions(+), 3 deletions(-)
app/test-compress-perf/comp_perf_test_common.c +92 -2
index dc9d0b0f4..dc3eaccac 100644
@@ -15,6 +15,19 @@
 
 #define DIV_CEIL(a, b)  ((a) / (b) + ((a) % (b) != 0))
 
+struct performance_tests_results {
+	uint16_t total_segments;
+	uint16_t segment_sz;
+	uint16_t last_segment_sz;
+	uint32_t total_buffs;	      /*number of buffers = number of ops*/
+	uint16_t segments_per_buff;
+	uint16_t segments_per_last_buff;
+	size_t input_data_sz;
+};
+
+static struct performance_tests_results tests_res;
+//extern static struct performance_tests_results tests_res;
+
 int
 param_range_check(uint16_t size, const struct rte_param_log2_range *range)
 {
@@ -169,6 +182,13 @@ comp_perf_allocate_memory(struct comp_test_data *test_data,
 				" could not be allocated\n");
 		return -1;
 	}
+
+	tests_res.total_segments = total_segs;
+	tests_res.segment_sz = test_data->seg_sz;
+	tests_res.total_buffs = mem->total_bufs;
+	tests_res.segments_per_buff = test_data->max_sgl_segs;
+	tests_res.input_data_sz = test_data->input_data_sz;
+
 	return 0;
 }
 
@@ -177,9 +197,10 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 {
 	uint32_t remaining_data = test_data->input_data_sz;
 	uint8_t *input_data_ptr = test_data->input_data;
-	size_t data_sz;
+	size_t data_sz = 0;
 	uint8_t *data_addr;
 	uint32_t i, j;
+	uint16_t segs_per_mbuf = 0;
 
 	for (i = 0; i < mem->total_bufs; i++) {
 		/* Allocate data in input mbuf and copy data from input file */
@@ -203,7 +224,7 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 		remaining_data -= data_sz;
 
 		/* Already one segment in the mbuf */
-		uint16_t segs_per_mbuf = 1;
+		segs_per_mbuf = 1;
 
 		/* Chain mbufs if needed for input mbufs */
 		while (segs_per_mbuf < test_data->max_sgl_segs
@@ -280,5 +301,74 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 		}
 	}
 
+	tests_res.segments_per_last_buff = segs_per_mbuf;
+	tests_res.last_segment_sz = data_sz;
+
 	return 0;
 }
+
+void
+print_test_dynamics(void)
+{
+	uint32_t opt_total_segs = DIV_CEIL(tests_res.input_data_sz,
+			MAX_SEG_SIZE);
+
+	if (tests_res.total_buffs > 1) {
+		printf("\nWarning: for the current input parameters number"
+				" of ops is higher than one, which may result"
+				" in sub-optimal performance.\n");
+		printf("To improve the performance (for the current"
+				" input data) following parameters are"
+				" suggested:\n");
+		printf("	• Segment size: %d\n", MAX_SEG_SIZE);
+		printf("	• Number of segments: %u\n", opt_total_segs);
+	} else if (tests_res.total_buffs == 1) {
+		printf("\nWarning: There is only one op with %u segments –"
+				" the compression ratio is the best.\n",
+			tests_res.segments_per_last_buff);
+		if (tests_res.segment_sz < MAX_SEG_SIZE)
+			printf("To reduce compression time, please use"
+					" bigger segment size: %d.\n",
+				MAX_SEG_SIZE);
+		else if (tests_res.segment_sz == MAX_SEG_SIZE)
+			printf("Segment size is optimal for the best"
+					" performance.\n");
+	} else
+		printf("Warning: something wrong happened!!\n");
+
+	printf("\nFor the current input parameters (segment size = %u,"
+			" segments number = %u):\n",
+		tests_res.segment_sz,
+		tests_res.segments_per_buff);
+	printf("	• Total number of segments: %d\n",
+		tests_res.total_segments);
+	printf("	• %u segments %u bytes long, last segment %u"
+			" byte(s) long\n",
+		tests_res.total_segments - 1,
+		tests_res.segment_sz,
+		tests_res.last_segment_sz);
+	printf("	• Number of ops: %u\n", tests_res.total_buffs);
+	printf("	• Total memory allocation: %u\n",
+		(tests_res.total_segments - 1) * tests_res.segment_sz
+		+ tests_res.last_segment_sz);
+	if (tests_res.total_buffs > 1)
+		printf("	• %u ops: %u segments in each,"
+				" segment size %u\n",
+			tests_res.total_buffs - 1,
+			tests_res.segments_per_buff,
+			tests_res.segment_sz);
+	if (tests_res.segments_per_last_buff > 1) {
+		printf("	• 1 op %u segments:\n",
+				tests_res.segments_per_last_buff);
+		printf("		o %u segment size %u\n",
+			tests_res.segments_per_last_buff - 1,
+			tests_res.segment_sz);
+		printf("		o last segment size %u\n",
+			tests_res.last_segment_sz);
+	} else if (tests_res.segments_per_last_buff == 1) {
+		printf("	• 1 op (the last one): %u segment %u"
+				" byte(s) long\n\n",
+			tests_res.segments_per_last_buff,
+			tests_res.last_segment_sz);
+	}
+}
app/test-compress-perf/comp_perf_test_common.h +3 -0
index 9c11e3a00..c72f3ef3c 100644
@@ -38,4 +38,7 @@ comp_perf_allocate_memory(struct comp_test_data *test_data,
 int
 prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem);
 
+void
+print_test_dynamics(void);
+
 #endif /* _COMP_PERF_TEST_COMMON_H_ */
app/test-compress-perf/main.c +3 -1
index e746e4708..76961bffb 100644
@@ -363,7 +363,7 @@ main(int argc, char **argv)
 
 	printf("App uses socket: %u\n", rte_socket_id());
 	printf("Burst size = %u\n", test_data->burst_sz);
-	printf("File size = %zu\n", test_data->input_data_sz);
+	printf("Input data size = %zu\n", test_data->input_data_sz);
 
 	test_data->cleanup = ST_DURING_TEST;
 	total_nb_qps = nb_compressdevs * test_data->nb_qps;
@@ -390,6 +390,8 @@ main(int argc, char **argv)
 		i++;
 	}
 
+	print_test_dynamics();
+
 	while (test_data->level <= test_data->level_lst.max) {
 
 		i = 0;
Signature · 1 line
2.17.1
#9 lore raw
Quoted 32 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Artur Trybula
Sent: Friday, July 5, 2019 12:00 PM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [dpdk-dev] [PATCH v2 1/1] app/test-compress-perf: report header improvement

This patch adds extra features to the compress performance test. Some important parameters (memory allocation, number of ops, number of segments) are calculated and printed out on the screen.

---
 .../comp_perf_test_common.c                   | 94 ++++++++++++++++++-
 .../comp_perf_test_common.h                   |  3 +
 app/test-compress-perf/main.c                 |  4 +-
 3 files changed, 98 insertions(+), 3 deletions(-)
app/test- renamed from app/test-compress-perf/comp_perf_test_common.c +0 -0

compress-perf/comp_perf_test_common.c
index dc9d0b0f4..dc3eaccac 100644

app/test-compress-perf/comp_perf_test_common.c +1 -0
@@ -15,6 +15,19 @@
 
 #define DIV_CEIL(a, b)  ((a) / (b) + ((a) % (b) != 0))
 
+struct performance_tests_results {

app/test-compress-perf/comp_perf_test_common.c line 28

Quoted 10 lines
app/test-compress-perf/comp_perf_test_common.c +10 -0
+	uint16_t total_segments;
+	uint16_t segment_sz;
+	uint16_t last_segment_sz;
+	uint32_t total_buffs;	      /*number of buffers = number of ops*/
+	uint16_t segments_per_buff;
+	uint16_t segments_per_last_buff;
+	size_t input_data_sz;
+};
+
+static struct performance_tests_results tests_res; //extern static

Spotted C++ style commented unused code.

Quoted 1 line
app/test-compress-perf/comp_perf_test_common.c +1 -0
+struct performance_tests_results tests_res;
#10 lore raw

v3 cover add extra features to test-compress-perf

In reply to Artur Trybula

v2 changes:

- merged with the series "add multiple cores feature to test-compress-perf"
- function renamed: print_report_header() -> print_test_dynamics()

v3 changes:

- commented code removed

This patch depends on the series "add multiple cores feature to test-compress-perf"
https://patches.dpdk.org/cover/56024/

---

Artur Trybula (1):
app/test-compress-perf: report header improvement

 .../comp_perf_test_common.c                   | 93 ++++++++++++++++++-
 .../comp_perf_test_common.h                   |  3 +
 app/test-compress-perf/main.c                 |  4 +-
 3 files changed, 97 insertions(+), 3 deletions(-)
Signature · 1 line
2.17.1
#11 lore raw

PATCH v3 1/1 app/test-compress-perf: report header improvement

This patch adds extra features to the compress performance test. Some important parameters (memory allocation, number of ops, number of segments) are calculated and printed out on the screen.

---
 .../comp_perf_test_common.c                   | 93 ++++++++++++++++++-
 .../comp_perf_test_common.h                   |  3 +
 app/test-compress-perf/main.c                 |  4 +-
 3 files changed, 97 insertions(+), 3 deletions(-)
app/test-compress-perf/comp_perf_test_common.c +91 -2
index dc9d0b0f4..7c5f36939 100644
@@ -15,6 +15,18 @@
 
 #define DIV_CEIL(a, b)  ((a) / (b) + ((a) % (b) != 0))
 
+struct performance_tests_results {
+	uint16_t total_segments;
+	uint16_t segment_sz;
+	uint16_t last_segment_sz;
+	uint32_t total_buffs;	      /*number of buffers = number of ops*/
+	uint16_t segments_per_buff;
+	uint16_t segments_per_last_buff;
+	size_t input_data_sz;
+};
+
+static struct performance_tests_results tests_res;
+
 int
 param_range_check(uint16_t size, const struct rte_param_log2_range *range)
 {
@@ -169,6 +181,13 @@ comp_perf_allocate_memory(struct comp_test_data *test_data,
 				" could not be allocated\n");
 		return -1;
 	}
+
+	tests_res.total_segments = total_segs;
+	tests_res.segment_sz = test_data->seg_sz;
+	tests_res.total_buffs = mem->total_bufs;
+	tests_res.segments_per_buff = test_data->max_sgl_segs;
+	tests_res.input_data_sz = test_data->input_data_sz;
+
 	return 0;
 }
 
@@ -177,9 +196,10 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 {
 	uint32_t remaining_data = test_data->input_data_sz;
 	uint8_t *input_data_ptr = test_data->input_data;
-	size_t data_sz;
+	size_t data_sz = 0;
 	uint8_t *data_addr;
 	uint32_t i, j;
+	uint16_t segs_per_mbuf = 0;
 
 	for (i = 0; i < mem->total_bufs; i++) {
 		/* Allocate data in input mbuf and copy data from input file */
@@ -203,7 +223,7 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 		remaining_data -= data_sz;
 
 		/* Already one segment in the mbuf */
-		uint16_t segs_per_mbuf = 1;
+		segs_per_mbuf = 1;
 
 		/* Chain mbufs if needed for input mbufs */
 		while (segs_per_mbuf < test_data->max_sgl_segs
@@ -280,5 +300,74 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 		}
 	}
 
+	tests_res.segments_per_last_buff = segs_per_mbuf;
+	tests_res.last_segment_sz = data_sz;
+
 	return 0;
 }
+
+void
+print_test_dynamics(void)
+{
+	uint32_t opt_total_segs = DIV_CEIL(tests_res.input_data_sz,
+			MAX_SEG_SIZE);
+
+	if (tests_res.total_buffs > 1) {
+		printf("\nWarning: for the current input parameters number"
+				" of ops is higher than one, which may result"
+				" in sub-optimal performance.\n");
+		printf("To improve the performance (for the current"
+				" input data) following parameters are"
+				" suggested:\n");
+		printf("	• Segment size: %d\n", MAX_SEG_SIZE);
+		printf("	• Number of segments: %u\n", opt_total_segs);
+	} else if (tests_res.total_buffs == 1) {
+		printf("\nWarning: There is only one op with %u segments –"
+				" the compression ratio is the best.\n",
+			tests_res.segments_per_last_buff);
+		if (tests_res.segment_sz < MAX_SEG_SIZE)
+			printf("To reduce compression time, please use"
+					" bigger segment size: %d.\n",
+				MAX_SEG_SIZE);
+		else if (tests_res.segment_sz == MAX_SEG_SIZE)
+			printf("Segment size is optimal for the best"
+					" performance.\n");
+	} else
+		printf("Warning: something wrong happened!!\n");
+
+	printf("\nFor the current input parameters (segment size = %u,"
+			" segments number = %u):\n",
+		tests_res.segment_sz,
+		tests_res.segments_per_buff);
+	printf("	• Total number of segments: %d\n",
+		tests_res.total_segments);
+	printf("	• %u segments %u bytes long, last segment %u"
+			" byte(s) long\n",
+		tests_res.total_segments - 1,
+		tests_res.segment_sz,
+		tests_res.last_segment_sz);
+	printf("	• Number of ops: %u\n", tests_res.total_buffs);
+	printf("	• Total memory allocation: %u\n",
+		(tests_res.total_segments - 1) * tests_res.segment_sz
+		+ tests_res.last_segment_sz);
+	if (tests_res.total_buffs > 1)
+		printf("	• %u ops: %u segments in each,"
+				" segment size %u\n",
+			tests_res.total_buffs - 1,
+			tests_res.segments_per_buff,
+			tests_res.segment_sz);
+	if (tests_res.segments_per_last_buff > 1) {
+		printf("	• 1 op %u segments:\n",
+				tests_res.segments_per_last_buff);
+		printf("		o %u segment size %u\n",
+			tests_res.segments_per_last_buff - 1,
+			tests_res.segment_sz);
+		printf("		o last segment size %u\n",
+			tests_res.last_segment_sz);
+	} else if (tests_res.segments_per_last_buff == 1) {
+		printf("	• 1 op (the last one): %u segment %u"
+				" byte(s) long\n\n",
+			tests_res.segments_per_last_buff,
+			tests_res.last_segment_sz);
+	}
+}
app/test-compress-perf/comp_perf_test_common.h +3 -0
index 9c11e3a00..c72f3ef3c 100644
@@ -38,4 +38,7 @@ comp_perf_allocate_memory(struct comp_test_data *test_data,
 int
 prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem);
 
+void
+print_test_dynamics(void);
+
 #endif /* _COMP_PERF_TEST_COMMON_H_ */
app/test-compress-perf/main.c +3 -1
index e746e4708..76961bffb 100644
@@ -363,7 +363,7 @@ main(int argc, char **argv)
 
 	printf("App uses socket: %u\n", rte_socket_id());
 	printf("Burst size = %u\n", test_data->burst_sz);
-	printf("File size = %zu\n", test_data->input_data_sz);
+	printf("Input data size = %zu\n", test_data->input_data_sz);
 
 	test_data->cleanup = ST_DURING_TEST;
 	total_nb_qps = nb_compressdevs * test_data->nb_qps;
@@ -390,6 +390,8 @@ main(int argc, char **argv)
 		i++;
 	}
 
+	print_test_dynamics();
+
 	while (test_data->level <= test_data->level_lst.max) {
 
 		i = 0;
Signature · 1 line
2.17.1
#12 lore raw

v4 cover add extra features to test-compress-perf

In reply to Artur Trybula

v4 changes:
- information about compression threads printed on screen

v3 changes:
- commented code removed

v2 changes:
- merged with the series "add multiple cores feature to test-compress-perf"
- function renamed: print_report_header() -> print_test_dynamics()

This patch depends on the series "add multiple cores feature to test-compress-perf"
https://patches.dpdk.org/cover/56236/

Artur Trybula (1):
app/test-compress-perf: report header improvement

 .../comp_perf_test_benchmark.c                | 21 ++++-
 .../comp_perf_test_common.c                   | 94 ++++++++++++++++++-
 .../comp_perf_test_common.h                   |  6 ++
 app/test-compress-perf/main.c                 |  4 +-
 4 files changed, 120 insertions(+), 5 deletions(-)
Signature · 1 line
2.17.1
#13 lore raw

PATCH v4 1/1 app/test-compress-perf: report header improvement

This patch adds extra features to the compress performance test. Some important parameters (memory allocation, number of ops, number of segments) are calculated and printed out on the screen.
Information about compression threads is also provided.

---
 .../comp_perf_test_benchmark.c                | 21 ++++-
 .../comp_perf_test_common.c                   | 94 ++++++++++++++++++-
 .../comp_perf_test_common.h                   |  6 ++
 app/test-compress-perf/main.c                 |  4 +-
 4 files changed, 120 insertions(+), 5 deletions(-)
app/test-compress-perf/comp_perf_test_benchmark.c +19 -2
index aa1f8eea2..887459449 100644
@@ -329,9 +329,26 @@ cperf_benchmark_test_runner(void *test_ctx)
 	struct comp_test_data *test_data = ctx->ver.options;
 	uint32_t lcore = rte_lcore_id();
 	static rte_atomic16_t display_once = RTE_ATOMIC16_INIT(0);
+	int i, ret = EXIT_SUCCESS;
 
 	ctx->ver.mem.lcore_id = lcore;
-	int i, ret = EXIT_SUCCESS;
+
+	/*
+	 * printing information about current compression thread
+	 */
+	if (rte_atomic16_test_and_set(&ctx->ver.mem.print_info_once))
+		printf("    lcore: %u,"
+				" driver name: %s,"
+				" device name: %s,"
+				" device id: %u,"
+				" socket id: %u,"
+				" queue pair id: %u\n",
+			lcore,
+			ctx->ver.options->driver_name,
+			rte_compressdev_name_get(ctx->ver.mem.dev_id),
+			ctx->ver.mem.dev_id,
+			rte_compressdev_socket_id(ctx->ver.mem.dev_id),
+			ctx->ver.mem.qp_id);
 
 	/*
 	 * First the verification part is needed
@@ -374,7 +391,7 @@ cperf_benchmark_test_runner(void *test_ctx)
 			1000000000;
 
 	if (rte_atomic16_test_and_set(&display_once)) {
-		printf("%12s%6s%12s%17s%15s%16s\n",
+		printf("\n%12s%6s%12s%17s%15s%16s\n",
 			"lcore id", "Level", "Comp size", "Comp ratio [%]",
 			"Comp [Gbps]", "Decomp [Gbps]");
 	}
app/test-compress-perf/comp_perf_test_common.c +92 -2

125 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_common.h +6 -0
index 9c11e3a00..c9e0c9081 100644
@@ -13,6 +13,9 @@ struct cperf_mem_resources {
 	uint8_t dev_id;
 	uint16_t qp_id;
 	uint8_t lcore_id;
+
+	rte_atomic16_t print_info_once;
+
 	uint32_t total_bufs;
 	uint8_t *compressed_data;
 	uint8_t *decompressed_data;
@@ -38,4 +41,7 @@ comp_perf_allocate_memory(struct comp_test_data *test_data,
 int
 prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem);
 
+void
+print_test_dynamics(void);
+
 #endif /* _COMP_PERF_TEST_COMMON_H_ */
app/test-compress-perf/main.c +3 -1
index e746e4708..e7ac412e6 100644
@@ -363,7 +363,7 @@ main(int argc, char **argv)
 
 	printf("App uses socket: %u\n", rte_socket_id());
 	printf("Burst size = %u\n", test_data->burst_sz);
-	printf("File size = %zu\n", test_data->input_data_sz);
+	printf("Input data size = %zu\n", test_data->input_data_sz);
 
 	test_data->cleanup = ST_DURING_TEST;
 	total_nb_qps = nb_compressdevs * test_data->nb_qps;
@@ -390,6 +390,8 @@ main(int argc, char **argv)
 		i++;
 	}
 
+	print_test_dynamics(); /* constructors must be executed first */
+
 	while (test_data->level <= test_data->level_lst.max) {
 
 		i = 0;
Signature · 1 line
2.17.1
#14 lore raw
Quoted 35 lines

-----Original Message-----
From: Artur Trybula <[email protected]>
Sent: Friday, July 12, 2019 4:13 PM
To: [email protected]; [email protected]; Shally Verma <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: [EXT] [PATCH v4 1/1] app/test-compress-perf: report header improvement

External Email

----------------------------------------------------------------------
This patch adds extra features to the compress performance test. Some important parameters (memory allocation, number of ops, number of segments) are calculated and printed out on the screen. Information about compression threads is also provided.

---
 .../comp_perf_test_benchmark.c                | 21 ++++-
 .../comp_perf_test_common.c                   | 94 ++++++++++++++++++-
 .../comp_perf_test_common.h                   |  6 ++
 app/test-compress-perf/main.c                 |  4 +-
 4 files changed, 120 insertions(+), 5 deletions(-)
app/test-compress-perf/comp_perf_test_benchmark.c +0 -0
index aa1f8eea2..887459449 100644
@@ -329,9 +329,26 @@ cperf_benchmark_test_runner(void *test_ctx)
 	struct comp_test_data *test_data = ctx->ver.options;
 	uint32_t lcore = rte_lcore_id();

app/test-compress-perf/comp_perf_test_benchmark.c cperf_benchmark_test_runner(void *test_ctx) · line 339

Quoted 10 lines
app/test-compress-perf/comp_perf_test_benchmark.c +6 -1
 	static rte_atomic16_t display_once = RTE_ATOMIC16_INIT(0);
+	int i, ret = EXIT_SUCCESS;
 
 	ctx->ver.mem.lcore_id = lcore;
-	int i, ret = EXIT_SUCCESS;
+
+	/*
+	 * printing information about current compression thread
+	 */
+	if (rte_atomic16_test_and_set(&ctx->ver.mem.print_info_once))

Question: runner() will be executed by each core so is ctx is thread local variable or global.? If it can be made thread local, then there would be no need of atomic here?

Quoted 32 lines
app/test-compress-perf/comp_perf_test_benchmark.c +12 -0
+		printf("    lcore: %u,"
+				" driver name: %s,"
+				" device name: %s,"
+				" device id: %u,"
+				" socket id: %u,"
+				" queue pair id: %u\n",
+			lcore,
+			ctx->ver.options->driver_name,
+			rte_compressdev_name_get(ctx->ver.mem.dev_id),
+			ctx->ver.mem.dev_id,
+			rte_compressdev_socket_id(ctx->ver.mem.dev_id),
+			ctx->ver.mem.qp_id);
 
 	/*
 	 * First the verification part is needed @@ -374,7 +391,7 @@

cperf_benchmark_test_runner(void *test_ctx)

app/test-compress-perf/comp_perf_test_benchmark.c +1 -1
 			1000000000;
 
 	if (rte_atomic16_test_and_set(&display_once)) {
-		printf("%12s%6s%12s%17s%15s%16s\n",
+		printf("\n%12s%6s%12s%17s%15s%16s\n",
 			"lcore id", "Level", "Comp size", "Comp ratio [%]",
 			"Comp [Gbps]", "Decomp [Gbps]");
 	}
app/test- renamed from app/test-compress-perf/comp_perf_test_common.c +0 -0

compress-perf/comp_perf_test_common.c
index 472c76686..3dc9349b0 100644

app/test-compress-perf/comp_perf_test_common.c +0 -0
@@ -16,6 +16,18 @@
 
 #define DIV_CEIL(a, b)  ((a) / (b) + ((a) % (b) != 0))

app/test-compress-perf/comp_perf_test_common.c line 27

Quoted 10 lines
app/test-compress-perf/comp_perf_test_common.c +9 -0
 
+struct performance_tests_results {
+	uint16_t total_segments;
+	uint16_t segment_sz;
+	uint16_t last_segment_sz;
+	uint32_t total_buffs;	      /*number of buffers = number of ops*/
+	uint16_t segments_per_buff;
+	uint16_t segments_per_last_buff;
+	size_t input_data_sz;
+};

These looks more like test configuration than result. If you agree, then can rename it to test_config ..

Quoted 21 lines
app/test-compress-perf/comp_perf_test_common.c +3 -0
+
+static struct performance_tests_results tests_res;
+
 int
 param_range_check(uint16_t size, const struct rte_param_log2_range
 *range)  { @@ -170,6 +182,13 @@ comp_perf_allocate_memory(struct

comp_test_data *test_data,

app/test-compress-perf/comp_perf_test_common.c +7 -0
 				" could not be allocated\n");
 		return -1;
 	}
+
+	tests_res.total_segments = total_segs;
+	tests_res.segment_sz = test_data->seg_sz;
+	tests_res.total_buffs = mem->total_bufs;
+	tests_res.segments_per_buff = test_data->max_sgl_segs;
+	tests_res.input_data_sz = test_data->input_data_sz;
+
 	return 0;
 }

app/test-compress-perf/comp_perf_test_common.c prepare_bufs(struct comp_test_data *test_data, · line 204

Quoted 9 lines
app/test-compress-perf/comp_perf_test_common.c +2 -1
@@ -178,9 +197,10 @@ prepare_bufs(struct comp_test_data *test_data,
 struct cperf_mem_resources *mem)  {
 	uint32_t remaining_data = test_data->input_data_sz;
 	uint8_t *input_data_ptr = test_data->input_data;
-	size_t data_sz;
+	size_t data_sz = 0;
 	uint8_t *data_addr;
 	uint32_t i, j;
+	uint16_t segs_per_mbuf = 0;
 

Minimum segment per mbuf is 1. Then why don’t we initialize it to 1 here?

Quoted 21 lines
app/test-compress-perf/comp_perf_test_common.c +0 -0
 	for (i = 0; i < mem->total_bufs; i++) {
 		/* Allocate data in input mbuf and copy data from input file

*/ @@ -204,7 +224,7 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)

app/test-compress-perf/comp_perf_test_common.c +1 -1
 		remaining_data -= data_sz;
 
 		/* Already one segment in the mbuf */
-		uint16_t segs_per_mbuf = 1;
+		segs_per_mbuf = 1;
 
 		/* Chain mbufs if needed for input mbufs */
 		while (segs_per_mbuf < test_data->max_sgl_segs @@ -

281,5 +301,75 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)

app/test-compress-perf/comp_perf_test_common.c +3 -0
 		}
 	}
 
+	tests_res.segments_per_last_buff = segs_per_mbuf;
+	tests_res.last_segment_sz = data_sz;
+
 	return 0;

app/test-compress-perf/comp_perf_test_common.c prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem) · line 317

Quoted 10 lines
app/test-compress-perf/comp_perf_test_common.c +9 -0
 }
+
+void
+print_test_dynamics(void)
+{
+	uint32_t opt_total_segs = DIV_CEIL(tests_res.input_data_sz,
+			MAX_SEG_SIZE);
+
+	if (tests_res.total_buffs > 1) {
+		printf("\nWarning: for the current input parameters number"

A comma after 'input parameters' would improve readability here

app/test-compress-perf/comp_perf_test_common.c prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem) · line 326

Quoted 9 lines
app/test-compress-perf/comp_perf_test_common.c +9 -0
+				" of ops is higher than one, which may result"
+				" in sub-optimal performance.\n");
+		printf("To improve the performance (for the current"
+				" input data) following parameters are"
+				" suggested:\n");
+		printf("	• Segment size: %d\n", MAX_SEG_SIZE);
+		printf("	• Number of segments: %u\n", opt_total_segs);
+	} else if (tests_res.total_buffs == 1) {
+		printf("\nWarning: there is only one op with %u segments –"

May "Warning:" be replaced with "Info: " here.

Quoted 37 lines
app/test-compress-perf/comp_perf_test_common.c +37 -0
+				" the compression ratio is the best.\n",
+			tests_res.segments_per_last_buff);
+		if (tests_res.segment_sz < MAX_SEG_SIZE)
+			printf("To reduce compression time, please use"
+					" bigger segment size: %d.\n",
+				MAX_SEG_SIZE);
+		else if (tests_res.segment_sz == MAX_SEG_SIZE)
+			printf("Segment size is optimal for the best"
+					" performance.\n");
+	} else
+		printf("Warning: something wrong happened!!\n");
+
+	printf("\nFor the current input parameters (segment size = %u,"
+			" segments number = %u):\n",
+		tests_res.segment_sz,
+		tests_res.segments_per_buff);
+	printf("	• Total number of buffers: %d\n",
+		tests_res.total_segments);
+	printf("	• %u buffer(s) %u bytes long, last buffer %u"
+			" byte(s) long\n",
+		tests_res.total_segments - 1,
+		tests_res.segment_sz,
+		tests_res.last_segment_sz);
+	printf("	• Number of ops: %u\n", tests_res.total_buffs);
+	printf("	• Total memory allocation: %u\n",
+		(tests_res.total_segments - 1) * tests_res.segment_sz
+		+ tests_res.last_segment_sz);
+	if (tests_res.total_buffs > 1)
+		printf("	• %u ops: %u segment(s) in each,"
+				" segment size %u\n",
+			tests_res.total_buffs - 1,
+			tests_res.segments_per_buff,
+			tests_res.segment_sz);
+	if (tests_res.segments_per_last_buff > 1) {
+		printf("	• 1 op %u segments:\n",
+				tests_res.segments_per_last_buff);
+		printf("		o %u segment size %u\n",

app/test-compress-perf/comp_perf_test_common.c prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem) · line 373

Quoted 10 lines
app/test-compress-perf/comp_perf_test_common.c +10 -0
+			tests_res.segments_per_last_buff - 1,
+			tests_res.segment_sz);
+		printf("		o last segment size %u\n",
+			tests_res.last_segment_sz);
+	} else if (tests_res.segments_per_last_buff == 1) {
+		printf("	• 1 op (the last one): %u segment %u"
+				" byte(s) long\n\n",
+			tests_res.segments_per_last_buff,
+			tests_res.last_segment_sz);
+	}

Probably this if and else if here can be replaced by just 1 statement.

Quoted 50 lines
app/test-compress-perf/comp_perf_test_common.c +2 -0
+	printf("\n");
+}
app/test- renamed from app/test-compress-perf/comp_perf_test_common.h +0 -0

compress-perf/comp_perf_test_common.h
index 9c11e3a00..c9e0c9081 100644

app/test-compress-perf/comp_perf_test_common.h +6 -0
@@ -13,6 +13,9 @@ struct cperf_mem_resources {
 	uint8_t dev_id;
 	uint16_t qp_id;
 	uint8_t lcore_id;
+
+	rte_atomic16_t print_info_once;
+
 	uint32_t total_bufs;
 	uint8_t *compressed_data;
 	uint8_t *decompressed_data;
@@ -38,4 +41,7 @@ comp_perf_allocate_memory(struct comp_test_data
 *test_data,  int  prepare_bufs(struct comp_test_data *test_data, struct
 
 cperf_mem_resources *mem);
 
+void
+print_test_dynamics(void);
+

#endif /* _COMP_PERF_TEST_COMMON_H_ */

app/test-compress-perf/main.c +4 -2
index e746e4708..e7ac412e6 100644
@@ -363,7 +363,7 @@ main(int argc, char **argv)
 
 	printf("App uses socket: %u\n", rte_socket_id());
 	printf("Burst size = %u\n", test_data->burst_sz);
-	printf("File size = %zu\n", test_data->input_data_sz);
+	printf("Input data size = %zu\n", test_data->input_data_sz);
 
 	test_data->cleanup = ST_DURING_TEST;
 	total_nb_qps = nb_compressdevs * test_data->nb_qps; @@ -390,6
+390,8 @@ main(int argc, char **argv)
 		i++;
 	}
 
+	print_test_dynamics(); /* constructors must be executed first */
+
 	while (test_data->level <= test_data->level_lst.max) {
 
 		i = 0;
--

2.17.1

#15 lore raw

-----Original Message-----
From: Shally Verma [mailto:[email protected]]
Sent: Monday, July 15, 2019 14:47
To: Trybula, ArturX <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; Dybkowski, AdamX <[email protected]>; [email protected]
Subject: RE: [EXT] [PATCH v4 1/1] app/test-compress-perf: report header improvement

Quoted 33 lines

-----Original Message-----
From: Artur Trybula <[email protected]>
Sent: Friday, July 12, 2019 4:13 PM
To: [email protected]; [email protected]; Shally Verma <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: [EXT] [PATCH v4 1/1] app/test-compress-perf: report header improvement

External Email

----------------------------------------------------------------------
This patch adds extra features to the compress performance test. Some important parameters (memory allocation, number of ops, number of segments) are calculated and printed out on the screen. Information about compression threads is also provided.

---
 .../comp_perf_test_benchmark.c                | 21 ++++-
 .../comp_perf_test_common.c                   | 94 ++++++++++++++++++-
 .../comp_perf_test_common.h                   |  6 ++
 app/test-compress-perf/main.c                 |  4 +-
 4 files changed, 120 insertions(+), 5 deletions(-)
app/test-compress-perf/comp_perf_test_benchmark.c +0 -0
index aa1f8eea2..887459449 100644
@@ -329,9 +329,26 @@ cperf_benchmark_test_runner(void *test_ctx)
 	struct comp_test_data *test_data = ctx->ver.options;
 	uint32_t lcore = rte_lcore_id();

app/test-compress-perf/comp_perf_test_benchmark.c cperf_benchmark_test_runner(void *test_ctx) · line 339

Quoted 10 lines
app/test-compress-perf/comp_perf_test_benchmark.c +6 -1
 	static rte_atomic16_t display_once = RTE_ATOMIC16_INIT(0);
+	int i, ret = EXIT_SUCCESS;
 
 	ctx->ver.mem.lcore_id = lcore;
-	int i, ret = EXIT_SUCCESS;
+
+	/*
+	 * printing information about current compression thread
+	 */
+	if (rte_atomic16_test_and_set(&ctx->ver.mem.print_info_once))

Question: runner() will be executed by each core so is ctx is thread local variable or global.? If it can be made thread local, then there would be no need of atomic here? [Artur] Runners are restarted for each compression level. It's enough to have the data printed only once.

Quoted 32 lines
app/test-compress-perf/comp_perf_test_benchmark.c +12 -0
+		printf("    lcore: %u,"
+				" driver name: %s,"
+				" device name: %s,"
+				" device id: %u,"
+				" socket id: %u,"
+				" queue pair id: %u\n",
+			lcore,
+			ctx->ver.options->driver_name,
+			rte_compressdev_name_get(ctx->ver.mem.dev_id),
+			ctx->ver.mem.dev_id,
+			rte_compressdev_socket_id(ctx->ver.mem.dev_id),
+			ctx->ver.mem.qp_id);
 
 	/*
 	 * First the verification part is needed @@ -374,7 +391,7 @@ 

cperf_benchmark_test_runner(void *test_ctx)

app/test-compress-perf/comp_perf_test_benchmark.c +1 -1
 			1000000000;
 
 	if (rte_atomic16_test_and_set(&display_once)) {
-		printf("%12s%6s%12s%17s%15s%16s\n",
+		printf("\n%12s%6s%12s%17s%15s%16s\n",
 			"lcore id", "Level", "Comp size", "Comp ratio [%]",
 			"Comp [Gbps]", "Decomp [Gbps]");
 	}
(quoted diff) +0 -0

b/app/test- compress-perf/comp_perf_test_common.c
index 472c76686..3dc9349b0 100644

app/test-compress-perf/comp_perf_test_common.c +0 -0
@@ -16,6 +16,18 @@
 
 #define DIV_CEIL(a, b)  ((a) / (b) + ((a) % (b) != 0))

app/test-compress-perf/comp_perf_test_common.c line 27

Quoted 10 lines
app/test-compress-perf/comp_perf_test_common.c +9 -0
 
+struct performance_tests_results {
+	uint16_t total_segments;
+	uint16_t segment_sz;
+	uint16_t last_segment_sz;
+	uint32_t total_buffs;	      /*number of buffers = number of ops*/
+	uint16_t segments_per_buff;
+	uint16_t segments_per_last_buff;
+	size_t input_data_sz;
+};

These looks more like test configuration than result. If you agree, then can rename it to test_config ..
[Artur] These are exactly tests results, internal variables used by the algorithm. A kind of snapshot. Config by definition is used for configuration. In this case all the fields are only printed out.

Quoted 21 lines
app/test-compress-perf/comp_perf_test_common.c +3 -0
+
+static struct performance_tests_results tests_res;
+
 int
 param_range_check(uint16_t size, const struct rte_param_log2_range
 *range)  { @@ -170,6 +182,13 @@ comp_perf_allocate_memory(struct 

comp_test_data *test_data,

app/test-compress-perf/comp_perf_test_common.c +7 -0
 				" could not be allocated\n");
 		return -1;
 	}
+
+	tests_res.total_segments = total_segs;
+	tests_res.segment_sz = test_data->seg_sz;
+	tests_res.total_buffs = mem->total_bufs;
+	tests_res.segments_per_buff = test_data->max_sgl_segs;
+	tests_res.input_data_sz = test_data->input_data_sz;
+
 	return 0;
 }

app/test-compress-perf/comp_perf_test_common.c prepare_bufs(struct comp_test_data *test_data, · line 204

Quoted 9 lines
app/test-compress-perf/comp_perf_test_common.c +2 -1
@@ -178,9 +197,10 @@ prepare_bufs(struct comp_test_data *test_data, 
 struct cperf_mem_resources *mem)  {
 	uint32_t remaining_data = test_data->input_data_sz;
 	uint8_t *input_data_ptr = test_data->input_data;
-	size_t data_sz;
+	size_t data_sz = 0;
 	uint8_t *data_addr;
 	uint32_t i, j;
+	uint16_t segs_per_mbuf = 0;
 

Minimum segment per mbuf is 1. Then why don’t we initialize it to 1 here?
[Artur] You are right Shally, if everything is fine with the input params and with the algorithm, but it should be left 0 in case of problems with mbufs allocation (current implementation).

Quoted 21 lines
app/test-compress-perf/comp_perf_test_common.c +0 -1
 	for (i = 0; i < mem->total_bufs; i++) {
 		/* Allocate data in input mbuf and copy data from input file */ @@ 
-204,7 +224,7 @@ prepare_bufs(struct comp_test_data *test_data, struct 

cperf_mem_resources *mem)

app/test-compress-perf/comp_perf_test_common.c +1 -1
 		remaining_data -= data_sz;
 
 		/* Already one segment in the mbuf */
-		uint16_t segs_per_mbuf = 1;
+		segs_per_mbuf = 1;
 
 		/* Chain mbufs if needed for input mbufs */
 		while (segs_per_mbuf < test_data->max_sgl_segs @@ -

281,5 +301,75 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)

app/test-compress-perf/comp_perf_test_common.c +3 -0
 		}
 	}
 
+	tests_res.segments_per_last_buff = segs_per_mbuf;
+	tests_res.last_segment_sz = data_sz;
+
 	return 0;

app/test-compress-perf/comp_perf_test_common.c prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem) · line 317

Quoted 10 lines
app/test-compress-perf/comp_perf_test_common.c +9 -0
 }
+
+void
+print_test_dynamics(void)
+{
+	uint32_t opt_total_segs = DIV_CEIL(tests_res.input_data_sz,
+			MAX_SEG_SIZE);
+
+	if (tests_res.total_buffs > 1) {
+		printf("\nWarning: for the current input parameters number"

A comma after 'input parameters' would improve readability here [Artur] - Ok

app/test-compress-perf/comp_perf_test_common.c prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem) · line 326

Quoted 9 lines
app/test-compress-perf/comp_perf_test_common.c +9 -0
+				" of ops is higher than one, which may result"
+				" in sub-optimal performance.\n");
+		printf("To improve the performance (for the current"
+				" input data) following parameters are"
+				" suggested:\n");
+		printf("	• Segment size: %d\n", MAX_SEG_SIZE);
+		printf("	• Number of segments: %u\n", opt_total_segs);
+	} else if (tests_res.total_buffs == 1) {
+		printf("\nWarning: there is only one op with %u segments –"

May "Warning:" be replaced with "Info: " here.
[Artur] Ok

Quoted 37 lines
app/test-compress-perf/comp_perf_test_common.c +37 -0
+				" the compression ratio is the best.\n",
+			tests_res.segments_per_last_buff);
+		if (tests_res.segment_sz < MAX_SEG_SIZE)
+			printf("To reduce compression time, please use"
+					" bigger segment size: %d.\n",
+				MAX_SEG_SIZE);
+		else if (tests_res.segment_sz == MAX_SEG_SIZE)
+			printf("Segment size is optimal for the best"
+					" performance.\n");
+	} else
+		printf("Warning: something wrong happened!!\n");
+
+	printf("\nFor the current input parameters (segment size = %u,"
+			" segments number = %u):\n",
+		tests_res.segment_sz,
+		tests_res.segments_per_buff);
+	printf("	• Total number of buffers: %d\n",
+		tests_res.total_segments);
+	printf("	• %u buffer(s) %u bytes long, last buffer %u"
+			" byte(s) long\n",
+		tests_res.total_segments - 1,
+		tests_res.segment_sz,
+		tests_res.last_segment_sz);
+	printf("	• Number of ops: %u\n", tests_res.total_buffs);
+	printf("	• Total memory allocation: %u\n",
+		(tests_res.total_segments - 1) * tests_res.segment_sz
+		+ tests_res.last_segment_sz);
+	if (tests_res.total_buffs > 1)
+		printf("	• %u ops: %u segment(s) in each,"
+				" segment size %u\n",
+			tests_res.total_buffs - 1,
+			tests_res.segments_per_buff,
+			tests_res.segment_sz);
+	if (tests_res.segments_per_last_buff > 1) {
+		printf("	• 1 op %u segments:\n",
+				tests_res.segments_per_last_buff);
+		printf("		o %u segment size %u\n",

app/test-compress-perf/comp_perf_test_common.c prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem) · line 373

Quoted 10 lines
app/test-compress-perf/comp_perf_test_common.c +10 -0
+			tests_res.segments_per_last_buff - 1,
+			tests_res.segment_sz);
+		printf("		o last segment size %u\n",
+			tests_res.last_segment_sz);
+	} else if (tests_res.segments_per_last_buff == 1) {
+		printf("	• 1 op (the last one): %u segment %u"
+				" byte(s) long\n\n",
+			tests_res.segments_per_last_buff,
+			tests_res.last_segment_sz);
+	}

Probably this if and else if here can be replaced by just 1 statement.
[Artur] I think it's ok. This version is clear. If you like I can remove {} brackets from the "else if".

Quoted 51 lines
app/test-compress-perf/comp_perf_test_common.c +2 -0
+	printf("\n");
+}
(quoted diff) +0 -0

b/app/test- compress-perf/comp_perf_test_common.h
index 9c11e3a00..c9e0c9081 100644

app/test-compress-perf/comp_perf_test_common.h +3 -0
@@ -13,6 +13,9 @@ struct cperf_mem_resources {
 	uint8_t dev_id;
 	uint16_t qp_id;
 	uint8_t lcore_id;
+
+	rte_atomic16_t print_info_once;
+
 	uint32_t total_bufs;
 	uint8_t *compressed_data;
 	uint8_t *decompressed_data;
@@ -38,4 +41,7 @@ comp_perf_allocate_memory(struct comp_test_data 
 *test_data,  int  prepare_bufs(struct comp_test_data *test_data, 

struct

cperf_mem_resources *mem);

app/test-compress-perf/comp_perf_test_common.h +3 -0
+void
+print_test_dynamics(void);
+
 #endif /* _COMP_PERF_TEST_COMMON_H_ */ diff --git 

a/app/test-compress-perf/main.c b/app/test-compress-perf/main.c index e746e4708..e7ac412e6 100644

app/test-compress-perf/main.c +4 -2
@@ -363,7 +363,7 @@ main(int argc, char **argv)
 
 	printf("App uses socket: %u\n", rte_socket_id());
 	printf("Burst size = %u\n", test_data->burst_sz);
-	printf("File size = %zu\n", test_data->input_data_sz);
+	printf("Input data size = %zu\n", test_data->input_data_sz);
 
 	test_data->cleanup = ST_DURING_TEST;
 	total_nb_qps = nb_compressdevs * test_data->nb_qps; @@ -390,6
+390,8 @@ main(int argc, char **argv)
 		i++;
 	}
 
+	print_test_dynamics(); /* constructors must be executed first */
+
 	while (test_data->level <= test_data->level_lst.max) {
 
 		i = 0;
--

2.17.1

#16 lore raw

Hi Artur, Shally,

Quoted 52 lines

-----Original Message-----
From: Trybula, ArturX
Sent: Monday, July 15, 2019 3:01 PM
To: Shally Verma <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; Dybkowski, AdamX <[email protected]>; [email protected]
Subject: RE: [EXT] [PATCH v4 1/1] app/test-compress-perf: report header improvement

-----Original Message-----
From: Shally Verma [mailto:[email protected]]
Sent: Monday, July 15, 2019 14:47
To: Trybula, ArturX <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; Dybkowski, AdamX <[email protected]>; [email protected]
Subject: RE: [EXT] [PATCH v4 1/1] app/test-compress-perf: report header improvement

Quoted 36 lines

-----Original Message-----
From: Artur Trybula <[email protected]>
Sent: Friday, July 12, 2019 4:13 PM
To: [email protected]; [email protected]; Shally Verma <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: [EXT] [PATCH v4 1/1] app/test-compress-perf: report header improvement

External Email

----------------------------------------------------------------------
This patch adds extra features to the compress performance test. Some important parameters (memory allocation, number of ops, number of segments) are calculated and printed out on the screen. Information about compression threads is also provided.

---
 .../comp_perf_test_benchmark.c                | 21 ++++-
 .../comp_perf_test_common.c                   | 94 ++++++++++++++++++-
 .../comp_perf_test_common.h                   |  6 ++
 app/test-compress-perf/main.c                 |  4 +-
 4 files changed, 120 insertions(+), 5 deletions(-)
app/test-compress-perf/comp_perf_test_benchmark.c +1 -0
index aa1f8eea2..887459449 100644
@@ -329,9 +329,26 @@ cperf_benchmark_test_runner(void *test_ctx)
 	struct comp_test_data *test_data = ctx->ver.options;
 	uint32_t lcore = rte_lcore_id();
 	static rte_atomic16_t display_once = RTE_ATOMIC16_INIT(0);
+	int i, ret = EXIT_SUCCESS;
 
Quoted 11 lines

app/test-compress-perf/comp_perf_test_benchmark.c cperf_benchmark_test_runner(void *test_ctx) · line 339

Quoted 7 lines
app/test-compress-perf/comp_perf_test_benchmark.c +5 -1
 	ctx->ver.mem.lcore_id = lcore;
-	int i, ret = EXIT_SUCCESS;
+
+	/*
+	 * printing information about current compression thread
+	 */
+	if (rte_atomic16_test_and_set(&ctx->ver.mem.print_info_once))

Question: runner() will be executed by each core so is ctx is thread local variable or global.? If it can be made thread local, then there would be no need of atomic here?
[Artur] Runners are restarted for each compression level. It's enough to have the data printed only once.

[Fiona] added clarification - we originally did as you suggest, but in cases where there are multiple params, e.g. level 1-9, the thread is started/stopped for each level, so the header was printing out many times - always with the same data. So we needed the atomic to resolve.

Quoted 34 lines
Quoted 34 lines
app/test-compress-perf/comp_perf_test_benchmark.c +12 -0
+		printf("    lcore: %u,"
+				" driver name: %s,"
+				" device name: %s,"
+				" device id: %u,"
+				" socket id: %u,"
+				" queue pair id: %u\n",
+			lcore,
+			ctx->ver.options->driver_name,
+			rte_compressdev_name_get(ctx->ver.mem.dev_id),
+			ctx->ver.mem.dev_id,
+			rte_compressdev_socket_id(ctx->ver.mem.dev_id),
+			ctx->ver.mem.qp_id);
 
 	/*
 	 * First the verification part is needed @@ -374,7 +391,7 @@

cperf_benchmark_test_runner(void *test_ctx)

app/test-compress-perf/comp_perf_test_benchmark.c +1 -1
 			1000000000;
 
 	if (rte_atomic16_test_and_set(&display_once)) {
-		printf("%12s%6s%12s%17s%15s%16s\n",
+		printf("\n%12s%6s%12s%17s%15s%16s\n",
 			"lcore id", "Level", "Comp size", "Comp ratio [%]",
 			"Comp [Gbps]", "Decomp [Gbps]");
 	}
(quoted diff) +0 -0

b/app/test- compress-perf/comp_perf_test_common.c
index 472c76686..3dc9349b0 100644

app/test-compress-perf/comp_perf_test_common.c +0 -0
@@ -16,6 +16,18 @@
 
 #define DIV_CEIL(a, b)  ((a) / (b) + ((a) % (b) != 0))
 
Quoted 12 lines

app/test-compress-perf/comp_perf_test_common.c line 27

Quoted 9 lines
app/test-compress-perf/comp_perf_test_common.c +9 -0
+struct performance_tests_results {
+	uint16_t total_segments;
+	uint16_t segment_sz;
+	uint16_t last_segment_sz;
+	uint32_t total_buffs;	      /*number of buffers = number of ops*/
+	uint16_t segments_per_buff;
+	uint16_t segments_per_last_buff;
+	size_t input_data_sz;
+};

These looks more like test configuration than result. If you agree, then can rename it to test_config .. [Artur] These are exactly tests results, internal variables used by the algorithm. A kind of snapshot. Config by definition is used for configuration. In this case all the fields are only printed out.

[Fiona] I can see the confusion, it's not the input config - but it's also confusing to call it results, as that implies the throughput and ratio numbers. How about cperf_buffer_info?

Quoted 123 lines
Quoted 22 lines
app/test-compress-perf/comp_perf_test_common.c +3 -0
+
+static struct performance_tests_results tests_res;
+
 int
 param_range_check(uint16_t size, const struct rte_param_log2_range
 *range)  { @@ -170,6 +182,13 @@ comp_perf_allocate_memory(struct

comp_test_data *test_data,

app/test-compress-perf/comp_perf_test_common.c +7 -0
 				" could not be allocated\n");
 		return -1;
 	}
+
+	tests_res.total_segments = total_segs;
+	tests_res.segment_sz = test_data->seg_sz;
+	tests_res.total_buffs = mem->total_bufs;
+	tests_res.segments_per_buff = test_data->max_sgl_segs;
+	tests_res.input_data_sz = test_data->input_data_sz;
+
 	return 0;
 }

app/test-compress-perf/comp_perf_test_common.c prepare_bufs(struct comp_test_data *test_data, · line 204

Quoted 9 lines
app/test-compress-perf/comp_perf_test_common.c +2 -1
@@ -178,9 +197,10 @@ prepare_bufs(struct comp_test_data *test_data,
 struct cperf_mem_resources *mem)  {
 	uint32_t remaining_data = test_data->input_data_sz;
 	uint8_t *input_data_ptr = test_data->input_data;
-	size_t data_sz;
+	size_t data_sz = 0;
 	uint8_t *data_addr;
 	uint32_t i, j;
+	uint16_t segs_per_mbuf = 0;
 

Minimum segment per mbuf is 1. Then why don’t we initialize it to 1 here?
[Artur] You are right Shally, if everything is fine with the input params and with the algorithm, but it should be left 0 in case of problems with mbufs allocation (current implementation).

Quoted 21 lines
app/test-compress-perf/comp_perf_test_common.c +0 -1
 	for (i = 0; i < mem->total_bufs; i++) {
 		/* Allocate data in input mbuf and copy data from input file */ @@
-204,7 +224,7 @@ prepare_bufs(struct comp_test_data *test_data, struct

cperf_mem_resources *mem)

app/test-compress-perf/comp_perf_test_common.c +1 -1
 		remaining_data -= data_sz;
 
 		/* Already one segment in the mbuf */
-		uint16_t segs_per_mbuf = 1;
+		segs_per_mbuf = 1;
 
 		/* Chain mbufs if needed for input mbufs */
 		while (segs_per_mbuf < test_data->max_sgl_segs @@ -

281,5 +301,75 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)

app/test-compress-perf/comp_perf_test_common.c +3 -0
 		}
 	}
 
+	tests_res.segments_per_last_buff = segs_per_mbuf;
+	tests_res.last_segment_sz = data_sz;
+
 	return 0;

app/test-compress-perf/comp_perf_test_common.c prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem) · line 317

Quoted 10 lines
app/test-compress-perf/comp_perf_test_common.c +9 -0
 }
+
+void
+print_test_dynamics(void)
+{
+	uint32_t opt_total_segs = DIV_CEIL(tests_res.input_data_sz,
+			MAX_SEG_SIZE);
+
+	if (tests_res.total_buffs > 1) {
+		printf("\nWarning: for the current input parameters number"

A comma after 'input parameters' would improve readability here [Artur] - Ok

app/test-compress-perf/comp_perf_test_common.c prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem) · line 326

Quoted 9 lines
app/test-compress-perf/comp_perf_test_common.c +9 -0
+				" of ops is higher than one, which may result"
+				" in sub-optimal performance.\n");
+		printf("To improve the performance (for the current"
+				" input data) following parameters are"
+				" suggested:\n");
+		printf("	• Segment size: %d\n", MAX_SEG_SIZE);
+		printf("	• Number of segments: %u\n", opt_total_segs);
+	} else if (tests_res.total_buffs == 1) {
+		printf("\nWarning: there is only one op with %u segments –"

May "Warning:" be replaced with "Info: " here.
[Artur] Ok

Quoted 41 lines
app/test-compress-perf/comp_perf_test_common.c +41 -0
+				" the compression ratio is the best.\n",
+			tests_res.segments_per_last_buff);
+		if (tests_res.segment_sz < MAX_SEG_SIZE)
+			printf("To reduce compression time, please use"
+					" bigger segment size: %d.\n",
+				MAX_SEG_SIZE);
+		else if (tests_res.segment_sz == MAX_SEG_SIZE)
+			printf("Segment size is optimal for the best"
+					" performance.\n");
+	} else
+		printf("Warning: something wrong happened!!\n");
+
+	printf("\nFor the current input parameters (segment size = %u,"
+			" segments number = %u):\n",
+		tests_res.segment_sz,
+		tests_res.segments_per_buff);
+	printf("	• Total number of buffers: %d\n",
+		tests_res.total_segments);
+	printf("	• %u buffer(s) %u bytes long, last buffer %u"
+			" byte(s) long\n",
+		tests_res.total_segments - 1,
+		tests_res.segment_sz,
+		tests_res.last_segment_sz);
+	printf("	• Number of ops: %u\n", tests_res.total_buffs);
+	printf("	• Total memory allocation: %u\n",
+		(tests_res.total_segments - 1) * tests_res.segment_sz
+		+ tests_res.last_segment_sz);
+	if (tests_res.total_buffs > 1)
+		printf("	• %u ops: %u segment(s) in each,"
+				" segment size %u\n",
+			tests_res.total_buffs - 1,
+			tests_res.segments_per_buff,
+			tests_res.segment_sz);
+	if (tests_res.segments_per_last_buff > 1) {
+		printf("	• 1 op %u segments:\n",
+				tests_res.segments_per_last_buff);
+		printf("		o %u segment size %u\n",
+			tests_res.segments_per_last_buff - 1,
+			tests_res.segment_sz);
+		printf("		o last segment size %u\n",
+			tests_res.last_segment_sz);
Quoted 8 lines

app/test-compress-perf/comp_perf_test_common.c prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem) · line 373

Quoted 6 lines
app/test-compress-perf/comp_perf_test_common.c +6 -0
+	} else if (tests_res.segments_per_last_buff == 1) {
+		printf("	• 1 op (the last one): %u segment %u"
+				" byte(s) long\n\n",
+			tests_res.segments_per_last_buff,
+			tests_res.last_segment_sz);
+	}

Probably this if and else if here can be replaced by just 1 statement.
[Artur] I think it's ok. This version is clear. If you like I can remove {} brackets from the "else if".

[Fiona] I think it's ok as is - there are different output whether >1 or ==1, so better to leave as separate paths.

Quoted 53 lines
Quoted 53 lines
app/test-compress-perf/comp_perf_test_common.c +2 -0
+	printf("\n");
+}
(quoted diff) +0 -0

b/app/test- compress-perf/comp_perf_test_common.h
index 9c11e3a00..c9e0c9081 100644

app/test-compress-perf/comp_perf_test_common.h +3 -0
@@ -13,6 +13,9 @@ struct cperf_mem_resources {
 	uint8_t dev_id;
 	uint16_t qp_id;
 	uint8_t lcore_id;
+
+	rte_atomic16_t print_info_once;
+
 	uint32_t total_bufs;
 	uint8_t *compressed_data;
 	uint8_t *decompressed_data;
@@ -38,4 +41,7 @@ comp_perf_allocate_memory(struct comp_test_data
 *test_data,  int  prepare_bufs(struct comp_test_data *test_data,

struct

cperf_mem_resources *mem);

app/test-compress-perf/comp_perf_test_common.h +3 -0
+void
+print_test_dynamics(void);
+
 #endif /* _COMP_PERF_TEST_COMMON_H_ */ diff --git

a/app/test-compress-perf/main.c b/app/test-compress-perf/main.c index e746e4708..e7ac412e6 100644

app/test-compress-perf/main.c +4 -2
@@ -363,7 +363,7 @@ main(int argc, char **argv)
 
 	printf("App uses socket: %u\n", rte_socket_id());
 	printf("Burst size = %u\n", test_data->burst_sz);
-	printf("File size = %zu\n", test_data->input_data_sz);
+	printf("Input data size = %zu\n", test_data->input_data_sz);
 
 	test_data->cleanup = ST_DURING_TEST;
 	total_nb_qps = nb_compressdevs * test_data->nb_qps; @@ -390,6
+390,8 @@ main(int argc, char **argv)
 		i++;
 	}
 
+	print_test_dynamics(); /* constructors must be executed first */
+
 	while (test_data->level <= test_data->level_lst.max) {
 
 		i = 0;
--

2.17.1

#17 lore raw
Quoted 12 lines

-----Original Message-----
From: Trahe, Fiona <[email protected]>
Sent: Tuesday, July 16, 2019 7:20 PM
To: Trybula, ArturX <[email protected]>; Shally Verma <[email protected]>; [email protected]; Dybkowski, AdamX <[email protected]>; [email protected]
Cc: Trahe, Fiona <[email protected]>
Subject: RE: [EXT] [PATCH v4 1/1] app/test-compress-perf: report header improvement

....

Quoted 47 lines
Quoted 38 lines
Quoted 38 lines

-----Original Message-----
From: Artur Trybula <[email protected]>
Sent: Friday, July 12, 2019 4:13 PM
To: [email protected]; [email protected]; Shally Verma <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: [EXT] [PATCH v4 1/1] app/test-compress-perf: report header improvement

External Email

--------------------------------------------------------------------
-- This patch adds extra features to the compress performance test. Some important parameters (memory allocation, number of ops, number of
segments) are calculated and printed out on the screen. Information about compression threads is also provided.

---
 .../comp_perf_test_benchmark.c                | 21 ++++-
 .../comp_perf_test_common.c                   | 94 ++++++++++++++++++-
 .../comp_perf_test_common.h                   |  6 ++
 app/test-compress-perf/main.c                 |  4 +-
 4 files changed, 120 insertions(+), 5 deletions(-)
app/test-compress-perf/comp_perf_test_benchmark.c +1 -0
index aa1f8eea2..887459449 100644
@@ -329,9 +329,26 @@ cperf_benchmark_test_runner(void *test_ctx)
 	struct comp_test_data *test_data = ctx->ver.options;
 	uint32_t lcore = rte_lcore_id();
 	static rte_atomic16_t display_once = RTE_ATOMIC16_INIT(0);
+	int i, ret = EXIT_SUCCESS;
 
Quoted 9 lines

app/test-compress-perf/comp_perf_test_benchmark.c cperf_benchmark_test_runner(void *test_ctx) · line 339

Quoted 7 lines
app/test-compress-perf/comp_perf_test_benchmark.c +5 -1
 	ctx->ver.mem.lcore_id = lcore;
-	int i, ret = EXIT_SUCCESS;
+
+	/*
+	 * printing information about current compression thread
+	 */
+	if (rte_atomic16_test_and_set(&ctx->ver.mem.print_info_once))

Question: runner() will be executed by each core so is ctx is thread local variable or global.? If it can be made thread local, then there would be

Quoted 8 lines

no need of atomic here?

Quoted 2 lines

[Artur] Runners are restarted for each compression level. It's enough to have the data printed only once.

[Fiona] added clarification - we originally did as you suggest, but in cases where there are multiple params, e.g. level 1-9, the thread is started/stopped for each level, so the header was printing out many times - always with the same data. So we needed the atomic to resolve.

[Shally] Okay.

Quoted 1 line
Quoted 1 line

....

Quoted 19 lines
Quoted 9 lines
Quoted 9 lines
(quoted diff) +0 -0

b/app/test- compress-perf/comp_perf_test_common.c index 472c76686..3dc9349b0 100644

app/test-compress-perf/comp_perf_test_common.c +0 -0
@@ -16,6 +16,18 @@
 
 #define DIV_CEIL(a, b)  ((a) / (b) + ((a) % (b) != 0))
 
Quoted 10 lines

app/test-compress-perf/comp_perf_test_common.c line 27

Quoted 9 lines
app/test-compress-perf/comp_perf_test_common.c +9 -0
+struct performance_tests_results {
+	uint16_t total_segments;
+	uint16_t segment_sz;
+	uint16_t last_segment_sz;
+	uint32_t total_buffs;	      /*number of buffers = number of ops*/
+	uint16_t segments_per_buff;
+	uint16_t segments_per_last_buff;
+	size_t input_data_sz;
+};

These looks more like test configuration than result. If you agree, then can

Quoted 8 lines

rename it to test_config ..

Quoted 1 line

[Artur] These are exactly tests results, internal variables used by the

algorithm. A kind of snapshot.

Quoted 1 line

Config by definition is used for configuration. In this case all the fields are

only printed out.
[Fiona] I can see the confusion, it's not the input config - but it's also confusing to call it results, as that implies the throughput and ratio numbers. How about cperf_buffer_info?

[Shally] this sound better.

Quoted 1 line
Quoted 1 line

...

Quoted 16 lines
Quoted 8 lines
Quoted 8 lines
app/test-compress-perf/comp_perf_test_common.c +8 -0
+	if (tests_res.segments_per_last_buff > 1) {
+		printf("	• 1 op %u segments:\n",
+				tests_res.segments_per_last_buff);
+		printf("		o %u segment size %u\n",
+			tests_res.segments_per_last_buff - 1,
+			tests_res.segment_sz);
+		printf("		o last segment size %u\n",
+			tests_res.last_segment_sz);
Quoted 8 lines

app/test-compress-perf/comp_perf_test_common.c prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem) · line 373

Quoted 6 lines
app/test-compress-perf/comp_perf_test_common.c +6 -0
+	} else if (tests_res.segments_per_last_buff == 1) {
+		printf("	• 1 op (the last one): %u segment %u"
+				" byte(s) long\n\n",
+			tests_res.segments_per_last_buff,
+			tests_res.last_segment_sz);
+	}

Probably this if and else if here can be replaced by just 1 statement. [Artur] I think it's ok. This version is clear. If you like I can remove {}

Quoted 3 lines

brackets from the "else if".
[Fiona] I think it's ok as is - there are different output whether >1 or ==1, so better to leave as separate paths.

[Shally] Okay. That was just my 2 cents. Am fine it "as is".

Quoted 1 line
Quoted 1 line

..

Quoted 1 line
Quoted 1 line
Quoted 1 line

2.17.1

#18 lore raw

v5 cover add extra features to test-compress-perf

In reply to Artur Trybula

v5 changes:
- some minor changes (rewording, structure renaming, etc.)

v4 changes:
- information about compression threads printed on screen

v3 changes:
- commented code removed

v2 changes:
- merged with the series "add multiple cores feature to test-compress-perf"
- function renamed: print_report_header() -> print_test_dynamics()

This patch depends on the series "add multiple cores feature to test-compress-perf"
https://patches.dpdk.org/cover/56236/

Artur Trybula (1):
app/test-compress-perf: report header improvement

 .../comp_perf_test_benchmark.c                | 21 ++++-
 .../comp_perf_test_common.c                   | 94 ++++++++++++++++++-
 .../comp_perf_test_common.h                   |  6 ++
 app/test-compress-perf/main.c                 |  4 +-
 4 files changed, 120 insertions(+), 5 deletions(-)
Signature · 1 line
2.17.1
#19 lore raw

PATCH v5 1/1 app/test-compress-perf: report header improvement

This patch adds extra features to the compress performance test. Some important parameters (memory allocation, number of ops, number of segments) are calculated and printed out on the screen.
Information about compression threads is also provided.

---
 .../comp_perf_test_benchmark.c                | 21 ++++-
 .../comp_perf_test_common.c                   | 94 ++++++++++++++++++-
 .../comp_perf_test_common.h                   |  6 ++
 app/test-compress-perf/main.c                 |  4 +-
 4 files changed, 120 insertions(+), 5 deletions(-)
app/test-compress-perf/comp_perf_test_benchmark.c +19 -2
index aa1f8eea2..887459449 100644
@@ -329,9 +329,26 @@ cperf_benchmark_test_runner(void *test_ctx)
 	struct comp_test_data *test_data = ctx->ver.options;
 	uint32_t lcore = rte_lcore_id();
 	static rte_atomic16_t display_once = RTE_ATOMIC16_INIT(0);
+	int i, ret = EXIT_SUCCESS;
 
 	ctx->ver.mem.lcore_id = lcore;
-	int i, ret = EXIT_SUCCESS;
+
+	/*
+	 * printing information about current compression thread
+	 */
+	if (rte_atomic16_test_and_set(&ctx->ver.mem.print_info_once))
+		printf("    lcore: %u,"
+				" driver name: %s,"
+				" device name: %s,"
+				" device id: %u,"
+				" socket id: %u,"
+				" queue pair id: %u\n",
+			lcore,
+			ctx->ver.options->driver_name,
+			rte_compressdev_name_get(ctx->ver.mem.dev_id),
+			ctx->ver.mem.dev_id,
+			rte_compressdev_socket_id(ctx->ver.mem.dev_id),
+			ctx->ver.mem.qp_id);
 
 	/*
 	 * First the verification part is needed
@@ -374,7 +391,7 @@ cperf_benchmark_test_runner(void *test_ctx)
 			1000000000;
 
 	if (rte_atomic16_test_and_set(&display_once)) {
-		printf("%12s%6s%12s%17s%15s%16s\n",
+		printf("\n%12s%6s%12s%17s%15s%16s\n",
 			"lcore id", "Level", "Comp size", "Comp ratio [%]",
 			"Comp [Gbps]", "Decomp [Gbps]");
 	}
app/test-compress-perf/comp_perf_test_common.c +92 -2

125 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_common.h +6 -0
index 9c11e3a00..c9e0c9081 100644
@@ -13,6 +13,9 @@ struct cperf_mem_resources {
 	uint8_t dev_id;
 	uint16_t qp_id;
 	uint8_t lcore_id;
+
+	rte_atomic16_t print_info_once;
+
 	uint32_t total_bufs;
 	uint8_t *compressed_data;
 	uint8_t *decompressed_data;
@@ -38,4 +41,7 @@ comp_perf_allocate_memory(struct comp_test_data *test_data,
 int
 prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem);
 
+void
+print_test_dynamics(void);
+
 #endif /* _COMP_PERF_TEST_COMMON_H_ */
app/test-compress-perf/main.c +3 -1
index e746e4708..e7ac412e6 100644
@@ -363,7 +363,7 @@ main(int argc, char **argv)
 
 	printf("App uses socket: %u\n", rte_socket_id());
 	printf("Burst size = %u\n", test_data->burst_sz);
-	printf("File size = %zu\n", test_data->input_data_sz);
+	printf("Input data size = %zu\n", test_data->input_data_sz);
 
 	test_data->cleanup = ST_DURING_TEST;
 	total_nb_qps = nb_compressdevs * test_data->nb_qps;
@@ -390,6 +390,8 @@ main(int argc, char **argv)
 		i++;
 	}
 
+	print_test_dynamics(); /* constructors must be executed first */
+
 	while (test_data->level <= test_data->level_lst.max) {
 
 		i = 0;
Signature · 1 line
2.17.1
#20 lore raw
Quoted 13 lines

-----Original Message-----
From: Artur Trybula <[email protected]>
Sent: Wednesday, July 17, 2019 4:33 PM
To: [email protected]; [email protected]; Shally Verma <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: [EXT] [PATCH v5 1/1] app/test-compress-perf: report header improvement

External Email

...

Quoted 1 line

+static struct cperf_buffer_info tests_res;

Rename test_res too --> buffer_info? You can address it in next release cycle as well.

....

#21 lore raw

-----Original Message-----
From: Shally Verma [mailto:[email protected]]
Sent: Wednesday, July 17, 2019 13:16
To: Trybula, ArturX <[email protected]>; [email protected]; Trahe, Fiona <[email protected]>; Dybkowski, AdamX <[email protected]>; [email protected]
Subject: RE: [EXT] [PATCH v5 1/1] app/test-compress-perf: report header improvement

Quoted 11 lines

-----Original Message-----
From: Artur Trybula <[email protected]>
Sent: Wednesday, July 17, 2019 4:33 PM
To: [email protected]; [email protected]; Shally Verma <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: [EXT] [PATCH v5 1/1] app/test-compress-perf: report header improvement

External Email

...

Quoted 1 line

+static struct cperf_buffer_info tests_res;

Rename test_res too --> buffer_info? You can address it in next release cycle as well. [Artur] Thank you Shally. Good point. Will be changed in the next cycle.

....

Applied
#22 lore raw
Quoted 7 lines
Quoted 2 lines

+static struct cperf_buffer_info tests_res;

Rename test_res too --> buffer_info? You can address it in next release cycle as well.
[Artur] Thank you Shally. Good point. Will be changed in the next cycle.

....

Applied to dpdk-next-crypto

Thanks.

#23 lore raw

19/07/2019 15:17, Akhil Goyal:

Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

+static struct cperf_buffer_info tests_res;

Rename test_res too --> buffer_info? You can address it in next release cycle as well.
[Artur] Thank you Shally. Good point. Will be changed in the next cycle.

....

Applied to dpdk-next-crypto

Not pulled in master tree for 2 reasons:
- the title and commit log are not descriptive enough
- there are some UTF-8 characters for no good reason in the printf. Please stick to standard dash or asterisk for lists,
so it will be printed in any console.

#24 lore raw

Hi Thomas,

Quoted 15 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Friday, July 19, 2019 5:21 PM
To: Trybula, ArturX <[email protected]>
Cc: [email protected]; Akhil Goyal <[email protected]>; Shally Verma <[email protected]>; Trahe, Fiona <[email protected]>; Dybkowski, AdamX <[email protected]>
Subject: Re: [dpdk-dev] [EXT] [PATCH v5 1/1] app/test-compress-perf: report header improvement

19/07/2019 15:17, Akhil Goyal:

Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

+static struct cperf_buffer_info tests_res;

Rename test_res too --> buffer_info? You can address it in next release cycle as well.
[Artur] Thank you Shally. Good point. Will be changed in the next cycle.

Quoted 8 lines
Quoted 2 lines
Quoted 1 line

....

Applied to dpdk-next-crypto

Not pulled in master tree for 2 reasons:
- the title and commit log are not descriptive enough
- there are some UTF-8 characters for no good reason in the printf. Please stick to standard dash or asterisk for lists,
so it will be printed in any console.

[Fiona] Sorry about this - we didn't know of this requirement. Will send a v6 next week.

#25 lore raw

v6 cover add extra features to test-compress-perf

In reply to Artur Trybula

v6 changes:
- replace special bullet characters with normal asterisks

v5 changes:
- some minor changes (rewording, structure renaming, etc.)

v4 changes:
- information about compression threads printed on screen

v3 changes:
- commented code removed

v2 changes:
- merged with the series "add multiple cores feature to test-compress-perf"
- function renamed: print_report_header() -> print_test_dynamics()

Artur Trybula (1):
app/test-compress-perf: provide more detailed report

 .../comp_perf_test_benchmark.c                | 21 ++++-
 .../comp_perf_test_common.c                   | 94 ++++++++++++++++++-
 .../comp_perf_test_common.h                   |  6 ++
 app/test-compress-perf/main.c                 |  4 +-
 4 files changed, 120 insertions(+), 5 deletions(-)
Signature · 1 line
2.17.1
#26 lore raw

PATCH v6 1/1 app/test-compress-perf: provide more detailed report

From: Artur Trybula <[email protected]>

This patch adds extra features to the compress performance test. Some important parameters (memory allocation, number of ops, number of segments) are calculated and printed out.
Information about threads, cores, devices and queue-pairs is also printed.

---
 .../comp_perf_test_benchmark.c                | 21 ++++-
 .../comp_perf_test_common.c                   | 94 ++++++++++++++++++-
 .../comp_perf_test_common.h                   |  6 ++
 app/test-compress-perf/main.c                 |  4 +-
 4 files changed, 120 insertions(+), 5 deletions(-)
app/test-compress-perf/comp_perf_test_benchmark.c +19 -2
index aa1f8eea2..887459449 100644
@@ -329,9 +329,26 @@ cperf_benchmark_test_runner(void *test_ctx)
 	struct comp_test_data *test_data = ctx->ver.options;
 	uint32_t lcore = rte_lcore_id();
 	static rte_atomic16_t display_once = RTE_ATOMIC16_INIT(0);
+	int i, ret = EXIT_SUCCESS;
 
 	ctx->ver.mem.lcore_id = lcore;
-	int i, ret = EXIT_SUCCESS;
+
+	/*
+	 * printing information about current compression thread
+	 */
+	if (rte_atomic16_test_and_set(&ctx->ver.mem.print_info_once))
+		printf("    lcore: %u,"
+				" driver name: %s,"
+				" device name: %s,"
+				" device id: %u,"
+				" socket id: %u,"
+				" queue pair id: %u\n",
+			lcore,
+			ctx->ver.options->driver_name,
+			rte_compressdev_name_get(ctx->ver.mem.dev_id),
+			ctx->ver.mem.dev_id,
+			rte_compressdev_socket_id(ctx->ver.mem.dev_id),
+			ctx->ver.mem.qp_id);
 
 	/*
 	 * First the verification part is needed
@@ -374,7 +391,7 @@ cperf_benchmark_test_runner(void *test_ctx)
 			1000000000;
 
 	if (rte_atomic16_test_and_set(&display_once)) {
-		printf("%12s%6s%12s%17s%15s%16s\n",
+		printf("\n%12s%6s%12s%17s%15s%16s\n",
 			"lcore id", "Level", "Comp size", "Comp ratio [%]",
 			"Comp [Gbps]", "Decomp [Gbps]");
 	}
app/test-compress-perf/comp_perf_test_common.c +92 -2

125 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_common.h +6 -0
index 9c11e3a00..c9e0c9081 100644
@@ -13,6 +13,9 @@ struct cperf_mem_resources {
 	uint8_t dev_id;
 	uint16_t qp_id;
 	uint8_t lcore_id;
+
+	rte_atomic16_t print_info_once;
+
 	uint32_t total_bufs;
 	uint8_t *compressed_data;
 	uint8_t *decompressed_data;
@@ -38,4 +41,7 @@ comp_perf_allocate_memory(struct comp_test_data *test_data,
 int
 prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem);
 
+void
+print_test_dynamics(void);
+
 #endif /* _COMP_PERF_TEST_COMMON_H_ */
app/test-compress-perf/main.c +3 -1
index e746e4708..e7ac412e6 100644
@@ -363,7 +363,7 @@ main(int argc, char **argv)
 
 	printf("App uses socket: %u\n", rte_socket_id());
 	printf("Burst size = %u\n", test_data->burst_sz);
-	printf("File size = %zu\n", test_data->input_data_sz);
+	printf("Input data size = %zu\n", test_data->input_data_sz);
 
 	test_data->cleanup = ST_DURING_TEST;
 	total_nb_qps = nb_compressdevs * test_data->nb_qps;
@@ -390,6 +390,8 @@ main(int argc, char **argv)
 		i++;
 	}
 
+	print_test_dynamics(); /* constructors must be executed first */
+
 	while (test_data->level <= test_data->level_lst.max) {
 
 		i = 0;
Signature · 1 line
2.17.1
#27 lore raw

v7 cover add extra features to test-compress-perf

v7 changes:
- one more special character replaced with a minus sign

v6 changes:
- replace special bullet characters with normal asterisks

v5 changes:
- some minor changes (rewording, structure renaming, etc.)

v4 changes:
- information about compression threads printed on screen

v3 changes:
- commented code removed

v2 changes:
- merged with the series "add multiple cores feature to test-compress-perf"
- function renamed: print_report_header() -> print_test_dynamics()

Artur Trybula (1):
app/test-compress-perf: provide more detailed report

 .../comp_perf_test_benchmark.c                | 21 ++++-
 .../comp_perf_test_common.c                   | 94 ++++++++++++++++++-
 .../comp_perf_test_common.h                   |  6 ++
 app/test-compress-perf/main.c                 |  4 +-
 4 files changed, 120 insertions(+), 5 deletions(-)
Signature · 1 line
2.17.1
#28 lore raw

PATCH v7 1/1 app/test-compress-perf: provide more detailed report

From: Artur Trybula <[email protected]>

This patch adds extra features to the compress performance test. Some important parameters (memory allocation, number of ops, number of segments) are calculated and printed out.
Information about threads, cores, devices and queue-pairs is also printed.

---
 .../comp_perf_test_benchmark.c                | 21 ++++-
 .../comp_perf_test_common.c                   | 94 ++++++++++++++++++-
 .../comp_perf_test_common.h                   |  6 ++
 app/test-compress-perf/main.c                 |  4 +-
 4 files changed, 120 insertions(+), 5 deletions(-)
app/test-compress-perf/comp_perf_test_benchmark.c +19 -2
index aa1f8eea2..887459449 100644
@@ -329,9 +329,26 @@ cperf_benchmark_test_runner(void *test_ctx)
 	struct comp_test_data *test_data = ctx->ver.options;
 	uint32_t lcore = rte_lcore_id();
 	static rte_atomic16_t display_once = RTE_ATOMIC16_INIT(0);
+	int i, ret = EXIT_SUCCESS;
 
 	ctx->ver.mem.lcore_id = lcore;
-	int i, ret = EXIT_SUCCESS;
+
+	/*
+	 * printing information about current compression thread
+	 */
+	if (rte_atomic16_test_and_set(&ctx->ver.mem.print_info_once))
+		printf("    lcore: %u,"
+				" driver name: %s,"
+				" device name: %s,"
+				" device id: %u,"
+				" socket id: %u,"
+				" queue pair id: %u\n",
+			lcore,
+			ctx->ver.options->driver_name,
+			rte_compressdev_name_get(ctx->ver.mem.dev_id),
+			ctx->ver.mem.dev_id,
+			rte_compressdev_socket_id(ctx->ver.mem.dev_id),
+			ctx->ver.mem.qp_id);
 
 	/*
 	 * First the verification part is needed
@@ -374,7 +391,7 @@ cperf_benchmark_test_runner(void *test_ctx)
 			1000000000;
 
 	if (rte_atomic16_test_and_set(&display_once)) {
-		printf("%12s%6s%12s%17s%15s%16s\n",
+		printf("\n%12s%6s%12s%17s%15s%16s\n",
 			"lcore id", "Level", "Comp size", "Comp ratio [%]",
 			"Comp [Gbps]", "Decomp [Gbps]");
 	}
app/test-compress-perf/comp_perf_test_common.c +92 -2

125 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_common.h +6 -0
index 9c11e3a00..c9e0c9081 100644
@@ -13,6 +13,9 @@ struct cperf_mem_resources {
 	uint8_t dev_id;
 	uint16_t qp_id;
 	uint8_t lcore_id;
+
+	rte_atomic16_t print_info_once;
+
 	uint32_t total_bufs;
 	uint8_t *compressed_data;
 	uint8_t *decompressed_data;
@@ -38,4 +41,7 @@ comp_perf_allocate_memory(struct comp_test_data *test_data,
 int
 prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem);
 
+void
+print_test_dynamics(void);
+
 #endif /* _COMP_PERF_TEST_COMMON_H_ */
app/test-compress-perf/main.c +3 -1
index e746e4708..e7ac412e6 100644
@@ -363,7 +363,7 @@ main(int argc, char **argv)
 
 	printf("App uses socket: %u\n", rte_socket_id());
 	printf("Burst size = %u\n", test_data->burst_sz);
-	printf("File size = %zu\n", test_data->input_data_sz);
+	printf("Input data size = %zu\n", test_data->input_data_sz);
 
 	test_data->cleanup = ST_DURING_TEST;
 	total_nb_qps = nb_compressdevs * test_data->nb_qps;
@@ -390,6 +390,8 @@ main(int argc, char **argv)
 		i++;
 	}
 
+	print_test_dynamics(); /* constructors must be executed first */
+
 	while (test_data->level <= test_data->level_lst.max) {
 
 		i = 0;
Signature · 1 line
2.17.1
Acked-by on v7 1/1
#29 lore raw

Re: [dpdk-dev] [PATCH v7 1/1] app/test-compress-perf: provide more detailed report

Quoted 18 lines

-----Original Message-----
From: Dybkowski, AdamX
Sent: Wednesday, July 24, 2019 2:55 PM
To: [email protected]; Trahe, Fiona <[email protected]>
Cc: Trybula, ArturX <[email protected]>; Dybkowski, AdamX <[email protected]>
Subject: [PATCH v7 1/1] app/test-compress-perf: provide more detailed report

From: Artur Trybula <[email protected]>

This patch adds extra features to the compress performance test. Some important parameters (memory allocation, number of ops, number of segments) are calculated and printed out.
Information about threads, cores, devices and queue-pairs is also printed.

Quoted 2 lines
Applied
#30 lore raw

Re: [dpdk-dev] [PATCH v7 1/1] app/test-compress-perf: provide more detailed report

Quoted 10 lines
Quoted 10 lines

From: Artur Trybula <[email protected]>

This patch adds extra features to the compress performance test. Some important parameters (memory allocation, number of ops, number of segments) are calculated and printed out.
Information about threads, cores, devices and queue-pairs is also printed.

Quoted 3 lines
Quoted 2 lines

Applied to dpdk-next-crypto

Thanks.

#31 lore raw

Re: [dpdk-dev] [EXT] [PATCH v5 0/1] add extra features to test-compress-perf

In reply to Artur Trybula
Quoted 27 lines

-----Original Message-----
From: Artur Trybula <[email protected]>
Sent: Wednesday, July 17, 2019 4:33 PM
To: [email protected]; [email protected]; Shally Verma <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: [EXT] [PATCH v5 0/1] add extra features to test-compress-perf

External Email

----------------------------------------------------------------------
v5 changes:
- some minor changes (rewording, structure renaming, etc.)

v4 changes:
- information about compression threads printed on screen

v3 changes:
- commented code removed

v2 changes:
- merged with the series "add multiple cores feature to test-compress-perf"
- function renamed: print_report_header() -> print_test_dynamics()

Quoted 6 lines

This patch depends on the series "add multiple cores feature to test- compress-perf"
https://patches.dpdk.org/cover/56236/

Other than minor change suggested. Series
Acked -by : Shally Verma <[email protected]>

Quoted 11 lines

Artur Trybula (1):
app/test-compress-perf: report header improvement

 .../comp_perf_test_benchmark.c                | 21 ++++-
 .../comp_perf_test_common.c                   | 94 ++++++++++++++++++-
 .../comp_perf_test_common.h                   |  6 ++
 app/test-compress-perf/main.c                 |  4 +-
 4 files changed, 120 insertions(+), 5 deletions(-)

--
2.17.1