Skip to contentSkip to conversation

Add descriptor definitions for a few new DSA operations

PATCH Applied Fenghua Yu 2 participants 7 messages Mar 3, 2023 – Mar 31, 2023

Subsystems (2)
lore
Share & tools
lore

Fenghua Yu

author
#0 lore raw

v2 cover Add descriptor definitions for a few new DSA operations

A few new DSA operations are introduced [1]:
1. Memory fill with 16 bytes of pattern.
2. Translation fetch.
3. Data Integrity Extension (DIX) generate.

This series adds descriptor definitions for the new DSA operations. With the definitions, user can issue the DSA operations to optimize corresponding transactions.

Change log:
v2:
- Change anonymous struct to uint64_t for pattern_upper (Dave Jiang) v1:
https://lore.kernel.org/dmaengine/[email protected]/

Reference:
1. DSA 2.0 spec: https://software.intel.com/content/www/us/en/develop/articles/intel-data-streaming-accelerator-architecture-specification.html

Fenghua Yu (3):
dmaengine: idxd: Add descriptor definitions for 16 bytes of pattern in
memory fill operation
dmaengine: idxd: Add descriptor definitions for DIX generate operation
dmaengine: idxd: Add descriptor definitions for translation fetch
operation

 include/uapi/linux/idxd.h | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
Signature · 1 line
2.37.1
author
#1 lore raw

PATCH v2 1/3 dmaengine: idxd: Add descriptor definitions for 16 bytes of pattern in memory fill operation

The memory fill operation (0x04) can fill in memory with either 8 bytes or 16 bytes of pattern. To fill in memory with 16 bytes of pattern, the first 8 bytes are provided in pattern lower in bytes 16-23 and the next 8 bytes are in pattern upper in bytes 40-47 in the descriptor. Currently only 8 bytes of pattern is enabled.

Add descriptor definitions for pattern lower and pattern upper so that user can use 16 bytes of pattern to fill memory.

---
v2:
- Change anonymous struct to uint64_t for pattern_upper (Dave Jiang)

 include/uapi/linux/idxd.h | 4 ++++
 1 file changed, 4 insertions(+)
include/uapi/linux/idxd.h +4 -0
index 1d553bedbdb5..c43d7df5fc15 100644
@@ -180,6 +180,7 @@ struct dsa_hw_desc {
 		uint64_t	rdback_addr;
 		uint64_t	pattern;
 		uint64_t	desc_list_addr;
+		uint64_t	pattern_lower;
 	};
 	union {
 		uint64_t	dst_addr;
@@ -244,6 +245,9 @@ struct dsa_hw_desc {
 			uint16_t	dest_app_tag_seed;
 		};
 
+		/* Fill */
+		uint64_t	pattern_upper;
+
 		uint8_t		op_specific[24];
 	};
 } __attribute__((packed));
Signature · 1 line
2.37.1
author
#2 lore raw

PATCH v2 2/3 dmaengine: idxd: Add descriptor definitions for DIX generate operation

In reply to Fenghua Yu

The Data Integrity Extension (DIX) generate operation (0x17) computes the Data Integrity Field (DIF) on the source data and writes only the computed DIF for each source block to the PI destination address.

Add descriptor definitions for this operation so that user can use DSA to accelerate DIX generate operation.

---
 include/uapi/linux/idxd.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
include/uapi/linux/idxd.h +20 -0
index c43d7df5fc15..4c12e93a6aa6 100644
@@ -78,6 +78,7 @@ enum dsa_opcode {
 	DSA_OPCODE_DIF_INS,
 	DSA_OPCODE_DIF_STRP,
 	DSA_OPCODE_DIF_UPDT,
+	DSA_OPCODE_DIX_GEN = 0x17,
 	DSA_OPCODE_CFLUSH = 0x20,
 };
 
@@ -248,6 +249,17 @@ struct dsa_hw_desc {
 		/* Fill */
 		uint64_t	pattern_upper;
 
+		/* DIX generate */
+		struct {
+			uint8_t		dix_gen_res;
+			uint8_t		dest_dif_flags;
+			uint8_t		dif_flags;
+			uint8_t		dix_gen_res2[13];
+			uint32_t	ref_tag_seed;
+			uint16_t	app_tag_mask;
+			uint16_t	app_tag_seed;
+		};
+
 		uint8_t		op_specific[24];
 	};
 } __attribute__((packed));
