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 D421346048; Fri, 10 Jan 2025 10:56:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BEE734278A; Fri, 10 Jan 2025 10:56:31 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 447F842788 for ; Fri, 10 Jan 2025 10:56:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736502989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=kRoGc3O0IeZHMwsFCbzmEwkualKP71HQTD5J4CEEJlw=; b=C0EnUb/kBnS2GYiz2ipYm83nr2DJl14UVbQQ54w7cplWPGC6u6KbcACwVZC3XBubqevxsM oUUsPVaeqO9fwmDMxtq14vppP50/5pOJpUjk3n01CrYQcPUncHEZ0lLkiBpjpec4QgWLw7 tAOxkyig02Ab1ZMZ0xLsnx8qj87K9IU= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-458-nXL3lLvlMoucxLddpvUT_Q-1; Fri, 10 Jan 2025 04:56:26 -0500 X-MC-Unique: nXL3lLvlMoucxLddpvUT_Q-1 X-Mimecast-MFC-AGG-ID: nXL3lLvlMoucxLddpvUT_Q Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-3862e986d17so761287f8f.3 for ; Fri, 10 Jan 2025 01:56:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736502985; x=1737107785; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=kRoGc3O0IeZHMwsFCbzmEwkualKP71HQTD5J4CEEJlw=; b=KdOYlCPViSlDl6Ry6exw8nWtva/gvAVnnQ/UfchjAY8BXi3/hAeSXRnexxWpPmG/Ng oijqhe57HuTM7P2+2XxeIhKECWs5W+KuAUk3LwJSAsUAJl3pp2i3LgEEaL7ysXn26Aut t3NLiou4ju5jfWr22/ErXvxHBPuCg4Rc5265+KtYYRm+mbduy1b4zlBxD/vW/P9SzRNO RoP+epc/7mQ6+aOg0CG/KzRmFhrSimBKnXBONacbWFM9GVeBuGXil2sianZ6YXFg7CXp XzUys0ayIJJUxnf1gh5/rKLpig4Ko83swLV3/Bx9AvISUFbmd7PrZkvLNvEAK8Nl8Q/q DTUA== X-Forwarded-Encrypted: i=1; AJvYcCVzX9ABjDUjUTwY0ymgd2l6nMioLeudqGic8JgbkO9rwEr60p78iOx6b2y2LLxAWEk7ewU=@dpdk.org X-Gm-Message-State: AOJu0Yx1q9QcuQn8i+N+waSMQ6Hs/hmk94RY7kJysV4Hj8oiRvfoWY0S b1Q+//gzAHRTTy14lc39gHpU9/c0uTTTMYLFRBbxih+G9p/hNwLoJtO6/Hy9mYxsKiXviZ7nXW+ q2ShAgFyRdT59qsnIAqIT68p5SAjRLZ3BkFRDmL1Y X-Gm-Gg: ASbGncsEhWP9qylEieh2dfCRFKg25dwn6NpNNk9aQtGBz7QCUj3d4RbTaJZa1lcXMnK cA2LjEMiRGCNyF8NArIRLGNWvCSZabKBAu3F3/IIn2wklp+KS2NgteHbpJNG+75BAcgU8KLpLit wGhAE+hUseugzqEHgyqJ+R1g9TZMQbLXpsmAqWUVDx/0udEwr80gyHMefTu/p6kGXmMU/qL5lOC wsAAe10Yx0RiyiONuKfj2bqSn3xEgyukCrCbDSU5wfS87a3NceOnr1kDCo= X-Received: by 2002:a5d:6d87:0:b0:385:ef2f:92ad with SMTP id ffacd0b85a97d-38a872f7f80mr8827850f8f.10.1736502985189; Fri, 10 Jan 2025 01:56:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IEsEWqaKg6NcfsEjBFiQGEQ1Uuu4iQzr077vLKjFfukTxuv0Dg+QKvgKescnLKjSxW6DLL1Xg== X-Received: by 2002:a5d:6d87:0:b0:385:ef2f:92ad with SMTP id ffacd0b85a97d-38a872f7f80mr8827832f8f.10.1736502984790; Fri, 10 Jan 2025 01:56:24 -0800 (PST) Received: from [192.168.0.36] ([78.16.250.229]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2dc0bb7sm80676845e9.16.2025.01.10.01.56.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Jan 2025 01:56:24 -0800 (PST) Message-ID: <781698ea-2527-4500-88a5-46a9ef1828ef@redhat.com> Date: Fri, 10 Jan 2025 09:56:23 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird 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, i.maximets@ovn.org Cc: stable@dpdk.org References: <20250109143130.3696613-1-maxime.coquelin@redhat.com> From: Kevin Traynor Autocrypt: addr=ktraynor@redhat.com; keydata= xsFNBF2J2awBEADUEPNhgNI+nJNgiTAUcw4YIgVXEoHlsNPyyzG1BEXkWXALy0Y3fNTiw6+r ltWDkF9jzL9kfkecgQ67itGfk1OaBXgSGKuw1PUpxAwX2Bi76LAR6M5OsyGM9TSVVQwARalz hMwRBIZPzPc7or6Pw7jAOJ8SQGJ1Zlp1YJCjrvpe87V1tH/LY8Wnxn/EuoseFmWILAQZAtYS tGjcrAgYn3SPMLR1B0BP5bTBY06vWQjiufH8drenfDnMJAzuBdG1mqjnTqCjULZ3Hunv4xqZ aMnkvL/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czonSSgTQU+i2g6DM4ha+BuQb4byAXH6HQHt/Zh1J64z0ohH v6iGsCzCY/sMWF8+LEGSnzMGRCLiiwSF0vJBHbzWK68fANaF4gBV0Z/+6tQRFN7YMhj/INmk qgvHj1ZzHFNtirjMGPRxoZs51YoLQM/aBPxKrnmXThx1ufH+0L6sGmFTugiDt0XSEkC5reH7 a+VhQ1VTFFQrClA8NmDSPzFeuhru4ryaaDHO+uEB16cNHxHrQtlP/2hts2JM5lwkZRWJ5A57 h8eDEIK5be47T85NVHfuTaboNRmgg1HygVejhGUtt69u/0MVRg/roUTa0FyEbNsvz4qAecyW yWzMcVrcGJDQLC9JLKEpoyUF6gdTKaiDL2Vao4+XRIA3Y57b6MO35a3HuzAv7+i5Z0mnDEJO XxXqTOmKYpMIGexzM/PtuA0712sT1abG9tAJ17ao/B7cqMW5IkKkalemFbWfI2unns4Papvo tk9igVqyp6EJDU98z5TJioCVojwK2laDaoIjTJk9YYv3iwCsqPd5feU= In-Reply-To: <20250109143130.3696613-1-maxime.coquelin@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: cmNnt5m3YUtprbYsrrP5uE2uwEh5l-lqNRaJm9thQJ8_1736502985 X-Mimecast-Originator: redhat.com Content-Language: en-US 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 09/01/2025 14: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 > --- > lib/vhost/socket.c | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > Thanks, this will make it easier for vhost-user users. One nit below, Acked-by: Kevin Traynor > 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; > - } > you can remove the extra blank line here > 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: