dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Add descriptor definitions for a few new DSA operations
@ 2023-03-03 21:34 Fenghua Yu
  2023-03-03 21:34 ` [PATCH v2 1/3] dmaengine: idxd: Add descriptor definitions for 16 bytes of pattern in memory fill operation Fenghua Yu
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Fenghua Yu @ 2023-03-03 21:34 UTC (permalink / raw)
  To: Vinod Koul, Dave Jiang; +Cc: dmaengine, linux-kernel, 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.

Change log:
v2:
- Change anonymous struct to uint64_t for pattern_upper (Dave Jiang)
v1:
https://lore.kernel.org/dmaengine/20221108003944.2095567-1-fenghua.yu@intel.com/

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(+)

-- 
2.37.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 1/3] dmaengine: idxd: Add descriptor definitions for 16 bytes of pattern in memory fill operation
  2023-03-03 21:34 [PATCH v2 0/3] Add descriptor definitions for a few new DSA operations Fenghua Yu
@ 2023-03-03 21:34 ` Fenghua Yu
  2023-03-03 21:34 ` [PATCH v2 2/3] dmaengine: idxd: Add descriptor definitions for DIX generate operation Fenghua Yu
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Fenghua Yu @ 2023-03-03 21:34 UTC (permalink / raw)
  To: Vinod Koul, Dave Jiang; +Cc: dmaengine, linux-kernel, 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.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
---
v2:
- Change anonymous struct to uint64_t for pattern_upper (Dave Jiang)

 include/uapi/linux/idxd.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/uapi/linux/idxd.h b/include/uapi/linux/idxd.h
index 1d553bedbdb5..c43d7df5fc15 100644
--- a/include/uapi/linux/idxd.h
+++ b/include/uapi/linux/idxd.h
@@ -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));
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 2/3] dmaengine: idxd: Add descriptor definitions for DIX generate operation
  2023-03-03 21:34 [PATCH v2 0/3] Add descriptor definitions for a few new DSA operations Fenghua Yu
  2023-03-03 21:34 ` [PATCH v2 1/3] dmaengine: idxd: Add descriptor definitions for 16 bytes of pattern in memory fill operation Fenghua Yu
@ 2023-03-03 21:34 ` Fenghua Yu
  2023-03-03 21:34 ` [PATCH v2 3/3] dmaengine: idxd: Add descriptor definitions for translation fetch operation Fenghua Yu
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Fenghua Yu @ 2023-03-03 21:34 UTC (permalink / raw)
  To: Vinod Koul, Dave Jiang; +Cc: dmaengine, linux-kernel, 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.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
---
 include/uapi/linux/idxd.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/include/uapi/linux/idxd.h b/include/uapi/linux/idxd.h
index c43d7df5fc15..4c12e93a6aa6 100644
--- a/include/uapi/linux/idxd.h
+++ b/include/uapi/linux/idxd.h
@@ -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));
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 3/3] dmaengine: idxd: Add descriptor definitions for translation fetch operation
  2023-03-03 21:34 [PATCH v2 0/3] Add descriptor definitions for a few new DSA operations Fenghua Yu
  2023-03-03 21:34 ` [PATCH v2 1/3] dmaengine: idxd: Add descriptor definitions for 16 bytes of pattern in memory fill operation Fenghua Yu
  2023-03-03 21:34 ` [PATCH v2 2/3] dmaengine: idxd: Add descriptor definitions for DIX generate operation Fenghua Yu
@ 2023-03-03 21:34 ` Fenghua Yu
  2023-03-29  2:05 ` [PATCH v2 0/3] Add descriptor definitions for a few new DSA operations Fenghua Yu
  2023-03-31 11:55 ` Vinod Koul
  4 siblings, 0 replies; 7+ messages in thread
From: Fenghua Yu @ 2023-03-03 21:34 UTC (permalink / raw)
  To: Vinod Koul, Dave Jiang; +Cc: dmaengine, linux-kernel, 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.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
---
 include/uapi/linux/idxd.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/uapi/linux/idxd.h b/include/uapi/linux/idxd.h
index 4c12e93a6aa6..fc47635b57dc 100644
--- a/include/uapi/linux/idxd.h
+++ b/include/uapi/linux/idxd.h
@@ -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;
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 0/3] Add descriptor definitions for a few new DSA operations
  2023-03-03 21:34 [PATCH v2 0/3] Add descriptor definitions for a few new DSA operations Fenghua Yu
                   ` (2 preceding siblings ...)
  2023-03-03 21:34 ` [PATCH v2 3/3] dmaengine: idxd: Add descriptor definitions for translation fetch operation Fenghua Yu
@ 2023-03-29  2:05 ` Fenghua Yu
  2023-03-31 11:55 ` Vinod Koul
  4 siblings, 0 replies; 7+ messages in thread
From: Fenghua Yu @ 2023-03-29  2:05 UTC (permalink / raw)
  To: Vinod Koul, Dave Jiang; +Cc: dmaengine, linux-kernel

Hi, Vinod,

On 3/3/23 13:34, Fenghua Yu wrote:
> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 0/3] Add descriptor definitions for a few new DSA operations
  2023-03-03 21:34 [PATCH v2 0/3] Add descriptor definitions for a few new DSA operations Fenghua Yu
                   ` (3 preceding siblings ...)
  2023-03-29  2:05 ` [PATCH v2 0/3] Add descriptor definitions for a few new DSA operations Fenghua Yu
@ 2023-03-31 11:55 ` Vinod Koul
  2023-03-31 15:56   ` Fenghua Yu
  4 siblings, 1 reply; 7+ messages in thread
From: Vinod Koul @ 2023-03-31 11:55 UTC (permalink / raw)
  To: Fenghua Yu; +Cc: Dave Jiang, dmaengine, linux-kernel

On 03-03-23, 13:34, Fenghua Yu wrote:
> 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

-- 
~Vinod

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 0/3] Add descriptor definitions for a few new DSA operations
  2023-03-31 11:55 ` Vinod Koul
@ 2023-03-31 15:56   ` Fenghua Yu
  0 siblings, 0 replies; 7+ messages in thread
From: Fenghua Yu @ 2023-03-31 15:56 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Dave Jiang, dmaengine, linux-kernel



On 3/31/23 04:55, Vinod Koul wrote:
> On 03-03-23, 13:34, Fenghua Yu wrote:
>> 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
> 

Thank you, Vinod!

-Fenghua

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-03-31 15:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-03 21:34 [PATCH v2 0/3] Add descriptor definitions for a few new DSA operations Fenghua Yu
2023-03-03 21:34 ` [PATCH v2 1/3] dmaengine: idxd: Add descriptor definitions for 16 bytes of pattern in memory fill operation Fenghua Yu
2023-03-03 21:34 ` [PATCH v2 2/3] dmaengine: idxd: Add descriptor definitions for DIX generate operation Fenghua Yu
2023-03-03 21:34 ` [PATCH v2 3/3] dmaengine: idxd: Add descriptor definitions for translation fetch operation Fenghua Yu
2023-03-29  2:05 ` [PATCH v2 0/3] Add descriptor definitions for a few new DSA operations Fenghua Yu
2023-03-31 11:55 ` Vinod Koul
2023-03-31 15:56   ` Fenghua Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).