Skip to contentSkip to conversation

Add descriptor definitions for a few new DSA operations

PATCH Superseded Fenghua Yu 2 participants 5 messages Nov 8, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Fenghua Yu

author
#0 lore raw

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.

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 | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
Signature · 1 line
2.32.0
author
#1 lore raw

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

---
 include/uapi/linux/idxd.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/uapi/linux/idxd.h +6 -0
index 095299c75828..04a2f6411820 100644
@@ -179,6 +179,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;
@@ -243,6 +244,11 @@ struct dsa_hw_desc {
 			uint16_t	dest_app_tag_seed;
 		};
 
+		/* Fill */
+		struct {
+			uint64_t	pattern_upper;
+		};
+
 		uint8_t		op_specific[24];
 	};
 } __attribute__((packed));
Signature · 1 line
2.32.0
author
#4 lore raw

PATCH 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 decriptor 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 34294d99c1cb..9de48c561452 100644
@@ -71,6 +71,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,
@@ -181,6 +182,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;
@@ -191,6 +193,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;
@@ -250,6 +253,12 @@ struct dsa_hw_desc {
 			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.32.0
author
#3 lore raw

PATCH 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 04a2f6411820..34294d99c1cb 100644
@@ -77,6 +77,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,
 };
 
@@ -249,6 +250,17 @@ struct dsa_hw_desc {
 			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));
@@ -327,6 +339,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.32.0
reviewer
#2 lore raw

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

In reply to Fenghua Yu
Quoted 28 lines · Fenghua Yu

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.

---
  include/uapi/linux/idxd.h | 6 ++++++
  1 file changed, 6 insertions(+)
include/uapi/linux/idxd.h +1 -0
index 095299c75828..04a2f6411820 100644
@@ -179,6 +179,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;

include/uapi/linux/idxd.h struct dsa_hw_desc { · line 248

Quoted 5 lines
include/uapi/linux/idxd.h +2 -0
@@ -243,6 +244,11 @@ struct dsa_hw_desc {
  			uint16_t	dest_app_tag_seed;
  		};
 
+		/* Fill */
+		struct {

I don't think the anon struct is needed here. If there are others, that can be added later with the next patch that needs it.

Quoted 6 lines
include/uapi/linux/idxd.h +3 -0
+			uint64_t	pattern_upper;
+		};
+
  		uint8_t		op_specific[24];
  	};
  } __attribute__((packed));