2023-03-03 21:34:28

by Fenghua Yu

[permalink] [raw]
Subject: [PATCH v2 0/3] 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(+)

--
2.37.1



2023-03-03 21:34:30

by Fenghua Yu

[permalink] [raw]
Subject: [PATCH v2 2/3] dmaengine: idxd: Add descriptor definitions for DIX generate operation

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 <[email protected]>
Reviewed-by: Dave Jiang <[email protected]>
---
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


2023-03-03 21:34:34

by Fenghua Yu

[permalink] [raw]
Subject: [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.

Signed-off-by: Fenghua Yu <[email protected]>
Reviewed-by: Dave Jiang <[email protected]>
---
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


2023-03-03 21:34:38

by Fenghua Yu

[permalink] [raw]
Subject: [PATCH v2 3/3] dmaengine: idxd: Add descriptor definitions for translation fetch operation

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 <[email protected]>
Reviewed-by: Dave Jiang <[email protected]>
---
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


2023-03-29 02:11:26

by Fenghua Yu

[permalink] [raw]
Subject: Re: [PATCH v2 0/3] Add descriptor definitions for a few new DSA operations

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

2023-03-31 12:04:45

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH v2 0/3] Add descriptor definitions for a few new DSA operations

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

2023-03-31 15:59:11

by Fenghua Yu

[permalink] [raw]
Subject: Re: [PATCH v2 0/3] Add descriptor definitions for a few new DSA operations



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