[v1,01/13] test/bbdev: fix seg fault for non supported HARQ len

Message ID 20230117165023.20567-2-hernan.vargas@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Maxime Coquelin
Headers
Series test/bbdev: changes for 23.03 |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Hernan Vargas Jan. 17, 2023, 4:50 p.m. UTC
  Catching a corner in bbdev-test (not in the actual PMD) when running
some specific vectors which size are not supported by the PMD.

Fixes: 335c11fd276 ("app/bbdev: support HARQ validation")
Cc: stable@dpdk.org

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
---
 app/test-bbdev/test_bbdev_perf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Maxime Coquelin Jan. 31, 2023, 9:20 a.m. UTC | #1
Hi Hernan,

On 1/17/23 17:50, Hernan Vargas wrote:
> Catching a corner in bbdev-test (not in the actual PMD) when running
> some specific vectors which size are not supported by the PMD.

Could you please reword the commit message, the title is clearer than
the commit message itself.

Also, the app name is test-bbdev.


> 
> Fixes: 335c11fd276 ("app/bbdev: support HARQ validation")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> ---
>   app/test-bbdev/test_bbdev_perf.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
> index 3818b74c79..cc7b5481d6 100644
> --- a/app/test-bbdev/test_bbdev_perf.c
> +++ b/app/test-bbdev/test_bbdev_perf.c
> @@ -84,7 +84,7 @@
>   /* Increment for next code block in external HARQ memory */
>   #define HARQ_INCR 32768
>   /* Headroom for filler LLRs insertion in HARQ buffer */
> -#define FILLER_HEADROOM 1024
> +#define FILLER_HEADROOM 2048
>   /* Constants from K0 computation from 3GPP 38.212 Table 5.4.2.1-2 */
>   #define N_ZC_1 66 /* N = 66 Zc for BG 1 */
>   #define N_ZC_2 50 /* N = 50 Zc for BG 2 */
> @@ -2111,9 +2111,9 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
>   					ops_ld->n_filler;
>   			if (data_len > deRmOutSize)
>   				data_len = deRmOutSize;
> -			if (data_len > orig_op->segments[i].length)
> -				data_len = orig_op->segments[i].length;
>   		}
> +		if (data_len > orig_op->segments[i].length)
> +			data_len = orig_op->segments[i].length;
>   		/*
>   		 * HARQ output can have minor differences
>   		 * due to integer representation and related scaling
  

Patch

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 3818b74c79..cc7b5481d6 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -84,7 +84,7 @@ 
 /* Increment for next code block in external HARQ memory */
 #define HARQ_INCR 32768
 /* Headroom for filler LLRs insertion in HARQ buffer */
-#define FILLER_HEADROOM 1024
+#define FILLER_HEADROOM 2048
 /* Constants from K0 computation from 3GPP 38.212 Table 5.4.2.1-2 */
 #define N_ZC_1 66 /* N = 66 Zc for BG 1 */
 #define N_ZC_2 50 /* N = 50 Zc for BG 2 */
@@ -2111,9 +2111,9 @@  validate_op_harq_chain(struct rte_bbdev_op_data *op,
 					ops_ld->n_filler;
 			if (data_len > deRmOutSize)
 				data_len = deRmOutSize;
-			if (data_len > orig_op->segments[i].length)
-				data_len = orig_op->segments[i].length;
 		}
+		if (data_len > orig_op->segments[i].length)
+			data_len = orig_op->segments[i].length;
 		/*
 		 * HARQ output can have minor differences
 		 * due to integer representation and related scaling