linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Si-Wei Liu <si-wei.liu@oracle.com>
Cc: mst@redhat.com, parav@nvidia.com,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/4] vdpa: save vdpa_dev_set_config in struct vdpa_device
Date: Mon, 24 Oct 2022 16:43:40 +0800	[thread overview]
Message-ID: <CACGkMEt-TiJ6LQczo4fY_eY9jWdDGVt_ZNXM8Eq3qkbNvLJmUA@mail.gmail.com> (raw)
In-Reply-To: <1666392237-4042-2-git-send-email-si-wei.liu@oracle.com>

On Sat, Oct 22, 2022 at 7:49 AM Si-Wei Liu <si-wei.liu@oracle.com> wrote:
>
> In order to allow live migration orchestration software to export the
> initial set of vdpa attributes with which the device was created, it
> will be useful if the vdpa tool can report the config on demand with
> simple query. This will ease the orchestration software implementation
> so that it doesn't have to keep track of vdpa config change, or have
> to persist vdpa attributes across failure and recovery, in fear of
> being killed due to accidental software error.
>
> This commit attempts to make struct vdpa_device contain the struct
> vdpa_dev_set_config, where all config attributes upon vdpa creation
> are carried over. Which will be used in subsequent commits.
>
> Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com>

Acked-by: Jason Wang <jasowang@redhat.com>


> ---
>  include/linux/vdpa.h | 23 +++++++++++++----------
>  1 file changed, 13 insertions(+), 10 deletions(-)
>
> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
> index 6d0f5e4..9f519a3 100644
> --- a/include/linux/vdpa.h
> +++ b/include/linux/vdpa.h
> @@ -58,6 +58,16 @@ struct vdpa_vq_state {
>         };
>  };
>
> +struct vdpa_dev_set_config {
> +       u64 device_features;
> +       struct {
> +               u8 mac[ETH_ALEN];
> +               u16 mtu;
> +               u16 max_vq_pairs;
> +       } net;
> +       u64 mask;
> +};
> +
>  struct vdpa_mgmt_dev;
>
>  /**
> @@ -77,6 +87,8 @@ struct vdpa_vq_state {
>   * @nvqs: maximum number of supported virtqueues
>   * @mdev: management device pointer; caller must setup when registering device as part
>   *       of dev_add() mgmtdev ops callback before invoking _vdpa_register_device().
> + * @init_cfg: initial device config on vdpa creation; useful when instantiating
> + *            device with identical config is needed, e.g. migration.
>   */
>  struct vdpa_device {
>         struct device dev;
> @@ -91,6 +103,7 @@ struct vdpa_device {
>         struct vdpa_mgmt_dev *mdev;
>         unsigned int ngroups;
>         unsigned int nas;
> +       struct vdpa_dev_set_config init_cfg;
>  };
>
>  /**
> @@ -103,16 +116,6 @@ struct vdpa_iova_range {
>         u64 last;
>  };
>
> -struct vdpa_dev_set_config {
> -       u64 device_features;
> -       struct {
> -               u8 mac[ETH_ALEN];
> -               u16 mtu;
> -               u16 max_vq_pairs;
> -       } net;
> -       u64 mask;
> -};
> -
>  /**
>   * Corresponding file area for device memory mapping
>   * @file: vma->vm_file for the mapping
> --
> 1.8.3.1
>


  reply	other threads:[~2022-10-24  8:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-21 22:43 [PATCH v3 0/4] vDPA: initial config export via "vdpa dev show" Si-Wei Liu
2022-10-21 22:43 ` [PATCH v3 1/4] vdpa: save vdpa_dev_set_config in struct vdpa_device Si-Wei Liu
2022-10-24  8:43   ` Jason Wang [this message]
2022-10-21 22:43 ` [PATCH v3 2/4] vdpa: pass initial config to _vdpa_register_device() Si-Wei Liu
2022-10-21 22:43 ` [PATCH v3 3/4] vdpa: show dev config as-is in "vdpa dev show" output Si-Wei Liu
2022-10-24  8:40   ` Jason Wang
2022-10-24 19:14     ` Si-Wei Liu
2022-10-25  2:24       ` Jason Wang
     [not found]         ` <25a18d7a-ebae-3647-32f0-14ad733118be@oracle.com>
2022-10-26  4:44           ` Jason Wang
2022-10-27  6:31             ` Si-Wei Liu
2022-10-27  8:47               ` Jason Wang
2022-10-28 23:23                 ` Si-Wei Liu
2022-10-30 13:36                   ` Eli Cohen
2022-12-19  6:31                   ` Michael S. Tsirkin
2022-12-21  0:14                     ` Si-Wei Liu
2022-12-20  7:58                   ` Jason Wang
2022-10-21 22:43 ` [PATCH v3 4/4] vdpa: fix improper error message when adding vdpa dev Si-Wei Liu
2022-10-24  8:43   ` Jason Wang
2023-01-27  8:16 ` [PATCH v3 0/4] vDPA: initial config export via "vdpa dev show" Michael S. Tsirkin
2023-01-30 21:05   ` Si-Wei Liu
2023-01-30 21:59     ` Si-Wei Liu

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=CACGkMEt-TiJ6LQczo4fY_eY9jWdDGVt_ZNXM8Eq3qkbNvLJmUA@mail.gmail.com \
    --to=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=parav@nvidia.com \
    --cc=si-wei.liu@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).