Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dmaengine: idxd: set defaults for wq configs

Add default values for wq size, max_xfer_size and max_batch_size. These
values should provide a general guidance for the wq configuration when
the user does not specify any specific values.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/163528473483.3926048.7950067926287180976.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Dave Jiang and committed by
Vinod Koul
92452a72 0f93f204

+11 -10
+5 -8
drivers/dma/idxd/device.c
··· 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) ··· 841 839 wq->wqcfg->bits[i] = ioread32(idxd->reg_base + wq_offset); 842 840 } 843 841 842 + if (wq->size == 0 && wq->type != IDXD_WQT_NONE) 843 + wq->size = WQ_DEFAULT_QUEUE_DEPTH; 844 + 844 845 /* byte 0-3 */ 845 846 wq->wqcfg->wq_size = wq->size; 846 - 847 - if (wq->size == 0) { 848 - idxd->cmd_status = IDXD_SCMD_WQ_NO_SIZE; 849 - dev_warn(dev, "Incorrect work queue size: 0\n"); 850 - return -EINVAL; 851 - } 852 847 853 848 /* bytes 4-7 */ 854 849 wq->wqcfg->wq_thresh = wq->threshold; ··· 991 992 group = wq->group; 992 993 993 994 if (!wq->group) 994 - continue; 995 - if (!wq->size) 996 995 continue; 997 996 998 997 if (wq_shared(wq) && !device_swq_supported(idxd)) {
+4
drivers/dma/idxd/idxd.h
··· 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,
+2 -2
drivers/dma/idxd/init.c
··· 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);