SCST在SAN网络环境中的应用

问题描述

在SAN网络环境中,Linux服务器上的SCSI设备,如何通过HBA卡,走光纤网络,让其他的服务器使用到这些设备?本文采用SCST - Generic SCSI Target Subsystem for Linux,试图解决该问题。

查看HBA卡的信息

# lspci | grep -i fibre
01:00.0 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Express HBA (rev 03)
01:00.1 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Express HBA (rev 03)

一块卡上有2个端口。

在/sys/class/fc_host/目录下,可以查看HBA卡信息

# cd /sys/class/fc_host/
# ls
host0  host1    # 有两个端口
# cat ./host1/port_name # 查看端口1的名称
0x2101001b3235b031
# cat ./host1/port_state # 查看端口1的状态
Online
# cat ./host1/speed # 查看端口1的速率
4 Gbit

通过查看host0,host1目录下的属性文件,可以查看HBA的各种信息。

安装systool工具,可以方便的查看HBA信息,该工具在sysfsutils包中。

# rpm -ivh libsysfs-2.1.0-7.el6.x86_64.rpm
# rpm -ivh sysfsutils-2.1.0-7.el6.x86_64.rpm

查看端口名称
# systool -c fc_host -v | grep "port_name"
port_name           = "0x2100001b3215b031"
port_name           = "0x2101001b3235b031"
查看端口速率
# systool -c fc_host -v | grep "speed"
speed               = "unknown"
supported_speeds    = "1 Gbit, 2 Gbit, 4 Gbit"
speed               = "4 Gbit"
supported_speeds    = "1 Gbit, 2 Gbit, 4 Gbit"
查看端口状态
# systool -c fc_host -v
Class = "fc_host"
......
Class Device = "host1"
Class Device path = "/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.1/host1/fc_host/host1"
dev_loss_tmo        = "45"
fabric_name         = "0xffffffff"
issue_lip           = <store method only>
max_npiv_vports     = "127"
node_name           = "0x2001001b3235b031"
npiv_vports_inuse   = "0"
**port_id             = "0x0000ef"**
**port_name           = "0x2101001b3235b031"**
**port_state          = "Online"**
port_type           = "Point-To-Point (direct nport connection)"
**speed               = "4 Gbit"**
supported_classes   = "Class 3"
supported_speeds    = "1 Gbit, 2 Gbit, 4 Gbit"
symbolic_name       = "QLE2462 FW:v7.03.00 DVR:v8.07.00.08.06.6-k1"
system_hostname     = ""
tgtid_bind_type     = "wwpn (World Wide Port Name)"
uevent              = 
vport_create        = <store method only>
vport_delete        = <store method only>

Device = "host1&
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
m7_scst_VTABLE是一个结构体,用于存储SCST的虚函数表。在SCST,每个驱动程序都有一个虚函数表,其包含了驱动程序的所有虚函数的地址。这些虚函数可以被其他函数调用,以执行特定的操作。m7_scst_VTABLE结构体包含了以下成员变量: - m7_scst_uint32_t magic:一个魔术数字,用于标识虚函数表的有效性。 - m7_scst_uint32_t version:虚函数表的版本号。 - m7_scst_uint32_t size:虚函数表的大小,以字节为单位。 - m7_scst_uint32_t reserved:保留字段,未使用。 - m7_scst_scsi_command_status_t (*execute_scsi_command)(m7_scst_scsi_command_t *command):执行SCSI命令的虚函数。 - m7_scst_uint32_t (*get_device_type)(void):获取设备类型的虚函数。 - m7_scst_uint32_t (*get_device_id)(void):获取设备ID的虚函数。 - m7_scst_uint32_t (*get_lun)(void):获取逻辑单元号的虚函数。 - m7_scst_uint32_t (*get_max_lun)(void):获取最大逻辑单元号的虚函数。 - m7_scst_uint32_t (*get_block_size)(void):获取块大小的虚函数。 - m7_scst_uint32_t (*get_device_size)(void):获取设备大小的虚函数。 - m7_scst_uint32_t (*get_device_status)(void):获取设备状态的虚函数。 - m7_scst_uint32_t (*get_device_info)(m7_scst_device_info_t *info):获取设备信息的虚函数。 这些虚函数可以被其他函数调用,以执行特定的操作。例如,execute_scsi_command函数用于执行SCSI命令,get_device_type函数用于获取设备类型,get_device_id函数用于获取设备ID等等。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值