Bug 2320 - Intel IAA - dmaengine: idxd: Fix max batch size issues for Intel IAA
Summary: Intel IAA - dmaengine: idxd: Fix max batch size issues for Intel IAA
Status: RESOLVED FIXED
Alias: None
Product: ANCK 5.10 Dev
Classification: ANCK
Component: drivers (show other bugs) drivers
Version: unspecified
Hardware: x86_64 Linux
: P2-High S2-major
Target Milestone: ---
Assignee: GuixinLiu
QA Contact: shuming
URL:
Whiteboard:
Keywords: Bugfix
Depends on:
Blocks:
 
Reported: 2022-09-30 11:55 UTC by xiaochenshen
Modified: 2023-03-01 16:30 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description xiaochenshen intel_group 2022-09-30 11:55:39 UTC
Description of problem:

1. Issue 1 - batch related values for IAA are incorrect 
From Intel IAA spec [1], Intel IAA does not support batch processing.
Two batch related default values for IAA are incorrect in current code:
(1) The max batch size of device is set during device initialization,
    that indicates batch is supported. It should be always 0 on IAA.
(2) The max batch size of work queue is set to WQ_DEFAULT_MAX_BATCH (32)
    as the default value regardless of Intel DSA or IAA device during
    work queue setup and cleanup. It should be always 0 on IAA.

Fix the issues by setting the max batch size of device and max batch
size of work queue to 0 on IAA device, that means batch is not
supported.

2. Issue 2 - batch related sysfs attributes should be invisible
In current code, dev.max_batch_size and wq.max_batch_size attributes in
sysfs are exposed to user to show or update the values.

From Intel IAA spec [1], Intel IAA does not support batch processing. So
these sysfs attributes should not be supported on IAA device.

Fix this issue by making the attributes of max_batch_size invisible in
sysfs through is_visible() filter when the device is IAA.


Version-Release number of selected component (if applicable):
ANCK 5.10 Dev.


How reproducible:
Always.


Steps to Reproduce:
# modprobe idxd
# cat /sys/bus/dsa/devices/dsa0/max_batch_size
1024
# cat /sys/bus/dsa/devices/dsa0/wq0.0/max_batch_size
32

# cat /sys/bus/dsa/devices/iax1/max_batch_size
1
# cat /sys/bus/dsa/devices/iax1/wq1.0/max_batch_size
32


Actual results:
# cat /sys/bus/dsa/devices/iax1/max_batch_size
1
# cat /sys/bus/dsa/devices/iax1/wq1.0/max_batch_size
32


Expected results:
These two sysfs attributes should be invisible:
# cat /sys/bus/dsa/devices/iax1/max_batch_size
# cat /sys/bus/dsa/devices/iax1/wq1.0/max_batch_size


Additional info:
This issue is reproducible in latest upstream kernel. So we need upstream fixing.
Comment 1 xiaochenshen intel_group 2022-09-30 12:12:30 UTC
The patch submitted to LKML:
https://lore.kernel.org/all/20220808031922.29751-1-xiaochen.shen@intel.com/

dmaengine maintainer requested to rebase on top of 'next' branch of
https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git

Rebase is working in progress. There will be no functional change.
Comment 2 xiaochenshen intel_group 2022-10-01 03:35:19 UTC
The patch v2 submitted to LKML:
https://lore.kernel.org/all/20220930201528.18621-1-xiaochen.shen@intel.com/
Comment 3 xiaochenshen intel_group 2022-10-11 20:55:22 UTC
Link: https://gitee.com/anolis/cloud-kernel/pulls/754
Comment 4 xiaochenshen intel_group 2022-10-11 21:02:13 UTC
Mark as FIXED because PR https://gitee.com/anolis/cloud-kernel/pulls/754 has been merged.