Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9226555rwp; Thu, 20 Jul 2023 01:16:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlGvEyb/Gp4J0A35GzmkZhWa3aNok6NLBpKv25bIKqJsv86D6TEH1+SUmOctqDotfGYd8YSI X-Received: by 2002:a05:6512:1115:b0:4fa:f79f:85a with SMTP id l21-20020a056512111500b004faf79f085amr1280869lfg.69.1689840961201; Thu, 20 Jul 2023 01:16:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689840961; cv=none; d=google.com; s=arc-20160816; b=pZEuxk1vAFU0WUut+/4q/6jxl9GpPppJ0HQPhP2NMrPdpHsfF1wmyn3ey7Z9nM/8vE ruAzlit+T4LYtQobIFcu/vnES4yDm0fP4yzO+wiSavFVEllSETcOnj5f8nJkMl7NcW8o EJSV0F1GwO0oB3pv3ouK915eNZjUpsjSAqV5C2qCMFzE87SC8gxzAhkpBV2ISGe+sovq aYQ9+gEEK2iUewcXG+bjNGwHu3gsuGvTgL4GcEBPlziibrQx5tHu4Uk3vhPtKV7N4ic2 yYX41KrmSZ/fPkUpebuJTkqC8SJvzVvL6T9xOwBdnQ/yUz32T+KV1GLziMiXgBWVuA7X W5cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=gk3Ip9dCbQyHmuypkjiG3tOvL5BFP6Tkj1TMbP+cGKc=; fh=D8mFhKXgkwZI5G0LAYWpDTnM3AqMDLZ8EmsH1rhgNFQ=; b=js9Er+B3N2vGw3A6saVczXsiTcZkzGeO4ghSLguSH1ghKDEDCSD4YjUL69LoQelTwg QsCkUgJmFnjslAetJjCI9JS09abKJFTbAdC2XW2/0gHgON3c/gd4VXLZsw0YD8pZfKem 8tO4Mz2NsYt8AU0YlxWH0yU66UilcFVPdOpma426ByKwcz1fOUMDLkM+iifdB9d1wVR8 aWWyWZ8j4h+iwSQGDracQzWMlqcUlWwiExAo/8TFeNEAgH6Z0eCH96irBEBE5NszEc4s 2dy58dV7ZmR1nz5rCCBs1qhGeEmKl4TlUf0iipzR1EQKpqdYHzTwirGNeL7mOfgbiT/n LrYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c19-20020a170906341300b0098dfd35276esi305904ejb.1055.2023.07.20.01.15.36; Thu, 20 Jul 2023 01:16:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229699AbjGTIAc (ORCPT + 99 others); Thu, 20 Jul 2023 04:00:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229814AbjGTIAb (ORCPT ); Thu, 20 Jul 2023 04:00:31 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAA352684; Thu, 20 Jul 2023 01:00:29 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 98BAB6732D; Thu, 20 Jul 2023 10:00:26 +0200 (CEST) Date: Thu, 20 Jul 2023 10:00:26 +0200 From: Christoph Hellwig To: Nitesh Shetty Cc: Jens Axboe , Jonathan Corbet , Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, Keith Busch , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , Alexander Viro , Christian Brauner , martin.petersen@oracle.com, linux-scsi@vger.kernel.org, willy@infradead.org, hare@suse.de, djwong@kernel.org, bvanassche@acm.org, ming.lei@redhat.com, dlemoal@kernel.org, nitheshshetty@gmail.com, gost.dev@samsung.com, Kanchan Joshi , Javier =?iso-8859-1?Q?Gonz=E1lez?= , Anuj Gupta , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-nvme@lists.infradead.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v13 5/9] nvme: add copy offload support Message-ID: <20230720080026.GB6246@lst.de> References: <20230627183629.26571-1-nj.shetty@samsung.com> <20230627183629.26571-6-nj.shetty@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230627183629.26571-6-nj.shetty@samsung.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > + if (blk_rq_nr_phys_segments(req) != 2) > + return BLK_STS_IOERR; The magic number of segments adding up source and dest really need constants and helpers to make the code understandable. > + /* +1 shift as dst+src length is added in request merging, we send copy > + * for half the length. > + */ > + n_lba = blk_rq_bytes(req) >> (ns->lba_shift + 1); I do not understand the logic and comment here. > + if (WARN_ON(!n_lba)) WARN_ON_ONCE > + return BLK_STS_NOTSUPP; and BLK_STS_NOTSUPP seems like the wrong error here, this is an invalid argument.