aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc.h
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2008-06-14 22:52:53 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-07-12 09:22:28 -0400
commit5e9d9b8276980fc5dfa88ce34f6ec88ce3026232 (patch)
tree30b495edab629068f929a32f88a66ad705687f34 /drivers/scsi/lpfc/lpfc.h
parent0d2b6b83030d6a88cbf7db57f84f2daf0e0b251b (diff)
[SCSI] lpfc 8.2.7 : Rework the worker thread
Rework of the worker thread to make it more efficient. Make a finer-grain notfication of pending work so less time is spent checking conditions. Also made other general cleanups. Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc.h')
-rw-r--r--drivers/scsi/lpfc/lpfc.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h
index ec0b0f6e5e1a..e3e5b540e36c 100644
--- a/drivers/scsi/lpfc/lpfc.h
+++ b/drivers/scsi/lpfc/lpfc.h
@@ -59,6 +59,9 @@ struct lpfc_sli2_slim;
59 59
60#define MAX_HBAEVT 32 60#define MAX_HBAEVT 32
61 61
62/* lpfc wait event data ready flag */
63#define LPFC_DATA_READY (1<<0)
64
62enum lpfc_polling_flags { 65enum lpfc_polling_flags {
63 ENABLE_FCP_RING_POLLING = 0x1, 66 ENABLE_FCP_RING_POLLING = 0x1,
64 DISABLE_FCP_RING_INT = 0x2 67 DISABLE_FCP_RING_INT = 0x2
@@ -425,9 +428,6 @@ struct lpfc_hba {
425 428
426 uint16_t pci_cfg_value; 429 uint16_t pci_cfg_value;
427 430
428 uint8_t work_found;
429#define LPFC_MAX_WORKER_ITERATION 4
430
431 uint8_t fc_linkspeed; /* Link speed after last READ_LA */ 431 uint8_t fc_linkspeed; /* Link speed after last READ_LA */
432 432
433 uint32_t fc_eventTag; /* event tag for link attention */ 433 uint32_t fc_eventTag; /* event tag for link attention */
@@ -489,8 +489,9 @@ struct lpfc_hba {
489 uint32_t work_hs; /* HS stored in case of ERRAT */ 489 uint32_t work_hs; /* HS stored in case of ERRAT */
490 uint32_t work_status[2]; /* Extra status from SLIM */ 490 uint32_t work_status[2]; /* Extra status from SLIM */
491 491
492 wait_queue_head_t *work_wait; 492 wait_queue_head_t work_waitq;
493 struct task_struct *worker_thread; 493 struct task_struct *worker_thread;
494 long data_flags;
494 495
495 uint32_t hbq_in_use; /* HBQs in use flag */ 496 uint32_t hbq_in_use; /* HBQs in use flag */
496 struct list_head hbqbuf_in_list; /* in-fly hbq buffer list */ 497 struct list_head hbqbuf_in_list; /* in-fly hbq buffer list */
@@ -637,6 +638,17 @@ lpfc_is_link_up(struct lpfc_hba *phba)
637 phba->link_state == LPFC_HBA_READY; 638 phba->link_state == LPFC_HBA_READY;
638} 639}
639 640
641static inline void
642lpfc_worker_wake_up(struct lpfc_hba *phba)
643{
644 /* Set the lpfc data pending flag */
645 set_bit(LPFC_DATA_READY, &phba->data_flags);
646
647 /* Wake up worker thread */
648 wake_up(&phba->work_waitq);
649 return;
650}
651
640#define FC_REG_DUMP_EVENT 0x10 /* Register for Dump events */ 652#define FC_REG_DUMP_EVENT 0x10 /* Register for Dump events */
641#define FC_REG_TEMPERATURE_EVENT 0x20 /* Register for temperature 653#define FC_REG_TEMPERATURE_EVENT 0x20 /* Register for temperature
642 event */ 654 event */