Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 36a2796

Browse files
James BottomleyJames Bottomley
authored andcommitted
Merge tag 'fcoe' into fixes
3.10 fixes
2 parents 222ab59 + f4aaea6 commit 36a2796

File tree

4 files changed

+31
-25
lines changed

4 files changed

+31
-25
lines changed

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3220,7 +3220,7 @@ F: lib/fault-inject.c
32203220

32213221
FCOE SUBSYSTEM (libfc, libfcoe, fcoe)
32223222
M: Robert Love <[email protected]>
3223-
3223+
32243224
W: www.Open-FCoE.org
32253225
S: Supported
32263226
F: drivers/scsi/libfc/

drivers/scsi/fcoe/fcoe_ctlr.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,9 +1548,6 @@ static struct fcoe_fcf *fcoe_ctlr_select(struct fcoe_ctlr *fip)
15481548
{
15491549
struct fcoe_fcf *fcf;
15501550
struct fcoe_fcf *best = fip->sel_fcf;
1551-
struct fcoe_fcf *first;
1552-
1553-
first = list_first_entry(&fip->fcfs, struct fcoe_fcf, list);
15541551

15551552
list_for_each_entry(fcf, &fip->fcfs, list) {
15561553
LIBFCOE_FIP_DBG(fip, "consider FCF fab %16.16llx "
@@ -1568,17 +1565,15 @@ static struct fcoe_fcf *fcoe_ctlr_select(struct fcoe_ctlr *fip)
15681565
"" : "un");
15691566
continue;
15701567
}
1571-
if (fcf->fabric_name != first->fabric_name ||
1572-
fcf->vfid != first->vfid ||
1573-
fcf->fc_map != first->fc_map) {
1568+
if (!best || fcf->pri < best->pri || best->flogi_sent)
1569+
best = fcf;
1570+
if (fcf->fabric_name != best->fabric_name ||
1571+
fcf->vfid != best->vfid ||
1572+
fcf->fc_map != best->fc_map) {
15741573
LIBFCOE_FIP_DBG(fip, "Conflicting fabric, VFID, "
15751574
"or FC-MAP\n");
15761575
return NULL;
15771576
}
1578-
if (fcf->flogi_sent)
1579-
continue;
1580-
if (!best || fcf->pri < best->pri || best->flogi_sent)
1581-
best = fcf;
15821577
}
15831578
fip->sel_fcf = best;
15841579
if (best) {

drivers/scsi/libfc/fc_exch.c

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -463,13 +463,7 @@ static void fc_exch_delete(struct fc_exch *ep)
463463
fc_exch_release(ep); /* drop hold for exch in mp */
464464
}
465465

466-
/**
467-
* fc_seq_send() - Send a frame using existing sequence/exchange pair
468-
* @lport: The local port that the exchange will be sent on
469-
* @sp: The sequence to be sent
470-
* @fp: The frame to be sent on the exchange
471-
*/
472-
static int fc_seq_send(struct fc_lport *lport, struct fc_seq *sp,
466+
static int fc_seq_send_locked(struct fc_lport *lport, struct fc_seq *sp,
473467
struct fc_frame *fp)
474468
{
475469
struct fc_exch *ep;
@@ -479,7 +473,7 @@ static int fc_seq_send(struct fc_lport *lport, struct fc_seq *sp,
479473
u8 fh_type = fh->fh_type;
480474

481475
ep = fc_seq_exch(sp);
482-
WARN_ON((ep->esb_stat & ESB_ST_SEQ_INIT) != ESB_ST_SEQ_INIT);
476+
WARN_ON(!(ep->esb_stat & ESB_ST_SEQ_INIT));
483477

484478
f_ctl = ntoh24(fh->fh_f_ctl);
485479
fc_exch_setup_hdr(ep, fp, f_ctl);
@@ -502,17 +496,34 @@ static int fc_seq_send(struct fc_lport *lport, struct fc_seq *sp,
502496
error = lport->tt.frame_send(lport, fp);
503497

504498
if (fh_type == FC_TYPE_BLS)
505-
return error;
499+
goto out;
506500

507501
/*
508502
* Update the exchange and sequence flags,
509503
* assuming all frames for the sequence have been sent.
510504
* We can only be called to send once for each sequence.
511505
*/
512-
spin_lock_bh(&ep->ex_lock);
513506
ep->f_ctl = f_ctl & ~FC_FC_FIRST_SEQ; /* not first seq */
514507
if (f_ctl & FC_FC_SEQ_INIT)
515508
ep->esb_stat &= ~ESB_ST_SEQ_INIT;
509+
out:
510+
return error;
511+
}
512+
513+
/**
514+
* fc_seq_send() - Send a frame using existing sequence/exchange pair
515+
* @lport: The local port that the exchange will be sent on
516+
* @sp: The sequence to be sent
517+
* @fp: The frame to be sent on the exchange
518+
*/
519+
static int fc_seq_send(struct fc_lport *lport, struct fc_seq *sp,
520+
struct fc_frame *fp)
521+
{
522+
struct fc_exch *ep;
523+
int error;
524+
ep = fc_seq_exch(sp);
525+
spin_lock_bh(&ep->ex_lock);
526+
error = fc_seq_send_locked(lport, sp, fp);
516527
spin_unlock_bh(&ep->ex_lock);
517528
return error;
518529
}
@@ -629,7 +640,7 @@ static int fc_exch_abort_locked(struct fc_exch *ep,
629640
if (fp) {
630641
fc_fill_fc_hdr(fp, FC_RCTL_BA_ABTS, ep->did, ep->sid,
631642
FC_TYPE_BLS, FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0);
632-
error = fc_seq_send(ep->lp, sp, fp);
643+
error = fc_seq_send_locked(ep->lp, sp, fp);
633644
} else
634645
error = -ENOBUFS;
635646
return error;
@@ -1132,7 +1143,7 @@ static void fc_seq_send_last(struct fc_seq *sp, struct fc_frame *fp,
11321143
f_ctl = FC_FC_LAST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT;
11331144
f_ctl |= ep->f_ctl;
11341145
fc_fill_fc_hdr(fp, rctl, ep->did, ep->sid, fh_type, f_ctl, 0);
1135-
fc_seq_send(ep->lp, sp, fp);
1146+
fc_seq_send_locked(ep->lp, sp, fp);
11361147
}
11371148

11381149
/**
@@ -1307,8 +1318,8 @@ static void fc_exch_recv_abts(struct fc_exch *ep, struct fc_frame *rx_fp)
13071318
ap->ba_low_seq_cnt = htons(sp->cnt);
13081319
}
13091320
sp = fc_seq_start_next_locked(sp);
1310-
spin_unlock_bh(&ep->ex_lock);
13111321
fc_seq_send_last(sp, fp, FC_RCTL_BA_ACC, FC_TYPE_BLS);
1322+
spin_unlock_bh(&ep->ex_lock);
13121323
fc_frame_free(rx_fp);
13131324
return;
13141325

drivers/scsi/libfc/fc_rport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1962,7 +1962,7 @@ static int fc_rport_fcp_prli(struct fc_rport_priv *rdata, u32 spp_len,
19621962
rdata->flags |= FC_RP_FLAGS_RETRY;
19631963
rdata->supported_classes = FC_COS_CLASS3;
19641964

1965-
if (!(lport->service_params & FC_RPORT_ROLE_FCP_INITIATOR))
1965+
if (!(lport->service_params & FCP_SPPF_INIT_FCN))
19661966
return 0;
19671967

19681968
spp->spp_flags |= rspp->spp_flags & FC_SPP_EST_IMG_PAIR;

0 commit comments

Comments
 (0)