All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Chautru <nicolas.chautru@intel.com>
To: dev@dpdk.org, thomas@monjalon.net, gakhil@marvell.com
Cc: maxime.coquelin@redhat.com, trix@redhat.com, mdr@ashroe.eu,
	bruce.richardson@intel.com, david.marchand@redhat.com,
	stephen@networkplumber.org, mingshan.zhang@intel.com,
	hemant.agrawal@nxp.com,
	Nicolas Chautru <nicolas.chautru@intel.com>
Subject: [PATCH v11 5/7] bbdev: add new operation for FFT processing
Date: Mon,  3 Oct 2022 11:00:21 -0700	[thread overview]
Message-ID: <20221003180023.13362-6-nicolas.chautru@intel.com> (raw)
In-Reply-To: <20221003180023.13362-1-nicolas.chautru@intel.com>

Extension of bbdev operation to support FFT based operations.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 doc/guides/prog_guide/bbdev.rst        | 103 +++++++++++++++++
 doc/guides/rel_notes/deprecation.rst   |   4 -
 doc/guides/rel_notes/release_22_11.rst |   5 +
 lib/bbdev/rte_bbdev.c                  |  10 +-
 lib/bbdev/rte_bbdev.h                  |  76 +++++++++++++
 lib/bbdev/rte_bbdev_op.h               | 149 +++++++++++++++++++++++++
 lib/bbdev/version.map                  |   4 +
 7 files changed, 346 insertions(+), 5 deletions(-)

diff --git a/doc/guides/prog_guide/bbdev.rst b/doc/guides/prog_guide/bbdev.rst
index 70fa01ada5..1c7eb24148 100644
--- a/doc/guides/prog_guide/bbdev.rst
+++ b/doc/guides/prog_guide/bbdev.rst
@@ -1118,6 +1118,109 @@ Figure :numref:`figure_turbo_tb_decode` above
 showing the Turbo decoding of CBs using BBDEV interface in TB-mode
 is also valid for LDPC decode.
 
+BBDEV FFT Operation
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This operation allows to run a combination of DFT and/or IDFT and/or time-domain windowing.
+These can be used in a modular fashion (using bypass modes) or as a processing pipeline
+which can be used for FFT-based baseband signal processing.
+In more details it allows :
+- to process the data first through an IDFT of adjustable size and padding;
+- to perform the windowing as a programmable cyclic shift offset of the data followed by a
+pointwise multiplication by a time domain window;
+- to process the related data through a DFT of adjustable size and de-padding for each such cyclic
+shift output.
+
+A flexible number of Rx antennas are being processed in parallel with the same configuration.
+The API allows more generally for flexibility in what the PMD may support (capability flags) and
+flexibility to adjust some of the parameters of the processing.
+
+The operation/capability flags that can be set for each FFT operation are given below.
+
+  **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.
+
++--------------------------------------------------------------------+
+|Description of FFT capability flags                                 |
++====================================================================+
+|RTE_BBDEV_FFT_WINDOWING                                             |
+| Set to enable/support windowing in time domain                     |
++--------------------------------------------------------------------+
+|RTE_BBDEV_FFT_CS_ADJUSTMENT                                         |
+| Set to enable/support  the cyclic shift time offset adjustment     |
++--------------------------------------------------------------------+
+|RTE_BBDEV_FFT_DFT_BYPASS                                            |
+| Set to bypass the DFT and use directly the IDFT as an option       |
++--------------------------------------------------------------------+
+|RTE_BBDEV_FFT_IDFT_BYPASS                                           |
+| Set to bypass the IDFT and use directly the DFT as an option       |
++--------------------------------------------------------------------+
+|RTE_BBDEV_FFT_WINDOWING_BYPASS                                      |
+| Set to bypass the time domain windowing  as an option              |
++--------------------------------------------------------------------+
+|RTE_BBDEV_FFT_POWER_MEAS                                            |
+| Set to provide an optional power measurement of the DFT output     |
++--------------------------------------------------------------------+
+|RTE_BBDEV_FFT_FP16_INPUT                                            |
+| Set if the input data shall use FP16 format instead of INT16       |
++--------------------------------------------------------------------+
+|RTE_BBDEV_FFT_FP16_OUTPUT                                           |
+| Set if the output data shall use FP16 format instead of INT16      |
++--------------------------------------------------------------------+
+
+The FFT parameters are set out in the table below.
+
++-------------------------+--------------------------------------------------------------+
+|Parameter                |Description                                                   |
++=========================+==============================================================+
+|base_input               |input data                                                    |
++-------------------------+--------------------------------------------------------------+
+|base_output              |output data                                                   |
++-------------------------+--------------------------------------------------------------+
+|power_meas_output        |optional output data with power measurement on DFT output     |
++-------------------------+--------------------------------------------------------------+
+|op_flags                 |bitmask of all active operation capabilities                  |
++-------------------------+--------------------------------------------------------------+
+|input_sequence_size      |size of the input sequence in 32-bits points per antenna      |
++-------------------------+--------------------------------------------------------------+
+|input_leading_padding    |number of points padded at the start of input data            |
++-------------------------+--------------------------------------------------------------+
+|output_sequence_size     |size of the output sequence per antenna and cyclic shift      |
++-------------------------+--------------------------------------------------------------+
+|output_leading_depadding |number of points de-padded at the start of output data        |
++-------------------------+--------------------------------------------------------------+
+|window_index             |optional windowing profile index used for each cyclic shift   |
++-------------------------+--------------------------------------------------------------+
+|cs_bitmap                |bitmap of the cyclic shift output requested (LSB for index 0) |
++-------------------------+--------------------------------------------------------------+
+|num_antennas_log2        |number of antennas as a log2 (10 maps to 1024...)             |
++-------------------------+--------------------------------------------------------------+
+|idft_log2                |iDFT size as a log2                                           |
++-------------------------+--------------------------------------------------------------+
+|dft_log2                 |DFT size as a log2                                            |
++-------------------------+--------------------------------------------------------------+
+|cs_time_adjustment       |adjustment of time position of all the cyclic shift output    |
++-------------------------+--------------------------------------------------------------+
+|idft_shift               |shift down of signal level post iDFT                          |
++-------------------------+--------------------------------------------------------------+
+|dft_shift                |shift down of signal level post DFT                           |
++-------------------------+--------------------------------------------------------------+
+|ncs_reciprocal           |inverse of max number of CS normalized to 15b (ie. 231 for 12)|
++-------------------------+--------------------------------------------------------------+
+|power_shift              |shift down of level of power measurement when enabled         |
++-------------------------+--------------------------------------------------------------+
+|fp16_exp_adjust          |value added to FP16 exponent at conversion from INT16         |
++-------------------------+--------------------------------------------------------------+
+
+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, but the
+structure is used to pass iova address.
+The mbuf output ``output`` is mandatory and is output of the FFT processing chain.
+Each point is a complex number of 32bits : 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.
 
 Sample code
 -----------
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index b6485019d2..28ce054d77 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -120,10 +120,6 @@ Deprecation Notices
   ``RTE_ETH_EVENT_IPSEC_SA_BYTE_HARD_EXPIRY`` and
   ``RTE_ETH_EVENT_IPSEC_SA_PKT_HARD_EXPIRY`` in DPDK 22.11.
 
