mbox series

[for-8.0,v2,00/11] Refactor cryptodev

Message ID 20221122140756.686982-1-pizhenwei@bytedance.com (mailing list archive)
Headers show
Series Refactor cryptodev | expand

Message

zhenwei pi Nov. 22, 2022, 2:07 p.m. UTC
v1 -> v2:
- fix coding style and use 'g_strjoin()' instead of 'char services[128]'
  (suggested by Dr. David Alan Gilbert)
- wrapper function 'cryptodev_backend_account' to record statistics, and
  allocate sym_stat/asym_stat in cryptodev base class. see patch:
  'cryptodev: Support statistics'.
- add more arguments into struct CryptoDevBackendOpInfo, then
  cryptodev_backend_crypto_operation() uses *op_info only.
- support cryptodev QoS settings(BPS&OPS), both QEMU command line and QMP
  command works fine.
- add myself as the maintainer for cryptodev.

v1:
- introduce cryptodev.json to describe the attributes of crypto device, then
  drop duplicated type declare, remove some virtio related dependence.
- add statistics: OPS and bandwidth.
- add QMP command: query-cryptodev
- add HMP info command: cryptodev
- misc fix: detect akcipher capability instead of exposing akcipher service
  unconditionally.

Zhenwei Pi (11):
  cryptodev: Introduce cryptodev.json
  cryptodev: Remove 'name' & 'model' fields
  cryptodev: Introduce cryptodev alg type in QAPI
  cryptodev: Introduce server type in QAPI
  cryptodev: Introduce 'query-cryptodev' QMP command
  cryptodev: Support statistics
  cryptodev-builtin: Detect akcipher capability
  hmp: add cryptodev info command
  cryptodev: Use CryptoDevBackendOpInfo for operation
  cryptodev: support QoS
  MAINTAINERS: add myself as the maintainer for cryptodev

 MAINTAINERS                     |   2 +
 backends/cryptodev-builtin.c    |  42 +++--
 backends/cryptodev-lkcf.c       |  19 +-
 backends/cryptodev-vhost-user.c |  13 +-
 backends/cryptodev-vhost.c      |   4 +-
 backends/cryptodev.c            | 295 +++++++++++++++++++++++++++++---
 hmp-commands-info.hx            |  14 ++
 hw/virtio/virtio-crypto.c       |  48 ++++--
 include/monitor/hmp.h           |   1 +
 include/sysemu/cryptodev.h      |  94 +++++-----
 monitor/hmp-cmds.c              |  36 ++++
 qapi/cryptodev.json             | 144 ++++++++++++++++
 qapi/meson.build                |   1 +
 qapi/qapi-schema.json           |   1 +
 qapi/qom.json                   |   8 +-
 15 files changed, 604 insertions(+), 118 deletions(-)
 create mode 100644 qapi/cryptodev.json

Comments

zhenwei pi Dec. 16, 2022, 3:24 a.m. UTC | #1
Hi, Lei

Could you please review this series?

