Bug 568271

Summary: [QLogic 4.9 bug] qla2xxx: Fix srb cache destroy issue on driver unload and FDMI registration issue (8.02.10.01.04.09-d)
Product: Red Hat Enterprise Linux 4 Reporter: Lalit Chandivade <lalit.chandivade>
Component: kernelAssignee: Chad Dupuis (Cavium) <cdupuis>
Status: CLOSED ERRATA QA Contact: Storage QE <storage-qe>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.9CC: andrew.vasquez, andriusb, coughlan, revers
Target Milestone: alphaKeywords: OtherQA
Target Release: 4.9   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-02-16 15:32:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 583726, 589295, 626414    
Attachments:
Description Flags
Patch to fix cache destroy issue and FDMI
none
Fix cache destroy & FDMI registration
none
Updated version to 8.02.10.01.04.09-d
none
Snapshot of RHEL 4.9 qla2xxx sources on 4.20.2010
none
Update version to 8.02.10.01.04.09-d none

Description Lalit Chandivade 2010-02-25 09:05:17 UTC
Created attachment 396238 [details]
Patch to fix cache destroy issue and FDMI

Description of problem:
1. Fix kmem_destroy_cache issue.

In IOCTL path mempool is used and not freed.
This causes following issue
Apr 22 23:06:54 localhost kernel: slab error in kmem_cache_destroy(): cache `qla2xxx_srbs': Can't free all objects
Apr 22 23:06:54 localhost kernel:
Apr 22 23:06:54 localhost kernel: Call Trace:<ffffffff801646e7>{kmem_cache_destroy+202} <ffffffffa004f5df>{:qla2xxx:qla2x00_module_exit+19}
Apr 22 23:06:54 localhost kernel:        <ffffffff8014f9f3>{sys_delete_module+487} <ffffffff80110e21>{error_exit+0}
Apr 22 23:06:55 localhost kernel:        <ffffffff801102f6>{system_call+126}
Apr 22 23:06:55 localhost kernel: qla2xxx: Unable to free SRB cache...Memory pools still active?

The reason is memory from mempool is allocated in function qim_ioctl_ms_queuecommand and is never
freed. Since this function is not fully incorporated return from this function as success .

2.Correct number of attribute passed in RHBA.

With incorrect number of attribute passed the switch
rejects the RHBA with following explanation code
“Invalid HBA Attribute Block Length”

3. Updated the driver version for 4.9 release to 8.02.09.00.04.09-d


How reproducible:
1. Load the driver, run QLogic SANsurfer. Close SANsurfer and unload the driver.
2. Load the module with ql2xfdmienable=1 and check FDMI on switch GUI



Actual results:
- Stack trace on driver unload
- Vendor information not visible on switch side.

Expected results:
- On unload  stack trace related to srb caches should not occur.
- If ql2xfdmienable is set to 1 then vendor information on switch FDMI page should be visible.

Comment 1 Rob Evers 2010-04-20 07:51:23 UTC
After reviewing the patch, the hunk below needs some explanation as to why simply returning from a function with QIM_SUCCESS is an acceptable solution to this problem.  If this turns out to be the correct solution after re-review by qlogic, please cleanup the function to eliminate all the un-needed code.

@@ -3871,6 +3871,8 @@ qim_ioctl_ms_queuecommand(struct qla_host_ioctl *ha, EXT_IOCTL *pext,
 	struct scsi_qla_host	*dr_ha = ha->dr_data;
 
 
+	return QIM_SUCCESS;
+
 	/* alloc sp */
 	if ((sp = qim_get_new_sp(dr_ha)) == NULL) {
 
Leaving this status as conditional nak pending more information from qlogic.  Reassigning to Chad Dupuis.

Comment 2 Lalit Chandivade 2010-04-20 10:41:43 UTC
Created attachment 407784 [details]
Fix cache destroy & FDMI registration

Removed the function qim_ioctl_ms_queuecommand as it is not completely implemented. Also removed other functions that were using qim_ioctl_ms_queuecommand function.

Comment 3 Lalit Chandivade 2010-04-20 10:43:50 UTC
Created attachment 407785 [details]
Updated version to 8.02.10.01.04.09-d

Updated version to 8.02.10.01.04.09-d

Comment 4 Chad Dupuis (Cavium) 2010-04-20 13:29:43 UTC
Lalit,

The patches that you submitted last night can be laid on top of the current RHEL 4.8 sources?

Thanks,
Chad

Comment 5 Lalit Chandivade 2010-04-20 13:46:58 UTC
(In reply to comment #4)
> Lalit,
> The patches that you submitted last night can be laid on top of the current
> RHEL 4.8 sources?
> Thanks,
> Chad    

Yes, the patches are on top of RHEL 4.8 qla2xxx driver source.

Comment 7 Chad Dupuis (Cavium) 2010-04-20 20:09:40 UTC
Created attachment 407917 [details]
Snapshot of RHEL 4.9 qla2xxx sources on 4.20.2010

Comment 8 Chad Dupuis (Cavium) 2010-04-20 20:12:11 UTC
Lalit,

My apologies, but can you regen your patches on the qla2xxx sources I just submitted?  These are the latest RHEL 4.9 sources which differ slightly from the RHEL 4.8 sources.

Thanks,
Chad

Comment 9 Lalit Chandivade 2010-04-21 04:37:47 UTC
Created attachment 407977 [details]
Update version to 8.02.10.01.04.09-d

All the patches apply to current qla2xxx source in 4.9 kernel.

Comment 10 Vivek Goyal 2010-09-13 20:21:54 UTC
Committed in 89.34.EL . RPMS are available at http://people.redhat.com/vgoyal/rhel4/

Comment 14 errata-xmlrpc 2011-02-16 15:32:22 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0263.html