Merged revisions 5833-5835,5844,5847-5856 via svnmerge from

svn+ssh://yanb123@svn.code.sf.net/p/scst/svn/trunk

........
  r5833 | bvassche | 2014-10-07 08:02:20 +0200 (Tue, 07 Oct 2014) | 1 line
  
  nightly build: Update kernel versions
........
  r5834 | bvassche | 2014-10-10 18:36:24 +0200 (Fri, 10 Oct 2014) | 1 line
  
  nightly build: Update kernel versions
........
  r5835 | bvassche | 2014-10-10 18:36:59 +0200 (Fri, 10 Oct 2014) | 1 line
  
  nightly build: Update kernel versions
........
  r5844 | vlnb | 2014-10-17 04:13:17 +0200 (Fri, 17 Oct 2014) | 3 lines
  
  iSER web updates
........
  r5847 | vlnb | 2014-10-17 04:22:23 +0200 (Fri, 17 Oct 2014) | 19 lines
  
  scst_vdisk: Remove a superfluous cast
  
  The 'iov_base' member of 'struct iovec' is declared in
  <uapi/linux/uio.h> with type 'void __user *'. Adding an integer
  to a void pointer has the same effect as adding an integer to
  a char pointer in the C language. This means that it is safe to
  remove the cast in front of the eiv->iov_base pointer.
  
  Please note that a similar construct already exists in the iSCSI
  target driver. From the nthread.c source file:
  
  			iop->iov_base += rest;
  			iop->iov_len -= rest;
  
  This patch does not change any functionality.
  
  Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
  r5848 | vlnb | 2014-10-17 04:24:07 +0200 (Fri, 17 Oct 2014) | 12 lines
  
  scst_vdisk: Reduce number of casts
  
  Since 'address' points at kernel space memory, change its type
  from uint8_t __user * into uint8_t *. This change reduces the
  number of casts between uint8_t __user * to uint8_t * in
  fileio_exec_write().
  
  This patch does not change any functionality.
  
  Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
  r5849 | vlnb | 2014-10-17 04:30:12 +0200 (Fri, 17 Oct 2014) | 10 lines
  
  scst_vdisk, MODE SELECT(10): Interpret both bytes of the BLOCK DESCRIPTOR LENGTH field
  
  While the BLOCK DESCRIPTOR LENGTH field spans a single byte in the
  Mode parameter header(6), the size of this field in the Mode parameter
  header(10) is two bytes. Interpret both bytes while executing a MODE
  SELECT(10) command.
  
  Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
  r5850 | vlnb | 2014-10-17 04:32:28 +0200 (Fri, 17 Oct 2014) | 8 lines
  
  scst/README: Document the lun<X> sysfs attributes
  
  The sessions/<sess>/lun<X> sysfs attribute "active_commands" is not
  yet documented. Hence add documentation for that sysfs attribute.
  
  Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
  r5851 | vlnb | 2014-10-17 04:35:01 +0200 (Fri, 17 Oct 2014) | 12 lines
  
  scst, iscsi-scst: Add thread_pid attribute
  
  For SCST devices with a short name determining which SCST command
  threads serve a given LUN requires an (expensive) walk of the
  process table. For SCST devices with a long name it is not possible
  to determine unambiguously which command threads serve a given
  LUN. Hence add a thread_pid sysfs attribute that makes it easy to
  figure out which command threads serve a LUN.
  
  Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
  r5852 | bvassche | 2014-10-18 10:56:23 +0200 (Sat, 18 Oct 2014) | 5 lines
  
  iscsi-scst: Make iscsi_thread_pool locking more fine-grained
  
  Protect iscsi_thread_pool.threads_list via tp_mutex instead of
  scst_mutex.
........
  r5853 | bvassche | 2014-10-24 09:12:39 +0200 (Fri, 24 Oct 2014) | 1 line
  
  nightly build: Update kernel versions
........
  r5854 | bvassche | 2014-11-01 10:30:20 +0200 (Sat, 01 Nov 2014) | 1 line
  
  nightly build: Update kernel versions
........
  r5855 | vlnb | 2014-11-15 03:44:06 +0200 (Sat, 15 Nov 2014) | 3 lines
  
  Ease severity of reporting unsupported REPORT LUNS SELECT REPORT value
........
  r5856 | vlnb | 2014-11-15 03:55:27 +0200 (Sat, 15 Nov 2014) | 3 lines
  
  Report RX data digest failures by default
