Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
bbdfcf18
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
bbdfcf18
编写于
3月 03, 2016
作者:
D
Doug Ledford
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'k.o/for-4.5-rc' into HEAD
上级
fc77dbd3
3d943c9d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
22 deletion
+29
-22
drivers/infiniband/core/device.c
drivers/infiniband/core/device.c
+1
-0
drivers/infiniband/core/uverbs_cmd.c
drivers/infiniband/core/uverbs_cmd.c
+6
-3
drivers/infiniband/hw/mlx5/srq.c
drivers/infiniband/hw/mlx5/srq.c
+22
-19
未找到文件。
drivers/infiniband/core/device.c
浏览文件 @
bbdfcf18
...
...
@@ -358,6 +358,7 @@ int ib_register_device(struct ib_device *device,
ret
=
device
->
query_device
(
device
,
&
device
->
attrs
,
&
uhw
);
if
(
ret
)
{
printk
(
KERN_WARNING
"Couldn't query the device attributes
\n
"
);
ib_cache_cleanup_one
(
device
);
goto
out
;
}
...
...
drivers/infiniband/core/uverbs_cmd.c
浏览文件 @
bbdfcf18
...
...
@@ -1970,7 +1970,8 @@ ssize_t ib_uverbs_create_qp(struct ib_uverbs_file *file,
resp_size
);
INIT_UDATA
(
&
uhw
,
buf
+
sizeof
(
cmd
),
(
unsigned
long
)
cmd
.
response
+
resp_size
,
in_len
-
sizeof
(
cmd
),
out_len
-
resp_size
);
in_len
-
sizeof
(
cmd
)
-
sizeof
(
struct
ib_uverbs_cmd_hdr
),
out_len
-
resp_size
);
memset
(
&
cmd_ex
,
0
,
sizeof
(
cmd_ex
));
cmd_ex
.
user_handle
=
cmd
.
user_handle
;
...
...
@@ -3413,7 +3414,8 @@ ssize_t ib_uverbs_create_srq(struct ib_uverbs_file *file,
INIT_UDATA
(
&
udata
,
buf
+
sizeof
cmd
,
(
unsigned
long
)
cmd
.
response
+
sizeof
resp
,
in_len
-
sizeof
cmd
,
out_len
-
sizeof
resp
);
in_len
-
sizeof
cmd
-
sizeof
(
struct
ib_uverbs_cmd_hdr
),
out_len
-
sizeof
resp
);
ret
=
__uverbs_create_xsrq
(
file
,
ib_dev
,
&
xcmd
,
&
udata
);
if
(
ret
)
...
...
@@ -3439,7 +3441,8 @@ ssize_t ib_uverbs_create_xsrq(struct ib_uverbs_file *file,
INIT_UDATA
(
&
udata
,
buf
+
sizeof
cmd
,
(
unsigned
long
)
cmd
.
response
+
sizeof
resp
,
in_len
-
sizeof
cmd
,
out_len
-
sizeof
resp
);
in_len
-
sizeof
cmd
-
sizeof
(
struct
ib_uverbs_cmd_hdr
),
out_len
-
sizeof
resp
);
ret
=
__uverbs_create_xsrq
(
file
,
ib_dev
,
&
cmd
,
&
udata
);
if
(
ret
)
...
...
drivers/infiniband/hw/mlx5/srq.c
浏览文件 @
bbdfcf18
...
...
@@ -75,7 +75,8 @@ static void mlx5_ib_srq_event(struct mlx5_core_srq *srq, enum mlx5_event type)
static
int
create_srq_user
(
struct
ib_pd
*
pd
,
struct
mlx5_ib_srq
*
srq
,
struct
mlx5_create_srq_mbox_in
**
in
,
struct
ib_udata
*
udata
,
int
buf_size
,
int
*
inlen
)
struct
ib_udata
*
udata
,
int
buf_size
,
int
*
inlen
,
int
is_xrc
)
{
struct
mlx5_ib_dev
*
dev
=
to_mdev
(
pd
->
device
);
struct
mlx5_ib_create_srq
ucmd
=
{};
...
...
@@ -87,13 +88,8 @@ static int create_srq_user(struct ib_pd *pd, struct mlx5_ib_srq *srq,
int
ncont
;
u32
offset
;
u32
uidx
=
MLX5_IB_DEFAULT_UIDX
;
int
drv_data
=
udata
->
inlen
-
sizeof
(
struct
ib_uverbs_cmd_hdr
);
if
(
drv_data
<
0
)
return
-
EINVAL
;
ucmdlen
=
(
drv_data
<
sizeof
(
ucmd
))
?
drv_data
:
sizeof
(
ucmd
);
ucmdlen
=
min
(
udata
->
inlen
,
sizeof
(
ucmd
));
if
(
ib_copy_from_udata
(
&
ucmd
,
udata
,
ucmdlen
))
{
mlx5_ib_dbg
(
dev
,
"failed copy udata
\n
"
);
...
...
@@ -103,15 +99,17 @@ static int create_srq_user(struct ib_pd *pd, struct mlx5_ib_srq *srq,
if
(
ucmd
.
reserved0
||
ucmd
.
reserved1
)
return
-
EINVAL
;
if
(
drv_data
>
sizeof
(
ucmd
)
&&
if
(
udata
->
inlen
>
sizeof
(
ucmd
)
&&
!
ib_is_udata_cleared
(
udata
,
sizeof
(
ucmd
),
drv_data
-
sizeof
(
ucmd
)))
udata
->
inlen
-
sizeof
(
ucmd
)))
return
-
EINVAL
;
err
=
get_srq_user_index
(
to_mucontext
(
pd
->
uobject
->
context
),
&
ucmd
,
udata
->
inlen
,
&
uidx
);
if
(
err
)
return
err
;
if
(
is_xrc
)
{
err
=
get_srq_user_index
(
to_mucontext
(
pd
->
uobject
->
context
),
&
ucmd
,
udata
->
inlen
,
&
uidx
);
if
(
err
)
return
err
;
}
srq
->
wq_sig
=
!!
(
ucmd
.
flags
&
MLX5_SRQ_FLAG_SIGNATURE
);
...
...
@@ -151,7 +149,8 @@ static int create_srq_user(struct ib_pd *pd, struct mlx5_ib_srq *srq,
(
*
in
)
->
ctx
.
log_pg_sz
=
page_shift
-
MLX5_ADAPTER_PAGE_SHIFT
;
(
*
in
)
->
ctx
.
pgoff_cqn
=
cpu_to_be32
(
offset
<<
26
);
if
(
MLX5_CAP_GEN
(
dev
->
mdev
,
cqe_version
)
==
MLX5_CQE_VERSION_V1
)
{
if
((
MLX5_CAP_GEN
(
dev
->
mdev
,
cqe_version
)
==
MLX5_CQE_VERSION_V1
)
&&
is_xrc
){
xsrqc
=
MLX5_ADDR_OF
(
create_xrc_srq_in
,
*
in
,
xrc_srq_context_entry
);
MLX5_SET
(
xrc_srqc
,
xsrqc
,
user_index
,
uidx
);
...
...
@@ -170,7 +169,7 @@ static int create_srq_user(struct ib_pd *pd, struct mlx5_ib_srq *srq,
static
int
create_srq_kernel
(
struct
mlx5_ib_dev
*
dev
,
struct
mlx5_ib_srq
*
srq
,
struct
mlx5_create_srq_mbox_in
**
in
,
int
buf_size
,
int
*
inlen
)
int
*
inlen
,
int
is_xrc
)
{
int
err
;
int
i
;
...
...
@@ -224,7 +223,8 @@ static int create_srq_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_srq *srq,
(
*
in
)
->
ctx
.
log_pg_sz
=
page_shift
-
MLX5_ADAPTER_PAGE_SHIFT
;
if
(
MLX5_CAP_GEN
(
dev
->
mdev
,
cqe_version
)
==
MLX5_CQE_VERSION_V1
)
{
if
((
MLX5_CAP_GEN
(
dev
->
mdev
,
cqe_version
)
==
MLX5_CQE_VERSION_V1
)
&&
is_xrc
){
xsrqc
=
MLX5_ADDR_OF
(
create_xrc_srq_in
,
*
in
,
xrc_srq_context_entry
);
/* 0xffffff means we ask to work with cqe version 0 */
...
...
@@ -302,10 +302,14 @@ struct ib_srq *mlx5_ib_create_srq(struct ib_pd *pd,
desc_size
,
init_attr
->
attr
.
max_wr
,
srq
->
msrq
.
max
,
srq
->
msrq
.
max_gs
,
srq
->
msrq
.
max_avail_gather
);
is_xrc
=
(
init_attr
->
srq_type
==
IB_SRQT_XRC
);
if
(
pd
->
uobject
)
err
=
create_srq_user
(
pd
,
srq
,
&
in
,
udata
,
buf_size
,
&
inlen
);
err
=
create_srq_user
(
pd
,
srq
,
&
in
,
udata
,
buf_size
,
&
inlen
,
is_xrc
);
else
err
=
create_srq_kernel
(
dev
,
srq
,
&
in
,
buf_size
,
&
inlen
);
err
=
create_srq_kernel
(
dev
,
srq
,
&
in
,
buf_size
,
&
inlen
,
is_xrc
);
if
(
err
)
{
mlx5_ib_warn
(
dev
,
"create srq %s failed, err %d
\n
"
,
...
...
@@ -313,7 +317,6 @@ struct ib_srq *mlx5_ib_create_srq(struct ib_pd *pd,
goto
err_srq
;
}
is_xrc
=
(
init_attr
->
srq_type
==
IB_SRQT_XRC
);
in
->
ctx
.
state_log_sz
=
ilog2
(
srq
->
msrq
.
max
);
flgs
=
((
srq
->
msrq
.
wqe_shift
-
4
)
|
(
is_xrc
<<
5
)
|
(
srq
->
wq_sig
<<
7
))
<<
24
;
xrcdn
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录