DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Miao Li <miao.li@intel.com>, dev@dpdk.org
Cc: chenbo.xia@intel.com
Subject: Re: [PATCH v1] net/vhost: add queue status check
Date: Tue, 16 Nov 2021 10:34:06 +0100	[thread overview]
Message-ID: <3076b24c-0347-c0cf-3384-aecf4f76773b@redhat.com> (raw)
In-Reply-To: <20211116164446.149453-1-miao.li@intel.com>



On 11/16/21 17:44, Miao Li wrote:
> This patch adds queue status check to make sure that vhost monitor
> address will not be got until the link between backend and frontend
s/got/gone/?
> up and the packets are allowed to be queued.

It needs a fixes tag.

> Signed-off-by: Miao Li <miao.li@intel.com>
> ---
>   drivers/net/vhost/rte_eth_vhost.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
> index 070f0e6dfd..9d600054d8 100644
> --- a/drivers/net/vhost/rte_eth_vhost.c
> +++ b/drivers/net/vhost/rte_eth_vhost.c
> @@ -1415,6 +1415,8 @@ vhost_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc)
>   	int ret;
>   	if (vq == NULL)
>   		return -EINVAL;
> +	if (unlikely(rte_atomic32_read(&vq->allow_queuing) == 0))
> +		return -EINVAL;

How does it help?
What does prevent allow_queuing to become zero between the check and the
call to rte_vhost_get_monitor_addr?

I think you need to implement the same logic as in eth_vhost_rx(), i.e.
check allow_queueing, set while_queueing, check allow_queueing, do your
stuff and clear while_queuing.

>   	ret = rte_vhost_get_monitor_addr(vq->vid, vq->virtqueue_id,
>   			&vhost_pmc);
>   	if (ret < 0)
> 

Maxime


  reply	other threads:[~2021-11-16  9:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-16 16:44 Miao Li
2021-11-16  9:34 ` Maxime Coquelin [this message]
2021-11-16  9:36   ` Maxime Coquelin
2021-11-19  6:30     ` Li, Miao
2022-01-31  8:36       ` Maxime Coquelin

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=3076b24c-0347-c0cf-3384-aecf4f76773b@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=miao.li@intel.com \
    /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).