Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1045308rdb; Mon, 19 Feb 2024 02:24:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU+VSY5BtfviB2/WV82DEXMtSZ0i0fUthmO0uyTYfkelkqdmGo4y6/aIJpgdoi5HZSiqFptrt0GS0wqVTbPrnU0DgZH4FuBn9AtONQ3GQ== X-Google-Smtp-Source: AGHT+IHgqIUf68JSb7y6IIoKXzXeH2apKBIQG0BZeaFPcgpB2uTLF1ka09fTjkfcVhOfbvcapRWo X-Received: by 2002:a81:4c8c:0:b0:604:a566:2555 with SMTP id z134-20020a814c8c000000b00604a5662555mr8336585ywa.6.1708338246021; Mon, 19 Feb 2024 02:24:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708338246; cv=pass; d=google.com; s=arc-20160816; b=HSfdYzAndy/ARUAvt0wmHdpXqlp/vv6SdTA6IpiHEMS6NJnK9G7Ppj5QUARXMPPlaa YPQ8q0qf/wynY/t6ivxPfow1P8VPDfl3hLKt5AOG1CktXSGQ/CoBGN6lVbTFa0YaKUNl QgTDB0TtTtlHhpL8VFeOQyN/wx49OfnUD+ThpK+yB1gRnyGNeeiloCVsOBRVlcv/srFW voiDi3uK3LaP79atXyckY1QtORjD28n2F9zDi+Xjz1fEwfI/6MYxxq3jL/X2SdBHD6yX 9K8KTZlUd74FPAuRUkPGDshIFV/p/Ii+czltmX8+KfbvnBiSgqTdGf1GOWcb2McPB/Hh Ix2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature:dkim-filter; bh=lqvmacQRB7KOJtXqzg9VNGDCrcZQrM2SF0mAB9k8gtE=; fh=dXBlqzMxyT08c6C/n3ZCDDv3TZXLsVX+sfoP6ClkdWY=; b=AEgOELwX/b6fVVmOOHQWPIQgZMCdQUFJbrNbTDtRH5Zxfjqh9+kmFKkW+nP8buLTF7 IqYB+2gY4qtA9s3dnDdDE1sX40ECRMy1VaYQgQ8CG9oF0CgP4JikaSO6GNs3OuPTU2xA aXCbIJbQ8xL/zJd43B51MfcRTQLTC8Xbnd16HU1RkBNTNbsqHaibRtdLOXKE3ODZMyEt 8CGoJBuiaHJJ5sVMFF8jB15BqS6XdEBbMdZV4wLIXjtXLg8QNuDWhO2bBMtGk3nLn0ZF vY6JsXnmXQaVE48/HVGBdAIG/QLQhZXycab+sA08nvqupsJhi6zb8NLtyC4DkyuPOxZd DzMw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=orwmxdGb; arc=pass (i=1 spf=pass spfdomain=linux.microsoft.com dkim=pass dkdomain=linux.microsoft.com dmarc=pass fromdomain=linux.microsoft.com); spf=pass (google.com: domain of linux-kernel+bounces-71119-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71119-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 14-20020ac8590e000000b0042c6bfbde55si4582150qty.18.2024.02.19.02.24.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 02:24:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71119-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=orwmxdGb; arc=pass (i=1 spf=pass spfdomain=linux.microsoft.com dkim=pass dkdomain=linux.microsoft.com dmarc=pass fromdomain=linux.microsoft.com); spf=pass (google.com: domain of linux-kernel+bounces-71119-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71119-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C2BB41C214DA for ; Mon, 19 Feb 2024 10:24:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F16282C699; Mon, 19 Feb 2024 10:23:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="orwmxdGb" Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C81A22C68E; Mon, 19 Feb 2024 10:23:54 +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=1708338236; cv=none; b=l8Dgkj6CxR/foKGPLC0ucTW7SG2Lf5X847mrg88Z+snW2aCjwBwbBJmXYjLqTl8swxHM9IRQx/RXG0BDbnIV6TsB+27wjeK8SW7arFpAQcjaN5YZLdo6n3BCQqO/5ENIVD5ebIfY8ByY+yK3YbsigiGDczUqsXUIp1vKmMAnkwQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708338236; c=relaxed/simple; bh=9lFhpNcxNkWQKY4Mqd3QqZPa1srTB9MzJwoZyS6/FoY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GwCLbPCjcmjJYTaRmb2zJlNK9oeRmU3bIDiXYAYd3RS0oQFictETZNKWgoKc6BlQe/l8A64dkPeLDbQIXc1xj2qBp4WhSxiwmhPAHCF5NIJl2sKWHee6aDuE8JcLCQihk3KhvQ1Mm5upKXmv7FG3UMiV9nZuCoAi69DIBxSWnwA= 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=orwmxdGb; 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 Received: by linux.microsoft.com (Postfix, from userid 1127) id 6189A20B2000; Mon, 19 Feb 2024 02:23:54 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 6189A20B2000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1708338234; bh=lqvmacQRB7KOJtXqzg9VNGDCrcZQrM2SF0mAB9k8gtE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=orwmxdGb6Ua8U1wwO9vYFSRq+cU8dvuvUOaA9NA5+gvfekPiqHqkoprrcoD1YN1Vr tJKeFNl9CPpjQ5do/M8BSOURfax5Wsu43mNawZPRp1LevTtZRwqNvtBNo11o5M6CQ8 2nZ7LLcrGnOwIMST3W5eQH3b4jb60wWjn+zuarok= Date: Mon, 19 Feb 2024 02:23:54 -0800 From: Saurabh Singh Sengar To: Greg KH 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 5/6] tools: hv: Add new fcopy application based on uio driver Message-ID: <20240219102354.GA12268@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1708193020-14740-1-git-send-email-ssengar@linux.microsoft.com> <1708193020-14740-6-git-send-email-ssengar@linux.microsoft.com> <2024021908-royal-sequester-84be@gregkh> <20240219092421.GA32526@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <2024021932-marbled-passable-e7ab@gregkh> 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: <2024021932-marbled-passable-e7ab@gregkh> User-Agent: Mutt/1.5.21 (2010-09-15) On Mon, Feb 19, 2024 at 10:52:12AM +0100, Greg KH wrote: > On Mon, Feb 19, 2024 at 01:24:21AM -0800, Saurabh Singh Sengar wrote: > > > > +#define HV_RING_SIZE (4 * 4096) > > > > > > Hey, that doesn't match the kernel driver! Why these values? > > > > This application talks to device which is recognize as HV_FCOPY > > is kernel. In the first patch of current patch series I have > > mentioned .pref_ring_size = 0x4000 for HV_FCOPY which matches this. > > > > This code is well tested. > > I'm commenting on the fact the 4096 is sometimes PAGE_SIZE and sometimes > not, and you have a default of using PAGE_SIZE values in the kernel > driver, and as such, this will not match up. So be careful here. Thanks for clarification, I will add some note for it in V2. > > > > > + > > > > +unsigned char desc[HV_RING_SIZE]; > > > > + > > > > +static int target_fd; > > > > +static char target_fname[PATH_MAX]; > > > > +static unsigned long long filesize; > > > > + > > > > +static int hv_fcopy_create_file(char *file_name, char *path_name, __u32 flags) > > > > +{ > > > > + int error = HV_E_FAIL; > > > > + char *q, *p; > > > > + > > > > + filesize = 0; > > > > + p = (char *)path_name; > > > > > > Why the unneeded cast? > > > > This code is existing today as form of hv_fcopy_daemon. As this new > > application is replacing hv_fcopy_daemon I reused the same code and > > casting. > > That wasn't obvious that this was copied code, please be explicit about > that. > > thanks, > > greg k-h