........


git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5873 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Yan Burman
2014-11-16 13:51:38 +00:00
parent a37e20d3c3
commit 6c2a375768
12 changed files with 124 additions and 28 deletions

View File

@@ -332,8 +332,13 @@ Each target subdirectory contains the following entries:
- tid - TID of this target.
Subdirectory "sessions" contains one subdirectory for each connected
session with name equal to name of the connected initiator.
The "sessions" subdirectory contains the following attribute:
- thread_pid - the process identifiers (PIDs) of the iscsird and iscsiwr
threads that process SCSI commands associated with this session.
Additionally, the "sessions" subdirectory contains one subdirectory for each
connected session with name equal to name of the connected initiator.
Each session subdirectory contains the following entries:

View File

@@ -205,8 +205,7 @@ int digest_rx_data(struct iscsi_cmnd *cmnd)
cmnd->conn->rpadding);
if (unlikely(crc != cmnd->ddigest)) {
TRACE(TRACE_MINOR|TRACE_MGMT_DEBUG, "%s", "RX data digest "
"failed");
PRINT_ERROR("RX data digest failed, stable pages disabled?");
TRACE_MGMT_DBG("Calculated crc %x, ddigest %x, offset %d", crc,
cmnd->ddigest, offset);
iscsi_dump_pdu(&cmnd->pdu);

View File

@@ -4110,11 +4110,13 @@ static void __iscsi_threads_pool_put(struct iscsi_thread_pool *p)
TRACE_DBG("Freeing iSCSI thread pool %p", p);
mutex_lock(&p->tp_mutex);
list_for_each_entry_safe(t, tt, &p->threads_list, threads_list_entry) {
kthread_stop(t->thr);
list_del(&t->threads_list_entry);
kfree(t);
}
mutex_unlock(&p->tp_mutex);
list_del(&p->thread_pools_list_entry);
@@ -4190,6 +4192,7 @@ int iscsi_threads_pool_get(const cpumask_t *cpu_mask,
else
cpumask_copy(&p->cpu_mask, cpu_mask);
p->thread_pool_ref = 1;
mutex_init(&p->tp_mutex);
INIT_LIST_HEAD(&p->threads_list);
if (cpu_mask == NULL)
@@ -4221,7 +4224,10 @@ int iscsi_threads_pool_get(const cpumask_t *cpu_mask,
kfree(t);
goto out_free;
}
mutex_lock(&p->tp_mutex);
list_add_tail(&t->threads_list_entry, &p->threads_list);
mutex_unlock(&p->tp_mutex);
}
}

View File

@@ -89,9 +89,11 @@ struct iscsi_thread_pool {
int thread_pool_ref;
struct list_head threads_list;
/* Entry in iscsi_thread_pools_list */
struct list_head thread_pools_list_entry;
struct mutex tp_mutex;
struct list_head threads_list; /* protected by tp_mutex */
};

View File