On 11/22/22 22:07, zhenwei pi wrote:
> v1 -> v2:
> - fix coding style and use 'g_strjoin()' instead of 'char services[128]'
>    (suggested by Dr. David Alan Gilbert)
> - wrapper function 'cryptodev_backend_account' to record statistics, and
>    allocate sym_stat/asym_stat in cryptodev base class. see patch:
>    'cryptodev: Support statistics'.
> - add more arguments into struct CryptoDevBackendOpInfo, then
>    cryptodev_backend_crypto_operation() uses *op_info only.
> - support cryptodev QoS settings(BPS&OPS), both QEMU command line and QMP
>    command works fine.
> - add myself as the maintainer for cryptodev.
> 
> v1:
> - introduce cryptodev.json to describe the attributes of crypto device, then
>    drop duplicated type declare, remove some virtio related dependence.
> - add statistics: OPS and bandwidth.
> - add QMP command: query-cryptodev
> - add HMP info command: cryptodev
> - misc fix: detect akcipher capability instead of exposing akcipher service
>    unconditionally.
> 
> Zhenwei Pi (11):
>    cryptodev: Introduce cryptodev.json
>    cryptodev: Remove 'name' & 'model' fields
>    cryptodev: Introduce cryptodev alg type in QAPI
>    cryptodev: Introduce server type in QAPI
>    cryptodev: Introduce 'query-cryptodev' QMP command
>    cryptodev: Support statistics
>    cryptodev-builtin: Detect akcipher capability
>    hmp: add cryptodev info command
>    cryptodev: Use CryptoDevBackendOpInfo for operation
>    cryptodev: support QoS
>    MAINTAINERS: add myself as the maintainer for cryptodev
> 
>   MAINTAINERS                     |   2 +
>   backends/cryptodev-builtin.c    |  42 +++--
>   backends/cryptodev-lkcf.c       |  19 +-
>   backends/cryptodev-vhost-user.c |  13 +-
>   backends/cryptodev-vhost.c      |   4 +-
>   backends/cryptodev.c            | 295 +++++++++++++++++++++++++++++---
>   hmp-commands-info.hx            |  14 ++
>   hw/virtio/virtio-crypto.c       |  48 ++++--
>   include/monitor/hmp.h           |   1 +
>   include/sysemu/cryptodev.h      |  94 +++++-----
>   monitor/hmp-cmds.c              |  36 ++++
>   qapi/cryptodev.json             | 144 ++++++++++++++++
>   qapi/meson.build                |   1 +
>   qapi/qapi-schema.json           |   1 +
>   qapi/qom.json                   |   8 +-
>   15 files changed, 604 insertions(+), 118 deletions(-)
>   create mode 100644 qapi/cryptodev.json
>
Michael S. Tsirkin Dec. 20, 2022, 3:36 p.m. UTC | #2
On Tue, Nov 22, 2022 at 10:07:45PM +0800, zhenwei pi wrote:
> v1 -> v2:
> - fix coding style and use 'g_strjoin()' instead of 'char services[128]'
>   (suggested by Dr. David Alan Gilbert)
> - wrapper function 'cryptodev_backend_account' to record statistics, and
>   allocate sym_stat/asym_stat in cryptodev base class. see patch:
>   'cryptodev: Support statistics'.
> - add more arguments into struct CryptoDevBackendOpInfo, then
>   cryptodev_backend_crypto_operation() uses *op_info only.
> - support cryptodev QoS settings(BPS&OPS), both QEMU command line and QMP
>   command works fine.
> - add myself as the maintainer for cryptodev.
> 
> v1:
> - introduce cryptodev.json to describe the attributes of crypto device, then
>   drop duplicated type declare, remove some virtio related dependence.
> - add statistics: OPS and bandwidth.
> - add QMP command: query-cryptodev
> - add HMP info command: cryptodev
> - misc fix: detect akcipher capability instead of exposing akcipher service
>   unconditionally.


Can we get ACK on QAPI things please?
Thanks!

> Zhenwei Pi (11):
>   cryptodev: Introduce cryptodev.json
>   cryptodev: Remove 'name' & 'model' fields
>   cryptodev: Introduce cryptodev alg type in QAPI
>   cryptodev: Introduce server type in QAPI
>   cryptodev: Introduce 'query-cryptodev' QMP command
>   cryptodev: Support statistics
>   cryptodev-builtin: Detect akcipher capability
>   hmp: add cryptodev info command
>   cryptodev: Use CryptoDevBackendOpInfo for operation
>   cryptodev: support QoS
>   MAINTAINERS: add myself as the maintainer for cryptodev
> 
>  MAINTAINERS                     |   2 +
>  backends/cryptodev-builtin.c    |  42 +++--
>  backends/cryptodev-lkcf.c       |  19 +-
>  backends/cryptodev-vhost-user.c |  13 +-
>  backends/cryptodev-vhost.c      |   4 +-
>  backends/cryptodev.c            | 295 +++++++++++++++++++++++++++++---
>  hmp-commands-info.hx            |  14 ++
>  hw/virtio/virtio-crypto.c       |  48 ++++--
>  include/monitor/hmp.h           |   1 +
>  include/sysemu/cryptodev.h      |  94 +++++-----
>  monitor/hmp-cmds.c              |  36 ++++
>  qapi/cryptodev.json             | 144 ++++++++++++++++
>  qapi/meson.build                |   1 +
>  qapi/qapi-schema.json           |   1 +
>  qapi/qom.json                   |   8 +-
>  15 files changed, 604 insertions(+), 118 deletions(-)
>  create mode 100644 qapi/cryptodev.json
> 
> -- 
> 2.20.1
zhenwei pi Dec. 22, 2022, 2:04 a.m. UTC | #3
On 12/20/22 23:36, Michael S. Tsirkin wrote:
> On Tue, Nov 22, 2022 at 10:07:45PM +0800, zhenwei pi wrote:
>> v1 -> v2:
>> - fix coding style and use 'g_strjoin()' instead of 'char services[128]'
>>    (suggested by Dr. David Alan Gilbert)
>> - wrapper function 'cryptodev_backend_account' to record statistics, and
>>    allocate sym_stat/asym_stat in cryptodev base class. see patch:
>>    'cryptodev: Support statistics'.
>> - add more arguments into struct CryptoDevBackendOpInfo, then
>>    cryptodev_backend_crypto_operation() uses *op_info only.
>> - support cryptodev QoS settings(BPS&OPS), both QEMU command line and QMP
>>    command works fine.
>> - add myself as the maintainer for cryptodev.
>>
>> v1:
>> - introduce cryptodev.json to describe the attributes of crypto device, then
>>    drop duplicated type declare, remove some virtio related dependence.
>> - add statistics: OPS and bandwidth.
>> - add QMP command: query-cryptodev
>> - add HMP info command: cryptodev
>> - misc fix: detect akcipher capability instead of exposing akcipher service
>>    unconditionally.
> 
> 
> Can we get ACK on QAPI things please?
> Thanks!
> 

