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

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


  • To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
  • Date: Sat, 6 Jun 2026 17:39:23 +0200
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
  • Cc: Owen Smith <owen.smith@xxxxxxxxxx>
  • Delivery-date: Sat, 06 Jun 2026 15:39:30 +0000
  • Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

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®.