Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Linux-御风守护者
linux
提交
a1d4ebdb
L
linux
项目概览
Linux-御风守护者
/
linux
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a1d4ebdb
编写于
5月 04, 2005
作者:
L
Linus Torvalds
浏览文件
操作
浏览文件
下载
差异文件
Merge of
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/aoe-2.6.git/
上级
742b0c90
0e57c716
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
70 addition
and
17 deletion
+70
-17
Documentation/aoe/aoe.txt
Documentation/aoe/aoe.txt
+36
-4
Documentation/aoe/status.sh
Documentation/aoe/status.sh
+0
-4
drivers/block/aoe/aoe.h
drivers/block/aoe/aoe.h
+1
-1
drivers/block/aoe/aoeblk.c
drivers/block/aoe/aoeblk.c
+13
-0
drivers/block/aoe/aoedev.c
drivers/block/aoe/aoedev.c
+4
-7
drivers/block/aoe/aoenet.c
drivers/block/aoe/aoenet.c
+16
-1
未找到文件。
Documentation/aoe/aoe.txt
浏览文件 @
a1d4ebdb
...
...
@@ -4,6 +4,16 @@ The EtherDrive (R) HOWTO for users of 2.6 kernels is found at ...
It has many tips and hints!
The aoetools are userland programs that are designed to work with this
driver. The aoetools are on sourceforge.
http://aoetools.sourceforge.net/
The scripts in this Documentation/aoe directory are intended to
document the use of the driver and are not necessary if you install
the aoetools.
CREATING DEVICE NODES
Users of udev should find the block device nodes created
...
...
@@ -35,14 +45,15 @@ USING DEVICE NODES
"echo eth2 eth4 > /dev/etherd/interfaces" tells the aoe driver to
limit ATA over Ethernet traffic to eth2 and eth4. AoE traffic from
untrusted networks should be ignored as a matter of security.
untrusted networks should be ignored as a matter of security. See
also the aoe_iflist driver option described below.
"echo > /dev/etherd/discover" tells the driver to find out what AoE
devices are available.
These character devices may disappear and be replaced by sysfs
counterparts
, so distribution maintainers are encouraged to create
scripts that use these device
s.
counterparts
. Using the commands in aoetools insulates users from
these implementation detail
s.
The block devices are named like this:
...
...
@@ -66,7 +77,8 @@ USING SYSFS
through which we are communicating with the remote AoE device.
There is a script in this directory that formats this information
in a convenient way.
in a convenient way. Users with aoetools can use the aoe-stat
command.
root@makki root# sh Documentation/aoe/status.sh
e10.0 eth3 up
...
...
@@ -89,3 +101,23 @@ USING SYSFS
e4.7 eth1 up
e4.8 eth1 up
e4.9 eth1 up
Use /sys/module/aoe/parameters/aoe_iflist (or better, the driver
option discussed below) instead of /dev/etherd/interfaces to limit
AoE traffic to the network interfaces in the given
whitespace-separated list. Unlike the old character device, the
sysfs entry can be read from as well as written to.
It's helpful to trigger discovery after setting the list of allowed
interfaces. The aoetools package provides an aoe-discover script
for this purpose. You can also directly use the
/dev/etherd/discover special file described above.
DRIVER OPTIONS
There is a boot option for the built-in aoe driver and a
corresponding module parameter, aoe_iflist. Without this option,
all network interfaces may be used for ATA over Ethernet. Here is a
usage example for the module parameter.
modprobe aoe_iflist="eth1 eth3"
Documentation/aoe/status.sh
浏览文件 @
a1d4ebdb
...
...
@@ -14,10 +14,6 @@ test ! -d "$sysd/block" && {
echo
"
$me
Error: sysfs is not mounted"
1>&2
exit
1
}
test
-z
"
`
lsmod |
grep
'^aoe'
`
"
&&
{
echo
"
$me
Error: aoe module is not loaded"
1>&2
exit
1
}
for
d
in
`
ls
-d
$sysd
/block/etherd
*
2>/dev/null |
grep
-v
p
`
end
;
do
# maybe ls comes up empty, so we use "end"
...
...
drivers/block/aoe/aoe.h
浏览文件 @
a1d4ebdb
/* Copyright (c) 2004 Coraid, Inc. See COPYING for GPL terms. */
#define VERSION "
6
"
#define VERSION "
10
"
#define AOE_MAJOR 152
#define DEVICE_NAME "aoe"
...
...
drivers/block/aoe/aoeblk.c
浏览文件 @
a1d4ebdb
...
...
@@ -37,6 +37,13 @@ static ssize_t aoedisk_show_netif(struct gendisk * disk, char *page)
return
snprintf
(
page
,
PAGE_SIZE
,
"%s
\n
"
,
d
->
ifp
->
name
);
}
/* firmware version */
static
ssize_t
aoedisk_show_fwver
(
struct
gendisk
*
disk
,
char
*
page
)
{
struct
aoedev
*
d
=
disk
->
private_data
;
return
snprintf
(
page
,
PAGE_SIZE
,
"0x%04x
\n
"
,
(
unsigned
int
)
d
->
fw_ver
);
}
static
struct
disk_attribute
disk_attr_state
=
{
.
attr
=
{.
name
=
"state"
,
.
mode
=
S_IRUGO
},
...
...
@@ -50,6 +57,10 @@ static struct disk_attribute disk_attr_netif = {
.
attr
=
{.
name
=
"netif"
,
.
mode
=
S_IRUGO
},
.
show
=
aoedisk_show_netif
};
static
struct
disk_attribute
disk_attr_fwver
=
{
.
attr
=
{.
name
=
"firmware-version"
,
.
mode
=
S_IRUGO
},
.
show
=
aoedisk_show_fwver
};
static
void
aoedisk_add_sysfs
(
struct
aoedev
*
d
)
...
...
@@ -57,6 +68,7 @@ aoedisk_add_sysfs(struct aoedev *d)
sysfs_create_file
(
&
d
->
gd
->
kobj
,
&
disk_attr_state
.
attr
);
sysfs_create_file
(
&
d
->
gd
->
kobj
,
&
disk_attr_mac
.
attr
);
sysfs_create_file
(
&
d
->
gd
->
kobj
,
&
disk_attr_netif
.
attr
);
sysfs_create_file
(
&
d
->
gd
->
kobj
,
&
disk_attr_fwver
.
attr
);
}
void
aoedisk_rm_sysfs
(
struct
aoedev
*
d
)
...
...
@@ -64,6 +76,7 @@ aoedisk_rm_sysfs(struct aoedev *d)
sysfs_remove_link
(
&
d
->
gd
->
kobj
,
"state"
);
sysfs_remove_link
(
&
d
->
gd
->
kobj
,
"mac"
);
sysfs_remove_link
(
&
d
->
gd
->
kobj
,
"netif"
);
sysfs_remove_link
(
&
d
->
gd
->
kobj
,
"firmware-version"
);
}
static
int
...
...
drivers/block/aoe/aoedev.c
浏览文件 @
a1d4ebdb
...
...
@@ -109,25 +109,22 @@ aoedev_set(ulong sysminor, unsigned char *addr, struct net_device *ifp, ulong bu
spin_lock_irqsave
(
&
devlist_lock
,
flags
);
for
(
d
=
devlist
;
d
;
d
=
d
->
next
)
if
(
d
->
sysminor
==
sysminor
||
memcmp
(
d
->
addr
,
addr
,
sizeof
d
->
addr
)
==
0
)
if
(
d
->
sysminor
==
sysminor
)
break
;
if
(
d
==
NULL
&&
(
d
=
aoedev_newdev
(
bufcnt
))
==
NULL
)
{
spin_unlock_irqrestore
(
&
devlist_lock
,
flags
);
printk
(
KERN_INFO
"aoe: aoedev_set: aoedev_newdev failure.
\n
"
);
return
NULL
;
}
}
/* if newdev, (d->flags & DEVFL_UP) == 0 for below */
spin_unlock_irqrestore
(
&
devlist_lock
,
flags
);
spin_lock_irqsave
(
&
d
->
lock
,
flags
);
d
->
ifp
=
ifp
;
if
(
d
->
sysminor
!=
sysminor
||
(
d
->
flags
&
DEVFL_UP
)
==
0
)
{
memcpy
(
d
->
addr
,
addr
,
sizeof
d
->
addr
);
if
((
d
->
flags
&
DEVFL_UP
)
==
0
)
{
aoedev_downdev
(
d
);
/* flushes outstanding frames */
memcpy
(
d
->
addr
,
addr
,
sizeof
d
->
addr
);
d
->
sysminor
=
sysminor
;
d
->
aoemajor
=
AOEMAJOR
(
sysminor
);
d
->
aoeminor
=
AOEMINOR
(
sysminor
);
...
...
drivers/block/aoe/aoenet.c
浏览文件 @
a1d4ebdb
...
...
@@ -7,6 +7,7 @@
#include <linux/hdreg.h>
#include <linux/blkdev.h>
#include <linux/netdevice.h>
#include <linux/moduleparam.h>
#include "aoe.h"
#define NECODES 5
...
...
@@ -26,6 +27,19 @@ enum {
};
static
char
aoe_iflist
[
IFLISTSZ
];
module_param_string
(
aoe_iflist
,
aoe_iflist
,
IFLISTSZ
,
0600
);
MODULE_PARM_DESC
(
aoe_iflist
,
"aoe_iflist=
\"
dev1 [dev2 ...]
\"\n
"
);
#ifndef MODULE
static
int
__init
aoe_iflist_setup
(
char
*
str
)
{
strncpy
(
aoe_iflist
,
str
,
IFLISTSZ
);
aoe_iflist
[
IFLISTSZ
-
1
]
=
'\0'
;
return
1
;
}
__setup
(
"aoe_iflist="
,
aoe_iflist_setup
);
#endif
int
is_aoe_netif
(
struct
net_device
*
ifp
)
...
...
@@ -36,7 +50,8 @@ is_aoe_netif(struct net_device *ifp)
if
(
aoe_iflist
[
0
]
==
'\0'
)
return
1
;
for
(
p
=
aoe_iflist
;
*
p
;
p
=
q
+
strspn
(
q
,
WHITESPACE
))
{
p
=
aoe_iflist
+
strspn
(
aoe_iflist
,
WHITESPACE
);
for
(;
*
p
;
p
=
q
+
strspn
(
q
,
WHITESPACE
))
{
q
=
p
+
strcspn
(
p
,
WHITESPACE
);
if
(
q
!=
p
)
len
=
q
-
p
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录