Commit Graph

462 Commits

Author SHA1 Message Date
Vladislav Bolkhovitin
0dd7573989 Fix for missed mempool_destroy() in case when CONFIG_TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION not defined noticed by Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4208 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-04-13 20:28:50 +00:00
Vladislav Bolkhovitin
88881a1459 iSCSI resource agents written by Riccardo Bicelli <r.bicelli@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4177 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-03-30 20:59:48 +00:00
Vladislav Bolkhovitin
49c56244a1 Fix 3.3 checkpatch warnings about min()and max()
Fix three occurrences of the following warnings reported by the checkpatch
script included with Linux kernel version 3.3:
WARNING: min() should probably be min_t()
WARNING: max() should probably be max_t()

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4172 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-03-27 01:46:51 +00:00
Vladislav Bolkhovitin
90670b1c83 scst_rx_mgmt_fn_lun(): Change 3rd arg from u8 * into void *
This change allows to remove several casts and hence improves
source code readability.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4169 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-03-27 01:40:45 +00:00
Vladislav Bolkhovitin
d5ffb2234b Cleanup mgmt parameters initialization.
It's better to do it via a single function.

Patch from Alexey Obitotskiy <alexeyo1@open-e.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4165 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-03-23 22:03:22 +00:00
Vladislav Bolkhovitin
937b2d550d Update for kernel 3.3
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4164 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-03-23 21:48:11 +00:00
Vladislav Bolkhovitin
7a87bf25a6 Cleanup + implement conditional logging
This patch:
* fixes signatures for log_debug and log_pdu macros
* collapses __log_<LEVEL> functions into one
* adds conditional logging

Here conditional logging means that the logging priority and logging level may
vary depending on some dynamic parameters. This is helpful when software is
able to recover from errors which occur periodically and hence, there is no
need to pollute system logs with tons of repetitive non-critical lines.

The following macros are added to support this feature:
* log_info_cond
* log_warning_cond
* log_error_cond

They take an additional first parameter called "level". If it is 0 then they
act as their non-cond counterparts, otherwise they act like log_debug with the
specified level.

Those who are not interested in conditional logging are not affected: they can
continue using plain old logging macros without any changes.

Signed-off-by: Sergey Myasnikov <tigra564@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4161 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-03-12 22:31:13 +00:00
Vladislav Bolkhovitin
5c2cde6757 Cleanup: move misc routines in misc.c
This patch moves the following utility functions from iscsi_scstd.c to misc.c
and makes them public (i.e. non-static):
* set_non_blocking
* sock_set_keepalive

Signed-off-by: Sergey Myasnikov <tigra564@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4160 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-03-12 21:52:35 +00:00
Vladislav Bolkhovitin
50120c37b3 scst_cmd_aborted() is a bad and ambiguous name. Rename it to scst_cmd_aborted_on_xmit() and create a new version, which truly reflects its semantic.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4143 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-02-24 02:24:06 +00:00
Vladislav Bolkhovitin
659e6ea6e8 Install man pages as well. Noticed by Bart Van Assche <bvanassche@acm.org>.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4133 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-02-17 01:38:16 +00:00
Vladislav Bolkhovitin
37cbdb03df Minor docs update based on experience of Rommer <rommer@active.by>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4119 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-02-11 03:01:00 +00:00
Bart Van Assche
f944799e42 iscsi-scst: Port to RHEL 5.7
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4112 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-02-04 16:41:21 +00:00
Bart Van Assche
85b89521f8 iscsi-scstd: Make really sure that the buffer allocated for nl_read() is large enough
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4110 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-02-04 16:39:26 +00:00
Bart Van Assche
fdeea7c916 iscsi-scstd: Follow-up for r4077 - avoid that reading from the netlink socket can cause data corruption
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4109 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-02-04 12:39:26 +00:00
Vladislav Bolkhovitin
8e5eafb7c3 Forgotten tcp_zero_copy.c added
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4080 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-20 03:13:11 +00:00
Vladislav Bolkhovitin
9da517bae1 Update for kernel 3.2. Netlink part in iSCSI-SCST done by Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4077 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-18 23:48:02 +00:00
Vladislav Bolkhovitin
b31865ea69 Update of put_page_callback-2.6.32-220.patch from Patrick Zwahlen <paz@navixia.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4064 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-12 03:22:09 +00:00
Vladislav Bolkhovitin
f6ba6aaf43 Patch from Richard Sharpe <realrichardsharpe@gmail.com> implementing put_page_callback patch for CentOS 6.2/RHEL 6.2
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4057 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-10 03:02:24 +00:00
Vladislav Bolkhovitin
7872837b6b Replace list_entry((a)->next, b, c) by list_first_entry(a, b, c).
BSD-signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3965 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-10 03:50:24 +00:00
Vladislav Bolkhovitin
69d8c2fbd7 Change __attribute__((packed)) into __packed and
__attribute__((aligned(x))) into __aligned(x) in kernel code since
checkpatch complains about the former.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3952 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-06 03:02:13 +00:00
Vladislav Bolkhovitin
295adebc0f Use get/put_unaligned_be<n>(...) instead of
get/put_unaligned(cpu_to_be<n>(...)).

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3941 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-01 03:28:39 +00:00
Vladislav Bolkhovitin
57193ecabc Those patches were mistakenly generated for patch -p0. Fix it. Thanks
Bart Van Assche for reporting it.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3926 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-11-16 19:21:30 +00:00
Vladislav Bolkhovitin
c95ef014d7 Update for kernel 3.1
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3902 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-10-27 19:11:40 +00:00
Bart Van Assche
74264389cd scst: Add script for rebuilding RHEL / CentOS / Scientific Linux kernel RPMs
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3890 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-10-05 17:14:23 +00:00
Vladislav Bolkhovitin
94418431ce Patch from Abhilash Sankar <Abhilash.S@hcl.com> with some fixes
Issue:
------------
The DevRegAttribute is sending a different Source Attribute (ISCSI name) which
represents the Storage Node for each target. So Microsoft isns server considers
the last request as the storage node and doesn't discover the previous targets.

