All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Martin Wilck <mwilck@suse.de>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
	Quinn Tran <qutran@marvell.com>,
	Himanshu Madhani <hmadhani@marvell.com>
Cc: linux-scsi@vger.kernel.org, Martin Wilck <mwilck@suse.com>,
	Daniel Wagner <dwagner@suse.de>,
	Roman Bolshakov <r.bolshakov@yadro.com>
Subject: Re: [PATCH 4/4] qla2xxx: Micro-optimize qla2x00_configure_local_loop()
Date: Sat, 14 Dec 2019 16:12:34 -0800	[thread overview]
Message-ID: <ee7fe321-956f-fe75-6a69-5cb1a0673046@acm.org> (raw)
In-Reply-To: <5ff7962a50719d79a3262bcb290bc93b3a8e3058.camel@suse.de>

On 2019-12-10 02:46, Martin Wilck wrote:
> On Mon, 2019-12-09 at 10:02 -0800, Bart Van Assche wrote:
>> diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
>> index 6c28f38f8021..ddd8bf7997a8 100644
>> --- a/drivers/scsi/qla2xxx/qla_init.c
>> +++ b/drivers/scsi/qla2xxx/qla_init.c
>> @@ -5047,13 +5047,12 @@ qla2x00_configure_local_loop(scsi_qla_host_t *vha)
>>  			rval = qla24xx_get_port_login_templ(vha,
>>  			    ha->init_cb_dma, (void *)ha->init_cb, sz);
>>  			if (rval == QLA_SUCCESS) {
>> +				__be32 *q = &ha->plogi_els_payld.data[0];
>> +
>>  				bp = (uint32_t *)ha->init_cb;
>> -				for (i = 0; i < sz/4 ; i++, bp++)
>> -					*bp = cpu_to_be32(*bp);
>> +				for (i = 0; i < sz/4 ; i++, bp++, q++)
>> +					*q = cpu_to_be32(*bp);
>>  
>> -				memcpy(&ha->plogi_els_payld.data,
>> -				    (void *)ha->init_cb,
>> -				    sizeof(ha->plogi_els_payld.data));
>>  				set_bit(RELOGIN_NEEDED, &vha->dpc_flags);
>>  			} else {
>>  				ql_dbg(ql_dbg_init, vha, 0x00d1,
> 
> A side effect of this patch would be that after return from
> qla2x00_configure_local_loop(), the byte ordering in ha->init_cb
> remains in CPU byte ordering, whereas before your patch, it would have
> been converted to be32. I'm uncertain if that would matter later on.
> 
> The following is not a problems with your patch, but what's really
> weird is that in qla24xx_get_port_login_templ() (which is only called
> from here), the buffer is converted from le32 to CPU endianness, and
> then here, in a second step, from CPU to be32. I'm wondering which byte
> order this buffer is supposed to have, and whether that's different
> depending on which mode the controller is operating in (the be32
> conversion seems to be applied in N2N mode only). Moreover, looking at
> the definition of init_cb_t in qla_def.h, this data structure actually
> has mixed endianness, making me doubt that changing the endianness of
> the whole buffer makes sense at all. Or is ha->init_cb simply being
> abused in this part of the code?
> 
> I guess only Himanshu or Quinn can tell.

Hi Martin,

I will rework this patch such that this function again changes the
ha->init_cb buffer into big endian byte order.

Bart.

  parent reply	other threads:[~2019-12-15  0:12 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-09 18:02 [PATCH 0/4] qla2xxx patches for kernel v5.6 Bart Van Assche
2019-12-09 18:02 ` [PATCH 1/4] qla2xxx: Check locking assumptions at runtime in qla2x00_abort_srb() Bart Van Assche
2019-12-10 11:06   ` Martin Wilck
2019-12-10 19:39   ` Himanshu Madhani
2019-12-11 19:03   ` Roman Bolshakov
2019-12-09 18:02 ` [PATCH 2/4] qla2xxx: Simplify the code for aborting SCSI commands Bart Van Assche
2019-12-10 11:47   ` Martin Wilck
2019-12-10 17:57     ` Bart Van Assche
2019-12-10 20:29       ` Martin Wilck
2019-12-10 20:45         ` Bart Van Assche
2019-12-11 10:26           ` Martin Wilck
2019-12-12 16:01     ` Roman Bolshakov
2019-12-10 19:41   ` Himanshu Madhani
2019-12-12 16:04   ` Roman Bolshakov
2019-12-09 18:02 ` [PATCH 3/4] qla2xxx: Fix point-to-point mode for qla25xx and older Bart Van Assche
2019-12-10 10:52   ` Martin Wilck
2019-12-10 18:00     ` Bart Van Assche
2019-12-10 19:44       ` Martin Wilck
2019-12-12 20:07     ` Roman Bolshakov
2019-12-14  1:04       ` Roman Bolshakov
2019-12-15  0:09         ` Bart Van Assche
2019-12-16 11:45           ` Roman Bolshakov
2019-12-16 20:08             ` Roman Bolshakov
2019-12-16  8:37         ` Daniel Wagner
2019-12-10 19:40   ` Himanshu Madhani
2019-12-09 18:02 ` [PATCH 4/4] qla2xxx: Micro-optimize qla2x00_configure_local_loop() Bart Van Assche
2019-12-10 10:46   ` Martin Wilck
2019-12-14 12:30     ` Roman Bolshakov
2019-12-15  0:12     ` Bart Van Assche [this message]
2019-12-14 12:33   ` Roman Bolshakov
2019-12-15  0:14     ` Bart Van Assche
2020-02-06 13:23 ` [PATCH 0/4] qla2xxx patches for kernel v5.6 Martin Wilck
2020-02-06 20:49   ` Bart Van Assche
2020-02-06 20:52     ` Martin Wilck
2020-02-06 21:01       ` Bart Van Assche
2020-02-07  9:09         ` Martin Wilck
2020-02-08  3:17           ` Bart Van Assche

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=ee7fe321-956f-fe75-6a69-5cb1a0673046@acm.org \
    --to=bvanassche@acm.org \
    --cc=dwagner@suse.de \
    --cc=hmadhani@marvell.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mwilck@suse.com \
    --cc=mwilck@suse.de \
    --cc=qutran@marvell.com \
    --cc=r.bolshakov@yadro.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.