summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [SCSI] scsi: Add osd library to build systemBoaz Harrosh2009-03-123-0/+14
| | | | | | | | | | | | OSD in kernel source code is assumed to be at: drivers/scsi/osd/ with its own Makefile and Kconfig Add includes to them from drivers/scsi Makefile and Kconfig Add OSD to MAINTAINERS file Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Reviewed-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] osd: Kconfig file for in-tree buildsBoaz Harrosh2009-03-121-0/+53
| | | | | | | | | | | | | Kconfig file for the drivers/scsi/osd subdirectory. Adds the following config items: config SCSI_OSD_INITIATOR config SCSI_OSD_ULD config SCSI_OSD_DPRINT_SENSE config SCSI_OSD_DEBUG Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Reviewed-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] osd: Documentation for OSD libraryBoaz Harrosh2009-03-121-0/+198
| | | | | | | | Add osd.txt to Documentation/scsi/ Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Reviewed-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] libosd: SCSI/OSD Sense decoding supportBoaz Harrosh2009-03-124-0/+506
| | | | | | | | | | | | | | | | Implementation of the osd_req_decode_sense() API. Can be called by library users to decode what failed in command executions. Add SCSI_OSD_DPRINT_SENSE Kconfig variable. Possible values are: 0 - Do not print any errors to messages file <KERN_ERR> 1 - (Default) Print only decoded errors that are not recoverable. Recoverable errors are those that the target has complied with the request but with a warning. For example read passed end of object will return zeros after the last valid byte. 2- Print all errors. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] libosd: OSDv2 auto detectionBoaz Harrosh2009-03-123-0/+133
| | | | | | | | | | | | | Auto detect an OSDv2 or OSDv1 target at run time. Note how none of the OSD API calls change. The tests do not know what device version it is. This test now passes against both the IBM-OSD-SIM OSD1 target as well as OSC's OSD2 target. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Reviewed-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] libosd: OSD version 2 SupportBoaz Harrosh2009-03-123-18/+205
| | | | | | | | | | | Add support for OSD2 at run time. It is now possible to run with both OSDv1 and OSDv2 targets at the same time. The actual detection should be preformed by the security manager, as the version is encoded in the capability structure. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Reviewed-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] libosd: Not implemented commandsBoaz Harrosh2009-03-121-0/+35
| | | | | | | | | Some commands declared in header are not yet implemented. Put them as stubs in .c file, just so they take their place in the file Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Reviewed-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] libosd: Add Flush and List-objects supportBoaz Harrosh2009-03-121-0/+124
| | | | | | | | | | | | Add support for the various List-objects commands. List-partitions-in-device, List-collections-in-partition, List-objects-in-partition, List-objects-in-collection. All these support partial listing and continuation. Add support for the different Flush commands and options. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Reviewed-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] libosd: OSD Security processing stubsBoaz Harrosh2009-03-121-0/+86
| | | | | | | | | | Layout the signing of OSD's CDB and all-data security modes. The actual code for signing the data and CDB is missing, but the code flow and the extra buffer segments are all in place. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Reviewed-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] libosd: attributes SupportBoaz Harrosh2009-03-122-0/+906
| | | | | | | | | | | | Support for both List-Mode and Page-Mode osd attributes. One of these operations may be added to most other operations. Define the OSD standard's attribute pages constants and structures (osd_attributes.h) Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Reviewed-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] osd_uld: API for retrieving osd devices from KernelBoaz Harrosh2009-03-122-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kernel clients like exofs can retrieve struct osd_dev(s) by means of below API. + osduld_path_lookup() - given a path (e.g "/dev/osd0") locks and returns the corresponding struct osd_dev, which is then needed for subsequent libosd use. + osduld_put_device() - free up use of an osd_dev. Devices can be shared by multiple clients. The osd_uld_device's life time is governed by an embedded kref structure. The osd_uld_device holds an extra reference to both it's char-device and it's scsi_device, and will release these just before the final deallocation. There are three possible lock sources of the osd_uld_device 1. First and for most is the probe() function called by scsi-ml upon a successful login into a target. Released in release() when logout. 2. Second by user-mode file handles opened on the char-dev. 3. Third is here by Kernel users. All three locks must be removed before the osd_uld_device is freed. The MODULE has three lock sources as well: 1. scsi-ml at probe() time, removed after release(). (login/logout) 2. The user-mode file handles open/close. 3. Import symbols by client modules like exofs. TODO: This API is not enough for the pNFS-objects LD. A more versatile API will be needed. Proposed API could be: struct osd_dev *osduld_sysid_lookup(const char id[OSD_SYSTEMID_LEN]); Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] osd_uld: OSD scsi ULDBoaz Harrosh2009-03-123-0/+432
| | | | | | | | | | | | | Add a Linux driver module that registers as a SCSI ULD and probes for OSD type SCSI devices. When an OSD-type SCSI device is found a character device is created in the form of /dev/osdX - where X goes from 0 up to hard coded 64. The Major character device number used is 260. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Reviewed-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] libosd: OSDv1 preliminary implementationBoaz Harrosh2009-03-124-0/+547
| | | | | | | | | | | | | | | Implementation of the most basic OSD functionality and infrastructure. Mainly Format, Create/Remove Partition, Create/Remove Object, and read/write. - Add Makefile and Kbuild to compile libosd.ko - osd_initiator.c Implementation file for osd_initiator.h and osd_sec.h APIs - osd_debug.h - Some kprintf macro definitions Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Reviewed-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] libosd: OSDv1 HeadersBoaz Harrosh2009-03-124-0/+914
| | | | | | | | | | | | | | | | | | | | Headers only patch. osd_protocol.h Contains a C-fied definition of the T10 OSD standard osd_types.h Contains CPU order common used types osd_initiator.h API definition of the osd_initiator library osd_sec.h Contains High level API for the security manager. [Note that checkpatch spews errors on things that are valid in this context and will not be fixed] Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Reviewed-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] add OSD_TYPEBoaz Harrosh2009-03-122-0/+2
| | | | | | | - Define the OSD_TYPE scsi device and let it show up in scans Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] major.h: char-major number for OSD device driverBoaz Harrosh2009-03-122-0/+7
| | | | | | | | Allocate major 260 for osd. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> CC: Torben Mathiasen <device@lanana.org> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] sg: fix races with ioctl(SG_IO)Tony Battersby2009-03-121-25/+14Star
| | | | | | | | | | | | | | | | | | | | sg_io_owned needs to be set before the command is sent to the midlevel; otherwise, a quickly-completing command may cause a different CPU to see "srp->done == 1 && !srp->sg_io_owned", which would lead to incorrect behavior. Check srp->done and set srp->orphan while holding rq_list_lock to prevent races with sg_rq_end_io(). There is no need to check sfp->closed from read/write/ioctl/poll/etc. since the kernel guarantees that this won't happen. The usefulness of sg_srp_done() was questionable before; now it is definitely not needed. Signed-off-by: Tony Battersby <tonyb@cybernetics.com> Acked-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] sg: fix races during device removalTony Battersby2009-03-121-217/+201Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sg has the following problems related to device removal: * opening a sg fd races with removing a device * closing a sg fd races with removing a device * /proc/scsi/sg/* access races with removing a device * command completion races with removing a device * command completion races with closing a sg fd * can rmmod sg with active commands These problems can cause kernel oopses, memory-use-after-free, or double-free errors. This patch fixes these problems by using krefs to manage the lifetime of sg_device and sg_fd. Each command submitted to the midlevel holds a reference to sg_fd until the completion callback. This ensures that sg_fd doesn't go away if the fd is closed with commands still outstanding. sg_fd gets the reference of sg_device (with scsi_device) and also makes sure that the sg module doesn't go away. /proc/scsi/sg/* functions don't play nicely with krefs because they give information about sg_fds which have been closed but not yet freed due to still having outstanding commands and sg_devices which have been removed but not yet freed due to still being referenced by one or more sg_fds. To deal with this safely without removing functionality, /proc functions now access sg_device and sg_fd while holding a lock instead of using kref_get()/kref_put(). Signed-off-by: Tony Battersby <tonyb@cybernetics.com> Acked-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] stex: Version updateEd Lin - PTU2009-03-121-3/+3
| | | | | | | Update version to 4.6.0000.1 Signed-off-by: Ed Lin <ed.lin@promise.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] stex: Small fixesEd Lin - PTU2009-03-121-6/+22
| | | | | | | | | | | | Some small fixes, including: - add data direction in req_msg because new firmware version may require this (backward compatible) - change internal timeout value - change judgment of type st_vsc1 - blank line handling, etc. Signed-off-by: Ed Lin <ed.lin@promise.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] stex: Fix for controller type st_yosemiteEd Lin - PTU2009-03-121-61/+3Star
| | | | | | | | | | This is the fix for controller type st_yosemite, including - max_lun is 256 (backward compatible) - remove unneeded special handling of INQUIRY - remove unnecessary listing of sub device ids Signed-off-by: Ed Lin <ed.lin@promise.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] stex: Add new device idEd Lin - PTU2009-03-121-2/+6
| | | | | | | Add new device id for controller type st_seq. Signed-off-by: Ed Lin <ed.lin@promise.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] stex: Fix for potential invalid responseEd Lin - PTU2009-03-121-0/+1
| | | | | | | | | | | The interrupt routine is good for normal cases. However, if the firmware is abnormal and returns an invalid response, the driver may reuse a ccb structure that has already been handled. This may cause problem. Fix this by setting the req member to NULL. Next time we know the response is invalid and handle accordingly if req is NULL. Signed-off-by: Ed Lin <ed.lin@promise.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] osst: Remove SUGGEST flagsJames Bottomley2009-03-121-2/+2
| | | | | | | | | | | | Fix up remaining bit of SUGGEST flag removal done by patch commit 0f10274300857d98ea5ea4c800c561a9ad9ac89f Author: Martin K. Petersen <martin.petersen@oracle.com> Date: Sun Jan 4 03:14:11 2009 -0500 [SCSI] Remove SUGGEST flags Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] Remove SUGGEST flagsMartin K. Petersen2009-03-129-36/+15Star
| | | | | | | | | The SUGGEST_* flags in the SCSI command result have been out of fashion for a while and we don't actually use them in the error handling. Remove the remaining occurrences. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] ipr: add MSI supportWayne Boyer2009-03-122-2/+9
| | | | | | | | Enable MSI if available/supported. Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com> Acked-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] scsi_transport_fc: Add missing parenthesis to Point-To-Point descriptionChristof Schmitt2009-03-121-1/+1
| | | | | | | Fix typo by adding closing parenthesis. Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] sym53c8xx: Keep transfer negotiations validAaro Koskinen2009-03-122-9/+27
| | | | | | | | | | | | | | | | | | | (The patch updated based on testing and comments from Tony Battersby.) Change the sym53c8xx_2 driver negotiation logic so that the driver will tolerate better device removals. Negotiation message(s) will be sent with every INQUIRY and REQUEST SENSE command, and whenever there is a change in goals or when the device reports check condition. The patch was made specifically to address the case where you hotswap the disk using remove-single-device/add-single-device commands through /proc/scsi/scsi. Without the patch the driver keeps using old transfer parameters even though the target is reset and reports check condition, so the data transfer of the very first INQUIRY will fail. Signed-off-by: Aaro Koskinen <Aaro.Koskinen@nokia.com> Tested-by: Tony Battersby <tonyb@cybernetics.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] Improve SCSI_LOGGING Kconfig entryRobert Love2009-03-121-6/+7
| | | | | | | | | | | | | | | The Kconfig entry for SCSI_LOGGING refers the reader to drivers/scsi/scsi.c, but I didn't find any useful information there. There is certainly logging code in that file, but the logging types and logging levels are described in drivers/scsi/scsi_logging.h. Also, the procfs file referred to in the section is incorrect. It should be /proc/sys/dev/scsi/logging_level and not /proc/scsi/scsi. Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] Check for deleted device in scsi_device_online()Hannes Reinecke2009-03-121-1/+2
| | | | | | | | scsi_device_online() is not just a negation of SDEV_OFFLINE, also devices in state SDEV_DEL are actually offline. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] lpfc: constify virtual function tablesJan Engelhardt2009-03-121-8/+8
| | | | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Acked-by: James Smart <James.Smart@Emulex.Com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] libfc: fix compile warningFUJITA Tomonori2009-03-122-3/+4
| | | | | | | | | | | | | | I got the following warnings on IA64: drivers/scsi/libfc/fc_lport.c: In function 'fc_lport_recv_flogi_req': drivers/scsi/libfc/fc_lport.c:788: warning: format '%llx' expects type 'long long unsigned int', but argument 3 has type 'u64' drivers/scsi/libfc/fc_lport.c:792: warning: format '%llx' expects type 'long long unsigned int', but argument 3 has type 'u64' scsi/libfc/fc_rport.c: In function 'fc_rport_recv_plogi_req': /home/fujita/git/linux-2.6/drivers/scsi/libfc/fc_rport.c:968: warning: format '%llx' expects type 'long long unsigned int', but argument 4 has type 'u64' Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] libfc: needs CRC32Randy Dunlap2009-03-121-0/+1
| | | | | | | | | | | | | | | | libfc uses crc32 functions, so cause it to be built via select: drivers/built-in.o: In function `fc_frame_crc_check': (.text+0x75dae): undefined reference to `crc32_le' drivers/built-in.o: In function `fc_fcp_recv': fc_fcp.c:(.text+0x7b919): undefined reference to `crc32_le' fc_fcp.c:(.text+0x7b9d5): undefined reference to `crc32_le' fc_fcp.c:(.text+0x7ba54): undefined reference to `crc32_le' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] scsi_debug: needs CRC_T10DIFRandy Dunlap2009-03-121-0/+1
| | | | | | | | | | | | Fix scsi_debug build error: drivers/built-in.o: In function `resp_read': scsi_debug.c:(.text+0x21379a): undefined reference to `crc_t10dif' drivers/built-in.o: In function `resp_write': scsi_debug.c:(.text+0x213fca): undefined reference to `crc_t10dif' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] scsi_debug: DIF/DIX supportMartin K. Petersen2009-03-121-7/+436
| | | | | | | | | | | | | | | | | | | | | | This patch adds support for DIX and DIF in scsi_debug. A separate buffer is allocated for the protection information. - The dix parameter indicates whether the controller supports DIX (protection information DMA) - The dif parameter indicates whether the simulated storage device supports DIF - The guard parameter switches between T10 CRC(0) and IP checksum(1) - The ato parameter indicates whether the application tag is owned by the disk(0) or the OS(1) - DIF and DIX errors can be triggered using the scsi_debug_opts mask Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Acked-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] scsi_sysfs: delete extra kernel-docRandy Dunlap2009-03-121-1/+0Star
| | | | | | | Warning(linux-2.6.28-git13//drivers/scsi/scsi_sysfs.c:1049): Excess function parameter 'dev' description in 'scsi_sysfs_add_host' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] ses: Use new scsi VPD helperMatthew Wilcox2009-03-121-27/+4Star
| | | | | | | | SES had its own code to retrieve VPD from devices; convert it to use the new scsi_get_vpd_page helper. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] Add VPD helperMatthew Wilcox2009-03-122-0/+105
| | | | | | | | Based on prior work by Martin Petersen and James Bottomley, this patch adds a generic helper for retrieving VPD pages from SCSI devices. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] qla2xxx: Update version number to 8.03.00-k4.Andrew Vasquez2009-03-101-1/+1
| | | | | Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] qla2xxx: Correct overwrite of pre-assigned init-control-block ↵Andrew Vasquez2009-03-101-4/+0Star
| | | | | | | | | structure size. The value is already pre-assigned prior to the qla2x00_mem_alloc(). Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] qla2xxx: Correct truncation in return-code status checking.Andrew Vasquez2009-03-102-2/+2
| | | | | | | | | | QLA_* return codes are 'int' in size. There were still several legacy check-points which assumed a return-code width of 8-bits. This could cause incorrect assumptions of 'good' status if a return of QLA_FUNCTION_TIMEOUT. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] qla2xxx: Correct vport delete bug.Anirban Chakraborty2009-03-103-9/+15
| | | | | Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] qla2xxx: Use correct value for max vport in LOOP topology.Lalit Chandivade2009-03-101-1/+5
| | | | | | | | | | Use minimum value for max vport during firmware initialization in LOOP topology. Using max vport value from get resource count in LOOP topology causes firmware initialization failure. Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] qla2xxx: Correct address range checking for option-rom updates.Andrew Vasquez2009-03-101-8/+1Star
| | | | | Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] fcoe: Change fcoe receive thread nice value from 19 (lowest priority) ↵Robert Love2009-03-101-1/+1
| | | | | | | | | | to -20 This change makes the fcoe Rx threads have the same nice value as lpfc and qla2xxx Rx threads. Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] fcoe: fix handling of pending queue, prevent out of order frames (v3)Chris Leech2009-03-101-57/+24Star
| | | | | | | | | | | | | | | | | | | | In fcoe_check_wait_queue() the queue length could temporarily drop to 0, before the last frame was successfully sent. This resulted in out of order data frames within a single sequence, leading to IO timeout errors. This builds on the approach from Vasu Dev to only fix the queue management in fcoe_check_wait_queue, where my first patch added locking to the transmit path even when the pending queue was not in use. This patch continues to use fcoe_pending_queue.qlen instead of introducing a new length counter, but takes precautions to ensure it never drops to 0 before the final frame in the queue has successfully been passed to the netdev qdisc layer. It also includes some cleanup of fcoe_check_wait_queue and removes the fcoe_insert_wait_queue(_head) wrapper functions. Signed-off-by: Chris Leech <christopher.leech@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] fcoe: Out of order tx frames was causing several check condition SCSI ↵Vasu Dev2009-03-103-24/+23Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | status frames followed by these errors in log. [sdp] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE,SUGGEST_OK [sdp] Sense Key : Aborted Command [current] [sdp] Add. Sense: Data phase error This was causing some test apps to exit due to write failure under heavy load. This was due to a race around adding and removing tx frame skb in fcoe_pending_queue, Chris Leech helped me to find that brief unlocking period when pulling skb from fcoe_pending_queue in various contexts (fcoe_watchdog and fcoe_xmit) and then adding skb back into fcoe_pending_queue up on a failed fcoe_start_io could change skb/tx frame order in fcoe_pending_queue. Thanks Chris. This patch allows only single context to pull skb from fcoe_pending_queue at any time to prevent above described ordering issue/race by use of fcoe_pending_queue_active flag. This patch simplified fcoe_watchdog with modified fcoe_check_wait_queue by use of FCOE_LOW_QUEUE_DEPTH instead previously used several conditionals to clear and set lp->qfull. I think FCOE_MAX_QUEUE_DEPTH with FCOE_LOW_QUEUE_DEPTH will work better in re/setting lp->qfull and these could be fine tuned for performance. Signed-off-by: Vasu Dev <vasu.dev@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] fcoe: fix kfree(skb)Roel Kluin2009-03-101-1/+1
| | | | | | | | Use kfree_skb instead of kfree for struct sk_buff pointers. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] fcoe: ETH_P_8021Q is already in if_ether and fcoe is not using it anywayYi Zou2009-03-101-4/+0Star
| | | | | | Signed-off-by: Yi Zou <yi.zou@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] libfc: do not change the fh_rx_id of a recevied frameYi Zou2009-03-101-13/+0Star
| | | | | | | | We shouldn't be altering inbound frames. Signed-off-by: Yi Zou <yi.zou@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>