Root Cause
----------------
Function ISNS_FUNC_DEV_ATTR_REG

Target A
Source attribute
            ISCSI-Name = <IQN A Name>
Operating Attribute
            ISCSI-Name  = <IQN A Name>
Flags
Replace Access = 1

Target B
Source attribute
               ISCSI-Name = <IQN B Name>
Operating Attribute
               ISCSI-Name  = <IQN B Name>
Replace Access = 1

So as per the request format Microsoft isns Server always takes the last target
as the source node. and register the same. Hence it doesn't discover the
targets other than last one. The Source Attribute has to be fixed for all targets. It
would be better if we use the first target iscsi name (rather than the last target
iscsi name) as source attribute iscsi name to represent the storage node.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3863 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-09-18 00:58:15 +00:00
Vladislav Bolkhovitin
43d576aa48 Changelogs updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3842 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-09-01 20:15:42 +00:00
Vladislav Bolkhovitin
1d2dedddcc Update of SCST_Gentoo_HOWTO.txt from Willem Boterenbrood <w.boterenbrood@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3823 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-08-19 23:20:22 +00:00
Bart Van Assche
49147b3d8d Change __constant_cpu_... into cpu_... since the latter is also evaluated at compile time.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3806 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-08-14 19:03:03 +00:00
Vladislav Bolkhovitin
632b6beeeb Update of SCST_Gentoo_HOWTO.txt to SCST 2.x. Thanks to Willem Boterenbrood <w.boterenbrood@gmail.com>!
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3800 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-08-09 01:04:57 +00:00
Bart Van Assche
705c3754a2 Remove superfluous double quotes from around #warning messages because checkpatch 3.0 complains about these.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3789 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-07-29 12:58:13 +00:00
Vladislav Bolkhovitin
90aa221cbb Update for kernels 3.0
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3775 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-07-27 01:13:10 +00:00
Vladislav Bolkhovitin
7096e492ba Improve changing debug/release/etc states by making them not depending
from the previous state. Hence, the corresponding labels were renamed to
2debug, 2release and 2perf.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3736 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-07-22 23:10:08 +00:00
Vladislav Bolkhovitin
654cc65319 put_page_callback patch for RHEL61 implemented by Patrick Zwahlen <paz@navixia.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3673 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-07-16 03:41:06 +00:00
Bart Van Assche
834015970b Add iscsi-scst/kernel/patches/rhel/put_page_callback_addendum-rhel6.patch
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3656 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-07-04 16:20:23 +00:00
Vladislav Bolkhovitin
5ff5d0e667 Cleanup
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3601 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-06-20 20:09:04 +00:00
Vladislav Bolkhovitin
daa5da87af Several wait loops in the SCST source code are similar. Move the common code
into a new macro called wait_event_locked().

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

