* [PATCH 1/9] lpfc: Check for active portpeerbeacon.
@ 2015-05-22 14:42 James Smart
2015-05-24 19:50 ` Sebastian Herbszt
2015-05-25 15:13 ` Hannes Reinecke
0 siblings, 2 replies; 3+ messages in thread
From: James Smart @ 2015-05-22 14:42 UTC (permalink / raw)
To: linux-scsi
Check for active portpeerbeacon.
LCB requests to set Beacon would fail if the beacon was already enabled
internally as the mailbox command used to query the state failes with
an already-set status.
Correct by enhancing the check so we don't fail if if the already set
status comes back.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
---
drivers/scsi/lpfc/lpfc_els.c | 19 +++++++++++++++----
drivers/scsi/lpfc/lpfc_hw4.h | 6 ++++++
2 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 011c8d8..3aad09f 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -5044,25 +5044,36 @@ lpfc_els_lcb_rsp(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
struct lpfc_iocbq *elsiocb;
struct lpfc_nodelist *ndlp;
struct ls_rjt *stat;
+ union lpfc_sli4_cfg_shdr *shdr;
struct lpfc_lcb_context *lcb_context;
struct fc_lcb_res_frame *lcb_res;
- uint32_t cmdsize;
+ uint32_t cmdsize, shdr_status, shdr_add_status;
int rc;
mb = &pmb->u.mb;
-
lcb_context = (struct lpfc_lcb_context *)pmb->context1;
ndlp = lcb_context->ndlp;
pmb->context1 = NULL;
pmb->context2 = NULL;
- if (mb->mbxStatus) {
+ shdr = (union lpfc_sli4_cfg_shdr *)
+ &pmb->u.mqe.un.beacon_config.header.cfg_shdr;
+ shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response);
+ shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
+
+ lpfc_printf_log(phba, KERN_INFO, LOG_MBOX,
+ "0194 SET_BEACON_CONFIG mailbox "
+ "completed with status x%x add_status x%x,"
+ " mbx status x%x\n",
+ shdr_status, shdr_add_status, mb->mbxStatus);
+
+ if (mb->mbxStatus && !(shdr_status &&
+ shdr_add_status == ADD_STATUS_OPERATION_ALREADY_ACTIVE)) {
mempool_free(pmb, phba->mbox_mem_pool);
goto error;
}
mempool_free(pmb, phba->mbox_mem_pool);
-
cmdsize = sizeof(struct fc_lcb_res_frame);
elsiocb = lpfc_prep_els_iocb(phba->pport, 0, cmdsize,
lpfc_max_els_tries, ndlp,
diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h
index 7cc7bec..b94fa46 100644
--- a/drivers/scsi/lpfc/lpfc_hw4.h
+++ b/drivers/scsi/lpfc/lpfc_hw4.h
@@ -1943,6 +1943,12 @@ struct lpfc_mbx_redisc_fcf_tbl {
#define STATUS_FCF_IN_USE 0x3a
#define STATUS_FCF_TABLE_EMPTY 0x43
+/*
+ * Additional status field for embedded SLI_CONFIG mailbox
+ * command.
+ */
+#define ADD_STATUS_OPERATION_ALREADY_ACTIVE 0x67
+
struct lpfc_mbx_sli4_config {
struct mbox_header header;
};
--
1.7.11.7
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/9] lpfc: Check for active portpeerbeacon.
2015-05-22 14:42 [PATCH 1/9] lpfc: Check for active portpeerbeacon James Smart
@ 2015-05-24 19:50 ` Sebastian Herbszt
2015-05-25 15:13 ` Hannes Reinecke
1 sibling, 0 replies; 3+ messages in thread
From: Sebastian Herbszt @ 2015-05-24 19:50 UTC (permalink / raw)
To: James Smart; +Cc: linux-scsi, Sebastian Herbszt
James Smart wrote:
>
> Check for active portpeerbeacon.
>
> LCB requests to set Beacon would fail if the beacon was already enabled
beacon
> internally as the mailbox command used to query the state failes with
fails
> an already-set status.
>
> Correct by enhancing the check so we don't fail if if the already set
if twice
> status comes back.
>
> Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
> Signed-off-by: James Smart <james.smart@avagotech.com>
> ---
> drivers/scsi/lpfc/lpfc_els.c | 19 +++++++++++++++----
> drivers/scsi/lpfc/lpfc_hw4.h | 6 ++++++
> 2 files changed, 21 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
> index 011c8d8..3aad09f 100644
> --- a/drivers/scsi/lpfc/lpfc_els.c
> +++ b/drivers/scsi/lpfc/lpfc_els.c
> @@ -5044,25 +5044,36 @@ lpfc_els_lcb_rsp(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
> struct lpfc_iocbq *elsiocb;
> struct lpfc_nodelist *ndlp;
> struct ls_rjt *stat;
> + union lpfc_sli4_cfg_shdr *shdr;
> struct lpfc_lcb_context *lcb_context;
> struct fc_lcb_res_frame *lcb_res;
> - uint32_t cmdsize;
> + uint32_t cmdsize, shdr_status, shdr_add_status;
> int rc;
>
> mb = &pmb->u.mb;
> -
> lcb_context = (struct lpfc_lcb_context *)pmb->context1;
> ndlp = lcb_context->ndlp;
> pmb->context1 = NULL;
> pmb->context2 = NULL;
>
> - if (mb->mbxStatus) {
> + shdr = (union lpfc_sli4_cfg_shdr *)
> + &pmb->u.mqe.un.beacon_config.header.cfg_shdr;
> + shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response);
> + shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
> +
> + lpfc_printf_log(phba, KERN_INFO, LOG_MBOX,
> + "0194 SET_BEACON_CONFIG mailbox "
> + "completed with status x%x add_status x%x,"
> + " mbx status x%x\n",
> + shdr_status, shdr_add_status, mb->mbxStatus);
checkpatch suggests to not split this user-visible string.
Sebastian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/9] lpfc: Check for active portpeerbeacon.
2015-05-22 14:42 [PATCH 1/9] lpfc: Check for active portpeerbeacon James Smart
2015-05-24 19:50 ` Sebastian Herbszt
@ 2015-05-25 15:13 ` Hannes Reinecke
1 sibling, 0 replies; 3+ messages in thread
From: Hannes Reinecke @ 2015-05-25 15:13 UTC (permalink / raw)
To: James Smart, linux-scsi
On 05/22/2015 04:42 PM, James Smart wrote:
>
> Check for active portpeerbeacon.
>
> LCB requests to set Beacon would fail if the beacon was already enabled
> internally as the mailbox command used to query the state failes with
> an already-set status.
>
> Correct by enhancing the check so we don't fail if if the already set
> status comes back.
>
> Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
> Signed-off-by: James Smart <james.smart@avagotech.com>
> ---
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-25 15:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-22 14:42 [PATCH 1/9] lpfc: Check for active portpeerbeacon James Smart
2015-05-24 19:50 ` Sebastian Herbszt
2015-05-25 15:13 ` Hannes Reinecke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox