Skip to content

Commit 21be4d0

Browse files
Merge patch series "lpfc: Update lpfc to revision 14.2.0.13"
Justin Tee <[email protected]> says: Update lpfc to revision 14.2.0.13 This patch set contains discovery bug fixes, firmware logging improvements, clean up of CQ handling, and statistics collection enhancements. The patches were cut against Martin's 6.5/scsi-queue tree. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
2 parents 2516cb8 + b93f9eb commit 21be4d0

File tree

11 files changed

+195
-320
lines changed

11 files changed

+195
-320
lines changed

drivers/scsi/lpfc/lpfc.h

Lines changed: 19 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,15 @@ struct lpfc_cgn_param {
429429
/* Max number of days of congestion data */
430430
#define LPFC_MAX_CGN_DAYS 10
431431

432+
struct lpfc_cgn_ts {
433+
uint8_t month;
434+
uint8_t day;
435+
uint8_t year;
436+
uint8_t hour;
437+
uint8_t minute;
438+
uint8_t second;
439+
};
440+
432441
/* Format of congestion buffer info
433442
* This structure defines memory thats allocated and registered with
434443
* the HBA firmware. When adding or removing fields from this structure
@@ -442,6 +451,7 @@ struct lpfc_cgn_info {
442451
#define LPFC_CGN_INFO_V1 1
443452
#define LPFC_CGN_INFO_V2 2
444453
#define LPFC_CGN_INFO_V3 3
454+
#define LPFC_CGN_INFO_V4 4
445455
uint8_t cgn_info_mode; /* 0=off 1=managed 2=monitor only */
446456
uint8_t cgn_info_detect;
447457
uint8_t cgn_info_action;
@@ -450,12 +460,7 @@ struct lpfc_cgn_info {
450460
uint8_t cgn_info_level2;
451461

452462
/* Start Time */
453-
uint8_t cgn_info_month;
454-
uint8_t cgn_info_day;
455-
uint8_t cgn_info_year;
456-
uint8_t cgn_info_hour;
457-
uint8_t cgn_info_minute;
458-
uint8_t cgn_info_second;
463+
struct lpfc_cgn_ts base_time;
459464

460465
/* minute / hours / daily indices */
461466
uint8_t cgn_index_minute;
@@ -496,45 +501,17 @@ struct lpfc_cgn_info {
496501
uint8_t cgn_stat_npm; /* Notifications per minute */
497502

498503
/* Start Time */
499-
uint8_t cgn_stat_month;
500-
uint8_t cgn_stat_day;
501-
uint8_t cgn_stat_year;
502-
uint8_t cgn_stat_hour;
503-
uint8_t cgn_stat_minute;
504-
uint8_t cgn_pad2[2];
504+
struct lpfc_cgn_ts stat_start; /* Base time */
505+
uint8_t cgn_pad2;
505506

506507
__le32 cgn_notification;
507508
__le32 cgn_peer_notification;
508509
__le32 link_integ_notification;
509510
__le32 delivery_notification;
510-
511-
uint8_t cgn_stat_cgn_month; /* Last congestion notification FPIN */
512-
uint8_t cgn_stat_cgn_day;
513-
uint8_t cgn_stat_cgn_year;
514-
uint8_t cgn_stat_cgn_hour;
515-
uint8_t cgn_stat_cgn_min;
516-
uint8_t cgn_stat_cgn_sec;
517-
518-
uint8_t cgn_stat_peer_month; /* Last peer congestion FPIN */
519-
uint8_t cgn_stat_peer_day;
520-
uint8_t cgn_stat_peer_year;
521-
uint8_t cgn_stat_peer_hour;
522-
uint8_t cgn_stat_peer_min;
523-
uint8_t cgn_stat_peer_sec;
524-
525-
uint8_t cgn_stat_lnk_month; /* Last link integrity FPIN */
526-
uint8_t cgn_stat_lnk_day;
527-
uint8_t cgn_stat_lnk_year;
528-
uint8_t cgn_stat_lnk_hour;
529-
uint8_t cgn_stat_lnk_min;
530-
uint8_t cgn_stat_lnk_sec;
531-
532-
uint8_t cgn_stat_del_month; /* Last delivery notification FPIN */
533-
uint8_t cgn_stat_del_day;
534-
uint8_t cgn_stat_del_year;
535-
uint8_t cgn_stat_del_hour;
536-
uint8_t cgn_stat_del_min;
537-
uint8_t cgn_stat_del_sec;
511+
struct lpfc_cgn_ts stat_fpin; /* Last congestion notification FPIN */
512+
struct lpfc_cgn_ts stat_peer; /* Last peer congestion FPIN */
513+
struct lpfc_cgn_ts stat_lnk; /* Last link integrity FPIN */
514+
struct lpfc_cgn_ts stat_delivery; /* Last delivery notification FPIN */
538515
);
539516

540517
__le32 cgn_info_crc;
@@ -932,8 +909,6 @@ struct lpfc_hba {
932909
void (*__lpfc_sli_release_iocbq)(struct lpfc_hba *,
933910
struct lpfc_iocbq *);
934911
int (*lpfc_hba_down_post)(struct lpfc_hba *phba);
935-
void (*lpfc_scsi_cmd_iocb_cmpl)
936-
(struct lpfc_hba *, struct lpfc_iocbq *, struct lpfc_iocbq *);
937912

938913
/* MBOX interface function jump table entries */
939914
int (*lpfc_sli_issue_mbox)
@@ -1045,8 +1020,6 @@ struct lpfc_hba {
10451020
* capability
10461021
*/
10471022
#define HBA_FLOGI_ISSUED 0x100000 /* FLOGI was issued */
1048-
#define HBA_SHORT_CMF 0x200000 /* shorter CMF timer routine */
1049-
#define HBA_CGN_DAY_WRAP 0x400000 /* HBA Congestion info day wraps */
10501023
#define HBA_DEFER_FLOGI 0x800000 /* Defer FLOGI till read_sparm cmpl */
10511024
#define HBA_SETUP 0x1000000 /* Signifies HBA setup is completed */
10521025
#define HBA_NEEDS_CFG_PORT 0x2000000 /* SLI3 - needs a CONFIG_PORT mbox */
@@ -1529,6 +1502,7 @@ struct lpfc_hba {
15291502
uint64_t cmf_last_sync_bw;
15301503
#define LPFC_CMF_BLK_SIZE 512
15311504
struct hrtimer cmf_timer;
1505+
struct hrtimer cmf_stats_timer; /* 1 minute stats timer */
15321506
atomic_t cmf_bw_wait;
15331507
atomic_t cmf_busy;
15341508
atomic_t cmf_stop_io; /* To block request and stop IO's */
@@ -1576,12 +1550,11 @@ struct lpfc_hba {
15761550
atomic_t cgn_sync_alarm_cnt; /* Total alarm events for SYNC wqe */
15771551
atomic_t cgn_driver_evt_cnt; /* Total driver cgn events for fmw */
15781552
atomic_t cgn_latency_evt_cnt;
1579-
struct timespec64 cgn_daily_ts;
15801553
atomic64_t cgn_latency_evt; /* Avg latency per minute */
15811554
unsigned long cgn_evt_timestamp;
15821555
#define LPFC_CGN_TIMER_TO_MIN 60000 /* ms in a minute */
15831556
uint32_t cgn_evt_minute;
1584-
#define LPFC_SEC_MIN 60
1557+
#define LPFC_SEC_MIN 60UL
15851558
#define LPFC_MIN_HOUR 60
15861559
#define LPFC_HOUR_DAY 24
15871560
#define LPFC_MIN_DAY (LPFC_MIN_HOUR * LPFC_HOUR_DAY)

drivers/scsi/lpfc/lpfc_els.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5452,9 +5452,19 @@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
54525452
ndlp->nlp_flag &= ~NLP_RELEASE_RPI;
54535453
spin_unlock_irq(&ndlp->lock);
54545454
}
5455+
lpfc_drop_node(vport, ndlp);
5456+
} else if (ndlp->nlp_state != NLP_STE_PLOGI_ISSUE &&
5457+
ndlp->nlp_state != NLP_STE_REG_LOGIN_ISSUE &&
5458+
ndlp->nlp_state != NLP_STE_PRLI_ISSUE) {
5459+
/* Drop ndlp if there is no planned or outstanding
5460+
* issued PRLI.
5461+
*
5462+
* In cases when the ndlp is acting as both an initiator
5463+
* and target function, let our issued PRLI determine
5464+
* the final ndlp kref drop.
5465+
*/
5466+
lpfc_drop_node(vport, ndlp);
54555467
}
5456-
5457-
lpfc_drop_node(vport, ndlp);
54585468
}
54595469

54605470
/* Release the originating I/O reference. */

drivers/scsi/lpfc/lpfc_hbadisc.c

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -458,11 +458,9 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp)
458458
if (ndlp->nlp_type & NLP_FABRIC) {
459459
spin_lock_irqsave(&ndlp->lock, iflags);
460460

461-
/* In massive vport configuration settings or when the FLOGI
462-
* completes with a sequence timeout, it's possible
463-
* dev_loss_tmo fired during node recovery. The driver has to
464-
* account for this race to allow for recovery and keep
465-
* the reference counting correct.
461+
/* The driver has to account for a race between any fabric
462+
* node that's in recovery when dev_loss_tmo expires. When this
463+
* happens, the driver has to allow node recovery.
466464
*/
467465
switch (ndlp->nlp_DID) {
468466
case Fabric_DID:
@@ -489,6 +487,17 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp)
489487
ndlp->nlp_state <= NLP_STE_REG_LOGIN_ISSUE)
490488
recovering = true;
491489
break;
490+
default:
491+
/* Ensure the nlp_DID at least has the correct prefix.
492+
* The fabric domain controller's last three nibbles
493+
* vary so we handle it in the default case.
494+
*/
495+
if (ndlp->nlp_DID & Fabric_DID_MASK) {
496+
if (ndlp->nlp_state >= NLP_STE_PLOGI_ISSUE &&
497+
ndlp->nlp_state <= NLP_STE_REG_LOGIN_ISSUE)
498+
recovering = true;
499+
}
500+
break;
492501
}
493502
spin_unlock_irqrestore(&ndlp->lock, iflags);
494503

@@ -556,6 +565,9 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp)
556565
ndlp->nlp_DID, ndlp->nlp_flag,
557566
ndlp->nlp_state, ndlp->nlp_rpi);
558567
}
568+
spin_lock_irqsave(&ndlp->lock, iflags);
569+
ndlp->nlp_flag &= ~NLP_IN_DEV_LOSS;
570+
spin_unlock_irqrestore(&ndlp->lock, iflags);
559571

