aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fcoe
diff options
context:
space:
mode:
authorJoe Eykholt <jeykholt@cisco.com>2010-03-12 19:08:02 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-04-11 10:23:36 -0400
commit7d65b0df6c5951271cd368170bca8601aa2e65c7 (patch)
tree722511a465f5a71f6ee74d9bf02c4b709d88fa85 /drivers/scsi/fcoe
parente49bf6145f50da2d95f9fab605ce74f8fb44cb16 (diff)
[SCSI] fcoe: save gateway address when receiving FLOGI request
In point-to-point mode, we need to save the source MAC from received FLOGI requests to use as the destination MAC for all outgoing frames. We stopped doing that at some point. Use the lport_set_port_id method to catch incoming FLOGI frames and pass them to fcoe_ctlr_recv_flogi() so it can save the source MAC. Signed-off-by: Joe Eykholt <jeykholt@cisco.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.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 7b0bb6e39a9f..17bf3ca82aff 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -146,6 +146,7 @@ static int fcoe_vport_destroy(struct fc_vport *);
146static int fcoe_vport_create(struct fc_vport *, bool disabled); 146static int fcoe_vport_create(struct fc_vport *, bool disabled);
147static int fcoe_vport_disable(struct fc_vport *, bool disable); 147static int fcoe_vport_disable(struct fc_vport *, bool disable);
148static void fcoe_set_vport_symbolic_name(struct fc_vport *); 148static void fcoe_set_vport_symbolic_name(struct fc_vport *);
149static void fcoe_set_port_id(struct fc_lport *, u32, struct fc_frame *);
149 150
150static struct libfc_function_template fcoe_libfc_fcn_templ = { 151static struct libfc_function_template fcoe_libfc_fcn_templ = {
151 .frame_send = fcoe_xmit, 152 .frame_send = fcoe_xmit,
@@ -153,6 +154,7 @@ static struct libfc_function_template fcoe_libfc_fcn_templ = {
153 .ddp_done = fcoe_ddp_done, 154 .ddp_done = fcoe_ddp_done,
154 .elsct_send = fcoe_elsct_send, 155 .elsct_send = fcoe_elsct_send,
155 .get_lesb = fcoe_get_lesb, 156 .get_lesb = fcoe_get_lesb,
157 .lport_set_port_id = fcoe_set_port_id,
156}; 158};
157 159
158struct fc_function_template fcoe_transport_function = { 160struct fc_function_template fcoe_transport_function = {
@@ -2631,3 +2633,25 @@ static void fcoe_get_lesb(struct fc_lport *lport,
2631 lesb->lesb_miss_fka = htonl(mdac); 2633 lesb->lesb_miss_fka = htonl(mdac);
2632 lesb->lesb_fcs_error = htonl(dev_get_stats(netdev)->rx_crc_errors); 2634 lesb->lesb_fcs_error = htonl(dev_get_stats(netdev)->rx_crc_errors);
2633} 2635}
2636
2637/**
2638 * fcoe_set_port_id() - Callback from libfc when Port_ID is set.
2639 * @lport: the local port
2640 * @port_id: the port ID
2641 * @fp: the received frame, if any, that caused the port_id to be set.
2642 *
2643 * This routine handles the case where we received a FLOGI and are
2644 * entering point-to-point mode. We need to call fcoe_ctlr_recv_flogi()
2645 * so it can set the non-mapped mode and gateway address.
2646 *
2647 * The FLOGI LS_ACC is handled by fcoe_flogi_resp().
2648 */
2649static void fcoe_set_port_id(struct fc_lport *lport,
2650 u32 port_id, struct fc_frame *fp)
2651{
2652 struct fcoe_port *port = lport_priv(lport);
2653 struct fcoe_interface *fcoe = port->fcoe;
2654
2655 if (fp && fc_frame_payload_op(fp) == ELS_FLOGI)
2656 fcoe_ctlr_recv_flogi(&fcoe->ctlr, lport, fp);
2657}