Skip to contentSkip to conversation

bbdev: API extension for 23.11

PATCH Superseded Nicolas Chautru 1 participant 5 messages May 25, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover bbdev: API extension for 23.11

Hi,

Including v1 for extending the bbdev api for 23.11. The new MLD-TS is expected to be non ABI compatible, the other ones should not break ABI.
I will send a deprecation notice in parallel.

This introduces a new operation (on top of FEC and FFT) to support equalization for MLD-TS. There also more modular API extension for existing FFT and FEC operation.

Thanks
Nic

Nicolas Chautru (4):
bbdev: add operation type for MLDTS procession
bbdev: add new capabilities for FFT processing
bbdev: add new capability for FEC 5G UL processing
bbdev: improving error handling for queue configuration

 doc/guides/prog_guide/bbdev.rst |  83 ++++++++++++++++++
 lib/bbdev/rte_bbdev.c           |  26 +++---
 lib/bbdev/rte_bbdev.h           |  76 +++++++++++++++++
 lib/bbdev/rte_bbdev_op.h        | 143 +++++++++++++++++++++++++++++++-
 lib/bbdev/version.map           |   5 ++
 5 files changed, 320 insertions(+), 13 deletions(-)
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/4 bbdev: add new capabilities for FFT processing

Extending existing FFT operation for new capabilities. Optional frequency domain dewindowing, frequency resampling, timing error correction and time offset per CS.

---
 doc/guides/prog_guide/bbdev.rst | 24 ++++++++++++++++++++++++
 lib/bbdev/rte_bbdev_op.h        | 23 ++++++++++++++++++++++-
 2 files changed, 46 insertions(+), 1 deletion(-)
doc/guides/prog_guide/bbdev.rst +24 -0
index 5b09c92963..d5c7522f79 100644
@@ -1111,6 +1111,18 @@ with the operation flags forming a bitmask in the ``op_flags`` field.
 |RTE_BBDEV_FFT_FP16_OUTPUT                                           |
 | Set if the output data shall use FP16 format instead of INT16      |
 +--------------------------------------------------------------------+
+|RTE_BBDEV_FFT_TIMING_OFFSET_PER_CS                                  |
+| Set if device supports adjusting time offset per CS                |
++--------------------------------------------------------------------+
+|RTE_BBDEV_FFT_TIMING_ERROR                                          |
+| Set if device supports correcting for timing error                 |
++--------------------------------------------------------------------+
+|RTE_BBDEV_FFT_DEWINDOWING                                           |
+| Set if enabling the option FFT Dewindowing in Frequency domain     |
++--------------------------------------------------------------------+
+|RTE_BBDEV_FFT_FREQ_RESAMPLING                                       |
+| Set if device supports the optional frequency resampling           |
++--------------------------------------------------------------------+
 
 The FFT parameters are set out in the table below.
 
@@ -1121,6 +1133,8 @@ The FFT parameters are set out in the table below.
 +-------------------------+--------------------------------------------------------------+
 |base_output              |output data                                                   |
 +-------------------------+--------------------------------------------------------------+
+|dewindowing_input        |optional frequency domain dewindowing input data              |
++-------------------------+--------------------------------------------------------------+
 |power_meas_output        |optional output data with power measurement on DFT output     |
 +-------------------------+--------------------------------------------------------------+
 |op_flags                 |bitmask of all active operation capabilities                  |
@@ -1155,6 +1169,16 @@ The FFT parameters are set out in the table below.
 +-------------------------+--------------------------------------------------------------+
 |fp16_exp_adjust          |value added to FP16 exponent at conversion from INT16         |
 +-------------------------+--------------------------------------------------------------+
+|freq_resample_mode       |frequency ressampling mode (0:transparent, 1-2: resample)     |
++-------------------------+--------------------------------------------------------------+
+| output_depadded_size    |output depadded size prior to frequency resampling            |
++-------------------------+--------------------------------------------------------------+
+|cs_theta_0               |timing error correction initial phase                         |
++-------------------------+--------------------------------------------------------------+
+|cs_theta_d               |timing error correction phase increment                       |
++-------------------------+--------------------------------------------------------------+
+|time_offset              |time offset per CS of time domain samples                     |
++-------------------------+--------------------------------------------------------------+
 
 The mbuf input ``base_input`` is mandatory for all bbdev PMDs and
 is the incoming data for the processing. Its size may not fit into an actual mbuf,
