Lines Matching refs:the
13 This file documents the features and components of the SCSI FC Transport.
14 It also provides documents the API between the transport and FC LLDDs.
36 port to appear on as multiple communication ports. Using the N_Port Id
39 separate port to other endpoints on the fabric, even though it shares one
40 physical link to the switch for communication. Each N_Port_ID can have a
41 unique view of the fabric based on fabric zoning and array lun-masking
42 (just like a normal non-NPIV adapter). Using the Virtual Fabric (VF)
43 mechanism, adding a fabric header to each frame allows the port to
44 interact with the Fabric Port to join multiple fabrics. The port will
47 used together with VF so that the port can obtain multiple N_Port_IDs
52 World Wide Node Name (wwnn). The transport also allows for the FC4's to
53 be specified for the vport, with FCP_Initiator being the primary role
54 expected. Once instantiated by one of the above methods, it will have a
56 The fc_host associated with the physical adapter will export the ability
57 to create vports. The transport will create the vport object within the
58 Linux device tree, and instruct the fc_host's driver to instantiate the
59 virtual port. Typically, the driver will create a new scsi_host instance
60 on the vport, resulting in a unique <H,C,T,L> namespace for the vport.
64 Note: At this time, the transport is written to create only NPIV-based
70 up to an administrative entity controlling the vport. For example,
72 utility would be responsible for creating wwpn/wwnn's for the vport,
80 Today, the device tree typically contains the scsi_host object,
81 with rports and scsi target objects underneath it. Currently the FC
82 transport creates the vport object and places it under the scsi_host
83 object corresponding to the physical adapter. The LLDD will allocate
84 a new scsi_host for the vport and link its object under the vport.
85 The remainder of the tree under the vports scsi_host is the same
86 as the non-NPIV case. The transport is written currently to easily
87 allow the parent of the vport to be something other than the scsi_host.
88 This could be used in the future to link the object onto a vm-specific
89 device tree. If the vport's parent is not the physical port's scsi_host,
90 a symbolic link to the vport object will be placed in the physical
93 Here's what to expect in the device tree :
96 and it has the typical descendant tree:
98 and then the vport is created on the Physical Port:
100 and the vport's Scsi_Host is then created:
102 and then the rest of the tree progresses, such as:
105 Here's what to expect in the sysfs tree :
113 /sys/class/fc_vports/vport-17:0-0 the vport's fc_vport
115 /sys/class/fc_remote_ports/rport-17:0-0 rport on the physical port
116 /sys/class/fc_remote_ports/rport-18:0-0 rport on the vport
122 The new fc_vport class object has the following attributes
125 The WWNN of the vport
128 The WWPN of the vport
131 Indicates the FC4 roles enabled on the vport.
134 A string, appended to the driver's symbolic port name string, which
135 is registered with the switch to identify the vport. For example,
138 to identify the port.
141 When written with a "1", will tear down the vport.
144 When written with a "1", will transition the vport to a disabled.
145 state. The vport will still be instantiated with the Linux kernel,
146 but it will not be active on the FC link.
147 When written with a "0", will enable the vport.
150 Indicates the previous state of the vport. See the section below on
154 Indicates the state of the vport. See the section below on
158 Reflects the FC mechanism used to create the virtual port.
162 For the fc_host class object, the following attributes are added for vports:
165 Indicates the maximum number of NPIV-based vports that the
166 driver/adapter can support on the fc_host.
169 Indicates how many NPIV-based vports have been instantiated on the
174 A "<WWPN>:<WWNN>" string is written to the attribute. The transport
175 then instantiates the vport object and calls the LLDD to create the
176 vport with the role of FCP_Initiator. Each WWN is specified as 16
181 string is written to the attribute. The transport will locate the
182 vport on the fc_host with the same WWNs and tear it down. Each WWN
191 - Creation with the kernel and LLDD. This means all transport and
194 independent of the adapter's link state.
195 - Instantiation of the vport on the FC link via ELS traffic, etc.
197 Further information can be found in the interfaces section below for
200 Once a vport has been instantiated with the kernel/LLDD, a vport state
201 can be reported via the sysfs attribute. The following states exist:
204 An temporary state, typically set only while the vport is being
205 instantiated with the kernel and LLDD.
208 The vport has been successfully been created on the FC link.
213 on the FC link. This is equivalent to a physical port with the
217 The vport is not operational as the physical link is not operational.
220 The vport is in the process of instantiating on the FC link.
221 The LLDD will set this state just prior to starting the ELS traffic
222 to create the vport. This state will persist until the vport is
224 (state is one of the values below). As this state is transitory,
225 it will not be preserved in the "vport_last_state".
228 The vport is not operational. One of the following conditions were
237 the operation.
240 The vport is not operational. The Fabric has LOGO'd the N_Port_ID
241 associated with the vport.
245 indicating that the WWN's are not valid.
252 The following state table indicates the different state transitions:
279 The following 4 error states all have the same transitions:
294 function in the transport template. The presence of this function will
295 cause the creation of the new attributes on the fc_host. As part of
296 the physical port completing its initialization relative to the
297 transport, it should set the max_npiv_vports attribute to indicate the
298 maximum number of vports the driver and/or adapter supports.
308 vport: Is the newly allocated vport object
309 disable: If "true", the vport is to be created in a disabled stated.
310 If "false", the vport is to be enabled upon creation.
312 When a request is made to create a new vport (via sgio/netlink, or the
313 vport_create fc_host attribute), the transport will validate that the LLDD
315 If not, the create request will be failed. If space remains, the transport
316 will increment the vport count, create the vport object, and then call the
317 LLDD's vport_create() function with the newly allocated vport object.
320 - Creation with the kernel and LLDD. This means all transport and
323 independent of the adapter's link state.
324 - Instantiation of the vport on the FC link via ELS traffic, etc.
328 parts to be fully completed before returning. It must validate that the
329 infrastructure exists to support NPIV, and complete the first part of
331 hinge vport_create() on the link-side operation mainly because:
333 means the vport is in an inoperable state until the link comes up.
334 This is consistent with the link bouncing post vport creation.
336 - This is consistent with a model where: the vport equates to a
338 to the adapter, which is independent of link state.
343 The expected behavior for the LLDD's vport_create() function is:
345 - If the driver or adapter cannot support another vport, whether
348 - If the driver validates the WWN's against those already active on
349 the adapter and detects an overlap - return VPCERR_BAD_WWN.
350 - If the driver detects the topology is loop, non-fabric, or the
353 of memory conditions, return the respective negative Exxx error code.
354 - If the role is FCP Initiator, the LLDD is to :
355 - Call scsi_host_alloc() to allocate a scsi_host for the vport.
356 - Call scsi_add_host(new_shost, &vport->dev) to start the scsi_host
357 and bind it as a child of the vport device.
358 - Initializes the fc_host attribute values.
359 - Kick of further vport state transitions based on the disable flag and
364 the physical port and the virtual port. The physical port's template
365 would have the vport_create, vport_delete, and vport_disable functions,
366 while the vports would not.
368 for the physical port and virtual port. Likely, there are driver
369 attributes, embedded into the scsi_host_template, that are applicable
370 for the physical port only (link speed, topology setting, etc). This
371 ensures that the attributes are applicable to the respective scsi_host.
382 disable: If "true", the vport is to be disabled.
383 If "false", the vport is to be enabled.
385 When a request is made to change the disabled state on a vport, the
386 transport will validate the request against the existing vport state.
387 If the request is to disable and the vport is already disabled, the
388 request will fail. Similarly, if the request is to enable, and the
389 vport is not in a disabled state, the request will fail. If the request
390 is valid for the vport state, the transport will call the LLDD to
391 change the vport's state.
393 Within the LLDD, if a vport is disabled, it remains instantiated with
394 the kernel and LLDD, but it is not active or visible on the FC link in
395 any way. (see Vport Creation and the 2 part instantiation discussion).
397 When enabling a vport, the LLDD reinstantiates the vport on the FC
398 link - essentially restarting the LLDD statemachine (see Vport States
411 When a request is made to delete a vport (via sgio/netlink, or via the
412 fc_host or fc_vport vport_delete attributes), the transport will call
413 the LLDD to terminate the vport on the FC link, and teardown all other
414 datastructures and references. If the LLDD completes successfully,
415 the transport will teardown the vport objects and complete the vport
416 removal. If the LLDD delete request fails, the vport object will remain,
419 Within the LLDD, the normal code paths for a scsi_host teardown should
420 be followed. E.g. If the vport has a FCP Initiator role, the LLDD
421 will call fc_remove_host() for the vports scsi_host, followed by
422 scsi_remove_host() and scsi_host_put() for the vports scsi_host.
429 the port_type attribute would be set to NPORT, NLPORT, etc based on the
430 topology type and existence of the fabric. As this is not applicable to
431 a vport, it makes more sense to report the FC mechanism used to create
432 the vport.
436 scsi_remove_host(). This allows the fc_host to tear down all remote
437 ports prior the scsi_host being torn down. The fc_remove_host() call
438 was updated to remove all vports for the fc_host as well.
444 The following functions are supplied by the FC-transport for use by LLDs.
453 * @shost: scsi host the virtual port is connected to.
455 * the virtual port.
467 * Calls the LLDD vport_delete() function, then deallocates and removes
468 * the vport from the shost and object tree.