-* bbdev: Will extend API to support new operation type ``RTE_BBDEV_OP_FFT`` as per
-  this `RFC <https://patches.dpdk.org/project/dpdk/list/?series=22111>`__.
-  This should be updated in DPDK 22.11.
-
 * cryptodev: Hide structures ``rte_cryptodev_sym_session`` and
   ``rte_cryptodev_asym_session`` to remove unnecessary indirection between
   session and the private data of session. An opaque pointer can be exposed
diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst
index 0b4e28f416..edc50e5647 100644
--- a/doc/guides/rel_notes/release_22_11.rst
+++ b/doc/guides/rel_notes/release_22_11.rst
@@ -102,6 +102,11 @@ New Features
   * Added AES-CCM support in lookaside protocol (IPsec) for CN9K & CN10K.
   * Added AES & DES DOCSIS algorithm support in lookaside crypto for CN9K.
 
+* **Added new operation for FFT processing in bbdev.**
+
+  Added a new operation type in bbdev for FFT processing with new functions
+  ``rte_bbdev_enqueue_fft_ops`` and ``rte_bbdev_dequeue_fft_ops`` and related structures.
+
 * **Added eventdev adapter instance get API.**
 
   * Added ``rte_event_eth_rx_adapter_instance_get`` to get Rx adapter
diff --git a/lib/bbdev/rte_bbdev.c b/lib/bbdev/rte_bbdev.c
index 38630a23f8..9d65ba8cd3 100644
--- a/lib/bbdev/rte_bbdev.c
+++ b/lib/bbdev/rte_bbdev.c
@@ -24,7 +24,7 @@
 #define DEV_NAME "BBDEV"
 
 /* Number of supported operation types */
-#define BBDEV_OP_TYPE_COUNT 5
+#define BBDEV_OP_TYPE_COUNT 6
 
 /* BBDev library logging ID */
 RTE_LOG_REGISTER_DEFAULT(bbdev_logtype, NOTICE);
@@ -852,6 +852,9 @@ get_bbdev_op_size(enum rte_bbdev_op_type type)
 	case RTE_BBDEV_OP_LDPC_ENC:
 		result = sizeof(struct rte_bbdev_enc_op);
 		break;
+	case RTE_BBDEV_OP_FFT:
+		result = sizeof(struct rte_bbdev_fft_op);
+		break;
 	default:
 		break;
 	}
@@ -875,6 +878,10 @@ bbdev_op_init(struct rte_mempool *mempool, void *arg, void *element,
 		struct rte_bbdev_enc_op *op = element;
 		memset(op, 0, mempool->elt_size);
 		op->mempool = mempool;
+	} else if (type == RTE_BBDEV_OP_FFT) {
+		struct rte_bbdev_fft_op *op = element;
+		memset(op, 0, mempool->elt_size);
+		op->mempool = mempool;
 	}
 }
 
@@ -1125,6 +1132,7 @@ rte_bbdev_op_type_str(enum rte_bbdev_op_type op_type)
 		"RTE_BBDEV_OP_TURBO_ENC",
 		"RTE_BBDEV_OP_LDPC_DEC",
 		"RTE_BBDEV_OP_LDPC_ENC",
+		"RTE_BBDEV_OP_FFT",
 	};
 
 	if (op_type < BBDEV_OP_TYPE_COUNT)
