Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1951333iob; Thu, 5 May 2022 11:37:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylRmB/eDsdWQXBvc43HNf9prX6AaXqqQwbzJ9yMV7POIlpY4oHJeax5c379/r/a/mjamZ4 X-Received: by 2002:a50:fe1a:0:b0:425:e276:5adf with SMTP id f26-20020a50fe1a000000b00425e2765adfmr31285396edt.284.1651775863401; Thu, 05 May 2022 11:37:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651775863; cv=none; d=google.com; s=arc-20160816; b=wey9r0P5KHBWP3A8F0NyOx6+oT4Jkg1m34BrSMSqs/bNSpOCj6OY4ZnTwTJPNfdRXQ HEcjiiaElv0qFGHh9QCHu/fOrMI/5VtsyJ53K4WMx3RL/7HvunchBwoYtHoXwHUujXsN oTvecukz6GtzIcAkBr8XV0WASExX28uK26ULsz7NPraY7c9vbZi/Sm+JXuv+ZEvLKPI7 O+JH2FkMp7/1G+/miw7fbk9HnR2JSDob00NTc5w8BA1dnXU5KiYjyVHLQ18V1Loy7evH gCuZXfYOVx4kR88RUHC9NINo5eKmIbGCjEnC9Ro8sRr6FS7IaZxrzds9OavTCbcsNHdh /Mvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=aEOiwyG+eTh6W3KHKpg7shbqlJQ76/KhFzFg57zL5/0=; b=R8ph7MDTb9ag6DvqOFpNGg4aQ+QSPsZyRuJF7L0a6+nLlvNjuZHWdW2i8eidCOznNN /RhBpGswSv3cGkyrDDIpj/AsEraMJHqfP/g0gDJ3ubXVW9Bxmx8QluWbBpyHyC2FzqKb AcVLLsXqbJAXp1Y26c3RSaTg3Quu016JT80L8ww1Bm0WKN2nZtzY+Z3VTktuGrILsy0H me8/tP718GuwKC2pt/VLA068KfIDo6yTlZMDnlxpdystDEGEdApNmlafnbeZDg5VsfqU lYuEp8BHnchJ5I94Eyz1rCmZR9A6kJLIQoVAq9BLKzCVUkCoHChjDNihcbDrm5a4OozZ 7AHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=SxFvslkZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s5-20020a508dc5000000b00423f6b13d94si2066172edh.565.2022.05.05.11.37.19; Thu, 05 May 2022 11:37:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=SxFvslkZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239718AbiEECmx (ORCPT + 99 others); Wed, 4 May 2022 22:42:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239426AbiEECmt (ORCPT ); Wed, 4 May 2022 22:42:49 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FD844926A for ; Wed, 4 May 2022 19:39:11 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id n18so3152846plg.5 for ; Wed, 04 May 2022 19:39:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=aEOiwyG+eTh6W3KHKpg7shbqlJQ76/KhFzFg57zL5/0=; b=SxFvslkZn6Q7OGlLS0jfiCTQI0xExlJuAPCV/QgaRH9jHQ3UvOSGxz4PqWTvGgBoOj gBffuL3wuhZtQhDfJigr7X7r7hQ7pNB++kVGMw+ILNK+ZJOd/AkCeDcxTSmZg47MtDoD z80FE3h2Xcbh2AjufRmu/kpVcavdLzpyMOpSRw6Xj1hH6rfCCnRe0xK7XDskvZdjifBr 2INqvNc4tChqAjFbu7htLf9yRlSjmfKGuHKu0S1g273gLnpPseYMXEplQsMUT3NjD+fr CGrdIGglM3GN0s8WNVIib+e6y9hsThmkkioTe5fxw/nghkpclZz6l0mWXwD+MKQlmaVj Ui8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=aEOiwyG+eTh6W3KHKpg7shbqlJQ76/KhFzFg57zL5/0=; b=XczxPu6EnBScePe/1lBbFoNrfzjMgU7k2HEip8+NwsP/zdPppAKDpxjmL1IDdO5mfl bAXuDlh0KZUjjcV6ZTdxFEo7t2909zT+Mq0sS3xn6jEbAP2Uiogcw5iQhwhSbY6R3zQh pmWhu45Pem/XVRYUAgpdZa8i+j9oTHlpzUr+4ON6mdp4qiKouO7azPesA0vjAmNuVA73 nsNBQmJsJs6njV4eHkPYkliaJakKbhZEKyUvLcVVJcNITVrhi+UiZpZZROffaiceY3Hn sI5ZFE4dhYGPdWsjGkWkpyYn5lt0jkxuh6FRWchvTHO0e5mw1w2gH/wr/y3AQ6ggHO3U TnnQ== X-Gm-Message-State: AOAM530dhSu0QjAB9mpmfTj54Ffn8SNM4IMa0KV+Q6h5TRJtXteOCqyd wXFIxHFM1TJbdDemW+HcE+eFiA== X-Received: by 2002:a17:90b:3903:b0:1dc:8fe0:df4d with SMTP id ob3-20020a17090b390300b001dc8fe0df4dmr3327533pjb.191.1651718350808; Wed, 04 May 2022 19:39:10 -0700 (PDT) Received: from [10.255.89.252] ([139.177.225.255]) by smtp.gmail.com with ESMTPSA id n1-20020a170902e54100b0015e8d4eb252sm203223plf.156.2022.05.04.19.39.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 May 2022 19:39:10 -0700 (PDT) Message-ID: Date: Thu, 5 May 2022 10:35:17 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: PING: [PATCH v4 0/5] virtio-crypto: Improve performance Content-Language: en-US To: arei.gonglei@huawei.com, mst@redhat.com, jasowang@redhat.com Cc: herbert@gondor.apana.org.au, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-crypto@vger.kernel.org, helei.sig11@bytedance.com, davem@davemloft.net References: <20220424104140.44841-1-pizhenwei@bytedance.com> From: zhenwei pi In-Reply-To: <20220424104140.44841-1-pizhenwei@bytedance.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org Hi, Lei Jason replied in another patch: Still hundreds of lines of changes, I'd leave this change to other maintainers to decide. Quite frankly, the virtio crypto driver changed only a few in the past, and the performance of control queue is not good enough. I am in doubt about that this driver is not used widely. So I'd like to rework a lot, it would be best to complete this work in 5.18 window. This gets different point with Jason. I would appreciate it if you could give me any hint. On 4/24/22 18:41, zhenwei pi wrote: > Hi, Lei > I'd like to move helper and callback functions(Eg, virtcrypto_clear_request > and virtcrypto_ctrlq_callback) from xx_core.c to xx_common.c, > then the xx_core.c supports: > - probe/remove/irq affinity seting for a virtio device > - basic virtio related operations > > xx_common.c supports: > - common helpers/functions for algos > > Do you have any suggestion about this? > > v3 -> v4: > - Don't create new file virtio_common.c, the new functions are added > into virtio_crypto_core.c > - Split the first patch into two parts: > 1, change code style, > 2, use private buffer instead of shared buffer > - Remove relevant change. > - Other minor changes. > > v2 -> v3: > - Jason suggested that spliting the first patch into two part: > 1, using private buffer > 2, remove the busy polling > Rework as Jason's suggestion, this makes the smaller change in > each one and clear. > > v1 -> v2: > - Use kfree instead of kfree_sensitive for insensitive buffer. > - Several coding style fix. > - Use memory from current node, instead of memory close to device > - Add more message in commit, also explain why removing per-device > request buffer. > - Add necessary comment in code to explain why using kzalloc to > allocate struct virtio_crypto_ctrl_request. > > v1: > The main point of this series is to improve the performance for > virtio crypto: > - Use wait mechanism instead of busy polling for ctrl queue, this > reduces CPU and lock racing, it's possiable to create/destroy session > parallelly, QPS increases from ~40K/s to ~200K/s. > - Enable retry on crypto engine to improve performance for data queue, > this allows the larger depth instead of 1. > - Fix dst data length in akcipher service. > - Other style fix. > > lei he (2): > virtio-crypto: adjust dst_len at ops callback > virtio-crypto: enable retry for virtio-crypto-dev > > zhenwei pi (3): > virtio-crypto: change code style > virtio-crypto: use private buffer for control request > virtio-crypto: wait ctrl queue instead of busy polling > > .../virtio/virtio_crypto_akcipher_algs.c | 83 ++++++----- > drivers/crypto/virtio/virtio_crypto_common.h | 21 ++- > drivers/crypto/virtio/virtio_crypto_core.c | 55 ++++++- > .../virtio/virtio_crypto_skcipher_algs.c | 140 ++++++++---------- > 4 files changed, 180 insertions(+), 119 deletions(-) > -- zhenwei pi