Commit Graph

43 Commits

Author SHA1 Message Date
Bart Van Assche
59da9cd84b fcst: RHEL 6 build fixes
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4031 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-27 10:38:01 +00:00
Bart Van Assche
2125cb8400 fcst: Complain when refusing login
Log an error message when refusing login because a target port has not yet been enabled
such that fcst users have a way to find out what happened.

Also, make sure that ft_prli() returns a value in the range of the enumeration type
fc_els_spp_resp. Note: since the return value of ft_prli() is only compared against
FC_SPP_RESP_ACK in the current libfc implementation, this change doesn't affect the
behavior of fcst.

BSD-signed-off-by: Bart Van Assche <bvanassche@acm.org>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4027 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-21 09:32:18 +00:00
Bart Van Assche
356f2339a7 fcst: add make 2debug / 2release / 2perf support
Make "make 2debug / 2release / 2perf support" work for fcst. Add -fno-inline
in debug mode. Remove unused defines. Remove a trailing tab.

BSD-signed-off-by: Bart Van Assche <bvanassche@acm.org>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4026 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-21 09:30:19 +00:00
Bart Van Assche
19a0804026 fcst: Avoid that login triggers a crash
Fix the following crash triggered by FCoE initiator login:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000002
IP: [<ffffffffa04b282b>] ft_prli+0x4b/0x350 [fcst]
PGD 1a7ba4067 PUD 1a7ba3067 PMD 0
Oops: 0000 [#1] SMP
CPU 0
Modules linked in: netconsole configfs ib_srpt fcst scst_vdisk scst
crc32c libcrc32c fcoe libfcoe libfc scsi_transport_fc snd_pcm_oss
snd_mixer_oss snd_seq snd_seq_device af_packet rdma_ucm rdma_cm iw_cm
ib_addr ib_ipoib ib_cm ib_sa ib_uverbs ib_umad mlx4_ib ib_mad ib_core
microcode cpufreq_conservative cpufreq_userspace cpufreq_powersave
acpi_cpufreq mperf dm_mod snd_hda_codec_hdmi snd_hda_codec_analog
snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_timer snd intel_agp
mlx4_core sr_mod sg intel_gtt cdrom soundcore i2c_i801 agpgart
snd_page_alloc i2c_core pcspkr button uhci_hcd sd_mod crc_t10dif
ehci_hcd usbcore edd ext3 mbcache jbd fan ata_generic ata_piix
pata_marvell ahci libahci libata scsi_mod thermal processor
thermal_sys hwmon [last unloaded: scst]

Pid: 3562, comm: fcoethread/0 Not tainted 3.1.5-debug+ #1 System
manufacturer P5Q DELUXE/P5Q DELUXE
RIP: 0010:[<ffffffffa04b282b>]  [<ffffffffa04b282b>] ft_prli+0x4b/0x350 [fcst]
RSP: 0018:ffff8801a6273b70  EFLAGS: 00010282
RAX: ffff8801a6273fd8 RBX: 0000000000000000 RCX: 0000000000000006
RDX: 0000000000000001 RSI: 2222222222222222 RDI: 2222222222222222
RBP: ffff8801a6273be0 R08: 2222222222222222 R09: 2222222222222222
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000004
R13: ffff8801a6291c7c R14: ffff8801a6290800 R15: ffff8801a6290848
FS:  0000000000000000(0000) GS:ffff8801bfc00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000002 CR3: 00000001a7ba1000 CR4: 00000000000406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process fcoethread/0 (pid: 3562, threadinfo ffff8801a6272000, task
ffff8801b13ecce0)
Stack:
 ffff8801a6273bc0 ffffffff812f7593 00000000000000c0 ffff8801b9002a00
 0000000000000100 000000000000002c 0000000000000000 ffff8801ae1a4a18
 ffff8801b1a1d600 ffff8801a6290800 ffff8801b1a1ce00 ffff8801ae1a4a18
Call Trace:
 [<ffffffff812f7593>] ? __alloc_skb+0x83/0x170
 [<ffffffffa03b95ec>] fc_rport_enter_prli+0xec/0x220 [libfc]
 [<ffffffffa03ba531>] fc_rport_recv_req+0x541/0x1280 [libfc]
 [<ffffffff81082e8d>] ? trace_hardirqs_on_caller+0x11d/0x1b0
 [<ffffffff813d44ad>] ? mutex_lock_nested+0x26d/0x330
 [<ffffffffa03b6c00>] ? fc_lport_recv_els_req+0x30/0x140 [libfc]
 [<ffffffffa03b6c1f>] fc_lport_recv_els_req+0x4f/0x140 [libfc]
 [<ffffffffa03b5f14>] fc_lport_recv_req+0x174/0x230 [libfc]
 [<ffffffffa03b5dd1>] ? fc_lport_recv_req+0x31/0x230 [libfc]
 [<ffffffff81082f2d>] ? trace_hardirqs_on+0xd/0x10
 [<ffffffffa03b2f6c>] fc_exch_recv+0x63c/0xe50 [libfc]
 [<ffffffffa03ce3b8>] fcoe_recv_frame+0x1d8/0x410 [fcoe]
 [<ffffffff81082e8d>] ? trace_hardirqs_on_caller+0x11d/0x1b0
 [<ffffffffa03ceaf8>] ? fcoe_percpu_receive_thread+0x68/0xf0 [fcoe]
 [<ffffffff8104caf7>] ? local_bh_enable_ip+0x87/0xf0
 [<ffffffffa03ceb00>] fcoe_percpu_receive_thread+0x70/0xf0 [fcoe]
 [<ffffffffa03cea90>] ? fcoe_rcv+0x450/0x450 [fcoe]
 [<ffffffff81069656>] kthread+0x96/0xa0
 [<ffffffff813e0b74>] kernel_thread_helper+0x4/0x10
 [<ffffffff813d6d9d>] ? retint_restore_args+0xe/0xe
 [<ffffffff810695c0>] ? __init_kthread_worker+0x70/0x70
 [<ffffffff813e0b70>] ? gs_change+0xb/0xb
Code: 90 f6 05 e8 2c 00 00 02 49 89 fe 48 89 d3 49 89 cd 0f 85 8e 02
00 00 31 f6 48 c7 c7 00 50 4b a0 41 bc 04 00 00 00 e8 15 1a f2 e0 <0f>
b6 43 02 a8 c0 75 65 8b 4b 0c 41 b4 08 0f c9 f6 c1 30 74 58
RIP  [<ffffffffa04b282b>] ft_prli+0x4b/0x350 [fcst]
 RSP <ffff8801a6273b70>
CR2: 0000000000000002
---[ end trace c06e7c64e9c18831 ]---

BSD-signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Yi Zou <yi.zou@intel.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4025 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-21 09:28:50 +00:00
Bart Van Assche
ca66f0fa2d fcst: Add a paragraph to the README
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3672 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-07-10 11:04:49 +00:00
Bart Van Assche
43c366ecf3 fcst: Add a paragraph in the README about the FCoE protocol.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3659 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-07-07 18:53:58 +00:00
Bart Van Assche
864b679c38 Only #include <linux/version.h> if necessary.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3517 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-06-02 14:55:54 +00:00
Vladislav Bolkhovitin
fae29aba88 Fix ft_get_transport_id() prototype change in r3322
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3326 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-03-30 07:47:43 +00:00
Vladislav Bolkhovitin
4539005d7c Patch from Alexey Obitotskiy <alexeyo1@open-e.com> making get_initiator_port_transport_id() more flexible
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3322 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-03-29 14:30:01 +00:00
Vladislav Bolkhovitin
f518cd150c Let's remove *.orig and *.rej files on extraclean
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3277 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-03-10 20:07:23 +00:00
Joe Eykholt
8e0e14b5e0 My previous commit failed to include 2 critical patches, plus
had the wrong version of 22-lport-notify.   This corrects that.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2845 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-11-26 21:40:59 +00:00
Joe Eykholt
649fef691e Changes to make fcst work on Linux 2.6.36.
The biggest difference is that libfc no longer allocates a sequence
and exchange for incoming requests, and that eliminates a parameter
on the receive function.  This was done to help performance and
might help on short reads sometime in the future.

This also fixes an error in ft_send_read_data() that exceeds the
skb's SG list length limit on long reads when the NIC
supports large send offload.

I also made other minor changes like adding debugging.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2823 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-11-25 01:16:18 +00:00
Bart Van Assche
8113a4f3dc Removed again because apparently fcst doesn't build yet with the 2.6.36 kernel.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2806 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-11-23 19:12:49 +00:00
Bart Van Assche
bda6f0043b Added to repository.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2805 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-11-23 19:06:14 +00:00
Joe Eykholt
ac5618b07e Adding patches for 2.6.36. These are similar to the 2.6.35 patches
except for line number changes and a few interface changes imposed
by differences in libfc between 2.6.35 and 2.6.36, mostly due to the
change which doesn't allocate an exchange and sequence for incoming
requests.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2804 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-11-23 17:56:35 +00:00
Joe Eykholt
ff7a986329 Add an fcoe patch for 2.6.35 to not deliver frames to fcst from softirq level.
I believe this was causing a race leading to a WARN in fc_seq_send that
the sequence initiative wasn't held in ft_send_response().  It also caused
a problem for tcm_fc.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2786 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-11-21 22:38:03 +00:00
Vladislav Bolkhovitin
121a30e9b2 Big CDBs handling improvements.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2295 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-28 13:56:46 +00:00
Joe Eykholt
2ac1c45585 Fix warning of uninitialized variable on some compilers due to
no default case in switch statement.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2290 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-27 17:18:50 +00:00
Vladislav Bolkhovitin
864d4b38c7 Fix possible deadlock on waiting on blocking. As a side effect it leaded to a nice cleanup.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2272 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-25 18:25:32 +00:00
Bart Van Assche
5b33692678 More upstream include path conversions.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2076 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-09 15:27:54 +00:00
Vladislav Bolkhovitin
716107a964 Docs updates before making the sys interface default
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2039 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-03 16:38:19 +00:00
Joe Eykholt
05bf0954aa Remove debug print of two obsolete fields.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1923 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-08-03 18:05:29 +00:00
Joe Eykholt
5d84242673 Add patch series for 2.6.35.
The individual patches are a subset of the earlier ones, with
only line number changes to apply cleanly.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1922 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-08-03 18:04:36 +00:00
Bart Van Assche
078841cbf4 Removed again -- doesn't build.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1917 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-08-03 15:38:57 +00:00
Bart Van Assche
7b839ceaf7 Added to repository.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1916 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-08-03 15:33:45 +00:00
Vladislav Bolkhovitin
78edc5afb9 Various cleanups and fixes after some errors injection tests. Particularly:
- ISCSI preliminary completed commands handling fixes
 - Write residuals cleanups and fixes
 - Interface to handle residuals and received from initiators data changed
 - BIDI cleanups and fixes.
 - All BIDI IN fields and functions renamed to OUT to be in line with the in-kernel convention

+ 

Docs updated



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1780 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-23 13:57:35 +00:00
Bart Van Assche
443250144b Fixed sparse warnings about functions that were defined but not declared.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1768 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-13 17:35:37 +00:00
Bart Van Assche
d8392af840 Apparently sparse ignores __attribute__((packed)) when applied to an enum
while gcc honors this attribute. The result is that
sizeof(struct fcoe_rcv_info) is 48 when the header include/scsi/fc_frame.h is
compiled with gcc and that sizeof(struct fcoe_rcv_info) > 48 when the same
header is compiled by sparse. As a result, compilation with sparse fails due
to the BUILD_BUG_ON() statement in the function fcoe_dev_from_skb(), even
when checking a vanilla Linux kernel with sparse. The patch below slightly
modifies include/scsi/fc_frame.h such that gcc and sparse interpret this header
in the same way.

Note: it is fine to revert this patch once the behavior of gcc and sparse is
again in sync.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1767 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-13 17:34:40 +00:00
Bart Van Assche
56538f02d5 Removed a trailing whitespace because checkpatch complained about it.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1766 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-12 06:17:22 +00:00
Bart Van Assche
4366b4ee83 Fixed checkpatch complaints about whitespace (removed space before tab twice).
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1765 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-12 05:57:49 +00:00
Joe Eykholt
7a12737c9d Simplify README by eliminating example using of ini_groups.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1761 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-11 17:59:26 +00:00
Joe Eykholt
546647be44 Support for persistent reservations.
Add a method for template get_initiator_port_transport_id()
to allow persistent reservations to work. 

Initialize struct ft_sess more fully before scst_register_session()
so that ft_get_transport_id() can use it.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1759 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-10 21:47:17 +00:00
Joe Eykholt
64a5ad5169 Updated README to refer to linux 2.6.34.
The same libfc patches apply, but I copied the series file for 2.6.34.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1758 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-10 20:40:45 +00:00
Joe Eykholt
f947cd2f43 Fix compile error by removing debug prints of deleted fields.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1756 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-10 18:38:58 +00:00
Vladislav Bolkhovitin
b53e4cb4c1 Merge of the pr branch with additional fixes for problems found during extra testing
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1714 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-05-26 17:46:46 +00:00
Bart Van Assche
7cb475ca57 Whitespace-only changes in order to fix the 2.6.34 checkpatch complaints
about whitespace.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1706 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-05-22 07:30:27 +00:00
Vladislav Bolkhovitin
168f4c3335 Document that the io_context patch isn't needed anymore
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1564 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-03-25 19:47:28 +00:00
Vladislav Bolkhovitin
cbaab260f1 Add new scst_cmd_get_queue_type()/scst_cmd_set_queue_type() accessors and use them in target drivers instead of direct access to SCST's cmd->queue_type.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1553 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-03-17 19:11:18 +00:00
Vladislav Bolkhovitin
17db798a36 Make enable_target() interface more clear
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1539 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-03-10 11:56:15 +00:00
Joe Eykholt
a041986db3 fcst: fix abort handling
Call scst_tgt_cmd_done() on aborted commands.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1526 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-03-01 18:35:36 +00:00
Joe Eykholt
5d2da8b297 fcst: set max_hw_pending_time
The target template max_hw_pending_time was zero, causing
premature timeouts and a fast retry in scst_hw_pending_work_fn().
    
Set it to 20 seconds, like qla2x00t does, for now.
It could be the wrong thing for tape, but should be
plenty long enough for disks.
    
Signed-off-by: Joe Eykholt <jeykholt@cisco.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1522 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-02-25 18:23:23 +00:00
Bart Van Assche
93e5dcab3c Removed trailing whitespace because checkpatch complained about it.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1518 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-02-21 19:30:39 +00:00
Vladislav Bolkhovitin
6023f1ad34 This patch adds a new target module for SCST and libfc
that accepts FCP requests from libfc HBAs running Fibre Channel
over Ethernet (FCoE) and passes them to SCST.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1514 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-02-20 20:02:02 +00:00