From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKQ13-0005Fd-Q1 for qemu-devel@nongnu.org; Tue, 05 Jul 2016 09:03:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKQ0y-0008ME-MM for qemu-devel@nongnu.org; Tue, 05 Jul 2016 09:03:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57782) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKQ0y-0008Lu-EQ for qemu-devel@nongnu.org; Tue, 05 Jul 2016 09:03:48 -0400 References: <577A6955.6020603@kamp.de> <577B130A.3040205@redhat.com> <577B620A.5010202@kamp.de> From: Eric Blake Message-ID: <577BB031.8000902@redhat.com> Date: Tue, 5 Jul 2016 07:03:45 -0600 MIME-Version: 1.0 In-Reply-To: <577B620A.5010202@kamp.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2eh5F6w63Lrus8EDQXO5qxkk6u7s24scr" Subject: Re: [Qemu-devel] Regression: block: Add .bdrv_co_pwrite_zeroes() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven , "qemu-devel@nongnu.org" Cc: Kevin Wolf This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --2eh5F6w63Lrus8EDQXO5qxkk6u7s24scr From: Eric Blake To: Peter Lieven , "qemu-devel@nongnu.org" Cc: Kevin Wolf Message-ID: <577BB031.8000902@redhat.com> Subject: Re: Regression: block: Add .bdrv_co_pwrite_zeroes() References: <577A6955.6020603@kamp.de> <577B130A.3040205@redhat.com> <577B620A.5010202@kamp.de> In-Reply-To: <577B620A.5010202@kamp.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/05/2016 01:30 AM, Peter Lieven wrote: > Am 05.07.2016 um 03:53 schrieb Eric Blake: >> On 07/04/2016 07:49 AM, Peter Lieven wrote: >>> Hi, >>> >>> the above commit: >>> >>> commit d05aa8bb4a8b6aa9a915ec5074fb12ae632d2323 >>> Author: Eric Blake >>> Date: Wed Jun 1 15:10:03 2016 -0600 >>> >>> block: Add .bdrv_co_pwrite_zeroes() >>> >>> introduces a regression (at least for me). >>> >>> The Limits from the iSCSI Block Limits VPD have no requirement of bei= ng >>> a power of two. >>> We use Dell Equallogic iSCSI SANs for instance. They have an internal= >>> page size of 15MB. And >>> they advertise this page size as max_ws_len, opt_transfer_len and >>> opt_discard_alignment. >> A non-power-of-2 max_ws_len shouldn't be a problem, but opt_transfer_l= en >> and opt_discard_alignment not being a power of 2 impacts other code. >> 15MB is a rather odd page size. >=20 > I know, not my idea ;-) I think at least opt_discard_alignment of 15MB > used to work > before. Does this fix it for you? diff --git i/block/iscsi.c w/block/iscsi.c index 9bb5ff6..556486c 100644 --- i/block/iscsi.c +++ w/block/iscsi.c @@ -1732,12 +1732,12 @@ static void iscsi_refresh_limits(BlockDriverState *bs, Error **errp) } if (iscsilun->lbp.lbpws) { bs->bl.pwrite_zeroes_alignment =3D - iscsilun->bl.opt_unmap_gran * iscsilun->block_size; + pow2floor(iscsilun->bl.opt_unmap_gran * iscsilun->block_size= ); } else { bs->bl.pwrite_zeroes_alignment =3D iscsilun->block_size; } bs->bl.opt_transfer_length =3D - sector_limits_lun2qemu(iscsilun->bl.opt_xfer_len, iscsilun); + pow2floor(sector_limits_lun2qemu(iscsilun->bl.opt_xfer_len, iscsilun)); } /* Note that this will not re-establish a connection with an iSCSI target - it One of those two hunks is covered by my pending 'block: Switch discard length bounds to byte-based' making its way through the block queue review, so if it works for you, I just need to formalize the patch for the pwrite_zeroes_alignment. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --2eh5F6w63Lrus8EDQXO5qxkk6u7s24scr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXe7AxAAoJEKeha0olJ0Nq6v0IAIHnq6PWs6Dte2KBRMRy+idI ZYyqC7Gcb+vAWnlYLURiNMTH9qMzr9h1iy6YqJBwMV2HWipJN4vbQfgE6IAiJU8r BDM/UJntncUEshHzeTSfL5UffpppkYbDyakFFv0Yjn5bWSuLq30BGpGSD7ohB2vZ rD8iyK6ICyULhFy2Zj3FVFVR8Yxzxj0s4KnWOTcanUXBFT8s/Y5SCWUDHifciZuA FwEgllCQtW9fWHD/4brVO0UG6OBnkGLNFkFEqAeXC07CqEKFlD3b6pOvhR9QOwIw cCw0lJ6w7csrGYO0vX1diSGahCRbepsY5ZTEp+zqOnhSJ+pOjInttfelx4o71Ac= =dDvc -----END PGP SIGNATURE----- --2eh5F6w63Lrus8EDQXO5qxkk6u7s24scr--