[v1,1/2] app/bbdev: add capture of queue dump

Message ID 20241025175709.1415722-2-nicolas.chautru@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series app/bbdev: minor application updates |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Nicolas Chautru Oct. 25, 2024, 5:57 p.m. UTC
Capturing additional queue dump information in the
bbdev-test application using the api introduced earlier.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
---
 app/test-bbdev/test_bbdev_perf.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
  

Comments

Hemant Agrawal Oct. 28, 2024, 9:37 a.m. UTC | #1
Reviewed-by:  Hemant Agrawal <hemant.agrawal@nxp.com>

On 25-10-2024 23:27, Nicolas Chautru wrote:
> Capturing additional queue dump information in the
> bbdev-test application using the api introduced earlier.
>
> Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
> ---
>   app/test-bbdev/test_bbdev_perf.c | 16 ++++++++++++++++
>   1 file changed, 16 insertions(+)
>
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
> index 9be360b225..405c22de44 100644
> --- a/app/test-bbdev/test_bbdev_perf.c
> +++ b/app/test-bbdev/test_bbdev_perf.c
> @@ -111,6 +111,8 @@ static uint32_t ldpc_cap_flags;
>   /* FFT window width predefined on device and on vector. */
>   static int fft_window_width_dev;
>   
> +bool dump_ops = true;
> +
>   /* Represents tested active devices */
>   static struct active_device {
>   	const char *driver_name;
> @@ -3109,6 +3111,20 @@ run_test_case_on_device(test_case_function *test_case_func, uint8_t dev_id,
>   	/* Run test case function */
>   	t_ret = test_case_func(ad, op_params);
>   
> +	if (dump_ops) {
> +		/* Dump queue information in local file. */
> +		static FILE *fd;
> +		fd = fopen("./dump_bbdev_queue_ops.txt", "w");
> +		if (fd == NULL) {
> +			printf("Open dump file error.\n");
> +			return -1;
> +		}
> +		rte_bbdev_queue_ops_dump(ad->dev_id, ad->queue_ids[i], fd);
> +		fclose(fd);
> +		/* Run it once only. */
> +		dump_ops = false;
> +	}
> +
>   	/* Free active device resources and return */
>   	free_buffers(ad, op_params);
>   	return t_ret;
  
Maxime Coquelin Nov. 8, 2024, 9 a.m. UTC | #2
On 10/25/24 19:57, Nicolas Chautru wrote:
> Capturing additional queue dump information in the
> bbdev-test application using the api introduced earlier.
> 
> Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
> ---
>   app/test-bbdev/test_bbdev_perf.c | 16 ++++++++++++++++
>   1 file changed, 16 insertions(+)
> 
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
> index 9be360b225..405c22de44 100644
> --- a/app/test-bbdev/test_bbdev_perf.c
> +++ b/app/test-bbdev/test_bbdev_perf.c
> @@ -111,6 +111,8 @@ static uint32_t ldpc_cap_flags;
>   /* FFT window width predefined on device and on vector. */
>   static int fft_window_width_dev;
>   
> +bool dump_ops = true;
> +
>   /* Represents tested active devices */
>   static struct active_device {
>   	const char *driver_name;
> @@ -3109,6 +3111,20 @@ run_test_case_on_device(test_case_function *test_case_func, uint8_t dev_id,
>   	/* Run test case function */
>   	t_ret = test_case_func(ad, op_params);
>   
> +	if (dump_ops) {
> +		/* Dump queue information in local file. */
> +		static FILE *fd;
> +		fd = fopen("./dump_bbdev_queue_ops.txt", "w");
> +		if (fd == NULL) {
> +			printf("Open dump file error.\n");
> +			return -1;
> +		}
> +		rte_bbdev_queue_ops_dump(ad->dev_id, ad->queue_ids[i], fd);
> +		fclose(fd);
> +		/* Run it once only. */
> +		dump_ops = false;
> +	}
> +
>   	/* Free active device resources and return */
>   	free_buffers(ad, op_params);
>   	return t_ret;

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
  

Patch

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 9be360b225..405c22de44 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -111,6 +111,8 @@  static uint32_t ldpc_cap_flags;
 /* FFT window width predefined on device and on vector. */
 static int fft_window_width_dev;
 
+bool dump_ops = true;
+
 /* Represents tested active devices */
 static struct active_device {
 	const char *driver_name;
@@ -3109,6 +3111,20 @@  run_test_case_on_device(test_case_function *test_case_func, uint8_t dev_id,
 	/* Run test case function */
 	t_ret = test_case_func(ad, op_params);
 
+	if (dump_ops) {
+		/* Dump queue information in local file. */
+		static FILE *fd;
+		fd = fopen("./dump_bbdev_queue_ops.txt", "w");
+		if (fd == NULL) {
+			printf("Open dump file error.\n");
+			return -1;
+		}
+		rte_bbdev_queue_ops_dump(ad->dev_id, ad->queue_ids[i], fd);
+		fclose(fd);
+		/* Run it once only. */
+		dump_ops = false;
+	}
+
 	/* Free active device resources and return */
 	free_buffers(ad, op_params);
 	return t_ret;