From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9D829224252; Mon, 21 Apr 2025 23:27:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745278063; cv=none; b=pYZZGW43fdq3mO6q8l5DnUg/kWnDzGX/SAPkqgD1HZn2wZfrRTAxJov0DlKVMwKFOiuilmAPjRMT3qEzDunb+B9x6jx9TMtdx9Z2HxP0z/MRfBVAmQbJzl10Gedu8NVVjZ//tfRmEG1PBkhwjUk2pJCDaei3k+8qIMrLR4LAd0M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745278063; c=relaxed/simple; bh=plS0dj7xUaRPgtvF1xd9b6EwHUtv+3iwNa8IBnlG1Uo=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=ZyByOMt9chhsuXDozEqskyOw3sYtETHViwo0P63BfgNd1R8pptTqRjIvHH+bxmmDbROSnDt6a/rV7odcZmBrTjhObReHujRnS5VZyz8JcgKk0KnoorvsbpcShYc36cyBQDs4yLAr1NHe4oFjmYbdZnjyO9pTTyFbzIdx6IHX3+4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=CRuJz68c; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="CRuJz68c" Received: from [100.65.97.83] (unknown [20.236.10.66]) by linux.microsoft.com (Postfix) with ESMTPSA id 7F082203B86E; Mon, 21 Apr 2025 16:27:40 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7F082203B86E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1745278061; bh=rgCwyON/e1COr+m3vQYBYaC1jT0qx4BriodovWWJ2oM=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=CRuJz68c0/VQgI89fv0oIv2W1+wJ6nbRbkUekWMt/Ew3z5Wji+LLNADl8AGPl9Hgj z2tW+nHV3yRZuoNrIOJWIrRIEuhgCsNwONreCFWQWOGgaZpeQYTAW+pUR10uTUHWjt ehWsanjMICKHh2ULuzsHzwkly+e6YlVc9Duc81ME= Message-ID: <1643d6a8-7d4f-4d6e-aeab-f43963644a1f@linux.microsoft.com> Date: Mon, 21 Apr 2025 16:27:40 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: eahariha@linux.microsoft.com, "kys@microsoft.com" , "haiyangz@microsoft.com" , "wei.liu@kernel.org" , "decui@microsoft.com" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "dave.hansen@linux.intel.com" , "hpa@zytor.com" , "lpieralisi@kernel.org" , "kw@linux.com" , "manivannan.sadhasivam@linaro.org" , "robh@kernel.org" , "bhelgaas@google.com" , "arnd@arndb.de" , "x86@kernel.org" , "linux-hyperv@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-pci@vger.kernel.org" , "linux-arch@vger.kernel.org" Subject: Re: [PATCH v3 1/7] Drivers: hv: Introduce hv_hvcall_*() functions for hypercall arguments To: Michael Kelley References: <20250415180728.1789-1-mhklinux@outlook.com> <20250415180728.1789-2-mhklinux@outlook.com> From: Easwar Hariharan Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/21/2025 2:24 PM, Michael Kelley wrote: > From: Easwar Hariharan Sent: Monday, April 21, 2025 1:41 PM >>> >>> >> >> This is very cool, thanks for taking the time! I think the function naming >> could be more intuitive, e.g. hv_setup_*_args(). I'd not block it for that reason, >> but would be super happy if you would update it. What do you think? >> > > I'm not particularly enamored with my naming scheme, but it was the > best I could come up with. My criteria were: > > * Keep the length reasonably short to not make line length problems > any worse > * Distinguish the input args only, input & output args, and array versions I think the in/inout/array scheme you have does this nicely > * Use the standard "hv_" prefix for Hyper-V related code > > Using "setup" instead of "hvcall" seems like an improvement to me, and > it is 1 character shorter. The "hv" prefix would be there, but they wouldn't > refer specifically to hypercalls. I would not add "_args" on the end because > that's another 5 characters in length. So we would have: > > * hv_setup_in() > * hv_setup_inout() > * hv_setup_in_array() > * hv_setup_inout_array() > * hv_setup_in_batch_size() [??] > > Or maybe, something like this, or similar, which picks up the "args" string, > but not "setup": > > * hv_hcargs_in() > * hv_hcargs_inout() > * hv_hcargs_in_array() > * hv_hcargs_inout_array() > * hv_hcargs_in_batch_size() [??] > > I'm very open to any other ideas because I'm not particularly > happy with the hv_hvcall_* approach. Between the two presented here, I prefer option 1, with the "setup" verb because it tells you inline what the function will do. I agree that the "args" is unnecessary because most hypercall args are named hv_{input, output}_* and are clearly arguments to hv_do_hypercall() and friends. Since hv_setup*() will normally be followed shortly after by hv_do_hypercall(), I don't see a problem with not referring specifically to hypercalls, it should be clear in context. For hv_hvcall_in_batch_size(), I think it serves a fundamentally different function than the other wrappers and doesn't need to follow the "setup" pattern. Instead it could be named hv_get_input_batch_size() for the same length and similarly tell you its purpose inline. I am continuing to review the rest of the series, sorry for the delay, and thank you for your patience! Thanks, Easwar (he/him)