From patchwork Thu Jul 13 06:41:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhenwei pi X-Patchwork-Id: 13311364 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ADB93EB64DD for ; Thu, 13 Jul 2023 06:43:09 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qJq1b-0004kX-Mu; Thu, 13 Jul 2023 02:42:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qJq1a-0004kN-Ae for qemu-devel@nongnu.org; Thu, 13 Jul 2023 02:42:02 -0400 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qJq1L-0007rn-3E for qemu-devel@nongnu.org; Thu, 13 Jul 2023 02:42:02 -0400 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-55c85b5321dso230240a12.3 for ; Wed, 12 Jul 2023 23:41:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1689230505; x=1691822505; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pEK1Z9Npjmo8oz7JUu1mUOmCLwI5rnb6nd13N6AuRpE=; b=UhxeoZcg0nga5d1YeUg8mFh9H+dxw0Bx3JYpl1vVaC4OqMtHm8f3hRxhwoNyOYjJMw a1YqNosm2CVY6bRtcrWLxj2d5txc75kzDcdiGJn8VLBZDUFrbnBuV1yHT3jRrXmxKJZo TkPVkTD3cI5i+3SClB6zEYrBcdF0tYYPQ6Jev8AHwVFUFe8eUT4wbW/Rz0SP00ZcNaqf 14jzSI3KYVRNecMNty9eNkcyosGtwCGxz1njrGuPgWfFRnYfKdlUM67myAuEd4w3hKrk ZlO1RPklHEOh91bucvqYKGFGiqxm2SBTwNHlRP/qvLEns6+zbgDt9wsy+DqcnOYAVNAf SBlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689230505; x=1691822505; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pEK1Z9Npjmo8oz7JUu1mUOmCLwI5rnb6nd13N6AuRpE=; b=RbfGUFdLTUvnxHcpFsr8wn9H8J0cG6C5v6gOOA6Qq097F4zsEQKJB0PrrZv6jHdIIp 9VHTK8Jy4hxm5gghJJ+eJsloxbfGMSSLGRFSiLqZha5YxLnVt6eqNRbcSJnrUuaM9Rxi mecNeh6zuJkBwMzm6PavkYz5LHGXkNOHh3CVBE2IJ9aKLAP3CZ8c52CreDJzkB952rXl B5xEmrVRjHOUj+1YkRcncGNVpMNRDZjxwBhdPptZDzdPMaNE+QL2n3BD61mRAGGj7gQX uv1gKPex1B84IILLhRYlIg5EQjhKBvCubFCcLX196ndyAcmGLVf/y9vFFveAkRGH45ZV UfGA== X-Gm-Message-State: ABy/qLaKT1v/K3s/v0wVSdxu3hICdiRtWyMo+YpXRr5d3kYgq6m6RJpL eLplI0LA4xlSC+mhSN4x4Le9kg== X-Google-Smtp-Source: APBJJlGhNwZ7CzgDPr0tJD9cT608Iaod1zn/D4QTLC56uIIFGaG6Uae9qTOQIHORWa2S3pcIP/xFzA== X-Received: by 2002:a05:6a20:2594:b0:12b:1686:3012 with SMTP id k20-20020a056a20259400b0012b16863012mr256290pzd.3.1689230505581; Wed, 12 Jul 2023 23:41:45 -0700 (PDT) Received: from libai.bytedance.net ([61.213.176.11]) by smtp.gmail.com with ESMTPSA id h13-20020a170902680d00b001ac2be26340sm5144966plk.222.2023.07.12.23.41.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 23:41:45 -0700 (PDT) From: zhenwei pi To: berto@igalia.com, kwolf@redhat.com, groug@kaod.org, qemu_oss@crudebyte.com, hreitz@redhat.com Cc: arei.gonglei@huawei.com, qemu-devel@nongnu.org, qemu-block@nongnu.org, berrange@redhat.com, zhenwei pi Subject: [PATCH v3 5/6] cryptodev: use NULL throttle timer cb for read direction Date: Thu, 13 Jul 2023 14:41:10 +0800 Message-Id: <20230713064111.558652-6-pizhenwei@bytedance.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230713064111.558652-1-pizhenwei@bytedance.com> References: <20230713064111.558652-1-pizhenwei@bytedance.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::535; envelope-from=pizhenwei@bytedance.com; helo=mail-pg1-x535.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Operations on a crytpodev are considered as *write* only, the callback of read direction is never invoked. Use NULL instead of an unreachable path(cryptodev_backend_throttle_timer_cb on read direction). Reviewed-by: Alberto Garcia Signed-off-by: zhenwei pi Reviewed-by: Hanna Czenczek --- backends/cryptodev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backends/cryptodev.c b/backends/cryptodev.c index 7d29517843..5cfa25c61c 100644 --- a/backends/cryptodev.c +++ b/backends/cryptodev.c @@ -331,8 +331,7 @@ static void cryptodev_backend_set_throttle(CryptoDevBackend *backend, int field, if (!enabled) { throttle_init(&backend->ts); throttle_timers_init(&backend->tt, qemu_get_aio_context(), - QEMU_CLOCK_REALTIME, - cryptodev_backend_throttle_timer_cb, /* FIXME */ + QEMU_CLOCK_REALTIME, NULL, cryptodev_backend_throttle_timer_cb, backend); }