Hi, Markus & Michael

Could you please review the changes of QAPI part?

>> Zhenwei Pi (11):
>>    cryptodev: Introduce cryptodev.json
>>    cryptodev: Remove 'name' & 'model' fields
>>    cryptodev: Introduce cryptodev alg type in QAPI
>>    cryptodev: Introduce server type in QAPI
>>    cryptodev: Introduce 'query-cryptodev' QMP command
>>    cryptodev: Support statistics
>>    cryptodev-builtin: Detect akcipher capability
>>    hmp: add cryptodev info command
>>    cryptodev: Use CryptoDevBackendOpInfo for operation
>>    cryptodev: support QoS
>>    MAINTAINERS: add myself as the maintainer for cryptodev
>>
>>   MAINTAINERS                     |   2 +
>>   backends/cryptodev-builtin.c    |  42 +++--
>>   backends/cryptodev-lkcf.c       |  19 +-
>>   backends/cryptodev-vhost-user.c |  13 +-
>>   backends/cryptodev-vhost.c      |   4 +-
>>   backends/cryptodev.c            | 295 +++++++++++++++++++++++++++++---
>>   hmp-commands-info.hx            |  14 ++
>>   hw/virtio/virtio-crypto.c       |  48 ++++--
>>   include/monitor/hmp.h           |   1 +
>>   include/sysemu/cryptodev.h      |  94 +++++-----
>>   monitor/hmp-cmds.c              |  36 ++++
>>   qapi/cryptodev.json             | 144 ++++++++++++++++
>>   qapi/meson.build                |   1 +
>>   qapi/qapi-schema.json           |   1 +
>>   qapi/qom.json                   |   8 +-
>>   15 files changed, 604 insertions(+), 118 deletions(-)
>>   create mode 100644 qapi/cryptodev.json
>>
>> -- 
>> 2.20.1
>
zhenwei pi Jan. 3, 2023, 6:14 a.m. UTC | #4
Hi, Markus & Michael

Could you please take a look at the changes of QAPI part?

