xref: /freebsd/sys/dev/qat/qat_api/include/dc/cpa_dc_dp.h (revision 271171e0)
1 /***************************************************************************
2  *
3  *   BSD LICENSE
4  *
5  *   Copyright(c) 2007-2022 Intel Corporation. All rights reserved.
6  *   All rights reserved.
7  *
8  *   Redistribution and use in source and binary forms, with or without
9  *   modification, are permitted provided that the following conditions
10  *   are met:
11  *
12  *     * Redistributions of source code must retain the above copyright
13  *       notice, this list of conditions and the following disclaimer.
14  *     * Redistributions in binary form must reproduce the above copyright
15  *       notice, this list of conditions and the following disclaimer in
16  *       the documentation and/or other materials provided with the
17  *       distribution.
18  *     * Neither the name of Intel Corporation nor the names of its
19  *       contributors may be used to endorse or promote products derived
20  *       from this software without specific prior written permission.
21  *
22  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25  *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26  *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27  *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28  *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29  *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30  *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31  *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  *
34  *
35  ***************************************************************************/
36 
37 /*
38  *****************************************************************************
39  * Doxygen group definitions
40  ****************************************************************************/
41 
42 /**
43  *****************************************************************************
44  * @file cpa_dc_dp.h
45  *
46  * @defgroup cpaDcDp Data Compression Data Plane API
47  *
48  * @ingroup cpaDc
49  *
50  * @description
51  *      These data structures and functions specify the Data Plane API
52  *      for compression and decompression operations.
53  *
54  *      This API is recommended for data plane applications, in which the
55  *      cost of offload - that is, the cycles consumed by the driver in
56  *      sending requests to the hardware, and processing responses - needs
57  *      to be minimized.  In particular, use of this API is recommended
58  *      if the following constraints are acceptable to your application:
59  *
60  *      - Thread safety is not guaranteed.  Each software thread should
61  *        have access to its own unique instance (CpaInstanceHandle) to
62  *        avoid contention.
63  *      - Polling is used, rather than interrupts (which are expensive).
64  *        Implementations of this API will provide a function (not
65  *        defined as part of this API) to read responses from the hardware
66  *        response queue and dispatch callback functions, as specified on
67  *        this API.
68  *      - Buffers and buffer lists are passed using physical addresses,
69  *        to avoid virtual to physical address translation costs.
70  *      - The ability to enqueue one or more requests without submitting
71  *        them to the hardware allows for certain costs to be amortized
72  *        across multiple requests.
73  *      - Only asynchronous invocation is supported.
74  *      - There is no support for partial packets.
75  *      - Implementations may provide certain features as optional at
76  *        build time, such as atomic counters.
77  *      - There is no support for stateful operations.
78  *        - The "default" instance (CPA_INSTANCE_HANDLE_SINGLE) is not
79  *          supported on this API.  The specific handle should be obtained
80  *          using the instance discovery functions (@ref cpaDcGetNumInstances,
81  *          @ref cpaDcGetInstances).
82  *
83  *****************************************************************************/
84 
85 #ifndef CPA_DC_DP_H
86 #define CPA_DC_DP_H
87 
88 #ifdef __cplusplus
89 extern "C" {
90 #endif
91 
92 #include "cpa_dc.h"
93 
94 /**
95  *****************************************************************************
96  * @ingroup cpaDcDp
97  *      Operation Data for compression data plane API.
98  *
99  * @description
100  *      This structure contains data relating to a request to perform
101  *      compression processing on one or more data buffers.
102  *
103  *      The physical memory to which this structure points should be
104  *      at least 8-byte aligned.
105  *
106  *      All reserved fields SHOULD NOT be written or read by the
107  *      calling code.
108  *
109  * @see
110  *        cpaDcDpEnqueueOp, cpaDcDpEnqueueOpBatch
111  ****************************************************************************/
112 typedef struct _CpaDcDpOpData
113 {
114     Cpa64U          reserved0;
115     /**< Reserved for internal use.  Source code should not read or write
116       * this field.
117       */
118     Cpa32U          bufferLenToCompress;
119     /**< The number of bytes from the source buffer to compress.  This must be
120      * less than, or more typically equal to, the total size of the source
121      * buffer (or buffer list).
122      */
123 
124     Cpa32U          bufferLenForData;
125     /**< The maximum number of bytes that should be written to the destination
126      * buffer.  This must be less than, or more typically equal to, the total
127      * size of the destination buffer (or buffer list).
128      */
129 
130     Cpa64U          reserved1;
131     /**< Reserved for internal use.  Source code should not read or write */
132 
133     Cpa64U          reserved2;
134     /**< Reserved for internal use.  Source code should not read or write */
135 
136     Cpa64U          reserved3;
137     /**< Reserved for internal use.  Source code should not read or write */
138 
139     CpaDcRqResults      results;
140     /**< Results of the operation.  Contents are valid upon completion. */
141 
142     CpaInstanceHandle   dcInstance;
143     /**< Instance to which the request is to be enqueued */
144 
145     CpaDcSessionHandle  pSessionHandle;
146     /**< DC Session associated with the stream of requests */
147 
148     CpaPhysicalAddr     srcBuffer;
149     /**< Physical address of the source buffer on which to operate.
150      * This is either the location of the data, of length srcBufferLen; or,
151      * if srcBufferLen has the special value @ref CPA_DP_BUFLIST, then
152      * srcBuffer contains the location where a @ref CpaPhysBufferList is
153      * stored.
154      */
155 
156     Cpa32U          srcBufferLen;
157     /**< If the source buffer is a "flat buffer", then this field
158      * specifies the size of the buffer, in bytes. If the source buffer
159      * is a "buffer list" (of type @ref CpaPhysBufferList), then this field
160      * should be set to the value @ref CPA_DP_BUFLIST.
161      */
162 
163     CpaPhysicalAddr     destBuffer;
164     /**< Physical address of the destination buffer on which to operate.
165      * This is either the location of the data, of length destBufferLen; or,
166      * if destBufferLen has the special value @ref CPA_DP_BUFLIST, then
167      * destBuffer contains the location where a @ref CpaPhysBufferList is
168      * stored.
169      */
170 
171     Cpa32U          destBufferLen;
172     /**< If the destination buffer is a "flat buffer", then this field
173      * specifies the size of the buffer, in bytes.  If the destination buffer
174      * is a "buffer list" (of type @ref CpaPhysBufferList), then this field
175      * should be set to the value @ref CPA_DP_BUFLIST.
176      */
177 
178     CpaDcSessionDir sessDirection;
179      /**<Session direction indicating whether session is used for
180       * compression, decompression.  For the DP implementation,
181       * CPA_DC_DIR_COMBINED is not a valid selection.
182       */
183 
184     CpaBoolean compressAndVerify;
185     /**< If set to true, for compression operations, the implementation
186      * will verify that compressed data, generated by the compression
187      * operation, can be successfully decompressed.
188      * This behavior is only supported for stateless compression.
189      * This behavior is only supported on instances that support the
190      * compressAndVerify capability. */
191 
192     CpaBoolean compressAndVerifyAndRecover;
193     /**< If set to true, for compression operations, the implementation
194      * will automatically recover from a compressAndVerify error.
195      * This behavior is only supported for stateless compression.
196      * This behavior is only supported on instances that support the
197      * compressAndVerifyAndRecover capability.
198      * The compressAndVerify field in CpaDcOpData MUST be set to CPA_TRUE
199      * if compressAndVerifyAndRecover is set to CPA_TRUE. */
200 
201     CpaStatus responseStatus;
202     /**< Status of the operation. Valid values are CPA_STATUS_SUCCESS,
203      * CPA_STATUS_FAIL and CPA_STATUS_UNSUPPORTED.
204      */
205 
206     CpaPhysicalAddr thisPhys;
207     /**< Physical address of this data structure */
208 
209     void* pCallbackTag;
210     /**< Opaque data that will be returned to the client in the function
211      * completion callback.
212      *
213      * This opaque data is not used by the implementation of the API,
214      * but is simply returned as part of the asynchronous response.
215      * It may be used to store information that might be useful when
216      * processing the response later.
217      */
218 } CpaDcDpOpData;
219 
220 
221 /**
222  *****************************************************************************
223  * @ingroup cpaDcDp
224  *      Definition of callback function for compression data plane API.
225  *
226  * @description
227  *      This is the callback function prototype. The callback function is
228  *      registered by the application using the @ref cpaDcDpRegCbFunc
229  *      function call, and called back on completion of asycnhronous
230  *      requests made via calls to @ref cpaDcDpEnqueueOp or @ref
231  *      cpaDcDpEnqueueOpBatch.
232  *
233  * @context
234  *      This callback function can be executed in a context that DOES NOT
235  *      permit sleeping to occur.
236  * @assumptions
237  *      None
238  * @sideEffects
239  *      None
240  * @reentrant
241  *      No
242  * @threadSafe
243  *      No
244  *
245  * @param[in] pOpData           Pointer to the @ref CpaDcDpOpData object which
246  *                              was supplied as part of the original request.
247 
248  * @return
249  *      None
250  * @pre
251  *      Instance has been initialized.
252  *      Callback has been registered with @ref cpaDcDpRegCbFunc.
253  * @post
254  *      None
255  * @note
256  *      None
257  * @see
258  *      @ref cpaDcDpRegCbFunc
259  *****************************************************************************/
260 typedef void (*CpaDcDpCallbackFn)(CpaDcDpOpData *pOpData);
261 
262 /**
263  *****************************************************************************
264  * @ingroup cpaDc
265  *      Get the size of the memory required to hold the data plane
266  *      session information.
267  *
268  * @description
269  *
270  *      The client of the Data Compression API is responsible for
271  *      allocating sufficient memory to hold session information. This
272  *      function provides a means for determining the size of the session
273  *      information and statistics information.
274  *
275  * @context
276  *      No restrictions
277  * @assumptions
278  *      None
279  * @sideEffects
280  *      None
281  * @blocking
282  *      Yes
283  * @reentrant
284  *      No
285  * @threadSafe
286  *      Yes
287  *
288  * @param[in] dcInstance            Instance handle.
289  * @param[in] pSessionData          Pointer to a user instantiated structure
290  *                                  containing session data.
291  * @param[out] pSessionSize         On return, this parameter will be the size
292  *                                  of the memory that will be
293  *                                  required by cpaDcInitSession() for session
294  *                                  data.
295  *
296  * @retval CPA_STATUS_SUCCESS        Function executed successfully.
297  * @retval CPA_STATUS_FAIL           Function failed.
298  * @retval CPA_STATUS_INVALID_PARAM  Invalid parameter passed in.
299  * @retval CPA_STATUS_UNSUPPORTED    Function is not supported.
300  *
301  * @pre
302  *      None
303  * @post
304  *      None
305  * @note
306  *      Only a synchronous version of this function is provided.
307  *
308  *      Session data is expected to include interim checksum values, various
309  *      counters and other other session related data that needs to persist
310  *      between invocations.
311  *      For a given implementation of this API, it is safe to assume that
312  *      cpaDcDpGetSessionSize() will always return the same session size and
313  *      that the size will not be different for different setup data
314  *      parameters. However, it should be noted that the size may change:
315  *       (1) between different implementations of the API (e.g. between software
316  *           and hardware implementations or between different hardware
317  *           implementations)
318  *       (2) between different releases of the same API implementation
319  *
320  * @see
321  *      cpaDcDpInitSession()
322  *
323  *****************************************************************************/
324 CpaStatus
325 cpaDcDpGetSessionSize(CpaInstanceHandle dcInstance,
326         CpaDcSessionSetupData* pSessionData,
327         Cpa32U* pSessionSize );
328 
329 
330 /**
331  *****************************************************************************
332  * @ingroup cpaDcDp
333  *      Initialize compression or decompression data plane session.
334  *
335  * @description
336  *      This function is used to initialize a compression/decompression session.
337  *      A single session can be used for both compression and decompression
338  *      requests.  Clients MUST register a callback
339  *      function for the compression service using this function.
340  *      This function returns a unique session handle each time this function
341  *      is invoked.
342  *      The order of the callbacks are guaranteed to be in the same order the
343  *      compression or decompression requests were submitted for each session,
344  *      so long as a single thread of execution is used for job submission.
345  *
346  * @context
347  *      This function may be called from any context.
348  * @assumptions
349  *      None
350  * @sideEffects
351  *      None
352  * @blocking
353  *      Yes
354  * @reentrant
355  *      No
356  * @threadSafe
357  *      Yes
358  *
359  * @param[in]       dcInstance      Instance handle derived from discovery
360  *                                  functions.
361  * @param[in,out]   pSessionHandle  Pointer to a session handle.
362  * @param[in,out]   pSessionData    Pointer to a user instantiated structure
363  *                                  containing session data.
364  *
365  * @retval CPA_STATUS_SUCCESS        Function executed successfully.
366  * @retval CPA_STATUS_FAIL           Function failed.
367  * @retval CPA_STATUS_INVALID_PARAM  Invalid parameter passed in.
368  * @retval CPA_STATUS_RESOURCE       Error related to system resources.
369  * @retval CPA_STATUS_RESTARTING     API implementation is restarting. Resubmit
370  *                                   the request.
371  * @retval CPA_STATUS_UNSUPPORTED    Function is not supported.
372  *
373  * @pre
374  *      dcInstance has been started using @ref cpaDcStartInstance.
375  * @post
376  *      None
377  * @note
378  *      Only a synchronous version of this function is provided.
379  *
380  *      This initializes opaque data structures in the session handle. Data
381  *      compressed under this session will be compressed to the level
382  *      specified in the pSessionData structure. Lower compression level
383  *      numbers indicate a request for faster compression at the
384  *      expense of compression ratio.  Higher compression level numbers
385  *      indicate a request for higher compression ratios at the expense of
386  *      execution time.
387  *
388  *      The session is opaque to the user application and the session handle
389  *      contains job specific data.
390  *
391  *      The window size specified in the pSessionData must match exactly
392  *      one of the supported window sizes specified in the capability
393  *      structure.  If a bi-directional session is being initialized, then
394  *      the window size must be valid for both compress and decompress.
395  *
396  *      Note stateful sessions are not supported by this API.
397  *
398  * @see
399  *      None
400  *
401  *****************************************************************************/
402 CpaStatus
403 cpaDcDpInitSession( CpaInstanceHandle       dcInstance,
404         CpaDcSessionHandle              pSessionHandle,
405         CpaDcSessionSetupData           *pSessionData );
406 
407 
408 /**
409  *****************************************************************************
410  * @ingroup cpaDc
411  *      Compression Data Plane Session Remove Function.
412  *
413  * @description
414  *      This function will remove a previously initialized session handle
415  *      and the installed callback handler function. Removal will fail if
416  *      outstanding calls still exist for the initialized session handle.
417  *      The client needs to retry the remove function at a later time.
418  *      The memory for the session handle MUST not be freed until this call
419  *      has completed successfully.
420  *
421  * @context
422  *      This is a synchronous function that cannot sleep. It can be
423  *      executed in a context that does not permit sleeping.
424  * @assumptions
425  *      None
426  * @sideEffects
427  *      None
428  * @blocking
429  *      No.
430  * @reentrant
431  *      No
432  * @threadSafe
433  *      Yes
434  *
435  * @param[in]      dcInstance      Instance handle.
436  * @param[in,out]  pSessionHandle  Session handle.
437  *
438  * @retval CPA_STATUS_SUCCESS        Function executed successfully.
439  * @retval CPA_STATUS_FAIL           Function failed.
440  * @retval CPA_STATUS_RETRY          Resubmit the request.
441  * @retval CPA_STATUS_INVALID_PARAM  Invalid parameter passed in.
442  * @retval CPA_STATUS_RESOURCE       Error related to system resources.
443  * @retval CPA_STATUS_RESTARTING     API implementation is restarting. Resubmit
444  *                                   the request.
445  * @retval CPA_STATUS_UNSUPPORTED    Function is not supported.
446  *
447  * @pre
448  *      The component has been initialized via @ref cpaDcStartInstance function.
449  * @post
450  *      None
451  * @note
452  *      This is a synchronous function and has no completion callback
453  *      associated with it.
454  *
455  * @see
456  *      @ref cpaDcDpInitSession
457  *
458  *****************************************************************************/
459 CpaStatus
460 cpaDcDpRemoveSession(const CpaInstanceHandle dcInstance,
461         CpaDcSessionHandle pSessionHandle );
462 
463 /**
464  *****************************************************************************
465  * @ingroup cpaDcDp
466  *      Registration of the operation completion callback function.
467  *
468  * @description
469  *      This function allows a completion callback function to be registered.
470  *      The registered callback function is invoked on completion of
471  *      asycnhronous requests made via calls to @ref cpaDcDpEnqueueOp
472  *      or @ref cpaDcDpEnqueueOpBatch.
473  * @context
474  *      This is a synchronous function and it cannot sleep. It can be
475  *      executed in a context that DOES NOT permit sleeping.
476  * @assumptions
477  *      None
478  * @sideEffects
479  *      None
480  * @reentrant
481  *      No
482  * @threadSafe
483  *      No
484  *
485  * @param[in] dcInstance     Instance on which the callback function is to be
486  *                           registered.
487  * @param[in] pNewCb         Callback function for this instance.
488  *
489  * @retval CPA_STATUS_SUCCESS        Function executed successfully.
490  * @retval CPA_STATUS_FAIL           Function failed.
491  * @retval CPA_STATUS_INVALID_PARAM  Invalid parameter passed in.
492  * @retval CPA_STATUS_RESOURCE       Error related to system resources.
493  * @retval CPA_STATUS_RESTARTING     API implementation is restarting. Resubmit
494  *                                   the request.
495  * @retval CPA_STATUS_UNSUPPORTED    Function is not supported.
496  *
497  * @pre
498  *      Instance has been initialized.
499  * @post
500  *      None
501  * @note
502  *      None
503  * @see
504  *      cpaDcDpCbFunc
505  *****************************************************************************/
506 CpaStatus cpaDcDpRegCbFunc(const CpaInstanceHandle dcInstance,
507         const CpaDcDpCallbackFn pNewCb);
508 
509 /**
510  *****************************************************************************
511  * @ingroup cpaDcDp
512  *      Enqueue a single compression or decompression request.
513  *
514  * @description
515  *      This function enqueues a single request to perform a compression,
516  *      decompression operation.
517  *
518  *      The function is asynchronous; control is returned to the user once
519  *      the request has been submitted.  On completion of the request, the
520  *      application may poll for responses, which will cause a callback
521  *      function (registered via @ref cpaDcDpRegCbFunc) to be invoked.
522  *      Callbacks within a session are guaranteed
523  *      to be in the same order in which they were submitted.
524  *
525  *      The following restrictions apply to the pOpData parameter:
526  *
527  *      - The memory MUST be aligned on an 8-byte boundary.
528  *      - The reserved fields of the structure MUST NOT be written to
529  *        or read from.
530  *      - The structure MUST reside in physically contiguous memory.
531  *
532  * @context
533  *      This function will not sleep, and hence can be executed in a context
534  *      that does not permit sleeping.
535  *
536  * @sideEffects
537  *      None
538  * @blocking
539  *      No
540  * @reentrant
541  *      No
542  * @threadSafe
543  *      No
544  *
545  * @param[in] pOpData           Pointer to a structure containing the
546  *                              request parameters. The client code allocates
547  *                              the memory for this structure. This component
548  *                              takes ownership of the memory until it is
549  *                              returned in the callback, which was registered
550  *                              on the instance via @ref cpaDcDpRegCbFunc.
551  *                              See the above Description for some restrictions
552  *                              that apply to this parameter.
553  * @param[in] performOpNow      Flag to indicate whether the operation should be
554  *                              performed immediately (CPA_TRUE), or simply
555  *                              enqueued to be performed later (CPA_FALSE).
556  *                              In the latter case, the request is submitted
557  *                              to be performed either by calling this function
558  *                              again with this flag set to CPA_TRUE, or by
559  *                              invoking the function @ref
560  *                              cpaDcDpPerformOpNow.
561  *
562  * @retval CPA_STATUS_SUCCESS        Function executed successfully.
563  * @retval CPA_STATUS_FAIL           Function failed.
564  * @retval CPA_STATUS_RETRY          Resubmit the request.
565  * @retval CPA_STATUS_INVALID_PARAM  Invalid parameter passed in.
566  * @retval CPA_STATUS_RESTARTING     API implementation is restarting. Resubmit
567  *                                   the request.
568  * @retval CPA_STATUS_UNSUPPORTED    Function is not supported.
569  *
570  * @pre
571  *      The session identified by pOpData->pSessionHandle was setup using
572  *      @ref cpaDcDpInitSession.
573  *      The instance identified by pOpData->dcInstance has had a
574  *      callback function registered via @ref cpaDcDpRegCbFunc.
575  *
576  * @post
577  *      None
578  *
579  * @note
580  *      A callback of type @ref CpaDcDpCallbackFn is generated in
581  *      response to this function call. Any errors generated during
582  *      processing are reported as part of the callback status code.
583  *
584  * @see
585  *      @ref cpaDcDpPerformOpNow
586  *****************************************************************************/
587 
588 
589 CpaStatus
590 cpaDcDpEnqueueOp(CpaDcDpOpData *pOpData,
591         const CpaBoolean performOpNow);
592 
593 
594 /**
595  *****************************************************************************
596  * @ingroup cpaDcDp
597  *      Enqueue multiple requests to the compression data plane API.
598  *
599  * @description
600  *      This function enqueues multiple requests to perform compression or
601  *      decompression operations.
602  *
603  *      The function is asynchronous; control is returned to the user once
604  *      the request has been submitted.  On completion of the request, the
605  *      application may poll for responses, which will cause a callback
606  *      function (registered via @ref cpaDcDpRegCbFunc) to be invoked.
607  *      Separate callbacks will be invoked for each request.
608  *      Callbacks within a session and at the same priority are guaranteed
609  *      to be in the same order in which they were submitted.
610  *
611  *      The following restrictions apply to each element of the pOpData
612  *      array:
613  *
614  *      - The memory MUST be aligned on an 8-byte boundary.
615  *      - The reserved fields of the structure MUST be set to zero.
616  *      - The structure MUST reside in physically contiguous memory.
617  *
618  * @context
619  *      This function will not sleep, and hence can be executed in a context
620  *      that does not permit sleeping.
621  *
622  * @assumptions
623  *      Client MUST allocate the request parameters to 8 byte alignment.
624  *      Reserved elements of the CpaDcDpOpData structure MUST not used
625  *      The CpaDcDpOpData structure MUST reside in physically
626  *      contiguous memory.
627  *
628  * @sideEffects
629  *      None
630  * @blocking
631  *      No
632  * @reentrant
633  *      No
634  * @threadSafe
635  *      No
636  *
637  * @param[in] numberRequests    The number of requests in the array of
638  *                              CpaDcDpOpData structures.
639  * @param[in] pOpData           An array of pointers to CpaDcDpOpData
640  *                              structures.  Each CpaDcDpOpData
641  *                              structure contains the request parameters for
642  *                              that request. The client code allocates the
643  *                              memory for this structure. This component takes
644  *                              ownership of the memory until it is returned in
645  *                              the callback, which was registered on the
646  *                              instance via @ref cpaDcDpRegCbFunc.
647  *                              See the above Description for some restrictions
648  *                              that apply to this parameter.
649  * @param[in] performOpNow      Flag to indicate whether the operation should be
650  *                              performed immediately (CPA_TRUE), or simply
651  *                              enqueued to be performed later (CPA_FALSE).
652  *                              In the latter case, the request is submitted
653  *                              to be performed either by calling this function
654  *                              again with this flag set to CPA_TRUE, or by
655  *                              invoking the function @ref
656  *                              cpaDcDpPerformOpNow.
657  *
658  * @retval CPA_STATUS_SUCCESS        Function executed successfully.
659  * @retval CPA_STATUS_FAIL           Function failed.
660  * @retval CPA_STATUS_RETRY          Resubmit the request.
661  * @retval CPA_STATUS_INVALID_PARAM  Invalid parameter passed in.
662  * @retval CPA_STATUS_RESTARTING     API implementation is restarting. Resubmit
663  *                                   the request.
664  * @retval CPA_STATUS_UNSUPPORTED    Function is not supported.
665  *
666  * @pre
667  *      The session identified by pOpData[i]->pSessionHandle was setup using
668  *      @ref cpaDcDpInitSession.
669  *      The instance identified by pOpData[i]->dcInstance has had a
670  *      callback function registered via @ref cpaDcDpRegCbFunc.
671  *
672  * @post
673  *      None
674  *
675  * @note
676  *      Multiple callbacks of type @ref CpaDcDpCallbackFn are generated in
677  *      response to this function call (one per request).  Any errors
678  *      generated during processing are reported as part of the callback
679  *      status code.
680  *
681  * @see
682  *      cpaDcDpEnqueueOp
683  *****************************************************************************/
684 CpaStatus
685 cpaDcDpEnqueueOpBatch(const Cpa32U numberRequests,
686         CpaDcDpOpData *pOpData[],
687         const CpaBoolean performOpNow);
688 
689 
690 /**
691  *****************************************************************************
692  * @ingroup cpaDcDp
693  *      Submit any previously enqueued requests to be performed now on the
694  *      compression data plane API.
695  *
696  * @description
697  *      This function triggers processing of previously enqueed requests on the
698  *      referenced instance.
699  *
700  *
701  * @context
702  *      Will not sleep. It can be executed in a context that does not
703  *      permit sleeping.
704  *
705  * @sideEffects
706  *      None
707  * @blocking
708  *      No
709  * @reentrant
710  *      No
711  * @threadSafe
712  *      No
713  *
714  * @param[in] dcInstance        Instance to which the requests will be
715  *                                  submitted.
716  *
717  * @retval CPA_STATUS_SUCCESS        Function executed successfully.
718  * @retval CPA_STATUS_FAIL           Function failed.
719  * @retval CPA_STATUS_RETRY          Resubmit the request.
720  * @retval CPA_STATUS_INVALID_PARAM  Invalid parameter passed in.
721  * @retval CPA_STATUS_RESTARTING     API implementation is restarting. Resubmit
722  *                                   the request.
723  * @retval CPA_STATUS_UNSUPPORTED    Function is not supported.
724  *
725  * @pre
726  *      The component has been initialized via @ref cpaDcStartInstance function.
727  *      A compression session has been previously setup using the
728  *      @ref cpaDcDpInitSession function call.
729  *
730  * @post
731  *      None
732  *
733  * @see
734  *      cpaDcDpEnqueueOp, cpaDcDpEnqueueOpBatch
735  *****************************************************************************/
736 CpaStatus
737 cpaDcDpPerformOpNow(CpaInstanceHandle dcInstance);
738 
739 
740 
741 #ifdef __cplusplus
742 } /* close the extern "C" { */
743 #endif
744 
745 #endif /* CPA_DC_DP_H */
746 
747