File tree Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -390,6 +390,8 @@ static void idxd_wq_disable_cleanup(struct idxd_wq *wq)
390
390
clear_bit (WQ_FLAG_DEDICATED , & wq -> flags );
391
391
clear_bit (WQ_FLAG_BLOCK_ON_FAULT , & wq -> flags );
392
392
memset (wq -> name , 0 , WQ_NAME_SIZE );
393
+ wq -> max_xfer_bytes = WQ_DEFAULT_MAX_XFER ;
394
+ wq -> max_batch_size = WQ_DEFAULT_MAX_BATCH ;
393
395
}
394
396
395
397
static void idxd_wq_ref_release (struct percpu_ref * ref )
@@ -839,15 +841,12 @@ static int idxd_wq_config_write(struct idxd_wq *wq)
839
841
wq -> wqcfg -> bits [i ] = ioread32 (idxd -> reg_base + wq_offset );
840
842
}
841
843
844
+ if (wq -> size == 0 && wq -> type != IDXD_WQT_NONE )
845
+ wq -> size = WQ_DEFAULT_QUEUE_DEPTH ;
846
+
842
847
/* byte 0-3 */
843
848
wq -> wqcfg -> wq_size = wq -> size ;
844
849
845
- if (wq -> size == 0 ) {
846
- idxd -> cmd_status = IDXD_SCMD_WQ_NO_SIZE ;
847
- dev_warn (dev , "Incorrect work queue size: 0\n" );
848
- return - EINVAL ;
849
- }
850
-
851
850
/* bytes 4-7 */
852
851
wq -> wqcfg -> wq_thresh = wq -> threshold ;
853
852
@@ -993,8 +992,6 @@ static int idxd_wqs_setup(struct idxd_device *idxd)
993
992
994
993
if (!wq -> group )
995
994
continue ;
996
- if (!wq -> size )
997
- continue ;
998
995
999
996
if (wq_shared (wq ) && !device_swq_supported (idxd )) {
1000
997
idxd -> cmd_status = IDXD_SCMD_WQ_NO_SWQ_SUPPORT ;
Original file line number Diff line number Diff line change @@ -150,6 +150,10 @@ struct idxd_cdev {
150
150
#define WQ_NAME_SIZE 1024
151
151
#define WQ_TYPE_SIZE 10
152
152
153
+ #define WQ_DEFAULT_QUEUE_DEPTH 16
154
+ #define WQ_DEFAULT_MAX_XFER SZ_2M
155
+ #define WQ_DEFAULT_MAX_BATCH 32
156
+
153
157
enum idxd_op_type {
154
158
IDXD_OP_BLOCK = 0 ,
155
159
IDXD_OP_NONBLOCK = 1 ,
Original file line number Diff line number Diff line change @@ -246,8 +246,8 @@ static int idxd_setup_wqs(struct idxd_device *idxd)
246
246
init_waitqueue_head (& wq -> err_queue );
247
247
init_completion (& wq -> wq_dead );
248
248
init_completion (& wq -> wq_resurrect );
249
- wq -> max_xfer_bytes = idxd -> max_xfer_bytes ;
250
- wq -> max_batch_size = idxd -> max_batch_size ;
249
+ wq -> max_xfer_bytes = WQ_DEFAULT_MAX_XFER ;
250
+ wq -> max_batch_size = WQ_DEFAULT_MAX_BATCH ;
251
251
wq -> wqcfg = kzalloc_node (idxd -> wqcfg_size , GFP_KERNEL , dev_to_node (dev ));
252
252
if (!wq -> wqcfg ) {
253
253
put_device (conf_dev );
You can’t perform that action at this time.
0 commit comments