From: Jason Wang <jasowang@redhat.com>
To: Eli Cohen <eli@mellanox.com>,
mst@redhat.com, virtualization@lists.linux-foundation.org,
linux-kernel@vger.kernel.org
Cc: shahafs@mellanox.com, saeedm@mellanox.com,
Parav Pandit <parav@mellanox.com>
Subject: Re: [PATCH vhost next 06/10] vdpa: Add means to communicate vq status on get_vq_state
Date: Thu, 16 Jul 2020 16:11:00 +0800 [thread overview]
Message-ID: <cb9bced7-1a7e-150a-875c-1b75f77ee853@redhat.com> (raw)
In-Reply-To: <20200716072327.5359-7-eli@mellanox.com>
On 2020/7/16 下午3:23, Eli Cohen wrote:
> Currently, get_vq_state() is used only to pass the available index value
> of a vq. Extend the struct to return status on the VQ to the caller.
> For now, define VQ_STATE_NOT_READY. In the future it will be extended to
> include other infomration.
>
> Modify current vdpa driver to update this field.
>
> Reviewed-by: Parav Pandit <parav@mellanox.com>
> Signed-off-by: Eli Cohen <eli@mellanox.com>
What's the difference between this and get_vq_ready()?
Thanks
> ---
> drivers/vdpa/ifcvf/ifcvf_main.c | 1 +
> drivers/vdpa/vdpa_sim/vdpa_sim.c | 1 +
> include/linux/vdpa.h | 9 +++++++++
> 3 files changed, 11 insertions(+)
>
> diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c
> index 69032ee97824..77e3b3d91167 100644
> --- a/drivers/vdpa/ifcvf/ifcvf_main.c
> +++ b/drivers/vdpa/ifcvf/ifcvf_main.c
> @@ -240,6 +240,7 @@ static void ifcvf_vdpa_get_vq_state(struct vdpa_device *vdpa_dev, u16 qid,
> {
> struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev);
>
> + state->state = vf->vring[qid].ready ? 0 : BIT(VQ_STATE_NOT_READY);
> state->avail_index = ifcvf_get_vq_state(vf, qid);
> }
>
> diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c
> index 599519039f8d..06d974b4bd7b 100644
> --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
> +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
> @@ -434,6 +434,7 @@ static void vdpasim_get_vq_state(struct vdpa_device *vdpa, u16 idx,
> struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx];
> struct vringh *vrh = &vq->vring;
>
> + state->state = vq->ready ? 0 : BIT(VQ_STATE_NOT_READY);
> state->avail_index = vrh->last_avail_idx;
> }
>
> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
> index 7b088bebffe8..bcefa30a3b2f 100644
> --- a/include/linux/vdpa.h
> +++ b/include/linux/vdpa.h
> @@ -27,12 +27,21 @@ struct vdpa_notification_area {
> resource_size_t size;
> };
>
> +/**
> + * Bitmask describing the status of the vq
> + */
> +enum {
> + VQ_STATE_NOT_READY = 0,
> +};
> +
> /**
> * vDPA vq_state definition
> * @avail_index: available index
> + * @state: returned status from get_vq_state
> */
> struct vdpa_vq_state {
> u16 avail_index;
> + u32 state;
> };
>
> /**
next prev parent reply other threads:[~2020-07-16 8:11 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-16 7:23 [PATCH vhost next 00/10] VDPA support for Mellanox ConnectX devices Eli Cohen
2020-07-16 7:23 ` [PATCH vhost next 01/10] vhost-vdpa: support batch updating Eli Cohen
2020-07-16 7:23 ` [PATCH vhost next 02/10] vdpa_sim: use the batching API Eli Cohen
2020-07-16 7:23 ` [PATCH vhost next 03/10] vdpa: remove hard coded virtq num Eli Cohen
2020-07-16 7:23 ` [PATCH vhost next 04/10] net/vdpa: Use struct for set/get vq state Eli Cohen
2020-07-16 7:23 ` [PATCH vhost next 05/10] vhost: Fix documentation Eli Cohen
2020-07-16 8:08 ` Jason Wang
2020-07-16 7:23 ` [PATCH vhost next 06/10] vdpa: Add means to communicate vq status on get_vq_state Eli Cohen
2020-07-16 8:11 ` Jason Wang [this message]
2020-07-16 8:21 ` Eli Cohen
2020-07-16 9:35 ` Jason Wang
2020-07-16 10:25 ` Eli Cohen
2020-07-20 4:13 ` Jason Wang
2020-07-16 7:23 ` [PATCH vhost next 07/10] vdpa/mlx5: Add hardware descriptive header file Eli Cohen
2020-07-16 7:23 ` [PATCH vhost next 08/10] vdpa/mlx5: Add support library for mlx5 VDPA implementation Eli Cohen
2020-07-16 10:44 ` kernel test robot
2020-07-16 7:23 ` [PATCH vhost next 09/10] vdpa/mlx5: Add shared memory registration code Eli Cohen
2020-07-16 8:13 ` Jason Wang
2020-07-16 8:28 ` Eli Cohen
2020-07-16 9:32 ` Jason Wang
2020-07-16 10:15 ` kernel test robot
2020-07-16 14:19 ` kernel test robot
2020-07-16 7:23 ` [PATCH vhost next 10/10] vdpa/mlx5: Add VDPA driver for supported mlx5 devices Eli Cohen
2020-07-16 9:14 ` Jason Wang
2020-07-16 11:54 ` Eli Cohen
2020-07-17 8:57 ` Jason Wang
2020-07-18 19:49 ` Eli Cohen
2020-07-20 4:12 ` Jason Wang
2020-07-20 5:19 ` Eli Cohen
2020-07-16 10:55 ` kernel test robot
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=cb9bced7-1a7e-150a-875c-1b75f77ee853@redhat.com \
--to=jasowang@redhat.com \
--cc=eli@mellanox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=parav@mellanox.com \
--cc=saeedm@mellanox.com \
--cc=shahafs@mellanox.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
all inboxes | Powered by JetHome®