Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a74e884 authored by Robert Love's avatar Robert Love Committed by James Bottomley
Browse files

[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: default avatarRobert Love <robert.w.love@intel.com>
Tested-by: default avatarRoss Brattain <ross.b.brattain@intel.com>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent fd8f8902
Loading
Loading
Loading
Loading
+77 −0
Original line number Diff line number Diff line
What:		/sys/bus/fcoe/ctlr_X
Date:		March 2012
KernelVersion:	TBD
Contact:	Robert Love <robert.w.love@intel.com>, devel@open-fcoe.org
Description:	'FCoE Controller' instances on the fcoe bus
Attributes:

	fcf_dev_loss_tmo: Device loss timeout peroid (see below). Changing
			  this value will change the dev_loss_tmo for all
			  FCFs discovered by this controller.

	lesb_link_fail:   Link Error Status Block (LESB) link failure count.

	lesb_vlink_fail:  Link Error Status Block (LESB) virtual link
			  failure count.

	lesb_miss_fka:    Link Error Status Block (LESB) missed FCoE
			  Initialization Protocol (FIP) Keep-Alives (FKA).

	lesb_symb_err:    Link Error Status Block (LESB) symbolic error count.

	lesb_err_block:   Link Error Status Block (LESB) block error count.

	lesb_fcs_error:   Link Error Status Block (LESB) Fibre Channel
			  Serivces error count.

Notes: ctlr_X (global increment starting at 0)

What:		/sys/bus/fcoe/fcf_X
Date:		March 2012
KernelVersion:	TBD
Contact:	Robert Love <robert.w.love@intel.com>, devel@open-fcoe.org
Description:	'FCoE FCF' instances on the fcoe bus. A FCF is a Fibre Channel
		Forwarder, which is a FCoE switch that can accept FCoE
		(Ethernet) packets, unpack them, and forward the embedded
		Fibre Channel frames into a FC fabric. It can also take
		outbound FC frames and pack them in Ethernet packets to
		be sent to their destination on the Ethernet segment.
Attributes:

	fabric_name: Identifies the fabric that the FCF services.

	switch_name: Identifies the FCF.

	priority:    The switch's priority amongst other FCFs on the same
		     fabric.

	selected:    1 indicates that the switch has been selected for use;
		     0 indicates that the swich will not be used.

	fc_map:      The Fibre Channel MAP

	vfid:	     The Virtual Fabric ID

	mac:         The FCF's MAC address

	fka_peroid:  The FIP Keep-Alive peroid

	fabric_state: The internal kernel state
		      "Unknown" - Initialization value
		      "Disconnected" - No link to the FCF/fabric
		      "Connected" - Host is connected to the FCF
		      "Deleted" - FCF is being removed from the system

	dev_loss_tmo: The device loss timeout peroid for this FCF.

Notes: A device loss infrastructre similar to the FC Transport's
       is present in fcoe_sysfs. 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 and the
       FCF becomes "Deleted" or the FCF is rediscovered and becomes
       "Connected."


Users: The first user of this interface will be the fcoeadm application,
       which is commonly packaged in the fcoe-utils package.
+1 −1
Original line number Diff line number Diff line
obj-$(CONFIG_FCOE) += fcoe.o
obj-$(CONFIG_LIBFCOE) += libfcoe.o

libfcoe-objs := fcoe_ctlr.o fcoe_transport.o
libfcoe-objs := fcoe_ctlr.o fcoe_transport.o fcoe_sysfs.o
Loading