accel-config: Update to current stable
JIRA: https://issues.redhat.com/browse/RHEL-38576 Pull in stable release updates to 4.1.8 * Refined usage of enable-device/disable-device * Update tests to make use of syscall write interface for descriptor submission Resolves: RHEL-38576 Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
This commit is contained in:
parent
b883451a95
commit
74539a3f89
137
0001-dsa_test-Use-syscall-write-to-submit-descriptor.patch
Normal file
137
0001-dsa_test-Use-syscall-write-to-submit-descriptor.patch
Normal file
@ -0,0 +1,137 @@
|
||||
From 99405e8b438b1e9f4b41d94c6d29b657e3cd6ffb Mon Sep 17 00:00:00 2001
|
||||
From: Yi Sun <yi.sun@intel.com>
|
||||
Date: Tue, 1 Oct 2024 13:23:58 +0800
|
||||
Subject: [PATCH] dsa_test: Use syscall write to submit descriptor
|
||||
'Content-type:text/plain'
|
||||
|
||||
Intel updated kernel driver to prevent the accelerators from being directly
|
||||
mapped into unprivileged user applications, because malicious may be
|
||||
able to cause corrupt memory.
|
||||
|
||||
Align with the kernel change, write the descriptor to cdev instead of
|
||||
enqcmd by default when submit shared work queue descriptor. Meanwhile, retain
|
||||
the enqcmd way if force to use it with new option '-u'.
|
||||
|
||||
More details refer to link:
|
||||
https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-01084.html
|
||||
|
||||
Signed-off-by: Yi Sun <yi.sun@intel.com>
|
||||
---
|
||||
test/accel_test.c | 31 +++++++++++++++++++++----------
|
||||
test/accel_test.h | 1 +
|
||||
test/dsa_test.c | 6 +++++-
|
||||
3 files changed, 27 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/test/accel_test.c b/test/accel_test.c
|
||||
index e7f0e8e1e323..f23295c9f3fb 100644
|
||||
--- a/test/accel_test.c
|
||||
+++ b/test/accel_test.c
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
unsigned int ms_timeout = 5000;
|
||||
int debug_logging;
|
||||
+int force_enqcmd = 0;
|
||||
static int umwait_support;
|
||||
|
||||
static inline void cpuid(unsigned int *eax, unsigned int *ebx,
|
||||
@@ -90,11 +91,13 @@ static int acctest_setup_wq(struct acctest_context *ctx, struct accfg_wq *wq)
|
||||
return -errno;
|
||||
}
|
||||
|
||||
- ctx->wq_reg = mmap(NULL, PAGE_SIZE, PROT_WRITE,
|
||||
- MAP_SHARED | MAP_POPULATE, ctx->fd, 0);
|
||||
- if (ctx->wq_reg == MAP_FAILED) {
|
||||
- perror("mmap");
|
||||
- return -errno;
|
||||
+ if (force_enqcmd) {
|
||||
+ ctx->wq_reg = mmap(NULL, PAGE_SIZE, PROT_WRITE,
|
||||
+ MAP_SHARED | MAP_POPULATE, ctx->fd, 0);
|
||||
+ if (ctx->wq_reg == MAP_FAILED) {
|
||||
+ perror("mmap");
|
||||
+ return -errno;
|
||||
+ }
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -295,14 +298,22 @@ struct task *acctest_alloc_task(struct acctest_context *ctx)
|
||||
return tsk;
|
||||
}
|
||||
|
||||
-static int acctest_enqcmd(struct acctest_context *ctx, struct hw_desc *hw)
|
||||
+static int acctest_desc_submit_swq(struct acctest_context *ctx, struct hw_desc *hw)
|
||||
{
|
||||
int retry_count = 0;
|
||||
int ret = 0;
|
||||
|
||||
while (retry_count < 3) {
|
||||
- if (!enqcmd(ctx->wq_reg, hw))
|
||||
- break;
|
||||
+ if (force_enqcmd) {
|
||||
+ info("Submitting descriptor via ENQCMD\n");
|
||||
+ if (!enqcmd(ctx->wq_reg, hw))
|
||||
+ break;
|
||||
+ } else {
|
||||
+ info("Submitting descriptor via syscall write\n");
|
||||
+ ret = write(ctx->fd, hw, sizeof(struct hw_desc));
|
||||
+ if (ret == sizeof(struct hw_desc))
|
||||
+ break;
|
||||
+ }
|
||||
|
||||
info("retry\n");
|
||||
retry_count++;
|
||||
@@ -535,7 +546,7 @@ void acctest_desc_submit(struct acctest_context *ctx, struct hw_desc *hw)
|
||||
/* use MOVDIR64B for DWQ */
|
||||
if (ctx->dedicated)
|
||||
movdir64b(ctx->wq_reg, hw);
|
||||
- else /* use ENQCMD for SWQ */
|
||||
- if (acctest_enqcmd(ctx, hw))
|
||||
+ else /* use ENQCMD or write for SWQ */
|
||||
+ if (acctest_desc_submit_swq(ctx, hw))
|
||||
usleep(10000);
|
||||
}
|
||||
diff --git a/test/accel_test.h b/test/accel_test.h
|
||||
index 1402620bc5c5..7cdeca67d02e 100644
|
||||
--- a/test/accel_test.h
|
||||
+++ b/test/accel_test.h
|
||||
@@ -48,6 +48,7 @@
|
||||
|
||||
extern unsigned int ms_timeout;
|
||||
extern int debug_logging;
|
||||
+extern int force_enqcmd;
|
||||
|
||||
struct task {
|
||||
struct hw_desc *desc;
|
||||
diff --git a/test/dsa_test.c b/test/dsa_test.c
|
||||
index c5a2dda60725..ecadaf2f32bc 100644
|
||||
--- a/test/dsa_test.c
|
||||
+++ b/test/dsa_test.c
|
||||
@@ -35,6 +35,7 @@ static void usage(void)
|
||||
"-e ; evl pattern <batch>:<desc><..>\n"
|
||||
" ; <bc_fault:bc_wr_fail:bd_fault:bd_fault_idx>:<desc_fault:cp_fault:cp_wr_fail:fence>:\n"
|
||||
"-v ; verbose\n"
|
||||
+ "-u ; use ENQCMD to submit descriptor\n"
|
||||
"-h ; print this message\n");
|
||||
}
|
||||
|
||||
@@ -849,7 +850,7 @@ int main(int argc, char *argv[])
|
||||
struct evl_desc_list *edl = NULL;
|
||||
char *edl_str = NULL;
|
||||
|
||||
- while ((opt = getopt(argc, argv, "e:w:l:f:o:b:c:d:n:t:p:vh")) != -1) {
|
||||
+ while ((opt = getopt(argc, argv, "e:w:l:f:o:b:c:d:n:t:p:vuh")) != -1) {
|
||||
switch (opt) {
|
||||
case 'e':
|
||||
edl_str = optarg;
|
||||
@@ -889,6 +890,9 @@ int main(int argc, char *argv[])
|
||||
case 'v':
|
||||
debug_logging = 1;
|
||||
break;
|
||||
+ case 'u':
|
||||
+ force_enqcmd = 1;
|
||||
+ break;
|
||||
case 'h':
|
||||
usage();
|
||||
exit(0);
|
||||
--
|
||||
2.48.0
|
||||
|
50
0002-Update-dsa_config_test_runner.sh.patch
Normal file
50
0002-Update-dsa_config_test_runner.sh.patch
Normal file
@ -0,0 +1,50 @@
|
||||
From 96703fa9b15f6d801b7d4cdb36ab0c0623c2d2b9 Mon Sep 17 00:00:00 2001
|
||||
From: shangsong2 <shangsong2@lenovo.com>
|
||||
Date: Mon, 5 Aug 2024 10:55:48 +0800
|
||||
Subject: [PATCH] Update dsa_config_test_runner.sh
|
||||
'Content-type:text/plain'
|
||||
|
||||
The op_config '272' test is conflict with the kernel commit 6827738dc684a merged in April 2024, it is better to remove the test.
|
||||
|
||||
Signed-off-by: shangsong <shangsong2@lenovo.com>
|
||||
---
|
||||
test/dsa_config_test_runner.sh | 23 -----------------------
|
||||
1 file changed, 23 deletions(-)
|
||||
|
||||
diff --git a/test/dsa_config_test_runner.sh b/test/dsa_config_test_runner.sh
|
||||
index 906856050796..59a7a290c0a2 100755
|
||||
--- a/test/dsa_config_test_runner.sh
|
||||
+++ b/test/dsa_config_test_runner.sh
|
||||
@@ -205,29 +205,6 @@ wq_config_test()
|
||||
"$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x1 -b 0x3 -c 2 "${VERBOSE}" &&
|
||||
echo "should fail, but pass" && exit 1
|
||||
"$ACCFG" disable-device $DSA
|
||||
-
|
||||
- "$ACCFG" config-wq $DSA/$WQ0 -g 0 -m dedicated -y user -n app1 -d user -p 10 -o 272
|
||||
- "$ACCFG" config-engine $DSA/$ENG0 -g 0
|
||||
- read_ret=$(cat $IDXD_DEVICE_PATH/$DSA/$WQ0/op_config | cut -c 55-)
|
||||
- if [ "$read_ret" != "00000000,00000272" ]; then
|
||||
- echo "wq op_config 30 failed" && exit "$EXIT_FAILURE"
|
||||
- fi
|
||||
- "$ACCFG" enable-device $DSA
|
||||
- "$ACCFG" enable-wq $DSA/$WQ0
|
||||
- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x0 "${VERBOSE}" && echo "should fail, but pass" && exit 1
|
||||
- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x2 "${VERBOSE}" && echo "should fail, but pass" && exit 1
|
||||
- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x3 "${VERBOSE}" && echo "should fail, but pass" && exit 1
|
||||
- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x7 "${VERBOSE}" && echo "should fail, but pass" && exit 1
|
||||
- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x8 "${VERBOSE}" && echo "should fail, but pass" && exit 1
|
||||
- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x4 "${VERBOSE}" || echo "should pass, but fail" || exit 1
|
||||
- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x5 "${VERBOSE}" || echo "should pass, but fail" || exit 1
|
||||
- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x6 "${VERBOSE}" || echo "should pass, but fail" || exit 1
|
||||
- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x9 "${VERBOSE}" || echo "should fail, but pass" || exit 1
|
||||
- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x1 -b 0x5 -c 2 "${VERBOSE}" ||
|
||||
- echo "should pass, but fail" || exit 1
|
||||
- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x1 -b 0x9 -c 2 "${VERBOSE}" ||
|
||||
- echo "should pass, but fail" || exit 1
|
||||
- "$ACCFG" disable-device $DSA
|
||||
fi
|
||||
}
|
||||
|
||||
--
|
||||
2.48.0
|
||||
|
67
0003-accel-config-Change-license-to-LGPL-2.1.patch
Normal file
67
0003-accel-config-Change-license-to-LGPL-2.1.patch
Normal file
@ -0,0 +1,67 @@
|
||||
From 6a2a45454e10c7dbbe031c07aea941eda01552aa Mon Sep 17 00:00:00 2001
|
||||
From: "Hentabli, Abdelrahim" <abdelrahim.hentabli@intel.com>
|
||||
Date: Wed, 4 Dec 2024 19:03:10 -0800
|
||||
Subject: [PATCH] accel-config: Change license to LGPL 2.1
|
||||
'Content-type:text/plain'
|
||||
|
||||
Change license to LGPL 2.1
|
||||
|
||||
Signed-off-by: Hentabli, Abdelrahim <abdelrahim.hentabli@intel.com>
|
||||
---
|
||||
util/log.c | 4 ++--
|
||||
util/log.h | 4 ++--
|
||||
util/sysfs.c | 4 ++--
|
||||
util/sysfs.h | 4 ++--
|
||||
4 files changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/util/log.c b/util/log.c
|
||||
index 1d94b17af1b3..f4f2cb31561a 100644
|
||||
--- a/util/log.c
|
||||
+++ b/util/log.c
|
||||
@@ -1,5 +1,5 @@
|
||||
-/* SPDX-License-Identifier: GPL-2.0 */
|
||||
-/* Copyright(c) 2015-2019 Intel Corporation. All rights reserved. */
|
||||
+/* SPDX-License-Identifier: LGPL-2.1 */
|
||||
+/* Copyright(c) 2016-2025 Intel Corporation. All rights reserved. */
|
||||
|
||||
#include <syslog.h>
|
||||
#include <stdlib.h>
|
||||
diff --git a/util/log.h b/util/log.h
|
||||
index 2734c94c28cd..645dc42f6b0e 100644
|
||||
--- a/util/log.h
|
||||
+++ b/util/log.h
|
||||
@@ -1,5 +1,5 @@
|
||||
-/* SPDX-License-Identifier: GPL-2.0 */
|
||||
-/* Copyright(c) 2015-2019 Intel Corporation. All rights reserved. */
|
||||
+/* SPDX-License-Identifier: LGPL-2.1 */
|
||||
+/* Copyright(c) 2016-2025 Intel Corporation. All rights reserved. */
|
||||
|
||||
#ifndef __UTIL_LOG_H__
|
||||
#define __UTIL_LOG_H__
|
||||
diff --git a/util/sysfs.c b/util/sysfs.c
|
||||
index 4f881ca8c329..83b2fc15e770 100644
|
||||
--- a/util/sysfs.c
|
||||
+++ b/util/sysfs.c
|
||||
@@ -1,5 +1,5 @@
|
||||
-/* SPDX-License-Identifier: GPL-2.0 */
|
||||
-/* Copyright(c) 2015-2019 Intel Corporation. All rights reserved. */
|
||||
+/* SPDX-License-Identifier: LGPL-2.1 */
|
||||
+/* Copyright(c) 2014-2025 Intel Corporation. All rights reserved. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
diff --git a/util/sysfs.h b/util/sysfs.h
|
||||
index abd470159e04..21c37f4c17f4 100644
|
||||
--- a/util/sysfs.h
|
||||
+++ b/util/sysfs.h
|
||||
@@ -1,5 +1,5 @@
|
||||
-/* SPDX-License-Identifier: GPL-2.0 */
|
||||
-/* Copyright(c) 2015-2019 Intel Corporation. All rights reserved. */
|
||||
+/* SPDX-License-Identifier: LGPL-2.1 */
|
||||
+/* Copyright(c) 2014-2025 Intel Corporation. All rights reserved. */
|
||||
|
||||
#ifndef __UTIL_SYSFS_H__
|
||||
#define __UTIL_SYSFS_H__
|
||||
--
|
||||
2.48.0
|
||||
|
146
0004-accel-config-Add-options-for-subcommand-enable-disab.patch
Normal file
146
0004-accel-config-Add-options-for-subcommand-enable-disab.patch
Normal file
@ -0,0 +1,146 @@
|
||||
From d12007de8ce229fc334e7fc7f49fa221d220c674 Mon Sep 17 00:00:00 2001
|
||||
From: Yi Sun <yi.sun@intel.com>
|
||||
Date: Mon, 28 Oct 2024 17:39:05 +0800
|
||||
Subject: [PATCH] accel-config: Add options for subcommand
|
||||
enable/disable-device
|
||||
'Content-type:text/plain'
|
||||
|
||||
For certain reasons, the user needs to batch enable or disable configured
|
||||
devices. Previously, the user would repeatedly call the 'disable-device'
|
||||
or 'enable-device' sub-command in a loop. The newly added 'all' 'dsa'
|
||||
'iax' options for 'disable-device' and 'enable-device' offers a more
|
||||
convenient solution.
|
||||
|
||||
Example:
|
||||
-----------
|
||||
[root@test-machine]# accel-config disable-device all
|
||||
disable 1 device(s) dsa0
|
||||
dsa2 is in disabled state already, skipping...
|
||||
dsa4 is in disabled state already, skipping...
|
||||
dsa6 is in disabled state already, skipping...
|
||||
disable 2 device(s) iax1
|
||||
iax3 is in disabled state already, skipping...
|
||||
iax5 is in disabled state already, skipping...
|
||||
iax7 is in disabled state already, skipping...
|
||||
|
||||
[root@test-machine]# accel-config config-wq dsa0/wq0.0 -g 0 -m dedicated -y user -n app1 -d user -p 10 -o 0
|
||||
[root@test-machine]# accel-config config-wq dsa2/wq2.0 -g 2 -m shared -y user -n app2 -d user -p 10 -o 0
|
||||
[root@test-machine]# accel-config config-engine dsa0/engine0.0 -g 0
|
||||
[root@test-machine]# accel-config config-engine dsa2/engine2.0 -g 2
|
||||
[root@test-machine]# accel-config enable-device all
|
||||
enable 1 device(s) dsa0
|
||||
enable 2 device(s) dsa2
|
||||
|
||||
NEG cases:
|
||||
-----------
|
||||
[root@test-machine]# accel-config disable-device iax
|
||||
iax1 is in disabled state already, skipping...
|
||||
iax3 is in disabled state already, skipping...
|
||||
iax5 is in disabled state already, skipping...
|
||||
iax7 is in disabled state already, skipping...
|
||||
|
||||
[root@test-machine]# accel-config disable-device dsa
|
||||
dsa0 is in disabled state already, skipping...
|
||||
dsa2 is in disabled state already, skipping...
|
||||
dsa4 is in disabled state already, skipping...
|
||||
dsa6 is in disabled state already, skipping...
|
||||
|
||||
[root@test-machine]# accel-config disable-device ERR
|
||||
(return code 0)
|
||||
|
||||
[root@test-machine]# accel-config enable-device all
|
||||
(return code 0)
|
||||
|
||||
[root@test-machine]# accel-config enable-device dsa
|
||||
(return code 0)
|
||||
|
||||
[root@test-machine]# accel-config enable-device iax
|
||||
(return code 0)
|
||||
|
||||
-------
|
||||
- Change from v1 to v2:
|
||||
- Remove redundant check.
|
||||
- Change the dev parameter from hardcode to enum.
|
||||
- Reword.
|
||||
|
||||
Signed-off-by: Yi Sun <yi.sun@intel.com>
|
||||
---
|
||||
accfg/enable.c | 43 +++++++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 41 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/accfg/enable.c b/accfg/enable.c
|
||||
index c27fbffcf792..4e7d716ff95c 100644
|
||||
--- a/accfg/enable.c
|
||||
+++ b/accfg/enable.c
|
||||
@@ -30,6 +30,12 @@ enum wq_action {
|
||||
WQ_ACTION_DISABLE,
|
||||
};
|
||||
|
||||
+enum dev_param {
|
||||
+ DEV_PARAM_DSA = 1,
|
||||
+ DEV_PARAM_IAX = 2,
|
||||
+ DEV_PARAM_ALL = 3,
|
||||
+};
|
||||
+
|
||||
static struct {
|
||||
bool verbose;
|
||||
bool force;
|
||||
@@ -91,6 +97,8 @@ static int device_action(int argc, const char **argv, const char *usage,
|
||||
};
|
||||
int i, rc = -EINVAL, success = 0;
|
||||
enum accfg_device_state state;
|
||||
+ struct accfg_device *device = NULL;
|
||||
+ unsigned int bmap_dev = 0;
|
||||
|
||||
argc = parse_options(argc, argv, options, u, 0);
|
||||
|
||||
@@ -101,13 +109,44 @@ static int device_action(int argc, const char **argv, const char *usage,
|
||||
if (strcmp(argv[i], "all") == 0) {
|
||||
argv[0] = "all";
|
||||
argc = 1;
|
||||
+ bmap_dev |= DEV_PARAM_ALL;
|
||||
+ break;
|
||||
+ }
|
||||
+ if (strcmp(argv[i], "dsa") == 0) {
|
||||
+ argv[0] = "dsa";
|
||||
+ argc = 1;
|
||||
+ bmap_dev |= DEV_PARAM_DSA;
|
||||
+ break;
|
||||
+ }
|
||||
+ if (strcmp(argv[i], "iax") == 0) {
|
||||
+ argv[0] = "iax";
|
||||
+ argc = 1;
|
||||
+ bmap_dev |= DEV_PARAM_IAX;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
- for (i = 0; i < argc; i++) {
|
||||
- struct accfg_device *device;
|
||||
+ if (bmap_dev) {
|
||||
+ accfg_device_foreach(ctx, device) {
|
||||
+ if (strstr(accfg_device_get_devname(device), "iax") &&
|
||||
+ (bmap_dev & DEV_PARAM_IAX) == 0)
|
||||
+ continue;
|
||||
+ if (strstr(accfg_device_get_devname(device), "dsa") &&
|
||||
+ (bmap_dev & DEV_PARAM_DSA) == 0)
|
||||
+ continue;
|
||||
+
|
||||
+ rc = dev_action_switch(device, action);
|
||||
+ if (rc == 0) {
|
||||
+ success++;
|
||||
+ fprintf(stderr, "%s %d device(s) %s\n",
|
||||
+ action == DEV_ACTION_ENABLE ? "enabled" : "disabled",
|
||||
+ success, accfg_device_get_devname(device));
|
||||
+ }
|
||||
+ }
|
||||
+ return 0;
|
||||
+ }
|
||||
|
||||
+ for (i = 0; i < argc; i++) {
|
||||
if (parse_device_name(ctx, argv[i], &device)) {
|
||||
if (param.verbose)
|
||||
fprintf(stderr,
|
||||
--
|
||||
2.48.0
|
||||
|
@ -0,0 +1,92 @@
|
||||
From a14d345c6dcc231354b98228056cf5b442712681 Mon Sep 17 00:00:00 2001
|
||||
From: Yi Sun <yi.sun@intel.com>
|
||||
Date: Mon, 28 Oct 2024 18:45:52 +0800
|
||||
Subject: [PATCH] accel-config: Refine the Usage of enable/disable-device
|
||||
'Content-type:text/plain'
|
||||
|
||||
Add the usage for newly added options of enable-device and disable-device.
|
||||
|
||||
Signed-off-by: Yi Sun <yi.sun@intel.com>
|
||||
---
|
||||
.../accfg/accel-config-disable-device.txt | 5 +++++
|
||||
.../accfg/accel-config-enable-device.txt | 5 +++++
|
||||
accfg/enable.c | 16 ++++++++++++++--
|
||||
3 files changed, 24 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/Documentation/accfg/accel-config-disable-device.txt b/Documentation/accfg/accel-config-disable-device.txt
|
||||
index 8952980e3468..0662092a785b 100644
|
||||
--- a/Documentation/accfg/accel-config-disable-device.txt
|
||||
+++ b/Documentation/accfg/accel-config-disable-device.txt
|
||||
@@ -11,10 +11,15 @@ SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'accel-config disable-device' <device>
|
||||
+'accel-config disable-device' <device-type>
|
||||
+ dsa: disable all DSA devices
|
||||
+ iax: disable all IAX devices
|
||||
+ all: disable all devices
|
||||
|
||||
EXAMPLE
|
||||
-------
|
||||
accel-config disable-device dsa0
|
||||
+accel-config disable-device all
|
||||
|
||||
OPTIONS
|
||||
-------
|
||||
diff --git a/Documentation/accfg/accel-config-enable-device.txt b/Documentation/accfg/accel-config-enable-device.txt
|
||||
index 21aba987652f..8da29065d60e 100644
|
||||
--- a/Documentation/accfg/accel-config-enable-device.txt
|
||||
+++ b/Documentation/accfg/accel-config-enable-device.txt
|
||||
@@ -11,10 +11,15 @@ SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'accel-config enable-device' <device>
|
||||
+'accel-config enable-device' <device-type>
|
||||
+ dsa: enable all configured DSA devices
|
||||
+ iax: enable all configured IAX devices
|
||||
+ all: enable all configured devices
|
||||
|
||||
EXAMPLE
|
||||
-------
|
||||
accel-config enable-device dsa0
|
||||
+accel-config enable-device all
|
||||
|
||||
include::../copyright.txt[]
|
||||
|
||||
diff --git a/accfg/enable.c b/accfg/enable.c
|
||||
index 4e7d716ff95c..18b560a73646 100644
|
||||
--- a/accfg/enable.c
|
||||
+++ b/accfg/enable.c
|
||||
@@ -285,7 +285,13 @@ static int wq_action(int argc, const char **argv, const char *usage,
|
||||
int cmd_disable_device(int argc, const char **argv, void *ctx)
|
||||
{
|
||||
char *usage =
|
||||
- "accel-config disable-device <accel_basename0> [<accel_basename1>..<accel_basenameN>] [<options>]";
|
||||
+ "\naccel-config disable-device <accel_basename0> [<accel_basename1>..<accel_basenameN>] [<options>]\n"
|
||||
+ "accel-config disable-device <device type>\n"
|
||||
+ " device_type: can be one of following values\n"
|
||||
+ " dsa: disable all DSA devices\n"
|
||||
+ " iax: disable all IAX devices\n"
|
||||
+ " all: disable all devices\n";
|
||||
+
|
||||
int count = device_action(argc, argv, usage, device_disable_options,
|
||||
DEV_ACTION_DISABLE, ctx);
|
||||
return count >= 0 ? 0 : EXIT_FAILURE;
|
||||
@@ -294,7 +300,13 @@ int cmd_disable_device(int argc, const char **argv, void *ctx)
|
||||
int cmd_enable_device(int argc, const char **argv, void *ctx)
|
||||
{
|
||||
char *usage =
|
||||
- "accel-config enable-device <accel_basename0> [<accel_basename1>..<accel_basenameN>] [<options>]";
|
||||
+ "\naccel-config enable-device <accel_basename0> [<accel_basename1>..<accel_basenameN>] [<options>]\n"
|
||||
+ "accel-config enable-device <device type>\n"
|
||||
+ " device_type: can be one of following values\n"
|
||||
+ " dsa: enable all configured DSA devices\n"
|
||||
+ " iax: enable all configured IAX devices\n"
|
||||
+ " all: enable all configured devices\n";
|
||||
+
|
||||
int count = device_action(argc, argv, usage, device_options,
|
||||
DEV_ACTION_ENABLE, ctx);
|
||||
return count >= 0 ? 0 : EXIT_FAILURE;
|
||||
--
|
||||
2.48.0
|
||||
|
232
0006-Add-decode-subcommand-info.patch
Normal file
232
0006-Add-decode-subcommand-info.patch
Normal file
@ -0,0 +1,232 @@
|
||||
From 07b5795208c79274aa29253a73109bad00561bea Mon Sep 17 00:00:00 2001
|
||||
From: Yi Sun <yi.sun@intel.com>
|
||||
Date: Mon, 28 Oct 2024 17:34:34 +0800
|
||||
Subject: [PATCH] Add decode subcommand info
|
||||
'Content-type:text/plain'
|
||||
|
||||
Decode op_cap to a readable operation name, providing users with easier
|
||||
access to information about hardware support."
|
||||
|
||||
Example
|
||||
-------------
|
||||
[root@testmachine]accel-config info -v
|
||||
|
||||
dsa0 [active]
|
||||
00000000,00000000,00000000,00000000,00000000,00000000,0000007b,00bf07fd
|
||||
Batch[-] Drain[+] Memory Move[+] Fill[+] Compare[+] Compare Pattern[+] Create Delta Record[+] Apply Delta Record[+] Memory Copy with Dualcast[+] Translation Fetch[+] CRC Generation[+] Copy with CRC Generation[+] DIF Check[+] DIF Insert[+] DIF Strip[+] DIF Update[+] DIX Generate[+] Cache Flush[+] Update Window[+] Inter-Domain Momery Copy[+] Inter-Domain Fill[+] Inter-Domain Compare[+] Inter-Domain Compare Pattern[+] Inter-Domain Cache Flush[-]
|
||||
|
||||
iax1
|
||||
00000000,00000000,00000000,00000000,00000000,004d001c,00000000,00000405
|
||||
Drain[+] Translation Fetch[+] Decrypt[-] Encrypt[-] Decompress[+] Compress[+] CRC64[+] Zdecompress32[-] Zdecompress16[-] Zdecompress8 [-] Zcompress32[-] Zcompress16[-] Zcompress8[-] Scan[+] Set Membership[-] Extract[+] Select[+] BLE Burst[-] Find Unique[-] Expand[+]
|
||||
|
||||
- Change from v1 to v2:
|
||||
- Merge two related patch into a single commit.
|
||||
- Reword.
|
||||
|
||||
Signed-off-by: Yi Sun <yi.sun@intel.com>
|
||||
---
|
||||
accfg/accel-config.c | 1 +
|
||||
accfg/list.c | 148 +++++++++++++++++++++++++++++++++++++++++++
|
||||
builtin.h | 1 +
|
||||
3 files changed, 150 insertions(+)
|
||||
|
||||
diff --git a/accfg/accel-config.c b/accfg/accel-config.c
|
||||
index 616f2e5af5dd..e8a1f718cebc 100644
|
||||
--- a/accfg/accel-config.c
|
||||
+++ b/accfg/accel-config.c
|
||||
@@ -23,6 +23,7 @@ const char accfg_usage_string[] =
|
||||
|
||||
static struct cmd_struct commands[] = {
|
||||
{"list", cmd_list},
|
||||
+ {"info", cmd_info},
|
||||
{"load-config", cmd_config},
|
||||
{"save-config", cmd_save},
|
||||
{"disable-device", cmd_disable_device},
|
||||
diff --git a/accfg/list.c b/accfg/list.c
|
||||
index 145c5231f5c5..916451069d2c 100644
|
||||
--- a/accfg/list.c
|
||||
+++ b/accfg/list.c
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <util/parse-options.h>
|
||||
#include <ccan/array_size/array_size.h>
|
||||
#include <accfg.h>
|
||||
+#include <string.h>
|
||||
|
||||
static struct util_filter_params util_param;
|
||||
static struct {
|
||||
@@ -25,6 +26,96 @@ static struct {
|
||||
bool save_conf;
|
||||
} list;
|
||||
|
||||
+struct map_op_name {
|
||||
+ int op_code;
|
||||
+ const char *op_name;
|
||||
+};
|
||||
+
|
||||
+#define BITMAP_SIZE 8
|
||||
+#define IAX_OP_CODE_NAME \
|
||||
+ {0x02, "Drain"}, \
|
||||
+ {0x0A, "Translation Fetch"}, \
|
||||
+ {0x40, "Decrypt"}, \
|
||||
+ {0x41, "Encrypt"}, \
|
||||
+ {0x42, "Decompress"}, \
|
||||
+ {0x43, "Compress"}, \
|
||||
+ {0x44, "CRC64"}, \
|
||||
+ {0x48, "Zdecompress32"}, \
|
||||
+ {0x49, "Zdecompress16"}, \
|
||||
+ {0x4A, "Zdecompress8"}, \
|
||||
+ {0x4C, "Zcompress32"}, \
|
||||
+ {0x4D, "Zcompress16"}, \
|
||||
+ {0x4E, "Zcompress8"}, \
|
||||
+ {0x50, "Scan"}, \
|
||||
+ {0x51, "Set Membership"}, \
|
||||
+ {0x52, "Extract"}, \
|
||||
+ {0x53, "Select"}, \
|
||||
+ {0x54, "BLE Burst"}, \
|
||||
+ {0x55, "Find Unique"}, \
|
||||
+ {0x56, "Expand"}
|
||||
+
|
||||
+struct map_op_name iax_op_code_name[] = {
|
||||
+ IAX_OP_CODE_NAME,
|
||||
+ {-1, NULL}
|
||||
+};
|
||||
+
|
||||
+#define DSA_OP_CODE_NAME \
|
||||
+ {0x01, "Batch"}, \
|
||||
+ {0x02, "Drain"}, \
|
||||
+ {0x03, "Memory Move"}, \
|
||||
+ {0x04, "Fill"}, \
|
||||
+ {0x05, "Compare"}, \
|
||||
+ {0x06, "Compare Pattern"}, \
|
||||
+ {0x07, "Create Delta Record"}, \
|
||||
+ {0x08, "Apply Delta Record"}, \
|
||||
+ {0x09, "Memory Copy with Dualcast"}, \
|
||||
+ {0x0A, "Translation Fetch"}, \
|
||||
+ {0x10, "CRC Generation"}, \
|
||||
+ {0x11, "Copy with CRC Generation"}, \
|
||||
+ {0x12, "DIF Check"}, \
|
||||
+ {0x13, "DIF Insert"}, \
|
||||
+ {0x14, "DIF Strip"}, \
|
||||
+ {0x15, "DIF Update"}, \
|
||||
+ {0x17, "DIX Generate"}, \
|
||||
+ {0x20, "Cache Flush"}, \
|
||||
+ {0x21, "Update Window"}, \
|
||||
+ {0x23, "Inter-Domain Momery Copy"}, \
|
||||
+ {0x24, "Inter-Domain Fill"}, \
|
||||
+ {0x25, "Inter-Domain Compare"}, \
|
||||
+ {0x26, "Inter-Domain Compare Pattern"}, \
|
||||
+ {0x27, "Inter-Domain Cache Flush"}
|
||||
+
|
||||
+struct map_op_name dsa_op_code_name[] = {
|
||||
+ DSA_OP_CODE_NAME,
|
||||
+ {-1, NULL}
|
||||
+};
|
||||
+
|
||||
+
|
||||
+static const char* get_op_name(struct map_op_name *code_name, int op_code)
|
||||
+{
|
||||
+ int i = 0;
|
||||
+ while (code_name[i].op_code != -1) {
|
||||
+ if (code_name[i].op_code == op_code) {
|
||||
+ return code_name[i].op_name;
|
||||
+ }
|
||||
+ i++;
|
||||
+ }
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static int get_bit(struct accfg_op_cap op_cap, int bit_index)
|
||||
+{
|
||||
+ int array_index = (BITMAP_SIZE - 1) - (bit_index / 32);
|
||||
+ int bit_offset = bit_index % 32;
|
||||
+
|
||||
+ if (bit_index < 0 || bit_index >= 256) {
|
||||
+ printf("Error: bit_index out of range (0-255)\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ return (op_cap.bits[array_index] & (1 << bit_offset)) != 0;
|
||||
+}
|
||||
+
|
||||
static uint64_t listopts_to_flags(void)
|
||||
{
|
||||
uint64_t flags = 0;
|
||||
@@ -692,6 +783,63 @@ int cmd_list(int argc, const char **argv, void *ctx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+int cmd_info(int argc, const char **argv, void *ctx)
|
||||
+{
|
||||
+ struct map_op_name *cur_op_name = NULL;
|
||||
+ struct accfg_device *device;
|
||||
+ struct accfg_op_cap op_cap;
|
||||
+ bool verbose = false;
|
||||
+ const char *dev_name;
|
||||
+ const char *op_name;
|
||||
+ int rc, j, has_op;
|
||||
+
|
||||
+ const struct option options[] = {
|
||||
+ OPT_BOOLEAN('v', "verbose", &verbose, "show more info"),
|
||||
+ OPT_END(),
|
||||
+ };
|
||||
+ const char *const u[] = {
|
||||
+ "accel-config info [<options>]",
|
||||
+ NULL
|
||||
+ };
|
||||
+
|
||||
+ argc = parse_options(argc, argv, options, u, 0);
|
||||
+ for (j = 0; j < argc; j++)
|
||||
+ error("unknown parameter \"%s\"\n", argv[j]);
|
||||
+
|
||||
+ accfg_device_foreach(ctx, device) {
|
||||
+ dev_name = accfg_device_get_devname(device);
|
||||
+ fprintf(stdout, "%s %s\n", dev_name,
|
||||
+ accfg_device_is_active(device)? "[active]" : "");
|
||||
+
|
||||
+ rc = accfg_device_get_op_cap(device, &op_cap);
|
||||
+ if (rc) {
|
||||
+ printf("Error getting op cap\n");
|
||||
+ return rc;
|
||||
+ }
|
||||
+
|
||||
+ for (j = 0; j < BITMAP_SIZE; j++)
|
||||
+ printf("%08x,", op_cap.bits[j]);
|
||||
+ printf("\b \n");
|
||||
+
|
||||
+ if (!verbose)
|
||||
+ continue;
|
||||
+
|
||||
+ if (strstr(dev_name, "dsa") != NULL) {
|
||||
+ cur_op_name = dsa_op_code_name;
|
||||
+ } else if (strstr(dev_name, "iax") != NULL) {
|
||||
+ cur_op_name = iax_op_code_name;
|
||||
+ }
|
||||
+ for (int k = 0; k < 256; k++) {
|
||||
+ has_op = get_bit(op_cap, k);
|
||||
+ op_name = get_op_name(cur_op_name, k);
|
||||
+ if (op_name)
|
||||
+ printf("%s[%c] ", op_name, has_op? '+' : '-');
|
||||
+ }
|
||||
+ printf("\n");
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
int cmd_save(int argc, const char **argv, void *ctx)
|
||||
{
|
||||
const struct option options[] = {
|
||||
diff --git a/builtin.h b/builtin.h
|
||||
index 9554ee541eed..ff6cb5f62990 100644
|
||||
--- a/builtin.h
|
||||
+++ b/builtin.h
|
||||
@@ -19,6 +19,7 @@ struct cmd_struct {
|
||||
int (*fn) (int, const char **, void *ctx);
|
||||
};
|
||||
int cmd_list(int argc, const char **argv, void *ctx);
|
||||
+int cmd_info(int argc, const char **argv, void *ctx);
|
||||
int cmd_config(int argc, const char **argv, void *ctx);
|
||||
int cmd_save(int argc, const char **argv, void *ctx);
|
||||
int cmd_disable_device(int argc, const char **argv, void *ctx);
|
||||
--
|
||||
2.48.0
|
||||
|
86
0007-Doc-Add-document-for-new-added-subcommand-info.patch
Normal file
86
0007-Doc-Add-document-for-new-added-subcommand-info.patch
Normal file
@ -0,0 +1,86 @@
|
||||
From dd55279f82ac6949b07632997028833c1107b441 Mon Sep 17 00:00:00 2001
|
||||
From: Yi Sun <yi.sun@intel.com>
|
||||
Date: Tue, 17 Dec 2024 15:45:59 +0800
|
||||
Subject: [PATCH] Doc: Add document for new added subcommand info
|
||||
'Content-type:text/plain'
|
||||
|
||||
Signed-off-by: Yi Sun <yi.sun@intel.com>
|
||||
---
|
||||
Documentation/accfg/Makefile.am | 6 ++--
|
||||
Documentation/accfg/accel-config-info.txt | 40 +++++++++++++++++++++++
|
||||
2 files changed, 44 insertions(+), 2 deletions(-)
|
||||
create mode 100644 Documentation/accfg/accel-config-info.txt
|
||||
|
||||
diff --git a/Documentation/accfg/Makefile.am b/Documentation/accfg/Makefile.am
|
||||
index 4d8d3125dee1..8b534c2e341f 100644
|
||||
--- a/Documentation/accfg/Makefile.am
|
||||
+++ b/Documentation/accfg/Makefile.am
|
||||
@@ -30,7 +30,8 @@ man1_MANS = \
|
||||
accel-config-disable-wq.1 \
|
||||
accel-config-enable-wq.1 \
|
||||
accel-config-enable-device.1 \
|
||||
- accel-config-config-user-default.1
|
||||
+ accel-config-config-user-default.1 \
|
||||
+ accel-config-info.1
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(man1_MANS) \
|
||||
@@ -46,7 +47,8 @@ EXTRA_DIST = \
|
||||
accel-config-disable-wq.txt \
|
||||
accel-config-enable-wq.txt \
|
||||
accel-config-enable-device.txt \
|
||||
- accel-config-config-user-default.txt
|
||||
+ accel-config-config-user-default.txt \
|
||||
+ accel-config-info.txt
|
||||
|
||||
CLEANFILES = $(man1_MANS)
|
||||
|
||||
diff --git a/Documentation/accfg/accel-config-info.txt b/Documentation/accfg/accel-config-info.txt
|
||||
new file mode 100644
|
||||
index 000000000000..c6630efb5a5d
|
||||
--- /dev/null
|
||||
+++ b/Documentation/accfg/accel-config-info.txt
|
||||
@@ -0,0 +1,40 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+
|
||||
+accel-config info(1)
|
||||
+====================
|
||||
+
|
||||
+NAME
|
||||
+----
|
||||
+accel-config-info - dump more idxd device information.
|
||||
+
|
||||
+SYNOPSIS
|
||||
+--------
|
||||
+[verse]
|
||||
+'accel-config info [-v]'
|
||||
+
|
||||
+EXAMPLE
|
||||
+-------
|
||||
+accel-config info -v
|
||||
+
|
||||
+dsa0 [active]
|
||||
+
|
||||
+00000000,00000000,00000000,00000000,00000000,00000000,0000007b,00bf07fd
|
||||
+
|
||||
+Batch[-] Drain[+] Memory Move[+] Fill[+] Compare[+] Compare Pattern[+] Create Delta Record[+] Apply Delta Record[+] Memory Copy with Dualcast[+] Translation Fetch[+] CRC Generation[+] Copy with CRC Generation[+] DIF Check[+] DIF Insert[+] DIF Strip[+] DIF Update[+] DIX Generate[+] Cache Flush[+] Update Window[+] Inter-Domain Momery Copy[+] Inter-Domain Fill[+] Inter-Domain Compare[+] Inter-Domain Compare Pattern[+] Inter-Domain Cache Flush[-]
|
||||
+
|
||||
+iax1
|
||||
+
|
||||
+00000000,00000000,00000000,00000000,00000000,004d001c,00000000,00000405
|
||||
+
|
||||
+Drain[+] Translation Fetch[+] Decrypt[-] Encrypt[-] Decompress[+] Compress[+] CRC64[+] Zdecompress32[-] Zdecompress16[-] Zdecompress8 [-] Zcompress32[-] Zcompress16[-] Zcompress8[-] Scan[+] Set Membership[-] Extract[+] Select[+] BLE Burst[-] Find Unique[-] Expand[+]
|
||||
+
|
||||
+OPTIONS
|
||||
+-------
|
||||
+-v:
|
||||
+ Verbose mode. Print more information about the device.
|
||||
+
|
||||
+include::../copyright.txt[]
|
||||
+
|
||||
+SEE ALSO
|
||||
+--------
|
||||
+accel-config info(1)
|
||||
--
|
||||
2.48.0
|
||||
|
57
0008-accfg-enable.c-Remove-the-redundant-check.patch
Normal file
57
0008-accfg-enable.c-Remove-the-redundant-check.patch
Normal file
@ -0,0 +1,57 @@
|
||||
From ba7721b36f700ac2c0584c588ead79310ea9f887 Mon Sep 17 00:00:00 2001
|
||||
From: Yi Sun <yi.sun@intel.com>
|
||||
Date: Tue, 17 Dec 2024 14:39:43 +0800
|
||||
Subject: [PATCH] accfg/enable.c: Remove the redundant check.
|
||||
'Content-type:text/plain'
|
||||
|
||||
There's no chance that the device state not mactch with return code.
|
||||
|
||||
Signed-off-by: Yi Sun <yi.sun@intel.com>
|
||||
---
|
||||
accfg/enable.c | 16 ++--------------
|
||||
1 file changed, 2 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/accfg/enable.c b/accfg/enable.c
|
||||
index 18b560a73646..eeab023799ee 100644
|
||||
--- a/accfg/enable.c
|
||||
+++ b/accfg/enable.c
|
||||
@@ -96,7 +96,7 @@ static int device_action(int argc, const char **argv, const char *usage,
|
||||
NULL
|
||||
};
|
||||
int i, rc = -EINVAL, success = 0;
|
||||
- enum accfg_device_state state;
|
||||
+ enum accfg_device_state;
|
||||
struct accfg_device *device = NULL;
|
||||
unsigned int bmap_dev = 0;
|
||||
|
||||
@@ -155,18 +155,6 @@ static int device_action(int argc, const char **argv, const char *usage,
|
||||
}
|
||||
|
||||
rc = dev_action_switch(device, action);
|
||||
- if (rc == 0) {
|
||||
- /*
|
||||
- * Double check if the state of the device
|
||||
- * matches with the enable/disable
|
||||
- */
|
||||
- state = accfg_device_get_state(device);
|
||||
- if (((state != ACCFG_DEVICE_ENABLED) &&
|
||||
- (action == DEV_ACTION_ENABLE)) ||
|
||||
- ((state != ACCFG_DEVICE_DISABLED) &&
|
||||
- (action == DEV_ACTION_DISABLE)))
|
||||
- rc = ENXIO;
|
||||
- }
|
||||
if (rc == 0)
|
||||
success++;
|
||||
else
|
||||
@@ -180,7 +168,7 @@ static int device_action(int argc, const char **argv, const char *usage,
|
||||
if (success)
|
||||
return 0;
|
||||
|
||||
- return rc;
|
||||
+ return -ENXIO;
|
||||
}
|
||||
|
||||
static int action_disable_wq(struct accfg_wq *wq, const char *wq_name)
|
||||
--
|
||||
2.48.0
|
||||
|
51
0009-iaa_test-Use-syscall-write-to-submit-descriptor.patch
Normal file
51
0009-iaa_test-Use-syscall-write-to-submit-descriptor.patch
Normal file
@ -0,0 +1,51 @@
|
||||
From c9fe230b2842c5db32863c6e5aa2b2ce9c5679fd Mon Sep 17 00:00:00 2001
|
||||
From: Yi Sun <yi.sun@intel.com>
|
||||
Date: Thu, 2 Jan 2025 11:15:54 +0800
|
||||
Subject: [PATCH] iaa_test: Use syscall write to submit descriptor
|
||||
'Content-type:text/plain'
|
||||
|
||||
Align with the kernel change, write the descriptor to cdev instead of
|
||||
enqcmd by default when submit shared work queue descriptor.
|
||||
|
||||
Do the same change for iaa_test as the what dsa_test, which is reviewed
|
||||
and merged.
|
||||
|
||||
Signed-off-by: Yi Sun <yi.sun@intel.com>
|
||||
---
|
||||
test/iaa_test.c | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/test/iaa_test.c b/test/iaa_test.c
|
||||
index 5854c64495f3..d42fa73bbb06 100644
|
||||
--- a/test/iaa_test.c
|
||||
+++ b/test/iaa_test.c
|
||||
@@ -28,6 +28,7 @@ static void usage(void)
|
||||
"-n <number of descriptors> ;descriptor count to submit\n"
|
||||
"-t <ms timeout> ; ms to wait for descs to complete\n"
|
||||
"-v ; verbose\n"
|
||||
+ "-u ; use ENQCMD to submit descriptor\n"
|
||||
"-h ; print this message\n");
|
||||
}
|
||||
|
||||
@@ -581,7 +582,7 @@ int main(int argc, char *argv[])
|
||||
int dev_wq_id = ACCTEST_DEVICE_ID_NO_INPUT;
|
||||
unsigned int num_desc = 1;
|
||||
|
||||
- while ((opt = getopt(argc, argv, "w:l:f:1:2:3:a:m:o:b:c:d:n:t:p:vh")) != -1) {
|
||||
+ while ((opt = getopt(argc, argv, "w:l:f:1:2:3:a:m:o:b:c:d:n:t:p:vuh")) != -1) {
|
||||
switch (opt) {
|
||||
case 'w':
|
||||
wq_type = atoi(optarg);
|
||||
@@ -624,6 +625,9 @@ int main(int argc, char *argv[])
|
||||
case 'v':
|
||||
debug_logging = 1;
|
||||
break;
|
||||
+ case 'u':
|
||||
+ force_enqcmd = 1;
|
||||
+ break;
|
||||
case 'h':
|
||||
usage();
|
||||
exit(0);
|
||||
--
|
||||
2.48.0
|
||||
|
29
0010-accel_test-Setup-Memmap-for-Dedicated-workqueue.patch
Normal file
29
0010-accel_test-Setup-Memmap-for-Dedicated-workqueue.patch
Normal file
@ -0,0 +1,29 @@
|
||||
From 5edcf2349fd1c31127c2e7370dff7b5184ab49bf Mon Sep 17 00:00:00 2001
|
||||
From: Yi Sun <yi.sun@intel.com>
|
||||
Date: Thu, 2 Jan 2025 14:39:48 +0800
|
||||
Subject: [PATCH] accel_test: Setup Memmap for Dedicated workqueue
|
||||
'Content-type:text/plain'
|
||||
|
||||
If tests running via dedicated workqueues, it's necessary to use memmap.
|
||||
|
||||
Signed-off-by: Yi Sun <yi.sun@intel.com>
|
||||
---
|
||||
test/accel_test.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/test/accel_test.c b/test/accel_test.c
|
||||
index f23295c9f3fb..ea7cc3e64d40 100644
|
||||
--- a/test/accel_test.c
|
||||
+++ b/test/accel_test.c
|
||||
@@ -91,7 +91,7 @@ static int acctest_setup_wq(struct acctest_context *ctx, struct accfg_wq *wq)
|
||||
return -errno;
|
||||
}
|
||||
|
||||
- if (force_enqcmd) {
|
||||
+ if (force_enqcmd || accfg_wq_get_mode(wq) == ACCFG_WQ_DEDICATED) {
|
||||
ctx->wq_reg = mmap(NULL, PAGE_SIZE, PROT_WRITE,
|
||||
MAP_SHARED | MAP_POPULATE, ctx->fd, 0);
|
||||
if (ctx->wq_reg == MAP_FAILED) {
|
||||
--
|
||||
2.48.0
|
||||
|
33
0011-test-common-Conditionally-remove-the-module.patch
Normal file
33
0011-test-common-Conditionally-remove-the-module.patch
Normal file
@ -0,0 +1,33 @@
|
||||
From b7faa04b92cd20576b7b7f096dee9cf2bbe79220 Mon Sep 17 00:00:00 2001
|
||||
From: "Sun, Yi" <yi.sun@intel.com>
|
||||
Date: Thu, 2 Jan 2025 16:44:34 +0800
|
||||
Subject: [PATCH] test/common: Conditionally remove the module
|
||||
'Content-type:text/plain'
|
||||
|
||||
'rmmod iaa_crypo' may cause error in case no iaa_crypo loaded.
|
||||
Check it before removing, and always return 0 for clean up function.
|
||||
|
||||
Signed-off-by: Yi Sun <yi.sun@intel.com>
|
||||
---
|
||||
test/common | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/test/common b/test/common
|
||||
index fd9a3eebdc6b..7355c908ac15 100755
|
||||
--- a/test/common
|
||||
+++ b/test/common
|
||||
@@ -189,7 +189,10 @@ _cleanup()
|
||||
modprobe vfio_pci
|
||||
|
||||
disable_all
|
||||
- rmmod iaa_crypto
|
||||
+ lsmod | grep -wq iaa_crypto && {
|
||||
+ rmmod iaa_crypto
|
||||
+ }
|
||||
+ return 0
|
||||
}
|
||||
|
||||
# json2var
|
||||
--
|
||||
2.48.0
|
||||
|
43
0012-test-Use-ENQCMD-for-Betch-Testing.patch
Normal file
43
0012-test-Use-ENQCMD-for-Betch-Testing.patch
Normal file
@ -0,0 +1,43 @@
|
||||
From 2f15749789947060a88086ba0298036e216f8a8c Mon Sep 17 00:00:00 2001
|
||||
From: "Sun, Yi" <yi.sun@intel.com>
|
||||
Date: Thu, 2 Jan 2025 16:45:10 +0800
|
||||
Subject: [PATCH] test: Use ENQCMD for Betch Testing
|
||||
'Content-type:text/plain'
|
||||
|
||||
The idxd tests are suggested to use syscall write to submit instead of
|
||||
ENQCMD. But so far the write function cannot handle batch tests.
|
||||
|
||||
Use the option '-u' to force the batch tests using ENQCMD.
|
||||
This is likely a workaround, need to look into the write function of the
|
||||
cdev supporting the betch function.
|
||||
|
||||
Signed-off-by: Yi Sun <yi.sun@intel.com>
|
||||
---
|
||||
test/dsa_user_test_runner.sh | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/test/dsa_user_test_runner.sh b/test/dsa_user_test_runner.sh
|
||||
index 2848feda68bb..937536597a22 100755
|
||||
--- a/test/dsa_user_test_runner.sh
|
||||
+++ b/test/dsa_user_test_runner.sh
|
||||
@@ -124,7 +124,7 @@ test_op_batch()
|
||||
-c 16 -f "$flag" t2000 "${VERBOSE}" -d "$DEV"
|
||||
else
|
||||
"$DSATEST" -w "$wq_mode_code" -l "$xfer_size" -o 0x1 -b "$opcode" \
|
||||
- -c 16 -f "$flag" t2000 "${VERBOSE}"
|
||||
+ -c 16 -f "$flag" t2000 "${VERBOSE}" -u
|
||||
fi
|
||||
done
|
||||
done
|
||||
@@ -184,7 +184,7 @@ test_dif_op_batch()
|
||||
-c 16 -f "$flag" t2000 "${VERBOSE}" -d "$DEV"
|
||||
else
|
||||
"$DSATEST" -w "$wq_mode_code" -l "$xfer_size" -o 0x1 -b "$opcode" \
|
||||
- -c 16 -f "$flag" t2000 "${VERBOSE}"
|
||||
+ -c 16 -f "$flag" t2000 "${VERBOSE}" -u
|
||||
fi
|
||||
done
|
||||
done
|
||||
--
|
||||
2.48.0
|
||||
|
29
0013-test-dsa-Fix-typo-chekcing-checking.patch
Normal file
29
0013-test-dsa-Fix-typo-chekcing-checking.patch
Normal file
@ -0,0 +1,29 @@
|
||||
From 3f0eb52a51057ad562fb9dedb1e61bc403f0e7ce Mon Sep 17 00:00:00 2001
|
||||
From: Colin Ian King <colin.i.king@gmail.com>
|
||||
Date: Mon, 6 Jan 2025 12:43:53 +0000
|
||||
Subject: [PATCH] test/dsa: Fix typo "chekcing" -> "checking"
|
||||
'Content-type:text/plain'
|
||||
|
||||
There is a typo in an info message. Fix it.
|
||||
|
||||
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
|
||||
---
|
||||
test/dsa.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/test/dsa.c b/test/dsa.c
|
||||
index 5638147a2c4f..59b7f477fffc 100644
|
||||
--- a/test/dsa.c
|
||||
+++ b/test/dsa.c
|
||||
@@ -2216,7 +2216,7 @@ int batch_result_verify(struct batch_task *btsk, int bof, int cpfault)
|
||||
}
|
||||
} else {
|
||||
if (core_stat == DSA_COMP_SUCCESS) {
|
||||
- info("core task success, chekcing sub-tasks\n");
|
||||
+ info("core task success, checking sub-tasks\n");
|
||||
} else if (core_stat == DSA_COMP_BATCH_PAGE_FAULT) {
|
||||
info("batch desc list page fault\n");
|
||||
} else if (core_stat == DSA_COMP_BATCH_FAIL) {
|
||||
--
|
||||
2.48.0
|
||||
|
45
0014-accfg-list-fix-typo-Momery-Memory.patch
Normal file
45
0014-accfg-list-fix-typo-Momery-Memory.patch
Normal file
@ -0,0 +1,45 @@
|
||||
From c16307ec6c4b9535b70e58af0350475ed86002c6 Mon Sep 17 00:00:00 2001
|
||||
From: Colin Ian King <colin.i.king@gmail.com>
|
||||
Date: Mon, 6 Jan 2025 12:47:10 +0000
|
||||
Subject: [PATCH] accfg/list: fix typo "Momery" -> "Memory"
|
||||
'Content-type:text/plain'
|
||||
|
||||
There is a typo in a literal string in the iax_op_code_name array,
|
||||
fix it. Also fix associated documentation that contains the same
|
||||
typo.
|
||||
|
||||
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
|
||||
---
|
||||
Documentation/accfg/accel-config-info.txt | 2 +-
|
||||
accfg/list.c | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/Documentation/accfg/accel-config-info.txt b/Documentation/accfg/accel-config-info.txt
|
||||
index c6630efb5a5d..3298e5c2c4b0 100644
|
||||
--- a/Documentation/accfg/accel-config-info.txt
|
||||
+++ b/Documentation/accfg/accel-config-info.txt
|
||||
@@ -20,7 +20,7 @@ dsa0 [active]
|
||||
|
||||
00000000,00000000,00000000,00000000,00000000,00000000,0000007b,00bf07fd
|
||||
|
||||
-Batch[-] Drain[+] Memory Move[+] Fill[+] Compare[+] Compare Pattern[+] Create Delta Record[+] Apply Delta Record[+] Memory Copy with Dualcast[+] Translation Fetch[+] CRC Generation[+] Copy with CRC Generation[+] DIF Check[+] DIF Insert[+] DIF Strip[+] DIF Update[+] DIX Generate[+] Cache Flush[+] Update Window[+] Inter-Domain Momery Copy[+] Inter-Domain Fill[+] Inter-Domain Compare[+] Inter-Domain Compare Pattern[+] Inter-Domain Cache Flush[-]
|
||||
+Batch[-] Drain[+] Memory Move[+] Fill[+] Compare[+] Compare Pattern[+] Create Delta Record[+] Apply Delta Record[+] Memory Copy with Dualcast[+] Translation Fetch[+] CRC Generation[+] Copy with CRC Generation[+] DIF Check[+] DIF Insert[+] DIF Strip[+] DIF Update[+] DIX Generate[+] Cache Flush[+] Update Window[+] Inter-Domain Memory Copy[+] Inter-Domain Fill[+] Inter-Domain Compare[+] Inter-Domain Compare Pattern[+] Inter-Domain Cache Flush[-]
|
||||
|
||||
iax1
|
||||
|
||||
diff --git a/accfg/list.c b/accfg/list.c
|
||||
index 916451069d2c..519b7eb7ee3f 100644
|
||||
--- a/accfg/list.c
|
||||
+++ b/accfg/list.c
|
||||
@@ -79,7 +79,7 @@ struct map_op_name iax_op_code_name[] = {
|
||||
{0x17, "DIX Generate"}, \
|
||||
{0x20, "Cache Flush"}, \
|
||||
{0x21, "Update Window"}, \
|
||||
- {0x23, "Inter-Domain Momery Copy"}, \
|
||||
+ {0x23, "Inter-Domain Memory Copy"}, \
|
||||
{0x24, "Inter-Domain Fill"}, \
|
||||
{0x25, "Inter-Domain Compare"}, \
|
||||
{0x26, "Inter-Domain Compare Pattern"}, \
|
||||
--
|
||||
2.48.0
|
||||
|
30
0015-Documentation-fix-typo-limt-limit.patch
Normal file
30
0015-Documentation-fix-typo-limt-limit.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From c590717c85a34c2b85f9463bb38a67cdf2493501 Mon Sep 17 00:00:00 2001
|
||||
From: Colin Ian King <colin.i.king@gmail.com>
|
||||
Date: Mon, 6 Jan 2025 12:50:24 +0000
|
||||
Subject: [PATCH] Documentation: fix typo "limt" -> "limit"
|
||||
'Content-type:text/plain'
|
||||
|
||||
There is a typo in the accel-config-config-group.txt documentation,
|
||||
fix it.
|
||||
|
||||
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
|
||||
---
|
||||
Documentation/accfg/accel-config-config-group.txt | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Documentation/accfg/accel-config-config-group.txt b/Documentation/accfg/accel-config-config-group.txt
|
||||
index ebd40bc2b4a0..8101aa09154d 100644
|
||||
--- a/Documentation/accfg/accel-config-config-group.txt
|
||||
+++ b/Documentation/accfg/accel-config-config-group.txt
|
||||
@@ -40,7 +40,7 @@ OPTIONS
|
||||
|
||||
-l::
|
||||
--use-read-buffer-limit=::
|
||||
- toggle the enabling of read-buffer limt usage. use-read-buffer-limit should be
|
||||
+ toggle the enabling of read-buffer limit usage. use-read-buffer-limit should be
|
||||
either 0 or 1.
|
||||
|
||||
-a::
|
||||
--
|
||||
2.48.0
|
||||
|
@ -2,11 +2,27 @@
|
||||
|
||||
Name: accel-config
|
||||
Version: 4.1.8
|
||||
Release: 2%{?dist}
|
||||
Release: 3%{?dist}
|
||||
Summary: Configure accelerator subsystem devices
|
||||
License: GPL-2.0-only
|
||||
URL: https://github.com/intel/%{project_name}
|
||||
Source0: %{URL}/archive/%{name}-v%{version}.tar.gz
|
||||
Patch0: 0001-dsa_test-Use-syscall-write-to-submit-descriptor.patch
|
||||
Patch1: 0002-Update-dsa_config_test_runner.sh.patch
|
||||
Patch2: 0003-accel-config-Change-license-to-LGPL-2.1.patch
|
||||
Patch3: 0004-accel-config-Add-options-for-subcommand-enable-disab.patch
|
||||
Patch4: 0005-accel-config-Refine-the-Usage-of-enable-disable-devi.patch
|
||||
Patch5: 0006-Add-decode-subcommand-info.patch
|
||||
Patch6: 0007-Doc-Add-document-for-new-added-subcommand-info.patch
|
||||
Patch7: 0008-accfg-enable.c-Remove-the-redundant-check.patch
|
||||
Patch8: 0009-iaa_test-Use-syscall-write-to-submit-descriptor.patch
|
||||
Patch9: 0010-accel_test-Setup-Memmap-for-Dedicated-workqueue.patch
|
||||
Patch10: 0011-test-common-Conditionally-remove-the-module.patch
|
||||
Patch11: 0012-test-Use-ENQCMD-for-Betch-Testing.patch
|
||||
Patch12: 0013-test-dsa-Fix-typo-chekcing-checking.patch
|
||||
Patch13: 0014-accfg-list-fix-typo-Momery-Memory.patch
|
||||
Patch14: 0015-Documentation-fix-typo-limt-limit.patch
|
||||
|
||||
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
||||
BuildRequires: gcc
|
||||
BuildRequires: autoconf
|
||||
@ -98,6 +114,10 @@ make check
|
||||
%{_libexecdir}/accel-config/test/*
|
||||
|
||||
%changelog
|
||||
* Mon Mar 17 2025 Jerry Snitselaar <jsnitsel@redhat.com> - 4.1.8-3
|
||||
- Update to current stable.
|
||||
Resolves: RHEL-38576
|
||||
|
||||
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 4.1.8-2
|
||||
- Bump release for October 2024 mass rebuild:
|
||||
Resolves: RHEL-64018
|
||||
|
Loading…
Reference in New Issue
Block a user