lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6ee3e73b-257a-3c02-db32-e890cfacae64@redhat.com>
Date:   Mon, 16 Nov 2020 12:18:19 +0800
From:   Jason Wang <jasowang@...hat.com>
To:     Stefano Garzarella <sgarzare@...hat.com>,
        virtualization@...ts.linux-foundation.org
Cc:     Stefan Hajnoczi <stefanha@...hat.com>,
        Laurent Vivier <lvivier@...hat.com>,
        linux-kernel@...r.kernel.org, Eli Cohen <elic@...dia.com>,
        "Michael S. Tsirkin" <mst@...hat.com>,
        Max Gurtovoy <mgurtovoy@...dia.com>
Subject: Re: [PATCH RFC 07/12] vdpa_sim: move config management outside of the
 core


On 2020/11/13 下午9:47, Stefano Garzarella wrote:
> In order to simplify the code of the vdpa_sim core, we move the
> config management in each device simulator.
>
> The device must provide the size of config structure and a callback
> to update this structure called during the vdpasim_set_features().


Similarly, I suggest to do this before patch 2, then there's no need for 
the conversion of blk device.


>
> Signed-off-by: Stefano Garzarella <sgarzare@...hat.com>
> ---
>   drivers/vdpa/vdpa_sim/vdpa_sim.h     |  5 +++--
>   drivers/vdpa/vdpa_sim/vdpa_sim.c     | 29 +++++-----------------------
>   drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 27 ++++++++++++++++----------
>   drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 12 ++++++++++++
>   4 files changed, 37 insertions(+), 36 deletions(-)
>
> diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.h b/drivers/vdpa/vdpa_sim/vdpa_sim.h
> index 76e642042eb0..f7e1fe0a88d3 100644
> --- a/drivers/vdpa/vdpa_sim/vdpa_sim.h
> +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.h
> @@ -10,8 +10,6 @@
>   #include <linux/vdpa.h>
>   #include <linux/vhost_iotlb.h>
>   #include <uapi/linux/virtio_config.h>
> -#include <uapi/linux/virtio_net.h>
> -#include <uapi/linux/virtio_blk.h>
>   
>   #define DRV_VERSION  "0.1"
>   #define DRV_AUTHOR   "Jason Wang <jasowang@...hat.com>"
> @@ -42,8 +40,11 @@ struct vdpasim_virtqueue {
>   
>   struct vdpasim_device {
>   	u64 supported_features;
> +	size_t config_size;
>   	u32 id;
>   	int nvqs;
> +
> +	void (*update_config)(struct vdpasim *vdpasim);


Let's use set_config/get_config to align with virtio/vhost.

Other looks good.

Thanks


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