lpfc: lower stack use in lpfc_fc_frame_check
Subsystems (2)
PATCH 1/1 lpfc: lower stack use in lpfc_fc_frame_check
Hi,
according to checkstack the lpfc_fc_frame_check occupies the first place in stack usage:
make checkstack
objdump -d vmlinux $(find . -name '*.ko') | \ perl /root/rpmbuild/BUILD/kernel-2.6.32/linux-2.6.32.x86_64/scripts/checkstack.pl x86_64
0x000013f4 lpfc_fc_frame_check [lpfc]: 1936
...
This change makes the rctl_names static, thus not on stack.
Tomas
Signed-off-by Tomas Henzl <[email protected]>
drivers/scsi/lpfc/lpfc_sli.c +2 -1
@@ -11578,7 +11578,8 @@ lpfc_sli4_post_scsi_sgl_block(struct lpfc_hba *phba, struct list_head *sblist,static int lpfc_fc_frame_check (struct lpfc_hba *phba,struct fc_frame_header *fc_hdr) { -char *rctl_names[] =FC_RCTL_NAMES_INIT ; +/* make rctl_names static to save stack space */ +static char *rctl_names[] =FC_RCTL_NAMES_INIT ;char *type_names[] =FC_TYPE_NAMES_INIT ;struct fc_vft_header *fc_vft_hdr;
Tomas,
Thank you.
Acked-by James Smart <[email protected]>
-- james s
Quoted 33 lines · Tomas Henzl
Hi,
according to checkstack thelpfc_fc_frame_checkoccupies the first place in stack usage:
make checkstackobjdump -d vmlinux $(find . -name '*.ko') | \ perl /root/rpmbuild/BUILD/kernel-2.6.32/linux-2.6.32.x86_64/scripts/checkstack.pl x86_64
0x000013f4lpfc_fc_frame_check[lpfc]: 1936
...
This change makes therctl_namesstatic, thus not on stack.Tomas
Signed-off-by Tomas Henzl<[email protected]>drivers/scsi/lpfc/lpfc_sli.c +2
-1@@ -11578,7 +11578,8 @@ lpfc_sli4_post_scsi_sgl_block(struct lpfc_hba *phba, struct list_head *sblist,static int lpfc_fc_frame_check (struct lpfc_hba *phba,struct fc_frame_header *fc_hdr) { -char *rctl_names[] =FC_RCTL_NAMES_INIT ; +/* make rctl_names static to save stack space */ +static char *rctl_names[] =FC_RCTL_NAMES_INIT ;char *type_names[] =FC_TYPE_NAMES_INIT ;struct fc_vft_header *fc_vft_hdr;