Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp883625lqh; Fri, 31 May 2024 23:46:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXRxsDK++t9ibU7mq2vfR6W3pYn2voXpkhiF+/6mHnQJoWHjb1W/9wxDM/Ve9YTZgZq8XZggtbhwDh3FVzb0YBdcGc90PWwfn1nkWqoPA== X-Google-Smtp-Source: AGHT+IGhjBrY6LSOKbX9yM3HYn/rU94UFV9fGY/PU5A01cbn8foRcQ9uRx2xVMAChgZMoaLOsege X-Received: by 2002:a17:903:32cf:b0:1f3:33b:ff18 with SMTP id d9443c01a7336-1f636ff51d9mr40506535ad.11.1717224361967; Fri, 31 May 2024 23:46:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717224361; cv=pass; d=google.com; s=arc-20160816; b=SPBNwKA8gFLCoVRDKBVi71HOhfgjY5XO3QK0+vDy+jd26Y9msdWHUZw0ovYBsDYZ3h 7lg0pABvC1fW2WQiVpfa8T+pHaMKgdfv1E3eBzyhSwG6LZJYO8KEr4fQhgdioyozK9Gy PzQ3PH0tXrT/7QZgeWkcZsVWrqDKooWYcEgeeNP7q4+fnmTnpyOjHBrIM+G8anqrEigq XGnyqxsFg1GuyxLmGs/xIf06mUqulhPCZWV5v278cWbmLV7SsvLF/SrGZkh1tlCgecyv L4KhW3JGDTxwCfvPwzeOvVWk5Ex98BSW9i60Bka3xoPm815IXb2VXB/KqMD10E4peLNv AXCg== 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; bh=6g5Cx5zv2e1ls+0tPMXlNRBn8m31lOIhDM+5wci87cc=; fh=kY1SW/oxmEsc3XVO4s/ftzvNMB6YehgxgfVzsXZfOYA=; b=GQzrsmnr8yAH5f84kZimJBM+K7ty8D+9hakOmIj15YEcwDn4gF1Zd+1KHDd/VnQqxb 7OFKI0NPakz1kH/3coVH4LTKXfuyQnjsVbl4iq59CYbUuXt44Zro70S/rBgb/kU2+lNN 6pNFF3aoHOLCOBL7SXsIzBW0yzqL0SniTHbkoc/q02r2tRR5WHLQH4cGP1OfRE2Q51Bk JsEPbLCxvIS0JwrMjGNCfaVXvm3weQZ/N3Q1+cyk5/NFqhBV+SLjPFDMfArkGwMdDc8v lVhhHuoKbprFBZhYo9VePktDu9kO9jUuSecuAIngdxfJMhdjG+UlNt5RKMcmwBGUN1Mo 2yiA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-197722-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197722-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f6323de8fbsi29395665ad.251.2024.05.31.23.46.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 23:46:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197722-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-197722-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197722-linux.lists.archive=gmail.com@vger.kernel.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 0AA0CB255D1 for ; Sat, 1 Jun 2024 06:22:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B3C82171A5; Sat, 1 Jun 2024 06:22:26 +0000 (UTC) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (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 ECF74125AC; Sat, 1 Jun 2024 06:22:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717222946; cv=none; b=EEgXDuK6zLcMgXIoCQHuzN+4NGIWgKg/gimO/mkv1f+D/u8SdGG2vnYUSI8sH/knaTdaznS9YoBIUNaVQmonDspTJYZw08KSCCSDzPqLCWo2JTGD/kGaC5ev6U4I3o7PCzJhMItsMZr1h9D+Pc5tuDfk+Y9BRuaUKB477siWQrY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717222946; c=relaxed/simple; bh=ueo2AbPJP1H/rx7rcof5h1bt+mD9E8aJVXr9WZHpZv8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bu+XsXp1Bv/WL0e6ojjdAW/GaO+iqZxJu0lFIMZZFt95vg1OFU8I7A7XAOSCLjcfwe3zROqLa7gR8c/T1/BwaFpnlKH5Hy6k7LKSk3qP/cw4XnV5xcuLZCiu9IvYn1VgPsiriKqDBSkIXBaa6LWn/oRwx8/8wVgFEjhlE3gg1f4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 941C868D1C; Sat, 1 Jun 2024 08:22:19 +0200 (CEST) Date: Sat, 1 Jun 2024 08:22:19 +0200 From: Christoph Hellwig To: Nitesh Shetty Cc: Jens Axboe , Jonathan Corbet , Alasdair Kergon , Mike Snitzer , Mikulas Patocka , Keith Busch , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , Alexander Viro , Christian Brauner , Jan Kara , martin.petersen@oracle.com, bvanassche@acm.org, david@fromorbit.com, hare@suse.de, damien.lemoal@opensource.wdc.com, anuj20.g@samsung.com, joshi.k@samsung.com, nitheshshetty@gmail.com, gost.dev@samsung.com, Javier Gonz??lez , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, dm-devel@lists.linux.dev, linux-nvme@lists.infradead.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v20 07/12] nvme: add copy offload support Message-ID: <20240601062219.GB6221@lst.de> References: <20240520102033.9361-1-nj.shetty@samsung.com> <20240520102033.9361-8-nj.shetty@samsung.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: <20240520102033.9361-8-nj.shetty@samsung.com> User-Agent: Mutt/1.5.17 (2007-11-01) On Mon, May 20, 2024 at 03:50:20PM +0530, Nitesh Shetty wrote: > + if (blk_rq_nr_phys_segments(req) != BLK_COPY_MAX_SEGMENTS) > + return BLK_STS_IOERR; This sounds like BLK_COPY_MAX_SEGMENTS is misnamed. Right now this is not a max segments, but the exact number of segments required. > /* > * Recommended frequency for KATO commands per NVMe 1.4 section 7.12.1: > - * > + * Please submit this whitespace fix separately. > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h > index 8b1edb46880a..1c5974bb23d5 100644 > --- a/include/linux/blkdev.h > +++ b/include/linux/blkdev.h > @@ -1287,6 +1287,7 @@ static inline unsigned int bdev_discard_granularity(struct block_device *bdev) > > /* maximum copy offload length, this is set to 128MB based on current testing */ > #define BLK_COPY_MAX_BYTES (1 << 27) > +#define BLK_COPY_MAX_SEGMENTS 2 ... and this doesn't belong into a NVMe patch. I'd also expect that the block layer would verify this before sending of the request to the driver. > diff --git a/include/linux/nvme.h b/include/linux/nvme.h > index 425573202295..5275a0962a02 100644 > --- a/include/linux/nvme.h > +++ b/include/linux/nvme.h Note that we've usually kept adding new protocol bits to nvme.h separate from the implementation in the host or target code.