Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
22f12c60
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 3 年多
通知
13
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看板
提交
22f12c60
编写于
12月 23, 2013
作者:
R
Roland Dreier
浏览文件
操作
浏览文件
下载
差异文件
Merge branches 'cxgb4', 'flowsteer' and 'misc' into for-linus
上级
c00850dd
6cc3df84
6b59ba60
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
52 addition
and
15 deletion
+52
-15
drivers/infiniband/core/iwcm.c
drivers/infiniband/core/iwcm.c
+9
-2
drivers/infiniband/core/uverbs.h
drivers/infiniband/core/uverbs.h
+9
-1
drivers/infiniband/core/uverbs_cmd.c
drivers/infiniband/core/uverbs_cmd.c
+17
-0
drivers/infiniband/core/uverbs_main.c
drivers/infiniband/core/uverbs_main.c
+16
-11
include/rdma/ib_verbs.h
include/rdma/ib_verbs.h
+1
-1
未找到文件。
drivers/infiniband/core/iwcm.c
浏览文件 @
22f12c60
...
...
@@ -181,9 +181,16 @@ static void add_ref(struct iw_cm_id *cm_id)
static
void
rem_ref
(
struct
iw_cm_id
*
cm_id
)
{
struct
iwcm_id_private
*
cm_id_priv
;
int
cb_destroy
;
cm_id_priv
=
container_of
(
cm_id
,
struct
iwcm_id_private
,
id
);
if
(
iwcm_deref_id
(
cm_id_priv
)
&&
test_bit
(
IWCM_F_CALLBACK_DESTROY
,
&
cm_id_priv
->
flags
))
{
/*
* Test bit before deref in case the cm_id gets freed on another
* thread.
*/
cb_destroy
=
test_bit
(
IWCM_F_CALLBACK_DESTROY
,
&
cm_id_priv
->
flags
);
if
(
iwcm_deref_id
(
cm_id_priv
)
&&
cb_destroy
)
{
BUG_ON
(
!
list_empty
(
&
cm_id_priv
->
work_list
));
free_cm_id
(
cm_id_priv
);
}
...
...
drivers/infiniband/core/uverbs.h
浏览文件 @
22f12c60
...
...
@@ -49,12 +49,20 @@
#define INIT_UDATA(udata, ibuf, obuf, ilen, olen) \
do { \
(udata)->inbuf = (void __user *) (ibuf); \
(udata)->inbuf = (
const
void __user *) (ibuf); \
(udata)->outbuf = (void __user *) (obuf); \
(udata)->inlen = (ilen); \
(udata)->outlen = (olen); \
} while (0)
#define INIT_UDATA_BUF_OR_NULL(udata, ibuf, obuf, ilen, olen) \
do { \
(udata)->inbuf = (ilen) ? (const void __user *) (ibuf) : NULL; \
(udata)->outbuf = (olen) ? (void __user *) (obuf) : NULL; \
(udata)->inlen = (ilen); \
(udata)->outlen = (olen); \
} while (0)
/*
* Our lifetime rules for these structs are the following:
*
...
...
drivers/infiniband/core/uverbs_cmd.c
浏览文件 @
22f12c60
...
...
@@ -2593,6 +2593,9 @@ ssize_t ib_uverbs_detach_mcast(struct ib_uverbs_file *file,
static
int
kern_spec_to_ib_spec
(
struct
ib_uverbs_flow_spec
*
kern_spec
,
union
ib_flow_spec
*
ib_spec
)
{
if
(
kern_spec
->
reserved
)
return
-
EINVAL
;
ib_spec
->
type
=
kern_spec
->
type
;
switch
(
ib_spec
->
type
)
{
...
...
@@ -2646,6 +2649,9 @@ int ib_uverbs_ex_create_flow(struct ib_uverbs_file *file,
void
*
ib_spec
;
int
i
;
if
(
ucore
->
inlen
<
sizeof
(
cmd
))
return
-
EINVAL
;
if
(
ucore
->
outlen
<
sizeof
(
resp
))
return
-
ENOSPC
;
...
...
@@ -2671,6 +2677,10 @@ int ib_uverbs_ex_create_flow(struct ib_uverbs_file *file,
(
cmd
.
flow_attr
.
num_of_specs
*
sizeof
(
struct
ib_uverbs_flow_spec
)))
return
-
EINVAL
;
if
(
cmd
.
flow_attr
.
reserved
[
0
]
||
cmd
.
flow_attr
.
reserved
[
1
])
return
-
EINVAL
;
if
(
cmd
.
flow_attr
.
num_of_specs
)
{
kern_flow_attr
=
kmalloc
(
sizeof
(
*
kern_flow_attr
)
+
cmd
.
flow_attr
.
size
,
GFP_KERNEL
);
...
...
@@ -2731,6 +2741,7 @@ int ib_uverbs_ex_create_flow(struct ib_uverbs_file *file,
if
(
cmd
.
flow_attr
.
size
||
(
i
!=
flow_attr
->
num_of_specs
))
{
pr_warn
(
"create flow failed, flow %d: %d bytes left from uverb cmd
\n
"
,
i
,
cmd
.
flow_attr
.
size
);
err
=
-
EINVAL
;
goto
err_free
;
}
flow_id
=
ib_create_flow
(
qp
,
flow_attr
,
IB_FLOW_DOMAIN_USER
);
...
...
@@ -2791,10 +2802,16 @@ int ib_uverbs_ex_destroy_flow(struct ib_uverbs_file *file,
struct
ib_uobject
*
uobj
;
int
ret
;
if
(
ucore
->
inlen
<
sizeof
(
cmd
))
return
-
EINVAL
;
ret
=
ib_copy_from_udata
(
&
cmd
,
ucore
,
sizeof
(
cmd
));
if
(
ret
)
return
ret
;
if
(
cmd
.
comp_mask
)
return
-
EINVAL
;
uobj
=
idr_write_uobj
(
&
ib_uverbs_rule_idr
,
cmd
.
flow_handle
,
file
->
ucontext
);
if
(
!
uobj
)
...
...
drivers/infiniband/core/uverbs_main.c
浏览文件 @
22f12c60
...
...
@@ -668,25 +668,30 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf,
if
((
hdr
.
in_words
+
ex_hdr
.
provider_in_words
)
*
8
!=
count
)
return
-
EINVAL
;
if
(
ex_hdr
.
cmd_hdr_reserved
)
return
-
EINVAL
;
if
(
ex_hdr
.
response
)
{
if
(
!
hdr
.
out_words
&&
!
ex_hdr
.
provider_out_words
)
return
-
EINVAL
;
if
(
!
access_ok
(
VERIFY_WRITE
,
(
void
__user
*
)
(
unsigned
long
)
ex_hdr
.
response
,
(
hdr
.
out_words
+
ex_hdr
.
provider_out_words
)
*
8
))
return
-
EFAULT
;
}
else
{
if
(
hdr
.
out_words
||
ex_hdr
.
provider_out_words
)
return
-
EINVAL
;
}
INIT_UDATA
(
&
ucore
,
(
hdr
.
in_words
)
?
buf
:
0
,
(
unsigned
long
)
ex_hdr
.
response
,
hdr
.
in_words
*
8
,
hdr
.
out_words
*
8
);
INIT_UDATA
(
&
uhw
,
(
ex_hdr
.
provider_in_words
)
?
buf
+
ucore
.
inlen
:
0
,
(
ex_hdr
.
provider_out_words
)
?
(
unsigned
long
)
ex_hdr
.
response
+
ucore
.
outlen
:
0
,
ex_hdr
.
provider_in_words
*
8
,
ex_hdr
.
provider_out_words
*
8
);
INIT_UDATA_BUF_OR_NULL
(
&
ucore
,
buf
,
(
unsigned
long
)
ex_hdr
.
response
,
hdr
.
in_words
*
8
,
hdr
.
out_words
*
8
);
INIT_UDATA_BUF_OR_NULL
(
&
uhw
,
buf
+
ucore
.
inlen
,
(
unsigned
long
)
ex_hdr
.
response
+
ucore
.
outlen
,
ex_hdr
.
provider_in_words
*
8
,
ex_hdr
.
provider_out_words
*
8
);
err
=
uverbs_ex_cmd_table
[
command
](
file
,
&
ucore
,
...
...
include/rdma/ib_verbs.h
浏览文件 @
22f12c60
...
...
@@ -978,7 +978,7 @@ struct ib_uobject {
};
struct
ib_udata
{
void
__user
*
inbuf
;
const
void
__user
*
inbuf
;
void
__user
*
outbuf
;
size_t
inlen
;
size_t
outlen
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录