Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1296789pxu; Sat, 5 Dec 2020 10:32:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJyu5giUHkDqEskPUmLlDzqmeKwP3APPF1FazAoTbdm5SkGmaqnIMRu3WdHtJHPcWohrAvVM X-Received: by 2002:a17:907:3312:: with SMTP id ym18mr12461283ejb.437.1607193175860; Sat, 05 Dec 2020 10:32:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607193175; cv=none; d=google.com; s=arc-20160816; b=1DIfuoua+HQRa/IgQVnOrt4bxNNr+aFKZfJXeNYQ9g7ra7kc3RBojWTZsCBlbObJr5 X6HygYb4uNNW7a0kvXulGbGLli/yw4MOje4EFXPix4Fj0LVeAqhAl1y7eGIQKV3uddw0 MsJ8CNofbpokCGq65BVVdHiPkchyscsTW1hCtpfM7X3i/sK196oUyg4518Ze5+f+fyyA FXLkEIWYNKf94sd0OUjoyEIzC4jdjoUROxi0VG/5jJUmdJfMmlBGhCjiEet3BjcmPtzr 1RMcsxBM2JUDYziA2mEnyINBZVeGjJE+08f4Ro8kYDnu5AMAN7GytoTtmY43GIr3W95r 366w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=VvhwcL0QoR67kqN/35OWyk2j4YsIzWNUi5wIMqoB6NQ=; b=E7q8k52n9Y0IVyaHwcimiT0oNIssfnEu2U5H8DvjZgorgLd7hXzS3p8gyNhljqVPfZ Z9w+3jCTmuzMwacRdG0XB0MO5aLiOIA7eeW64Df0Bp7F+xbeW1C8zPv9up7sHdMEQEHn AFnbJI6C2gHZQql1llo3QjCa99dFGM21SpudrdoIXPxDpUzeiMDviOh/q3cKs7PJLNzp eySKGMZlCZGYtlzHwGx+cO6bEKT2voExAhoWsz7umol1irzSSQwTSgWtJncrNqJ1PvK+ hZs1tJ4p4CwVnxQ3O1spEN0x271AVYoHMatGzLQzl27YykGxw0IiQJyO/hGiL2mgKeOB Jx0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q10si4954386edi.178.2020.12.05.10.31.37; Sat, 05 Dec 2020 10:32:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727745AbgLERoL (ORCPT + 99 others); Sat, 5 Dec 2020 12:44:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727434AbgLERk2 (ORCPT ); Sat, 5 Dec 2020 12:40:28 -0500 Received: from faui03.informatik.uni-erlangen.de (faui03.informatik.uni-erlangen.de [IPv6:2001:638:a000:4130:131:188:30:103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27A48C09425C; Sat, 5 Dec 2020 09:39:48 -0800 (PST) Received: from cip4d0.informatik.uni-erlangen.de (cip4d0.cip.cs.fau.de [IPv6:2001:638:a000:4160:131:188:60:59]) by faui03.informatik.uni-erlangen.de (Postfix) with ESMTP id 22147241036; Sat, 5 Dec 2020 18:27:57 +0100 (CET) Received: by cip4d0.informatik.uni-erlangen.de (Postfix, from userid 68457) id 13663D8049E; Sat, 5 Dec 2020 18:27:57 +0100 (CET) From: Stefan Eschenbacher To: "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu Cc: Stefan Eschenbacher , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel@i4.cs.fau.de, Max Stolze Subject: [PATCH 0/3] drivers/hv: make max_num_channels_supported configurable Date: Sat, 5 Dec 2020 18:26:47 +0100 Message-Id: <20201205172650.2290-1-stefan.eschenbacher@fau.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org According to the TODO comment in hyperv_vmbus.h the value in macro MAX_NUM_CHANNELS_SUPPORTED should be configurable. The first patch accomplishes that by introducting uint max_num_channels_supported as module parameter. Also macro MAX_NUM_CHANNELS_SUPPORTED_DEFAULT is introduced with value 256, which is the currently used macro value. MAX_NUM_CHANNELS_SUPPORTED was found and replaced in two locations. During module initialization sanity checks are applied which will result in EINVAL or ERANGE if the given value is no multiple of 32 or larger than MAX_NUM_CHANNELS. While testing, we found a misleading typo in the comment for the macro MAX_NUM_CHANNELS which is fixed by the second patch. The third patch makes the added default macro configurable by introduction and use of Kconfig parameter HYPERV_VMBUS_DEFAULT_CHANNELS. Default value remains at 256. Two notes on these patches: 1) With above patches it is valid to configure max_num_channels_supported and MAX_NUM_CHANNELS_SUPPORTED_DEFAULT as 0. We simply don't know if that is a valid value. Doing so while testing still left us with a working Debian VM in Hyper-V on Windows 10. 2) To set the Kconfig parameter the user currently has to divide the desired default number of channels by 32 and enter the result of that calculation. This way both known constraints we got from the comments in the code are enforced. It feels a bit unintuitive though. We haven't found Kconfig options to ensure that the value is a multiple of 32. So if you'd like us to fix that we'd be happy for some input on how to settle it with Kconfig. Signed-off-by: Stefan Eschenbacher Co-developed-by: Max Stolze Signed-off-by: Max Stolze Stefan Eschenbacher (3): drivers/hv: make max_num_channels_supported configurable drivers/hv: fix misleading typo in comment drivers/hv: add default number of vmbus channels to Kconfig drivers/hv/Kconfig | 13 +++++++++++++ drivers/hv/hyperv_vmbus.h | 8 ++++---- drivers/hv/vmbus_drv.c | 20 +++++++++++++++++++- 3 files changed, 36 insertions(+), 5 deletions(-) -- 2.20.1