560572
/* If we are devloss, but we are in the process of rediscovering the
561573
* ndlp, don't issue a NLP_EVT_DEVICE_RM event.
@@ -565,9 +577,6 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp)
565577
return fcf_inuse;
566578
}
567579

568-
spin_lock_irqsave(&ndlp->lock, iflags);
569-
ndlp->nlp_flag &= ~NLP_IN_DEV_LOSS;
570-
spin_unlock_irqrestore(&ndlp->lock, iflags);
571580
if (!(ndlp->fc4_xpt_flags & NVME_XPT_REGD))
572581
lpfc_disc_state_machine(vport, ndlp, NULL, NLP_EVT_DEVICE_RM);
573582

@@ -4498,14 +4507,6 @@ lpfc_register_remote_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
44984507
if (vport->load_flag & FC_UNLOADING)
44994508
return;
45004509

4501-
/*
4502-
* Disassociate any older association between this ndlp and rport
4503-
*/
4504-
if (ndlp->rport) {
4505-
rdata = ndlp->rport->dd_data;
4506-
rdata->pnode = NULL;
4507-
}
4508-
45094510
ndlp->rport = rport = fc_remote_port_add(shost, 0, &rport_ids);
45104511
if (!rport) {
45114512
dev_printk(KERN_WARNING, &phba->pcidev->dev,

drivers/scsi/lpfc/lpfc_hw4.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,6 @@ struct lpfc_cqe {
395395
#define CQE_STATUS_NEED_BUFF_ENTRY 0xf
396396
#define CQE_STATUS_DI_ERROR 0x16
397397

398-
/* Used when mapping CQE status to IOCB */
399-
#define LPFC_IOCB_STATUS_MASK 0xf
400-
401398
/* Status returned by hardware (valid only if status = CQE_STATUS_SUCCESS). */
402399
#define CQE_HW_STATUS_NO_ERR 0x0
403400
#define CQE_HW_STATUS_UNDERRUN 0x1

0 commit comments

Comments
 (0)