Skip to content

Commit e780c94

Browse files
Justin Teemartinkpetersen
authored andcommitted
scsi: lpfc: Change lpfc_hba hba_flag member into a bitmask
In attempt to reduce the amount of unnecessary phba->hbalock acquisitions in the lpfc driver, change hba_flag into an unsigned long bitmask and use clear_bit/test_bit bitwise atomic APIs instead of reliance on phba->hbalock for synchronization. Signed-off-by: Justin Tee <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 5f800d7 commit e780c94

File tree

12 files changed

+279
-331
lines changed

12 files changed

+279
-331
lines changed

drivers/scsi/lpfc/lpfc.h

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,37 @@ enum hba_state {
393393
LPFC_HBA_ERROR = -1
394394
};
395395

396+
enum lpfc_hba_flag { /* hba generic flags */
397+
HBA_ERATT_HANDLED = 0, /* This flag is set when eratt handled */
398+
DEFER_ERATT = 1, /* Deferred error attn in progress */
399+
HBA_FCOE_MODE = 2, /* HBA function in FCoE Mode */
400+
HBA_SP_QUEUE_EVT = 3, /* Slow-path qevt posted to worker thread*/
401+
HBA_POST_RECEIVE_BUFFER = 4, /* Rcv buffers need to be posted */
402+
HBA_PERSISTENT_TOPO = 5, /* Persistent topology support in hba */
403+
ELS_XRI_ABORT_EVENT = 6, /* ELS_XRI abort event was queued */
404+
ASYNC_EVENT = 7,
405+
LINK_DISABLED = 8, /* Link disabled by user */
406+
FCF_TS_INPROG = 9, /* FCF table scan in progress */
407+
FCF_RR_INPROG = 10, /* FCF roundrobin flogi in progress */
408+
HBA_FIP_SUPPORT = 11, /* FIP support in HBA */
409+
HBA_DEVLOSS_TMO = 13, /* HBA in devloss timeout */
410+
HBA_RRQ_ACTIVE = 14, /* process the rrq active list */
411+
HBA_IOQ_FLUSH = 15, /* I/O queues being flushed */
412+
HBA_RECOVERABLE_UE = 17, /* FW supports recoverable UE */
413+
HBA_FORCED_LINK_SPEED = 18, /*
414+
* Firmware supports Forced Link
415+
* Speed capability
416+
*/
417+
HBA_FLOGI_ISSUED = 20, /* FLOGI was issued */
418+
HBA_DEFER_FLOGI = 23, /* Defer FLOGI till read_sparm cmpl */
419+
HBA_SETUP = 24, /* HBA setup completed */
420+
HBA_NEEDS_CFG_PORT = 25, /* SLI3: CONFIG_PORT mbox needed */
421+
HBA_HBEAT_INP = 26, /* mbox HBEAT is in progress */
422+
HBA_HBEAT_TMO = 27, /* HBEAT initiated after timeout */
423+
HBA_FLOGI_OUTSTANDING = 28, /* FLOGI is outstanding */
424+
HBA_RHBA_CMPL = 29, /* RHBA FDMI cmd is successful */
425+
};
426+
396427
struct lpfc_trunk_link_state {
397428
enum hba_state state;
398429
uint8_t fault;
@@ -1007,35 +1038,7 @@ struct lpfc_hba {
10071038
#define LS_CT_VEN_RPA 0x20 /* Vendor RPA sent to switch */
10081039
#define LS_EXTERNAL_LOOPBACK 0x40 /* External loopback plug inserted */
10091040

1010-
uint32_t hba_flag; /* hba generic flags */
1011-
#define HBA_ERATT_HANDLED 0x1 /* This flag is set when eratt handled */
1012-
#define DEFER_ERATT 0x2 /* Deferred error attention in progress */
1013-
#define HBA_FCOE_MODE 0x4 /* HBA function in FCoE Mode */
1014-
#define HBA_SP_QUEUE_EVT 0x8 /* Slow-path qevt posted to worker thread*/
1015-
#define HBA_POST_RECEIVE_BUFFER 0x10 /* Rcv buffers need to be posted */
1016-
#define HBA_PERSISTENT_TOPO 0x20 /* Persistent topology support in hba */
1017-
#define ELS_XRI_ABORT_EVENT 0x40 /* ELS_XRI abort event was queued */
1018-
#define ASYNC_EVENT 0x80
1019-
#define LINK_DISABLED 0x100 /* Link disabled by user */
1020-
#define FCF_TS_INPROG 0x200 /* FCF table scan in progress */
1021-
#define FCF_RR_INPROG 0x400 /* FCF roundrobin flogi in progress */
1022-
#define HBA_FIP_SUPPORT 0x800 /* FIP support in HBA */
1023-
#define HBA_DEVLOSS_TMO 0x2000 /* HBA in devloss timeout */
1024-
#define HBA_RRQ_ACTIVE 0x4000 /* process the rrq active list */
1025-
#define HBA_IOQ_FLUSH 0x8000 /* FCP/NVME I/O queues being flushed */
1026-
#define HBA_RECOVERABLE_UE 0x20000 /* Firmware supports recoverable UE */
1027-
#define HBA_FORCED_LINK_SPEED 0x40000 /*
1028-
* Firmware supports Forced Link Speed
1029-
* capability
1030-
*/
1031-
#define HBA_FLOGI_ISSUED 0x100000 /* FLOGI was issued */
1032-
#define HBA_DEFER_FLOGI 0x800000 /* Defer FLOGI till read_sparm cmpl */
1033-
#define HBA_SETUP 0x1000000 /* Signifies HBA setup is completed */
1034-
#define HBA_NEEDS_CFG_PORT 0x2000000 /* SLI3 - needs a CONFIG_PORT mbox */
1035-
#define HBA_HBEAT_INP 0x4000000 /* mbox HBEAT is in progress */
1036-
#define HBA_HBEAT_TMO 0x8000000 /* HBEAT initiated after timeout */
1037-
#define HBA_FLOGI_OUTSTANDING 0x10000000 /* FLOGI is outstanding */
1038-
#define HBA_RHBA_CMPL 0x20000000 /* RHBA FDMI command is successful */
1041+
unsigned long hba_flag; /* hba generic flags */
10391042

10401043
struct completion *fw_dump_cmpl; /* cmpl event tracker for fw_dump */
10411044
uint32_t fcp_ring_in_use; /* When polling test if intr-hndlr active*/

drivers/scsi/lpfc/lpfc_attr.c

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ lpfc_enable_fip_show(struct device *dev, struct device_attribute *attr,
322322
struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
323323
struct lpfc_hba *phba = vport->phba;
324324

325-
if (phba->hba_flag & HBA_FIP_SUPPORT)
325+
if (test_bit(HBA_FIP_SUPPORT, &phba->hba_flag))
326326
return scnprintf(buf, PAGE_SIZE, "1\n");
327327
else
328328
return scnprintf(buf, PAGE_SIZE, "0\n");
@@ -1049,7 +1049,7 @@ lpfc_link_state_show(struct device *dev, struct device_attribute *attr,
10491049
case LPFC_INIT_MBX_CMDS:
10501050
case LPFC_LINK_DOWN:
10511051
case LPFC_HBA_ERROR:
1052-
if (phba->hba_flag & LINK_DISABLED)
1052+
if (test_bit(LINK_DISABLED, &phba->hba_flag))
10531053
len += scnprintf(buf + len, PAGE_SIZE-len,
10541054
"Link Down - User disabled\n");
10551055
else
@@ -1292,7 +1292,7 @@ lpfc_issue_lip(struct Scsi_Host *shost)
12921292
* it doesn't make any sense to allow issue_lip
12931293
*/
12941294
if (test_bit(FC_OFFLINE_MODE, &vport->fc_flag) ||
1295-
(phba->hba_flag & LINK_DISABLED) ||
1295+
test_bit(LINK_DISABLED, &phba->hba_flag) ||
12961296
(phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO))
12971297
return -EPERM;
12981298

@@ -3635,7 +3635,8 @@ lpfc_pt_show(struct device *dev, struct device_attribute *attr, char *buf)
36353635
struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba;
36363636

36373637
return scnprintf(buf, PAGE_SIZE, "%d\n",
3638-
(phba->hba_flag & HBA_PERSISTENT_TOPO) ? 1 : 0);
3638+
test_bit(HBA_PERSISTENT_TOPO,
3639+
&phba->hba_flag) ? 1 : 0);
36393640
}
36403641
static DEVICE_ATTR(pt, 0444,
36413642
lpfc_pt_show, NULL);
@@ -4205,8 +4206,8 @@ lpfc_topology_store(struct device *dev, struct device_attribute *attr,
42054206
&phba->sli4_hba.sli_intf);
42064207
if_type = bf_get(lpfc_sli_intf_if_type,
42074208
&phba->sli4_hba.sli_intf);
4208-
if ((phba->hba_flag & HBA_PERSISTENT_TOPO ||
4209-
(!phba->sli4_hba.pc_sli4_params.pls &&
4209+
if ((test_bit(HBA_PERSISTENT_TOPO, &phba->hba_flag) ||
4210+
(!phba->sli4_hba.pc_sli4_params.pls &&
42104211
(sli_family == LPFC_SLI_INTF_FAMILY_G6 ||
42114212
if_type == LPFC_SLI_INTF_IF_TYPE_6))) &&
42124213
val == 4) {
@@ -4309,7 +4310,7 @@ lpfc_link_speed_store(struct device *dev, struct device_attribute *attr,
43094310

43104311
if_type = bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf);
43114312
if (if_type >= LPFC_SLI_INTF_IF_TYPE_2 &&
4312-
phba->hba_flag & HBA_FORCED_LINK_SPEED)
4313+
test_bit(HBA_FORCED_LINK_SPEED, &phba->hba_flag))
43134314
return -EPERM;
43144315

43154316
if (!strncmp(buf, "nolip ", strlen("nolip "))) {
@@ -6497,7 +6498,8 @@ lpfc_get_host_speed(struct Scsi_Host *shost)
64976498
struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
64986499
struct lpfc_hba *phba = vport->phba;
64996500

6500-
if ((lpfc_is_link_up(phba)) && (!(phba->hba_flag & HBA_FCOE_MODE))) {
6501+
if ((lpfc_is_link_up(phba)) &&
6502+
!test_bit(HBA_FCOE_MODE, &phba->hba_flag)) {
65016503
switch(phba->fc_linkspeed) {
65026504
case LPFC_LINK_SPEED_1GHZ:
65036505
fc_host_speed(shost) = FC_PORTSPEED_1GBIT;
@@ -6533,7 +6535,8 @@ lpfc_get_host_speed(struct Scsi_Host *shost)
65336535
fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN;
65346536
break;
65356537
}
6536-
} else if (lpfc_is_link_up(phba) && (phba->hba_flag & HBA_FCOE_MODE)) {
6538+
} else if (lpfc_is_link_up(phba) &&
6539+
test_bit(HBA_FCOE_MODE, &phba->hba_flag)) {
65376540
switch (phba->fc_linkspeed) {
65386541
case LPFC_ASYNC_LINK_SPEED_1GBPS:
65396542
fc_host_speed(shost) = FC_PORTSPEED_1GBIT;
@@ -6718,7 +6721,7 @@ lpfc_get_stats(struct Scsi_Host *shost)
67186721
hs->invalid_crc_count -= lso->invalid_crc_count;
67196722
hs->error_frames -= lso->error_frames;
67206723

6721-
if (phba->hba_flag & HBA_FCOE_MODE) {
6724+
if (test_bit(HBA_FCOE_MODE, &phba->hba_flag)) {
67226725
hs->lip_count = -1;
67236726
hs->nos_count = (phba->link_events >> 1);
67246727
hs->nos_count -= lso->link_events;
@@ -6816,7 +6819,7 @@ lpfc_reset_stats(struct Scsi_Host *shost)
68166819
lso->invalid_tx_word_count = pmb->un.varRdLnk.invalidXmitWord;
68176820
lso->invalid_crc_count = pmb->un.varRdLnk.crcCnt;
68186821
lso->error_frames = pmb->un.varRdLnk.crcCnt;
6819-
if (phba->hba_flag & HBA_FCOE_MODE)
6822+
if (test_bit(HBA_FCOE_MODE, &phba->hba_flag))
68206823
lso->link_events = (phba->link_events >> 1);
68216824
else
68226825
lso->link_events = (phba->fc_eventTag >> 1);
@@ -7161,11 +7164,11 @@ lpfc_get_hba_function_mode(struct lpfc_hba *phba)
71617164
case PCI_DEVICE_ID_ZEPHYR_DCSP:
71627165
case PCI_DEVICE_ID_TIGERSHARK:
71637166
case PCI_DEVICE_ID_TOMCAT:
7164-
phba->hba_flag |= HBA_FCOE_MODE;
7167+
set_bit(HBA_FCOE_MODE, &phba->hba_flag);
71657168
break;
71667169
default:
71677170
/* for others, clear the flag */
7168-
phba->hba_flag &= ~HBA_FCOE_MODE;
7171+
clear_bit(HBA_FCOE_MODE, &phba->hba_flag);
71697172
}
71707173
}
71717174

@@ -7236,7 +7239,7 @@ lpfc_get_cfgparam(struct lpfc_hba *phba)
72367239
lpfc_get_hba_function_mode(phba);
72377240

72387241
/* BlockGuard allowed for FC only. */
7239-
if (phba->cfg_enable_bg && phba->hba_flag & HBA_FCOE_MODE) {
7242+
if (phba->cfg_enable_bg && test_bit(HBA_FCOE_MODE, &phba->hba_flag)) {
72407243
lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
72417244
"0581 BlockGuard feature not supported\n");
72427245
/* If set, clear the BlockGuard support param */

drivers/scsi/lpfc/lpfc_bsg.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5002,7 +5002,8 @@ lpfc_forced_link_speed(struct bsg_job *job)
50025002
goto job_error;
50035003
}
50045004

5005-
forced_reply->supported = (phba->hba_flag & HBA_FORCED_LINK_SPEED)
5005+
forced_reply->supported = test_bit(HBA_FORCED_LINK_SPEED,
5006+
&phba->hba_flag)
50065007
? LPFC_FORCED_LINK_SPEED_SUPPORTED
50075008
: LPFC_FORCED_LINK_SPEED_NOT_SUPPORTED;
50085009
job_error:

drivers/scsi/lpfc/lpfc_ct.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2173,7 +2173,7 @@ lpfc_fdmi_rprt_defer(struct lpfc_hba *phba, uint32_t mask)
21732173
struct lpfc_nodelist *ndlp;
21742174
int i;
21752175

2176-
phba->hba_flag |= HBA_RHBA_CMPL;
2176+
set_bit(HBA_RHBA_CMPL, &phba->hba_flag);
21772177
vports = lpfc_create_vport_work_array(phba);
21782178
if (vports) {
21792179
for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) {
@@ -2368,7 +2368,7 @@ lpfc_cmpl_ct_disc_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
23682368
* for the physical port completes successfully.
23692369
* We may have to defer the RPRT accordingly.
23702370
*/
2371-
if (phba->hba_flag & HBA_RHBA_CMPL) {
2371+
if (test_bit(HBA_RHBA_CMPL, &phba->hba_flag)) {
23722372
lpfc_fdmi_cmd(vport, ndlp, SLI_MGMT_RPRT, 0);
23732373
} else {
23742374
lpfc_printf_vlog(vport, KERN_INFO,
@@ -2785,7 +2785,7 @@ lpfc_fdmi_port_attr_support_speed(struct lpfc_vport *vport, void *attr)
27852785
u32 tcfg;
27862786
u8 i, cnt;
27872787

2788-
if (!(phba->hba_flag & HBA_FCOE_MODE)) {
2788+
if (!test_bit(HBA_FCOE_MODE, &phba->hba_flag)) {
27892789
cnt = 0;
27902790
if (phba->sli_rev == LPFC_SLI_REV4) {
27912791
tcfg = phba->sli4_hba.conf_trunk;
@@ -2859,7 +2859,7 @@ lpfc_fdmi_port_attr_speed(struct lpfc_vport *vport, void *attr)
28592859
struct lpfc_hba *phba = vport->phba;
28602860
u32 speeds = 0;
28612861

2862-
if (!(phba->hba_flag & HBA_FCOE_MODE)) {
2862+
if (!test_bit(HBA_FCOE_MODE, &phba->hba_flag)) {
28632863
switch (phba->fc_linkspeed) {
28642864
case LPFC_LINK_SPEED_1GHZ:
28652865
speeds = HBA_PORTSPEED_1GFC;

drivers/scsi/lpfc/lpfc_els.c

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,11 @@ lpfc_prep_els_iocb(struct lpfc_vport *vport, u8 expect_rsp,
189189
* If this command is for fabric controller and HBA running
190190
* in FIP mode send FLOGI, FDISC and LOGO as FIP frames.
191191
*/
192-
if ((did == Fabric_DID) &&
193-
(phba->hba_flag & HBA_FIP_SUPPORT) &&
194-
((elscmd == ELS_CMD_FLOGI) ||
195-
(elscmd == ELS_CMD_FDISC) ||
196-
(elscmd == ELS_CMD_LOGO)))
192+
if (did == Fabric_DID &&
193+
test_bit(HBA_FIP_SUPPORT, &phba->hba_flag) &&
194+
(elscmd == ELS_CMD_FLOGI ||
195+
elscmd == ELS_CMD_FDISC ||
196+
elscmd == ELS_CMD_LOGO))
197197
switch (elscmd) {
198198
case ELS_CMD_FLOGI:
199199
elsiocb->cmd_flag |=
@@ -965,7 +965,7 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
965965
* In case of FIP mode, perform roundrobin FCF failover
966966
* due to new FCF discovery
967967
*/
968-
if ((phba->hba_flag & HBA_FIP_SUPPORT) &&
968+
if (test_bit(HBA_FIP_SUPPORT, &phba->hba_flag) &&
969969
(phba->fcf.fcf_flag & FCF_DISCOVERY)) {
970970
if (phba->link_state < LPFC_LINK_UP)
971971
goto stop_rr_fcf_flogi;
@@ -999,7 +999,7 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
999999
IOERR_LOOP_OPEN_FAILURE)))
10001000
lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
10011001
"2858 FLOGI failure Status:x%x/x%x TMO"
1002-
":x%x Data x%x x%x\n",
1002+
":x%x Data x%lx x%x\n",
10031003
ulp_status, ulp_word4, tmo,
10041004
phba->hba_flag, phba->fcf.fcf_flag);
10051005

@@ -1119,7 +1119,7 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
11191119
if (sp->cmn.fPort)
11201120
rc = lpfc_cmpl_els_flogi_fabric(vport, ndlp, sp,
11211121
ulp_word4);
1122-
else if (!(phba->hba_flag & HBA_FCOE_MODE))
1122+
else if (!test_bit(HBA_FCOE_MODE, &phba->hba_flag))
11231123
rc = lpfc_cmpl_els_flogi_nport(vport, ndlp, sp);
11241124
else {
11251125
lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
@@ -1149,23 +1149,25 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
11491149
lpfc_nlp_put(ndlp);
11501150
spin_lock_irq(&phba->hbalock);
11511151
phba->fcf.fcf_flag &= ~FCF_DISCOVERY;
1152-
phba->hba_flag &= ~(FCF_RR_INPROG | HBA_DEVLOSS_TMO);
11531152
spin_unlock_irq(&phba->hbalock);
1153+
clear_bit(FCF_RR_INPROG, &phba->hba_flag);
1154+
clear_bit(HBA_DEVLOSS_TMO, &phba->hba_flag);
11541155
phba->fcf.fcf_redisc_attempted = 0; /* reset */
11551156
goto out;
11561157
}
11571158
if (!rc) {
11581159
/* Mark the FCF discovery process done */
1159-
if (phba->hba_flag & HBA_FIP_SUPPORT)
1160+
if (test_bit(HBA_FIP_SUPPORT, &phba->hba_flag))
11601161
lpfc_printf_vlog(vport, KERN_INFO, LOG_FIP |
11611162
LOG_ELS,
11621163
"2769 FLOGI to FCF (x%x) "
11631164
"completed successfully\n",
11641165
phba->fcf.current_rec.fcf_indx);
11651166
spin_lock_irq(&phba->hbalock);
11661167
phba->fcf.fcf_flag &= ~FCF_DISCOVERY;
1167-
phba->hba_flag &= ~(FCF_RR_INPROG | HBA_DEVLOSS_TMO);
11681168
spin_unlock_irq(&phba->hbalock);
1169+
clear_bit(FCF_RR_INPROG, &phba->hba_flag);
1170+
clear_bit(HBA_DEVLOSS_TMO, &phba->hba_flag);
11691171
phba->fcf.fcf_redisc_attempted = 0; /* reset */
11701172
goto out;
11711173
}
@@ -1202,7 +1204,7 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
12021204
}
12031205
out:
12041206
if (!flogi_in_retry)
1205-
phba->hba_flag &= ~HBA_FLOGI_OUTSTANDING;
1207+
clear_bit(HBA_FLOGI_OUTSTANDING, &phba->hba_flag);
12061208

12071209
lpfc_els_free_iocb(phba, cmdiocb);
12081210
lpfc_nlp_put(ndlp);
@@ -1372,11 +1374,13 @@ lpfc_issue_els_flogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
13721374
}
13731375

13741376
/* Avoid race with FLOGI completion and hba_flags. */
1375-
phba->hba_flag |= (HBA_FLOGI_ISSUED | HBA_FLOGI_OUTSTANDING);
1377+
set_bit(HBA_FLOGI_ISSUED, &phba->hba_flag);
1378+
set_bit(HBA_FLOGI_OUTSTANDING, &phba->hba_flag);
13761379

13771380
rc = lpfc_issue_fabric_iocb(phba, elsiocb);
13781381
if (rc == IOCB_ERROR) {
1379-
phba->hba_flag &= ~(HBA_FLOGI_ISSUED | HBA_FLOGI_OUTSTANDING);
1382+
clear_bit(HBA_FLOGI_ISSUED, &phba->hba_flag);
1383+
clear_bit(HBA_FLOGI_OUTSTANDING, &phba->hba_flag);
13801384
lpfc_els_free_iocb(phba, elsiocb);
13811385
lpfc_nlp_put(ndlp);
13821386
return 1;
@@ -1413,7 +1417,7 @@ lpfc_issue_els_flogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
14131417

14141418
lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
14151419
"3354 Xmit deferred FLOGI ACC: rx_id: x%x,"
1416-
" ox_id: x%x, hba_flag x%x\n",
1420+
" ox_id: x%x, hba_flag x%lx\n",
14171421
phba->defer_flogi_acc_rx_id,
14181422
phba->defer_flogi_acc_ox_id, phba->hba_flag);
14191423

@@ -7415,7 +7419,8 @@ lpfc_els_rcv_rdp(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
74157419
goto error;
74167420
}
74177421

7418-
if (phba->sli_rev < LPFC_SLI_REV4 || (phba->hba_flag & HBA_FCOE_MODE)) {
7422+
if (phba->sli_rev < LPFC_SLI_REV4 ||
7423+
test_bit(HBA_FCOE_MODE, &phba->hba_flag)) {
74197424
rjt_err = LSRJT_UNABLE_TPC;
74207425
rjt_expl = LSEXP_REQ_UNSUPPORTED;
74217426
goto error;
@@ -7738,7 +7743,7 @@ lpfc_els_rcv_lcb(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
77387743
}
77397744

77407745
if (phba->sli_rev < LPFC_SLI_REV4 ||
7741-
phba->hba_flag & HBA_FCOE_MODE ||
7746+
test_bit(HBA_FCOE_MODE, &phba->hba_flag) ||
77427747
(bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) <
77437748
LPFC_SLI_INTF_IF_TYPE_2)) {
77447749
rjt_err = LSRJT_CMD_UNSUPPORTED;
@@ -8443,7 +8448,7 @@ lpfc_els_rcv_flogi(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
84438448
memcpy(&phba->fc_fabparam, sp, sizeof(struct serv_parm));
84448449

84458450
/* Defer ACC response until AFTER we issue a FLOGI */
8446-
if (!(phba->hba_flag & HBA_FLOGI_ISSUED)) {
8451+
if (!test_bit(HBA_FLOGI_ISSUED, &phba->hba_flag)) {
84478452
phba->defer_flogi_acc_rx_id = bf_get(wqe_ctxt_tag,
84488453
&wqe->xmit_els_rsp.wqe_com);
84498454
phba->defer_flogi_acc_ox_id = bf_get(wqe_rcvoxid,
@@ -8453,7 +8458,7 @@ lpfc_els_rcv_flogi(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
84538458

84548459
lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
84558460
"3344 Deferring FLOGI ACC: rx_id: x%x,"
8456-
" ox_id: x%x, hba_flag x%x\n",
8461+
" ox_id: x%x, hba_flag x%lx\n",
84578462
phba->defer_flogi_acc_rx_id,
84588463
phba->defer_flogi_acc_ox_id, phba->hba_flag);
84598464

0 commit comments

Comments
 (0)