[PATCH v3 5/6] cryptodev: use NULL throttle timer cb for read direction

zhenwei pi posted 6 patches 2 years, 7 months ago
Maintainers: "Gonglei (Arei)" <arei.gonglei@huawei.com>, Zhenwei Pi <pizhenwei@bytedance.com>, Alberto Garcia <berto@igalia.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Greg Kurz <groug@kaod.org>, Christian Schoenebeck <qemu_oss@crudebyte.com>
There is a newer version of this series
[PATCH v3 5/6] cryptodev: use NULL throttle timer cb for read direction
Posted by zhenwei pi 2 years, 7 months ago
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 <berto@igalia.com>
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
---
 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);
     }
 
-- 
2.34.1
Re: [PATCH v3 5/6] cryptodev: use NULL throttle timer cb for read direction
Posted by Hanna Czenczek 2 years, 6 months ago
On 13.07.23 08:41, zhenwei pi wrote:
> Operations on a crytpodev are considered as *write* only, the callback

s/crytpodev/cryptodev/

> 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 <berto@igalia.com>
> Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
> ---
>   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 */

Now it’ll be gone (good), but if you happen to add a FIXME again, it 
would be nice to explain in the same comment in the code what exactly 
needs fixing, and why it isn‘t being fixed at this point.

> +                             QEMU_CLOCK_REALTIME, NULL,
>                                cryptodev_backend_throttle_timer_cb, backend);
>       }

With the typo in the commit message fixed:

Reviewed-by: Hanna Czenczek <hreitz@redhat.com>