From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 430024602F; Thu, 9 Jan 2025 17:35:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9744940EE2; Thu, 9 Jan 2025 17:35:07 +0100 (CET) Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) by mails.dpdk.org (Postfix) with ESMTP id 9F43840430; Thu, 9 Jan 2025 17:35:05 +0100 (CET) Received: by mail-ed1-f66.google.com with SMTP id 4fb4d7f45d1cf-5d414b8af7bso1855942a12.0; Thu, 09 Jan 2025 08:35:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736440505; x=1737045305; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:to:subject:cc:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=/eLwHko0Prc5lKff7QJnW8Y9Xcg6IwCa4JV0bpN/CnY=; b=gDSLr53v+h1oG8qOadmUyuRgfAS+mG95MXUSMh78HSdLSEVpgORJ+pj0cf6rJ+HgYr cuJiRnrCaSiIx8taUw4H0gKvOMTvipy6cGtyQKBvrnZwp2FxHa/gyRBaYBjHjytIzeCG l19fa+VK2HBls2hJ6Md0O8Dh7lIlCAy8sBKcP9nsY1uciyq10Ha7+jqLn6Hq50o0fnCU bTKi0eUyPCNMNbQY9gM7B8YrYbHsR6FwGxLMl1q39AddWqsrkRjQQTHGkMpd/4vVgCdH auoLNgR7iPzj4MGJDsvZvNWnxT3jOTt/Wd0oCON1XQ+u0QM/vb+G4d1CWJ92CF0jPY7A PzOQ== X-Forwarded-Encrypted: i=1; AJvYcCUratrP0xSf3vqr+jPfPUAeBFcIf9O6beCmFLf3LZyMcvII8ty8rpV7UF8s+S9Rt8YIsPU=@dpdk.org, AJvYcCWAjSz3tUXFC/3SlkA3uiuLXpHkAZlZerj2t+/9MNBmFrzTHHH9G88uhmlYYMwlN61idcEvQ/rQ@dpdk.org X-Gm-Message-State: AOJu0YwxHY/1kVlVmHv9NyPJfxGigaz7jXum2KWkLxwMpeg+PtSi5tk8 YowAglmt97/ClHFbRqSNHviLDQjXcI2VsGH6qfM5g1CUVBFItsax X-Gm-Gg: ASbGncsDdyw2Jxz2xAZPMfnGkrNVR/4m7e2cwhOJTHSFag/D+0Hw9iTHQlKZaENiz51 VGeWFXKx2v4YC15FTo/qsaJz9CPKGq3AF8Kz2h1p0g7JKGiaW+E0rvclqxPYzn1BzKjsSxSB5eH TiCEUSb9f5QpLVrXM8OJPr9ajJ45TP2VJFdXqA79Gkz9zhvI4dPn0/h5Fk49kIE7pY28747ASgF ZUyfPVt/1iCmsqoy8dHTfNXXJPf+1nc524VDHW75OP9t6Mm6iYolJlG7HOMaNXB4nH0RuMDMsrW kNlR38akHeg9 X-Google-Smtp-Source: AGHT+IHVY4arhqVhsoK6x2lkRXD7TEpcA7g/bM0Y3/ND92JccuvGqfKwb3LxKFhJ7rPP97V0l9TN3Q== X-Received: by 2002:a05:6402:50d4:b0:5d3:ba42:e9f4 with SMTP id 4fb4d7f45d1cf-5d972e554f4mr6792679a12.23.1736440504897; Thu, 09 Jan 2025 08:35:04 -0800 (PST) Received: from [192.168.0.13] (ip-86-49-44-151.bb.vodafone.cz. [86.49.44.151]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d9904a411csm755918a12.72.2025.01.09.08.35.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Jan 2025 08:35:04 -0800 (PST) Message-ID: Date: Thu, 9 Jan 2025 17:35:03 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: i.maximets@ovn.org, stable@dpdk.org Subject: Re: [PATCH] vhost: fix misleading log when setting max queue num To: Maxime Coquelin , dev@dpdk.org, chenbox@nvidia.com, david.marchand@redhat.com, ktraynor@redhat.com References: <20250109143130.3696613-1-maxime.coquelin@redhat.com> Content-Language: en-US From: Ilya Maximets Autocrypt: addr=i.maximets@ovn.org; keydata= xsFNBF77bOMBEADVZQ4iajIECGfH3hpQMQjhIQlyKX4hIB3OccKl5XvB/JqVPJWuZQRuqNQG /B70MP6km95KnWLZ4H1/5YOJK2l7VN7nO+tyF+I+srcKq8Ai6S3vyiP9zPCrZkYvhqChNOCF pNqdWBEmTvLZeVPmfdrjmzCLXVLi5De9HpIZQFg/Ztgj1AZENNQjYjtDdObMHuJQNJ6ubPIW cvOOn4WBr8NsP4a2OuHSTdVyAJwcDhu+WrS/Bj3KlQXIdPv3Zm5x9u/56NmCn1tSkLrEgi0i /nJNeH5QhPdYGtNzPixKgPmCKz54/LDxU61AmBvyRve+U80ukS+5vWk8zvnCGvL0ms7kx5sA tETpbKEV3d7CB3sQEym8B8gl0Ux9KzGp5lbhxxO995KWzZWWokVUcevGBKsAx4a/C0wTVOpP FbQsq6xEpTKBZwlCpxyJi3/PbZQJ95T8Uw6tlJkPmNx8CasiqNy2872gD1nN/WOP8m+cIQNu o6NOiz6VzNcowhEihE8Nkw9V+zfCxC8SzSBuYCiVX6FpgKzY/Tx+v2uO4f/8FoZj2trzXdLk BaIiyqnE0mtmTQE8jRa29qdh+s5DNArYAchJdeKuLQYnxy+9U1SMMzJoNUX5uRy6/3KrMoC/ 7zhn44x77gSoe7XVM6mr/mK+ViVB7v9JfqlZuiHDkJnS3yxKPwARAQABzSJJbHlhIE1heGlt ZXRzIDxpLm1heGltZXRzQG92bi5vcmc+wsGUBBMBCAA+AhsDBQsJCAcCBhUKCQgLAgQWAgMB Ah4BAheAFiEEh+ma1RKWrHCY821auffsd8gpv5YFAmP+Y/MFCQjFXhAACgkQuffsd8gpv5Yg OA//eEakvE7xTHNIMdLW5r3XnWSEY44dFDEWTLnS7FbZLLHxPNFXN0GSAA8ZsJ3fE26O5Pxe EEFTf7R/W6hHcSXN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HceAmPWVCq3WrFuX9dSlgf3RWTqNiWZC0a8Hn6fNDp26TzLbdo9mnxbU4I/3BbcAJZI9p 9ELaE9rw3LU8esKqRIfaZqPtrdm1C+e5gZa2gkmEzG+WEsS0MKtJyOFnuglGl1ZBxR1uFvbU VXhewCNoviXxkkPk/DanIgYB1nUtkPC+BHkJJYCyf9Kfl33s/bai34aaxkGXqpKv+CInARg3 fCikcHzYYWKaXS6HABEBAAHCwXwEGAEIACYCGwwWIQSH6ZrVEpascJjzbVq59+x3yCm/lgUC Y/5kJAUJCMVeQQAKCRC59+x3yCm/lpF7D/9Lolx00uxqXz2vt/u9flvQvLsOWa+UBmWPGX9u oWhQ26GjtbVvIf6SECcnNWlu/y+MHhmYkz+h2VLhWYVGJ0q03XkktFCNwUvHp3bTXG3IcPIC eDJUVMMIHXFp7TcuRJhrGqnlzqKverlY6+2CqtCpGMEmPVahMDGunwqFfG65QubZySCHVYvX T9SNga0Ay/L71+eVwcuGChGyxEWhVkpMVK5cSWVzZe7C+gb6N1aTNrhu2dhpgcwe1Xsg4dYv dYzTNu19FRpfc+nVRdVnOto8won1SHGgYSVJA+QPv1x8lMYqKESOHAFE/DJJKU8MRkCeSfqs izFVqTxTk3VXOCMUR4t2cbZ9E7Qb/ZZigmmSgilSrOPgDO5TtT811SzheAN0PvgT+L1Gsztc Q3BvfofFv3OLF778JyVfpXRHsn9rFqxG/QYWMqJWi+vdPJ5RhDl1QUEFyH7ok/ZY60/85FW3 o9OQwoMf2+pKNG3J+EMuU4g4ZHGzxI0isyww7PpEHx6sxFEvMhsOp7qnjPsQUcnGIIiqKlTj H7i86580VndsKrRK99zJrm4s9Tg/7OFP1SpVvNvSM4TRXSzVF25WVfLgeloN1yHC5Wsqk33X XNtNovqA0TLFjhfyyetBsIOgpGakgBNieC9GnY7tC3AG+BqG5jnVuGqSTO+iM/d+lsoa+w== In-Reply-To: <20250109143130.3696613-1-maxime.coquelin@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 1/9/25 15:31, Maxime Coquelin wrote: > 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 > 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 > --- Thanks, Maxime! This makes the logs way less confusing. Reviewed-by: Ilya Maximets > 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: