History

ublk: add DMA alignment limit

The in-tree ublk driver doesn't need DMA alignment limit because there is one data copy between request pages and the userspace buffer. However, ublk is going to support zero copy, then DMA alignment limit is required, because same IO buffer is forwarded to backend which may have specific buffer DMA alignment limit, so the limit has to be exposed from the frontend driver to client application.

Ming Lei committed 1 year ago

Commit e84025d1 parent 105ca2a2 files · +22 −1Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/ublk_cmd.h+7−0
@@ -401,6 +401,11 @@ struct ublk_param_zoned { · 400 unmodified lines
401401 __u8 reserved[20];
402402 };
403403
404+struct ublk_param_dma_align {
405+ __u32 alignment;
406+ __u8 pad[4];
407+};
408+
404409 struct ublk_params {
405410 /*
406411 * Total length of parameters, userspace has to set 'len' for both
@@ -413,12 +418,14 @@ struct ublk_params { · 6 unmodified lines
413418 #define UBLK_PARAM_TYPE_DISCARD (1 << 1)
414419 #define UBLK_PARAM_TYPE_DEVT (1 << 2)
415420 #define UBLK_PARAM_TYPE_ZONED (1 << 3)
421+#define UBLK_PARAM_TYPE_DMA_ALIGN (1 << 4)
416422 __u32 types; /* types of parameter included */
417423
418424 struct ublk_param_basic basic;
419425 struct ublk_param_discard discard;
420426 struct ublk_param_devt devt;
421427 struct ublk_param_zoned zoned;
428+ struct ublk_param_dma_align dma;
422429 };
423430
424431 #endif