lib/bbdev/rte_bbdev_op.h +22 -1
index 990d110fa7..682e265327 100644
@@ -50,6 +50,7 @@ extern "C" {
 #define RTE_BBDEV_LDPC_MAX_CODE_BLOCKS (256)
 /* 12 CS maximum */
 #define RTE_BBDEV_MAX_CS_2 (6)
+#define RTE_BBDEV_MAX_CS   (12)
 /* MLD-TS up to 4 layers */
 #define RTE_BBDEV_MAX_MLD_LAYERS (4)
 /* 12 SB per RB */
@@ -242,7 +243,15 @@ enum rte_bbdev_op_fft_flag_bitmasks {
 	/** Set if the input data used FP16 format. */
 	RTE_BBDEV_FFT_FP16_INPUT = (1ULL << 6),
 	/** Set if the output data uses FP16 format. */
-	RTE_BBDEV_FFT_FP16_OUTPUT = (1ULL << 7)
+	RTE_BBDEV_FFT_FP16_OUTPUT = (1ULL << 7),
+	/** Flexible adjustment of Timing offset adjustment per CS. */
+	RTE_BBDEV_FFT_TIMING_OFFSET_PER_CS = (1ULL << 8),
+	/** Flexible adjustment of Timing error correction per CS. */
+	RTE_BBDEV_FFT_TIMING_ERROR = (1ULL << 9),
+	/** Set for optional frequency domain dewindowing. */
+	RTE_BBDEV_FFT_DEWINDOWING = (1ULL << 10),
+	/** Flexible adjustment of frequency resampling mode. */
+	RTE_BBDEV_FFT_FREQ_RESAMPLING = (1ULL << 11)
 };
 
 /** Flags for MLDTS operation and capability structure */
@@ -756,6 +765,8 @@ struct rte_bbdev_op_fft {
 	struct rte_bbdev_op_data base_input;
 	/** Output data starting from first antenna and first cyclic shift. */
 	struct rte_bbdev_op_data base_output;
+	/** Optional frequency window input data. */
+	struct rte_bbdev_op_data dewindowing_input;
 	/** Optional power measurement output data. */
 	struct rte_bbdev_op_data power_meas_output;
 	/** Flags from rte_bbdev_op_fft_flag_bitmasks. */
@@ -790,6 +801,16 @@ struct rte_bbdev_op_fft {
 	uint16_t power_shift;
 	/** Adjust the FP6 exponent for INT<->FP16 conversion. */
 	uint16_t fp16_exp_adjust;
+	/** Frequency resampling : 0: Transparent Mode1: 4/3 Resample2: 2/3 Resample. */
+	int8_t freq_resample_mode;
+	/** Output depadded size prior to frequency resampling. */
+	uint16_t output_depadded_size;
+	/** Time error correction initial phase. */
+	uint16_t cs_theta_0[RTE_BBDEV_MAX_CS];
+	/** Time error correction phase increment. */
+	uint32_t cs_theta_d[RTE_BBDEV_MAX_CS];
+	/* Time offset per CS of time domain samples. */
+	int8_t time_offset[RTE_BBDEV_MAX_CS];
 };
 /* >8 End of structure rte_bbdev_op_fft. */
 
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/4 bbdev: add operation type for MLDTS procession

In reply to Nicolas Chautru

Extended bbdev operations to support MLDTS based operations.

---
 doc/guides/prog_guide/bbdev.rst |  53 +++++++++++++++
 lib/bbdev/rte_bbdev.c           |  11 ++-
 lib/bbdev/rte_bbdev.h           |  76 +++++++++++++++++++++
 lib/bbdev/rte_bbdev_op.h        | 116 +++++++++++++++++++++++++++++++-
 lib/bbdev/version.map           |   5 ++
 5 files changed, 259 insertions(+), 2 deletions(-)
doc/guides/prog_guide/bbdev.rst +53 -0
index 549f1d002a..5b09c92963 100644
@@ -1165,6 +1165,59 @@ either as 2 INT16 or as 2 FP16 based when the option supported.
 The data layout is based on contiguous concatenation of output data
 first by cyclic shift then by antenna.
 
+BBDEV MLD-TS Operation
+~~~~~~~~~~~~~~~~~~~~~~
+
+This operation allows to run the Tree Search (TS) portion of a Maximum Likelihood processing (MLD).
+
+This alternate equalization option accelerates the exploration of the best combination of
+transmitted symbols across layers minimizing the Euclidian distance between the received and
+reconstructed signal, then generates the LLRs to be used by the LDPC Decoder.
+The input is the results of the Q R decomposition: Q^Hy signal and R matrix.
+
+The structure passed for each MLD-TS operation is given below,
+with the operation flags forming a bitmask in the ``op_flags`` field.
+
+  **NOTE:** The actual operation flags that may be used with a specific
+  bbdev PMD are dependent on the driver capabilities as reported via
+  ``rte_bbdev_info_get()``, and may be a subset of those below.
+
+.. literalinclude:: ../../../lib/bbdev/rte_bbdev_op.h
+   :language: c
+   :start-after: Structure rte_bbdev_op_mldts 8<
+   :end-before: >8 End of structure rte_bbdev_op_mldts.
+
++--------------------------------------------------------------------+
+|Description of MLD-TS capability flags                              |
++====================================================================+
+|RTE_BBDEV_MLDTS_REP                                                 |
+| Set if the option to use repeated data from R channel is supported |
++--------------------------------------------------------------------+
+
+The MLD-TS parameters are set out in the table below.
+
++-------------------------+--------------------------------------------------------------+
+|Parameter                |Description                                                   |
++=========================+==============================================================+
+|qhy_input                |input data qHy                                                |
++-------------------------+--------------------------------------------------------------+
+|r_input                  |input data R triangular matrix                                |
++-------------------------+--------------------------------------------------------------+
+|output                   |output data (LLRs)                                            |
++-------------------------+--------------------------------------------------------------+
+|op_flags                 |bitmask of all active operation capabilities                  |
++-------------------------+--------------------------------------------------------------+
+|num_rbs                  |number of Resource Blocks                                     |
++-------------------------+--------------------------------------------------------------+
+|num_layers               |number of overlapping layers                                  |
++-------------------------+--------------------------------------------------------------+
+|q_m                      |array of modulation order for each layer                      |
++-------------------------+--------------------------------------------------------------+
+|r_rep                    |optional row repetition for the R matrix (subcarriers)        |
++-------------------------+--------------------------------------------------------------+
+|c_rep                    |optional column repetition for the R matrix (symbols)         |
++-------------------------+--------------------------------------------------------------+
+
 Sample code
 -----------
 
lib/bbdev/rte_bbdev.c +10 -1
index 1521cdbc53..26fc077bdc 100644
@@ -24,7 +24,7 @@
 #define DEV_NAME "BBDEV"
 
 /* Number of supported operation types in *rte_bbdev_op_type*. */
-#define BBDEV_OP_TYPE_COUNT 6
+#define BBDEV_OP_TYPE_COUNT 7
 
 /* BBDev library logging ID */
 RTE_LOG_REGISTER_DEFAULT(bbdev_logtype, NOTICE);
@@ -857,6 +857,9 @@ get_bbdev_op_size(enum rte_bbdev_op_type type)
 	case RTE_BBDEV_OP_FFT:
 		result = sizeof(struct rte_bbdev_fft_op);
 		break;
+	case RTE_BBDEV_OP_MLDTS:
+		result = sizeof(struct rte_bbdev_mldts_op);
+		break;
 	default:
 		break;
 	}
@@ -884,6 +887,10 @@ bbdev_op_init(struct rte_mempool *mempool, void *arg, void *element,
 		struct rte_bbdev_fft_op *op = element;
 		memset(op, 0, mempool->elt_size);
 		op->mempool = mempool;
+	} else if (type == RTE_BBDEV_OP_MLDTS) {
+		struct rte_bbdev_mldts_op *op = element;
+		memset(op, 0, mempool->elt_size);
+		op->mempool = mempool;
 	}
 }
 
