Skip to content

Commit dc8596d

Browse files
Chris LeechJames Bottomley
authored andcommitted
[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>
1 parent c914f7d commit dc8596d

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

‎drivers/scsi/fcoe/fcoe.c‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ static struct scsi_transport_template *fcoe_vport_transport_template;
9696
static int fcoe_vport_destroy(struct fc_vport *vport);
9797
static int fcoe_vport_create(struct fc_vport *vport, bool disabled);
9898
static int fcoe_vport_disable(struct fc_vport *vport, bool disable);
99+
static void fcoe_set_vport_symbolic_name(struct fc_vport *vport);
99100

100101
struct fc_function_template fcoe_transport_function = {
101102
.show_host_node_name = 1,
@@ -132,6 +133,7 @@ struct fc_function_template fcoe_transport_function = {
132133
.vport_create = fcoe_vport_create,
133134
.vport_delete = fcoe_vport_destroy,
134135
.vport_disable = fcoe_vport_disable,
136+
.set_vport_symbolic_name = fcoe_set_vport_symbolic_name,
135137
};
136138

137139
struct fc_function_template fcoe_vport_transport_function = {
@@ -2326,3 +2328,34 @@ static int fcoe_vport_disable(struct fc_vport *vport, bool disable)
23262328
return 0;
23272329
}
23282330

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+
*/
2339+
static 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+

‎drivers/scsi/libfc/fc_frame.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,4 @@ struct fc_frame *fc_frame_alloc_fill(struct fc_lport *lp, size_t payload_len)
8686
}
8787
return fp;
8888
}
89+
EXPORT_SYMBOL(fc_frame_alloc_fill);

0 commit comments

Comments
 (0)