From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sagi Grimberg Subject: Re: [PATCH 10/11] nvmet-tcp: add NVMe over TCP target driver Date: Mon, 19 Nov 2018 15:24:13 -0800 Message-ID: <0de07d6d-ed90-df0e-5710-1f5cdddd6187@grimberg.me> References: <21b60ffc-d9eb-2f2e-fa1a-891f7f8d5239@grimberg.me> <20181119.145343.2254073323355763213.davem@davemloft.net> <20181119.151805.2250212740843808194.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: sagi@lightbitslabs.com, linux-block@vger.kernel.org, netdev@vger.kernel.org, keith.busch@intel.com, hch@lst.de, linux-nvme@lists.infradead.org To: David Miller Return-path: Received: from mail-oi1-f196.google.com ([209.85.167.196]:42727 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725722AbeKTJuT (ORCPT ); Tue, 20 Nov 2018 04:50:19 -0500 In-Reply-To: <20181119.151805.2250212740843808194.davem@davemloft.net> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: >> Also, looking a bit closer there is a slight difference between the >> copy vs. the copy_and_csum variants. copy allows for a short_copy if >> we copy less than we expect while the csum faults it. I'm thinking >> that the copy_and_hash variant should also fault? Although I'm not >> sure I understand the fault entirely as csum is supposed to be >> cumulative, any insight? > > When we are writing and signal an error, sockets have this recurring > pattern where we return immediately the amount of bytes successfully > transferred. Then on the next sendmsg() call we give the error. > > I don't know if that is what is influencing the behavior here or not > but it could be. That makes sense... Does recvmsg() have the same semantics? this is the rx path where we copy fragments to an iter.. If so, I guess that it makes sense that we fault and not allow short copies as we have an incomplete csum in this case... I'm wandering how we can consolidate the code paths together with this subtle difference? Perhaps a short_copy flag?