From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.server123.net (Postfix) with ESMTPS for ; Thu, 24 Sep 2020 19:38:35 +0200 (CEST) MIME-Version: 1.0 Message-ID: <7b6fdfd5-0160-4bcf-b7ed-d0e51553c678@default> Date: Thu, 24 Sep 2020 10:38:26 -0700 (PDT) From: Sudhakar Panneerselvam Sender: Sudhakar Panneerselvam References: <1600281606-1446-1-git-send-email-sudhakar.panneerselvam@oracle.com> <3be1ea32-b6a8-41ef-a9ba-ed691434d068@default> <20200924012732.GA10766@redhat.com> <20200924051419.GA16103@sol.localdomain> <252587bb-c0b7-47c9-a97b-91422f8f9c47@default> In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Re: [dm-crypt] [dm-devel] [RFC PATCH 0/2] dm crypt: Allow unaligned buffer lengths for skcipher devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mikulas Patocka Cc: Eric Biggers , Mike Snitzer , Damien.LeMoal@wdc.com, ssudhakarp@gmail.com, Martin Petersen , dm-crypt@saout.de, dm-devel@redhat.com, Shirley Ma , Milan Broz , agk@redhat.com Hi Mikulas, > > Windows Guest <--> Vhost-Scsi <--> LIO(scsi/target/blockio) <--> dm-cr= ypt > <--> iSCSI block device > > > > One real example out of my debugging: Windows sends a I/O request with > > 6656 bytes to vhost-scsi interface. Vhost-scsi uses translate_desc() in > > drivers/vhost/vhost.c to convert windows user space memory buffers to > > kernel iovecs. Vhost-scsi then converts the iovecs to sg entries in > > vhost_scsi_mapal() which is then handed over to "target" subsystem and > > eventually submitted to dm-crypt. This 6656 bytes IO has got 3 segments= , > > first segment had 1584, second 4096 and the last had 976 bytes. Dm-cryp= t > > rejects the I/O after seeing the first segment length 1584 which is not > > a 512 byte multiple. > > > > Let me know if there are further questions. > > > > Thanks > > Sudhakar >=20 > Hi >=20 > I think it should be fixed in vhost-scsi. In the above example of 6656 bytes I/O, windows allocates 6656 bytes virtua= lly contiguous I/O. This IO, when it lands in the kernel, translates to 3 p= hysically discontiguous pages, that's why translate_desc() had to create 3 = iovecs to handle this I/O. I don't understand how vhost-scsi could have sol= ved this issue. Only other possibility I see is to have windows fix it by a= lways sending 512 byte aligned buffer lengths, but going with my earlier po= int that every other component in the Linux IO path handles this case well = except for dm-crypt, so it make more sense to fix it in dm-crypt. Thanks Sudhakar >=20 > Mikulas >=20