patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Chenbo Xia <chenbox@nvidia.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"david.marchand@redhat.com" <david.marchand@redhat.com>,
	"ktraynor@redhat.com" <ktraynor@redhat.com>,
	"i.maximets@ovn.org" <i.maximets@ovn.org>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [PATCH] vhost: fix misleading log when setting max queue num
Date: Fri, 10 Jan 2025 09:41:09 +0000	[thread overview]
Message-ID: <16E2FFD6-6CBC-49C1-B828-28833DF590E0@nvidia.com> (raw)
In-Reply-To: <20250109143130.3696613-1-maxime.coquelin@redhat.com>

Hi Maxime,

> On Jan 9, 2025, at 22:31, Maxime Coquelin <maxime.coquelin@redhat.com> wrote:
> 
> External email: Use caution opening links or attachments
> 
> 
> rte_vhost_driver_set_max_queue_num API returns early when
> called for a Vhost-user device, as this API is intended to
> limit the maximum number of queue pairs supported by VDUSE
> devices. However, a log mentioning the maximim number of

maximum

With above fixed:

Reviewed-by: Chenbo Xia <chenbox@nvidia.com>

> queue pairs is being set is emitted unconditionally, which
> may confuse the end user.
> 
> This patch moves this log after the backend type is
> checked, so that it is only called with VDUSE backends.
> The check on the requested value is also moved at the same
> place.
> 
> Fixes: e1808999d36b ("vhost: restrict set max queue pair API to VDUSE")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
> lib/vhost/socket.c | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c
> index d29d15494c..07247907b0 100644
> --- a/lib/vhost/socket.c
> +++ b/lib/vhost/socket.c
> @@ -844,13 +844,6 @@ rte_vhost_driver_set_max_queue_num(const char *path, uint32_t max_queue_pairs)
>        struct vhost_user_socket *vsocket;
>        int ret = 0;
> 
> -       VHOST_CONFIG_LOG(path, INFO, "Setting max queue pairs to %u", max_queue_pairs);
> -
> -       if (max_queue_pairs > VHOST_MAX_QUEUE_PAIRS) {
> -               VHOST_CONFIG_LOG(path, ERR, "Library only supports up to %u queue pairs",
> -                               VHOST_MAX_QUEUE_PAIRS);
> -               return -1;
> -       }
> 
>        pthread_mutex_lock(&vhost_user.mutex);
>        vsocket = find_vhost_user_socket(path);
> @@ -872,6 +865,15 @@ rte_vhost_driver_set_max_queue_num(const char *path, uint32_t max_queue_pairs)
>                goto unlock_exit;
>        }
> 
> +       VHOST_CONFIG_LOG(path, INFO, "Setting max queue pairs to %u", max_queue_pairs);
> +
> +       if (max_queue_pairs > VHOST_MAX_QUEUE_PAIRS) {
> +               VHOST_CONFIG_LOG(path, ERR, "Library only supports up to %u queue pairs",
> +                               VHOST_MAX_QUEUE_PAIRS);
> +               ret = -1;
> +               goto unlock_exit;
> +       }
> +
>        vsocket->max_queue_pairs = max_queue_pairs;
> 
> unlock_exit:
> --
> 2.47.1
> 


  parent reply	other threads:[~2025-01-10  9:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-09 14:31 Maxime Coquelin
2025-01-09 16:35 ` Ilya Maximets
2025-01-10  9:41 ` Chenbo Xia [this message]
2025-01-10  9:56 ` Kevin Traynor

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=16E2FFD6-6CBC-49C1-B828-28833DF590E0@nvidia.com \
    --to=chenbox@nvidia.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=i.maximets@ovn.org \
    --cc=ktraynor@redhat.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.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).