[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] Correct reporting of unmap granularity


  • To: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>, "win-pv-devel@xxxxxxxxxxxxxxxxxxxx" <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Owen Smith <owen.smith@xxxxxxxxxx>
  • Date: Mon, 8 Jun 2026 06:48:11 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xvUUHt6Kx0pMjpcAGtT4p7kHwUavtibRi2uWxL1b8qY=; b=AjU4l3kHlKxlmxiLnXzoUJyH3moEnzMEEZemq8iWE1QYq5xIuogaygD1/5g/2Wxdd1BdNJ/2D5RcSJARVLruV5EIu/0CBsvCQ73SfCEUm6bAIy06bqRpGghffe7NVM2DFjCa13aqGQf6H61yUznqMluU02AEk2mub1TmhSWPxzjqi8DJazgr42K9qM4VBpwmKb482QSlt66uK+trhvaZZefE5PKZiTnXvpItzdIMDwRk2CGZKxLJkSGpFugEIAn297iqJ1+9wyv2OUAo61WzUu80GH8egpLDmGqvU16fBSSI2kgkgEYml740ib0V5IhTj241ue2BLFan1VgQv/BdzA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qbY/hbcLasA9rcnqoF8hUsWokZsSdENpRV8trbxd+wGMcB3eY+6kxpj+ZFYgF5AsFxqfYyw0xczzPS1cYyo/Y0YC+c9Qq0gzbEsebUgPKnusl3JcSTyAW4fRu3ra6v465FEs20pYNx/eEUaWatttasDGbofbKp3AD1neHtnUkrUyOjKgZ7gQtCp+dCCcwRkHOstFgqMRVOGsdlwh5DEw5/Cov067hIVhS5gao+cREwidUB6OfGixfEHVk/u9EUn+xMkUDbv7vRJyT8nsOzarbgBlShZQ/wxKcj8SVGfmgDln8tru2YSZ6AFP2fGTED9oVmVycKh0CT5eR18rrtNMgA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Delivery-date: Mon, 08 Jun 2026 06:48:17 +0000
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>
  • Msip_labels:
  • Thread-index: AQHc1unNeM3DnoJu40mhVfcOjyOqPbYx53iAgAKQLXc=
  • Thread-topic: [PATCH 1/2] Correct reporting of unmap granularity

Sorry, I missed this 1 (and its other part)

Reviewed-by: Owen Smith <owen.smith@xxxxxxxxxx>

________________________________________
From: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
Sent: 06 June 2026 4:39 PM
To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
Cc: Owen Smith
Subject: Re: [PATCH 1/2] Correct reporting of unmap granularity

Hi,

I'd like to send a quick reminder for this patch.

On 28/04/2026 10:34, Tu Dinh wrote:
> blkif.h specifies discard-alignment and discard-granularity as being in
> byte unit. These values must be converted to LBA unit in the
> corresponding inquiry outputs.
>
> Signed-off-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
> ---
>   src/xenvbd/target.c | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/src/xenvbd/target.c b/src/xenvbd/target.c
> index e4a9c03..102e8b8 100644
> --- a/src/xenvbd/target.c
> +++ b/src/xenvbd/target.c
> @@ -842,6 +842,7 @@ TargetInquiryB0(
>       )
>   {
>       PXENVBD_FEATURES        Features = 
> FrontendGetFeatures(Target->Frontend);
> +    PXENVBD_DISKINFO        DiskInfo = FrontendGetDiskInfo(Target->Frontend);
>       PVPD_BLOCK_LIMITS_PAGE  Data = Srb->DataBuffer;
>       ULONG                   Length = Srb->DataTransferLength;
>
> @@ -867,8 +868,10 @@ TargetInquiryB0(
>        * default.
>        */
>       *(PULONG)Data->MaximumUnmapBlockDescriptorCount = _byteswap_ulong(8);
> -    *(PULONG)Data->OptimalUnmapGranularity = 
> _byteswap_ulong(Features->DiscardGranularity);
> -    *(PULONG)Data->UnmapGranularityAlignment = 
> _byteswap_ulong(Features->DiscardAlignment);
> +    *(PULONG)Data->OptimalUnmapGranularity =
> +        _byteswap_ulong(Features->DiscardGranularity / DiskInfo->SectorSize);
> +    *(PULONG)Data->UnmapGranularityAlignment =
> +        _byteswap_ulong(Features->DiscardAlignment / DiskInfo->SectorSize);
>       // alignment is only valid if a granularity has been set
>       Data->UGAValid = (Features->DiscardGranularity != 0) ? 1 : 0;
>



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.