On 12/22/22 10:04, zhenwei pi wrote:
> 
> 
> On 12/20/22 23:36, Michael S. Tsirkin wrote:
>> On Tue, Nov 22, 2022 at 10:07:45PM +0800, zhenwei pi wrote:
>>> v1 -> v2:
>>> - fix coding style and use 'g_strjoin()' instead of 'char services[128]'
>>>    (suggested by Dr. David Alan Gilbert)
>>> - wrapper function 'cryptodev_backend_account' to record statistics, and
>>>    allocate sym_stat/asym_stat in cryptodev base class. see patch:
>>>    'cryptodev: Support statistics'.
>>> - add more arguments into struct CryptoDevBackendOpInfo, then
>>>    cryptodev_backend_crypto_operation() uses *op_info only.
>>> - support cryptodev QoS settings(BPS&OPS), both QEMU command line and 
>>> QMP
>>>    command works fine.
>>> - add myself as the maintainer for cryptodev.
>>>
>>> v1:
>>> - introduce cryptodev.json to describe the attributes of crypto 
>>> device, then
>>>    drop duplicated type declare, remove some virtio related dependence.
>>> - add statistics: OPS and bandwidth.
>>> - add QMP command: query-cryptodev
>>> - add HMP info command: cryptodev
>>> - misc fix: detect akcipher capability instead of exposing akcipher 
>>> service
>>>    unconditionally.
>>
>>
>> Can we get ACK on QAPI things please?
>> Thanks!
>>
> 
> Hi, Markus & Michael
> 
> Could you please review the changes of QAPI part?
> 
>>> Zhenwei Pi (11):
>>>    cryptodev: Introduce cryptodev.json
>>>    cryptodev: Remove 'name' & 'model' fields
>>>    cryptodev: Introduce cryptodev alg type in QAPI
>>>    cryptodev: Introduce server type in QAPI
>>>    cryptodev: Introduce 'query-cryptodev' QMP command
>>>    cryptodev: Support statistics
>>>    cryptodev-builtin: Detect akcipher capability
>>>    hmp: add cryptodev info command
>>>    cryptodev: Use CryptoDevBackendOpInfo for operation
>>>    cryptodev: support QoS
>>>    MAINTAINERS: add myself as the maintainer for cryptodev
>>>
>>>   MAINTAINERS                     |   2 +
>>>   backends/cryptodev-builtin.c    |  42 +++--
>>>   backends/cryptodev-lkcf.c       |  19 +-
>>>   backends/cryptodev-vhost-user.c |  13 +-
>>>   backends/cryptodev-vhost.c      |   4 +-
>>>   backends/cryptodev.c            | 295 +++++++++++++++++++++++++++++---
>>>   hmp-commands-info.hx            |  14 ++
>>>   hw/virtio/virtio-crypto.c       |  48 ++++--
>>>   include/monitor/hmp.h           |   1 +
>>>   include/sysemu/cryptodev.h      |  94 +++++-----
>>>   monitor/hmp-cmds.c              |  36 ++++
>>>   qapi/cryptodev.json             | 144 ++++++++++++++++
>>>   qapi/meson.build                |   1 +
>>>   qapi/qapi-schema.json           |   1 +
>>>   qapi/qom.json                   |   8 +-
>>>   15 files changed, 604 insertions(+), 118 deletions(-)
>>>   create mode 100644 qapi/cryptodev.json
>>>
>>> -- 
>>> 2.20.1
>>
>
zhenwei pi Jan. 16, 2023, 9:53 a.m. UTC | #5
On 12/20/22 23:36, Michael S. Tsirkin wrote:
> On Tue, Nov 22, 2022 at 10:07:45PM +0800, zhenwei pi wrote:
>> v1 -> v2:
>> - fix coding style and use 'g_strjoin()' instead of 'char services[128]'
>>    (suggested by Dr. David Alan Gilbert)
>> - wrapper function 'cryptodev_backend_account' to record statistics, and
>>    allocate sym_stat/asym_stat in cryptodev base class. see patch:
>>    'cryptodev: Support statistics'.
>> - add more arguments into struct CryptoDevBackendOpInfo, then
>>    cryptodev_backend_crypto_operation() uses *op_info only.
>> - support cryptodev QoS settings(BPS&OPS), both QEMU command line and QMP
>>    command works fine.
>> - add myself as the maintainer for cryptodev.
>>
>> v1:
>> - introduce cryptodev.json to describe the attributes of crypto device, then
>>    drop duplicated type declare, remove some virtio related dependence.
>> - add statistics: OPS and bandwidth.
>> - add QMP command: query-cryptodev
>> - add HMP info command: cryptodev
>> - misc fix: detect akcipher capability instead of exposing akcipher service
>>    unconditionally.
> 
> 
> Can we get ACK on QAPI things please?
> Thanks!
> 

Hi Michael

I pinged QAPI maintainers, but I got no ACK.
Could you please have a glance at this?

