From: Hannes Reinecke <hare@suse.de>
To: Jay Kallickal <jayamohank@gmail.com>,
jbottomley@parallels.com, linux-scsi@vger.kernel.org,
michaelc@cs.wisc.edu
Cc: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>,
Minh Tran <minhduc.tran@emulex.com>,
John Soni Jose <sony.john-n@emulex.com>
Subject: Re: [PATCH 3/5] be2iscsi: Fix updating the boot enteries in sysfs
Date: Wed, 27 Aug 2014 15:52:51 +0200 [thread overview]
Message-ID: <53FDE2B3.6010208@suse.de> (raw)
In-Reply-To: <1407474003-26220-3-git-send-email-jkallickal@emulex.com>
On 08/08/2014 07:00 AM, Jay Kallickal wrote:
> From: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
>
> During port async event driver should check if there is any boot target
> configured on the adapter. Update sysfs enteries with the boot target
> parameters.
>
> Signed-off-by: Minh Tran <minhduc.tran@emulex.com>
> Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
> ---
> drivers/scsi/be2iscsi/be_cmds.c | 38 ++++++++++++++++++++++++++++++++++++--
> drivers/scsi/be2iscsi/be_cmds.h | 8 ++++++++
> drivers/scsi/be2iscsi/be_main.c | 17 +++++++++++++++++
> drivers/scsi/be2iscsi/be_main.h | 1 +
> 4 files changed, 62 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/be2iscsi/be_cmds.c b/drivers/scsi/be2iscsi/be_cmds.c
> index ea4477f..80d97f3 100644
> --- a/drivers/scsi/be2iscsi/be_cmds.c
> +++ b/drivers/scsi/be2iscsi/be_cmds.c
> @@ -275,6 +275,19 @@ bool is_link_state_evt(u32 trailer)
> ASYNC_EVENT_CODE_LINK_STATE);
> }
>
> +static bool is_iscsi_evt(u32 trailer)
> +{
> + return ((trailer >> ASYNC_TRAILER_EVENT_CODE_SHIFT) &
> + ASYNC_TRAILER_EVENT_CODE_MASK) ==
> + ASYNC_EVENT_CODE_ISCSI;
> +}
> +
> +static int iscsi_evt_type(u32 trailer)
> +{
> + return (trailer >> ASYNC_TRAILER_EVENT_TYPE_SHIFT) &
> + ASYNC_TRAILER_EVENT_TYPE_MASK;
> +}
> +
> static inline bool be_mcc_compl_is_new(struct be_mcc_compl *compl)
> {
> if (compl->flags != 0) {
> @@ -438,7 +451,7 @@ void beiscsi_async_link_state_process(struct beiscsi_hba *phba,
> } else if ((evt->port_link_status & ASYNC_EVENT_LINK_UP) ||
> ((evt->port_link_status & ASYNC_EVENT_LOGICAL) &&
> (evt->port_fault == BEISCSI_PHY_LINK_FAULT_NONE))) {
> - phba->state = BE_ADAPTER_LINK_UP;
> + phba->state = BE_ADAPTER_LINK_UP | BE_ADAPTER_CHECK_BOOT;
>
> beiscsi_log(phba, KERN_ERR,
> BEISCSI_LOG_CONFIG | BEISCSI_LOG_INIT,
> @@ -461,7 +474,28 @@ int beiscsi_process_mcc(struct beiscsi_hba *phba)
> /* Interpret compl as a async link evt */
> beiscsi_async_link_state_process(phba,
> (struct be_async_event_link_state *) compl);
> - else
> + else if (is_iscsi_evt(compl->flags)) {
> + switch (iscsi_evt_type(compl->flags)) {
> + case ASYNC_EVENT_NEW_ISCSI_TGT_DISC:
> + case ASYNC_EVENT_NEW_ISCSI_CONN:
> + case ASYNC_EVENT_NEW_TCP_CONN:
> + phba->state |= BE_ADAPTER_CHECK_BOOT;
> + beiscsi_log(phba, KERN_ERR,
> + BEISCSI_LOG_CONFIG |
> + BEISCSI_LOG_MBOX,
> + "BC_%d : Async iscsi Event,"
> + " flags handled = 0x%08x\n",
> + compl->flags);
> + break;
> + default:
> + beiscsi_log(phba, KERN_ERR,
> + BEISCSI_LOG_CONFIG |
> + BEISCSI_LOG_MBOX,
> + "BC_%d : Unsupported Async"
> + " Event, flags = 0x%08x\n",
> + compl->flags);
> + }
> + } else
> beiscsi_log(phba, KERN_ERR,
> BEISCSI_LOG_CONFIG |
> BEISCSI_LOG_MBOX,
> diff --git a/drivers/scsi/be2iscsi/be_cmds.h b/drivers/scsi/be2iscsi/be_cmds.h
> index ccda0b6..9889743 100644
> --- a/drivers/scsi/be2iscsi/be_cmds.h
> +++ b/drivers/scsi/be2iscsi/be_cmds.h
> @@ -118,6 +118,14 @@ struct be_mcc_compl {
> #define ASYNC_TRAILER_EVENT_CODE_SHIFT 8 /* bits 8 - 15 */
> #define ASYNC_TRAILER_EVENT_CODE_MASK 0xFF
> #define ASYNC_EVENT_CODE_LINK_STATE 0x1
> +#define ASYNC_EVENT_CODE_ISCSI 0x4
> +
> +#define ASYNC_TRAILER_EVENT_TYPE_SHIFT 16 /* bits 16 - 23 */
> +#define ASYNC_TRAILER_EVENT_TYPE_MASK 0xF
> +#define ASYNC_EVENT_NEW_ISCSI_TGT_DISC 0x4
> +#define ASYNC_EVENT_NEW_ISCSI_CONN 0x5
> +#define ASYNC_EVENT_NEW_TCP_CONN 0x7
> +
> struct be_async_event_trailer {
> u32 code;
> };
> diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
> index d6465ed..8f9f625 100644
> --- a/drivers/scsi/be2iscsi/be_main.c
> +++ b/drivers/scsi/be2iscsi/be_main.c
> @@ -4379,6 +4379,10 @@ static int beiscsi_setup_boot_info(struct beiscsi_hba *phba)
> {
> struct iscsi_boot_kobj *boot_kobj;
>
> + /* it has been created previously */
> + if (phba->boot_kset)
> + return 0;
> +
> /* get boot info using mgmt cmd */
> if (beiscsi_get_boot_info(phba))
> /* Try to see if we can carry on without this */
> @@ -5337,6 +5341,14 @@ static void be_eqd_update(struct beiscsi_hba *phba)
> }
> }
>
> +static void be_check_boot_session(struct beiscsi_hba *phba)
> +{
> + if (beiscsi_setup_boot_info(phba))
> + beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
> + "BM_%d : Could not set up "
> + "iSCSI boot info on async event.\n");
> +}
> +
> /*
> * beiscsi_hw_health_check()- Check adapter health
> * @work: work item to check HW health
> @@ -5352,6 +5364,11 @@ beiscsi_hw_health_check(struct work_struct *work)
>
> be_eqd_update(phba);
>
> + if (phba->state & BE_ADAPTER_CHECK_BOOT) {
> + phba->state &= ~BE_ADAPTER_CHECK_BOOT;
> + be_check_boot_session(phba);
> + }
> +
> beiscsi_ue_detect(phba);
>
> schedule_delayed_work(&phba->beiscsi_hw_check_task,
> diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h
> index 0ca9d2d..1e3428a 100644
> --- a/drivers/scsi/be2iscsi/be_main.h
> +++ b/drivers/scsi/be2iscsi/be_main.h
> @@ -104,6 +104,7 @@
> #define BE_ADAPTER_LINK_DOWN 0x002
> #define BE_ADAPTER_PCI_ERR 0x004
> #define BE_ADAPTER_STATE_SHUTDOWN 0x008
> +#define BE_ADAPTER_CHECK_BOOT 0x010
>
>
> #define BEISCSI_CLEAN_UNLOAD 0x01
>
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
next prev parent reply other threads:[~2014-08-27 13:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-08 4:59 [PATCH 1/5] be2iscsi: Fix the sparse warning introduced in previous submission Jay Kallickal
2014-08-08 4:59 ` [PATCH 2/5] be2iscsi: Fix the copyright year Jay Kallickal
2014-08-27 13:50 ` Hannes Reinecke
2014-08-08 5:00 ` [PATCH 3/5] be2iscsi: Fix updating the boot enteries in sysfs Jay Kallickal
2014-08-27 13:52 ` Hannes Reinecke [this message]
2014-08-08 5:00 ` [PATCH 4/5] be2iscsi: Fix processing CQE before connection resources are freed Jay Kallickal
2014-08-27 13:53 ` Hannes Reinecke
2014-08-08 5:00 ` [PATCH 5/5] be2iscsi: Bump the driver version Jay Kallickal
2014-08-27 13:53 ` Hannes Reinecke
2014-08-08 5:00 ` [PATCH 0/5] be2iscsi: Update to 10.4.74.0 Jay Kallickal
2014-08-08 18:55 ` Mike Christie
2014-08-19 17:27 ` [PATCH 1/5] be2iscsi: Fix the sparse warning introduced in previous submission Christoph Hellwig
2014-08-27 13:50 ` Hannes Reinecke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53FDE2B3.6010208@suse.de \
--to=hare@suse.de \
--cc=jayamohan.kallickal@emulex.com \
--cc=jayamohank@gmail.com \
--cc=jbottomley@parallels.com \
--cc=linux-scsi@vger.kernel.org \
--cc=michaelc@cs.wisc.edu \
--cc=minhduc.tran@emulex.com \
--cc=sony.john-n@emulex.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.