aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bnx2i
Commit message (Collapse)AuthorAgeFilesLines
* SCSI: bnx2i: Fixed NULL ptr deference for 1G bnx2 Linux iSCSI offloadEddie Wai2012-10-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit d6532207116307eb7ecbfa7b9e02c53230096a50 upstream. This patch fixes the following kernel panic invoked by uninitialized fields in the chip initialization for the 1G bnx2 iSCSI offload. One of the bits in the chip initialization is being used by the latest firmware to control overflow packets. When this control bit gets enabled erroneously, it would ultimately result in a bad packet placement which would cause the bnx2 driver to dereference a NULL ptr in the placement handler. This can happen under certain stress I/O environment under the Linux iSCSI offload operation. This change only affects Broadcom's 5709 chipset. Unable to handle kernel NULL pointer dereference at 0000000000000008 RIP: [<ffffffff881f0e7d>] :bnx2:bnx2_poll_work+0xd0d/0x13c5 Pid: 0, comm: swapper Tainted: G ---- 2.6.18-333.el5debug #2 RIP: 0010:[<ffffffff881f0e7d>] [<ffffffff881f0e7d>] :bnx2:bnx2_poll_work+0xd0d/0x13c5 RSP: 0018:ffff8101b575bd50 EFLAGS: 00010216 RAX: 0000000000000005 RBX: ffff81007c5fb180 RCX: 0000000000000000 RDX: 0000000000000ffc RSI: 00000000817e8000 RDI: 0000000000000220 RBP: ffff81015bbd7ec0 R08: ffff8100817e9000 R09: 0000000000000000 R10: ffff81007c5fb180 R11: 00000000000000c8 R12: 000000007a25a010 R13: 0000000000000000 R14: 0000000000000005 R15: ffff810159f80558 FS: 0000000000000000(0000) GS:ffff8101afebc240(0000) knlGS:0000000000000000 CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b CR2: 0000000000000008 CR3: 0000000000201000 CR4: 00000000000006a0 Process swapper (pid: 0, threadinfo ffff8101b5754000, task ffff8101afebd820) Stack: 000000000000000b ffff810159f80000 0000000000000040 ffff810159f80520 ffff810159f80500 00cf00cf8008e84b ffffc200100939e0 ffff810009035b20 0000502900000000 000000be00000001 ffff8100817e7810 00d08101b575bea8 Call Trace: <IRQ> [<ffffffff8008e0d0>] show_schedstat+0x1c2/0x25b [<ffffffff881f1886>] :bnx2:bnx2_poll+0xf6/0x231 [<ffffffff8000c9b9>] net_rx_action+0xac/0x1b1 [<ffffffff800125a0>] __do_softirq+0x89/0x133 [<ffffffff8005e30c>] call_softirq+0x1c/0x28 [<ffffffff8006d5de>] do_softirq+0x2c/0x7d [<ffffffff8006d46e>] do_IRQ+0xee/0xf7 [<ffffffff8005d625>] ret_from_intr+0x0/0xa <EOI> [<ffffffff801a5780>] acpi_processor_idle_simple+0x1c5/0x341 [<ffffffff801a573d>] acpi_processor_idle_simple+0x182/0x341 [<ffffffff801a55bb>] acpi_processor_idle_simple+0x0/0x341 [<ffffffff80049560>] cpu_idle+0x95/0xb8 [<ffffffff80078b1c>] start_secondary+0x479/0x488 Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* [SCSI] bnx2i: Optimized the iSCSI offload performanceEddie Wai2011-05-243-19/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modified the event coalescing code for iSCSI offload to combat both corner cases and optimize performance as follows: 1. Added mechanism to loop back a second time to process any leftover CQEs that was generated by the hardware during the time the driver is busy processing previous CQEs in the bh. This not only helps the performance but also fixes the corner case when no more CQEs are being generated in the pipeline; so those leftover CQEs will get a a chance to be processed. 2. Added ARM_CQE_FP to distinguish between fast path arming versus slow path arming. This change will guarantee that the CQEs will always get a chance to be re-armed during fast path completions. 3. Removed the inline event coalescing division for perf optimization. Also fixed a division-by-zero error when the event_coal_div module param was set to 0. 4. Changed the default SQ WQEs size from 256 to 128 to match chip default. 5. Changed the cmd_per_lun from 32 to 24. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <jbottomley@parallels.com>
* [SCSI] bnx2i: Updated the connection shutdown/cleanup timeoutEddie Wai2011-05-242-2/+2
| | | | | | | | | | | Modified the 10s wait time for inflight offload connections to advance to the next state to 2s based on test result. Modified the 20s shutdown timeout to 30s based on test result. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Cc: stable@kernel.org Signed-off-by: James Bottomley <jbottomley@parallels.com>
* [SCSI] bnx2i: Fixed packet error created when the sq_size is set to 16Eddie Wai2011-05-242-0/+4
| | | | | | | | | | | | | | The number of chip's internal command cell, which is use to generate SCSI cmd packets to the target, was not initialized correctly by the driver when the sq_size is changed from the default 128. This, in turn, will create a problem where the chip's transmit pipe will erroneously reuse an old command cell that is no longer valid. The fix is to correctly initialize the chip's command cell upon setup. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Cc: stable@kernel.org Signed-off-by: James Bottomley <jbottomley@parallels.com>
* Fix common misspellingsLucas De Marchi2011-03-311-1/+1
| | | | | | Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
* [SCSI] bnx2i: fix null ptr ref in conn get paramMike Christie2011-02-241-23/+22
| | | | | | | | | | | | | | | | | | bnx2i has some checks to try and make sure the ep is not destroyed while the addr/port is getting read. However, if after this check: if (!(bnx2i_conn && bnx2i_conn->ep && bnx2i_conn->ep->hba)) goto out; bnx2i_conn->ep is cleared by ep_disconnect then we will oops. This patches fixes the problem by having the driver use the get_ep_param callback instead of get_conn_param. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] bnx2i: Updated to version 2.6.2.3Eddie Wai2011-02-241-2/+2
| | | | | | Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] bnx2i: Added iSCSI text pdu support for iSCSI offloadEddie Wai2011-02-243-1/+123
| | | | | | | | | This is part of an effort to support send target discovery via the iSCSI offload path. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] bnx2i: Added jumbo MTU support for the no shost caseEddie Wai2011-02-241-1/+1
| | | | | | | | | | | | For scenarios where the shost is not being passed to bnx2i for the iSCSI offload connection request, the code would consult the routing table to select the CNIC device. This code path will erroneously error out if the corresponding L2 interface's MTU has been setup to > 1500. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] bnx2i: Added support for the 57712(E) devicesEddie Wai2011-02-241-4/+6
| | | | | | | | | | Moved all PCI_DEVICE_ID_NX2_57712(E) definitions to pci_ids.h Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Acked-by: Michael Chan <mchan@broadcom.com> Acked-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] bnx2i: Added handling for unsupported iSCSI offload hbaEddie Wai2011-02-241-0/+15
| | | | | | | | | The hba will now be unregistered and freed when iSCSI offload is not supported by the NIC. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] bnx2i: Fixed the 32-bit swapping of the LUN field for nopouts for 5771XEddie Wai2011-02-241-3/+3
| | | | | | | | | Fixed a bug where the 64-bit LUN field for nopouts were 32-bit swapped. This only pertains to 5771X devices. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] bnx2i: Allow ep CONNECT_FAILED condition to go through proper cleanupEddie Wai2011-02-241-1/+1
| | | | | | | | | | Allow CNIC to go through the proper cleanup procedure for an endpoint which failed to connect. Proper cleanup is necessary for the chip to reset back to the initial state for the offloaded endpoint. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] bnx2i: Added reconnect fix connecting against Lefthand targetsEddie Wai2011-01-241-0/+3
| | | | | | | | | | | The nopout's reserved field was not being initialized to zero before being reused. Stale CDB values from previous SCSI cmds of the same BHS offset was the cause of the disconnection initiated by the Lefthand target. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6Linus Torvalds2011-01-077-181/+195
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (147 commits) [SCSI] arcmsr: fix write to device check [SCSI] lpfc: lower stack use in lpfc_fc_frame_check [SCSI] eliminate an unnecessary local variable from scsi_remove_target() [SCSI] libiscsi: use bh locking instead of irq with session lock [SCSI] libiscsi: do not take host lock in queuecommand [SCSI] be2iscsi: fix null ptr when accessing task hdr [SCSI] be2iscsi: fix gfp use in alloc_pdu [SCSI] libiscsi: add more informative failure message during iscsi scsi eh [SCSI] gdth: Add missing call to gdth_ioctl_free [SCSI] bfa: remove unused defintions and misc cleanups [SCSI] bfa: remove inactive functions [SCSI] bfa: replace bfa_assert with WARN_ON [SCSI] qla2xxx: Use sg_next to fetch next sg element while walking sg list. [SCSI] qla2xxx: Fix to avoid recursive lock failure during BSG timeout. [SCSI] qla2xxx: Remove code to not reset ISP82xx on failure. [SCSI] qla2xxx: Display mailbox register 4 during 8012 AEN for ISP82XX parts. [SCSI] qla2xxx: Don't perform a BIG_HAMMER if Get-ID (0x20) mailbox command fails on CNAs. [SCSI] qla2xxx: Remove redundant module parameter permission bits [SCSI] qla2xxx: Add sysfs node for displaying board temperature. [SCSI] qla2xxx: Code cleanup to remove unwanted comments and code. ...
| * [SCSI] bnx2i: Updated version to 2.6.2.2Eddie Wai2010-12-211-2/+2
| | | | | | | | | | Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
| * [SCSI] bnx2i: Updated copyright and maintainer infoEddie Wai2010-12-217-7/+14
| | | | | | | | | | Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
| * [SCSI] bnx2i: Cleaned up various error conditions in ep_connect/disconnectEddie Wai2010-12-211-27/+40
| | | | | | | | | | | | | | | | | | | | | | Various error conditions inside ep_connect and ep_disconnect were either not being handled or not being handled correctly. This patch fixes all those issues. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
| * [SCSI] bnx2i: Added return code check for chip kwqe submission requestEddie Wai2010-12-213-20/+60
| | | | | | | | | | | | | | | | | | | | | | | | Added the handling for cases when a chip request is made to the CNIC module but the hardware is not ready to accept. This would lead to many unnecessary wait timeouts. This code adds check in the connect establishment and destruction path. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
| * [SCSI] bnx2i: Modified the bnx2i stop path to compensate for in progress opsEddie Wai2010-12-212-5/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The stop path has been augmented to wait a max of 10s for all in progress offload and destroy activities to complete before proceeding to terminate all active connections (via iscsid or forcefully). Note that any new offload and destroy requests are now blocked and return to the caller immediately. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
| * [SCSI] bnx2i: Removed the dynamic registration of CNICEddie Wai2010-12-213-92/+0
| | | | | | | | | | | | | | | | | | | | | | The code no longer needs to dynamically register and unregister the CNIC device. The CNIC device will be kept registered until module unload. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
| * [SCSI] bnx2i: Added mutex lock protection to conn_get_paramEddie Wai2010-12-211-3/+10
| | | | | | | | | | | | | | | | | | | | Added net_dev mutex lock protection before accessing the csk parameters. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
| * [SCSI] bnx2i: Allow to abort the connection if connect request times outEddie Wai2010-12-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In the situation where the connect completion response arrives after the connect request has already timed out, the connection was not being aborted but only the resource was being freed. This creates a problem for 5771X (10g) as the chip flags this with an assertion. This change will properly aborts the connection before freeing the resource. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
| * [SCSI] bnx2i: Fixed the remote TCP RST handling for the 570X (1g)Eddie Wai2010-12-212-7/+9
| | | | | | | | | | | | | | | | | | Modified the handling of the remote TCP RST code so the chip can now flush the tx pipe accordingly upon a remote TCP RST reception. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
| * [SCSI] bnx2i: Fixed a cid leak issue for 5771X (10g)Eddie Wai2010-12-211-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | A cid leak issue was found when the connect destroy request exceeded the driver's disconnection timeout. This will lead to a cid resource leak issue. The fix is to allow the cid cleanup even when this happens. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
| * [SCSI] bnx2i: Fixed the endian bug in the TMF LUN cmd sendEddie Wai2010-12-211-1/+5
| | | | | | | | | | | | | | | | Added a be32_to_cpu call for the TMF LUN wqe. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
| * [SCSI] bnx2i: Added fix for NOP-Out response panic from unsolicited NOP-InEddie Wai2010-12-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch fixes the following situations where NOP-Out pkt is called for: - local unsolicited NOP-Out requests (requesting no NOP-In response) - local NOP-Out responses to unsolicited NOP-In requests kernel panic is observed due to double session spin_lock requests; one in the bnx2i_process_nopin_local_cmpl routine in bnx2i_hwi.c and the other in the iscsi_put_task routine in libiscsi.c The proposed fix is to export the currently static __iscsi_put_task() routine and have bnx2i call it directly instead of the iscsi_put_task() routine which holds the session spin lock. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Anil Veerabhadrappa <anilgv@broadcom.com> Acked-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
| * [SCSI] bnx2i: Fixed bugs in the handling of unsolicited NOP-InsEddie Wai2010-12-211-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unsolicited NOP-Ins are placed in the receive queue of the hardware which requires to be read out regardless if the receive pipe is suspended or not. This patch adds the disposal of this RQ element under this condition. Also fixed the bug in the unsolicited NOP-In handling routine which checks for the RESERVED_ITT. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* | cnic: Improve ->iscsi_nl_msg_send()Michael Chan2010-12-231-6/+8
|/ | | | | | | | | | | | 1. Change first parameter from cnic_dev to ulp_handle which is the hba pointer. All other similar upcalls are using hba pointer. The callee can then directly reference the hba without conversion. 2. Change return value from void to int so that an error code can be passed back. This allows the operation to be retried. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6Linus Torvalds2010-10-233-1/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1699 commits) bnx2/bnx2x: Unsupported Ethtool operations should return -EINVAL. vlan: Calling vlan_hwaccel_do_receive() is always valid. tproxy: use the interface primary IP address as a default value for --on-ip tproxy: added IPv6 support to the socket match cxgb3: function namespace cleanup tproxy: added IPv6 support to the TPROXY target tproxy: added IPv6 socket lookup function to nf_tproxy_core be2net: Changes to use only priority codes allowed by f/w tproxy: allow non-local binds of IPv6 sockets if IP_TRANSPARENT is enabled tproxy: added tproxy sockopt interface in the IPV6 layer tproxy: added udp6_lib_lookup function tproxy: added const specifiers to udp lookup functions tproxy: split off ipv6 defragmentation to a separate module l2tp: small cleanup nf_nat: restrict ICMP translation for embedded header can: mcp251x: fix generation of error frames can: mcp251x: fix endless loop in interrupt handler if CANINTF_MERRF is set can-raw: add msg_flags to distinguish local traffic 9p: client code cleanup rds: make local functions/variables static ... Fix up conflicts in net/core/dev.c, drivers/net/pcmcia/smc91c92_cs.c and drivers/net/wireless/ath/ath9k/debug.c as per David
| * cnic: Defer iscsi connection cleanupMichael Chan2010-10-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The bnx2x devices require a 2 second quiet time before sending the last RAMROD command to destroy a connection. This sleep wait adds up to a long delay when iscsid is serially destroying maultiple connections. Create a workqueue to perform the final connection cleanup in the background to speed up the process. This significantly speeds up the process as the wait time can be done in parallel for multiple connections. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * bnx2x, cnic, bnx2i: use new FW/HSIDmitry Kravkov2010-10-062-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the new FW HSI blob and the relevant definitions without logic changes. It also included code adaptation for new HSI. New features are not enabled. New FW/HSI includes: - Support for 57712 HW - Future support for VF (not used) - Improvements in FW interrupts scheme - FW FCoE hooks (stubs for future usage) Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | [SCSI] bnx2i: Updated version to bnx2i-2.1.3Eddie Wai2010-09-051-3/+5
| | | | | | | | | | | | | | Also updated maintainer info. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* | [SCSI] bnx2i: Added chip cleanup for the remove module pathEddie Wai2010-09-052-20/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the case when an ep_connect request is interrupted due to route request stall, if the iSCSI daemon is terminated by the user, the chip will be left in a state which will not get cleaned up upon module removal. Upon module reload, when the same context id is used for a new connection, chip panic would occur. This patch adds chip cleanup in the module removal path. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Acked-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* | [SCSI] bnx2i: Recouple the CFC delete cleanup with cm_abort/close completionEddie Wai2010-09-051-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | Specific to the Broadcom 10g chipset, the CFC delete operation must be coupled with the cm_abort/close with does the SRC delete/terminate offload operation prior. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Acked-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* | [SCSI] bxn2i: Added support for other TMFs besides ABORT_TASKEddie Wai2010-09-051-28/+30
| | | | | | | | | | | | | | | | | | | | | | Expanded the TMF request routine to support other TMFs such as LUN RESET, etc. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Anil Veerabhadrappa <anilgv@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* | [SCSI] bnx2i: Fixed a protocol violation on nopout responsesEddie Wai2010-09-053-6/+3
|/ | | | | | | | | According to RFC3720, nopout packet sent in response to unsolicited nopin packet requesting a response must retain the TTT of the requester. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* scsi: fix bnx2i build errorsRandy Dunlap2010-08-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | bnx2i should depend on NET since it selects SCSI_ISCSI_ATTRS, which depends on NET. Also move the dependencies together. The "depends" change fixes multiple build errors when CONFIG_NET is not enabled: ERROR: "skb_trim" [drivers/scsi/scsi_transport_iscsi.ko] undefined! ERROR: "netlink_kernel_create" [drivers/scsi/scsi_transport_iscsi.ko] undefined! ERROR: "netlink_kernel_release" [drivers/scsi/scsi_transport_iscsi.ko] undefined! ERROR: "skb_pull" [drivers/scsi/scsi_transport_iscsi.ko] undefined! ERROR: "init_net" [drivers/scsi/scsi_transport_iscsi.ko] undefined! ERROR: "__alloc_skb" [drivers/scsi/scsi_transport_iscsi.ko] undefined! ERROR: "netlink_broadcast" [drivers/scsi/scsi_transport_iscsi.ko] undefined! ERROR: "kfree_skb" [drivers/scsi/scsi_transport_iscsi.ko] undefined! ERROR: "skb_put" [drivers/scsi/scsi_transport_iscsi.ko] undefined! Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: Anil Veerabhadrappa <anilgv@broadcom.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* [SCSI] bnx2i: Updated version from 2.1.1 to 2.1.2Eddie Wai2010-07-271-2/+2
| | | | | Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] bnx2i: Added host param ISCSI_HOST_PARAM_IPADDRESSMichael Chan2010-07-271-1/+22
| | | | | | | | | | | This sysfs attribute is proven to be useful during pivot_root. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] bnx2i: Fixed the TCP graceful termination initiationEddie Wai2010-07-273-19/+40
| | | | | | | | | | | | | | | | In compliance to RFC793, a TCP graceful termination will be used instead of an abortive termination for the case where the remote has initiated the close of the connection. Additionally, a TCP abortive termination will be used to close the connection when a logout response is not received in time after a logout request has been initiated. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] bnx2i: Fine tuned conn destroy and context destroy timeout valuesEddie Wai2010-07-272-4/+13
| | | | | | | | | | | | | | | | Added variables to separate the fine tuned timeout values for connection destroy and context destroy for both 1g and 10g devices. v2: Extended the 5771X disconnect timeout from 10s to 20s as the firmware has a retransmission timeout of 16s. This fixes one of the iscsi_endpoint leak issues when the target is slow or non-responsive to our TCP FIN. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] bnx2i: Optimized the bnx2i_stop connection clean up procedureEddie Wai2010-07-273-9/+40
| | | | | | | | | | | | | | | | | | | For cases where the iSCSI disconnection procedure times out due to the iSCSI daemon being slow or unresponsive, the bnx2i_stop routine will now perform hardware cleanup via bnx2i_hw_ep_disconnect on all active endpoints so that subsequent operations will perform properly. Also moved the mutex locks inside ep_connect and ep_disconnect so that proper exclusivity can resolve simultaneous calls to the ep_disconnect routine. v2: Removed the unnecessary read lock in the bnx2i_stop Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] bnx2i: Created an active linklist which holds bnx2i endpointsEddie Wai2010-07-272-3/+47
| | | | | | | | | | | | | This introduces a new active linklist which would link up all active bnx2i_endpoints. This will be used by subsequent patches that follows. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] bnx2i: Separated the hardware's cleanup procedure from ep_disconnectEddie Wai2010-07-271-43/+76
| | | | | | | | | | | | | | This patch introduces a new bnx2i_hw_ep_disconnect routine which contains all chip related disconnect and clean up procedure of iSCSI offload connections. This separation is intended as a preparation for the subsequent bnx2i_stop patch. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] Merge scsi-misc-2.6 into scsi-rc-fixes-2.6James Bottomley2010-05-182-6/+7
|\ | | | | | | Signed-off-by: James Bottomley <James.Bottomley@suse.de>
| * [SCSI] bnx2i: Update version and module descriptionAnil Veerabhadrappa2010-04-111-3/+4
| | | | | | | | | | | | | | | | missing 10G drivers added to description Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
| * [SCSI] bnx2i: link bnx2i hba and cnic device before registering the deviceAnil Veerabhadrappa2010-04-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When bnx2/cnic/bnx2i drivers are loaded in certain order, bnx2i will will not initialize the device correctly because 'hba->cnic' will be NULL when bnx2i_start() is called from register_device() context. Under this condition 'ifdown' and 'ifup' of associated network interface is required to bring iscsi adapter state to ready state so that it will accept iscsi connection setup within the chip Initializing 'hba->cnic' before calling register_device() will fix this issue Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
| * [SCSI] bnx2i: make firmware use statsn field when constructing headerAnil Veerabhadrappa2010-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | instruct firmware to use driver/iscsid provided expected statsn field while constructing login pdu header. Initialize 'flags' to instruct chip to use driver/iscsid provided ExpStatSN value while constructing iSCSI login PDU header Signed-off-by: Eddie Wai <waie@broadcom.com> Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* | [SCSI] bnx2i: Bug fixes related to MTU change issue when there are active ↵Anil Veerabhadrappa2010-04-113-4/+24
|/ | | | | | | | | | | | | | | | | | | | | | | | iscsi sessions bnx2i driver has to wait and cleanup all iscsi endpoints before returning from bnx2i_stop(). This is to make sure all chip resources are freed before chip is reset. As the requirements for 1G and 10G chipsets is different, added per-device 'hba_shutdown_tmo' parameter to adapter structure If the connections are not torn down by the daemon within this timeout period, 'cid's will be leaked in 10G device. 1G devices are more flexible and do not leak any resources because the whole chip ports gets reset when MTU is changed or ethtool selftest is run fixed a minor issue in bnx2i_ep_poll() which unnecessarily forced error return code when driver timed out waiting for TCP connect request to complete Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>