diff --git a/lib/bbdev/rte_bbdev.h b/lib/bbdev/rte_bbdev.h
index 21d076cd36..2a9d9de79f 100644
--- a/lib/bbdev/rte_bbdev.h
+++ b/lib/bbdev/rte_bbdev.h
@@ -401,6 +401,12 @@ typedef uint16_t (*rte_bbdev_enqueue_dec_ops_t)(
 		struct rte_bbdev_dec_op **ops,
 		uint16_t num);
 
+/** @internal Enqueue FFT operations for processing on queue of a device. */
+typedef uint16_t (*rte_bbdev_enqueue_fft_ops_t)(
+		struct rte_bbdev_queue_data *q_data,
+		struct rte_bbdev_fft_op **ops,
+		uint16_t num);
+
 /** @internal Dequeue encode operations from a queue of a device. */
 typedef uint16_t (*rte_bbdev_dequeue_enc_ops_t)(
 		struct rte_bbdev_queue_data *q_data,
@@ -411,6 +417,11 @@ typedef uint16_t (*rte_bbdev_dequeue_dec_ops_t)(
 		struct rte_bbdev_queue_data *q_data,
 		struct rte_bbdev_dec_op **ops, uint16_t num);
 
+/** @internal Dequeue FFT operations from a queue of a device. */
+typedef uint16_t (*rte_bbdev_dequeue_fft_ops_t)(
+		struct rte_bbdev_queue_data *q_data,
+		struct rte_bbdev_fft_op **ops, uint16_t num);
+
 #define RTE_BBDEV_NAME_MAX_LEN  64  /**< Max length of device name */
 
 /**
@@ -459,6 +470,10 @@ struct __rte_cache_aligned rte_bbdev {
 	rte_bbdev_dequeue_enc_ops_t dequeue_ldpc_enc_ops;
 	/** Dequeue decode function */
 	rte_bbdev_dequeue_dec_ops_t dequeue_ldpc_dec_ops;
+	/** Enqueue FFT function */
+	rte_bbdev_enqueue_fft_ops_t enqueue_fft_ops;
+	/** Dequeue FFT function */
+	rte_bbdev_dequeue_fft_ops_t dequeue_fft_ops;
 	const struct rte_bbdev_ops *dev_ops;  /**< Functions exported by PMD */
 	struct rte_bbdev_data *data;  /**< Pointer to device data */
 	enum rte_bbdev_state state;  /**< If device is currently used or not */
@@ -591,6 +606,36 @@ rte_bbdev_enqueue_ldpc_dec_ops(uint16_t dev_id, uint16_t queue_id,
 	return dev->enqueue_ldpc_dec_ops(q_data, ops, num_ops);
 }
 
+/**
+ * Enqueue a burst of FFT operations to a queue of the device.
+ * This functions only enqueues as many operations as currently possible and
+ * does not block until @p num_ops entries in the queue are available.
+ * This function does not provide any error notification to avoid the
+ * corresponding overhead.
+ *
+ * @param dev_id
+ *   The identifier of the device.
+ * @param queue_id
+ *   The index of the queue.
+ * @param ops
+ *   Pointer array containing operations to be enqueued Must have at least
+ *   @p num_ops entries
+ * @param num_ops
+ *   The maximum number of operations to enqueue.
+ *
+ * @return
+ *   The number of operations actually enqueued (this is the number of processed
+ *   entries in the @p ops array).
+ */
+__rte_experimental
+static inline uint16_t
+rte_bbdev_enqueue_fft_ops(uint16_t dev_id, uint16_t queue_id,
+		struct rte_bbdev_fft_op **ops, uint16_t num_ops)
+{
+	struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
+	struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
+	return dev->enqueue_fft_ops(q_data, ops, num_ops);
+}
 
 /**
  * Dequeue a burst of processed encode operations from a queue of the device.
@@ -716,6 +761,37 @@ rte_bbdev_dequeue_ldpc_dec_ops(uint16_t dev_id, uint16_t queue_id,
 	return dev->dequeue_ldpc_dec_ops(q_data, ops, num_ops);
 }
 
+/**
+ * Dequeue a burst of FFT operations from a queue of the device.
+ * This functions returns only the current contents of the queue, and does not
+ * block until @ num_ops is available.
+ * This function does not provide any error notification to avoid the
+ * corresponding overhead.
+ *
+ * @param dev_id
+ *   The identifier of the device.
+ * @param queue_id
+ *   The index of the queue.
+ * @param ops
+ *   Pointer array where operations will be dequeued to. Must have at least
+ *   @p num_ops entries
+ * @param num_ops
+ *   The maximum number of operations to dequeue.
+ *
+ * @return
+ *   The number of operations actually dequeued (this is the number of entries
+ *   copied into the @p ops array).
+ */
+__rte_experimental
+static inline uint16_t
+rte_bbdev_dequeue_fft_ops(uint16_t dev_id, uint16_t queue_id,
+		struct rte_bbdev_fft_op **ops, uint16_t num_ops)
+{
+	struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
+	struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
+	return dev->dequeue_fft_ops(q_data, ops, num_ops);
+}
+
 /** Definitions of device event types */
 enum rte_bbdev_event_type {
 	RTE_BBDEV_EVENT_UNKNOWN,  /**< unknown event type */
diff --git a/lib/bbdev/rte_bbdev_op.h b/lib/bbdev/rte_bbdev_op.h
index 99a7552779..c322d15dd5 100644
--- a/lib/bbdev/rte_bbdev_op.h
+++ b/lib/bbdev/rte_bbdev_op.h
@@ -47,6 +47,8 @@ extern "C" {
 #define RTE_BBDEV_TURBO_MAX_CODE_BLOCKS (64)
 /* LDPC:  Maximum number of Code Blocks in Transport Block.*/
 #define RTE_BBDEV_LDPC_MAX_CODE_BLOCKS (256)
+/* 12 CS maximum */
+#define RTE_BBDEV_MAX_CS_2 (6)
 
 /*
  * Maximum size to be used to manage the enum rte_bbdev_op_type
@@ -218,6 +220,26 @@ enum rte_bbdev_op_ldpcenc_flag_bitmasks {
 	RTE_BBDEV_LDPC_ENC_CONCATENATION = (1ULL << 7)
 };
 
+/** Flags for DFT operation and capability structure */
+enum rte_bbdev_op_fft_flag_bitmasks {
+	/** Flexible windowing capability */
+	RTE_BBDEV_FFT_WINDOWING = (1ULL << 0),
+	/** Flexible adjustment of Cyclic Shift time offset */
+	RTE_BBDEV_FFT_CS_ADJUSTMENT = (1ULL << 1),
+	/** Set for bypass the DFT and get directly into iDFT input */
+	RTE_BBDEV_FFT_DFT_BYPASS = (1ULL << 2),
+	/** Set for bypass the IDFT and get directly the DFT output */
+	RTE_BBDEV_FFT_IDFT_BYPASS = (1ULL << 3),
+	/** Set for bypass time domain windowing */
+	RTE_BBDEV_FFT_WINDOWING_BYPASS = (1ULL << 4),
+	/** Set for optional power measurement on DFT output */
+	RTE_BBDEV_FFT_POWER_MEAS = (1ULL << 5),
+	/** 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)
+};
+
 /** Flags for the Code Block/Transport block mode  */
 enum rte_bbdev_op_cb_mode {
 	/** One operation is one or fraction of one transport block  */
@@ -696,6 +718,55 @@ struct rte_bbdev_op_ldpc_enc {
 	};
 };
 
+/** Operation structure for FFT processing.
+ *
+ * The operation processes the data for multiple antennas in a single call
+ * (.i.e for all the REs belonging to a given SRS sequence for instance)
+ *
+ * The output mbuf data structure is expected to be allocated by the
+ * application with enough room for the output data.
+ */
+struct rte_bbdev_op_fft {
+	/** Input data starting from first antenna */
+	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 power measurement output data */
+	struct rte_bbdev_op_data power_meas_output;
+	/** Flags from rte_bbdev_op_fft_flag_bitmasks */
+	uint32_t op_flags;
+	/** Input sequence size in 32-bits points */
+	uint16_t input_sequence_size;
+	/** Padding at the start of the sequence */
+	uint16_t input_leading_padding;
+	/** Output sequence size in 32-bits points */
+	uint16_t output_sequence_size;
+	/** Depadding at the start of the DFT output */
+	uint16_t output_leading_depadding;
+	/** Window index being used for each cyclic shift output */
+	uint8_t window_index[RTE_BBDEV_MAX_CS_2];
+	/** Bitmap of the cyclic shift output requested */
+	uint16_t cs_bitmap;
+	/** Number of antennas as a log2 – 8 to 128 */
+	uint8_t num_antennas_log2;
+	/** iDFT size as a log2 - 32 to 2048 */
+	uint8_t idft_log2;
+	/** DFT size as a log2 - 8 to 2048 */
+	uint8_t dft_log2;
+	/** Adjustment of position of the cyclic shifts - -31 to 31 */
+	int8_t cs_time_adjustment;
+	/** iDFT shift down */
+	int8_t idft_shift;
+	/** DFT shift down */
+	int8_t dft_shift;
+	/** NCS reciprocal factor  */
+	uint16_t ncs_reciprocal;
+	/** power measurement out shift down */
+	uint16_t power_shift;
+	/** Adjust the FP6 exponent for INT<->FP16 conversion */
+	uint16_t fp16_exp_adjust;
+};
+
 /** List of the capabilities for the Turbo Decoder */
 struct rte_bbdev_op_cap_turbo_dec {
 	/** Flags from rte_bbdev_op_td_flag_bitmasks */
@@ -748,6 +819,16 @@ struct rte_bbdev_op_cap_ldpc_enc {
 	uint16_t num_buffers_dst;
 };
 
+/** List of the capabilities for the FFT */
+struct rte_bbdev_op_cap_fft {
+	/** Flags from rte_bbdev_op_fft_flag_bitmasks */
+	uint32_t capability_flags;
+	/** Num input code block buffers */
+	uint16_t num_buffers_src;
+	/** Num output code block buffers */
+	uint16_t num_buffers_dst;
+};
+
 /** Different operation types supported by the device.
  *  The related macro RTE_BBDEV_OP_TYPE_SIZE_MAX can be used as an absolute maximum for
  *  notably sizing array while allowing for future enumeration insertion.
@@ -758,6 +839,7 @@ enum rte_bbdev_op_type {
 	RTE_BBDEV_OP_TURBO_ENC,  /**< Turbo encode */
 	RTE_BBDEV_OP_LDPC_DEC,  /**< LDPC decode */
 	RTE_BBDEV_OP_LDPC_ENC,  /**< LDPC encode */
+	RTE_BBDEV_OP_FFT,  /**< FFT */
 	/* Note: RTE_BBDEV_OP_TYPE_SIZE_MAX must be larger or equal to maximum enum value */
 };
 
@@ -801,6 +883,18 @@ struct rte_bbdev_dec_op {
 	};
 };
 
+/** Structure specifying a single FFT operation */
+struct rte_bbdev_fft_op {
+	/** Status of operation that was performed */
+	int status;
+	/** Mempool which op instance is in */
+	struct rte_mempool *mempool;
+	/** Opaque pointer for user data */
+	void *opaque_data;
+	/** Contains turbo decoder specific parameters */
+	struct rte_bbdev_op_fft fft;
+};
+
 /** Operation capabilities supported by a device */
 struct rte_bbdev_op_cap {
 	enum rte_bbdev_op_type type;  /**< Type of operation */
@@ -809,6 +903,7 @@ struct rte_bbdev_op_cap {
 		struct rte_bbdev_op_cap_turbo_enc turbo_enc;
 		struct rte_bbdev_op_cap_ldpc_dec ldpc_dec;
 		struct rte_bbdev_op_cap_ldpc_enc ldpc_enc;
+		struct rte_bbdev_op_cap_fft fft;
 	} cap;  /**< Operation-type specific capabilities */
 };
 
@@ -927,6 +1022,42 @@ rte_bbdev_dec_op_alloc_bulk(struct rte_mempool *mempool,
 	return 0;
 }
 
+/**
+ * Bulk allocate FFT operations from a mempool with parameter defaults reset.
+ *
+ * @param mempool
+ *   Operation mempool, created by rte_bbdev_op_pool_create().
+ * @param ops
+ *   Output array to place allocated operations
+ * @param num_ops
+ *   Number of operations to allocate
+ *
+ * @returns
+ *   - 0 on success
+ *   - EINVAL if invalid mempool is provided
+ */
+__rte_experimental
+static inline int
+rte_bbdev_fft_op_alloc_bulk(struct rte_mempool *mempool,
+		struct rte_bbdev_fft_op **ops, uint16_t num_ops)
+{
+	struct rte_bbdev_op_pool_private *priv;
+	int ret;
+
+	/* Check type */
+	priv = (struct rte_bbdev_op_pool_private *)
+			rte_mempool_get_priv(mempool);
+	if (unlikely(priv->type != RTE_BBDEV_OP_FFT))
+		return -EINVAL;
+
+	/* Get elements */
+	ret = rte_mempool_get_bulk(mempool, (void **)ops, num_ops);
+	if (unlikely(ret < 0))
+		return ret;
+
+	return 0;
+}
+
 /**
  * Free decode operation structures that were allocated by
  * rte_bbdev_dec_op_alloc_bulk().
@@ -961,6 +1092,24 @@ rte_bbdev_enc_op_free_bulk(struct rte_bbdev_enc_op **ops, unsigned int num_ops)
 		rte_mempool_put_bulk(ops[0]->mempool, (void **)ops, num_ops);
 }
 
+/**
+ * Free encode operation structures that were allocated by
+ * *rte_bbdev_fft_op_alloc_bulk*.
+ * All structures must belong to the same mempool.
+ *
+ * @param ops
+ *   Operation structures
+ * @param num_ops
+ *   Number of structures
+ */
+__rte_experimental
+static inline void
+rte_bbdev_fft_op_free_bulk(struct rte_bbdev_fft_op **ops, unsigned int num_ops)
+{
+	if (num_ops > 0)
+		rte_mempool_put_bulk(ops[0]->mempool, (void **)ops, num_ops);
+}
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/bbdev/version.map b/lib/bbdev/version.map
index addea05f00..db178917e2 100644
--- a/lib/bbdev/version.map
+++ b/lib/bbdev/version.map
@@ -44,5 +44,9 @@ EXPERIMENTAL {
 	global:
 
 	# added in 22.11
+	rte_bbdev_dequeue_fft_ops;
 	rte_bbdev_device_status_str;
+	rte_bbdev_enqueue_fft_ops;
+	rte_bbdev_fft_op_alloc_bulk;
+	rte_bbdev_fft_op_free_bulk;
 };
-- 
2.37.1


  parent reply	other threads:[~2022-10-03 18:34 UTC|newest]

Thread overview: 174+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-09  0:22 [PATCH v1 0/2] bbdev: add device info on queue topology Nicolas Chautru
2022-03-09  0:22 ` [PATCH v1 1/2] " Nicolas Chautru
2022-03-09  1:28   ` Stephen Hemminger
2022-03-09  0:22 ` [PATCH v1 2/2] drivers/baseband: update PMDs to expose queue per operation Nicolas Chautru
2022-06-17 18:37   ` [PATCH v2 0/5] bbdev changes for 22.11 Nicolas Chautru
2022-06-17 18:37     ` [PATCH v2 1/5] bbdev: allow operation type enum for growth Nicolas Chautru
2022-06-17 18:37     ` [PATCH v2 2/5] bbdev: add device status info Nicolas Chautru
2022-06-17 18:37     ` [PATCH v2 3/5] bbdev: add device info on queue topology Nicolas Chautru
2022-06-17 18:37     ` [PATCH v2 4/5] drivers/baseband: update PMDs to expose queue per operation Nicolas Chautru
2022-06-17 18:37     ` [PATCH v2 5/5] bbdev: add new operation for FFT processing Nicolas Chautru
2022-06-28  1:35       ` [PATCH v3 0/7] bbdev changes for 22.11 Nicolas Chautru
2022-06-28  1:35         ` [PATCH v3 1/7] bbdev: allow operation type enum for growth Nicolas Chautru
2022-06-28  1:35         ` [PATCH v3 2/7] bbdev: add device status info Nicolas Chautru
2022-06-28  1:35         ` [PATCH v3 3/7] bbdev: add device info on queue topology Nicolas Chautru
2022-06-28  1:35         ` [PATCH v3 4/7] drivers/baseband: update PMDs to expose queue per operation Nicolas Chautru
2022-06-28  1:35         ` [PATCH v3 5/7] bbdev: add new operation for FFT processing Nicolas Chautru
2022-06-28  1:35         ` [PATCH v3 6/7] bbdev: add queue related warning and status information Nicolas Chautru
2022-06-28  1:35         ` [PATCH v3 7/7] bbdev: add a lock option for enqueue/dequeue operation Nicolas Chautru
2022-07-06  0:23       ` [PATCH v4 0/7] bbdev changes for 22.11 Nicolas Chautru
2022-07-06  0:23         ` [PATCH v4 1/7] bbdev: allow operation type enum for growth Nicolas Chautru
2022-07-06 12:50           ` Tom Rix
2022-07-06 21:20             ` Chautru, Nicolas
2022-07-06  0:23         ` [PATCH v4 2/7] bbdev: add device status info Nicolas Chautru
2022-07-06 15:38           ` Tom Rix
2022-07-06 21:16             ` Chautru, Nicolas
2022-07-07 13:37               ` Tom Rix
2022-07-07 17:15                 ` Chautru, Nicolas
2022-07-18 13:09                   ` Tom Rix
2022-08-25 14:08               ` Maxime Coquelin
2022-07-06  0:23         ` [PATCH v4 3/7] bbdev: add device info on queue topology Nicolas Chautru
2022-07-06 16:06           ` Tom Rix
2022-07-06 21:12             ` Chautru, Nicolas
2022-07-07 13:34               ` Tom Rix
2022-07-07 17:13                 ` Chautru, Nicolas
2022-07-18 13:04                   ` Tom Rix
2022-07-06  0:23         ` [PATCH v4 4/7] drivers/baseband: update PMDs to expose queue per operation Nicolas Chautru
2022-07-06 16:15           ` Tom Rix
2022-07-06 21:10             ` Chautru, Nicolas
2022-07-07 13:20               ` Tom Rix
2022-07-07 17:19                 ` Chautru, Nicolas
2022-07-18 13:21                   ` Tom Rix
2022-08-15 17:28                     ` Chautru, Nicolas
2022-07-06  0:23         ` [PATCH v4 5/7] bbdev: add new operation for FFT processing Nicolas Chautru
2022-07-06 18:47           ` Tom Rix
2022-07-06 21:04             ` Chautru, Nicolas
2022-07-07 13:09               ` Tom Rix
2022-07-07 16:57                 ` Chautru, Nicolas
2022-07-18 22:38                   ` Tom Rix
2022-07-06  0:23         ` [PATCH v4 6/7] bbdev: add queue related warning and status information Nicolas Chautru
2022-07-06 18:57           ` Tom Rix
2022-07-06 20:34             ` Chautru, Nicolas
2022-07-06  0:23         ` [PATCH v4 7/7] bbdev: add a lock option for enqueue/dequeue operation Nicolas Chautru
2022-07-06 19:01           ` Tom Rix
2022-07-06 19:20             ` Stephen Hemminger
2022-07-06 20:21               ` Chautru, Nicolas
2022-07-07 12:47                 ` Tom Rix
2022-07-06 23:28       ` [PATCH v5 0/7] bbdev changes for 22.11 Nicolas Chautru
2022-07-06 23:28         ` [PATCH v5 1/7] bbdev: allow operation type enum for growth Nicolas Chautru
2022-08-25 13:54           ` Maxime Coquelin
2022-07-06 23:28         ` [PATCH v5 2/7] bbdev: add device status info Nicolas Chautru
2022-08-25 14:18           ` Maxime Coquelin
2022-08-25 18:30             ` Chautru, Nicolas
2022-08-26 10:12               ` Maxime Coquelin
2022-08-29 16:10                 ` Chautru, Nicolas
2022-08-30  7:08                   ` Maxime Coquelin
2022-08-30 19:38                     ` Chautru, Nicolas
2022-07-06 23:28         ` [PATCH v5 3/7] bbdev: add device info on queue topology Nicolas Chautru
2022-08-25 15:23           ` Maxime Coquelin
2022-07-06 23:28         ` [PATCH v5 4/7] drivers/baseband: update PMDs to expose queue per operation Nicolas Chautru
2022-07-06 23:28         ` [PATCH v5 5/7] bbdev: add new operation for FFT processing Nicolas Chautru
2022-07-06 23:28         ` [PATCH v5 6/7] bbdev: add queue related warning and status information Nicolas Chautru
2022-07-06 23:28         ` [PATCH v5 7/7] bbdev: remove unnecessary if-check Nicolas Chautru
2022-08-15 17:54         ` [PATCH v5 0/7] bbdev changes for 22.11 Chautru, Nicolas
2022-08-25 18:24       ` [PATCH v6 " Nicolas Chautru
2022-08-25 18:24         ` [PATCH v6 1/7] bbdev: allow operation type enum for growth Nicolas Chautru
2022-08-25 18:24         ` [PATCH v6 2/7] bbdev: add device status info Nicolas Chautru
2022-08-25 18:24         ` [PATCH v6 3/7] bbdev: add device info on queue topology Nicolas Chautru
2022-08-25 18:24         ` [PATCH v6 4/7] drivers/baseband: update PMDs to expose queue per operation Nicolas Chautru
2022-08-26 11:53           ` Maxime Coquelin
2022-08-25 18:24         ` [PATCH v6 5/7] bbdev: add new operation for FFT processing Nicolas Chautru
2022-08-26 12:07           ` Maxime Coquelin
2022-08-29 18:18             ` Chautru, Nicolas
2022-08-25 18:24         ` [PATCH v6 6/7] bbdev: add queue related warning and status information Nicolas Chautru
2022-08-26 19:51           ` Maxime Coquelin
2022-08-25 18:24         ` [PATCH v6 7/7] bbdev: remove unnecessary if-check Nicolas Chautru
2022-08-26 19:52           ` Maxime Coquelin
2022-08-29 18:07       ` [PATCH v7 0/7] bbdev changes for 22.11 Nicolas Chautru
2022-08-29 18:07         ` [PATCH v7 1/7] bbdev: allow operation type enum for growth Nicolas Chautru
2022-08-29 18:07         ` [PATCH v7 2/7] bbdev: add device status info Nicolas Chautru
2022-08-30  2:19           ` Zhang, Mingshan
2022-08-30  4:43           ` Hemant Agrawal
2022-09-21 18:54           ` [EXT] " Akhil Goyal
2022-09-21 20:53             ` Chautru, Nicolas
2022-08-29 18:07         ` [PATCH v7 3/7] bbdev: add device info on queue topology Nicolas Chautru
2022-08-29 18:07         ` [PATCH v7 4/7] drivers/baseband: update PMDs to expose queue per operation Nicolas Chautru
2022-08-30  4:44           ` Hemant Agrawal
2022-09-21 19:00           ` [EXT] " Akhil Goyal
2022-09-21 20:53             ` Chautru, Nicolas
2022-08-29 18:07         ` [PATCH v7 5/7] bbdev: add new operation for FFT processing Nicolas Chautru
2022-09-21 19:14           ` [EXT] " Akhil Goyal
2022-09-21 20:56             ` Chautru, Nicolas
2022-09-22 14:19               ` Akhil Goyal
2022-09-22 16:39                 ` Chautru, Nicolas
2022-09-22 16:48                   ` Akhil Goyal
2022-09-22 17:25                     ` Chautru, Nicolas
2022-08-29 18:07         ` [PATCH v7 6/7] bbdev: add queue related warning and status information Nicolas Chautru
2022-09-21 19:21           ` [EXT] " Akhil Goyal
2022-09-21 20:57             ` Chautru, Nicolas
2022-09-23 10:57             ` Ferruh Yigit
     [not found]               ` <CO6PR18MB44848717BA4EA2FF8967D7CBD8509@CO6PR18MB4484.namprd18.prod.outlook.com>
2022-09-24 16:34                 ` Chautru, Nicolas
2022-09-27  9:43                   ` Ferruh Yigit
2022-09-27 20:59                   ` Chautru, Nicolas
2022-09-29 18:10                     ` Ferruh Yigit
2022-09-29 18:32                       ` Akhil Goyal
2022-09-29 19:48                         ` Chautru, Nicolas
2022-09-30  7:54                           ` Maxime Coquelin
2022-08-29 18:07         ` [PATCH v7 7/7] bbdev: remove unnecessary if-check Nicolas Chautru
2022-09-21 19:25           ` [EXT] " Akhil Goyal
2022-09-21 20:58             ` Chautru, Nicolas
2022-08-30  4:45         ` [PATCH v7 0/7] bbdev changes for 22.11 Hemant Agrawal
2022-09-06 16:47         ` Chautru, Nicolas
2022-09-21 21:02       ` [PATCH v8 " Nic Chautru
2022-09-21 21:02         ` [PATCH v8 1/7] bbdev: allow operation type enum for growth Nic Chautru
2022-09-21 21:02         ` [PATCH v8 2/7] bbdev: add device status info Nic Chautru
2022-09-21 21:02         ` [PATCH v8 3/7] bbdev: add device info on queue topology Nic Chautru
2022-09-21 21:02         ` [PATCH v8 4/7] drivers/baseband: update PMDs to expose queue per operation Nic Chautru
2022-09-21 21:02         ` [PATCH v8 5/7] bbdev: add new operation for FFT processing Nic Chautru
2022-09-21 21:02         ` [PATCH v8 6/7] bbdev: add queue related warning and status information Nic Chautru
2022-09-21 21:02         ` [PATCH v8 7/7] bbdev: remove unnecessary if-check Nic Chautru
2022-09-22 17:45       ` [PATCH v9 0/7] bbdev changes for 22.11 Nic Chautru
2022-09-22 17:45         ` [PATCH v9 1/7] bbdev: allow operation type enum for growth Nic Chautru
2022-09-22 17:45         ` [PATCH v9 2/7] bbdev: add device status info Nic Chautru
2022-09-22 17:45         ` [PATCH v9 3/7] bbdev: add device info on queue topology Nic Chautru
2022-09-22 17:45         ` [PATCH v9 4/7] drivers/baseband: update PMDs to expose queue per operation Nic Chautru
2022-09-22 17:45         ` [PATCH v9 5/7] bbdev: add new operation for FFT processing Nic Chautru
2022-09-22 17:45         ` [PATCH v9 6/7] bbdev: add queue related warning and status information Nic Chautru
2022-09-22 17:45         ` [PATCH v9 7/7] bbdev: remove unnecessary if-check Nic Chautru
2022-09-22 18:17         ` [EXT] [PATCH v9 0/7] bbdev changes for 22.11 Akhil Goyal
2022-09-22 20:59           ` Chautru, Nicolas
2022-09-30 18:45       ` [PATCH v10 " Nicolas Chautru
2022-09-30 18:45         ` [PATCH v10 1/7] bbdev: allow operation type enum for growth Nicolas Chautru
2022-09-30 18:46         ` [PATCH v10 2/7] bbdev: add device status info Nicolas Chautru
2022-09-30 18:46         ` [PATCH v10 3/7] bbdev: add device info on queue topology Nicolas Chautru
2022-09-30 18:46         ` [PATCH v10 4/7] drivers/baseband: update PMDs to expose queue per operation Nicolas Chautru
2022-09-30 18:46         ` [PATCH v10 5/7] bbdev: add new operation for FFT processing Nicolas Chautru
2022-09-30 18:46         ` [PATCH v10 6/7] bbdev: add queue related warning and status information Nicolas Chautru
2022-10-03  8:28           ` Thomas Monjalon
2022-10-03 16:39             ` Chautru, Nicolas
2022-10-03 17:21               ` Thomas Monjalon
2022-09-30 18:46         ` [PATCH v10 7/7] bbdev: remove unnecessary if-check Nicolas Chautru
2022-09-30 20:38         ` [EXT] [PATCH v10 0/7] bbdev changes for 22.11 Akhil Goyal
2022-10-03 18:00       ` [PATCH v11 " Nicolas Chautru
2022-10-03 18:00         ` [PATCH v11 1/7] bbdev: allow operation type enum for growth Nicolas Chautru
2022-10-03 18:00         ` [PATCH v11 2/7] bbdev: add device status info Nicolas Chautru
2022-10-03 18:00         ` [PATCH v11 3/7] bbdev: add device info on queue topology Nicolas Chautru
2022-10-03 18:00         ` [PATCH v11 4/7] drivers/baseband: update PMDs to expose queue per operation Nicolas Chautru
2022-10-03 18:00         ` Nicolas Chautru [this message]
2022-10-03 18:00         ` [PATCH v11 6/7] bbdev: add queue related warning and status information Nicolas Chautru
2022-10-03 18:00         ` [PATCH v11 7/7] bbdev: remove unnecessary if-check Nicolas Chautru
2022-10-04 17:16       ` [PATCH v12 0/7] bbdev changes for 22.11 Nicolas Chautru
2022-10-04 17:16         ` [PATCH v12 1/7] bbdev: allow operation type enum for growth Nicolas Chautru
2022-10-04 17:16         ` [PATCH v12 2/7] bbdev: add device status info Nicolas Chautru
2022-10-05  7:16           ` Maxime Coquelin
2022-10-04 17:16         ` [PATCH v12 3/7] bbdev: add device info on queue topology Nicolas Chautru
2022-10-04 17:16         ` [PATCH v12 4/7] drivers/baseband: update PMDs to expose queue per operation Nicolas Chautru
2022-10-04 17:16         ` [PATCH v12 5/7] bbdev: add new operation for FFT processing Nicolas Chautru
2022-10-04 17:16         ` [PATCH v12 6/7] bbdev: add queue related warning and status information Nicolas Chautru
2022-10-04 17:16         ` [PATCH v12 7/7] bbdev: remove unnecessary if-check Nicolas Chautru
2022-10-06 17:31         ` [EXT] [PATCH v12 0/7] bbdev changes for 22.11 Akhil Goyal
2022-10-06 22:28           ` Chautru, Nicolas
2022-10-07  4:46             ` Akhil Goyal
2022-10-10  7:35           ` Thomas Monjalon
2022-10-10 17:07             ` Chautru, Nicolas
2022-06-06 16:15 ` [PATCH v1 0/2] bbdev: add device info on queue topology Chautru, Nicolas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221003180023.13362-6-nicolas.chautru@intel.com \
    --to=nicolas.chautru@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=mdr@ashroe.eu \
    --cc=mingshan.zhang@intel.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    --cc=trix@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.