• Arnd Bergmann's avatar
    scsi: fc: use get/put_unaligned64 for wwn access · ef3fb242
    Arnd Bergmann authored
    A bug in the gcc-6.0 prerelease version caused at least one
    driver (lpfc) to have excessive stack usage when dealing with
    wwn data, on the ARM architecture.
    
    lpfc_scsi.c: In function 'lpfc_find_next_oas_lun':
    lpfc_scsi.c:117:1: warning: the frame size of 1152 bytes is larger than 1024 bytes [-Wframe-larger-than=]
    
    I have reported this as a gcc regression in
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70232
    
    However, using a better implementation of wwn_to_u64() not only
    helps with the particular gcc problem but also leads to better
    object code for any version or architecture.
    
    The kernel already provides get_unaligned_be64() and
    put_unaligned_be64() helper functions that provide an
    optimized implementation with the desired semantics.
    
    The lpfc_find_next_oas_lun() function in the example that
    grew from 1146 bytes to 5144 bytes when moving from gcc-5.3
    to gcc-6.0 is now 804 bytes, as the optimized
    get_unaligned_be64() load can be done in three instructions.
    The stack usage is now down to 28 bytes from 128 bytes with
    gcc-5.3 before.
    Signed-off-by: 's avatarArnd Bergmann <arnd@arndb.de>
    Reviewed-by: 's avatarHannes Reinicke <hare@suse.de>
    Reviewed-by: 's avatarEwan Milne <emilne@redhat.com>
    Signed-off-by: 's avatarMartin K. Petersen <martin.petersen@oracle.com>
    ef3fb242
Name
Last commit
Last update
..
fc Loading commit data...
fc_encode.h Loading commit data...
fc_frame.h Loading commit data...
fcoe_sysfs.h Loading commit data...
iscsi_if.h Loading commit data...
iscsi_proto.h Loading commit data...
iser.h Loading commit data...
libfc.h Loading commit data...
libfcoe.h Loading commit data...
libiscsi.h Loading commit data...
libiscsi_tcp.h Loading commit data...
libsas.h Loading commit data...
osd_attributes.h Loading commit data...
osd_initiator.h Loading commit data...
osd_ore.h Loading commit data...
osd_protocol.h Loading commit data...
osd_sec.h Loading commit data...
osd_sense.h Loading commit data...
osd_types.h Loading commit data...
sas.h Loading commit data...
sas_ata.h Loading commit data...
scsi.h Loading commit data...
scsi_bsg_iscsi.h Loading commit data...
scsi_cmnd.h Loading commit data...
scsi_common.h Loading commit data...
scsi_dbg.h Loading commit data...
scsi_device.h Loading commit data...
scsi_devinfo.h Loading commit data...
scsi_dh.h Loading commit data...
scsi_driver.h Loading commit data...
scsi_eh.h Loading commit data...
scsi_host.h Loading commit data...
scsi_ioctl.h Loading commit data...
scsi_proto.h Loading commit data...
scsi_tcq.h Loading commit data...
scsi_transport.h Loading commit data...
scsi_transport_fc.h Loading commit data...
scsi_transport_iscsi.h Loading commit data...
scsi_transport_sas.h Loading commit data...
scsi_transport_spi.h Loading commit data...
scsi_transport_srp.h Loading commit data...
scsicam.h Loading commit data...
sg.h Loading commit data...
srp.h Loading commit data...