1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 2023 Intel Corporation. All rights rsvd. */
3 #include <linux/kernel.h>
6 int idxd_load_iaa_device_defaults(struct idxd_device
*idxd
)
8 struct idxd_engine
*engine
;
9 struct idxd_group
*group
;
12 if (!test_bit(IDXD_FLAG_CONFIGURABLE
, &idxd
->flags
))
17 if (wq
->state
!= IDXD_WQ_DISABLED
)
20 /* set mode to "dedicated" */
21 set_bit(WQ_FLAG_DEDICATED
, &wq
->flags
);
24 /* only setting up 1 wq, so give it all the wq space */
25 wq
->size
= idxd
->max_wq_size
;
27 /* set priority to 10 */
30 /* set type to "kernel" */
31 wq
->type
= IDXD_WQT_KERNEL
;
33 /* set wq group to 0 */
34 group
= idxd
->groups
[0];
38 /* set name to "iaa_crypto" */
39 memset(wq
->name
, 0, WQ_NAME_SIZE
+ 1);
40 strscpy(wq
->name
, "iaa_crypto", WQ_NAME_SIZE
+ 1);
42 /* set driver_name to "crypto" */
43 memset(wq
->driver_name
, 0, DRIVER_NAME_SIZE
+ 1);
44 strscpy(wq
->driver_name
, "crypto", DRIVER_NAME_SIZE
+ 1);
46 engine
= idxd
->engines
[0];
48 /* set engine group to 0 */
49 engine
->group
= idxd
->groups
[0];
50 engine
->group
->num_engines
++;