@@ -326,6 +338,14 @@ struct dsa_completion_record {
 			uint16_t	dif_upd_dest_app_tag;
 		};
 
+		/* DIX generate */
+		struct {
+			uint64_t	dix_gen_res;
+			uint32_t	dix_ref_tag;
+			uint16_t	dix_app_tag_mask;
+			uint16_t	dix_app_tag;
+		};
+
 		uint8_t		op_specific[16];
 	};
 } __attribute__((packed));
Signature · 1 line
2.37.1
author
#3 lore raw

PATCH v2 3/3 dmaengine: idxd: Add descriptor definitions for translation fetch operation

In reply to Fenghua Yu

The translation fetch operation (0x0A) fetches address translations for the address range specified in the descriptor by issuing address translation (ATS) requests to the IOMMU.

Add descriptor definitions for the operation so that user can use DSA to accelerate translation fetch.

---
 include/uapi/linux/idxd.h | 9 +++++++++
 1 file changed, 9 insertions(+)
include/uapi/linux/idxd.h +9 -0
index 4c12e93a6aa6..fc47635b57dc 100644
@@ -72,6 +72,7 @@ enum dsa_opcode {
 	DSA_OPCODE_CR_DELTA,
 	DSA_OPCODE_AP_DELTA,
 	DSA_OPCODE_DUALCAST,
+	DSA_OPCODE_TRANSL_FETCH,
 	DSA_OPCODE_CRCGEN = 0x10,
 	DSA_OPCODE_COPY_CRC,
 	DSA_OPCODE_DIF_CHECK,
@@ -182,6 +183,7 @@ struct dsa_hw_desc {
 		uint64_t	pattern;
 		uint64_t	desc_list_addr;
 		uint64_t	pattern_lower;
+		uint64_t	transl_fetch_addr;
 	};
 	union {
 		uint64_t	dst_addr;
@@ -192,6 +194,7 @@ struct dsa_hw_desc {
 	union {
 		uint32_t	xfer_size;
 		uint32_t	desc_count;
+		uint32_t	region_size;
 	};
 	uint16_t	int_handle;
 	uint16_t	rsvd1;
@@ -249,6 +252,12 @@ struct dsa_hw_desc {
 		/* Fill */
 		uint64_t	pattern_upper;
 
+		/* Translation fetch */
+		struct {
+			uint64_t	transl_fetch_res;
+			uint32_t	region_stride;
+		};
+
 		/* DIX generate */
 		struct {
 			uint8_t		dix_gen_res;
Signature · 1 line
2.37.1
author
#4 lore raw
In reply to Fenghua Yu

Hi, Vinod,

Quoted 8 lines · Fenghua Yu

A few new DSA operations are introduced [1]:
1. Memory fill with 16 bytes of pattern.
2. Translation fetch.
3. Data Integrity Extension (DIX) generate.

This series adds descriptor definitions for the new DSA operations. With the definitions, user can issue the DSA operations to optimize corresponding transactions.

Any comment on this patch set? Will you pick it up? This can be applied cleanly to upstream kernel.

Thank you very much!

-Fenghua

maintainer Applied
#5 lore raw
In reply to Fenghua Yu
Quoted 8 lines · Fenghua Yu

A few new DSA operations are introduced [1]:
1. Memory fill with 16 bytes of pattern.
2. Translation fetch.
3. Data Integrity Extension (DIX) generate.

This series adds descriptor definitions for the new DSA operations. With the definitions, user can issue the DSA operations to optimize corresponding transactions.

Applied, thanks

Signature · 1 line
~Vinod
author
#6 lore raw
Quoted 6 lines · Vinod Koul
Quoted 5 lines · Fenghua Yu

A few new DSA operations are introduced [1]:
1. Memory fill with 16 bytes of pattern.
2. Translation fetch.
3. Data Integrity Extension (DIX) generate.

Quoted 6 lines
Quoted 3 lines

This series adds descriptor definitions for the new DSA operations. With the definitions, user can issue the DSA operations to optimize corresponding transactions.

Applied, thanks

Thank you, Vinod!

-Fenghua