@@ -560,6 +560,37 @@ static ssize_t iscsi_sess_reinstating_show(struct kobject *kobj,
static struct kobj_attribute iscsi_sess_attr_reinstating =
__ATTR(reinstating, S_IRUGO, iscsi_sess_reinstating_show, NULL);
static ssize_t iscsi_sess_thread_pid_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
{
struct scst_session *scst_sess = container_of(kobj, struct scst_session,
sess_kobj);
struct iscsi_session *sess = scst_sess_get_tgt_priv(scst_sess);
struct iscsi_thread_pool *thr_pool = sess->sess_thr_pool;
struct iscsi_thread *t;
int res = -ENOENT;
if (!thr_pool)
goto out;
res = 0;
mutex_lock(&thr_pool->tp_mutex);
list_for_each_entry(t, &thr_pool->threads_list, threads_list_entry)
res += scnprintf(buf + res, PAGE_SIZE - res, "%d%s",
task_pid_vnr(t->thr),
list_is_last(&t->threads_list_entry,
&thr_pool->threads_list) ?
"\n" : " ");
mutex_unlock(&thr_pool->tp_mutex);
out:
return res;
}
static struct kobj_attribute iscsi_sess_thread_pid =
__ATTR(thread_pid, S_IRUGO, iscsi_sess_thread_pid_show, NULL);
const struct attribute *iscsi_sess_attrs[] = {
&iscsi_sess_attr_initial_r2t.attr,
&iscsi_sess_attr_immediate_data.attr,
@@ -572,6 +603,7 @@ const struct attribute *iscsi_sess_attrs[] = {
&iscsi_sess_attr_data_digest.attr,
&iscsi_attr_sess_sid.attr,
&iscsi_sess_attr_reinstating.attr,
&iscsi_sess_thread_pid.attr,
NULL,
};

View File

@@ -3,13 +3,13 @@
ABT_DETAILS="x86_64"
ABT_JOBS=5
ABT_KERNELS=" \
3.16.3 \
3.16.7 \
3.15.10-nc \
3.14.19-nc \
3.14.23-nc \
3.13.11-nc \
3.12.28-nc \
3.12.31-nc \
3.11.10-nc \
3.10.55-nc \
3.10.59-nc \
3.9.11-nc \
3.8.13-nc \
3.7.10-nc \

View File

@@ -690,6 +690,16 @@ Each session subdirectory contains the following entries:
See below description of the VDISK's sysfs interface for samples.
Each sessions/<sess>/lun<X> subdirectory contains the following entries:
- active_commands - contains number of active, i.e. not yet or being
executed, SCSI commands for lun<X> in session <sess>.
- thread_pid - contains a single line with all the process identifiers
(PIDs) of the kernel threads that process SCSI commands intended for
lun<X> in session <sess>.
Access and devices visibility management (LUN masking)
------------------------------------------------------

View File

@@ -552,6 +552,16 @@ Each session subdirectory contains the following entries:
See below description of the VDISK's sysfs interface for samples.
Each sessions/<sess>/lun<X> subdirectory contains the following entries:
- active_commands - contains number of active, i.e. not yet or being
executed, SCSI commands for lun<X> in session <sess>.
- thread_pid - contains a single line with all the process identifiers
(PIDs) of the kernel threads that process SCSI commands intended for
lun<X> in session <sess>.
Access and devices visibility management (LUN masking)
------------------------------------------------------

View File

@@ -4351,7 +4351,7 @@ static enum compl_status_e vdisk_exec_mode_select(struct vdisk_cmd_params *p)
int32_t length;
uint8_t *address;
struct scst_vdisk_dev *virt_dev;
int mselect_6, offset, type;
int mselect_6, offset, bdl, type;
TRACE_ENTRY();
@@ -4370,14 +4370,17 @@ static enum compl_status_e vdisk_exec_mode_select(struct vdisk_cmd_params *p)
goto out_put;
}
if (mselect_6)
if (mselect_6) {
bdl = address[3];
offset = 4;
else
} else {
bdl = get_unaligned_be16(&address[6]);
offset = 8;
}
if (address[offset - 1] == 8) {
if (bdl == 8)
offset += 8;
} else if (address[offset - 1] != 0) {
else if (bdl != 0) {
PRINT_ERROR("%s", "MODE SELECT: Wrong parameters list length");
scst_set_invalid_field_in_parm_list(cmd, offset-1, 0);
goto out_put;
@@ -5021,7 +5024,7 @@ static enum compl_status_e fileio_exec_write(struct vdisk_cmd_params *p)
mm_segment_t old_fs;
loff_t err = 0;
ssize_t length, full_len;
uint8_t __user *address;
uint8_t *address;
struct scst_vdisk_dev *virt_dev = cmd->dev->dh_priv;
struct file *fd = virt_dev->fd;
struct iovec *iv, *eiv;
@@ -5039,7 +5042,7 @@ static enum compl_status_e fileio_exec_write(struct vdisk_cmd_params *p)
if (iv == NULL)
goto out_nomem;
length = scst_get_buf_first(cmd, (uint8_t __force **)&address);
length = scst_get_buf_first(cmd, &address);
if (unlikely(length < 0)) {
PRINT_ERROR("scst_get_buf_first() failed: %zd", length);
scst_set_cmd_error(cmd,
@@ -5058,12 +5061,11 @@ static enum compl_status_e fileio_exec_write(struct vdisk_cmd_params *p)
full_len += length;
i++;
iv_count++;
iv[i].iov_base = address;
iv[i].iov_base = (uint8_t __force __user *)address;
iv[i].iov_len = length;
if (iv_count == UIO_MAXIOV)
break;
length = scst_get_buf_next(cmd,
(uint8_t __force **)&address);
length = scst_get_buf_next(cmd, &address);
}
if (length == 0) {
finished = true;
@@ -5116,8 +5118,7 @@ restart:
eiv++;
eiv_count--;
} else {
eiv->iov_base =
(uint8_t __force __user *)eiv->iov_base + err;
eiv->iov_base += err;
eiv->iov_len -= err;
break;
}
@@ -5131,7 +5132,7 @@ restart:
if (finished)
break;
length = scst_get_buf_next(cmd, (uint8_t __force **)&address);
length = scst_get_buf_next(cmd, &address);
}
set_fs(old_fs);

View File

@@ -3506,6 +3506,31 @@ static struct kobj_attribute tgt_dev_latency_attr =
#endif /* CONFIG_SCST_MEASURE_LATENCY */
static ssize_t scst_tgt_dev_thread_pid_show(struct kobject *kobj,
struct kobj_attribute *attr,
char *buffer)
{
struct scst_tgt_dev *tgt_dev =
container_of(kobj, struct scst_tgt_dev, tgt_dev_kobj);
struct scst_cmd_threads *cmd_threads = tgt_dev->active_cmd_threads;
struct scst_cmd_thread_t *t;
int res = 0;
spin_lock(&cmd_threads->thr_lock);
list_for_each_entry(t, &cmd_threads->threads_list, thread_list_entry)
res += scnprintf(buffer + res, PAGE_SIZE - res, "%d%s",
task_pid_vnr(t->cmd_thread),
list_is_last(&t->thread_list_entry,
&cmd_threads->threads_list) ?
"\n" : " ");
spin_unlock(&cmd_threads->thr_lock);
return res;
}
static struct kobj_attribute tgt_dev_thread_pid_attr =
__ATTR(thread_pid, S_IRUGO, scst_tgt_dev_thread_pid_show, NULL);
static ssize_t scst_tgt_dev_active_commands_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
{
@@ -3524,6 +3549,7 @@ static struct kobj_attribute tgt_dev_active_commands_attr =
scst_tgt_dev_active_commands_show, NULL);
static struct attribute *scst_tgt_dev_attrs[] = {
&tgt_dev_thread_pid_attr.attr,
&tgt_dev_active_commands_attr.attr,
#ifdef CONFIG_SCST_MEASURE_LATENCY
&tgt_dev_latency_attr.attr,

View File

@@ -1850,8 +1850,8 @@ static int scst_report_luns_local(struct scst_cmd *cmd)
cmd->driver_status = 0;
if ((cmd->cdb[2] != 0) && (cmd->cdb[2] != 2)) {
PRINT_ERROR("Unsupported SELECT REPORT value %x in REPORT "
"LUNS command", cmd->cdb[2]);
TRACE(TRACE_MINOR, "Unsupported SELECT REPORT value %x in "
"REPORT LUNS command", cmd->cdb[2]);
scst_set_invalid_field_in_cdb(cmd, 2, 0);
goto out_compl;
}

View File

@@ -1,12 +1,12 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="Keywords" content="iSCSI target, iSCSI-SCST">
<meta name="Keywords" content="iSER, iSCSI target, iSCSI-SCST">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="author" content="Daniel Fernandes">
<meta name="Robots" content="index,follow">
<link rel="stylesheet" href="images/Orange.css" type="text/css">
<title>iSCSI Target Driver</title>
<title>iSER Target Driver</title>
</head>
<body>
@@ -59,10 +59,15 @@
<h1>iSCSI Extensions for RDMA (iSER) driver for iSCSI-SCST</h1>
<p>ISER extension for ISCSI-SCST has been developed by Yan Burman and Mellanox Technologies (thank you!).</p>
<p>Current version is 3.0.0. You can find the latest development version in the SCST SVN. See the download page how to setup
<p>Current version is 3.0.0. You can find the latest development version in the SCST SVN in iser branch. See the download page how to setup
access to it.</p>
<p>3.0.x-iser branch in the SCST SVN is the stable post-3.0 release iSER
branch with the latest stable fixes in the iSER driver as well as other SCST components merged from the 3.0.0 branch.</p>
<br><br><br>
<p class="post-footer align-right">
<a href="http://community.mellanox.com/docs/DOC-1479" class="readmore">HOWTO</a>
<a href="http://sourceforge.net/p/scst/svn/HEAD/tree/" class="readmore">SCST SVN Repository</a>
</p>
<table border=0><tr><td height="300px">&nbsp;</td></tr></table>