>> Zhenwei Pi (11):
>>    cryptodev: Introduce cryptodev.json
>>    cryptodev: Remove 'name' & 'model' fields
>>    cryptodev: Introduce cryptodev alg type in QAPI
>>    cryptodev: Introduce server type in QAPI
>>    cryptodev: Introduce 'query-cryptodev' QMP command
>>    cryptodev: Support statistics
>>    cryptodev-builtin: Detect akcipher capability
>>    hmp: add cryptodev info command
>>    cryptodev: Use CryptoDevBackendOpInfo for operation
>>    cryptodev: support QoS
>>    MAINTAINERS: add myself as the maintainer for cryptodev
>>
>>   MAINTAINERS                     |   2 +
>>   backends/cryptodev-builtin.c    |  42 +++--
>>   backends/cryptodev-lkcf.c       |  19 +-
>>   backends/cryptodev-vhost-user.c |  13 +-
>>   backends/cryptodev-vhost.c      |   4 +-
>>   backends/cryptodev.c            | 295 +++++++++++++++++++++++++++++---
>>   hmp-commands-info.hx            |  14 ++
>>   hw/virtio/virtio-crypto.c       |  48 ++++--
>>   include/monitor/hmp.h           |   1 +
>>   include/sysemu/cryptodev.h      |  94 +++++-----
>>   monitor/hmp-cmds.c              |  36 ++++
>>   qapi/cryptodev.json             | 144 ++++++++++++++++
>>   qapi/meson.build                |   1 +
>>   qapi/qapi-schema.json           |   1 +
>>   qapi/qom.json                   |   8 +-
>>   15 files changed, 604 insertions(+), 118 deletions(-)
>>   create mode 100644 qapi/cryptodev.json
>>
>> -- 
>> 2.20.1
>
Daniel P. Berrangé Jan. 16, 2023, 11:27 a.m. UTC | #6
On Mon, Jan 16, 2023 at 05:53:07PM +0800, zhenwei pi wrote:
> On 12/20/22 23:36, Michael S. Tsirkin wrote:
> > On Tue, Nov 22, 2022 at 10:07:45PM +0800, zhenwei pi wrote:
> > > v1 -> v2:
> > > - fix coding style and use 'g_strjoin()' instead of 'char services[128]'
> > >    (suggested by Dr. David Alan Gilbert)
> > > - wrapper function 'cryptodev_backend_account' to record statistics, and
> > >    allocate sym_stat/asym_stat in cryptodev base class. see patch:
> > >    'cryptodev: Support statistics'.
> > > - add more arguments into struct CryptoDevBackendOpInfo, then
> > >    cryptodev_backend_crypto_operation() uses *op_info only.
> > > - support cryptodev QoS settings(BPS&OPS), both QEMU command line and QMP
> > >    command works fine.
> > > - add myself as the maintainer for cryptodev.
> > > 
> > > v1:
> > > - introduce cryptodev.json to describe the attributes of crypto device, then
> > >    drop duplicated type declare, remove some virtio related dependence.
> > > - add statistics: OPS and bandwidth.
> > > - add QMP command: query-cryptodev
> > > - add HMP info command: cryptodev
> > > - misc fix: detect akcipher capability instead of exposing akcipher service
> > >    unconditionally.
> > 
> > 
> > Can we get ACK on QAPI things please?
> > Thanks!
> > 
> 
> Hi Michael
> 
> I pinged QAPI maintainers, but I got no ACK.
> Could you please have a glance at this?

I am /not/ a  QAPI maintainer, but I've given some review of the patches
that touch QAPI.

With regards,
Daniel
zhenwei pi Jan. 17, 2023, 1:52 a.m. UTC | #7
On 1/16/23 19:27, Daniel P. Berrangé wrote:
> On Mon, Jan 16, 2023 at 05:53:07PM +0800, zhenwei pi wrote:
>> On 12/20/22 23:36, Michael S. Tsirkin wrote:
>>> On Tue, Nov 22, 2022 at 10:07:45PM +0800, zhenwei pi wrote:
>>>> v1 -> v2:
>>>> - fix coding style and use 'g_strjoin()' instead of 'char services[128]'
>>>>     (suggested by Dr. David Alan Gilbert)
>>>> - wrapper function 'cryptodev_backend_account' to record statistics, and
>>>>     allocate sym_stat/asym_stat in cryptodev base class. see patch:
>>>>     'cryptodev: Support statistics'.
>>>> - add more arguments into struct CryptoDevBackendOpInfo, then
>>>>     cryptodev_backend_crypto_operation() uses *op_info only.
>>>> - support cryptodev QoS settings(BPS&OPS), both QEMU command line and QMP
>>>>     command works fine.
>>>> - add myself as the maintainer for cryptodev.
>>>>
>>>> v1:
>>>> - introduce cryptodev.json to describe the attributes of crypto device, then
>>>>     drop duplicated type declare, remove some virtio related dependence.
>>>> - add statistics: OPS and bandwidth.
>>>> - add QMP command: query-cryptodev
>>>> - add HMP info command: cryptodev
>>>> - misc fix: detect akcipher capability instead of exposing akcipher service
>>>>     unconditionally.
>>>
>>>
>>> Can we get ACK on QAPI things please?
>>> Thanks!
>>>
>>
>> Hi Michael
>>
>> I pinged QAPI maintainers, but I got no ACK.
>> Could you please have a glance at this?
> 
> I am /not/ a  QAPI maintainer, but I've given some review of the patches
> that touch QAPI.
> 

A million thanks to you!

> With regards,
> Daniel