Re: [dpdk-dev] [PATCH v4 1/8] bbdev: add network order data capability

2021-04-26 Thread Dave Burley
Hi Hemant

Can I ask what the usage case is for 
RTE_BBDEV_LDPC_ENC_NETWORK_ORDER/RTE_BBDEV_LDPC_DEC_NETWORK_ORDER ?

Thanks

Dave




From: dev  on behalf of Hemant Agrawal 

Sent: 24 April 2021 11:36
To: dev@dpdk.org ; gak...@marvell.com ; 
nicolas.chau...@intel.com 
Cc: david.march...@redhat.com ; Hemant Agrawal 

Subject: [dpdk-dev] [PATCH v4 1/8] bbdev: add network order data capability

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

This patch intoduces a new capability of the bbdev device
to process the LDPC data in network byte order.

Signed-off-by: Hemant Agrawal 
---
 doc/guides/bbdevs/features/default.ini | 1 +
 doc/guides/prog_guide/bbdev.rst| 6 ++
 lib/bbdev/rte_bbdev_op.h   | 8 ++--
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/doc/guides/bbdevs/features/default.ini 
b/doc/guides/bbdevs/features/default.ini
index 5fe267a625..e5da644099 100644
--- a/doc/guides/bbdevs/features/default.ini
+++ b/doc/guides/bbdevs/features/default.ini
@@ -14,3 +14,4 @@ LLR/HARQ Compression   =
 External DDR Access=
 HW Accelerated =
 BBDEV API  =
+Network Order Data =
diff --git a/doc/guides/prog_guide/bbdev.rst b/doc/guides/prog_guide/bbdev.rst
index 6b2bd54e1a..89a86d10fb 100644
--- a/doc/guides/prog_guide/bbdev.rst
+++ b/doc/guides/prog_guide/bbdev.rst
@@ -747,6 +747,9 @@ given below.
 |RTE_BBDEV_LDPC_ENC_CONCATENATION|
 | Set if a device supports concatenation of non byte aligned output  |
 ++
+|RTE_BBDEV_LDPC_ENC_NETWORK_ORDER|
+| Set if a device supports network order data processing |
+++

 The structure passed for each LDPC encode operation is given below,
 with the operation flags forming a bitmask in the ``op_flags`` field.
@@ -942,6 +945,9 @@ given below.
 |RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK|
 | Set if a device supports loopback access to HARQ internal memory   |
 ++
+|RTE_BBDEV_LDPC_DEC_NETWORK_ORDER|
+| Set if a device supports network order data processing |
+++

 The structure passed for each LDPC decode operation is given below,
 with the operation flags forming a bitmask in the ``op_flags`` field.
diff --git a/lib/bbdev/rte_bbdev_op.h b/lib/bbdev/rte_bbdev_op.h
index f946842727..8fab617768 100644
--- a/lib/bbdev/rte_bbdev_op.h
+++ b/lib/bbdev/rte_bbdev_op.h
@@ -186,7 +186,9 @@ enum rte_bbdev_op_ldpcdec_flag_bitmasks {
 *  for HARQ memory. If not set, it is assumed the filler bits are not
 *  in HARQ memory and handled directly by the LDPC decoder.
 */
-   RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS = (1ULL << 18)
+   RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS = (1ULL << 18),
+   /** Set if a device supports network order data processing */
+   RTE_BBDEV_LDPC_DEC_NETWORK_ORDER = (1ULL << 19)
 };

 /** Flags for LDPC encoder operation and capability structure */
@@ -206,7 +208,9 @@ enum rte_bbdev_op_ldpcenc_flag_bitmasks {
/** Set if a device supports scatter-gather functionality. */
RTE_BBDEV_LDPC_ENC_SCATTER_GATHER = (1ULL << 6),
/** Set if a device supports concatenation of non byte aligned output */
-   RTE_BBDEV_LDPC_ENC_CONCATENATION = (1ULL << 7)
+   RTE_BBDEV_LDPC_ENC_CONCATENATION = (1ULL << 7),
+   /** Set if a device supports network order data processing */
+   RTE_BBDEV_LDPC_ENC_NETWORK_ORDER = (1ULL << 8)
 };

 /** Flags for the Code Block/Transport block mode  */
--
2.17.1



Re: [dpdk-dev] [PATCH v3 01/14] bbdev: add capability flag for filler bits inclusion in HARQ

2020-03-13 Thread Dave Burley

Acked-by: Dave Burley 

On 04/03/2020 18:54, Nicolas Chautru wrote:

From: Nic Chautru 

Adding capability flag for device variants when HARQ buffer
may or may not include the filler bits.
Minor cosmetic changes in same file.

Signed-off-by: Nic Chautru 
---
  lib/librte_bbdev/rte_bbdev.h|  2 ++
  lib/librte_bbdev/rte_bbdev_op.h | 12 ++--
  2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/lib/librte_bbdev/rte_bbdev.h b/lib/librte_bbdev/rte_bbdev.h
