[dpdk-dev] [PATCH] doc/compressdev: clarify that structs should be zeroed before use

Fiona Trahe fiona.trahe at intel.com
Tue Aug 27 19:26:04 CEST 2019


Some structs used on the API are zeroed on creation by API calls,
(e.g. rte_comp_op), but a few are allocated in the application domain.
Clarify that the application should zero those to enable future
extensions without API breakage.

Signed-off-by: Fiona Trahe <fiona.trahe at intel.com>
---
 doc/guides/prog_guide/compressdev.rst |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/doc/guides/prog_guide/compressdev.rst b/doc/guides/prog_guide/compressdev.rst
index a089db1..2a85eba 100644
--- a/doc/guides/prog_guide/compressdev.rst
+++ b/doc/guides/prog_guide/compressdev.rst
@@ -76,6 +76,11 @@ The ``rte_compressdev_configure`` API is used to configure a compression device.
 The ``rte_compressdev_config`` structure is used to pass the configuration
 parameters.
 
+The allocation of the ``rte_compressdev_config`` struct passed on the API is in the application
+domain, so to allow future API extensions in a backwardly compatible manner the application
+should zero this struct, e.g. using sizeof(), before populating it. This allows the addition
+of new parameters to the struct with default value of zero indicating original behaviour.
+
 See *DPDK API Reference* for details.
 
 Configuration of Queue Pairs
@@ -264,6 +269,11 @@ Compression transforms (``rte_comp_xform``) are the mechanism
 to specify the details of the compression operation such as algorithm,
 window size and checksum.
 
+The allocation of the ``rte_comp_xform`` struct passed on the API is in the application
+domain, so to allow future API extensions in a backwardly compatible manner the application
+should zero this struct, e.g. using sizeof(), before populating it. This allows the addition
+of new parameters to the struct with default value of zero indicating original behaviour.
+
 Compression API Hash support
 ----------------------------
 
-- 
1.7.0.7



More information about the dev mailing list