* [PATCH v2 01/16] test/bbdev: fix seg fault for non supported HARQ len
[not found] <20230215170949.60569-1-hernan.vargas@intel.com>
@ 2023-02-15 17:09 ` Hernan Vargas
2023-02-20 16:08 ` Maxime Coquelin
2023-02-15 17:09 ` [PATCH v2 02/16] test/bbdev: extend HARQ tolerance Hernan Vargas
2023-02-15 17:09 ` [PATCH v2 12/16] test/bbdev: remove check for invalid opaque data Hernan Vargas
2 siblings, 1 reply; 6+ messages in thread
From: Hernan Vargas @ 2023-02-15 17:09 UTC (permalink / raw)
To: dev, maxime.coquelin, gakhil, trix
Cc: nicolas.chautru, qi.z.zhang, Hernan Vargas, stable
Fix segmentation fault happening in corner case in test-bbdev.
This fault could happen 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(-)
diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 45e1780df7..027f32cbf1 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
--
2.37.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 01/16] test/bbdev: fix seg fault for non supported HARQ len
2023-02-15 17:09 ` [PATCH v2 01/16] test/bbdev: fix seg fault for non supported HARQ len Hernan Vargas
@ 2023-02-20 16:08 ` Maxime Coquelin
0 siblings, 0 replies; 6+ messages in thread
From: Maxime Coquelin @ 2023-02-20 16:08 UTC (permalink / raw)
To: Hernan Vargas, dev, gakhil, trix; +Cc: nicolas.chautru, qi.z.zhang, stable
On 2/15/23 18:09, Hernan Vargas wrote:
> Fix segmentation fault happening in corner case in test-bbdev.
> This fault could happen 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(-)
>
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
> index 45e1780df7..027f32cbf1 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
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 02/16] test/bbdev: extend HARQ tolerance
[not found] <20230215170949.60569-1-hernan.vargas@intel.com>
2023-02-15 17:09 ` [PATCH v2 01/16] test/bbdev: fix seg fault for non supported HARQ len Hernan Vargas
@ 2023-02-15 17:09 ` Hernan Vargas
2023-02-20 16:09 ` Maxime Coquelin
2023-02-15 17:09 ` [PATCH v2 12/16] test/bbdev: remove check for invalid opaque data Hernan Vargas
2 siblings, 1 reply; 6+ messages in thread
From: Hernan Vargas @ 2023-02-15 17:09 UTC (permalink / raw)
To: dev, maxime.coquelin, gakhil, trix
Cc: nicolas.chautru, qi.z.zhang, Hernan Vargas, stable
HARQ memory implementation could have different size assumptions.
Extending HARQ tolerance to cover different implementations.
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 | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 027f32cbf1..74e7e13940 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -95,6 +95,7 @@
#define K0_3_1 56 /* K0 fraction numerator for rv 3 and BG 1 */
#define K0_3_2 43 /* K0 fraction numerator for rv 3 and BG 2 */
+#define HARQ_MEM_TOLERANCE 256
static struct test_bbdev_vector test_vector;
/* Switch between PMD and Interrupt for throughput TC */
@@ -2090,13 +2091,17 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
uint16_t data_len = rte_pktmbuf_data_len(m) - offset;
total_data_size += orig_op->segments[i].length;
- TEST_ASSERT(orig_op->segments[i].length <
- (uint32_t)(data_len + 64),
+ TEST_ASSERT(orig_op->segments[i].length < (uint32_t)(data_len + HARQ_MEM_TOLERANCE),
"Length of segment differ in original (%u) and filled (%u) op",
orig_op->segments[i].length, data_len);
harq_orig = (int8_t *) orig_op->segments[i].addr;
harq_out = rte_pktmbuf_mtod_offset(m, int8_t *, offset);
+ /* Cannot compare HARQ output data for such cases */
+ if ((ldpc_llr_decimals > 1) && ((ops_ld->op_flags & RTE_BBDEV_LDPC_LLR_COMPRESSION)
+ || (ops_ld->op_flags & RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION)))
+ break;
+
if (!(ldpc_cap_flags &
RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS
) || (ops_ld->op_flags &
@@ -2172,7 +2177,7 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
/* Validate total mbuf pkt length */
uint32_t pkt_len = rte_pktmbuf_pkt_len(op->data) - op->offset;
- TEST_ASSERT(total_data_size < pkt_len + 64,
+ TEST_ASSERT(total_data_size < pkt_len + HARQ_MEM_TOLERANCE,
"Length of data differ in original (%u) and filled (%u) op",
total_data_size, pkt_len);
--
2.37.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 02/16] test/bbdev: extend HARQ tolerance
2023-02-15 17:09 ` [PATCH v2 02/16] test/bbdev: extend HARQ tolerance Hernan Vargas
@ 2023-02-20 16:09 ` Maxime Coquelin
0 siblings, 0 replies; 6+ messages in thread
From: Maxime Coquelin @ 2023-02-20 16:09 UTC (permalink / raw)
To: Hernan Vargas, dev, gakhil, trix; +Cc: nicolas.chautru, qi.z.zhang, stable
On 2/15/23 18:09, Hernan Vargas wrote:
> HARQ memory implementation could have different size assumptions.
> Extending HARQ tolerance to cover different implementations.
>
> 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 | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
> index 027f32cbf1..74e7e13940 100644
> --- a/app/test-bbdev/test_bbdev_perf.c
> +++ b/app/test-bbdev/test_bbdev_perf.c
> @@ -95,6 +95,7 @@
> #define K0_3_1 56 /* K0 fraction numerator for rv 3 and BG 1 */
> #define K0_3_2 43 /* K0 fraction numerator for rv 3 and BG 2 */
>
> +#define HARQ_MEM_TOLERANCE 256
> static struct test_bbdev_vector test_vector;
>
> /* Switch between PMD and Interrupt for throughput TC */
> @@ -2090,13 +2091,17 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
> uint16_t data_len = rte_pktmbuf_data_len(m) - offset;
> total_data_size += orig_op->segments[i].length;
>
> - TEST_ASSERT(orig_op->segments[i].length <
> - (uint32_t)(data_len + 64),
> + TEST_ASSERT(orig_op->segments[i].length < (uint32_t)(data_len + HARQ_MEM_TOLERANCE),
> "Length of segment differ in original (%u) and filled (%u) op",
> orig_op->segments[i].length, data_len);
> harq_orig = (int8_t *) orig_op->segments[i].addr;
> harq_out = rte_pktmbuf_mtod_offset(m, int8_t *, offset);
>
> + /* Cannot compare HARQ output data for such cases */
> + if ((ldpc_llr_decimals > 1) && ((ops_ld->op_flags & RTE_BBDEV_LDPC_LLR_COMPRESSION)
> + || (ops_ld->op_flags & RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION)))
> + break;
> +
> if (!(ldpc_cap_flags &
> RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS
> ) || (ops_ld->op_flags &
> @@ -2172,7 +2177,7 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
>
> /* Validate total mbuf pkt length */
> uint32_t pkt_len = rte_pktmbuf_pkt_len(op->data) - op->offset;
> - TEST_ASSERT(total_data_size < pkt_len + 64,
> + TEST_ASSERT(total_data_size < pkt_len + HARQ_MEM_TOLERANCE,
> "Length of data differ in original (%u) and filled (%u) op",
> total_data_size, pkt_len);
>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 12/16] test/bbdev: remove check for invalid opaque data
[not found] <20230215170949.60569-1-hernan.vargas@intel.com>
2023-02-15 17:09 ` [PATCH v2 01/16] test/bbdev: fix seg fault for non supported HARQ len Hernan Vargas
2023-02-15 17:09 ` [PATCH v2 02/16] test/bbdev: extend HARQ tolerance Hernan Vargas
@ 2023-02-15 17:09 ` Hernan Vargas
2023-02-22 10:53 ` Maxime Coquelin
2 siblings, 1 reply; 6+ messages in thread
From: Hernan Vargas @ 2023-02-15 17:09 UTC (permalink / raw)
To: dev, maxime.coquelin, gakhil, trix
Cc: nicolas.chautru, qi.z.zhang, Hernan Vargas, stable
Assert also if the opaque data is invalid.
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 | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index a19eda2de8..2ce1c7e7d3 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -79,7 +79,6 @@
#define SYNC_WAIT 0
#define SYNC_START 1
-#define INVALID_OPAQUE -1
#define INVALID_QUEUE_ID -1
/* Increment for next code block in external HARQ memory */
@@ -1999,10 +1998,9 @@ check_enc_status_and_ordering(struct rte_bbdev_enc_op *op,
"op_status (%d) != expected_status (%d)",
op->status, expected_status);
- if (op->opaque_data != (void *)(uintptr_t)INVALID_OPAQUE)
- TEST_ASSERT((void *)(uintptr_t)order_idx == op->opaque_data,
- "Ordering error, expected %p, got %p",
- (void *)(uintptr_t)order_idx, op->opaque_data);
+ TEST_ASSERT((void *)(uintptr_t)order_idx == op->opaque_data,
+ "Ordering error, expected %p, got %p",
+ (void *)(uintptr_t)order_idx, op->opaque_data);
return TEST_SUCCESS;
}
--
2.37.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 12/16] test/bbdev: remove check for invalid opaque data
2023-02-15 17:09 ` [PATCH v2 12/16] test/bbdev: remove check for invalid opaque data Hernan Vargas
@ 2023-02-22 10:53 ` Maxime Coquelin
0 siblings, 0 replies; 6+ messages in thread
From: Maxime Coquelin @ 2023-02-22 10:53 UTC (permalink / raw)
To: Hernan Vargas, dev, gakhil, trix; +Cc: nicolas.chautru, qi.z.zhang, stable
On 2/15/23 18:09, Hernan Vargas wrote:
> Assert also if the opaque data is invalid.
New line needed before Fixes tag.
> 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 | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
> index a19eda2de8..2ce1c7e7d3 100644
> --- a/app/test-bbdev/test_bbdev_perf.c
> +++ b/app/test-bbdev/test_bbdev_perf.c
> @@ -79,7 +79,6 @@
>
> #define SYNC_WAIT 0
> #define SYNC_START 1
> -#define INVALID_OPAQUE -1
>
> #define INVALID_QUEUE_ID -1
> /* Increment for next code block in external HARQ memory */
> @@ -1999,10 +1998,9 @@ check_enc_status_and_ordering(struct rte_bbdev_enc_op *op,
> "op_status (%d) != expected_status (%d)",
> op->status, expected_status);
>
> - if (op->opaque_data != (void *)(uintptr_t)INVALID_OPAQUE)
> - TEST_ASSERT((void *)(uintptr_t)order_idx == op->opaque_data,
> - "Ordering error, expected %p, got %p",
> - (void *)(uintptr_t)order_idx, op->opaque_data);
> + TEST_ASSERT((void *)(uintptr_t)order_idx == op->opaque_data,
> + "Ordering error, expected %p, got %p",
> + (void *)(uintptr_t)order_idx, op->opaque_data);
>
> return TEST_SUCCESS;
> }
With typo fixed:
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
^ permalink raw reply [flat|nested] 6+ messages in thread