Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
f6cc35ee
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
f6cc35ee
编写于
9月 06, 2017
作者:
V
Vinod Koul
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'topic/ioat' into for-linus
上级
07e24b85
268e2519
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
83 addition
and
4 deletion
+83
-4
Documentation/ABI/stable/sysfs-driver-dma-ioatdma
Documentation/ABI/stable/sysfs-driver-dma-ioatdma
+30
-0
drivers/dma/ioat/dma.c
drivers/dma/ioat/dma.c
+7
-3
drivers/dma/ioat/dma.h
drivers/dma/ioat/dma.h
+3
-0
drivers/dma/ioat/init.c
drivers/dma/ioat/init.c
+1
-1
drivers/dma/ioat/sysfs.c
drivers/dma/ioat/sysfs.c
+42
-0
未找到文件。
Documentation/ABI/stable/sysfs-driver-dma-ioatdma
0 → 100644
浏览文件 @
f6cc35ee
What: sys/devices/pciXXXX:XX/0000:XX:XX.X/dma/dma<n>chan<n>/quickdata/cap
Date: December 3, 2009
KernelVersion: 2.6.32
Contact: dmaengine@vger.kernel.org
Description: Capabilities the DMA supports.Currently there are DMA_PQ, DMA_PQ_VAL,
DMA_XOR,DMA_XOR_VAL,DMA_INTERRUPT.
What: sys/devices/pciXXXX:XX/0000:XX:XX.X/dma/dma<n>chan<n>/quickdata/ring_active
Date: December 3, 2009
KernelVersion: 2.6.32
Contact: dmaengine@vger.kernel.org
Description: The number of descriptors active in the ring.
What: sys/devices/pciXXXX:XX/0000:XX:XX.X/dma/dma<n>chan<n>/quickdata/ring_size
Date: December 3, 2009
KernelVersion: 2.6.32
Contact: dmaengine@vger.kernel.org
Description: Descriptor ring size, total number of descriptors available.
What: sys/devices/pciXXXX:XX/0000:XX:XX.X/dma/dma<n>chan<n>/quickdata/version
Date: December 3, 2009
KernelVersion: 2.6.32
Contact: dmaengine@vger.kernel.org
Description: Version of ioatdma device.
What: sys/devices/pciXXXX:XX/0000:XX:XX.X/dma/dma<n>chan<n>/quickdata/intr_coalesce
Date: August 8, 2017
KernelVersion: 4.14
Contact: dmaengine@vger.kernel.org
Description: Tune-able interrupt delay value per channel basis.
drivers/dma/ioat/dma.c
浏览文件 @
f6cc35ee
...
@@ -644,9 +644,13 @@ static void __cleanup(struct ioatdma_chan *ioat_chan, dma_addr_t phys_complete)
...
@@ -644,9 +644,13 @@ static void __cleanup(struct ioatdma_chan *ioat_chan, dma_addr_t phys_complete)
mod_timer
(
&
ioat_chan
->
timer
,
jiffies
+
IDLE_TIMEOUT
);
mod_timer
(
&
ioat_chan
->
timer
,
jiffies
+
IDLE_TIMEOUT
);
}
}
/* 5 microsecond delay per pending descriptor */
/* microsecond delay by sysfs variable per pending descriptor */
writew
(
min
((
5
*
(
active
-
i
)),
IOAT_INTRDELAY_MASK
),
if
(
ioat_chan
->
intr_coalesce
!=
ioat_chan
->
prev_intr_coalesce
)
{
ioat_chan
->
ioat_dma
->
reg_base
+
IOAT_INTRDELAY_OFFSET
);
writew
(
min
((
ioat_chan
->
intr_coalesce
*
(
active
-
i
)),
IOAT_INTRDELAY_MASK
),
ioat_chan
->
ioat_dma
->
reg_base
+
IOAT_INTRDELAY_OFFSET
);
ioat_chan
->
prev_intr_coalesce
=
ioat_chan
->
intr_coalesce
;
}
}
}
static
void
ioat_cleanup
(
struct
ioatdma_chan
*
ioat_chan
)
static
void
ioat_cleanup
(
struct
ioatdma_chan
*
ioat_chan
)
...
...
drivers/dma/ioat/dma.h
浏览文件 @
f6cc35ee
...
@@ -142,11 +142,14 @@ struct ioatdma_chan {
...
@@ -142,11 +142,14 @@ struct ioatdma_chan {
spinlock_t
prep_lock
;
spinlock_t
prep_lock
;
struct
ioat_descs
descs
[
2
];
struct
ioat_descs
descs
[
2
];
int
desc_chunks
;
int
desc_chunks
;
int
intr_coalesce
;
int
prev_intr_coalesce
;
};
};
struct
ioat_sysfs_entry
{
struct
ioat_sysfs_entry
{
struct
attribute
attr
;
struct
attribute
attr
;
ssize_t
(
*
show
)(
struct
dma_chan
*
,
char
*
);
ssize_t
(
*
show
)(
struct
dma_chan
*
,
char
*
);
ssize_t
(
*
store
)(
struct
dma_chan
*
,
const
char
*
,
size_t
);
};
};
/**
/**
...
...
drivers/dma/ioat/init.c
浏览文件 @
f6cc35ee
...
@@ -39,7 +39,7 @@ MODULE_VERSION(IOAT_DMA_VERSION);
...
@@ -39,7 +39,7 @@ MODULE_VERSION(IOAT_DMA_VERSION);
MODULE_LICENSE
(
"Dual BSD/GPL"
);
MODULE_LICENSE
(
"Dual BSD/GPL"
);
MODULE_AUTHOR
(
"Intel Corporation"
);
MODULE_AUTHOR
(
"Intel Corporation"
);
static
struct
pci_device_id
ioat_pci_tbl
[]
=
{
static
const
struct
pci_device_id
ioat_pci_tbl
[]
=
{
/* I/OAT v3 platforms */
/* I/OAT v3 platforms */
{
PCI_VDEVICE
(
INTEL
,
PCI_DEVICE_ID_INTEL_IOAT_TBG0
)
},
{
PCI_VDEVICE
(
INTEL
,
PCI_DEVICE_ID_INTEL_IOAT_TBG0
)
},
{
PCI_VDEVICE
(
INTEL
,
PCI_DEVICE_ID_INTEL_IOAT_TBG1
)
},
{
PCI_VDEVICE
(
INTEL
,
PCI_DEVICE_ID_INTEL_IOAT_TBG1
)
},
...
...
drivers/dma/ioat/sysfs.c
浏览文件 @
f6cc35ee
...
@@ -64,8 +64,24 @@ ioat_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
...
@@ -64,8 +64,24 @@ ioat_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
return
entry
->
show
(
&
ioat_chan
->
dma_chan
,
page
);
return
entry
->
show
(
&
ioat_chan
->
dma_chan
,
page
);
}
}
static
ssize_t
ioat_attr_store
(
struct
kobject
*
kobj
,
struct
attribute
*
attr
,
const
char
*
page
,
size_t
count
)
{
struct
ioat_sysfs_entry
*
entry
;
struct
ioatdma_chan
*
ioat_chan
;
entry
=
container_of
(
attr
,
struct
ioat_sysfs_entry
,
attr
);
ioat_chan
=
container_of
(
kobj
,
struct
ioatdma_chan
,
kobj
);
if
(
!
entry
->
store
)
return
-
EIO
;
return
entry
->
store
(
&
ioat_chan
->
dma_chan
,
page
,
count
);
}
const
struct
sysfs_ops
ioat_sysfs_ops
=
{
const
struct
sysfs_ops
ioat_sysfs_ops
=
{
.
show
=
ioat_attr_show
,
.
show
=
ioat_attr_show
,
.
store
=
ioat_attr_store
,
};
};
void
ioat_kobject_add
(
struct
ioatdma_device
*
ioat_dma
,
struct
kobj_type
*
type
)
void
ioat_kobject_add
(
struct
ioatdma_device
*
ioat_dma
,
struct
kobj_type
*
type
)
...
@@ -121,11 +137,37 @@ static ssize_t ring_active_show(struct dma_chan *c, char *page)
...
@@ -121,11 +137,37 @@ static ssize_t ring_active_show(struct dma_chan *c, char *page)
}
}
static
struct
ioat_sysfs_entry
ring_active_attr
=
__ATTR_RO
(
ring_active
);
static
struct
ioat_sysfs_entry
ring_active_attr
=
__ATTR_RO
(
ring_active
);
static
ssize_t
intr_coalesce_show
(
struct
dma_chan
*
c
,
char
*
page
)
{
struct
ioatdma_chan
*
ioat_chan
=
to_ioat_chan
(
c
);
return
sprintf
(
page
,
"%d
\n
"
,
ioat_chan
->
intr_coalesce
);
}
static
ssize_t
intr_coalesce_store
(
struct
dma_chan
*
c
,
const
char
*
page
,
size_t
count
)
{
int
intr_coalesce
=
0
;
struct
ioatdma_chan
*
ioat_chan
=
to_ioat_chan
(
c
);
if
(
sscanf
(
page
,
"%du"
,
&
intr_coalesce
)
!=
-
1
)
{
if
((
intr_coalesce
<
0
)
||
(
intr_coalesce
>
IOAT_INTRDELAY_MASK
))
return
-
EINVAL
;
ioat_chan
->
intr_coalesce
=
intr_coalesce
;
}
return
count
;
}
static
struct
ioat_sysfs_entry
intr_coalesce_attr
=
__ATTR_RW
(
intr_coalesce
);
static
struct
attribute
*
ioat_attrs
[]
=
{
static
struct
attribute
*
ioat_attrs
[]
=
{
&
ring_size_attr
.
attr
,
&
ring_size_attr
.
attr
,
&
ring_active_attr
.
attr
,
&
ring_active_attr
.
attr
,
&
ioat_cap_attr
.
attr
,
&
ioat_cap_attr
.
attr
,
&
ioat_version_attr
.
attr
,
&
ioat_version_attr
.
attr
,
&
intr_coalesce_attr
.
attr
,
NULL
,
NULL
,
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录