Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2521426rwb; Fri, 9 Dec 2022 03:15:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf4pJu1hQkH98kgrzE0lPeBUqzmDDcYJ53dIjtZk9o73oE/vc7SNiVriT6wMoPgdUrQ3B/NZ X-Received: by 2002:a05:6402:5007:b0:45c:835c:369a with SMTP id p7-20020a056402500700b0045c835c369amr5544602eda.35.1670584533762; Fri, 09 Dec 2022 03:15:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670584533; cv=none; d=google.com; s=arc-20160816; b=NWSyFuMkFUbxgbyL6k8qfQ85Y4Mhcyc3aNZ3j69T7z0uMiV2+i85ueH7gHCcDyCcIB IqAdnEt7zSd7YNSb2TX5Kqzz5is3ooT7XNqPXto69f5DiuIpu+YRxwN5Acd5Hxo8vVG6 YOzVYihOrR2yHSAavwAtUw3iTOdjcSiaWJrvXm6GsFTLaO84xcJ0hc4/3mg4ljIPT10U AJ5xIQNHqTI8K2Qg815U3SAUGv5lXmkZ9aJTrxMmOl2Fy0CuU0ap2T4W7g6iPHTbUlUf Wp6TaTKEJm9vrQrdl/SnATCvpwk++0kKdQCv7WHeM4gCT91pZpdEZlxtZm490Toa7M3x dX0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=kaqIDWhAT6kwaj1Iz5Pt40vY4LgvrpWEWFICt0/BbmQ=; b=Q5U3rj5762ISBiThMvUGlnO7BNYx20C2WLBk8ncafUrnK/I8A8YmOUtiU1YVr1a46/ 16nLpyj9g3ft/UP9ApSCcQ+yZcskYVtLcpn3kdRzYOk5qbIVwhNK3jyjXchqqVIlXOad MRNCIUw+hH1QaGFPD0/rcKCmt+u6tLxF2GbPv6wQvxg0gGjUOSODnRg6ew3ZarVMaMLQ aXNvY3RJEkgrVjqWv34H2muqmG+s9mqTNoudSpR6P7CAFelecedyll/Pfy1CTO9PX0Gx 5p36BNAcriACwce5ej9wZwOl/i3iKYaWwq7ebzKTI3oVCGkcOP9NNdU/QHSyXqmYIHUX TjDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f11-20020a056402354b00b004642b0f7b2fsi1259520edd.417.2022.12.09.03.15.10; Fri, 09 Dec 2022 03:15:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229498AbiLILG7 (ORCPT + 99 others); Fri, 9 Dec 2022 06:06:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbiLILG6 (ORCPT ); Fri, 9 Dec 2022 06:06:58 -0500 Received: from formenos.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C1FC4D5FA for ; Fri, 9 Dec 2022 03:06:56 -0800 (PST) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1p3bDQ-005gj2-4Q; Fri, 09 Dec 2022 19:06:53 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 09 Dec 2022 19:06:52 +0800 Date: Fri, 9 Dec 2022 19:06:52 +0800 From: Herbert Xu To: Giovanni Cabiddu Cc: linux-crypto@vger.kernel.org, qat-linux@intel.com, Vlad Dronov Subject: Re: [PATCH v3 00/12] crypto: qat - enable compression deflate algorithm Message-ID: References: <20221128122123.130459-1-giovanni.cabiddu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221128122123.130459-1-giovanni.cabiddu@intel.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Mon, Nov 28, 2022 at 12:21:11PM +0000, Giovanni Cabiddu wrote: > This set enables the offload of the compression deflate algorithm to QAT > accelerators through the acomp API. > > The first part of the set (patches 1 to 8) reworks and refactors logic > that is specific to the crypto service in order to be used by the > compression service. > In particular, the first 6 patches rework the buffer list logic, which > is used to map, unmap and convert scatterlists into the format that the > QAT firmware can understand. These relocate the bufferlist logic to a > separate file, change the interfaces so that the logic is service > agnostic (not tied to compression or crypto) and extend the interface to > allow an additional pre-allocated buffer for each destination scatter list > which will be used to avoid premature overflows reported by the compression > hardware. > Patch 7 relocates the function qat_algs_alloc_flags() from a crypto > specific header to qat_bl.h. > Patch 8 moves and renames the configuration function for GEN2, > qat_crypto_dev_config(), to a new file, adf_gen2_config.h, which > contains the configuration logic for both crypto and compression > instances for QAT GEN2 devices. > > The last 2 patches in the set introduce all the infrastructure required > to enable the compression service in the QAT driver and expose it through > the acomp APIs. > In particular, patch 9 introduces the logic related to the creation > and handling of compression instances and their configuration. In addition, > it adds the back-end for qat_deflate to plug into acomp, including the logic > to build descriptors for the newly added GEN2 compression firmware APIs. > This was all kept in a single patch to avoid introducing unused logic in > the QAT driver in previous patches. > > Patch 10, extends the compression logic to support to QAT GEN4 devices. > > Patch 11 extends the acomp api by defining the max size for the destination > buffer when a request is submitted with NULL destination buffer. > This value is then used in the followin patch. > > Patch 12 implements the resubmission logic for decompression requests > that is triggered if the destination buffer, allocated by the driver, > is not sufficiently big to store the output from the operation. > > Changes from v1: > - Implemented resubmission logic for decompression triggered when > the output buffer allocated by the driver is not sufficiently large to > store the result from the operation > - Renamed buffer list functions that are moved to the qat_bl module > > Changes from v2: > - Reworked decompression re-submission logic. For decompression operations > submitted specifying NULL as destination buffer, resubmit once with a > destination buffer of size 128KB instead of retying multiple times > doubling every time the size of the destination buffer. > - Added define in acomp api to specify the destination maximum size. > > Giovanni Cabiddu (12): > crypto: qat - relocate bufferlist logic > crypto: qat - rename bufferlist functions > crypto: qat - change bufferlist logic interface > crypto: qat - generalize crypto request buffers > crypto: qat - extend buffer list interface > crypto: qat - relocate backlog related structures > crypto: qat - relocate qat_algs_alloc_flags() > crypto: qat - rename and relocate GEN2 config function > crypto: qat - expose deflate through acomp api for QAT GEN2 > crypto: qat - enable deflate for QAT GEN4 > crypto: acomp - define max size for destination > crypto: qat - add resubmit logic for decompression > > .../crypto/qat/qat_4xxx/adf_4xxx_hw_data.c | 4 +- > .../crypto/qat/qat_4xxx/adf_4xxx_hw_data.h | 2 +- > drivers/crypto/qat/qat_4xxx/adf_drv.c | 145 ++++++- > .../crypto/qat/qat_c3xxx/adf_c3xxx_hw_data.c | 4 + > drivers/crypto/qat/qat_c3xxx/adf_drv.c | 2 +- > .../qat/qat_c3xxxvf/adf_c3xxxvf_hw_data.c | 4 + > .../crypto/qat/qat_c62x/adf_c62x_hw_data.c | 4 + > drivers/crypto/qat/qat_c62x/adf_drv.c | 2 +- > .../qat/qat_c62xvf/adf_c62xvf_hw_data.c | 4 + > drivers/crypto/qat/qat_common/Makefile | 8 +- > .../crypto/qat/qat_common/adf_accel_devices.h | 14 + > .../crypto/qat/qat_common/adf_cfg_strings.h | 1 + > .../crypto/qat/qat_common/adf_common_drv.h | 9 +- > drivers/crypto/qat/qat_common/adf_ctl_drv.c | 6 + > .../crypto/qat/qat_common/adf_gen2_config.c | 206 +++++++++ > .../crypto/qat/qat_common/adf_gen2_config.h | 10 + > drivers/crypto/qat/qat_common/adf_gen2_dc.c | 70 +++ > drivers/crypto/qat/qat_common/adf_gen2_dc.h | 10 + > drivers/crypto/qat/qat_common/adf_gen4_dc.c | 83 ++++ > drivers/crypto/qat/qat_common/adf_gen4_dc.h | 10 + > drivers/crypto/qat/qat_common/adf_init.c | 11 + > drivers/crypto/qat/qat_common/adf_sriov.c | 4 + > drivers/crypto/qat/qat_common/icp_qat_fw.h | 24 ++ > .../crypto/qat/qat_common/icp_qat_fw_comp.h | 404 ++++++++++++++++++ > drivers/crypto/qat/qat_common/icp_qat_hw.h | 66 +++ > .../qat/qat_common/icp_qat_hw_20_comp.h | 164 +++++++ > .../qat/qat_common/icp_qat_hw_20_comp_defs.h | 300 +++++++++++++ > drivers/crypto/qat/qat_common/qat_algs.c | 208 +-------- > drivers/crypto/qat/qat_common/qat_algs_send.h | 16 +- > drivers/crypto/qat/qat_common/qat_bl.c | 383 +++++++++++++++++ > drivers/crypto/qat/qat_common/qat_bl.h | 67 +++ > drivers/crypto/qat/qat_common/qat_comp_algs.c | 344 +++++++++++++++ > drivers/crypto/qat/qat_common/qat_comp_req.h | 123 ++++++ > .../crypto/qat/qat_common/qat_compression.c | 297 +++++++++++++ > .../crypto/qat/qat_common/qat_compression.h | 37 ++ > drivers/crypto/qat/qat_common/qat_crypto.c | 120 +----- > drivers/crypto/qat/qat_common/qat_crypto.h | 55 +-- > .../qat/qat_dh895xcc/adf_dh895xcc_hw_data.c | 4 + > drivers/crypto/qat/qat_dh895xcc/adf_drv.c | 2 +- > .../qat_dh895xccvf/adf_dh895xccvf_hw_data.c | 4 + > include/crypto/acompress.h | 1 + > 41 files changed, 2848 insertions(+), 384 deletions(-) > create mode 100644 drivers/crypto/qat/qat_common/adf_gen2_config.c > create mode 100644 drivers/crypto/qat/qat_common/adf_gen2_config.h > create mode 100644 drivers/crypto/qat/qat_common/adf_gen2_dc.c > create mode 100644 drivers/crypto/qat/qat_common/adf_gen2_dc.h > create mode 100644 drivers/crypto/qat/qat_common/adf_gen4_dc.c > create mode 100644 drivers/crypto/qat/qat_common/adf_gen4_dc.h > create mode 100644 drivers/crypto/qat/qat_common/icp_qat_fw_comp.h > create mode 100644 drivers/crypto/qat/qat_common/icp_qat_hw_20_comp.h > create mode 100644 drivers/crypto/qat/qat_common/icp_qat_hw_20_comp_defs.h > create mode 100644 drivers/crypto/qat/qat_common/qat_bl.c > create mode 100644 drivers/crypto/qat/qat_common/qat_bl.h > create mode 100644 drivers/crypto/qat/qat_common/qat_comp_algs.c > create mode 100644 drivers/crypto/qat/qat_common/qat_comp_req.h > create mode 100644 drivers/crypto/qat/qat_common/qat_compression.c > create mode 100644 drivers/crypto/qat/qat_common/qat_compression.h > > -- > 2.38.1 All applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt