Skip to content

Commit 9a74e88

Browse files
Robert LoveJames Bottomley
Robert Love
authored and
James Bottomley
committed
[SCSI] libfcoe: Add fcoe_sysfs
This patch adds a 'fcoe bus' infrastructure to the kernel that is driven by changes to libfcoe which allow LLDs to present FIP (FCoE Initialization Protocol) discovered entities and their attributes to user space via sysfs. This patch adds the following APIs- fcoe_ctlr_device_add fcoe_ctlr_device_delete fcoe_fcf_device_add fcoe_fcf_device_delete They allow the LLD to expose the FCoE ENode Controller and any discovered FCFs (Fibre Channel Forwarders, e.g. FCoE switches) to the user. Each of these new devices has their own bus_type so that they are grouped together for easy lookup from a user space application. Each new class has an attribute_group to expose attributes for any created instances. The attributes are- fcoe_ctlr_device * fcf_dev_loss_tmo * lesb_link_fail * lesb_vlink_fail * lesb_miss_fka * lesb_symb_err * lesb_err_block * lesb_fcs_error fcoe_fcf_device * fabric_name * switch_name * priority * selected * fc_map * vfid * mac * fka_peroid * fabric_state * dev_loss_tmo A device loss infrastructre similar to the FC Transport's is also added by this patch. It is nice to have so that a link flapping adapter doesn't continually advance the count used to identify the discovered FCF. FCFs will exist in a "Disconnected" state until either the timer expires or the FCF is rediscovered and becomes "Connected." This patch generates a few checkpatch.pl WARNINGS that I'm not sure what to do about. They're macros modeled around the FC Transport attribute building macros, which have the same 'feature' where the caller can ommit a cast in the argument list and no cast occurs in the code. I'm not sure how to keep the code condensed while keeping the macros. Any advice would be appreciated. Signed-off-by: Robert Love <[email protected]> Tested-by: Ross Brattain <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: James Bottomley <[email protected]>
1 parent fd8f890 commit 9a74e88

File tree

6 files changed

+1046
-3
lines changed

6 files changed

+1046
-3
lines changed
+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
What: /sys/bus/fcoe/ctlr_X
2+
Date: March 2012
3+
KernelVersion: TBD
4+
Contact: Robert Love <[email protected]>, [email protected]
5+
Description: 'FCoE Controller' instances on the fcoe bus
6+
Attributes:
7+
8+
fcf_dev_loss_tmo: Device loss timeout peroid (see below). Changing
9+
this value will change the dev_loss_tmo for all
10+
FCFs discovered by this controller.
11+
12+
lesb_link_fail: Link Error Status Block (LESB) link failure count.
13+
14+
lesb_vlink_fail: Link Error Status Block (LESB) virtual link
15+
failure count.
16+
17+
lesb_miss_fka: Link Error Status Block (LESB) missed FCoE
18+
Initialization Protocol (FIP) Keep-Alives (FKA).
19+
20+
lesb_symb_err: Link Error Status Block (LESB) symbolic error count.
21+
22+
lesb_err_block: Link Error Status Block (LESB) block error count.
23+
24+
lesb_fcs_error: Link Error Status Block (LESB) Fibre Channel
25+
Serivces error count.
26+
27+
Notes: ctlr_X (global increment starting at 0)
28+
29+
What: /sys/bus/fcoe/fcf_X
30+
Date: March 2012
31+
KernelVersion: TBD
32+
Contact: Robert Love <[email protected]>, [email protected]
33+
Description: 'FCoE FCF' instances on the fcoe bus. A FCF is a Fibre Channel
34+
Forwarder, which is a FCoE switch that can accept FCoE
35+
(Ethernet) packets, unpack them, and forward the embedded
36+
Fibre Channel frames into a FC fabric. It can also take
37+
outbound FC frames and pack them in Ethernet packets to
38+
be sent to their destination on the Ethernet segment.
39+
Attributes:
40+
41+
fabric_name: Identifies the fabric that the FCF services.
42+
43+
switch_name: Identifies the FCF.
44+
45+
priority: The switch's priority amongst other FCFs on the same
46+
fabric.
47+
48+
selected: 1 indicates that the switch has been selected for use;
49+
0 indicates that the swich will not be used.
50+
51+
fc_map: The Fibre Channel MAP
52+
53+
vfid: The Virtual Fabric ID
54+
55+
mac: The FCF's MAC address
56+
57+
fka_peroid: The FIP Keep-Alive peroid
58+
59+
fabric_state: The internal kernel state
60+
"Unknown" - Initialization value
61+
"Disconnected" - No link to the FCF/fabric
62+
"Connected" - Host is connected to the FCF
63+
"Deleted" - FCF is being removed from the system
64+
65+
dev_loss_tmo: The device loss timeout peroid for this FCF.
66+
67+
Notes: A device loss infrastructre similar to the FC Transport's
68+
is present in fcoe_sysfs. It is nice to have so that a
69+
link flapping adapter doesn't continually advance the count
70+
used to identify the discovered FCF. FCFs will exist in a
71+
"Disconnected" state until either the timer expires and the
72+
FCF becomes "Deleted" or the FCF is rediscovered and becomes
73+
"Connected."
74+
75+
76+
Users: The first user of this interface will be the fcoeadm application,
77+
which is commonly packaged in the fcoe-utils package.

drivers/scsi/fcoe/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
obj-$(CONFIG_FCOE) += fcoe.o
22
obj-$(CONFIG_LIBFCOE) += libfcoe.o
33

4-
libfcoe-objs := fcoe_ctlr.o fcoe_transport.o
4+
libfcoe-objs := fcoe_ctlr.o fcoe_transport.o fcoe_sysfs.o

0 commit comments

Comments
 (0)