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 18D1246048; Fri, 10 Jan 2025 10:41:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AB5F141148; Fri, 10 Jan 2025 10:41:14 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2050.outbound.protection.outlook.com [40.107.220.50]) by mails.dpdk.org (Postfix) with ESMTP id 01CFA40648; Fri, 10 Jan 2025 10:41:13 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=A/onhlacXI5wAA0kEQSj8Pj8fpEvbFK0Y1wNm3vMdUMt0g/D3y5yZW118mmPZkyHmHFQ2f5tTfQzE8TMUiEXvlWwXa+SmTW9jP3XFKKPoYtlg/8uGOpM3n0xBzxIwfeD5Spu3Mydcm53YnFsk4oPeITcZaROYqvs+ooV82xkAGMspwrgmFv2WfHNKtc+S83twmk26Arx00ECtda8mG/bPN5odmiuMmw+azlW5HoHnENJnm9cZ8sAhuv9oTAjP1jos7xQ2kwCEEA+WmpzBH3l0N1Qv1cFgK07Q6Mk6TKwDydMtdBgG1XrolDWlDVV7s+68V7PyBkytUekLQWMbI3bQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0dLW9J+1lLCMBfP9IpEVk/cvnrVbzAI5cinD48t8/LI=; b=lHs0HTMbuq6vAS1+Li66lH4+vO1N13B/t2YllzNwi9r4KtOfwhfrLoIIFHIRfoDn29SQWwW3JiODJpL1AuLt0ONO0WuSCjM8uzd47/r212fEV7hf8/7syE9Aa2VnpFvceesycV0eWCb0/4XxeGgIAh9fJ/Z8bi3Y2+l1/6W6fhvfzH7QGZAr9mtX+o8KnEKs5JwX9uojIupwRrw6wkj59pkVNVCG+b5GeikzqFOm3NfYdBpZ3SgoP2FI0YtAxbETRzR8lACgU+ucKL4qvuVWiEwzbTs6St/1gL6s0yoUKsVOhjEpFerNooZGA3P8qI8ljeL9sJGTtkkWeffU37sLfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0dLW9J+1lLCMBfP9IpEVk/cvnrVbzAI5cinD48t8/LI=; b=jG2/KAXotXy56sVykccCsY5qeuf783L55mU6UicqR+5Nno0B4W0dLOcmE9AX9W9s/cBb03iHW2wcZZfuIbYASJY0C1tSSAXA9qvxlEV/5qXMx28kvxxVe59eFzFYeX1I1NB6YgY3sEsxEA7n6lzy3m9BPauHJfi2HB1+wmu6u+quhMjp67rnLS+x1Ljx2Dxa3OYNLa482zcw5CGBLzy0r8PzV1LBsQUtYT9Zr9t5fSz+t/Guv33hDf+cStllgbXWAEE0T9+VCD6znCrVio74Qv3fhPZLUMrh34eG+XIaT30b0s8eBaosp0EDbBqbyE8YZMB/G06Q2zlVcdmVVTRa6g== Received: from MN0PR12MB6103.namprd12.prod.outlook.com (2603:10b6:208:3c9::19) by SJ2PR12MB8831.namprd12.prod.outlook.com (2603:10b6:a03:4d0::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.17; Fri, 10 Jan 2025 09:41:10 +0000 Received: from MN0PR12MB6103.namprd12.prod.outlook.com ([fe80::3c6c:6f63:917e:98d8]) by MN0PR12MB6103.namprd12.prod.outlook.com ([fe80::3c6c:6f63:917e:98d8%6]) with mapi id 15.20.8293.000; Fri, 10 Jan 2025 09:41:10 +0000 From: Chenbo Xia To: Maxime Coquelin CC: "dev@dpdk.org" , "david.marchand@redhat.com" , "ktraynor@redhat.com" , "i.maximets@ovn.org" , "stable@dpdk.org" Subject: Re: [PATCH] vhost: fix misleading log when setting max queue num Thread-Topic: [PATCH] vhost: fix misleading log when setting max queue num Thread-Index: AQHbYqM3t6FF9dOk+0y0UWNC7KaTHbMPwjuA Date: Fri, 10 Jan 2025 09:41:09 +0000 Message-ID: <16E2FFD6-6CBC-49C1-B828-28833DF590E0@nvidia.com> References: <20250109143130.3696613-1-maxime.coquelin@redhat.com> In-Reply-To: <20250109143130.3696613-1-maxime.coquelin@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN0PR12MB6103:EE_|SJ2PR12MB8831:EE_ x-ms-office365-filtering-correlation-id: a22818ea-cd57-421d-7533-08dd315aea13 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|1800799024|376014|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?zBO4JGlhuvhi/wkpbKh6iarLr8vf+tHQ+PRbKxlGhcXne8Xp0984b564cy/o?= =?us-ascii?Q?rM0gQiQJxZLwXpQeAuQ8vH56HIb2P/TQj0+D8GwDwS8mPAJlIZvyF2YiXNPv?= =?us-ascii?Q?RxzH4TRla/Oqo3qBZJZ5Hw8C7z2qzGfAjx/eMapgUwN/6DQp2gnkb58+860p?= =?us-ascii?Q?cNqgPvCHwEP7DqUCUatPxJ0PI3pB7oXPGcociDs9sUn2yGf4Ox9t9SvPNS4g?= =?us-ascii?Q?+OI0ve37yVWV5vpLf3VvZ/1mwv45ewa/QhwjgsucIYin+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8ELekXokQrVDwgfC0wR6PRmQmrnj/R9smnZXTwCGIU?= =?us-ascii?Q?GpNx5r2Yv/iioow9sQMV1HUw20RcWv5XdUJxZGBpum8YkrLDbwKnXInvew8g?= =?us-ascii?Q?/UG6eRyr9QKwcYFYhRdBBzE815+PllaPGTN63Irkq5PfPNv6k3NPpXYJbSyM?= =?us-ascii?Q?oM9KRLwNMmQS8RyzuuntwLTEWA1WIWbArmM0D8DRlyWGFzAq36d+4vhyPwTD?= =?us-ascii?Q?K9mLNt7Jj1aUw4LiK/Mt2HKSdOVuiZhUsJvL/CSVpQ7tOgzEMrEt0SfYe6LN?= =?us-ascii?Q?G47U75hqEIyw+VW4+adJ/5L9AXuPt/l2?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN0PR12MB6103.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?kgR7rJOgthDFcjvpUQlNQkKn2m9LDNJLjUNCfU3Y6m6cSbWZdoarm/6DqDOu?= =?us-ascii?Q?oTulhk9enMtmbthgieoBkX7oW002AC0bpPZBrhP8u0VTjwopwupUkRvVrfQV?= =?us-ascii?Q?6fyK9gJAqz/MwDrWHock0CScpnCQAqpTmvzhfAuMOBuARmOZsbWjjqbKlG6j?= =?us-ascii?Q?E6Wv0IMkl8JF0LFzOJsuu3GYVRtdBiXDLVmONgQcwrL6K5kIfQRf3F3KnYWO?= =?us-ascii?Q?QPslNsFO2s0L5oW30CWHwS5TPvhPhwwi5p3EXyLNIE91OA3f5vJNTxXmyd9z?= =?us-ascii?Q?UKa9ezWMtWu6PFvHqlqJY9vjanGiOXL2qj6sJFzucIeSsQM+A/BjYt6EEu1Q?= =?us-ascii?Q?aTtlpGGZGjwvuqz1HH+Ha6dHrKbM6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?oa+NQxwsApVan4dTc2VSNUaqLZ/mZCkdPNYz8lDfFFkOAFB25EON1azCqTpa?= =?us-ascii?Q?SmoyxZTosZGiYSsLyU6ekHHJJcDM4BBaZNNMbmBzLut0xtE1HOAOiaxqIcEw?= =?us-ascii?Q?KGE71mu89oKQQr8Di9YhIL7fsgvqk7+86JmeGyOdeGhB+VN7+v/TilzBZdML?= =?us-ascii?Q?94qXC1bRB+q2rwhTUAHlmTEj5gtrxgmnDF4z0jpdF6ifzm0OVSw4g3VOfpUD?= =?us-ascii?Q?rZYova4KuuePFaLRHbGn7Iuh6xEOpteVluRRXIlY7BDYq4I3+WZ1cPCVbJZi?= =?us-ascii?Q?hV0LlzgGZD6uddr626V86X/x5kW8pnso4RCgyqOW?= Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN0PR12MB6103.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a22818ea-cd57-421d-7533-08dd315aea13 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jan 2025 09:41:09.9979 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: fu9qOBi2TZ5+GgOY+wvE8TkiFL/wj4O/sxeo5bdgz+9G4L3LCg30wiCLPvifw8kQ3m1gVQqZSGgEKo6ZGkSD8w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8831 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 Hi Maxime, > On Jan 9, 2025, at 22:31, Maxime Coquelin wr= ote: >=20 > External email: Use caution opening links or attachments >=20 >=20 > 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 > queue pairs is being set is emitted unconditionally, which > may confuse the end user. >=20 > 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. >=20 > Fixes: e1808999d36b ("vhost: restrict set max queue pair API to VDUSE") > Cc: stable@dpdk.org >=20 > Signed-off-by: Maxime Coquelin > --- > lib/vhost/socket.c | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) >=20 > 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 =3D 0; >=20 > - 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; > - } >=20 > pthread_mutex_lock(&vhost_user.mutex); > vsocket =3D 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; > } >=20 > + 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 =3D -1; > + goto unlock_exit; > + } > + > vsocket->max_queue_pairs =3D max_queue_pairs; >=20 > unlock_exit: > -- > 2.47.1 >=20