@@ -1135,6 +1142,7 @@ rte_bbdev_op_type_str(enum rte_bbdev_op_type op_type)
 		"RTE_BBDEV_OP_LDPC_DEC",
 		"RTE_BBDEV_OP_LDPC_ENC",
 		"RTE_BBDEV_OP_FFT",
+		"RTE_BBDEV_OP_MLDTS",
 	};
 
 	if (op_type < BBDEV_OP_TYPE_COUNT)
@@ -1184,3 +1192,4 @@ rte_bbdev_enqueue_status_str(enum rte_bbdev_enqueue_status status)
 	rte_bbdev_log(ERR, "Invalid enqueue status");
 	return NULL;
 }
+
lib/bbdev/rte_bbdev.h +76 -0

106 lines not on this page · raw message

lib/bbdev/rte_bbdev_op.h +115 -1

176 lines not on this page · raw message

lib/bbdev/version.map +5 -0
index d0bb835255..8f28ae7c68 100644
@@ -50,4 +50,9 @@ EXPERIMENTAL {
 	rte_bbdev_enqueue_status_str;
 	rte_bbdev_fft_op_alloc_bulk;
 	rte_bbdev_fft_op_free_bulk;
+	#added in 23.11
+	rte_bbdev_dequeue_mldts_ops;
+	rte_bbdev_enqueue_mldts_ops;
+	rte_bbdev_mldts_op_alloc_bulk;
+	rte_bbdev_mldts_op_free_bulk;
 };
