Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp534118rdb; Sat, 17 Feb 2024 23:12:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWpJk+gD7cTWzQkmFJVfjSAh3Ydx1FaF/hibl0MJ0VEaPBmS/M0z5B+k3TT20T+GoA8R6T8dKitCd6IcIb7EwNBukvWStNDtgt0K0wPjg== X-Google-Smtp-Source: AGHT+IHBYGawReUtCG4Qww0EE6jPfwb5q3Wazi4lB3tefenoNM9ly41RhzJ63Sk7SgM4JWdNqK4V X-Received: by 2002:a17:90b:3a86:b0:299:2bc7:d84b with SMTP id om6-20020a17090b3a8600b002992bc7d84bmr5765667pjb.25.1708240328312; Sat, 17 Feb 2024 23:12:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708240328; cv=pass; d=google.com; s=arc-20160816; b=S8bD+6EplLs2j/5yPMl6sdI1AIptSQrAXQVkC1O3wsTrFfpU7QGqqHsMwZd6CCP7nY k4c601c9iMmuoBdbKJ/H/h+rtk+Z8mfTkVyTGDIje/MAGu3zTjlcrcpYGrI2yd6QlJOj n8Jgjy04+uhHP0LuUHbwqxRWyEDncp+uFlklxIACdZtxS82Rli/Mrs/eBBgU1nH61Z+V zCZbnO0qkEswnwfO5VZ6wJo6K7ycD24+8N3ZeIUpUHG7Y9H8HhqnoHD4RekjIzAxxhBt o7DP4jhYJJifr7MqP3QDDBRYHJppcRs8Bdb7J4n4ZZbsAKnszrA2awqumPiQ8IyIoV0i CcqQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Oj8yUrr4I4MY543Ay9vPUF9/Dj1RjR5Y8gFKZE1tNm0=; fh=085oS1yyf5kX9qNxDuDBeQjXOhxwKWygNYWYyGVvWXs=; b=Py8bSsw8ocqeq+rUb4qQrie12okicFgUvP4zh/N33M6xJ9Q2uwlAcvB84iy5yY5r3I 9376Jh8rwMTAnoXXgKbdBraLTRDvmb/QKbXOBt+/GQB7lpY4jPgyWmvX1aalTKRzal32 1dH2c6NSeFtwgKGV+nIRGfrdApN0+M6xmT8z1QOcV+/iZFp/fu1IzkiR6Wj1I9bRC/26 YflRZTEdyyAfywrk3wNqwuFvJVw2cvfDLv8lYnV/QwI8mkK64hMmtnhC+1ENlMfdvKE6 XIX62y5eAVQnuFje6FwsxnXddygD1QIxCTYLdNCnm/NmIxFeD9rjsPlA8KSqXyHG63y0 CCRw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oM1LDZdN; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-70247-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70247-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id n2-20020a17090a9f0200b00296fba17af7si2642343pjp.160.2024.02.17.23.12.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 23:12:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70247-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oM1LDZdN; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-70247-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70247-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0C8622830EC for ; Sun, 18 Feb 2024 07:12:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D9C53EACC; Sun, 18 Feb 2024 07:12:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="oM1LDZdN" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2166E544; Sun, 18 Feb 2024 07:12:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708240322; cv=none; b=tdSdXBiZI6iC1c9X73ElIy2SLLT4ElOe9uk5RZTf7Iu189tB+tJB1BHZH6n7SYQCrfwItUNBRGQBF+F2gK9pQT8yfzF4M0DAvWSD110NXpr/ObSiP3ENtbjj3nupgfuyXtEHmLnBBDFimh6voE7QFb3c38gdgPV40ABHJQ23X0Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708240322; c=relaxed/simple; bh=7kz46bBlzsC6VKg//Ry1WVNK/qIqJJJC1HkHxIrtwQ4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RnEEXH/VFxsW7TgyRYNCBQhtyA3n5eBCXDw9oJexjmff2DMTxxtC2ADyCLJbuaN0gv+m5GM8axNCahQ0LkEBtdz3en8pmhNjrkBCdFMxt4/F9XjZkonPvAAB2B5oVVrKS8H5MqACGH7CPIFtA0MAyKirc1LZJCxAU9TfnuB1zv8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=oM1LDZdN; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11BECC433F1; Sun, 18 Feb 2024 07:12:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1708240321; bh=7kz46bBlzsC6VKg//Ry1WVNK/qIqJJJC1HkHxIrtwQ4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oM1LDZdN2xbLsX7070H1FVHEemh1N6DarM2Gjm7yMTCj909NRJlfO1qrj+e1ZF+GK p9J56q1zV0nw/xx/OLYt98sLaUi0MLr1+yp7NTy5rK2ogf0NvuFSAqn3Bz+0bSRFqM suMOUoutTdh5wENuXL55l8WHGGEHNzLTwvzxvjHE= Date: Sun, 18 Feb 2024 08:11:58 +0100 From: Greg KH To: Saurabh Sengar Cc: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, ssengar@microsoft.com Subject: Re: [PATCH 1/6] Drivers: hv: vmbus: Add utility function for querying ring size Message-ID: <2024021858-cubicle-irregular-d402@gregkh> References: <1708193020-14740-1-git-send-email-ssengar@linux.microsoft.com> <1708193020-14740-2-git-send-email-ssengar@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1708193020-14740-2-git-send-email-ssengar@linux.microsoft.com> On Sat, Feb 17, 2024 at 10:03:35AM -0800, Saurabh Sengar wrote: > Add a function to query for the preferred ring buffer size of VMBus > device. That says what you did, but not why you did it. > > Signed-off-by: Saurabh Sengar > --- > drivers/hv/channel_mgmt.c | 7 +++++-- > drivers/hv/hyperv_vmbus.h | 5 +++++ > include/linux/hyperv.h | 1 + > 3 files changed, 11 insertions(+), 2 deletions(-) > > diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c > index 2f4d09ce027a..7ea444d72f9f 100644 > --- a/drivers/hv/channel_mgmt.c > +++ b/drivers/hv/channel_mgmt.c > @@ -120,7 +120,8 @@ const struct vmbus_device vmbus_devs[] = { > }, > > /* File copy */ > - { .dev_type = HV_FCOPY, > + { .pref_ring_size = 0x4000, > + .dev_type = HV_FCOPY, > HV_FCOPY_GUID, > .perf_device = false, > .allowed_in_isolated = false, > @@ -141,11 +142,13 @@ const struct vmbus_device vmbus_devs[] = { > }, > > /* Unknown GUID */ > - { .dev_type = HV_UNKNOWN, > + { .pref_ring_size = 0x11000, > + .dev_type = HV_UNKNOWN, Where do these magic numbers for the size come from? > .perf_device = false, > .allowed_in_isolated = false, > }, > }; > +EXPORT_SYMBOL_GPL(vmbus_devs); > > static const struct { > guid_t guid; > diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h > index f6b1e710f805..76ac5185a01a 100644 > --- a/drivers/hv/hyperv_vmbus.h > +++ b/drivers/hv/hyperv_vmbus.h > @@ -417,6 +417,11 @@ static inline bool hv_is_perf_channel(struct vmbus_channel *channel) > return vmbus_devs[channel->device_id].perf_device; > } > > +static inline size_t hv_dev_ring_size(struct vmbus_channel *channel) > +{ > + return vmbus_devs[channel->device_id].pref_ring_size; > +} > + > static inline bool hv_is_allocated_cpu(unsigned int cpu) > { > struct vmbus_channel *channel, *sc; > diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h > index 2b00faf98017..5951c7bb5712 100644 > --- a/include/linux/hyperv.h > +++ b/include/linux/hyperv.h > @@ -800,6 +800,7 @@ struct vmbus_requestor { > #define VMBUS_RQST_RESET (U64_MAX - 3) > > struct vmbus_device { > + size_t pref_ring_size; No documentation for this? What is the size in units of? thanks, greg k-h