index 591fb79..b2da190 100644
--- a/lib/librte_bbdev/rte_bbdev.h
+++ b/lib/librte_bbdev/rte_bbdev.h
@@ -607,6 +607,7 @@ struct __rte_cache_aligned rte_bbdev {
   * @param ops
   *   Pointer array where operations will be dequeued to. Must have at least
   *   @p num_ops entries
+ *   ie. A pointer to a table of void * pointers (ops) that will be filled.
   * @param num_ops
   *   The maximum number of operations to dequeue.
   *
@@ -638,6 +639,7 @@ struct __rte_cache_aligned rte_bbdev {
   * @param ops
   *   Pointer array where operations will be dequeued to. Must have at least
   *   @p num_ops entries
+ *   ie. A pointer to a table of void * pointers (ops) that will be filled.
   * @param num_ops
   *   The maximum number of operations to dequeue.
   *
diff --git a/lib/librte_bbdev/rte_bbdev_op.h b/lib/librte_bbdev/rte_bbdev_op.h
index 1e119a7..062f9ff 100644
--- a/lib/librte_bbdev/rte_bbdev_op.h
+++ b/lib/librte_bbdev/rte_bbdev_op.h
@@ -31,8 +31,11 @@
  #define RTE_BBDEV_TURBO_MAX_TB_SIZE (391656)
  /* Maximum size of Code Block (36.212, Table 5.1.3-3) */
  #define RTE_BBDEV_TURBO_MAX_CB_SIZE (6144)
-/* Maximum size of Code Block  */
+/* Maximum size of Code Block */
  #define RTE_BBDEV_LDPC_MAX_CB_SIZE (8448)
+/* Minimum size of Code Block */
+#define RTE_BBDEV_LDPC_MIN_CB_SIZE (40)
+
  /* Minimum size of Code Block (36.212, Table 5.1.3-3) */
  #define RTE_BBDEV_TURBO_MIN_CB_SIZE (40)
  /* Maximum size of circular buffer */
@@ -177,7 +180,12 @@ enum rte_bbdev_op_ldpcdec_flag_bitmasks {
/** Set if a device supports loop-back access to
 *  HARQ internal memory. Intended for troubleshooting.
 */
-   RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK = (1ULL << 17)
+   RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK = (1ULL << 17),
+   /** Set if a device includes LLR filler bits in the circular buffer
+*  for HARQ memory. If not set, it is assumed the filler are not in
+*  HARQ memory and handled directory by the LDPC decoder.
+*/
+   RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS = (1ULL << 18)
  };
  
  /** Flags for LDPC encoder operation and capability structure */


Re: [dpdk-dev] [PATCH v3 02/14] bbdev: expose device HARQ buffer size at device level

2020-03-13 Thread Dave Burley

Acked-by: Dave Burley 

On 04/03/2020 18:54, Nicolas Chautru wrote:

From: Nic Chautru 

This exposes the HARQ buffer size at the device driver level
instead of using the capability of a specific operation.

This is currently not yet used by a device until
future commit.

Signed-off-by: Nic Chautru 
---
  drivers/baseband/turbo_sw/bbdev_turbo_software.c | 2 +-
  lib/librte_bbdev/rte_bbdev.h | 2 ++
  lib/librte_bbdev/rte_bbdev_op.h  | 2 --
  3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/baseband/turbo_sw/bbdev_turbo_software.c 
b/drivers/baseband/turbo_sw/bbdev_turbo_software.c
index f2fe7a2..6d5e080 100644
--- a/drivers/baseband/turbo_sw/bbdev_turbo_software.c
+++ b/drivers/baseband/turbo_sw/bbdev_turbo_software.c
@@ -219,7 +219,6 @@ struct turbo_sw_queue {
RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE,
.llr_size = 8,
.llr_decimals = 2,
-   .harq_memory_size = 0,
.num_buffers_src =
RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,
.num_buffers_hard_out =
@@ -251,6 +250,7 @@ struct turbo_sw_queue {
dev_info->default_queue_conf = default_queue_conf;
dev_info->capabilities = bbdev_capabilities;
dev_info->min_alignment = 64;
+   dev_info->harq_buffer_size = 0;
  
  	rte_bbdev_log_debug("got device info from %u\n", dev->data->dev_id);

  }
diff --git a/lib/librte_bbdev/rte_bbdev.h b/lib/librte_bbdev/rte_bbdev.h
index b2da190..38d9d50 100644
--- a/lib/librte_bbdev/rte_bbdev.h
+++ b/lib/librte_bbdev/rte_bbdev.h
@@ -307,6 +307,8 @@ struct rte_bbdev_driver_info {
bool queue_intr_supported;
/** Minimum alignment of buffers, in bytes */
uint16_t min_alignment;
+   /** HARQ memory available in kB */
+   uint32_t harq_buffer_size;
/** Default queue configuration used if none is supplied  */
struct rte_bbdev_queue_conf default_queue_conf;
/** Device operation capabilities */
diff --git a/lib/librte_bbdev/rte_bbdev_op.h b/lib/librte_bbdev/rte_bbdev_op.h
index 062f9ff..8122089 100644
--- a/lib/librte_bbdev/rte_bbdev_op.h
+++ b/lib/librte_bbdev/rte_bbdev_op.h
@@ -712,8 +712,6 @@ struct rte_bbdev_op_cap_ldpc_dec {
int8_t llr_size;
/** LLR numbers of decimals bit for arithmetic representation */
int8_t llr_decimals;
-   /** Amount of memory for HARQ in external DDR in MB */
-   uint16_t harq_memory_size;
/** Num input code block buffers */
uint16_t num_buffers_src;
/** Num hard output code block buffers */


Re: [dpdk-dev] [PATCH v3 05/14] test-bbdev: rename FPGA LTE macros to be more explicit

2020-03-13 Thread Dave Burley

Acked-by: Dave Burley 

On 04/03/2020 18:54, Nicolas Chautru wrote:

From: Nic Chautru 

Self-contained and cosmetic renaming of macro
so that to be more explicit for future extension.

Signed-off-by: Nic Chautru 
---
  app/test-bbdev/test_bbdev_perf.c | 51 +++-
  1 file changed, 19 insertions(+), 32 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index d46966d..aa8bb71 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -18,10 +18,6 @@
  #include 
  #include 
  
-#ifdef RTE_LIBRTE_PMD_BBDEV_FPGA_LTE_FEC

-#include 
-#endif
-
  #include "main.h"
  #include "test_bbdev_vector.h"
  
@@ -31,15 +27,16 @@

  #define TEST_REPETITIONS 1000
  
  #ifdef RTE_LIBRTE_PMD_BBDEV_FPGA_LTE_FEC

-#define FPGA_PF_DRIVER_NAME ("intel_fpga_lte_fec_pf")
-#define FPGA_VF_DRIVER_NAME ("intel_fpga_lte_fec_vf")
-#define VF_UL_QUEUE_VALUE 4
-#define VF_DL_QUEUE_VALUE 4
-#define UL_BANDWIDTH 3
-#define DL_BANDWIDTH 3
-#define UL_LOAD_BALANCE 128
-#define DL_LOAD_BALANCE 128
-#define FLR_TIMEOUT 610
+#include 
+#define FPGA_LTE_PF_DRIVER_NAME ("intel_fpga_lte_fec_pf")
+#define FPGA_LTE_VF_DRIVER_NAME ("intel_fpga_lte_fec_vf")
+#define VF_UL_4G_QUEUE_VALUE 4
+#define VF_DL_4G_QUEUE_VALUE 4
+#define UL_4G_BANDWIDTH 3
+#define DL_4G_BANDWIDTH 3
+#define UL_4G_LOAD_BALANCE 128
+#define DL_4G_LOAD_BALANCE 128
+#define FLR_4G_TIMEOUT 610
  #endif
  
  #define OPS_CACHE_SIZE 256U

@@ -521,11 +518,11 @@ typedef int (test_case_function)(struct active_device *ad,
   */
  #ifdef RTE_LIBRTE_PMD_BBDEV_FPGA_LTE_FEC
if ((get_init_device() == true) &&
-   (!strcmp(info->drv.driver_name, FPGA_PF_DRIVER_NAME))) {
+   (!strcmp(info->drv.driver_name, FPGA_LTE_PF_DRIVER_NAME))) {
struct fpga_lte_fec_conf conf;
unsigned int i;
  
-		printf("Configure FPGA FEC Driver %s with default values\n",

+   printf("Configure FPGA LTE FEC Driver %s with default values\n",
info->drv.driver_name);
  
  		/* clear default configuration before initialization */

@@ -539,22 +536,22 @@ typedef int (test_case_function)(struct active_device *ad,
  
  		for (i = 0; i < FPGA_LTE_FEC_NUM_VFS; ++i) {

/* Number of UL queues per VF (fpga supports 8 VFs) */
-   conf.vf_ul_queues_number[i] = VF_UL_QUEUE_VALUE;
+   conf.vf_ul_queues_number[i] = VF_UL_4G_QUEUE_VALUE;
/* Number of DL queues per VF (fpga supports 8 VFs) */
-   conf.vf_dl_queues_number[i] = VF_DL_QUEUE_VALUE;
+   conf.vf_dl_queues_number[i] = VF_DL_4G_QUEUE_VALUE;
}
  
  		/* UL bandwidth. Needed for schedule algorithm */

-   conf.ul_bandwidth = UL_BANDWIDTH;
+   conf.ul_bandwidth = UL_4G_BANDWIDTH;
/* DL bandwidth */
-   conf.dl_bandwidth = DL_BANDWIDTH;
+   conf.dl_bandwidth = DL_4G_BANDWIDTH;
  
  		/* UL & DL load Balance Factor to 64 */

-   conf.ul_load_balance = UL_LOAD_BALANCE;
-   conf.dl_load_balance = DL_LOAD_BALANCE;
+   conf.ul_load_balance = UL_4G_LOAD_BALANCE;
+   conf.dl_load_balance = DL_4G_LOAD_BALANCE;
  
  		/**< FLR timeout value */

-   conf.flr_time_out = FLR_TIMEOUT;
+   conf.flr_time_out = FLR_4G_TIMEOUT;
  
  		/* setup FPGA PF with configuration information */

ret = fpga_lte_fec_configure(info->dev_name, &conf);
@@ -2862,11 +2859,6 @@ typedef int (test_case_function)(struct active_device 
*ad,
  
  		start_time = rte_rdtsc_precise();
  
-		/*

-* printf("Latency Debug %d\n",
-* ops_enq[0]->ldpc_enc.cb_params.z_c); REMOVEME
-*/
-
enq = rte_bbdev_enqueue_ldpc_enc_ops(dev_id, queue_id,
&ops_enq[enq], burst_sz);
TEST_ASSERT(enq == burst_sz,
@@ -2892,11 +2884,6 @@ typedef int (test_case_function)(struct active_device 
*ad,
TEST_ASSERT_SUCCESS(ret, "Validation failed!");
}
  
-		/*

-* printf("Ready to free - deq %d num_to_process %d\n", FIXME
-*  deq, num_to_process);
-* printf("cache %d\n", ops_enq[0]->mempool->cache_size);
-*/
rte_bbdev_enc_op_free_bulk(ops_enq, deq);
dequeued += deq;
}


Re: [dpdk-dev] [PATCH v3 07/14] test-bbdev: support for performance tests

2020-03-13 Thread Dave Burley

Acked-by: Dave Burley 

On 04/03/2020 18:54, Nicolas Chautru wrote:

From: Nic Chautru 

Includes support for BLER wireless performance test with
new arguments for SNR and number of iterations for 5G.

Signed-off-by: Nic Chautru 
---
  app/test-bbdev/main.c|  29 ++-
  app/test-bbdev/main.h|   9 +-
  app/test-bbdev/test_bbdev_perf.c | 523 ++-
  3 files changed, 548 insertions(+), 13 deletions(-)

diff --git a/app/test-bbdev/main.c b/app/test-bbdev/main.c
index 8a42115..ff65173 100644
--- a/app/test-bbdev/main.c
+++ b/app/test-bbdev/main.c
@@ -29,6 +29,8 @@
unsigned int num_ops;
unsigned int burst_sz;
unsigned int num_lcores;
+   double snr;
+   unsigned int iter_max;
char test_vector_filename[PATH_MAX];
bool init_device;
  } test_params;
@@ -140,6 +142,18 @@
return test_params.num_lcores;
  }
  
+double

+get_snr(void)
+{
+   return test_params.snr;
+}
+
+unsigned int
+get_iter_max(void)
+{
+   return test_params.iter_max;
+}
+
  bool
  get_init_device(void)
  {
@@ -180,12 +194,15 @@
{ "test-cases", 1, 0, 'c' },
{ "test-vector", 1, 0, 'v' },
{ "lcores", 1, 0, 'l' },
+   { "snr", 1, 0, 's' },
+   { "iter_max", 6, 0, 't' },
{ "init-device", 0, 0, 'i'},
{ "help", 0, 0, 'h' },
{ NULL,  0, 0, 0 }
};
+   tp->iter_max = DEFAULT_ITER;
  
-	while ((opt = getopt_long(argc, argv, "hin:b:c:v:l:", lgopts,

+   while ((opt = getopt_long(argc, argv, "hin:b:c:v:l:s:t:", lgopts,
&option_index)) != EOF)
switch (opt) {
case 'n':
@@ -237,6 +254,16 @@
sizeof(tp->test_vector_filename),
"%s", optarg);
break;
+   case 's':
+   TEST_ASSERT(strlen(optarg) > 0,
+   "SNR is not provided");
+   tp->snr = strtod(optarg, NULL);
+   break;
+   case 't':
+   TEST_ASSERT(strlen(optarg) > 0,
+   "Iter_max is not provided");
+   tp->iter_max = strtol(optarg, NULL, 10);
+   break;
case 'l':
TEST_ASSERT(strlen(optarg) > 0,
"Num of lcores is not provided");
diff --git a/app/test-bbdev/main.h b/app/test-bbdev/main.h
index 23b4d58..fb3dec8 100644
--- a/app/test-bbdev/main.h
+++ b/app/test-bbdev/main.h
@@ -19,6 +19,8 @@
  #define MAX_BURST 512U
  #define DEFAULT_BURST 32U
  #define DEFAULT_OPS 64U
+#define DEFAULT_ITER 6U
+
  
  
  #define TEST_ASSERT(cond, msg, ...) do {  \

@@ -104,8 +106,7 @@ struct test_command {
.command = RTE_STR(name), \
.callback = test_func_##name, \
}; \
-   static void __attribute__((constructor, used)) \
-   test_register_##name(void) \
+   RTE_INIT(test_register_##name) \
{ \
add_test_command(&test_struct_##name); \
}
@@ -118,6 +119,10 @@ struct test_command {
  
  unsigned int get_num_lcores(void);
  
+double get_snr(void);

+
+unsigned int get_iter_max(void);
+
  bool get_init_device(void);
  
  #endif

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 978ccd6..7bc824b 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -111,6 +111,8 @@ struct thread_params {
double ops_per_sec;
double mbps;
uint8_t iter_count;
+   double iter_average;
+   double bler;
rte_atomic16_t nb_dequeued;
rte_atomic16_t processing_status;
rte_atomic16_t burst_sz;
@@ -1204,6 +1206,213 @@ typedef int (test_case_function)(struct active_device 
*ad,
}
  }
  
+

+/* Returns a random number drawn from a normal distribution
+ * with mean of 0 and variance of 1
+ * Marsaglia algorithm
+ */
+static double
+randn(int n)
+{
+   double S, Z, U1, U2, u, v, fac;
+
+   do {
+   U1 = (double)rand() / RAND_MAX;
+   U2 = (double)rand() / RAND_MAX;
+   u = 2. * U1 - 1.;
+   v = 2. * U2 - 1.;
+   S = u * u + v * v;
+   } while (S >= 1 || S == 0);
+   fac = sqrt(-2. * log(S) / S);
+   Z = (n % 2) ? u * fac : v * fac;
+   return Z;
+}
+
+static inline double
+maxstar(double A, double B)
+{
+   if (fabs(A - B) > 5)
+   return fmax(A, B);
+   else
+   retur

Re: [dpdk-dev] [PATCH v3 08/14] test-bbdev: support for LDPC interrupt test

2020-03-13 Thread Dave Burley

Acked-by: Dave Burley 

On 04/03/2020 18:54, Nicolas Chautru wrote:

From: Nic Chautru 

Adding missing implementation for the interrupt tests
for LDPC encoder and decoders.

Signed-off-by: Nic Chautru 
---
  app/test-bbdev/test_bbdev_perf.c | 202 ++-
  1 file changed, 200 insertions(+), 2 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 7bc824b..8fcdda0 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -745,6 +745,9 @@ typedef int (test_case_function)(struct active_device *ad,
/* Clear active devices structs. */
memset(active_devs, 0, sizeof(active_devs));
nb_active_devs = 0;
+
+   /* Disable interrupts */
+   intr_enabled = false;
  }
  
  static int

@@ -2457,6 +2460,109 @@ typedef int (test_case_function)(struct active_device 
*ad,
  }
  
  static int

+throughput_intr_lcore_ldpc_dec(void *arg)
+{
+   struct thread_params *tp = arg;
+   unsigned int enqueued;
+   const uint16_t queue_id = tp->queue_id;
+   const uint16_t burst_sz = tp->op_params->burst_sz;
+   const uint16_t num_to_process = tp->op_params->num_to_process;
+   struct rte_bbdev_dec_op *ops[num_to_process];
+   struct test_buffers *bufs = NULL;
+   struct rte_bbdev_info info;
+   int ret, i, j;
+   struct rte_bbdev_dec_op *ref_op = tp->op_params->ref_dec_op;
+   uint16_t num_to_enq, enq;
+
+   bool loopback = check_bit(ref_op->ldpc_dec.op_flags,
+   RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK);
+   bool hc_out = check_bit(ref_op->ldpc_dec.op_flags,
+   RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE);
+
+   TEST_ASSERT_SUCCESS((burst_sz > MAX_BURST),
+   "BURST_SIZE should be <= %u", MAX_BURST);
+
+   TEST_ASSERT_SUCCESS(rte_bbdev_queue_intr_enable(tp->dev_id, queue_id),
+   "Failed to enable interrupts for dev: %u, queue_id: %u",
+   tp->dev_id, queue_id);
+
+   rte_bbdev_info_get(tp->dev_id, &info);
+
+   TEST_ASSERT_SUCCESS((num_to_process > info.drv.queue_size_lim),
+   "NUM_OPS cannot exceed %u for this device",
+   info.drv.queue_size_lim);
+
+   bufs = &tp->op_params->q_bufs[GET_SOCKET(info.socket_id)][queue_id];
+
+   rte_atomic16_clear(&tp->processing_status);
+   rte_atomic16_clear(&tp->nb_dequeued);
+
+   while (rte_atomic16_read(&tp->op_params->sync) == SYNC_WAIT)
+   rte_pause();
+
+   ret = rte_bbdev_dec_op_alloc_bulk(tp->op_params->mp, ops,
+   num_to_process);
+   TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops",
+   num_to_process);
+   if (test_vector.op_type != RTE_BBDEV_OP_NONE)
+   copy_reference_ldpc_dec_op(ops, num_to_process, 0, bufs->inputs,
+   bufs->hard_outputs, bufs->soft_outputs,
+   bufs->harq_inputs, bufs->harq_outputs, ref_op);
+
+   /* Set counter to validate the ordering */
+   for (j = 0; j < num_to_process; ++j)
+   ops[j]->opaque_data = (void *)(uintptr_t)j;
+
+   for (j = 0; j < TEST_REPETITIONS; ++j) {
+   for (i = 0; i < num_to_process; ++i) {
+   if (!loopback)
+   rte_pktmbuf_reset(
+   ops[i]->ldpc_dec.hard_output.data);
+   if (hc_out || loopback)
+   mbuf_reset(
+   ops[i]->ldpc_dec.harq_combined_output.data);
+   }
+
+   tp->start_time = rte_rdtsc_precise();
+   for (enqueued = 0; enqueued < num_to_process;) {
+   num_to_enq = burst_sz;
+
+   if (unlikely(num_to_process - enqueued < num_to_enq))
+   num_to_enq = num_to_process - enqueued;
+
+   enq = 0;
+   do {
+   enq += rte_bbdev_enqueue_ldpc_dec_ops(
+   tp->dev_id,
+   queue_id, &ops[enqueued],
+   num_to_enq);
+   } while (unlikely(num_to_enq != enq));
+   enqueued += enq;
+
+   /* Write to thread burst_sz current number of enqueued
+* descriptors. It ensures that proper number of
+* descriptors will be dequeued in callback
+* function - needed for last batch in case where
+* t

Re: [dpdk-dev] [PATCH v3 11/14] doc: update of testbbdev documentation

2020-03-13 Thread Dave Burley

Acked-by: Dave Burley 

On 04/03/2020 18:54, Nicolas Chautru wrote:

From: Nic Chautru 

Update related to the changes introduced by the
previous commits.

Signed-off-by: Nic Chautru 
---
  doc/guides/tools/testbbdev.rst | 337 +++--
  1 file changed, 291 insertions(+), 46 deletions(-)

diff --git a/doc/guides/tools/testbbdev.rst b/doc/guides/tools/testbbdev.rst
index 7e95696..016f3f9 100644
--- a/doc/guides/tools/testbbdev.rst
+++ b/doc/guides/tools/testbbdev.rst
@@ -6,9 +6,9 @@ dpdk-test-bbdev Application
  
  The ``dpdk-test-bbdev`` tool is a Data Plane Development Kit (DPDK) utility that

  allows measuring performance parameters of PMDs available in the bbdev 
framework.
-Available tests available for execution are: latency, throughput, validation 
and
-sanity tests. Execution of tests can be customized using various parameters
-passed to a python running script.
+Available tests available for execution are: latency, throughput, validation,
+bler and sanity tests. Execution of tests can be customized using various
+parameters passed to a python running script.
  
  Compiling the Application

  -
@@ -47,6 +47,8 @@ The tool application has a number of command line options:
 [-c TEST_CASE [TEST_CASE ...]]
 [-v TEST_VECTOR [TEST_VECTOR...]] [-n NUM_OPS]
 [-b BURST_SIZE [BURST_SIZE ...]] [-l NUM_LCORES]
+   [-t MAX_ITERS [MAX_ITERS ...]]
+   [-s SNR [SNR ...]]
  
  command-line Options

  
@@ -106,10 +108,18 @@ The following are the command-line options:
   Specifies operations enqueue/dequeue burst size. If not specified burst_size 
is
   set to 32. Maximum is 512.
  
+``-t MAX_ITERS [MAX_ITERS ...], --iter_max MAX_ITERS [MAX_ITERS ...]``

+ Specifies LDPC decoder operations maximum number of iterations for throughput
+ and bler tests. If not specified iter_max is set to 6.
+
+``-s SNR [SNR ...], --snr SNR [SNR ...]``
+ Specifies for LDPC decoder operations the SNR in dB used when generating LLRs
+ for bler tests. If not specified snr is set to 0 dB.
+
  Test Cases
  ~~
  
-There are 6 main test cases that can be executed using testbbdev tool:

+There are 7 main test cases that can be executed using testbbdev tool:
  
  * Sanity checks [-c unittest]

  - Performs sanity checks on BBDEV interface, validating basic 
functionality
@@ -149,6 +159,11 @@ There are 6 main test cases that can be executed using 
testbbdev tool:
  - Results are printed in million operations per second and million bits
per second
  
+* BLER measurement [-c bler]

+- Performs full operation of enqueue and dequeue
+- Measures the achieved throughput on a subset or all available CPU cores
+- Computed BLER in % based on the total number of operations.
+
  * Interrupt-mode Throughput [-c interrupt]
  - Similar to Throughput test case, but using interrupts. No polling.
  
@@ -159,7 +174,7 @@ Parameter Globbing

  Thanks to the globbing functionality in python test-bbdev.py script allows to
  run tests with different set of vector files without giving all of them 
explicitly.
  
-**Example usage:**

+**Example usage for 4G:**
  
  .. code-block:: console
  
@@ -221,6 +236,11 @@ It runs all tests with "default" vectors.

  * ``turbo_enc_default.data`` is a soft link to
``turbo_enc_c1_k6144_r0_e32256_crc24b_rm.data``
  
+* ``ldpc_dec_default.data`` is a soft link to

+  ``ldpc_dec_v6563.data``
+
+* ``ldpc_enc_default.data`` is a soft link to
+  ``ldpc_enc_c1_k8148_r0_e9372_rm.data``
  
  Running Tests

  -
@@ -254,6 +274,38 @@ x86_64-native-linux-icc target:
   |-- turbo_dec_c1_k6144_r0_e34560_posllr.data
   |-- turbo_enc_c1_k40_r0_e1194_rm.data
   |-- turbo_enc_c1_k6144_r0_e32256_crc24b_rm.data
+ |-- ldpc_enc_v9503.data
+ |-- ldpc_enc_v8568.data
+ |-- ldpc_enc_v7813.data
+ |-- ldpc_enc_v2342.data
+ |-- ldpc_enc_v11835.data
+ |-- ldpc_dec_v8568.data
+ |-- ldpc_dec_v8480.data
+ |-- ldpc_dec_v7813.data
+ |-- ldpc_dec_v2342_drop.data
+ |-- ldpc_dec_v11835.data
+ |-- ldpc_dec_HARQ_1_2.data
+ |-- ldpc_dec_HARQ_1_1.data
+ |-- ldpc_dec_HARQ_1_0.data
+ |-- ldpc_enc_v8568_crc24a.data
+ |-- ldpc_enc_v3964_rv1.data
+ |-- ldpc_enc_c1_k8148_r0_e9372_rm.data
+ |-- ldpc_enc_c1_k720_r0_e864_rm_crc24b.data
+ |-- ldpc_enc_c1_k720_r0_e832_rm.data
+ |-- ldpc_enc_c1_k330_r0_e360_rm.data
+ |-- ldpc_enc_c1_k1144_r0_e1380_rm_crc24b.data
+ |-- ldpc_enc_c1_k1144_r0_e1380_rm.data
+ |-- ldpc_dec_vcrc_fail.data
+ |-- ldpc_dec_v8568_low.data
+ |-- ldpc_dec_v14298.data
+ |-- ldpc_dec_HA

Re: [dpdk-dev] [PATCH v3 12/14] drivers/baseband: add PMD for FPGA 5GNR FEC

2020-03-13 Thread Dave Burley

Acked-by: Dave Burley 

On 04/03/2020 18:55, Nicolas Chautru wrote:

From: Nic Chautru 

Supports for FEC 5G PMD Driver on FPGA card PAC N3000

Signed-off-by: Nic Chautru 
---
  config/common_base |5 +
  doc/guides/bbdevs/fpga_5gnr_fec.rst|  297 +++
  doc/guides/bbdevs/index.rst|1 +
  doc/guides/rel_notes/release_20_05.rst |6 +
  drivers/baseband/Makefile  |2 +
  drivers/baseband/fpga_5gnr_fec/Makefile|   29 +
  drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.c | 2552 
  drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h |   74 +
  drivers/baseband/fpga_5gnr_fec/meson.build |6 +
  .../rte_pmd_bbdev_fpga_5gnr_fec_version.map|   10 +
  drivers/baseband/meson.build   |2 +-
  mk/rte.app.mk  |1 +
  12 files changed, 2984 insertions(+), 1 deletion(-)
  create mode 100644 doc/guides/bbdevs/fpga_5gnr_fec.rst
  create mode 100644 drivers/baseband/fpga_5gnr_fec/Makefile
  create mode 100644 drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.c
  create mode 100644 drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h
  create mode 100644 drivers/baseband/fpga_5gnr_fec/meson.build
  create mode 100644 
drivers/baseband/fpga_5gnr_fec/rte_pmd_bbdev_fpga_5gnr_fec_version.map

diff --git a/config/common_base b/config/common_base
index 7ca2f28..7280ee2 100644
--- a/config/common_base
+++ b/config/common_base
@@ -578,6 +578,11 @@ CONFIG_RTE_LIBRTE_PMD_BBDEV_TURBO_SW=y
  CONFIG_RTE_LIBRTE_PMD_BBDEV_FPGA_LTE_FEC=y
  
  #

+# Compile PMD for Intel FPGA 5GNR FEC bbdev device
+#
+CONFIG_RTE_LIBRTE_PMD_BBDEV_FPGA_5GNR_FEC=y
+
+#
  # Compile generic crypto device library
  #
  CONFIG_RTE_LIBRTE_CRYPTODEV=y
diff --git a/doc/guides/bbdevs/fpga_5gnr_fec.rst 
b/doc/guides/bbdevs/fpga_5gnr_fec.rst
new file mode 100644
index 000..5641b1a
--- /dev/null
+++ b/doc/guides/bbdevs/fpga_5gnr_fec.rst
@@ -0,0 +1,297 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+Copyright(c) 2019 Intel Corporation
+
+Intel(R) FPGA 5GNR FEC Poll Mode Driver
+==
+
+The BBDEV FPGA 5GNR FEC poll mode driver (PMD) supports an FPGA implementation 
of a VRAN
+LDPC Encode / Decode 5GNR wireless acceleration function, using Intel's PCI-e 
and FPGA
+based Vista Creek device.
+
+Features
+
+
+FPGA 5GNR FEC PMD supports the following features:
+
+- LDPC Encode in the DL
+- LDPC Decode in the UL
+- 8 VFs per PF (physical device)
+- Maximum of 32 UL queues per VF
+- Maximum of 32 DL queues per VF
+- PCIe Gen-3 x8 Interface
+- MSI-X
+- SR-IOV
+
+FPGA 5GNR FEC PMD supports the following BBDEV capabilities:
+
+* For the LDPC encode operation:
+   - ``RTE_BBDEV_LDPC_CRC_24B_ATTACH`` :  set to attach CRC24B to CB(s)
+   - ``RTE_BBDEV_LDPC_RATE_MATCH`` :  if set then do not do Rate Match bypass
+
+* For the LDPC decode operation:
+   - ``RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK`` :  check CRC24B from CB(s)
+   - ``RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE`` :  disable early termination
+   - ``RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP`` :  drops CRC24B bits appended while 
decoding
+   - ``RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE`` :  provides an input for HARQ 
combining
+   - ``RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE`` :  provides an input for HARQ 
combining
+   - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE`` :  HARQ memory input is 
internal
+   - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE`` :  HARQ memory output 
is internal
+   - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK`` :  loopback data to/from 
HARQ memory
+   - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS`` :  HARQ memory includes 
the fillers bits
+
+
+Limitations
+---
+
+FPGA 5GNR FEC does not support the following:
+
+- Scatter-Gather function
+
+
+Installation
+--
+
+Section 3 of the DPDK manual provides instuctions on installing and compiling 
DPDK. The
+default set of bbdev compile flags may be found in config/common_base, where 
for example
+the flag to build the FPGA 5GNR FEC device, 
``CONFIG_RTE_LIBRTE_PMD_BBDEV_FPGA_5GNR_FEC``,
+is already set. It is assumed DPDK has been compiled using for instance:
+
+.. code-block:: console
+
+  make install T=x86_64-native-linuxapp-gcc
+
+
+DPDK requires hugepages to be configured as detailed in section 2 of the DPDK 
manual.
+The bbdev test application has been tested with a configuration 40 x 1GB 
hugepages. The
+hugepage configuration of a server may be examined using:
+
+.. code-block:: console
+
+   grep Huge* /proc/meminfo
+
+
+Initialization
+--
+
+When the device first powers up, its PCI Physical Functions (PF) can be listed 
through this command:
+
+.. code-block:: console
+
+  sudo lspci -vd8086:0d8f
+
+The physical and virtual functions are compatible with Linux UIO drivers:
+``vfio`` and ``igb_uio``. However, in order to work the FPGA 5GNR FEC device 
firstly 

Re: [dpdk-dev] [PATCH v3 13/14] test-bbdev: add support for FPGA driver initialization

2020-03-13 Thread Dave Burley

Acked-by: Dave Burley 

On 04/03/2020 18:55, Nicolas Chautru wrote:

From: Nic Chautru 

Adding capacity to initialize the device driver from
the test-bbdev environment for the new device
FPGA for 5GNR FEC.

Signed-off-by: Nic Chautru 
---
  app/test-bbdev/Makefile  |  3 +++
  app/test-bbdev/meson.build   |  3 +++
  app/test-bbdev/test_bbdev_perf.c | 58 
  3 files changed, 64 insertions(+)

diff --git a/app/test-bbdev/Makefile b/app/test-bbdev/Makefile
index c53982f..e951302 100644
--- a/app/test-bbdev/Makefile
+++ b/app/test-bbdev/Makefile
@@ -24,5 +24,8 @@ LDLIBS += -lm
  ifeq ($(CONFIG_RTE_LIBRTE_PMD_BBDEV_FPGA_LTE_FEC),y)
  LDLIBS += -lrte_pmd_bbdev_fpga_lte_fec
  endif
+ifeq ($(CONFIG_RTE_LIBRTE_PMD_BBDEV_FPGA_5GNR_FEC),y)
+LDLIBS += -lrte_pmd_bbdev_fpga_5gnr_fec
+endif
  
  include $(RTE_SDK)/mk/rte.app.mk

diff --git a/app/test-bbdev/meson.build b/app/test-bbdev/meson.build
index 4f53a2e..e57e019 100644
--- a/app/test-bbdev/meson.build
+++ b/app/test-bbdev/meson.build
@@ -10,3 +10,6 @@ deps += ['bbdev', 'bus_vdev']
  if dpdk_conf.has('RTE_LIBRTE_PMD_BBDEV_FPGA_LTE_FEC')
deps += ['pmd_bbdev_fpga_lte_fec']
  endif
+if dpdk_conf.has('RTE_LIBRTE_PMD_BBDEV_FPGA_5GNR_FEC')
+   deps += ['pmd_bbdev_fpga_5gnr_fec']
+endif
\ No newline at end of file
diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 1017b97..50ffee0 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -39,6 +39,19 @@
  #define FLR_4G_TIMEOUT 610
  #endif
  
+#ifdef RTE_LIBRTE_PMD_BBDEV_FPGA_5GNR_FEC

+#include 
+#define FPGA_5GNR_PF_DRIVER_NAME ("intel_fpga_5gnr_fec_pf")
+#define FPGA_5GNR_VF_DRIVER_NAME ("intel_fpga_5gnr_fec_vf")
+#define VF_UL_5G_QUEUE_VALUE 4
+#define VF_DL_5G_QUEUE_VALUE 4
+#define UL_5G_BANDWIDTH 3
+#define DL_5G_BANDWIDTH 3
+#define UL_5G_LOAD_BALANCE 128
+#define DL_5G_LOAD_BALANCE 128
+#define FLR_5G_TIMEOUT 610
+#endif
+
  #define OPS_CACHE_SIZE 256U
  #define OPS_POOL_SIZE_MIN 511U /* 0.5K per queue */
  
@@ -587,6 +600,51 @@ typedef int (test_case_function)(struct active_device *ad,

info->dev_name);
}
  #endif
+#ifdef RTE_LIBRTE_PMD_BBDEV_FPGA_5GNR_FEC
+   if ((get_init_device() == true) &&
+   (!strcmp(info->drv.driver_name, FPGA_5GNR_PF_DRIVER_NAME))) {
+   struct fpga_5gnr_fec_conf conf;
+   unsigned int i;
+
+   printf("Configure FPGA 5GNR FEC Driver %s with default 
values\n",
+   info->drv.driver_name);
+
+   /* clear default configuration before initialization */
+   memset(&conf, 0, sizeof(struct fpga_5gnr_fec_conf));
+
+   /* Set PF mode :
+* true if PF is used for data plane
+* false for VFs
+*/
+   conf.pf_mode_en = true;
+
+   for (i = 0; i < FPGA_5GNR_FEC_NUM_VFS; ++i) {
+   /* Number of UL queues per VF (fpga supports 8 VFs) */
+   conf.vf_ul_queues_number[i] = VF_UL_5G_QUEUE_VALUE;
+   /* Number of DL queues per VF (fpga supports 8 VFs) */
+   conf.vf_dl_queues_number[i] = VF_DL_5G_QUEUE_VALUE;
+   }
+
+   /* UL bandwidth. Needed for schedule algorithm */
+   conf.ul_bandwidth = UL_5G_BANDWIDTH;
+   /* DL bandwidth */
+   conf.dl_bandwidth = DL_5G_BANDWIDTH;
+
+   /* UL & DL load Balance Factor to 64 */
+   conf.ul_load_balance = UL_5G_LOAD_BALANCE;
+   conf.dl_load_balance = DL_5G_LOAD_BALANCE;
+
+   /**< FLR timeout value */
+   conf.flr_time_out = FLR_5G_TIMEOUT;
+
+   /* setup FPGA PF with configuration information */
+   ret = fpga_5gnr_fec_configure(info->dev_name, &conf);
+   TEST_ASSERT_SUCCESS(ret,
+   "Failed to configure 5G FPGA PF for bbdev %s",
+   info->dev_name);
+   }
+#endif
+
nb_queues = RTE_MIN(rte_lcore_count(), info->drv.max_num_queues);
nb_queues = RTE_MIN(nb_queues, (unsigned int) MAX_QUEUES);
  


Re: [dpdk-dev] [PATCH v3 14/14] doc: add feature matrix table for bbdev devices

2020-03-13 Thread Dave Burley

Acked-by: Dave Burley 

On 04/03/2020 18:55, Nicolas Chautru wrote:

From: Nic Chautru 

Adding missing overview page in documentation with
comparison of feature set by PMD implementation.

Signed-off-by: Nic Chautru 
---
  .gitignore   |  1 +
  doc/guides/bbdevs/features/default.ini   | 16 
  doc/guides/bbdevs/features/fpga_5gnr_fec.ini | 11 +++
  doc/guides/bbdevs/features/fpga_lte_fec.ini  | 10 ++
  doc/guides/bbdevs/features/mbc.ini   | 14 ++
  doc/guides/bbdevs/features/null.ini  |  7 +++
  doc/guides/bbdevs/features/turbo_sw.ini  | 11 +++
  doc/guides/bbdevs/index.rst  |  1 +
  doc/guides/bbdevs/overview.rst   | 15 +++
  doc/guides/conf.py   |  5 +
  10 files changed, 91 insertions(+)
  create mode 100644 doc/guides/bbdevs/features/default.ini
  create mode 100644 doc/guides/bbdevs/features/fpga_5gnr_fec.ini
  create mode 100644 doc/guides/bbdevs/features/fpga_lte_fec.ini
  create mode 100644 doc/guides/bbdevs/features/mbc.ini
  create mode 100644 doc/guides/bbdevs/features/null.ini
  create mode 100644 doc/guides/bbdevs/features/turbo_sw.ini
  create mode 100644 doc/guides/bbdevs/overview.rst

diff --git a/.gitignore b/.gitignore
index 2acb459..f2f8892 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,7 @@ doc/guides/cryptodevs/overview_aead_table.txt
  doc/guides/cryptodevs/overview_asym_table.txt
  doc/guides/compressdevs/overview_feature_table.txt
  doc/guides/vdpadevs/overview_feature_table.txt
+doc/guides/bbdevs/overview_feature_table.txt
  
  # ignore generated ctags/cscope files

  cscope.out.po
diff --git a/doc/guides/bbdevs/features/default.ini 
b/doc/guides/bbdevs/features/default.ini
new file mode 100644
index 000..5fe267a
--- /dev/null
+++ b/doc/guides/bbdevs/features/default.ini
@@ -0,0 +1,16 @@
+;
+; Features of a default bbdev driver.
+;
+; This file defines the features that are valid for inclusion in
+; the other driver files and also the order that they appear in
+; the features table in the documentation.
+;
+[Features]
+Turbo Decoder (4G) =
+Turbo Encoder (4G) =
+LDPC Decoder (5G)  =
+LDPC Encoder (5G)  =
+LLR/HARQ Compression   =
+External DDR Access=
+HW Accelerated =
+BBDEV API  =
diff --git a/doc/guides/bbdevs/features/fpga_5gnr_fec.ini 
b/doc/guides/bbdevs/features/fpga_5gnr_fec.ini
new file mode 100644
index 000..7a0b8d4
--- /dev/null
+++ b/doc/guides/bbdevs/features/fpga_5gnr_fec.ini
@@ -0,0 +1,11 @@
+;
+; Supported features of the 'fpga_5ngr_fec' bbdev driver.
+;
+; Refer to default.ini for the full list of available PMD features.
+;
+[Features]
+LDPC Decoder (5G)  = Y
+LDPC Encoder (5G)  = Y
+External DDR Access= Y
+HW Accelerated = Y
+BBDEV API  = Y
diff --git a/doc/guides/bbdevs/features/fpga_lte_fec.ini 
b/doc/guides/bbdevs/features/fpga_lte_fec.ini
new file mode 100644
index 000..f1cfb92
--- /dev/null
+++ b/doc/guides/bbdevs/features/fpga_lte_fec.ini
@@ -0,0 +1,10 @@
+;
+; Supported features of the 'fpga_lte_fec' bbdev driver.
+;
+; Refer to default.ini for the full list of available PMD features.
+;
+[Features]
+Turbo Decoder (4G) = Y
+Turbo Encoder (4G) = Y
+HW Accelerated = Y
+BBDEV API  = Y
diff --git a/doc/guides/bbdevs/features/mbc.ini 
b/doc/guides/bbdevs/features/mbc.ini
new file mode 100644
index 000..78a7b95
--- /dev/null
+++ b/doc/guides/bbdevs/features/mbc.ini
@@ -0,0 +1,14 @@
+;
+; Supported features of the 'mbc' bbdev driver.
+;
+; Refer to default.ini for the full list of available PMD features.
+;
+[Features]
+Turbo Decoder (4G) = Y
+Turbo Encoder (4G) = Y
+LDPC Decoder (5G)  = Y
+LDPC Encoder (5G)  = Y
+LLR/HARQ Compression   = Y
+External DDR Access= Y
+HW Accelerated = Y
+BBDEV API  = Y
diff --git a/doc/guides/bbdevs/features/null.ini 
b/doc/guides/bbdevs/features/null.ini
new file mode 100644
index 000..d9bbda9
--- /dev/null
+++ b/doc/guides/bbdevs/features/null.ini
@@ -0,0 +1,7 @@
+;
+; Supported features of the 'null' bbdev driver.
+;
+; Refer to default.ini for the full list of available PMD features.
+;
+[Features]
+BBDEV API  = Y
diff --git a/doc/guides/bbdevs/features/turbo_sw.ini 
b/doc/guides/bbdevs/features/turbo_sw.ini
new file mode 100644
index 000..2c7075e
--- /dev/null
+++ b/doc/guides/bbdevs/features/turbo_sw.ini
@@ -0,0 +1,11 @@
+;
+; Supported features of the 'turbo_sw' bbdev driver.
+;
+; Refer to default.ini for the full list of available PMD features.
+;
+[Features]
+Turbo Decoder (4G) = Y
+Turbo Encoder (4G) = Y
+LDPC Decoder (5G)  = Y
+LDPC Encoder (5G)  = Y
+BBDEV API  = Y
diff --git a/doc/guides/bbdevs/index.rst b/doc/guides/bbdevs/index.rst
index 1a79343..a8092dd 100644
--- a/doc/guides/

Re: [dpdk-dev] [PATCH v3 04/14] baseband/turbo_sw: support large size code block

2020-03-13 Thread Dave Burley

Acked-by: Dave Burley 

On 04/03/2020 18:54, Nicolas Chautru wrote:

From: Nic Chautru 

This is to support cases when the input data for
decoding a code block is larger than 64kB and would
not fit as a contiguous block of data into one
mbuf. In that case the length from the opearation
supersedes the mbug default structure.

Signed-off-by: Nic Chautru 
---
  app/test-bbdev/test_bbdev_perf.c | 40 +++-
  doc/guides/rel_notes/release_20_05.rst   |  6 
  drivers/baseband/turbo_sw/bbdev_turbo_software.c | 11 ---
  3 files changed, 45 insertions(+), 12 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index d8db58e..d46966d 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -764,6 +764,7 @@ typedef int (test_case_function)(struct active_device *ad,
  {
int ret;
unsigned int i, j;
+   bool large_input = false;
  
  	for (i = 0; i < n; ++i) {

char *data;
@@ -774,24 +775,47 @@ typedef int (test_case_function)(struct active_device *ad,
op_type, n * ref_entries->nb_segments,
mbuf_pool->size);
  
-		TEST_ASSERT_SUCCESS(((seg->length + RTE_PKTMBUF_HEADROOM) >

-   (uint32_t)UINT16_MAX),
-   "Given data is bigger than allowed mbuf segment 
size");
-
+   if (seg->length > 64000) {
+   /*
+* Special case when DPDK mbuf cannot handle
+* the required input size
+*/
+   printf("Warning: Larger input size than DPDK mbuf %d\n",
+   seg->length);
+   large_input = true;
+   } else {
+   TEST_ASSERT_SUCCESS(
+   ((seg->length + RTE_PKTMBUF_HEADROOM)
+   > (uint32_t)UINT16_MAX),
+   "Given data is bigger than allowed mbuf 
segment size"
+   );
+   }
bufs[i].data = m_head;
bufs[i].offset = 0;
bufs[i].length = 0;
  
  		if ((op_type == DATA_INPUT) || (op_type == DATA_HARQ_INPUT)) {

-   data = rte_pktmbuf_append(m_head, seg->length);
-   TEST_ASSERT_NOT_NULL(data,
+   if ((op_type == DATA_INPUT) && large_input) {
+   /* Allocate a fake overused mbuf */
+   data = rte_malloc(NULL, 128 * 1024, 0);
+   memcpy(data, seg->addr, seg->length);
+   m_head->buf_addr = data;
+   m_head->buf_iova = rte_mem_virt2phy(data);
+   m_head->data_off = 0;
+   m_head->data_len = seg->length;
+   } else {
+   data = rte_pktmbuf_append(m_head, seg->length);
+   TEST_ASSERT_NOT_NULL(data,
"Couldn't append %u bytes to mbuf from %d 
data type mbuf pool",
seg->length, op_type);
  
-			TEST_ASSERT(data == RTE_PTR_ALIGN(data, min_alignment),

+   TEST_ASSERT(data == RTE_PTR_ALIGN(
+   data, min_alignment),
"Data addr in mbuf (%p) is not aligned to 
device min alignment (%u)",
data, min_alignment);
-   rte_memcpy(data, seg->addr, seg->length);
+   rte_memcpy(data, seg->addr, seg->length);
+   }
+
bufs[i].length += seg->length;
  
  			for (j = 1; j < ref_entries->nb_segments; ++j) {

diff --git a/doc/guides/rel_notes/release_20_05.rst 
b/doc/guides/rel_notes/release_20_05.rst
index 2190eaf..d6c3dfb 100644
--- a/doc/guides/rel_notes/release_20_05.rst
+++ b/doc/guides/rel_notes/release_20_05.rst
@@ -56,6 +56,12 @@ New Features
   Also, make sure to start the actual text at the margin.
   =
  
+* **Updated the TURBO_SW bbdev PMD.**

+
+  Updated the ``turbo_sw`` bbdev driver with changes including:
+
+  * Support for large size code block not fitting in one mbuf segment.
+  * Exposes the accurate LLR decimal assumption.
  
  Removed Items

  -
diff --git a/drivers/baseband/turbo_sw/bbdev_turbo_software.c 
b/drivers/baseband/turbo_sw/bbdev_turbo_software.c
index 5ca8ca1..ea3fecb 100644
--- a/drivers/baseband/

Re: [dpdk-dev] [PATCH v5 00/10] bbdev new features

2020-03-27 Thread Dave Burley

Acked-by: Dave Burley 

On 26/03/2020 03:27, Nicolas Chautru wrote:

v5: cosmetic change
v4: Changes based on review comments from Akhil. Also taking the new PMD out of 
this serie
to be pushed in separate serie.
v3: squash the release notes updates into the related commits
v2: including release note update + fix for typo in commit message reported by 
DPDK CI.

This set includes extending support for the bbdev device drivers for 20.05 and 
notably add a new baseband PMD for FPGA 5GNR FEC implementation.
Documentation is updated as well accordingly.


Nic Chautru (10):
   bbdev: add capability flag for filler bits inclusion in HARQ
   bbdev: expose device HARQ buffer size at device level
   baseband/turbo_sw: fix the exposed LLR decimals assumption
   baseband/turbo_sw: support large size code block
   test-bbdev: rename FPGA LTE macros to be more explicit
   test-bbdev: support HARQ validation
   test-bbdev: support for performance tests
   test-bbdev: support for LDPC interrupt test
   test-bbdev: support for offload test for LDPC
   test-bbdev: vectors update

  app/test-bbdev/ldpc_dec_default.data   |2 +-
  app/test-bbdev/main.c  |   29 +-
  app/test-bbdev/main.h  |9 +-
  app/test-bbdev/test_bbdev_perf.c   | 1539 ++--
  app/test-bbdev/test_bbdev_vector.c |9 +-
  app/test-bbdev/test_vectors/ldpc_dec_v2342.data|  745 --
  app/test-bbdev/test_vectors/ldpc_dec_v9503.data|4 +-
  .../turbo_dec_c1_k6144_r0_e34560_negllr.data   |  645 
  .../turbo_dec_c2_k3136_r0_e4920_sbd_negllr.data|  676 -
  ...bo_dec_c2_k3136_r0_e4920_sbd_negllr_crc24b.data |5 +-
  .../turbo_enc_c2_k5952_r0_e17868_crc24b.data   |  300 
  .../turbo_enc_c4_k4800_r2_e14412_crc24b.data   |  252 
  doc/guides/rel_notes/release_20_05.rst |5 +
  doc/guides/tools/testbbdev.rst |  340 -
  drivers/baseband/turbo_sw/bbdev_turbo_software.c   |   17 +-
  lib/librte_bbdev/rte_bbdev.h   |4 +
  lib/librte_bbdev/rte_bbdev_op.h|   15 +-
  17 files changed, 1745 insertions(+), 2851 deletions(-)
  delete mode 100644 app/test-bbdev/test_vectors/ldpc_dec_v2342.data
  delete mode 100644 
app/test-bbdev/test_vectors/turbo_dec_c1_k6144_r0_e34560_negllr.data
  delete mode 100644 
app/test-bbdev/test_vectors/turbo_dec_c2_k3136_r0_e4920_sbd_negllr.data
  delete mode 100644 
app/test-bbdev/test_vectors/turbo_enc_c2_k5952_r0_e17868_crc24b.data
  delete mode 100644 
app/test-bbdev/test_vectors/turbo_enc_c4_k4800_r2_e14412_crc24b.data



Re: [dpdk-dev] [PATCH v5 01/10] bbdev: add capability flag for filler bits inclusion in HARQ

2020-03-27 Thread Dave Burley

Acked-by: Dave Burley 

On 26/03/2020 03:27, Nicolas Chautru wrote:

From: Nic Chautru 

Adding capability flag for device variants when HARQ buffer
may or may not include the filler bits.
Minor cosmetic changes in same file.

Signed-off-by: Nic Chautru 
---
  lib/librte_bbdev/rte_bbdev.h|  2 ++
  lib/librte_bbdev/rte_bbdev_op.h | 12 ++--
  2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/lib/librte_bbdev/rte_bbdev.h b/lib/librte_bbdev/rte_bbdev.h
index 591fb79..b2da190 100644
--- a/lib/librte_bbdev/rte_bbdev.h
+++ b/lib/librte_bbdev/rte_bbdev.h
@@ -607,6 +607,7 @@ struct __rte_cache_aligned rte_bbdev {
   * @param ops
   *   Pointer array where operations will be dequeued to. Must have at least
   *   @p num_ops entries
+ *   ie. A pointer to a table of void * pointers (ops) that will be filled.
   * @param num_ops
   *   The maximum number of operations to dequeue.
   *
@@ -638,6 +639,7 @@ struct __rte_cache_aligned rte_bbdev {
   * @param ops
   *   Pointer array where operations will be dequeued to. Must have at least
   *   @p num_ops entries
+ *   ie. A pointer to a table of void * pointers (ops) that will be filled.
   * @param num_ops
   *   The maximum number of operations to dequeue.
   *
diff --git a/lib/librte_bbdev/rte_bbdev_op.h b/lib/librte_bbdev/rte_bbdev_op.h
index 1e119a7..c8a354e 100644
--- a/lib/librte_bbdev/rte_bbdev_op.h
+++ b/lib/librte_bbdev/rte_bbdev_op.h
@@ -31,8 +31,11 @@
  #define RTE_BBDEV_TURBO_MAX_TB_SIZE (391656)
  /* Maximum size of Code Block (36.212, Table 5.1.3-3) */
  #define RTE_BBDEV_TURBO_MAX_CB_SIZE (6144)
-/* Maximum size of Code Block  */
+/* Maximum size of Code Block */
  #define RTE_BBDEV_LDPC_MAX_CB_SIZE (8448)
+/* Minimum size of Code Block */
+#define RTE_BBDEV_LDPC_MIN_CB_SIZE (40)
+
  /* Minimum size of Code Block (36.212, Table 5.1.3-3) */
  #define RTE_BBDEV_TURBO_MIN_CB_SIZE (40)
  /* Maximum size of circular buffer */
@@ -177,7 +180,12 @@ enum rte_bbdev_op_ldpcdec_flag_bitmasks {
/** Set if a device supports loop-back access to
 *  HARQ internal memory. Intended for troubleshooting.
 */
-   RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK = (1ULL << 17)
+   RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK = (1ULL << 17),
+   /** Set if a device includes LLR filler bits in the circular buffer
+*  for HARQ memory. If not set, it is assumed the filler bits are not
+*  in HARQ memory and handled directly by the LDPC decoder.
+*/
+   RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS = (1ULL << 18)
  };
  
  /** Flags for LDPC encoder operation and capability structure */


Re: [dpdk-dev] [PATCH v5 03/10] baseband/turbo_sw: fix the exposed LLR decimals assumption

2020-03-27 Thread Dave Burley

Acked-by: Dave Burley 

On 26/03/2020 03:27, Nicolas Chautru wrote:

From: Nic Chautru 

The actual LLR representation was incorrectly assumed to be 2
instead of 4. This would impact wireless performance but is not
critical to be back ported on LTS branches.

Fixes: c769c711757a ("baseband/turbo_sw: extend for 5G")

Signed-off-by: Nic Chautru 
---
  drivers/baseband/turbo_sw/bbdev_turbo_software.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/baseband/turbo_sw/bbdev_turbo_software.c 
b/drivers/baseband/turbo_sw/bbdev_turbo_software.c
index 6d5e080..5ca8ca1 100644
--- a/drivers/baseband/turbo_sw/bbdev_turbo_software.c
+++ b/drivers/baseband/turbo_sw/bbdev_turbo_software.c
@@ -218,7 +218,7 @@ struct turbo_sw_queue {
RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE |
RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE,
.llr_size = 8,
-   .llr_decimals = 2,
+   .llr_decimals = 4,
.num_buffers_src =
RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,
.num_buffers_hard_out =


Re: [dpdk-dev] [PATCH v5 02/10] bbdev: expose device HARQ buffer size at device level

2020-03-27 Thread Dave Burley

Acked-by: Dave Burley 

On 26/03/2020 03:27, Nicolas Chautru wrote:

From: Nic Chautru 

This exposes the HARQ buffer size at the device driver level
instead of using the capability of a specific operation.

This is currently not yet used by a device until
future commit.

Signed-off-by: Nic Chautru 
---
  drivers/baseband/turbo_sw/bbdev_turbo_software.c | 2 +-
  lib/librte_bbdev/rte_bbdev.h | 2 ++
  lib/librte_bbdev/rte_bbdev_op.h  | 2 --
  3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/baseband/turbo_sw/bbdev_turbo_software.c 
b/drivers/baseband/turbo_sw/bbdev_turbo_software.c
index f2fe7a2..6d5e080 100644
--- a/drivers/baseband/turbo_sw/bbdev_turbo_software.c
+++ b/drivers/baseband/turbo_sw/bbdev_turbo_software.c
@@ -219,7 +219,6 @@ struct turbo_sw_queue {
RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE,
.llr_size = 8,
.llr_decimals = 2,
-   .harq_memory_size = 0,
.num_buffers_src =
RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,
.num_buffers_hard_out =
@@ -251,6 +250,7 @@ struct turbo_sw_queue {
dev_info->default_queue_conf = default_queue_conf;
dev_info->capabilities = bbdev_capabilities;
dev_info->min_alignment = 64;
+   dev_info->harq_buffer_size = 0;
  
  	rte_bbdev_log_debug("got device info from %u\n", dev->data->dev_id);

  }
diff --git a/lib/librte_bbdev/rte_bbdev.h b/lib/librte_bbdev/rte_bbdev.h
index b2da190..38d9d50 100644
--- a/lib/librte_bbdev/rte_bbdev.h
+++ b/lib/librte_bbdev/rte_bbdev.h
@@ -307,6 +307,8 @@ struct rte_bbdev_driver_info {
bool queue_intr_supported;
/** Minimum alignment of buffers, in bytes */
uint16_t min_alignment;
+   /** HARQ memory available in kB */
+   uint32_t harq_buffer_size;
/** Default queue configuration used if none is supplied  */
struct rte_bbdev_queue_conf default_queue_conf;
/** Device operation capabilities */
diff --git a/lib/librte_bbdev/rte_bbdev_op.h b/lib/librte_bbdev/rte_bbdev_op.h
index c8a354e..80f3934 100644
--- a/lib/librte_bbdev/rte_bbdev_op.h
+++ b/lib/librte_bbdev/rte_bbdev_op.h
@@ -712,8 +712,6 @@ struct rte_bbdev_op_cap_ldpc_dec {
int8_t llr_size;
/** LLR numbers of decimals bit for arithmetic representation */
int8_t llr_decimals;
-   /** Amount of memory for HARQ in external DDR in MB */
-   uint16_t harq_memory_size;
/** Num input code block buffers */
uint16_t num_buffers_src;
/** Num hard output code block buffers */


Re: [dpdk-dev] [PATCH v5 04/10] baseband/turbo_sw: support large size code block

2020-03-27 Thread Dave Burley

Acked-by: Dave Burley 

On 26/03/2020 03:27, Nicolas Chautru wrote:

From: Nic Chautru 

This is to support cases when the input data for
decoding a code block is larger than 64kB and would
not fit as a contiguous block of data into one
mbuf. In that case the length from the operation
supersedes the mbuf default structure.

Signed-off-by: Nic Chautru 
---
  app/test-bbdev/test_bbdev_perf.c | 34 ++--
  doc/guides/rel_notes/release_20_05.rst   |  5 
  drivers/baseband/turbo_sw/bbdev_turbo_software.c | 13 +
  lib/librte_bbdev/rte_bbdev_op.h  |  3 ++-
  4 files changed, 41 insertions(+), 14 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index d8db58e..e998d0b 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -764,6 +764,7 @@ typedef int (test_case_function)(struct active_device *ad,
  {
int ret;
unsigned int i, j;
+   bool large_input = false;
  
  	for (i = 0; i < n; ++i) {

char *data;
@@ -774,24 +775,41 @@ typedef int (test_case_function)(struct active_device *ad,
op_type, n * ref_entries->nb_segments,
mbuf_pool->size);
  
-		TEST_ASSERT_SUCCESS(((seg->length + RTE_PKTMBUF_HEADROOM) >

-   (uint32_t)UINT16_MAX),
-   "Given data is bigger than allowed mbuf segment 
size");
-
+   if (seg->length > RTE_BBDEV_LDPC_E_MAX_MBUF) {
+   /*
+* Special case when DPDK mbuf cannot handle
+* the required input size
+*/
+   printf("Warning: Larger input size than DPDK mbuf %d\n",
+   seg->length);
+   large_input = true;
+   }
bufs[i].data = m_head;
bufs[i].offset = 0;
bufs[i].length = 0;
  
  		if ((op_type == DATA_INPUT) || (op_type == DATA_HARQ_INPUT)) {

-   data = rte_pktmbuf_append(m_head, seg->length);
-   TEST_ASSERT_NOT_NULL(data,
+   if ((op_type == DATA_INPUT) && large_input) {
+   /* Allocate a fake overused mbuf */
+   data = rte_malloc(NULL, seg->length, 0);
+   memcpy(data, seg->addr, seg->length);
+   m_head->buf_addr = data;
+   m_head->buf_iova = rte_malloc_virt2iova(data);
+   m_head->data_off = 0;
+   m_head->data_len = seg->length;
+   } else {
+   data = rte_pktmbuf_append(m_head, seg->length);
+   TEST_ASSERT_NOT_NULL(data,
"Couldn't append %u bytes to mbuf from %d 
data type mbuf pool",
seg->length, op_type);
  
-			TEST_ASSERT(data == RTE_PTR_ALIGN(data, min_alignment),

+   TEST_ASSERT(data == RTE_PTR_ALIGN(
+   data, min_alignment),
"Data addr in mbuf (%p) is not aligned to 
device min alignment (%u)",
data, min_alignment);
-   rte_memcpy(data, seg->addr, seg->length);
+   rte_memcpy(data, seg->addr, seg->length);
+   }
+
bufs[i].length += seg->length;
  
  			for (j = 1; j < ref_entries->nb_segments; ++j) {

diff --git a/doc/guides/rel_notes/release_20_05.rst 
b/doc/guides/rel_notes/release_20_05.rst
index 2190eaf..8dc87fc 100644
--- a/doc/guides/rel_notes/release_20_05.rst
+++ b/doc/guides/rel_notes/release_20_05.rst
@@ -56,6 +56,11 @@ New Features
   Also, make sure to start the actual text at the margin.
   =
  
+* **Updated the TURBO_SW bbdev PMD.**

+
+  Updated the ``turbo_sw`` bbdev driver with changes including:
+
+  * Support for large size code block not fitting in one mbuf segment.
  
  Removed Items

  -
diff --git a/drivers/baseband/turbo_sw/bbdev_turbo_software.c 
b/drivers/baseband/turbo_sw/bbdev_turbo_software.c
index 5ca8ca1..bb62276 100644
--- a/drivers/baseband/turbo_sw/bbdev_turbo_software.c
+++ b/drivers/baseband/turbo_sw/bbdev_turbo_software.c
@@ -1335,7 +1335,7 @@ struct turbo_sw_queue {
  
  static inline void

  process_ldpc_dec_cb(struct turbo_sw_queue *q, struct rte_bbdev_dec_op *op,
-   uint8_t c, uint16_t out_length, uint16_t e,
+   uint8_t c, u

Re: [dpdk-dev] [PATCH v5 05/10] test-bbdev: rename FPGA LTE macros to be more explicit

2020-03-27 Thread Dave Burley

Acked-by: Dave Burley 

On 26/03/2020 03:27, Nicolas Chautru wrote:

From: Nic Chautru 

Self-contained and cosmetic renaming of macro
so that to be more explicit for future extension.

Signed-off-by: Nic Chautru 
---
  app/test-bbdev/test_bbdev_perf.c | 51 +++-
  1 file changed, 19 insertions(+), 32 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index e998d0b..b17fc95 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -18,10 +18,6 @@
  #include 
  #include 
  
-#ifdef RTE_LIBRTE_PMD_BBDEV_FPGA_LTE_FEC

-#include 
-#endif
-
  #include "main.h"
  #include "test_bbdev_vector.h"
  
@@ -31,15 +27,16 @@

  #define TEST_REPETITIONS 1000
  
  #ifdef RTE_LIBRTE_PMD_BBDEV_FPGA_LTE_FEC

-#define FPGA_PF_DRIVER_NAME ("intel_fpga_lte_fec_pf")
-#define FPGA_VF_DRIVER_NAME ("intel_fpga_lte_fec_vf")
-#define VF_UL_QUEUE_VALUE 4
-#define VF_DL_QUEUE_VALUE 4
-#define UL_BANDWIDTH 3
-#define DL_BANDWIDTH 3
-#define UL_LOAD_BALANCE 128
-#define DL_LOAD_BALANCE 128
-#define FLR_TIMEOUT 610
+#include 
+#define FPGA_LTE_PF_DRIVER_NAME ("intel_fpga_lte_fec_pf")
+#define FPGA_LTE_VF_DRIVER_NAME ("intel_fpga_lte_fec_vf")
+#define VF_UL_4G_QUEUE_VALUE 4
+#define VF_DL_4G_QUEUE_VALUE 4
+#define UL_4G_BANDWIDTH 3
+#define DL_4G_BANDWIDTH 3
+#define UL_4G_LOAD_BALANCE 128
+#define DL_4G_LOAD_BALANCE 128
+#define FLR_4G_TIMEOUT 610
  #endif
  
  #define OPS_CACHE_SIZE 256U

@@ -521,11 +518,11 @@ typedef int (test_case_function)(struct active_device *ad,
   */
  #ifdef RTE_LIBRTE_PMD_BBDEV_FPGA_LTE_FEC
if ((get_init_device() == true) &&
-   (!strcmp(info->drv.driver_name, FPGA_PF_DRIVER_NAME))) {
+   (!strcmp(info->drv.driver_name, FPGA_LTE_PF_DRIVER_NAME))) {
struct fpga_lte_fec_conf conf;
unsigned int i;
  
-		printf("Configure FPGA FEC Driver %s with default values\n",

+   printf("Configure FPGA LTE FEC Driver %s with default values\n",
info->drv.driver_name);
  
  		/* clear default configuration before initialization */

@@ -539,22 +536,22 @@ typedef int (test_case_function)(struct active_device *ad,
  
  		for (i = 0; i < FPGA_LTE_FEC_NUM_VFS; ++i) {

/* Number of UL queues per VF (fpga supports 8 VFs) */
-   conf.vf_ul_queues_number[i] = VF_UL_QUEUE_VALUE;
+   conf.vf_ul_queues_number[i] = VF_UL_4G_QUEUE_VALUE;
/* Number of DL queues per VF (fpga supports 8 VFs) */
-   conf.vf_dl_queues_number[i] = VF_DL_QUEUE_VALUE;
+   conf.vf_dl_queues_number[i] = VF_DL_4G_QUEUE_VALUE;
}
  
  		/* UL bandwidth. Needed for schedule algorithm */

-   conf.ul_bandwidth = UL_BANDWIDTH;
+   conf.ul_bandwidth = UL_4G_BANDWIDTH;
/* DL bandwidth */
-   conf.dl_bandwidth = DL_BANDWIDTH;
+   conf.dl_bandwidth = DL_4G_BANDWIDTH;
  
  		/* UL & DL load Balance Factor to 64 */

-   conf.ul_load_balance = UL_LOAD_BALANCE;
-   conf.dl_load_balance = DL_LOAD_BALANCE;
+   conf.ul_load_balance = UL_4G_LOAD_BALANCE;
+   conf.dl_load_balance = DL_4G_LOAD_BALANCE;
  
  		/**< FLR timeout value */

-   conf.flr_time_out = FLR_TIMEOUT;
+   conf.flr_time_out = FLR_4G_TIMEOUT;
  
  		/* setup FPGA PF with configuration information */

ret = fpga_lte_fec_configure(info->dev_name, &conf);
@@ -2856,11 +2853,6 @@ typedef int (test_case_function)(struct active_device 
*ad,
  
  		start_time = rte_rdtsc_precise();
  
-		/*

-* printf("Latency Debug %d\n",
-* ops_enq[0]->ldpc_enc.cb_params.z_c); REMOVEME
-*/
-
enq = rte_bbdev_enqueue_ldpc_enc_ops(dev_id, queue_id,
&ops_enq[enq], burst_sz);
TEST_ASSERT(enq == burst_sz,
@@ -2886,11 +2878,6 @@ typedef int (test_case_function)(struct active_device 
*ad,
TEST_ASSERT_SUCCESS(ret, "Validation failed!");
}
  
-		/*

-* printf("Ready to free - deq %d num_to_process %d\n", FIXME
-*  deq, num_to_process);
-* printf("cache %d\n", ops_enq[0]->mempool->cache_size);
-*/
rte_bbdev_enc_op_free_bulk(ops_enq, deq);
dequeued += deq;
}


Re: [dpdk-dev] [PATCH v5 06/10] test-bbdev: support HARQ validation

2020-03-27 Thread Dave Burley

Acked-by: Dave Burley 

On 26/03/2020 03:27, Nicolas Chautru wrote:

From: Nic Chautru 

Adding functionality to validate HARQ for different
devices implementation.
Adding capacity to fetch HARQ data when required as
part of this validation.

Signed-off-by: Nic Chautru 
---
  app/test-bbdev/test_bbdev_perf.c   | 564 -
  app/test-bbdev/test_bbdev_vector.c |   9 +-
  2 files changed, 504 insertions(+), 69 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index b17fc95..4d7dc4e 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -44,14 +44,34 @@
  
  #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 */
+#define HARQ_INCR 32768
+/* Headroom for filler LLRs insertion in HARQ buffer */
+#define FILLER_HEADROOM 1024
+/* 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 */
+#define K0_1_1 17 /* K0 fraction numerator for rv 1 and BG 1 */
+#define K0_1_2 13 /* K0 fraction numerator for rv 1 and BG 2 */
+#define K0_2_1 33 /* K0 fraction numerator for rv 2 and BG 1 */
+#define K0_2_2 25 /* K0 fraction numerator for rv 2 and BG 2 */
+#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 */
  
  static struct test_bbdev_vector test_vector;
  
  /* Switch between PMD and Interrupt for throughput TC */

  static bool intr_enabled;
  
+/* LLR arithmetic representation for numerical conversion */

+static int ldpc_llr_decimals;
+static int ldpc_llr_size;
+/* Keep track of the LDPC decoder device capability flag */
+static uint32_t ldpc_cap_flags;
+
  /* Represents tested active devices */
  static struct active_device {
const char *driver_name;
@@ -293,7 +313,7 @@ typedef int (test_case_function)(struct active_device *ad,
return TEST_FAILED;
}
if (intr_enabled && !(cap->capability_flags &
-   RTE_BBDEV_TURBO_ENC_INTERRUPTS)) {
+   RTE_BBDEV_LDPC_ENC_INTERRUPTS)) {
printf(
"Dequeue interrupts are not 
supported!\n");
return TEST_FAILED;
@@ -336,12 +356,19 @@ typedef int (test_case_function)(struct active_device *ad,
return TEST_FAILED;
}
if (intr_enabled && !(cap->capability_flags &
-   RTE_BBDEV_TURBO_DEC_INTERRUPTS)) {
+   RTE_BBDEV_LDPC_DEC_INTERRUPTS)) {
printf(
"Dequeue interrupts are not 
supported!\n");
return TEST_FAILED;
}
-
+   if (intr_enabled && (test_vector.ldpc_dec.op_flags &
+   (RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE |
+   RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE |
+   RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK
+   ))) {
+   printf("Skip loop-back with interrupt\n");
+   return TEST_FAILED;
+   }
return TEST_SUCCESS;
}
}
@@ -377,7 +404,8 @@ typedef int (test_case_function)(struct active_device *ad,
snprintf(pool_name, sizeof(pool_name), "%s_pool_%u", op_type_str,
dev_id);
return rte_pktmbuf_pool_create(pool_name, mbuf_pool_size, 0, 0,
-   RTE_MAX(max_seg_sz + RTE_PKTMBUF_HEADROOM,
+   RTE_MAX(max_seg_sz + RTE_PKTMBUF_HEADROOM
+   + FILLER_HEADROOM,
(unsigned int)RTE_MBUF_DEFAULT_BUF_SIZE), socket_id);
  }
  
@@ -432,27 +460,33 @@ typedef int (test_case_function)(struct active_device *ad,

return TEST_SUCCESS;
  
  	/* Inputs */

-   mbuf_pool_size = optimal_mempool_size(ops_pool_size * in->nb_segments);
-   mp = create_mbuf_pool(in, ad->dev_id, socket_id, mbuf_pool_size, "in");
-   TEST_ASSERT_NOT_NULL(mp,
-   "ERROR Failed to create %u items input pktmbuf pool for dev 
%u on socket %u.",
-   mbuf_pool_size,
-   ad->dev_id,
-   socket_id);
-   ad->in_mbuf_pool = mp;
+   if (in->nb_segments > 0) {
+   mbuf_pool_size = optimal_mempool_siz

Re: [dpdk-dev] [PATCH v5 07/10] test-bbdev: support for performance tests

2020-03-27 Thread Dave Burley

Acked-by: Dave Burley 

On 26/03/2020 03:27, Nicolas Chautru wrote:

From: Nic Chautru 

Includes support for BLER (Block Error Rate) wireless
performance test with new arguments for SNR and number
of iterations for 5G. This generates LLRs for a given
SNR level then measures the ratio of code blocks being
successfully decoded or not.

Signed-off-by: Nic Chautru 
---
  app/test-bbdev/main.c|  29 +-
  app/test-bbdev/main.h|   9 +-
  app/test-bbdev/test_bbdev_perf.c | 620 ++-
  doc/guides/tools/testbbdev.rst   |  16 +
  4 files changed, 662 insertions(+), 12 deletions(-)

diff --git a/app/test-bbdev/main.c b/app/test-bbdev/main.c
index 8a42115..ff65173 100644
--- a/app/test-bbdev/main.c
+++ b/app/test-bbdev/main.c
@@ -29,6 +29,8 @@
unsigned int num_ops;
unsigned int burst_sz;
unsigned int num_lcores;
+   double snr;
+   unsigned int iter_max;
char test_vector_filename[PATH_MAX];
bool init_device;
  } test_params;
@@ -140,6 +142,18 @@
return test_params.num_lcores;
  }
  
+double

+get_snr(void)
+{
+   return test_params.snr;
+}
+
+unsigned int
+get_iter_max(void)
+{
+   return test_params.iter_max;
+}
+
  bool
  get_init_device(void)
  {
@@ -180,12 +194,15 @@
{ "test-cases", 1, 0, 'c' },
{ "test-vector", 1, 0, 'v' },
{ "lcores", 1, 0, 'l' },
+   { "snr", 1, 0, 's' },
+   { "iter_max", 6, 0, 't' },
{ "init-device", 0, 0, 'i'},
{ "help", 0, 0, 'h' },
{ NULL,  0, 0, 0 }
};
+   tp->iter_max = DEFAULT_ITER;
  
-	while ((opt = getopt_long(argc, argv, "hin:b:c:v:l:", lgopts,

+   while ((opt = getopt_long(argc, argv, "hin:b:c:v:l:s:t:", lgopts,
&option_index)) != EOF)
switch (opt) {
case 'n':
@@ -237,6 +254,16 @@
sizeof(tp->test_vector_filename),
"%s", optarg);
break;
+   case 's':
+   TEST_ASSERT(strlen(optarg) > 0,
+   "SNR is not provided");
+   tp->snr = strtod(optarg, NULL);
+   break;
+   case 't':
+   TEST_ASSERT(strlen(optarg) > 0,
+   "Iter_max is not provided");
+   tp->iter_max = strtol(optarg, NULL, 10);
+   break;
case 'l':
TEST_ASSERT(strlen(optarg) > 0,
"Num of lcores is not provided");
diff --git a/app/test-bbdev/main.h b/app/test-bbdev/main.h
index 23b4d58..fb3dec8 100644
--- a/app/test-bbdev/main.h
+++ b/app/test-bbdev/main.h
@@ -19,6 +19,8 @@
  #define MAX_BURST 512U
  #define DEFAULT_BURST 32U
  #define DEFAULT_OPS 64U
+#define DEFAULT_ITER 6U
+
  
  
  #define TEST_ASSERT(cond, msg, ...) do {  \

@@ -104,8 +106,7 @@ struct test_command {
.command = RTE_STR(name), \
.callback = test_func_##name, \
}; \
-   static void __attribute__((constructor, used)) \
-   test_register_##name(void) \
+   RTE_INIT(test_register_##name) \
{ \
add_test_command(&test_struct_##name); \
}
@@ -118,6 +119,10 @@ struct test_command {
  
  unsigned int get_num_lcores(void);
  
+double get_snr(void);

+
+unsigned int get_iter_max(void);
+
  bool get_init_device(void);
  
  #endif

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 4d7dc4e..bc73a97 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -120,6 +120,8 @@ struct thread_params {
double ops_per_sec;
double mbps;
uint8_t iter_count;
+   double iter_average;
+   double bler;
rte_atomic16_t nb_dequeued;
rte_atomic16_t processing_status;
rte_atomic16_t burst_sz;
@@ -1207,6 +1209,312 @@ typedef int (test_case_function)(struct active_device 
*ad,
}
  }
  
+

+/* Returns a random number drawn from a normal distribution
+ * with mean of 0 and variance of 1
+ * Marsaglia algorithm
+ */
+static double
+randn(int n)
+{
+   double S, Z, U1, U2, u, v, fac;
+
+   do {
+   U1 = (double)rand() / RAND_MAX;
+   U2 = (double)rand() / RAND_MAX;
+   u = 2. * U1 - 1.;
+   v = 2. * U2 - 1.;
+   S = u * u + v * v;
+   } while (S >= 1 || S == 0);
+   fac = sqrt(-2. * log(S) / S);
+   Z = (n % 2) ? u * fac : v * fac;
+   

Re: [dpdk-dev] [PATCH v5 08/10] test-bbdev: support for LDPC interrupt test

2020-03-27 Thread Dave Burley

Acked-by: Dave Burley 

On 26/03/2020 03:27, Nicolas Chautru wrote:

From: Nic Chautru 

Adding missing implementation for the interrupt tests
for LDPC encoder and decoders.

Signed-off-by: Nic Chautru 
---
  app/test-bbdev/test_bbdev_perf.c | 202 ++-
  1 file changed, 200 insertions(+), 2 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index bc73a97..c45cdd2 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -754,6 +754,9 @@ typedef int (test_case_function)(struct active_device *ad,
/* Clear active devices structs. */
memset(active_devs, 0, sizeof(active_devs));
nb_active_devs = 0;
+
+   /* Disable interrupts */
+   intr_enabled = false;
  }
  
  static int

@@ -2562,6 +2565,109 @@ typedef int (test_case_function)(struct active_device 
*ad,
  }
  
  static int

+throughput_intr_lcore_ldpc_dec(void *arg)
+{
+   struct thread_params *tp = arg;
+   unsigned int enqueued;
+   const uint16_t queue_id = tp->queue_id;
+   const uint16_t burst_sz = tp->op_params->burst_sz;
+   const uint16_t num_to_process = tp->op_params->num_to_process;
+   struct rte_bbdev_dec_op *ops[num_to_process];
+   struct test_buffers *bufs = NULL;
+   struct rte_bbdev_info info;
+   int ret, i, j;
+   struct rte_bbdev_dec_op *ref_op = tp->op_params->ref_dec_op;
+   uint16_t num_to_enq, enq;
+
+   bool loopback = check_bit(ref_op->ldpc_dec.op_flags,
+   RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK);
+   bool hc_out = check_bit(ref_op->ldpc_dec.op_flags,
+   RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE);
+
+   TEST_ASSERT_SUCCESS((burst_sz > MAX_BURST),
+   "BURST_SIZE should be <= %u", MAX_BURST);
+
+   TEST_ASSERT_SUCCESS(rte_bbdev_queue_intr_enable(tp->dev_id, queue_id),
+   "Failed to enable interrupts for dev: %u, queue_id: %u",
+   tp->dev_id, queue_id);
+
+   rte_bbdev_info_get(tp->dev_id, &info);
+
+   TEST_ASSERT_SUCCESS((num_to_process > info.drv.queue_size_lim),
+   "NUM_OPS cannot exceed %u for this device",
+   info.drv.queue_size_lim);
+
+   bufs = &tp->op_params->q_bufs[GET_SOCKET(info.socket_id)][queue_id];
+
+   rte_atomic16_clear(&tp->processing_status);
+   rte_atomic16_clear(&tp->nb_dequeued);
+
+   while (rte_atomic16_read(&tp->op_params->sync) == SYNC_WAIT)
+   rte_pause();
+
+   ret = rte_bbdev_dec_op_alloc_bulk(tp->op_params->mp, ops,
+   num_to_process);
+   TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops",
+   num_to_process);
+   if (test_vector.op_type != RTE_BBDEV_OP_NONE)
+   copy_reference_ldpc_dec_op(ops, num_to_process, 0, bufs->inputs,
+   bufs->hard_outputs, bufs->soft_outputs,
+   bufs->harq_inputs, bufs->harq_outputs, ref_op);
+
+   /* Set counter to validate the ordering */
+   for (j = 0; j < num_to_process; ++j)
+   ops[j]->opaque_data = (void *)(uintptr_t)j;
+
+   for (j = 0; j < TEST_REPETITIONS; ++j) {
+   for (i = 0; i < num_to_process; ++i) {
+   if (!loopback)
+   rte_pktmbuf_reset(
+   ops[i]->ldpc_dec.hard_output.data);
+   if (hc_out || loopback)
+   mbuf_reset(
+   ops[i]->ldpc_dec.harq_combined_output.data);
+   }
+
+   tp->start_time = rte_rdtsc_precise();
+   for (enqueued = 0; enqueued < num_to_process;) {
+   num_to_enq = burst_sz;
+
+   if (unlikely(num_to_process - enqueued < num_to_enq))
+   num_to_enq = num_to_process - enqueued;
+
+   enq = 0;
+   do {
+   enq += rte_bbdev_enqueue_ldpc_dec_ops(
+   tp->dev_id,
+   queue_id, &ops[enqueued],
+   num_to_enq);
+   } while (unlikely(num_to_enq != enq));
+   enqueued += enq;
+
+   /* Write to thread burst_sz current number of enqueued
+* descriptors. It ensures that proper number of
+* descriptors will be dequeued in callback
+* function - needed for last batch in case where
+* t

Re: [dpdk-dev] [PATCH v5 09/10] test-bbdev: support for offload test for LDPC

2020-03-27 Thread Dave Burley

Acked-by: Dave Burley 

On 26/03/2020 03:27, Nicolas Chautru wrote:

From: Nic Chautru 

Adding support for the offload latency tests when
using the LDPC encoder and decoder operations.

Signed-off-by: Nic Chautru 
---
  app/test-bbdev/test_bbdev_perf.c | 26 +++---
  1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index c45cdd2..6ec17e5 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -4643,7 +4643,7 @@ typedef int (test_case_function)(struct active_device *ad,
  offload_latency_empty_q_test_dec(uint16_t dev_id, uint16_t queue_id,
const uint16_t num_to_process, uint16_t burst_sz,
uint64_t *deq_total_time, uint64_t *deq_min_time,
-   uint64_t *deq_max_time)
+   uint64_t *deq_max_time, const enum rte_bbdev_op_type op_type)
  {
int i, deq_total;
struct rte_bbdev_dec_op *ops[MAX_BURST];
@@ -4657,7 +4657,12 @@ typedef int (test_case_function)(struct active_device 
*ad,
  
  		if (unlikely(num_to_process - deq_total < burst_sz))

burst_sz = num_to_process - deq_total;
-   rte_bbdev_dequeue_dec_ops(dev_id, queue_id, ops, burst_sz);
+   if (op_type == RTE_BBDEV_OP_LDPC_DEC)
+   rte_bbdev_dequeue_ldpc_dec_ops(dev_id, queue_id, ops,
+   burst_sz);
+   else
+   rte_bbdev_dequeue_dec_ops(dev_id, queue_id, ops,
+   burst_sz);
  
  		deq_last_time = rte_rdtsc_precise() - deq_start_time;

*deq_max_time = RTE_MAX(*deq_max_time, deq_last_time);
@@ -4672,7 +4677,7 @@ typedef int (test_case_function)(struct active_device *ad,
  offload_latency_empty_q_test_enc(uint16_t dev_id, uint16_t queue_id,
const uint16_t num_to_process, uint16_t burst_sz,
uint64_t *deq_total_time, uint64_t *deq_min_time,
-   uint64_t *deq_max_time)
+   uint64_t *deq_max_time, const enum rte_bbdev_op_type op_type)
  {
int i, deq_total;
struct rte_bbdev_enc_op *ops[MAX_BURST];
@@ -4685,7 +4690,12 @@ typedef int (test_case_function)(struct active_device 
*ad,
  
  		if (unlikely(num_to_process - deq_total < burst_sz))

burst_sz = num_to_process - deq_total;
-   rte_bbdev_dequeue_enc_ops(dev_id, queue_id, ops, burst_sz);
+   if (op_type == RTE_BBDEV_OP_LDPC_ENC)
+   rte_bbdev_dequeue_ldpc_enc_ops(dev_id, queue_id, ops,
+   burst_sz);
+   else
+   rte_bbdev_dequeue_enc_ops(dev_id, queue_id, ops,
+   burst_sz);
  
  		deq_last_time = rte_rdtsc_precise() - deq_start_time;

*deq_max_time = RTE_MAX(*deq_max_time, deq_last_time);
@@ -4695,6 +4705,7 @@ typedef int (test_case_function)(struct active_device *ad,
  
  	return i;

  }
+
  #endif
  
  static int

@@ -4732,14 +4743,15 @@ typedef int (test_case_function)(struct active_device 
*ad,
printf("== test: offload latency empty dequeue\ndev: %s, burst size: %u, num 
ops: %u, op type: %s\n",
info.dev_name, burst_sz, num_to_process, op_type_str);
  
-	if (op_type == RTE_BBDEV_OP_TURBO_DEC)

+   if (op_type == RTE_BBDEV_OP_TURBO_DEC ||
+   op_type == RTE_BBDEV_OP_LDPC_DEC)
iter = offload_latency_empty_q_test_dec(ad->dev_id, queue_id,
num_to_process, burst_sz, &deq_total_time,
-   &deq_min_time, &deq_max_time);
+   &deq_min_time, &deq_max_time, op_type);
else
iter = offload_latency_empty_q_test_enc(ad->dev_id, queue_id,
num_to_process, burst_sz, &deq_total_time,
-   &deq_min_time, &deq_max_time);
+   &deq_min_time, &deq_max_time, op_type);
  
  	if (iter <= 0)

return TEST_FAILED;


Re: [dpdk-dev] [PATCH v3 05/11] baseband/acc100: add LDPC processing functions

2020-08-20 Thread Dave Burley
Hi Nic,

As you've now specified the use of RTE_BBDEV_LDPC_LLR_COMPRESSION for this PMB, 
please could you confirm what the packed format of the LLRs in memory looks 
like? 

Best Regards

Dave Burley


From: dev  on behalf of Nicolas Chautru 

Sent: 19 August 2020 01:25
To: dev@dpdk.org ; akhil.go...@nxp.com 
Cc: bruce.richard...@intel.com ; Nicolas Chautru 

Subject: [dpdk-dev] [PATCH v3 05/11] baseband/acc100: add LDPC processing 
functions 
 
Adding LDPC decode and encode processing operations

Signed-off-by: Nicolas Chautru 
---
 drivers/baseband/acc100/rte_acc100_pmd.c | 1625 +-
 drivers/baseband/acc100/rte_acc100_pmd.h |    3 +
 2 files changed, 1626 insertions(+), 2 deletions(-)

diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c 
b/drivers/baseband/acc100/rte_acc100_pmd.c
index 7a21c57..5f32813 100644
--- a/drivers/baseband/acc100/rte_acc100_pmd.c
+++ b/drivers/baseband/acc100/rte_acc100_pmd.c
@@ -15,6 +15,9 @@
 #include 
 #include 
 #include 
+#ifdef RTE_BBDEV_OFFLOAD_COST
+#include 
+#endif
 
 #include 
 #include 
@@ -449,7 +452,6 @@
 return 0;
 }
 
-
 /**
  * Report a ACC100 queue index which is free
  * Return 0 to 16k for a valid queue_idx or -1 when no queue is available
@@ -634,6 +636,46 @@
 struct acc100_device *d = dev->data->dev_private;
 
 static const struct rte_bbdev_op_cap bbdev_capabilities[] = {
+   {
+   .type   = RTE_BBDEV_OP_LDPC_ENC,
+   .cap.ldpc_enc = {
+   .capability_flags =
+   RTE_BBDEV_LDPC_RATE_MATCH |
+   RTE_BBDEV_LDPC_CRC_24B_ATTACH |
+   RTE_BBDEV_LDPC_INTERLEAVER_BYPASS,
+   .num_buffers_src =
+   RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,
+   .num_buffers_dst =
+   RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,
+   }
+   },
+   {
+   .type   = RTE_BBDEV_OP_LDPC_DEC,
+   .cap.ldpc_dec = {
+   .capability_flags =
+   RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK |
+   RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP |
+   RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE |
+   RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE |
+#ifdef ACC100_EXT_MEM
+   RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE |
+   RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE |
+#endif
+   RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE |
+   RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS |
+   RTE_BBDEV_LDPC_DECODE_BYPASS |
+   RTE_BBDEV_LDPC_DEC_SCATTER_GATHER |
+   RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION |
+   RTE_BBDEV_LDPC_LLR_COMPRESSION,
+   .llr_size = 8,
+   .llr_decimals = 1,
+   .num_buffers_src =
+   RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,
+   .num_buffers_hard_out =
+   RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,
+   .num_buffers_soft_out = 0,
+   }
+   },
 RTE_BBDEV_END_OF_CAPABILITIES_LIST()
 };
 
@@ -669,9 +711,14 @@
 dev_info->cpu_flag_reqs = NULL;
 dev_info->min_alignment = 64;
 dev_info->capabilities = bbdev_capabilities;
+#ifdef ACC100_EXT_MEM
 dev_info->harq_buffer_size = d->ddr_size;
+#else
+   dev_info->harq_buffer_size = 0;
+#endif
 }
 
+
 static const struct rte_bbdev_ops acc100_bbdev_ops = {
 .setup_queues = acc100_setup_queues,
 .close = acc100_dev_close,
@@ -696,6 +743,1577 @@
 {.device_id = 0},
 };
 
+/* Read flag value 0/1 from bitmap */
+static inline bool
+check_bit(uint32_t bitmap, uint32_t bitmask)
+{
+   return bitmap & bitmask;
+}
+
+static inline char *
+mbuf_append(struct rte_mbuf *m_head, struct rte_mbuf *m, uint16_t len)
+{
+   if (unlikely(len > rte_pktmbuf_tailroom(m)))
+   return NULL;
+
+   char *tail = (char *)m->buf_addr + m->data_off + m->data_len;
+   m->data_len = (uint16_t)(m->data_len + len);
+   m_head->pkt_len  = (m_head->pkt_len + len);
+   return tail;
+}
+
+/* Compute value of k0.
+ * Based on 3GPP 38.212 Table 5.4.2.1-2
+ * Starting position of different redundancy versions, k0
+ */
+static inline uint16_t
+get_k0(uint16_t n_cb, uint16_t z_c, uint8_t bg, uint8_t rv_index)
+{
+   if (rv_index == 0)
+   return 0;
+   uint16_t n = (bg == 1 ? N_ZC_1 : N

Re: [dpdk-dev] [PATCH v3 05/11] baseband/acc100: add LDPC processing functions

2020-08-20 Thread Dave Burley
Hi Nic

Thank you - it would be useful to have further documentation for clarification 
as the data format isn't explicitly documented in BBDEV.
Best Regards

Dave


From: Chautru, Nicolas 
Sent: 20 August 2020 15:52
To: Dave Burley ; dev@dpdk.org 
Cc: Richardson, Bruce 
Subject: RE: [dpdk-dev] [PATCH v3 05/11] baseband/acc100: add LDPC processing 
functions 
 
Hi Dave, 
This is assuming 6 bits LLR compression packing (ie. first 2 MSB dropped). 
Similar to HARQ compression.
Let me know if unclear, I can clarify further in documentation if not explicit 
enough.
Thanks
Nic

> -Original Message-
> From: Dave Burley 
> Sent: Thursday, August 20, 2020 7:39 AM
> To: Chautru, Nicolas ; dev@dpdk.org
> Cc: Richardson, Bruce 
> Subject: Re: [dpdk-dev] [PATCH v3 05/11] baseband/acc100: add LDPC
> processing functions
> 
> Hi Nic,
> 
> As you've now specified the use of RTE_BBDEV_LDPC_LLR_COMPRESSION for
> this PMB, please could you confirm what the packed format of the LLRs in
> memory looks like?
> 
> Best Regards
> 
> Dave Burley
> 
> 
> From: dev  on behalf of Nicolas Chautru
> 
> Sent: 19 August 2020 01:25
> To: dev@dpdk.org ; akhil.go...@nxp.com
> 
> Cc: bruce.richard...@intel.com ; Nicolas
> Chautru 
> Subject: [dpdk-dev] [PATCH v3 05/11] baseband/acc100: add LDPC processing
> functions
> 
> Adding LDPC decode and encode processing operations
> 
> Signed-off-by: Nicolas Chautru 
> ---
>  drivers/baseband/acc100/rte_acc100_pmd.c | 1625
> +-
>  drivers/baseband/acc100/rte_acc100_pmd.h |    3 +
>  2 files changed, 1626 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c
> b/drivers/baseband/acc100/rte_acc100_pmd.c
> index 7a21c57..5f32813 100644
> --- a/drivers/baseband/acc100/rte_acc100_pmd.c
> +++ b/drivers/baseband/acc100/rte_acc100_pmd.c
> @@ -15,6 +15,9 @@
>  #include 
>  #include 
>  #include 
> +#ifdef RTE_BBDEV_OFFLOAD_COST
> +#include 
> +#endif
> 
>  #include 
>  #include 
> @@ -449,7 +452,6 @@
>  return 0;
>  }
> 
> -
>  /**
>   * Report a ACC100 queue index which is free
>   * Return 0 to 16k for a valid queue_idx or -1 when no queue is available
> @@ -634,6 +636,46 @@
>  struct acc100_device *d = dev->data->dev_private;
> 
>  static const struct rte_bbdev_op_cap bbdev_capabilities[] = {
> +   {
> +   .type   = RTE_BBDEV_OP_LDPC_ENC,
> +   .cap.ldpc_enc = {
> +   .capability_flags =
> +   RTE_BBDEV_LDPC_RATE_MATCH |
> +   RTE_BBDEV_LDPC_CRC_24B_ATTACH |
> +   RTE_BBDEV_LDPC_INTERLEAVER_BYPASS,
> +   .num_buffers_src =
> +   
> RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,
> +   .num_buffers_dst =
> +   
> RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,
> +   }
> +   },
> +   {
> +   .type   = RTE_BBDEV_OP_LDPC_DEC,
> +   .cap.ldpc_dec = {
> +   .capability_flags =
> +   RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK |
> +   RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP |
> +   RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE |
> +   RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE |
> +#ifdef ACC100_EXT_MEM
> +   RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABL
> E |
> +   RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENA
> BLE |
> +#endif
> +   RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE |
> +   RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS |
> +   RTE_BBDEV_LDPC_DECODE_BYPASS |
> +   RTE_BBDEV_LDPC_DEC_SCATTER_GATHER |
> +   RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION |
> +   RTE_BBDEV_LDPC_LLR_COMPRESSION,
> +   .llr_size = 8,
> +   .llr_decimals = 1,
> +   .num_buffers_src =
> +   RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,
> +   .num_buffers_hard_out =
> +   RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,
> +   .num_buffers_soft_out = 0,
> +   }
> +   },
>  RTE_BBDEV_END_OF_CAPABILITIES_LIST()
>  };
>

Re: [dpdk-dev] [PATCH v3 05/11] baseband/acc100: add LDPC processing functions

2020-09-03 Thread Dave Burley
Acked-by: Dave Burley 


From: Chautru, Nicolas 
Sent: 20 August 2020 22:05
To: Dave Burley ; dev@dpdk.org 
Cc: Richardson, Bruce 
Subject: RE: [dpdk-dev] [PATCH v3 05/11] baseband/acc100: add LDPC processing 
functions 
 

> From: Dave Burley > 
> Hi Nic
> 
> Thank you - it would be useful to have further documentation for clarification
> as the data format isn't explicitly documented in BBDEV.

Thanks Dave. Just updated on this other patch -> 
https://patches.dpdk.org/patch/75793/
Feel free to ack or let me know if you need more details. 

> Best Regards
> 
> Dave
> 
> 
> From: Chautru, Nicolas 
> Sent: 20 August 2020 15:52
> To: Dave Burley ; dev@dpdk.org
> 
> Cc: Richardson, Bruce 
> Subject: RE: [dpdk-dev] [PATCH v3 05/11] baseband/acc100: add LDPC
> processing functions
> 
> Hi Dave,
> This is assuming 6 bits LLR compression packing (ie. first 2 MSB dropped).
> Similar to HARQ compression.
> Let me know if unclear, I can clarify further in documentation if not explicit
> enough.
> Thanks
> Nic
> 
> > -Original Message-
> > From: Dave Burley 
> > Sent: Thursday, August 20, 2020 7:39 AM
> > To: Chautru, Nicolas ; dev@dpdk.org
> > Cc: Richardson, Bruce 
> > Subject: Re: [dpdk-dev] [PATCH v3 05/11] baseband/acc100: add LDPC
> > processing functions
> >
> > Hi Nic,
> >
> > As you've now specified the use of RTE_BBDEV_LDPC_LLR_COMPRESSION for
> > this PMB, please could you confirm what the packed format of the LLRs in
> > memory looks like?
> >
> > Best Regards
> >
> > Dave Burley
> >
> >
> > From: dev  on behalf of Nicolas Chautru
> > 
> > Sent: 19 August 2020 01:25
> > To: dev@dpdk.org ; akhil.go...@nxp.com
> > 
> > Cc: bruce.richard...@intel.com ; Nicolas
> > Chautru 
> > Subject: [dpdk-dev] [PATCH v3 05/11] baseband/acc100: add LDPC processing
> > functions
> >
> > Adding LDPC decode and encode processing operations
> >
> > Signed-off-by: Nicolas Chautru 
> > ---
> >  drivers/baseband/acc100/rte_acc100_pmd.c | 1625
> > +-
> >  drivers/baseband/acc100/rte_acc100_pmd.h |    3 +
> >  2 files changed, 1626 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c
> > b/drivers/baseband/acc100/rte_acc100_pmd.c
> > index 7a21c57..5f32813 100644
> > --- a/drivers/baseband/acc100/rte_acc100_pmd.c
> > +++ b/drivers/baseband/acc100/rte_acc100_pmd.c
> > @@ -15,6 +15,9 @@
> >  #include 
> >  #include 
> >  #include 
> > +#ifdef RTE_BBDEV_OFFLOAD_COST
> > +#include 
> > +#endif
> >
> >  #include 
> >  #include 
> > @@ -449,7 +452,6 @@
> >  return 0;
> >  }
> >
> > -
> >  /**
> >   * Report a ACC100 queue index which is free
> >   * Return 0 to 16k for a valid queue_idx or -1 when no queue is available
> > @@ -634,6 +636,46 @@
> >  struct acc100_device *d = dev->data->dev_private;
> >
> >  static const struct rte_bbdev_op_cap bbdev_capabilities[] = {
> > +   {
> > +   .type   = RTE_BBDEV_OP_LDPC_ENC,
> > +   .cap.ldpc_enc = {
> > +   .capability_flags =
> > +   RTE_BBDEV_LDPC_RATE_MATCH |
> > +   RTE_BBDEV_LDPC_CRC_24B_ATTACH |
> > +   RTE_BBDEV_LDPC_INTERLEAVER_BYPASS,
> > +   .num_buffers_src =
> > +   
> > RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,
> > +   .num_buffers_dst =
> > +   
> > RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,
> > +   }
> > +   },
> > +   {
> > +   .type   = RTE_BBDEV_OP_LDPC_DEC,
> > +   .cap.ldpc_dec = {
> > +   .capability_flags =
> > +   RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK |
> > +   RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP |
> > +   RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE |
> > +   RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE |
> > +#ifdef ACC100_EXT_MEM
> >
> +   RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABL
> > E |
> >
> +   RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENA
> &

Re: [dpdk-dev] [PATCH v3 1/7] app/bbdev: add explicit ut for latency vs validation

2020-09-15 Thread Dave Burley
Acked-by: Dave Burley 



From: dev  on behalf of Nicolas Chautru 

Sent: 19 August 2020 01:05
To: dev@dpdk.org ; akhil.go...@nxp.com 
Cc: bruce.richard...@intel.com ; Nicolas Chautru 

Subject: [dpdk-dev] [PATCH v3 1/7] app/bbdev: add explicit ut for latency vs 
validation 
 
Adding explicit different ut when testing for validation
or latency (early termination enabled or not).

Signed-off-by: Nicolas Chautru 
---
 app/test-bbdev/test_bbdev_perf.c | 92 ++--
 1 file changed, 88 insertions(+), 4 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 45c0d62..1319afd 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -3928,12 +3928,14 @@ typedef int (test_case_function)(struct active_device 
*ad,
 return i;
 }
 
+/* Test case for latency/validation for LDPC Decoder */
 static int
 latency_test_ldpc_dec(struct rte_mempool *mempool,
 struct test_buffers *bufs, struct rte_bbdev_dec_op *ref_op,
 int vector_mask, uint16_t dev_id, uint16_t queue_id,
 const uint16_t num_to_process, uint16_t burst_sz,
-   uint64_t *total_time, uint64_t *min_time, uint64_t *max_time)
+   uint64_t *total_time, uint64_t *min_time, uint64_t *max_time,
+   bool disable_et)
 {
 int ret = TEST_SUCCESS;
 uint16_t i, j, dequeued;
@@ -3955,7 +3957,7 @@ typedef int (test_case_function)(struct active_device *ad,
 "rte_bbdev_dec_op_alloc_bulk() failed");
 
 /* For latency tests we need to disable early termination */
-   if (check_bit(ref_op->ldpc_dec.op_flags,
+   if (disable_et && check_bit(ref_op->ldpc_dec.op_flags,
 RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE))
 ref_op->ldpc_dec.op_flags -=
 RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE;
@@ -4177,7 +4179,7 @@ typedef int (test_case_function)(struct active_device *ad,
 TEST_ASSERT_NOT_NULL(op_type_str, "Invalid op type: %u", op_type);
 
 printf("+ --- 
+\n");
-   printf("== test: validation/latency\ndev: %s, burst size: %u, num ops: 
%u, op type: %s\n",
+   printf("== test: latency\ndev: %s, burst size: %u, num ops: %u, op 
type: %s\n",
 info.dev_name, burst_sz, num_to_process, op_type_str);
 
 if (op_type == RTE_BBDEV_OP_TURBO_DEC)
@@ -4199,7 +4201,83 @@ typedef int (test_case_function)(struct active_device 
*ad,
 iter = latency_test_ldpc_dec(op_params->mp, bufs,
 op_params->ref_dec_op, op_params->vector_mask,
 ad->dev_id, queue_id, num_to_process,
+   burst_sz, &total_time, &min_time, &max_time,
+   true);
+   else
+   iter = latency_test_enc(op_params->mp, bufs,
+   op_params->ref_enc_op,
+   ad->dev_id, queue_id,
+   num_to_process, burst_sz, &total_time,
+   &min_time, &max_time);
+
+   if (iter <= 0)
+   return TEST_FAILED;
+
+   printf("Operation latency:\n"
+   "\tavg: %lg cycles, %lg us\n"
+   "\tmin: %lg cycles, %lg us\n"
+   "\tmax: %lg cycles, %lg us\n",
+   (double)total_time / (double)iter,
+   (double)(total_time * 100) / (double)iter /
+   (double)rte_get_tsc_hz(), (double)min_time,
+   (double)(min_time * 100) / (double)rte_get_tsc_hz(),
+   (double)max_time, (double)(max_time * 100) /
+   (double)rte_get_tsc_hz());
+
+   return TEST_SUCCESS;
+}
+
+static int
+validation_test(struct active_device *ad,
+   struct test_op_params *op_params)
+{
+   int iter;
+   uint16_t burst_sz = op_params->burst_sz;
+   const uint16_t num_to_process = op_params->num_to_process;
+   const enum rte_bbdev_op_type op_type = test_vector.op_type;
+   const uint16_t queue_id = ad->queue_ids[0];
+   struct test_buffers *bufs = NULL;
+   struct rte_bbdev_info info;
+   uint64_t total_time, min_time, max_time;
+   const char *op_type_str;
+
+   total_time = max_time = 0;
+   min_time = UINT64_MAX;
+
+   TEST_ASSERT_SUCCESS((burst_sz > MAX_BURST),
+   "BURST_SIZE should be <= %u", MAX_BURST);
+
+   rte_bbdev_info_get(ad->dev_id, &info);
+   bufs =

Re: [dpdk-dev] [PATCH v3 2/7] app/bbdev: add explicit check for counters

2020-09-15 Thread Dave Burley
Acked-by: Dave Burley 


From: dev  on behalf of Nicolas Chautru 

Sent: 19 August 2020 01:05
To: dev@dpdk.org ; akhil.go...@nxp.com 
Cc: bruce.richard...@intel.com ; Nicolas Chautru 

Subject: [dpdk-dev] [PATCH v3 2/7] app/bbdev: add explicit check for counters 
 
Adding explicit check in ut that the stats counters
have the expected values. Was missing for coverage.

Signed-off-by: Nicolas Chautru 
---
 app/test-bbdev/test_bbdev_perf.c | 17 +
 1 file changed, 17 insertions(+)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 1319afd..b0b6f18 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -4769,6 +4769,23 @@ typedef int (test_case_function)(struct active_device 
*ad,
 (double)(time_st.deq_max_time * 100) /
 rte_get_tsc_hz());
 
+   struct rte_bbdev_stats stats = {0};
+   get_bbdev_queue_stats(ad->dev_id, queue_id, &stats);
+   if (op_type != RTE_BBDEV_OP_LDPC_DEC) {
+   TEST_ASSERT_SUCCESS(stats.enqueued_count != num_to_process,
+   "Mismatch in enqueue count %10"PRIu64" %d",
+   stats.enqueued_count, num_to_process);
+   TEST_ASSERT_SUCCESS(stats.dequeued_count != num_to_process,
+   "Mismatch in dequeue count %10"PRIu64" %d",
+   stats.dequeued_count, num_to_process);
+   }
+   TEST_ASSERT_SUCCESS(stats.enqueue_err_count != 0,
+   "Enqueue count Error %10"PRIu64"",
+   stats.enqueue_err_count);
+   TEST_ASSERT_SUCCESS(stats.dequeue_err_count != 0,
+   "Dequeue count Error (%10"PRIu64"",
+   stats.dequeue_err_count);
+
 return TEST_SUCCESS;
 #endif
 }
-- 
1.8.3.1


Re: [dpdk-dev] [PATCH v3 5/7] app/bbdev: skip bler ut when compression is used

2020-09-15 Thread Dave Burley
Acked-by: Dave Burley 



From: dev  on behalf of Nicolas Chautru 

Sent: 19 August 2020 01:05
To: dev@dpdk.org ; akhil.go...@nxp.com 
Cc: bruce.richard...@intel.com ; Nicolas Chautru 

Subject: [dpdk-dev] [PATCH v3 5/7] app/bbdev: skip bler ut when compression is 
used 
 
bler test results are not valid when LLR compression
is used or for loopback scenarios. Skipping these.

Signed-off-by: Nicolas Chautru 
---
 app/test-bbdev/test_bbdev_perf.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index e2c1d64..a6cd94b 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -3648,7 +3648,11 @@ typedef int (test_case_function)(struct active_device 
*ad,
 RTE_ALIGN(sizeof(struct thread_params) * num_lcores,
 RTE_CACHE_LINE_SIZE));
 
-   if (test_vector.op_type == RTE_BBDEV_OP_LDPC_DEC)
+   if ((test_vector.op_type == RTE_BBDEV_OP_LDPC_DEC) &&
+   !check_bit(test_vector.ldpc_dec.op_flags,
+   RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK)
+   && !check_bit(test_vector.ldpc_dec.op_flags,
+   RTE_BBDEV_LDPC_LLR_COMPRESSION))
 bler_function = bler_pmd_lcore_ldpc_dec;
 else
 return TEST_SKIPPED;
-- 
1.8.3.1


Re: [dpdk-dev] [PATCH v3 7/7] app/bbdev: update offload test to dequeue full ring

2020-09-15 Thread Dave Burley
Acked-by: Dave Burley 


From: dev  on behalf of Nicolas Chautru 

Sent: 19 August 2020 01:05
To: dev@dpdk.org ; akhil.go...@nxp.com 
Cc: bruce.richard...@intel.com ; Nicolas Chautru 

Subject: [dpdk-dev] [PATCH v3 7/7] app/bbdev: update offload test to dequeue 
full ring 
 
update offload dequeue to retrieve the full ring to be
agnostic of implementation.

Signed-off-by: Nicolas Chautru 
---
 app/test-bbdev/test_bbdev_perf.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index c5156a2..ccb6b38 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -4392,8 +4392,8 @@ typedef int (test_case_function)(struct active_device *ad,
 /* Dequeue one operation */
 do {
 deq += rte_bbdev_dequeue_dec_ops(dev_id, queue_id,
-   &ops_deq[deq], 1);
-   } while (unlikely(deq != 1));
+   &ops_deq[deq], enq);
+   } while (unlikely(deq == 0));
 
 deq_last_time = rte_rdtsc_precise() - deq_start_time;
 time_st->deq_max_time = RTE_MAX(time_st->deq_max_time,
@@ -4483,8 +4483,8 @@ typedef int (test_case_function)(struct active_device *ad,
 /* Dequeue one operation */
 do {
 deq += rte_bbdev_dequeue_ldpc_dec_ops(dev_id, queue_id,
-   &ops_deq[deq], 1);
-   } while (unlikely(deq != 1));
+   &ops_deq[deq], enq);
+   } while (unlikely(deq == 0));
 
 deq_last_time = rte_rdtsc_precise() - deq_start_time;
 time_st->deq_max_time = RTE_MAX(time_st->deq_max_time,
@@ -4571,8 +4571,8 @@ typedef int (test_case_function)(struct active_device *ad,
 /* Dequeue one operation */
 do {
 deq += rte_bbdev_dequeue_enc_ops(dev_id, queue_id,
-   &ops_deq[deq], 1);
-   } while (unlikely(deq != 1));
+   &ops_deq[deq], enq);
+   } while (unlikely(deq == 0));
 
 deq_last_time = rte_rdtsc_precise() - deq_start_time;
 time_st->deq_max_time = RTE_MAX(time_st->deq_max_time,
@@ -4654,8 +4654,8 @@ typedef int (test_case_function)(struct active_device *ad,
 /* Dequeue one operation */
 do {
 deq += rte_bbdev_dequeue_ldpc_enc_ops(dev_id, queue_id,
-   &ops_deq[deq], 1);
-   } while (unlikely(deq != 1));
+   &ops_deq[deq], enq);
+   } while (unlikely(deq == 0));
 
 deq_last_time = rte_rdtsc_precise() - deq_start_time;
 time_st->deq_max_time = RTE_MAX(time_st->deq_max_time,
-- 
1.8.3.1


Re: [dpdk-dev] [PATCH v1] app/bbdev: fix test vector symlink

2020-09-15 Thread Dave Burley
Acked-by: Dave Burley 


From: dev  on behalf of Nicolas Chautru 

Sent: 09 September 2020 22:15
To: dev@dpdk.org 
Cc: sta...@dpdk.org ; tianjiao@intel.com 
; Nicolas Chautru 
Subject: [dpdk-dev] [PATCH v1] app/bbdev: fix test vector symlink 
 
5G DL default symlink was pointing to a 4G vector.

Fixes: d762705308c4 ("app/bbdev: add test vectors for 5GNR")
Cc: sta...@dpdk.org

Signed-off-by: Nicolas Chautru 
---
 app/test-bbdev/ldpc_enc_default.data | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-bbdev/ldpc_enc_default.data 
b/app/test-bbdev/ldpc_enc_default.data
index 371cbc6..52d51ae 12
--- a/app/test-bbdev/ldpc_enc_default.data
+++ b/app/test-bbdev/ldpc_enc_default.data
@@ -1 +1 @@
-test_vectors/turbo_dec_c1_k6144_r0_e10376_crc24b_sbd_negllr_high_snr.data
\ No newline at end of file
+test_vectors/ldpc_enc_v2342.data
\ No newline at end of file
-- 
1.8.3.1