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

[RFC PATCH 3/6] Report max unmap LBA and block descriptor counts



These values are needed in the Block Limits VPD page in order to show
that unmap is supported.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
---
 src/xenvbd/target.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/xenvbd/target.c b/src/xenvbd/target.c
index 1c6944f..5109281 100644
--- a/src/xenvbd/target.c
+++ b/src/xenvbd/target.c
@@ -829,6 +829,16 @@ TargetInquiryB0(
     Data->PageCode = VPD_BLOCK_LIMITS;
     Data->PageLength[1] = 0x3C; // as per spec
 
+    *(PULONG)Data->MaximumUnmapLBACount = _byteswap_ulong(ULONG_MAX);
+    /*
+     * Each discarded extent requires its own BLKIF_OP_DISCARD request. We 
don't
+     * want to consume the entire ring at once, but the optimal value might not
+     * be 1 either.
+     * Since the ring can hold anywhere from 32 requests (with 1 ring page) to
+     * 512 requests (using XENVBD_MAX_RING_PAGE_ORDER), use 8 as a conservative
+     * default.
+     */
+    *(PULONG)Data->MaximumUnmapBlockDescriptorCount = _byteswap_ulong(8);
     *(PULONG)Data->OptimalUnmapGranularity = 
_byteswap_ulong(Features->DiscardGranularity);
     *(PULONG)Data->UnmapGranularityAlignment = 
_byteswap_ulong(Features->DiscardAlignment);
     // alignment is only valid if a granularity has been set
-- 
2.51.2.windows.1



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