From patchwork Tue Aug 27 17:26:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fiona Trahe X-Patchwork-Id: 58096 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CC1E71C1CA; Tue, 27 Aug 2019 19:26:12 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 085C41C1C2 for ; Tue, 27 Aug 2019 19:26:10 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Aug 2019 10:26:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,438,1559545200"; d="scan'208";a="197349262" Received: from sivswdev09.ir.intel.com (HELO localhost.localdomain) ([10.237.217.48]) by fmsmga001.fm.intel.com with ESMTP; 27 Aug 2019 10:26:07 -0700 From: Fiona Trahe To: dev@dpdk.org Cc: akhil.goyal@nxp.com, ashish.gupta@marvell.com, shallyv@marvell.com, Fiona Trahe Date: Tue, 27 Aug 2019 18:26:04 +0100 Message-Id: <1566926764-31816-1-git-send-email-fiona.trahe@intel.com> X-Mailer: git-send-email 1.7.0.7 Subject: [dpdk-dev] [PATCH] doc/compressdev: clarify that structs should be zeroed before use X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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 ----------------------------