All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Cindy Lu <lulu@redhat.com>
Cc: virtualization <virtualization@lists.linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>, mst <mst@redhat.com>
Subject: Re: [PATCH v2 2/2] vdpa/vp_vdpa : add vdpa tool support in vp_vdpa
Date: Tue, 26 Apr 2022 14:05:21 +0800	[thread overview]
Message-ID: <CACGkMEtGZqoei6i=LmVrTgNfWM4SpxjQH-8j7BP=EoFO=iqeYw@mail.gmail.com> (raw)
In-Reply-To: <20220425062735.172576-2-lulu@redhat.com>

On Mon, Apr 25, 2022 at 2:27 PM Cindy Lu <lulu@redhat.com> wrote:
>
> this patch is to add the support for vdpa tool in vp_vdpa
> here is the example steps
>
> modprobe vp_vdpa
> modprobe vhost_vdpa
> echo 0000:00:06.0>/sys/bus/pci/drivers/virtio-pci/unbind
> echo 1af4 1041 > /sys/bus/pci/drivers/vp-vdpa/new_id
>
> vdpa dev add name vdpa1 mgmtdev pci/0000:00:06.0
>
> Signed-off-by: Cindy Lu <lulu@redhat.com>
> ---
>  drivers/vdpa/virtio_pci/vp_vdpa.c | 138 +++++++++++++++++++++++-------
>  1 file changed, 106 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/vdpa/virtio_pci/vp_vdpa.c b/drivers/vdpa/virtio_pci/vp_vdpa.c
> index cce101e6a940..873402977543 100644
> --- a/drivers/vdpa/virtio_pci/vp_vdpa.c
> +++ b/drivers/vdpa/virtio_pci/vp_vdpa.c
> @@ -32,7 +32,8 @@ struct vp_vring {
>
>  struct vp_vdpa {
>         struct vdpa_device vdpa;
> -       struct virtio_pci_modern_device mdev;
> +       /* this is an pointer point to the mdev in vp_vdpa_mgmtdev*/
> +       struct virtio_pci_modern_device *mdev;

The code can explain itself, so the comment is redundant.

>         struct vp_vring *vring;
>         struct vdpa_callback config_cb;
>         char msix_name[VP_VDPA_NAME_SIZE];
> @@ -41,6 +42,12 @@ struct vp_vdpa {
>         int vectors;
>  };
>
> +struct vp_vdpa_mgmtdev {
> +       struct vdpa_mgmt_dev mgtdev;
> +       struct virtio_pci_modern_device mdev;

I think coupling it with mgmt device is probably not good, any reason
we can't allocate it independently?

Thanks

> +       struct vp_vdpa *vp_vdpa;
> +};

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

WARNING: multiple messages have this Message-ID (diff)
From: Jason Wang <jasowang@redhat.com>
To: Cindy Lu <lulu@redhat.com>
Cc: mst <mst@redhat.com>,
	virtualization <virtualization@lists.linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] vdpa/vp_vdpa : add vdpa tool support in vp_vdpa
Date: Tue, 26 Apr 2022 14:05:21 +0800	[thread overview]
Message-ID: <CACGkMEtGZqoei6i=LmVrTgNfWM4SpxjQH-8j7BP=EoFO=iqeYw@mail.gmail.com> (raw)
In-Reply-To: <20220425062735.172576-2-lulu@redhat.com>

On Mon, Apr 25, 2022 at 2:27 PM Cindy Lu <lulu@redhat.com> wrote:
>
> this patch is to add the support for vdpa tool in vp_vdpa
> here is the example steps
>
> modprobe vp_vdpa
> modprobe vhost_vdpa
> echo 0000:00:06.0>/sys/bus/pci/drivers/virtio-pci/unbind
> echo 1af4 1041 > /sys/bus/pci/drivers/vp-vdpa/new_id
>
> vdpa dev add name vdpa1 mgmtdev pci/0000:00:06.0
>
> Signed-off-by: Cindy Lu <lulu@redhat.com>
> ---
>  drivers/vdpa/virtio_pci/vp_vdpa.c | 138 +++++++++++++++++++++++-------
>  1 file changed, 106 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/vdpa/virtio_pci/vp_vdpa.c b/drivers/vdpa/virtio_pci/vp_vdpa.c
> index cce101e6a940..873402977543 100644
> --- a/drivers/vdpa/virtio_pci/vp_vdpa.c
> +++ b/drivers/vdpa/virtio_pci/vp_vdpa.c
> @@ -32,7 +32,8 @@ struct vp_vring {
>
>  struct vp_vdpa {
>         struct vdpa_device vdpa;
> -       struct virtio_pci_modern_device mdev;
> +       /* this is an pointer point to the mdev in vp_vdpa_mgmtdev*/
> +       struct virtio_pci_modern_device *mdev;

The code can explain itself, so the comment is redundant.

>         struct vp_vring *vring;
>         struct vdpa_callback config_cb;
>         char msix_name[VP_VDPA_NAME_SIZE];
> @@ -41,6 +42,12 @@ struct vp_vdpa {
>         int vectors;
>  };
>
> +struct vp_vdpa_mgmtdev {
> +       struct vdpa_mgmt_dev mgtdev;
> +       struct virtio_pci_modern_device mdev;

I think coupling it with mgmt device is probably not good, any reason
we can't allocate it independently?

Thanks

> +       struct vp_vdpa *vp_vdpa;
> +};


  reply	other threads:[~2022-04-26  6:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-25  6:27 [PATCH v2 2/2] vdpa/vp_vdpa : add vdpa tool support in vp_vdpa Cindy Lu
2022-04-26  6:05 ` Jason Wang [this message]
2022-04-26  6:05   ` Jason Wang
2022-04-27  1:58   ` Cindy Lu
2022-04-27  4:05     ` Jason Wang
2022-04-27  4:05       ` Jason Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACGkMEtGZqoei6i=LmVrTgNfWM4SpxjQH-8j7BP=EoFO=iqeYw@mail.gmail.com' \
    --to=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lulu@redhat.com \
    --cc=mst@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.