Signature · 1 line
2.34.1
#4 lore raw

PATCH 4/4 bbdev: improving error handling for queue configuration

In reply to Nicolas Chautru

Refactor of the error handling based on available priority queue to be more generic.

---
 lib/bbdev/rte_bbdev.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
lib/bbdev/rte_bbdev.c +6 -9
index 26fc077bdc..589b796ea3 100644
@@ -441,6 +441,7 @@ rte_bbdev_queue_configure(uint16_t dev_id, uint16_t queue_id,
 	const struct rte_bbdev_op_cap *p;
 	struct rte_bbdev_queue_conf *stored_conf;
 	const char *op_type_str;
+	unsigned int max_priority;
 	VALID_DEV_OR_RET_ERR(dev, dev_id);
 
 	VALID_DEV_OPS_OR_RET_ERR(dev, dev_id);
@@ -494,20 +495,16 @@ rte_bbdev_queue_configure(uint16_t dev_id, uint16_t queue_id,
 					conf->queue_size, queue_id, dev_id);
 			return -EINVAL;
 		}
-		if (conf->op_type == RTE_BBDEV_OP_TURBO_DEC &&
-			conf->priority > dev_info.max_ul_queue_priority) {
+		if ((uint8_t)conf->op_type >= RTE_BBDEV_OP_TYPE_SIZE_MAX) {
 			rte_bbdev_log(ERR,
-					"Priority (%u) of queue %u of bbdev %u must be <= %u",
-					conf->priority, queue_id, dev_id,
-					dev_info.max_ul_queue_priority);
+					"Invalid operation type (%u) ", conf->op_type);
 			return -EINVAL;
 		}
-		if (conf->op_type == RTE_BBDEV_OP_TURBO_ENC &&
-			conf->priority > dev_info.max_dl_queue_priority) {
+		max_priority = dev_info.queue_priority[conf->op_type];
+		if (conf->priority > max_priority) {
 			rte_bbdev_log(ERR,
 					"Priority (%u) of queue %u of bbdev %u must be <= %u",
-					conf->priority, queue_id, dev_id,
-					dev_info.max_dl_queue_priority);
+					conf->priority, queue_id, dev_id, max_priority);
 			return -EINVAL;
 		}
 	}
Signature · 1 line
2.34.1
#3 lore raw

PATCH 3/4 bbdev: add new capability for FEC 5G UL processing

In reply to Nicolas Chautru

Extending existing LDPC UL operation for new capability. Option to compress HARQ memory to 4 bits per LLR.

---
 doc/guides/prog_guide/bbdev.rst | 6 ++++++
 lib/bbdev/rte_bbdev_op.h        | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)
doc/guides/prog_guide/bbdev.rst +6 -0
index d5c7522f79..8dd7b866ad 100644
@@ -903,6 +903,12 @@ given below.
 |RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK                        |
 | Set if a device supports loopback access to HARQ internal memory   |
 +--------------------------------------------------------------------+
+|RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS                         |
+| Set if a device includes LLR filler bits in HARQ circular buffer   |
++--------------------------------------------------------------------+
+|RTE_BBDEV_LDPC_HARQ_4BIT_COMPRESSION                                |
+|Set if a device supports input/output 4 bits HARQ compression       |
++--------------------------------------------------------------------+
 
 The structure passed for each LDPC decode operation is given below,
 with the operation flags forming a bitmask in the ``op_flags`` field.
lib/bbdev/rte_bbdev_op.h +3 -1
index 682e265327..a4a2ae1440 100644
@@ -203,7 +203,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 << 19)
+	RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS = (1ULL << 19),
+	/** Set if a device supports input/output HARQ 4bits compression. */
+	RTE_BBDEV_LDPC_HARQ_4BIT_COMPRESSION = (1ULL << 20)
 };
 
 /** Flags for LDPC encoder operation and capability structure */
Signature · 1 line
2.34.1