aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fcoe
diff options
context:
space:
mode:
authorChris Leech <christopher.leech@intel.com>2009-11-03 14:47:18 -0500
committerJames Bottomley <James.Bottomley@suse.de>2009-12-04 13:01:04 -0500
commitdc8596d303bb306da9ab5326fa6209710de86b8b (patch)
treec9f747013ecf23b966e057daf0b7cb87e6495f99 /drivers/scsi/fcoe
parentc914f7d16df6420cfd4c09399957425ba9c21f47 (diff)
[SCSI] fcoe: vport symbolic name support
Allow a vport specific string to be appended to the port symbolic name. The new symbolic name is sent to the name server after it is set. This currently messes with libhbalinux, which is looking for the fcoe "fcoe <ver> over <ethX>" string and expects whatever comes after the "over" to be a network interface name only. Adds an EXPORT_SYMBOL to libfc for fc_frame_alloc_fill, which is needed to allow fcoe to allocate a frame of variable length for the RSPN request. Signed-off-by: Chris Leech <christopher.leech@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/fcoe')
-rw-r--r--drivers/scsi/fcoe/fcoe.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 437eacf2732d..f1c126b798af 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -96,6 +96,7 @@ static struct scsi_transport_template *fcoe_vport_transport_template;
96static int fcoe_vport_destroy(struct fc_vport *vport); 96static int fcoe_vport_destroy(struct fc_vport *vport);
97static int fcoe_vport_create(struct fc_vport *vport, bool disabled); 97static int fcoe_vport_create(struct fc_vport *vport, bool disabled);
98static int fcoe_vport_disable(struct fc_vport *vport, bool disable); 98static int fcoe_vport_disable(struct fc_vport *vport, bool disable);
99static void fcoe_set_vport_symbolic_name(struct fc_vport *vport);
99 100
100struct fc_function_template fcoe_transport_function = { 101struct fc_function_template fcoe_transport_function = {
101 .show_host_node_name = 1, 102 .show_host_node_name = 1,
@@ -132,6 +133,7 @@ struct fc_function_template fcoe_transport_function = {
132 .vport_create = fcoe_vport_create, 133 .vport_create = fcoe_vport_create,
133 .vport_delete = fcoe_vport_destroy, 134 .vport_delete = fcoe_vport_destroy,
134 .vport_disable = fcoe_vport_disable, 135 .vport_disable = fcoe_vport_disable,
136 .set_vport_symbolic_name = fcoe_set_vport_symbolic_name,
135}; 137};
136 138
137struct fc_function_template fcoe_vport_transport_function = { 139struct fc_function_template fcoe_vport_transport_function = {
@@ -2326,3 +2328,34 @@ static int fcoe_vport_disable(struct fc_vport *vport, bool disable)
2326 return 0; 2328 return 0;
2327} 2329}
2328 2330
2331/**
2332 * fcoe_vport_set_symbolic_name() - append vport string to symbolic name
2333 * @vport: fc_vport with a new symbolic name string
2334 *
2335 * After generating a new symbolic name string, a new RSPN_ID request is
2336 * sent to the name server. There is no response handler, so if it fails
2337 * for some reason it will not be retried.
2338 */
2339static void fcoe_set_vport_symbolic_name(struct fc_vport *vport)
2340{
2341 struct fc_lport *lport = vport->dd_data;
2342 struct fc_frame *fp;
2343 size_t len;
2344
2345 snprintf(fc_host_symbolic_name(lport->host), FC_SYMBOLIC_NAME_SIZE,
2346 "%s v%s over %s : %s", FCOE_NAME, FCOE_VERSION,
2347 fcoe_netdev(lport)->name, vport->symbolic_name);
2348
2349 if (lport->state != LPORT_ST_READY)
2350 return;
2351
2352 len = strnlen(fc_host_symbolic_name(lport->host), 255);
2353 fp = fc_frame_alloc(lport,
2354 sizeof(struct fc_ct_hdr) +
2355 sizeof(struct fc_ns_rspn) + len);
2356 if (!fp)
2357 return;
2358 lport->tt.elsct_send(lport, FC_FID_DIR_SERV, fp, FC_NS_RSPN_ID,
2359 NULL, NULL, lport->e_d_tov);
2360}
2361