diff options
author | Joe Eykholt <jeykholt@cisco.com> | 2010-07-20 18:20:40 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-28 10:05:57 -0400 |
commit | cd229e42eb8cdfdcbe15dfeec39c3641f62de43a (patch) | |
tree | 6f2b999043148e993406785a6c2c1aa8b21293e0 /drivers/scsi/fcoe/libfcoe.c | |
parent | 5554345bc5275afed760631277fdab0a5a19472e (diff) |
[SCSI] fcoe libfcoe: use correct FC-MAP for VN2VN mode
In VN2VN mode, map_dest means to use the default VN2VN OUI.
Change code that uses the default FCoE OUI to use the one
set in the fcoe_ctlr struct.
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/libfcoe.c')
-rw-r--r-- | drivers/scsi/fcoe/libfcoe.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c index 4865e8181172..4de8ced1fee7 100644 --- a/drivers/scsi/fcoe/libfcoe.c +++ b/drivers/scsi/fcoe/libfcoe.c | |||
@@ -153,6 +153,20 @@ static inline int fcoe_ctlr_fcf_usable(struct fcoe_fcf *fcf) | |||
153 | } | 153 | } |
154 | 154 | ||
155 | /** | 155 | /** |
156 | * fcoe_ctlr_map_dest() - Set flag and OUI for mapping destination addresses | ||
157 | * @fip: The FCoE controller | ||
158 | */ | ||
159 | static void fcoe_ctlr_map_dest(struct fcoe_ctlr *fip) | ||
160 | { | ||
161 | if (fip->mode == FIP_MODE_VN2VN) | ||
162 | hton24(fip->dest_addr, FIP_VN_FC_MAP); | ||
163 | else | ||
164 | hton24(fip->dest_addr, FIP_DEF_FC_MAP); | ||
165 | hton24(fip->dest_addr + 3, 0); | ||
166 | fip->map_dest = 1; | ||
167 | } | ||
168 | |||
169 | /** | ||
156 | * fcoe_ctlr_init() - Initialize the FCoE Controller instance | 170 | * fcoe_ctlr_init() - Initialize the FCoE Controller instance |
157 | * @fip: The FCoE controller to initialize | 171 | * @fip: The FCoE controller to initialize |
158 | */ | 172 | */ |
@@ -345,7 +359,7 @@ static void fcoe_ctlr_reset(struct fcoe_ctlr *fip) | |||
345 | fip->port_ka_time = 0; | 359 | fip->port_ka_time = 0; |
346 | fip->sol_time = 0; | 360 | fip->sol_time = 0; |
347 | fip->flogi_oxid = FC_XID_UNKNOWN; | 361 | fip->flogi_oxid = FC_XID_UNKNOWN; |
348 | fip->map_dest = 0; | 362 | fcoe_ctlr_map_dest(fip); |
349 | } | 363 | } |
350 | 364 | ||
351 | /** | 365 | /** |
@@ -573,11 +587,11 @@ int fcoe_ctlr_els_send(struct fcoe_ctlr *fip, struct fc_lport *lport, | |||
573 | fip->flogi_count++; | 587 | fip->flogi_count++; |
574 | if (fip->flogi_count < 3) | 588 | if (fip->flogi_count < 3) |
575 | goto drop; | 589 | goto drop; |
576 | fip->map_dest = 1; | 590 | fcoe_ctlr_map_dest(fip); |
577 | return 0; | 591 | return 0; |
578 | } | 592 | } |
579 | if (fip->state == FIP_ST_NON_FIP) | 593 | if (fip->state == FIP_ST_NON_FIP) |
580 | fip->map_dest = 1; | 594 | fcoe_ctlr_map_dest(fip); |
581 | } | 595 | } |
582 | 596 | ||
583 | if (fip->state == FIP_ST_NON_FIP) | 597 | if (fip->state == FIP_ST_NON_FIP) |
@@ -1411,6 +1425,7 @@ static void fcoe_ctlr_timer_work(struct work_struct *work) | |||
1411 | "Fibre-Channel Forwarder MAC %pM\n", | 1425 | "Fibre-Channel Forwarder MAC %pM\n", |
1412 | fip->lp->host->host_no, sel->fcf_mac); | 1426 | fip->lp->host->host_no, sel->fcf_mac); |
1413 | memcpy(fip->dest_addr, sel->fcf_mac, ETH_ALEN); | 1427 | memcpy(fip->dest_addr, sel->fcf_mac, ETH_ALEN); |
1428 | fip->map_dest = 0; | ||
1414 | fip->port_ka_time = jiffies + | 1429 | fip->port_ka_time = jiffies + |
1415 | msecs_to_jiffies(FIP_VN_KA_PERIOD); | 1430 | msecs_to_jiffies(FIP_VN_KA_PERIOD); |
1416 | fip->ctlr_ka_time = jiffies + sel->fka_period; | 1431 | fip->ctlr_ka_time = jiffies + sel->fka_period; |
@@ -1527,7 +1542,7 @@ int fcoe_ctlr_recv_flogi(struct fcoe_ctlr *fip, struct fc_lport *lport, | |||
1527 | * Otherwise we use the FCoE gateway addr | 1542 | * Otherwise we use the FCoE gateway addr |
1528 | */ | 1543 | */ |
1529 | if (!compare_ether_addr(sa, (u8[6])FC_FCOE_FLOGI_MAC)) { | 1544 | if (!compare_ether_addr(sa, (u8[6])FC_FCOE_FLOGI_MAC)) { |
1530 | fip->map_dest = 1; | 1545 | fcoe_ctlr_map_dest(fip); |
1531 | } else { | 1546 | } else { |
1532 | memcpy(fip->dest_addr, sa, ETH_ALEN); | 1547 | memcpy(fip->dest_addr, sa, ETH_ALEN); |
1533 | fip->map_dest = 0; | 1548 | fip->map_dest = 0; |
@@ -2426,6 +2441,7 @@ static void fcoe_ctlr_vn_timeout(struct fcoe_ctlr *fip) | |||
2426 | new_port_id = fip->port_id; | 2441 | new_port_id = fip->port_id; |
2427 | hton24(mac, FIP_VN_FC_MAP); | 2442 | hton24(mac, FIP_VN_FC_MAP); |
2428 | hton24(mac + 3, new_port_id); | 2443 | hton24(mac + 3, new_port_id); |
2444 | fcoe_ctlr_map_dest(fip); | ||
2429 | fip->update_mac(fip->lp, mac); | 2445 | fip->update_mac(fip->lp, mac); |
2430 | fcoe_ctlr_vn_send_claim(fip); | 2446 | fcoe_ctlr_vn_send_claim(fip); |
2431 | next_time = jiffies + msecs_to_jiffies(FIP_VN_ANN_WAIT); | 2447 | next_time = jiffies + msecs_to_jiffies(FIP_VN_ANN_WAIT); |