All of lore.kernel.org
 help / color / mirror / Atom feed
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>,
	John Soni Jose <sony.john-n@emulex.com>
Subject: Re: [PATCH 4/5] be2iscsi: Fix processing CQE before connection resources are freed
Date: Wed, 27 Aug 2014 15:53:05 +0200	[thread overview]
Message-ID: <53FDE2C1.7090801@suse.de> (raw)
In-Reply-To: <1407474003-26220-4-git-send-email-jkallickal@emulex.com>

On 08/08/2014 07:00 AM, Jay Kallickal wrote:
> From: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
>
>   Driver should process the completion queue entries before a connection
>   resources are freed. While running mixed traffic due to latency, driver
>   processes the CQE after the connection resources are freed. This fix
>   processes all the completion queue before the connection resources are
>   freed.
>
> Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
> ---
>   drivers/scsi/be2iscsi/be_iscsi.c | 29 +++++++++++++++++++++++++++++
>   drivers/scsi/be2iscsi/be_main.c  | 15 ++++++++++++++-
>   drivers/scsi/be2iscsi/be_main.h  |  3 +++
>   3 files changed, 46 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c
> index e25203e..b7391a3 100644
> --- a/drivers/scsi/be2iscsi/be_iscsi.c
> +++ b/drivers/scsi/be2iscsi/be_iscsi.c
> @@ -1274,6 +1274,31 @@ int beiscsi_ep_poll(struct iscsi_endpoint *ep, int timeout_ms)
>   }
>
>   /**
> + * beiscsi_flush_cq()- Flush the CQ created.
> + * @phba: ptr device priv structure.
> + *
> + * Before the connection resource are freed flush
> + * all the CQ enteries
> + **/
> +static void beiscsi_flush_cq(struct beiscsi_hba *phba)
> +{
> +	uint16_t i;
> +	struct be_eq_obj *pbe_eq;
> +	struct hwi_controller *phwi_ctrlr;
> +	struct hwi_context_memory *phwi_context;
> +
> +	phwi_ctrlr = phba->phwi_ctrlr;
> +	phwi_context = phwi_ctrlr->phwi_ctxt;
> +
> +	for (i = 0; i < phba->num_cpus; i++) {
> +		pbe_eq = &phwi_context->be_eq[i];
> +		blk_iopoll_disable(&pbe_eq->iopoll);
> +		beiscsi_process_cq(pbe_eq);
> +		blk_iopoll_enable(&pbe_eq->iopoll);
> +	}
> +}
> +
> +/**
>    * beiscsi_close_conn - Upload the  connection
>    * @ep: The iscsi endpoint
>    * @flag: The type of connection closure
> @@ -1294,6 +1319,10 @@ static int beiscsi_close_conn(struct  beiscsi_endpoint *beiscsi_ep, int flag)
>   	}
>
>   	ret = beiscsi_mccq_compl(phba, tag, NULL, NULL);
> +
> +	/* Flush the CQ entries */
> +	beiscsi_flush_cq(phba);
> +
>   	return ret;
>   }
>
> diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
> index 8f9f625..cbc9fc2 100644
> --- a/drivers/scsi/be2iscsi/be_main.c
> +++ b/drivers/scsi/be2iscsi/be_main.c
> @@ -2068,7 +2068,7 @@ static void  beiscsi_process_mcc_isr(struct beiscsi_hba *phba)
>    * return
>    *     Number of Completion Entries processed.
>    **/
> -static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
> +unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
>   {
>   	struct be_queue_info *cq;
>   	struct sol_cqe *sol;
> @@ -2110,6 +2110,18 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
>
>   		cri_index = BE_GET_CRI_FROM_CID(cid);
>   		ep = phba->ep_array[cri_index];
> +
> +		if (ep == NULL) {
> +			/* connection has already been freed
> +			 * just move on to next one
> +			 */
> +			beiscsi_log(phba, KERN_WARNING,
> +				    BEISCSI_LOG_INIT,
> +				    "BM_%d : proc cqe of disconn ep: cid %d\n",
> +				    cid);
> +			goto proc_next_cqe;
> +		}
> +
>   		beiscsi_ep = ep->dd_data;
>   		beiscsi_conn = beiscsi_ep->conn;
>
> @@ -2219,6 +2231,7 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
>   			break;
>   		}
>
> +proc_next_cqe:
>   		AMAP_SET_BITS(struct amap_sol_cqe, valid, sol, 0);
>   		queue_tail_inc(cq);
>   		sol = queue_tail_node(cq);
> diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h
> index 1e3428a..5f8b0fc 100644
> --- a/drivers/scsi/be2iscsi/be_main.h
> +++ b/drivers/scsi/be2iscsi/be_main.h
> @@ -840,6 +840,9 @@ void beiscsi_free_mgmt_task_handles(struct beiscsi_conn *beiscsi_conn,
>   void hwi_ring_cq_db(struct beiscsi_hba *phba,
>   		     unsigned int id, unsigned int num_processed,
>   		     unsigned char rearm, unsigned char event);
> +
> +unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq);
> +
>   static inline bool beiscsi_error(struct beiscsi_hba *phba)
>   {
>   	return phba->ue_detected || phba->fw_timeout;
>
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

  reply	other threads:[~2014-08-27 13:53 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
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 [this message]
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=53FDE2C1.7090801@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=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.