From: Hannes Reinecke <hare@suse.de>
To: James Smart <james.smart@avagotech.com>, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 13/17] lpfc: Fix external loopback failure.
Date: Thu, 17 Dec 2015 09:33:36 +0100 [thread overview]
Message-ID: <56727360.4080906@suse.de> (raw)
In-Reply-To: <5671efc4.p0ZuEBo3q81E+gY3%james.smart@avagotech.com>
On 12/17/2015 12:12 AM, James Smart wrote:
>
> Fix external loopback failure.
>
> Rx sequence reassembly was incorrect.
>
> Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
> Signed-off-by: James Smart <james.smart@avagotech.com>
> ---
> drivers/scsi/lpfc/lpfc_sli.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
> index e504d51..b4bff35 100644
> --- a/drivers/scsi/lpfc/lpfc_sli.c
> +++ b/drivers/scsi/lpfc/lpfc_sli.c
> @@ -14849,10 +14849,12 @@ lpfc_fc_frame_add(struct lpfc_vport *vport, struct hbq_dmabuf *dmabuf)
> struct lpfc_dmabuf *h_buf;
> struct hbq_dmabuf *seq_dmabuf = NULL;
> struct hbq_dmabuf *temp_dmabuf = NULL;
> + uint8_t found = 0;
>
> INIT_LIST_HEAD(&dmabuf->dbuf.list);
> dmabuf->time_stamp = jiffies;
> new_hdr = (struct fc_frame_header *)dmabuf->hbuf.virt;
> +
> /* Use the hdr_buf to find the sequence that this frame belongs to */
> list_for_each_entry(h_buf, &vport->rcv_buffer_list, list) {
> temp_hdr = (struct fc_frame_header *)h_buf->virt;
> @@ -14892,7 +14894,8 @@ lpfc_fc_frame_add(struct lpfc_vport *vport, struct hbq_dmabuf *dmabuf)
> return seq_dmabuf;
> }
> /* find the correct place in the sequence to insert this frame */
> - list_for_each_entry_reverse(d_buf, &seq_dmabuf->dbuf.list, list) {
> + d_buf = list_entry(seq_dmabuf->dbuf.list.prev, typeof(*d_buf), list);
> + while (!found) {
> temp_dmabuf = container_of(d_buf, struct hbq_dmabuf, dbuf);
> temp_hdr = (struct fc_frame_header *)temp_dmabuf->hbuf.virt;
> /*
> @@ -14902,9 +14905,17 @@ lpfc_fc_frame_add(struct lpfc_vport *vport, struct hbq_dmabuf *dmabuf)
> if (be16_to_cpu(new_hdr->fh_seq_cnt) >
> be16_to_cpu(temp_hdr->fh_seq_cnt)) {
> list_add(&dmabuf->dbuf.list, &temp_dmabuf->dbuf.list);
> - return seq_dmabuf;
> + found = 1;
> + break;
> }
> +
> + if (&d_buf->list == &seq_dmabuf->dbuf.list)
> + break;
> + d_buf = list_entry(d_buf->list.prev, typeof(*d_buf), list);
> }
> +
> + if (found)
> + return seq_dmabuf;
> return NULL;
> }
>
>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (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
prev parent reply other threads:[~2015-12-17 8:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-16 23:12 [PATCH 13/17] lpfc: Fix external loopback failure James Smart
2015-12-17 8:33 ` Hannes Reinecke [this message]
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=56727360.4080906@suse.de \
--to=hare@suse.de \
--cc=james.smart@avagotech.com \
--cc=linux-scsi@vger.kernel.org \
/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.