+

Micro-optimize wait_event_locked(). Switch from default_wake_function() to
autoremove_wake_function() (via DEFINE_WAIT()). The result is that
wait_queue_head_t.lock is locked once instead of twice for wakeup + wait queue
removal.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3591 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-06-18 21:15:59 +00:00
Vladislav Bolkhovitin
4eadecd70d Docs update from Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3582 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-06-17 02:34:21 +00:00
Vladislav Bolkhovitin
7bde8810f5 Currently there are three different init scripts inside the SCST project:
scst, iscsi-scst and qla2x00t. This makes it unnecessary hard for users to
run several target drivers simultaneously. Additionally, several variants of
these init scripts exist for different distributions. This patch unifies all
these init scripts into a single init script. Additionally, some new features
have been added:
- Kernel module parameters can now be specified per kernel module in
  /etc/default/scst. An example:
 ib_srpt_parameters="thread=1 srp_max_req_size=4200"
- When using the sysfs interface, compute the kernel module list from scst.conf.
  Or, editing the SCST_MODULES variable is no longer necessary.
- When using the procfs interface, the SCST handler kernel module list is
  computed from /etc/scst.conf. The list of target driver kernel modules must
  now be configured in /etc/default/scst.

Other changes:
- scstadmin output is shown if scstadmin fails.
- Running make -C scstadmin install does no longer cause the scst script to
  be started at the next reboot - it is better to leave this as an explicit step.
- Made the error message generated if the lsb-core package has not yet been
  installed more clear.
- Use proper init script path on Slackware.
- make uninstall: run remove_initd under chroot if $(DESTDIR) is not empty.
- Fixed a bug in "make -C scstadmin uninstall": the path specified for removing
  /etc/init.d/scst was wrong.
- The command /etc/init.d/scst restart will only try to start SCST if stopping
  succeeded.
- Replaced "mkdir -m 755 -p $(DESTDIR)$(INITDIR)" by
  "install -d $(DESTDIR)$(INITDIR)" because of uniformity.

These changes have been tested on Ubuntu 11.04, Fedora 15, CentOS 5.6,
Scientific Linux 6.0, openSUSE 11.4, SLES11 SP1 and Slackware 13.37.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3564 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-06-10 02:38:04 +00:00
Vladislav Bolkhovitin
8b90327419 Modified patch from Bart Van Assche <bvanassche@acm.org> fixing errors reporting
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3552 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-06-07 18:08:58 +00:00
Vladislav Bolkhovitin
2f1745eec1 Set data_out_in_data_receiving for preliminary completed commands as
well to prevent releasing them too early in iscsi_check_tm_data_wait_timeouts()



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3546 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-06-06 21:04:04 +00:00
Vladislav Bolkhovitin
8cfb816e16 Cleanup
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3523 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-06-03 20:29:48 +00:00
Bart Van Assche
beeef55b6f Use __packed instead of __attribute__((packed)).
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3500 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-06-01 10:40:07 +00:00
Bart Van Assche
375597fedf iSCSI-SCST: only define __packed for those kernels versions that do not have a definition for __packed.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3498 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-06-01 08:03:32 +00:00
Bart Van Assche
4839c8167f iscsi-scst: get rid of two "suspect code indent for conditional statements" checkpatch complaints.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3497 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-06-01 07:19:12 +00:00
Bart Van Assche
c37081aed5 Move spaces in long #warning/#error lines to the end of the previous line to shut up checkpatch.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3495 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-06-01 06:59:40 +00:00
Bart Van Assche
b901fe2958 iSCSI-SCST builds again on RHEL 5.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3488 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-05-28 10:37:46 +00:00
Vladislav Bolkhovitin
554c044fe6 ChangeLogs updates
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3474 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-05-25 00:25:11 +00:00
Vladislav Bolkhovitin
b5a41deb28 Update for 2.6.39
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3462 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-05-20 00:52:34 +00:00
Vladislav Bolkhovitin
c54ebba11a Some more TM cleanups/improvements
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3460 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-05-18 21:45:09 +00:00
Bart Van Assche
fc82862369 iscsi-scst: Fixed a compilation error that only occurred with GENERATING_UPSTREAM_PATCH defined.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3452 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-05-13 06:13:52 +00:00