Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Chris Leech and committed by
James Bottomley
dc8596d3 c914f7d1

+34
+33
drivers/scsi/fcoe/fcoe.c
··· 96 96 static int fcoe_vport_destroy(struct fc_vport *vport); 97 97 static int fcoe_vport_create(struct fc_vport *vport, bool disabled); 98 98 static int fcoe_vport_disable(struct fc_vport *vport, bool disable); 99 + static void fcoe_set_vport_symbolic_name(struct fc_vport *vport); 99 100 100 101 struct fc_function_template fcoe_transport_function = { 101 102 .show_host_node_name = 1, ··· 133 132 .vport_create = fcoe_vport_create, 134 133 .vport_delete = fcoe_vport_destroy, 135 134 .vport_disable = fcoe_vport_disable, 135 + .set_vport_symbolic_name = fcoe_set_vport_symbolic_name, 136 136 }; 137 137 138 138 struct fc_function_template fcoe_vport_transport_function = { ··· 2326 2324 } 2327 2325 2328 2326 return 0; 2327 + } 2328 + 2329 + /** 2330 + * fcoe_vport_set_symbolic_name() - append vport string to symbolic name 2331 + * @vport: fc_vport with a new symbolic name string 2332 + * 2333 + * After generating a new symbolic name string, a new RSPN_ID request is 2334 + * sent to the name server. There is no response handler, so if it fails 2335 + * for some reason it will not be retried. 2336 + */ 2337 + static void fcoe_set_vport_symbolic_name(struct fc_vport *vport) 2338 + { 2339 + struct fc_lport *lport = vport->dd_data; 2340 + struct fc_frame *fp; 2341 + size_t len; 2342 + 2343 + snprintf(fc_host_symbolic_name(lport->host), FC_SYMBOLIC_NAME_SIZE, 2344 + "%s v%s over %s : %s", FCOE_NAME, FCOE_VERSION, 2345 + fcoe_netdev(lport)->name, vport->symbolic_name); 2346 + 2347 + if (lport->state != LPORT_ST_READY) 2348 + return; 2349 + 2350 + len = strnlen(fc_host_symbolic_name(lport->host), 255); 2351 + fp = fc_frame_alloc(lport, 2352 + sizeof(struct fc_ct_hdr) + 2353 + sizeof(struct fc_ns_rspn) + len); 2354 + if (!fp) 2355 + return; 2356 + lport->tt.elsct_send(lport, FC_FID_DIR_SERV, fp, FC_NS_RSPN_ID, 2357 + NULL, NULL, lport->e_d_tov); 2329 2358 } 2330 2359
+1
drivers/scsi/libfc/fc_frame.c
··· 86 86 } 87 87 return fp; 88 88 } 89 + EXPORT_SYMBOL(fc_frame_alloc_fill);