[Bug 60644] MPT2SAS drops all HDDs when under high I/O

2013-09-17 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=60644

--- Comment #32 from livea...@live.com ---
Hi .

This bug is still present in 3.12-rc1 as of today's tests .

Thank you .

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] qla4xxx: correctly update session discovery_parent_idx.

2013-09-17 Thread vikas.chaudhary
From: Manish Rangankar 

Earlier logic for driver created iscsi_session->discovery_parent_idx
was to store ram index of a sendtarget entry, but driver frees
sendtarget ram index as soon as firmware is done with discovery,
which is available for further use. So changing the logic to point
iscsi_session->discovery_parent_idx to store sendtarget flashnode index.

Signed-off-by: Manish Rangankar 
Signed-off-by: Vikas Chaudhary 
---
 drivers/scsi/qla4xxx/ql4_def.h |   1 +
 drivers/scsi/qla4xxx/ql4_os.c  | 199 +
 2 files changed, 181 insertions(+), 19 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
index 41327d4..084d1fd 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
@@ -306,6 +306,7 @@ struct ddb_entry {
 struct qla_ddb_index {
struct list_head list;
uint16_t fw_ddb_idx;
+   uint16_t flash_ddb_idx;
struct dev_db_entry fw_ddb;
uint8_t flash_isid[6];
 };
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index f8a0a26..a8847a3 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -2373,11 +2373,6 @@ static void qla4xxx_copy_to_sess_conn_params(struct 
iscsi_conn *conn,
COPY_ISID(sess->isid, fw_ddb_entry->isid);
 
ddb_link = le16_to_cpu(fw_ddb_entry->ddb_link);
-   if (ddb_link < MAX_DDB_ENTRIES)
-   sess->discovery_parent_idx = ddb_link;
-   else
-   sess->discovery_parent_idx = DDB_NO_LINK;
-
if (ddb_link == DDB_ISNS)
disc_parent = ISCSI_DISC_PARENT_ISNS;
else if (ddb_link == DDB_NO_LINK)
@@ -4937,7 +4932,8 @@ static int qla4xxx_compare_tuple_ddb(struct scsi_qla_host 
*ha,
 }
 
 static int qla4xxx_is_session_exists(struct scsi_qla_host *ha,
-struct dev_db_entry *fw_ddb_entry)
+struct dev_db_entry *fw_ddb_entry,
+uint32_t *index)
 {
struct ddb_entry *ddb_entry;
struct ql4_tuple_ddb *fw_tddb = NULL;
@@ -4971,6 +4967,8 @@ static int qla4xxx_is_session_exists(struct scsi_qla_host 
*ha,
qla4xxx_get_param_ddb(ddb_entry, tmp_tddb);
if (!qla4xxx_compare_tuple_ddb(ha, fw_tddb, tmp_tddb, false)) {
ret = QLA_SUCCESS; /* found */
+   if (index != NULL)
+   *index = idx;
goto exit_check;
}
}
@@ -5267,6 +5265,87 @@ static void qla4xxx_wait_for_ip_configuration(struct 
scsi_qla_host *ha)
} while (time_after(wtime, jiffies));
 }
 
+static int qla4xxx_cmp_fw_stentry(struct dev_db_entry *fw_ddb_entry,
+ struct dev_db_entry *flash_ddb_entry)
+{
+   uint16_t options = 0;
+   size_t ip_len = IP_ADDR_LEN;
+
+   options = le16_to_cpu(fw_ddb_entry->options);
+   if (options & DDB_OPT_IPV6_DEVICE)
+   ip_len = IPv6_ADDR_LEN;
+
+   if (memcmp(fw_ddb_entry->ip_addr, flash_ddb_entry->ip_addr, ip_len))
+   return QLA_ERROR;
+
+   if (memcmp(&fw_ddb_entry->isid[0], &flash_ddb_entry->isid[0],
+  sizeof(fw_ddb_entry->isid)))
+   return QLA_ERROR;
+
+   if (memcmp(&fw_ddb_entry->port, &flash_ddb_entry->port,
+  sizeof(fw_ddb_entry->port)))
+   return QLA_ERROR;
+
+   return QLA_SUCCESS;
+}
+
+static int qla4xxx_find_flash_st_idx(struct scsi_qla_host *ha,
+struct dev_db_entry *fw_ddb_entry,
+uint32_t fw_idx, uint32_t *flash_index)
+{
+   struct dev_db_entry *flash_ddb_entry;
+   dma_addr_t flash_ddb_entry_dma;
+   uint32_t idx = 0;
+   int max_ddbs;
+   int ret = QLA_ERROR, status;
+
+   max_ddbs =  is_qla40XX(ha) ? MAX_DEV_DB_ENTRIES_40XX :
+MAX_DEV_DB_ENTRIES;
+
+   flash_ddb_entry = dma_pool_alloc(ha->fw_ddb_dma_pool, GFP_KERNEL,
+&flash_ddb_entry_dma);
+   if (flash_ddb_entry == NULL || fw_ddb_entry == NULL) {
+   ql4_printk(KERN_ERR, ha, "Out of memory\n");
+   goto exit_find_st_idx;
+   }
+
+   status = qla4xxx_flashdb_by_index(ha, flash_ddb_entry,
+ flash_ddb_entry_dma, fw_idx);
+   if (status == QLA_SUCCESS) {
+   status = qla4xxx_cmp_fw_stentry(fw_ddb_entry, flash_ddb_entry);
+   if (status == QLA_SUCCESS) {
+   *flash_index = fw_idx;
+   ret = QLA_SUCCESS;
+   goto exit_find_st_idx;
+   }
+   }
+
+   for (idx = 0; idx < max_ddbs; idx++) {
+   status = qla4xxx_flashdb_by_index(ha, flash_ddb_entry,
+ flash_ddb_entry_dma, idx);

[PATCH 1/7] qla4xxx: Correct the check for local CHAP entry type

2013-09-17 Thread adheer.chandravanshi
From: Adheer Chandravanshi 

Use correct bit flag to check the type of CHAP entry.

Signed-off-by: Adheer Chandravanshi 
Signed-off-by: Vikas Chaudhary 
---
 drivers/scsi/qla4xxx/ql4_mbx.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index 62d4208..5eef7d1 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -1611,7 +1611,7 @@ int qla4xxx_get_uni_chap_at_index(struct scsi_qla_host 
*ha, char *username,
goto exit_unlock_uni_chap;
}
 
-   if (!(chap_table->flags & BIT_6)) {
+   if (!(chap_table->flags & BIT_7)) {
ql4_printk(KERN_ERR, ha, "Unidirectional entry not set\n");
rval = QLA_ERROR;
goto exit_unlock_uni_chap;
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/7] qla4xxx: Use offset based on adapter type to set CHAP entry in flash

2013-09-17 Thread adheer.chandravanshi
From: Adheer Chandravanshi 

To write a CHAP entry in adapter's flash calculate the offset based
on the type of adapter.

Signed-off-by: Adheer Chandravanshi 
Signed-off-by: Vikas Chaudhary 
---
 drivers/scsi/qla4xxx/ql4_mbx.c |   16 +++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index 5eef7d1..121be42 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -1537,6 +1537,7 @@ static int qla4xxx_set_chap(struct scsi_qla_host *ha, 
char *username,
int rval = QLA_ERROR;
uint32_t offset = 0;
struct ql4_chap_table *chap_table;
+   uint32_t chap_size = 0;
dma_addr_t chap_dma;
 
chap_table = dma_pool_alloc(ha->chap_dma_pool, GFP_KERNEL, &chap_dma);
@@ -1554,7 +1555,20 @@ static int qla4xxx_set_chap(struct scsi_qla_host *ha, 
char *username,
strncpy(chap_table->secret, password, MAX_CHAP_SECRET_LEN);
strncpy(chap_table->name, username, MAX_CHAP_NAME_LEN);
chap_table->cookie = __constant_cpu_to_le16(CHAP_VALID_COOKIE);
-   offset = FLASH_CHAP_OFFSET | (idx * sizeof(struct ql4_chap_table));
+
+   if (is_qla40XX(ha)) {
+   chap_size = MAX_CHAP_ENTRIES_40XX * sizeof(*chap_table);
+   offset = FLASH_CHAP_OFFSET;
+   } else { /* Single region contains CHAP info for both ports which is
+ * divided into half for each port.
+ */
+   chap_size = ha->hw.flt_chap_size / 2;
+   offset = FLASH_RAW_ACCESS_ADDR + (ha->hw.flt_region_chap << 2);
+   if (ha->port_num == 1)
+   offset += chap_size;
+   }
+
+   offset += (idx * sizeof(struct ql4_chap_table));
rval = qla4xxx_set_flash(ha, chap_dma, offset,
sizeof(struct ql4_chap_table),
FLASH_OPT_RMW_COMMIT);
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 7/7] qla4xxx: Add support to get CHAP details for flash target session

2013-09-17 Thread adheer.chandravanshi
From: Adheer Chandravanshi 

Add support to get local CHAP - index, username and password,
sysfs params of iscsi session corresponding to flash target entry.

Signed-off-by: Adheer Chandravanshi 
Signed-off-by: Vikas Chaudhary 
---
 drivers/scsi/qla4xxx/ql4_os.c |   41 ++---
 1 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 933c766..6dc3e99 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -1652,9 +1652,12 @@ static int qla4xxx_session_get_param(struct 
iscsi_cls_session *cls_sess,
struct iscsi_session *sess = cls_sess->dd_data;
struct ddb_entry *ddb_entry = sess->dd_data;
struct scsi_qla_host *ha = ddb_entry->ha;
+   struct iscsi_cls_conn *cls_conn = ddb_entry->conn;
+   struct ql4_chap_table chap_tbl;
int rval, len;
uint16_t idx;
 
+   memset(&chap_tbl, 0, sizeof(chap_tbl));
switch (param) {
case ISCSI_PARAM_CHAP_IN_IDX:
rval = qla4xxx_get_chap_index(ha, sess->username_in,
@@ -1666,14 +1669,46 @@ static int qla4xxx_session_get_param(struct 
iscsi_cls_session *cls_sess,
len = sprintf(buf, "%hu\n", idx);
break;
case ISCSI_PARAM_CHAP_OUT_IDX:
-   rval = qla4xxx_get_chap_index(ha, sess->username,
- sess->password, LOCAL_CHAP,
- &idx);
+   if (ddb_entry->ddb_type == FLASH_DDB) {
+   if (ddb_entry->chap_tbl_idx != INVALID_ENTRY) {
+   idx = ddb_entry->chap_tbl_idx;
+   rval = QLA_SUCCESS;
+   } else {
+   rval = QLA_ERROR;
+   }
+   } else {
+   rval = qla4xxx_get_chap_index(ha, sess->username,
+ sess->password,
+ LOCAL_CHAP, &idx);
+   }
if (rval)
len = sprintf(buf, "\n");
else
len = sprintf(buf, "%hu\n", idx);
break;
+   case ISCSI_PARAM_USERNAME:
+   case ISCSI_PARAM_PASSWORD:
+   /* First, populate session username and password for FLASH DDB,
+* if not already done. This happens when session login fails
+* for a FLASH DDB.
+*/
+   if (ddb_entry->ddb_type == FLASH_DDB &&
+   ddb_entry->chap_tbl_idx != INVALID_ENTRY &&
+   !sess->username && !sess->password) {
+   idx = ddb_entry->chap_tbl_idx;
+   rval = qla4xxx_get_uni_chap_at_index(ha, chap_tbl.name,
+   chap_tbl.secret,
+   idx);
+   if (!rval) {
+   iscsi_set_param(cls_conn, ISCSI_PARAM_USERNAME,
+   (char *)chap_tbl.name,
+   strlen((char *)chap_tbl.name));
+   iscsi_set_param(cls_conn, ISCSI_PARAM_PASSWORD,
+   (char *)chap_tbl.secret,
+   chap_tbl.secret_len);
+   }
+   }
+   /* allow fall-through */
default:
return iscsi_session_get_param(cls_sess, param, buf);
}
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/7] scsi_transport_iscsi: Add support to set CHAP entries

2013-09-17 Thread adheer.chandravanshi
From: Adheer Chandravanshi 

For offload iSCSI like qla4xxx, CHAP entries are stored in adapter's
flash.
This patch adds support to add/update CHAP entries in adapter's flash
using iscsi tools, like Open-iSCSI.

Signed-off-by: Adheer Chandravanshi 
Signed-off-by: Vikas Chaudhary 
---
 drivers/scsi/scsi_transport_iscsi.c |   26 ++
 include/scsi/iscsi_if.h |   17 +
 include/scsi/scsi_transport_iscsi.h |1 +
 3 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/scsi_transport_iscsi.c 
b/drivers/scsi/scsi_transport_iscsi.c
index e4a989f..63a6ca4 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -2744,6 +2744,28 @@ exit_get_chap:
return err;
 }
 
+static int iscsi_set_chap(struct iscsi_transport *transport,
+ struct iscsi_uevent *ev, uint32_t len)
+{
+   char *data = (char *)ev + sizeof(*ev);
+   struct Scsi_Host *shost;
+   int err = 0;
+
+   if (!transport->set_chap)
+   return -ENOSYS;
+
+   shost = scsi_host_lookup(ev->u.set_path.host_no);
+   if (!shost) {
+   pr_err("%s could not find host no %u\n",
+  __func__, ev->u.set_path.host_no);
+   return -ENODEV;
+   }
+
+   err = transport->set_chap(shost, data, len);
+   scsi_host_put(shost);
+   return err;
+}
+
 static int iscsi_delete_chap(struct iscsi_transport *transport,
 struct iscsi_uevent *ev)
 {
@@ -3234,6 +3256,10 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr 
*nlh, uint32_t *group)
case ISCSI_UEVENT_LOGOUT_FLASHNODE_SID:
err = iscsi_logout_flashnode_sid(transport, ev);
break;
+   case ISCSI_UEVENT_SET_CHAP:
+   err = iscsi_set_chap(transport, ev,
+nlmsg_attrlen(nlh, sizeof(*ev)));
+   break;
default:
err = -ENOSYS;
break;
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index 13d81c5..5d6ed6c 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -69,6 +69,7 @@ enum iscsi_uevent_e {
ISCSI_UEVENT_LOGIN_FLASHNODE= UEVENT_BASE + 28,
ISCSI_UEVENT_LOGOUT_FLASHNODE   = UEVENT_BASE + 29,
ISCSI_UEVENT_LOGOUT_FLASHNODE_SID   = UEVENT_BASE + 30,
+   ISCSI_UEVENT_SET_CHAP   = UEVENT_BASE + 31,
 
/* up events */
ISCSI_KEVENT_RECV_PDU   = KEVENT_BASE + 1,
@@ -309,8 +310,16 @@ enum iscsi_param_type {
ISCSI_HOST_PARAM,   /* iscsi_host_param */
ISCSI_NET_PARAM,/* iscsi_net_param */
ISCSI_FLASHNODE_PARAM,  /* iscsi_flashnode_param */
+   ISCSI_CHAP_PARAM,   /* iscsi_chap_param */
 };
 
+/* structure for minimalist usecase */
+struct iscsi_param_info {
+   uint32_t len;   /* Actual length of the param value */
+   uint16_t param; /* iscsi param */
+   uint8_t value[0];   /* length sized value follows */
+} __packed;
+
 struct iscsi_iface_param_info {
uint32_t iface_num; /* iface number, 0 - n */
uint32_t len;   /* Actual length of the param */
@@ -739,6 +748,14 @@ enum chap_type_e {
CHAP_TYPE_IN,
 };
 
+enum iscsi_chap_param {
+   ISCSI_CHAP_PARAM_INDEX,
+   ISCSI_CHAP_PARAM_CHAP_TYPE,
+   ISCSI_CHAP_PARAM_USERNAME,
+   ISCSI_CHAP_PARAM_PASSWORD,
+   ISCSI_CHAP_PARAM_PASSWORD_LEN
+};
+
 #define ISCSI_CHAP_AUTH_NAME_MAX_LEN   256
 #define ISCSI_CHAP_AUTH_SECRET_MAX_LEN 256
 struct iscsi_chap_rec {
diff --git a/include/scsi/scsi_transport_iscsi.h 
b/include/scsi/scsi_transport_iscsi.h
index d0f1602..fe7c8f3 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -152,6 +152,7 @@ struct iscsi_transport {
int (*get_chap) (struct Scsi_Host *shost, uint16_t chap_tbl_idx,
 uint32_t *num_entries, char *buf);
int (*delete_chap) (struct Scsi_Host *shost, uint16_t chap_tbl_idx);
+   int (*set_chap) (struct Scsi_Host *shost, void *data, int len);
int (*get_flashnode_param) (struct iscsi_bus_flash_session *fnode_sess,
int param, char *buf);
int (*set_flashnode_param) (struct iscsi_bus_flash_session *fnode_sess,
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/7] qla4xxx: Support setting of local CHAP index for flash target entry

2013-09-17 Thread adheer.chandravanshi
From: Adheer Chandravanshi 

Support setting of CHAP_OUT_IDX param for the target entry in flash.
Setting of valid local CHAP index with enable CHAP AUTH for that
flash target entry and disabling CHAP AUTH will invalidate the CHAP
index for the flash target entry.

Signed-off-by: Adheer Chandravanshi 
Signed-off-by: Vikas Chaudhary 
---
 drivers/scsi/qla4xxx/ql4_fw.h |4 
 drivers/scsi/qla4xxx/ql4_os.c |   18 ++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_fw.h b/drivers/scsi/qla4xxx/ql4_fw.h
index 51d1a70..1243e59 100644
--- a/drivers/scsi/qla4xxx/ql4_fw.h
+++ b/drivers/scsi/qla4xxx/ql4_fw.h
@@ -539,6 +539,10 @@ struct qla_flt_region {
 #define ENABLE_INTERNAL_LOOPBACK   0x04
 #define ENABLE_EXTERNAL_LOOPBACK   0x08
 
+/* generic defines to enable/disable params */
+#define QL4_PARAM_DISABLE  0
+#define QL4_PARAM_ENABLE   1
+
 /*/
 
 /* Host Adapter Initialization Control Block (from host) */
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index a8847a3..057d068 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -6684,10 +6684,13 @@ qla4xxx_sysfs_ddb_set_param(struct 
iscsi_bus_flash_session *fnode_sess,
struct Scsi_Host *shost = iscsi_flash_session_to_shost(fnode_sess);
struct scsi_qla_host *ha = to_qla_host(shost);
struct iscsi_flashnode_param_info *fnode_param;
+   struct ql4_chap_table chap_tbl;
struct nlattr *attr;
+   uint16_t chap_out_idx = INVALID_ENTRY;
int rc = QLA_ERROR;
uint32_t rem = len;
 
+   memset((void *)&chap_tbl, 0, sizeof(chap_tbl));
nla_for_each_attr(attr, data, len, rem) {
fnode_param = nla_data(attr);
 
@@ -6729,6 +6732,10 @@ qla4xxx_sysfs_ddb_set_param(struct 
iscsi_bus_flash_session *fnode_sess,
break;
case ISCSI_FLASHNODE_CHAP_AUTH_EN:
fnode_sess->chap_auth_en = fnode_param->value[0];
+   /* Invalidate chap index if chap auth is disabled */
+   if (!fnode_sess->chap_auth_en)
+   fnode_sess->chap_out_idx = INVALID_ENTRY;
+
break;
case ISCSI_FLASHNODE_SNACK_REQ_EN:
fnode_conn->snack_req_en = fnode_param->value[0];
@@ -6867,6 +6874,17 @@ qla4xxx_sysfs_ddb_set_param(struct 
iscsi_bus_flash_session *fnode_sess,
fnode_conn->exp_statsn =
*(uint32_t *)fnode_param->value;
break;
+   case ISCSI_FLASHNODE_CHAP_OUT_IDX:
+   chap_out_idx = *(uint16_t *)fnode_param->value;
+   if (!qla4xxx_get_uni_chap_at_index(ha,
+  chap_tbl.name,
+  chap_tbl.secret,
+  chap_out_idx)) {
+   fnode_sess->chap_out_idx = chap_out_idx;
+   /* Enable chap auth if chap index is valid */
+   fnode_sess->chap_auth_en = QL4_PARAM_ENABLE;
+   }
+   break;
default:
ql4_printk(KERN_ERR, ha,
   "%s: No such sysfs attribute\n", __func__);
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/7] qla4xxx: Populate local CHAP credentials for flash target sessions

2013-09-17 Thread adheer.chandravanshi
From: Adheer Chandravanshi 

If any flash target entry is using CHAP authentication then set
CHAP username and password sysfs params for the corresponding
iscsi sessions.

Signed-off-by: Adheer Chandravanshi 
Signed-off-by: Vikas Chaudhary 
---
 drivers/scsi/qla4xxx/ql4_os.c |   16 
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 057d068..4547880 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -2397,6 +2397,7 @@ static void qla4xxx_copy_fwddb_param(struct scsi_qla_host 
*ha,
int buflen = 0;
struct iscsi_session *sess;
struct ddb_entry *ddb_entry;
+   struct ql4_chap_table chap_tbl;
struct iscsi_conn *conn;
char ip_addr[DDB_IPADDR_LEN];
uint16_t options = 0;
@@ -2404,6 +2405,7 @@ static void qla4xxx_copy_fwddb_param(struct scsi_qla_host 
*ha,
sess = cls_sess->dd_data;
ddb_entry = sess->dd_data;
conn = cls_conn->dd_data;
+   memset(&chap_tbl, 0, sizeof(chap_tbl));
 
ddb_entry->chap_tbl_idx = le16_to_cpu(fw_ddb_entry->chap_tbl_idx);
 
@@ -2430,6 +2432,19 @@ static void qla4xxx_copy_fwddb_param(struct 
scsi_qla_host *ha,
(char *)fw_ddb_entry->iscsi_name, buflen);
iscsi_set_param(cls_conn, ISCSI_PARAM_INITIATOR_NAME,
(char *)ha->name_string, buflen);
+
+   if (ddb_entry->chap_tbl_idx != INVALID_ENTRY) {
+   if (!qla4xxx_get_uni_chap_at_index(ha, chap_tbl.name,
+  chap_tbl.secret,
+  ddb_entry->chap_tbl_idx)) {
+   iscsi_set_param(cls_conn, ISCSI_PARAM_USERNAME,
+   (char *)chap_tbl.name,
+   strlen((char *)chap_tbl.name));
+   iscsi_set_param(cls_conn, ISCSI_PARAM_PASSWORD,
+   (char *)chap_tbl.secret,
+   chap_tbl.secret_len);
+   }
+   }
 }
 
 void qla4xxx_update_session_conn_fwddb_param(struct scsi_qla_host *ha,
@@ -5204,6 +5219,7 @@ static void qla4xxx_setup_flash_ddb_entry(struct 
scsi_qla_host *ha,
ddb_entry->ha = ha;
ddb_entry->unblock_sess = qla4xxx_unblock_flash_ddb;
ddb_entry->ddb_change = qla4xxx_flash_ddb_change;
+   ddb_entry->chap_tbl_idx = INVALID_ENTRY;
 
atomic_set(&ddb_entry->retry_relogin_timer, INVALID_ENTRY);
atomic_set(&ddb_entry->relogin_timer, 0);
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/7] qla4xxx: Updates for scsi "misc" branch

2013-09-17 Thread adheer.chandravanshi
From: Adheer Chandravanshi 

James,

Please apply the following patches to the scsi tree at your earliest 
convenience.

These patches are on top of other qla4xxx patch posted on list here:
http://marc.info/?l=linux-scsi&m=137941920702034&w=2

Adheer Chandravanshi (7):
  qla4xxx: Correct the check for local CHAP entry type
  qla4xxx: Support setting of local CHAP index for flash target entry
  qla4xxx: Populate local CHAP credentials for flash target sessions
  qla4xxx: Use offset based on adapter type to set CHAP entry in flash
  scsi_transport_iscsi: Add support to set CHAP entries
  qla4xxx: Add support to set CHAP entries
  qla4xxx: Add support to get CHAP details for flash target session

Thanks,
Adheer

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/7] qla4xxx: Add support to set CHAP entries

2013-09-17 Thread adheer.chandravanshi
From: Adheer Chandravanshi 

Provide support to add/update the CHAP entries in adapter's flash
using iscsi tools, like Open-iSCSI.

Signed-off-by: Adheer Chandravanshi 
Signed-off-by: Vikas Chaudhary 
---
 drivers/scsi/qla4xxx/ql4_glbl.h   |2 +
 drivers/scsi/qla4xxx/ql4_inline.h |   12 +++
 drivers/scsi/qla4xxx/ql4_mbx.c|   16 +++-
 drivers/scsi/qla4xxx/ql4_os.c |  197 +
 4 files changed, 225 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_glbl.h b/drivers/scsi/qla4xxx/ql4_glbl.h
index e6f2a26..5cef252 100644
--- a/drivers/scsi/qla4xxx/ql4_glbl.h
+++ b/drivers/scsi/qla4xxx/ql4_glbl.h
@@ -83,6 +83,8 @@ int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t 
inCount,
uint8_t outCount, uint32_t *mbx_cmd, uint32_t *mbx_sts);
 int qla4xxx_get_chap_index(struct scsi_qla_host *ha, char *username,
   char *password, int bidi, uint16_t *chap_index);
+int qla4xxx_set_chap(struct scsi_qla_host *ha, char *username, char *password,
+uint16_t idx, int bidi);
 
 void qla4xxx_queue_iocb(struct scsi_qla_host *ha);
 void qla4xxx_complete_iocb(struct scsi_qla_host *ha);
diff --git a/drivers/scsi/qla4xxx/ql4_inline.h 
b/drivers/scsi/qla4xxx/ql4_inline.h
index 8503ad6..655b7bb 100644
--- a/drivers/scsi/qla4xxx/ql4_inline.h
+++ b/drivers/scsi/qla4xxx/ql4_inline.h
@@ -82,3 +82,15 @@ qla4xxx_disable_intrs(struct scsi_qla_host *ha)
__qla4xxx_disable_intrs(ha);
spin_unlock_irqrestore(&ha->hardware_lock, flags);
 }
+
+static inline int qla4xxx_get_chap_type(struct ql4_chap_table *chap_entry)
+{
+   int type;
+
+   if (chap_entry->flags & BIT_7)
+   type = LOCAL_CHAP;
+   else
+   type = BIDI_CHAP;
+
+   return type;
+}
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index 121be42..22cbd00 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -1530,8 +1530,20 @@ exit_get_chap:
return ret;
 }
 
-static int qla4xxx_set_chap(struct scsi_qla_host *ha, char *username,
-   char *password, uint16_t idx, int bidi)
+/**
+ * qla4xxx_set_chap - Make a chap entry at the given index
+ * @ha: pointer to adapter structure
+ * @username: CHAP username to set
+ * @password: CHAP password to set
+ * @idx: CHAP index at which to make the entry
+ * @bidi: type of chap entry (chap_in or chap_out)
+ *
+ * Create chap entry at the given index with the information provided.
+ *
+ * Note: Caller should acquire the chap lock before getting here.
+ **/
+int qla4xxx_set_chap(struct scsi_qla_host *ha, char *username, char *password,
+uint16_t idx, int bidi)
 {
int ret = 0;
int rval = QLA_ERROR;
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 4547880..933c766 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -149,6 +149,8 @@ static int qla4xxx_send_ping(struct Scsi_Host *shost, 
uint32_t iface_num,
 static int qla4xxx_get_chap_list(struct Scsi_Host *shost, uint16_t 
chap_tbl_idx,
 uint32_t *num_entries, char *buf);
 static int qla4xxx_delete_chap(struct Scsi_Host *shost, uint16_t chap_tbl_idx);
+static int qla4xxx_set_chap_entry(struct Scsi_Host *shost, void  *data,
+ int len);
 
 /*
  * SCSI host template entry points
@@ -252,6 +254,7 @@ static struct iscsi_transport qla4xxx_iscsi_transport = {
.send_ping  = qla4xxx_send_ping,
.get_chap   = qla4xxx_get_chap_list,
.delete_chap= qla4xxx_delete_chap,
+   .set_chap   = qla4xxx_set_chap_entry,
.get_flashnode_param= qla4xxx_sysfs_ddb_get_param,
.set_flashnode_param= qla4xxx_sysfs_ddb_set_param,
.new_flashnode  = qla4xxx_sysfs_ddb_add,
@@ -508,6 +511,95 @@ static umode_t qla4_attr_is_visible(int param_type, int 
param)
return 0;
 }
 
+static int qla4xxx_get_chap_by_index(struct scsi_qla_host *ha,
+int16_t chap_index,
+struct ql4_chap_table **chap_entry)
+{
+   int rval = QLA_ERROR;
+   int max_chap_entries;
+
+   if (!ha->chap_list) {
+   ql4_printk(KERN_ERR, ha, "CHAP table cache is empty!\n");
+   rval = QLA_ERROR;
+   goto exit_get_chap;
+   }
+
+   if (is_qla80XX(ha))
+   max_chap_entries = (ha->hw.flt_chap_size / 2) /
+  sizeof(struct ql4_chap_table);
+   else
+   max_chap_entries = MAX_CHAP_ENTRIES_40XX;
+
+   if (chap_index > max_chap_entries) {
+   ql4_printk(KERN_ERR, ha, "Invalid Chap index\n");
+   rval = QLA_ERROR;
+   goto exit_get_chap;
+   }
+
+   *chap_entry = (struct ql4_chap_table *)ha->chap_list + chap_index

Mail Back iF You Are Interested!

2013-09-17 Thread G.DANIELS
It is Private

I am George Daniels, a Banker and credit system programmer (HSBC bank). 
I saw your email address while browsing through  the bank D.T.C Screen in my 
office yesterday so I decided to use this very chance to know you. I believe we 
should use every opportunity to know each other better. However, I am 
contacting 
you for obvious reason which you will understand. 

I am sending this mail just to know if this email address is OK, reply me back 
so 
that I will send  more details to you. I have a very important thing to discuss 
with 
you, I look forward to receiving your response at: georgedaniel...@matrock.net. 
Have a pleasant day.

George Daniels

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] scsi: delete decade+ obsolete aic7xxx_old driver

2013-09-17 Thread Hannes Reinecke
On 09/17/2013 04:13 AM, Doug Ledford wrote:
> Yes, this driver is well past ready to be removed.
> 
> Acked-by: Doug Ledford 
> 
> Sent from my ASUS Pad
> 
> Paul Gortmaker  wrote:
> 
>> After getting warnings in an allyesconfig build[1] from this
>> driver, I decided to remind myself just how old it was, and
>> whether it warranted fixing.  In the Kconfig help text, I found:
>>
>>  "This driver will eventually be phased out entirely"
>>
>> Going back to the history archive, I see the line was added[2]
>> in Feb 2002, when we moved from v2.4.2.1 ---> v2.4.2.2
>>
>> So, with over a decade of notification, and multiple major releases
>> since then, I think we can justify removing this.  Currently we have
>> people wasting time building it during routine testing, and then
>> wasting more time re-researching the known reported warnings, only to
>> find that nobody really is willing to integrate the fixes[3] for it.
>>
>> A quick search didn't seem to indicate any active user base for it.
>> If someone happens to have a quirky _old_ card that the eleven year
>> old "new" driver doesn't work with, then it is entirely reasonable
>> that they stick with a kernel version that predates this removal.
>>
>> [1] drivers/scsi/aic7xxx_old.c: In function ‘aic7xxx_register’:
>>drivers/scsi/aic7xxx_old.c:7901:5: warning: case value ‘257’ not in 
>> enumerated type ‘ahc_chip’ [-Wswitch]
>>drivers/scsi/aic7xxx_old.c:7898:5: warning: case value ‘513’ not in 
>> enumerated type ‘ahc_chip’ [-Wswitch]
>>drivers/scsi/aic7xxx_old.c: In function ‘aic7xxx_load_seeprom’:
>>drivers/scsi/aic7xxx_old.c:8517:5: warning: case value ‘257’ not in 
>> enumerated type ‘ahc_chip’ [-Wswitch]
>>drivers/scsi/aic7xxx_old.c:8510:5: warning: case value ‘513’ not in 
>> enumerated type ‘ahc_chip’ [-Wswitch]
>>
>> [2] http://git.kernel.org/cgit/linux/kernel/git/tglx/history.git commit 
>> 44e8778c
>>
>> [3] https://lkml.org/lkml/2012/10/29/215
>>
>> Cc: Hannes Reinecke 
>> Cc: Doug Ledford 
>> Cc: "James E.J. Bottomley" 
>> Signed-off-by: Paul Gortmaker 

However, if we do this we're removing support for any non-PCI based
adapters. I personally doubt that there are any installations left
running on (E)ISA or VLB. But we should be clear on this.

In general I'm in favour removing obsolete drivers, so

Acked-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes Reinecke   zSeries & Storage
h...@suse.de  +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] scsi: delete decade+ obsolete aic7xxx_old driver

2013-09-17 Thread Paul Gortmaker
On 13-09-17 10:29 AM, Hannes Reinecke wrote:
> On 09/17/2013 04:13 AM, Doug Ledford wrote:
>> Yes, this driver is well past ready to be removed.
>>
>> Acked-by: Doug Ledford 
>>
>> Sent from my ASUS Pad
>>
>> Paul Gortmaker  wrote:
>>
>>> After getting warnings in an allyesconfig build[1] from this
>>> driver, I decided to remind myself just how old it was, and
>>> whether it warranted fixing.  In the Kconfig help text, I found:
>>>
>>>  "This driver will eventually be phased out entirely"
>>>
>>> Going back to the history archive, I see the line was added[2]
>>> in Feb 2002, when we moved from v2.4.2.1 ---> v2.4.2.2
>>>
>>> So, with over a decade of notification, and multiple major releases
>>> since then, I think we can justify removing this.  Currently we have
>>> people wasting time building it during routine testing, and then
>>> wasting more time re-researching the known reported warnings, only to
>>> find that nobody really is willing to integrate the fixes[3] for it.
>>>
>>> A quick search didn't seem to indicate any active user base for it.
>>> If someone happens to have a quirky _old_ card that the eleven year
>>> old "new" driver doesn't work with, then it is entirely reasonable
>>> that they stick with a kernel version that predates this removal.
>>>
>>> [1] drivers/scsi/aic7xxx_old.c: In function ‘aic7xxx_register’:
>>>drivers/scsi/aic7xxx_old.c:7901:5: warning: case value ‘257’ not in 
>>> enumerated type ‘ahc_chip’ [-Wswitch]
>>>drivers/scsi/aic7xxx_old.c:7898:5: warning: case value ‘513’ not in 
>>> enumerated type ‘ahc_chip’ [-Wswitch]
>>>drivers/scsi/aic7xxx_old.c: In function ‘aic7xxx_load_seeprom’:
>>>drivers/scsi/aic7xxx_old.c:8517:5: warning: case value ‘257’ not in 
>>> enumerated type ‘ahc_chip’ [-Wswitch]
>>>drivers/scsi/aic7xxx_old.c:8510:5: warning: case value ‘513’ not in 
>>> enumerated type ‘ahc_chip’ [-Wswitch]
>>>
>>> [2] http://git.kernel.org/cgit/linux/kernel/git/tglx/history.git commit 
>>> 44e8778c
>>>
>>> [3] https://lkml.org/lkml/2012/10/29/215
>>>
>>> Cc: Hannes Reinecke 
>>> Cc: Doug Ledford 
>>> Cc: "James E.J. Bottomley" 
>>> Signed-off-by: Paul Gortmaker 
> 
> However, if we do this we're removing support for any non-PCI based
> adapters. I personally doubt that there are any installations left
> running on (E)ISA or VLB. But we should be clear on this.

Is the Kconfig text for the "new" driver wrong then?  It says:

 -
config SCSI_AIC7XXX
tristate "Adaptec AIC7xxx Fast -> U160 support (New Driver)"
depends on (PCI || EISA) && SCSI
select SCSI_SPI_ATTRS
---help---
This driver supports all of Adaptec's Fast through Ultra 160 PCI
based SCSI controllers as well as the aic7770 based EISA and VLB
SCSI controllers (the 274x and 284x series).
 -

So, as long as you'd enabled either of PCI or EISA, a VLB card should
work too.  (Of course you are correct in doubting that anyone is genuinely
using a 486 VLB system with ~16MB RAM, so it is largely a moot point.)

[I probably could delete that "(New Driver)" text as part of this commit too].

Thanks,
Paul.
--

> 
> In general I'm in favour removing obsolete drivers, so
> 
> Acked-by: Hannes Reinecke 
> 
> Cheers,
> 
> Hannes
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] sg: relax 16 byte cdb restriction

2013-09-17 Thread Douglas Gilbert

From time to time I am asked how to pass a 32 byte SCSI
command (cdb) through the sg driver. My stock answer is
to refer people to the bsg driver for that purpose.
Since the bsg driver and the sg driver now make essentially
the same calls to the underlying block layer interface
it seems about time to relax the 16 byte cdb restriction
on the sg driver. Obviously the implementation to do this
has been well tested already by the bsg driver so the same
implementation is lifted by this patch into the sg driver.

SPC-4 (draft rev 36i section 3.1.30) states the maximum cdb
size in SCSI is 260 bytes. [Seems to me XCDBs could exceed
that since they can contain multiple XCDB descriptors each
of which is 140 bytes long.] Anyway the sg v3 interface
(sg_io_hdr as used by the sg driver) restricts the cdb length
by the type of its 'unsigned char cmd_len;' field, namely
255. So not quite 260 but better than 16. The bsg driver
uses a uint32_t for its cdb length field and may want to
consider putting an upper limit on that ...

Documentation: This file in the kernel:
  Documentation/scsi/scsi-generic.txt
does not describe the sg v3 interface but instead points to
this page:
  http://sg.danny.cz/sg/p/sg_v3_ho.html
which does describe the sg v3 interface. If this patch is
accepted I will update the description of the cmd_len
field in that web page.


ChangeLog:
- remove the 16 byte CDB (SCSI command) length limit
  from the sg driver by handling longer CDBs the same
  way as the bsg driver. Remove comment from sg.h
  public interface about the cmd_len field being
  limited to 16 bytes.

Signed-off-by: Douglas Gilbert 

diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 5cbc4bb..c46d4b2 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -7,7 +7,7 @@
  * Original driver (sg.c):
  *Copyright (C) 1992 Lawrence Foard
  * Version 2 and 3 extensions to driver:
- *Copyright (C) 1998 - 2005 Douglas Gilbert
+ *Copyright (C) 1998 - 2013 Douglas Gilbert
  *
  *  Modified  19-JAN-1998  Richard Gooch   Devfs support
  *
@@ -18,8 +18,8 @@
  *
  */
 
-static int sg_version_num = 30534;	/* 2 digits for each component */
-#define SG_VERSION_STR "3.5.34"
+static int sg_version_num = 30535;	/* 2 digits for each component */
+#define SG_VERSION_STR "3.5.35"
 
 /*
  *  D. P. Gilbert (dgilb...@interlog.com, do...@triode.net.au), notes:
@@ -64,7 +64,7 @@ static int sg_version_num = 30534;	/* 2 digits for each component */
 
 #ifdef CONFIG_SCSI_PROC_FS
 #include 
-static char *sg_version_date = "20061027";
+static char *sg_version_date = "20130916";
 
 static int sg_proc_init(void);
 static void sg_proc_cleanup(void);
@@ -74,6 +74,9 @@ static void sg_proc_cleanup(void);
 
 #define SG_MAX_DEVS 32768
 
+#define SG_MAX_CDB_SIZE 255	/* should be 260: spc4r36i 3.1.30 */
+
+
 /*
  * Suppose you want to calculate the formula muldiv(x,m,d)=int(x * m / d)
  * Then when using 32 bit integers x * m may overflow during the calculation.
@@ -542,7 +545,7 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
 	Sg_request *srp;
 	struct sg_header old_hdr;
 	sg_io_hdr_t *hp;
-	unsigned char cmnd[MAX_COMMAND_SIZE];
+	unsigned char cmnd[SG_MAX_CDB_SIZE];
 
 	if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp)))
 		return -ENXIO;
@@ -574,7 +577,7 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
 	buf += SZ_SG_HEADER;
 	__get_user(opcode, buf);
 	if (sfp->next_cmd_len > 0) {
-		if (sfp->next_cmd_len > MAX_COMMAND_SIZE) {
+		if (sfp->next_cmd_len > SG_MAX_CDB_SIZE) {
 			SCSI_LOG_TIMEOUT(1, printk("sg_write: command length too long\n"));
 			sfp->next_cmd_len = 0;
 			sg_remove_request(sfp, srp);
@@ -651,7 +654,7 @@ sg_new_write(Sg_fd *sfp, struct file *file, const char __user *buf,
 	int k;
 	Sg_request *srp;
 	sg_io_hdr_t *hp;
-	unsigned char cmnd[MAX_COMMAND_SIZE];
+	unsigned char cmnd[SG_MAX_CDB_SIZE];
 	int timeout;
 	unsigned long ul_timeout;
 
@@ -1624,14 +1627,25 @@ static int sg_start_req(Sg_request *srp, unsigned char *cmd)
 	struct request_queue *q = sfp->parentdp->device->request_queue;
 	struct rq_map_data *md, map_data;
 	int rw = hp->dxfer_direction == SG_DXFER_TO_DEV ? WRITE : READ;
+	unsigned char * long_cmdp = NULL;
 
 	SCSI_LOG_TIMEOUT(4, printk(KERN_INFO "sg_start_req: dxfer_len=%d\n",
    dxfer_len));
+	if (hp->cmd_len > BLK_MAX_CDB) {
+		long_cmdp = kzalloc(hp->cmd_len, GFP_KERNEL);
+		if (!long_cmdp)
+			return -ENOMEM;
+	}
 
 	rq = blk_get_request(q, rw, GFP_ATOMIC);
-	if (!rq)
+	if (!rq) {
+		if (long_cmdp)
+			kfree(long_cmdp);
 		return -ENOMEM;
+	}
 
+	if (hp->cmd_len > BLK_MAX_CDB)
+		rq->cmd = long_cmdp;
 	memcpy(rq->cmd, cmd, hp->cmd_len);
 
 	rq->cmd_len = hp->cmd_len;
@@ -1718,6 +1732,8 @@ static int sg_finish_rem_req(Sg_request * srp)
 		if (srp->bio)
 			ret = blk_rq_unmap_user(srp->bio);
 
+		if (srp->rq->cmd != srp->rq->__cmd)
+			kfree(srp->rq->cmd);
 		blk_put_request(srp->rq);
 	}
 
diff -

[no subject]

2013-09-17 Thread Gillian Adrian Bayford
we will be donating £1.5 Million Pounds to you in our ongoing lucky draws 
donations. Please get back to us with your Name, Age, Tel, Country and i will 
send you more details how your funds will be sent to you.Please read the 
article - http://www.bbc.co.uk/news/uk-england-19254228
gillianadrianbayf...@dgoh.org
 Gillian & Adrian Bayford 
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: scsi: delete decade+ obsolete aic7xxx_old driver

2013-09-17 Thread Paul Bolle
On Mon, 2013-09-16 at 21:51 -0400, Paul Gortmaker wrote:
> Currently we have people wasting time building it during routine testing,
> and then wasting more time re-researching the known reported warnings,
> only to find that nobody really is willing to integrate the fixes[3] for
> it.
> 
>[...]
>
> [3] https://lkml.org/lkml/2012/10/29/215

Well, this didn't end up as an entire waste of my time. After that
message I sent a patch to Fedora's kernel list, and a reminder a few
months later[1]. That prompted Josh Boyer to remove this old driver from
the Fedora build[2].

And now that driver is disabled in all kernels that Fedora currently
ships. I'm not familiar with any complaints about this decision.


Paul Bolle

[1] https://lists.fedoraproject.org/pipermail/kernel/2013-February/004102.html
[2] 
http://pkgs.fedoraproject.org/cgit/kernel.git/commit/?id=2192022f4bf13b30e389e77170da7ae08fd28ecf

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Does Linux support 32-byte CDBs

2013-09-17 Thread Nicholas A. Bellinger
Hi Andrew,

(Adding CC' to linux-scsi, as it's a more appropriate venue than the
target list)

On Mon, 2013-09-16 at 13:27 -0700, Andrew Falanga wrote:
> Hello,
> 
> I truly hope that this is the correct forum for this question.  If
> not, forgive me and if possible, please direct me to the correct
> forum.  My question is quite simple (I hope the answer is equally
> simple).  Does Linux support 32-byte CDBs in SCSI?  I've done enough
> research that I think the answer may depend on the kernel version in
> use, and the particular upper layer driver in use (i.e. sd, sg, bsg,
> etc.).  If so, the relevant information from my linux system is:
> 
> * CentOS 6.2  -- 2.6.32-71 kernel  32-bit
> 
> I'd be using the SG driver.
> 

My understanding is that you need to use BSG in order to submit > 16
byte CDBs from userspace.

Also, sd.c will generate > 16 byte CDBs (eg: WRITE_32 + READ_32) when
DIF protection is enabled.

I believe that both are supported on v2.6.32.x, but you might want to
double check to be sure.

--nab


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] scsi: delete decade+ obsolete aic7xxx_old driver

2013-09-17 Thread James Bottomley
On Tue, 2013-09-17 at 16:29 +0200, Hannes Reinecke wrote:
> On 09/17/2013 04:13 AM, Doug Ledford wrote:
> > Yes, this driver is well past ready to be removed.
> > 
> > Acked-by: Doug Ledford 
> > 
> > Sent from my ASUS Pad
> > 
> > Paul Gortmaker  wrote:
> > 
> >> After getting warnings in an allyesconfig build[1] from this
> >> driver, I decided to remind myself just how old it was, and
> >> whether it warranted fixing.  In the Kconfig help text, I found:
> >>
> >>  "This driver will eventually be phased out entirely"
> >>
> >> Going back to the history archive, I see the line was added[2]
> >> in Feb 2002, when we moved from v2.4.2.1 ---> v2.4.2.2
> >>
> >> So, with over a decade of notification, and multiple major releases
> >> since then, I think we can justify removing this.  Currently we have
> >> people wasting time building it during routine testing, and then
> >> wasting more time re-researching the known reported warnings, only to
> >> find that nobody really is willing to integrate the fixes[3] for it.
> >>
> >> A quick search didn't seem to indicate any active user base for it.
> >> If someone happens to have a quirky _old_ card that the eleven year
> >> old "new" driver doesn't work with, then it is entirely reasonable
> >> that they stick with a kernel version that predates this removal.
> >>
> >> [1] drivers/scsi/aic7xxx_old.c: In function ‘aic7xxx_register’:
> >>drivers/scsi/aic7xxx_old.c:7901:5: warning: case value ‘257’ not in 
> >> enumerated type ‘ahc_chip’ [-Wswitch]
> >>drivers/scsi/aic7xxx_old.c:7898:5: warning: case value ‘513’ not in 
> >> enumerated type ‘ahc_chip’ [-Wswitch]
> >>drivers/scsi/aic7xxx_old.c: In function ‘aic7xxx_load_seeprom’:
> >>drivers/scsi/aic7xxx_old.c:8517:5: warning: case value ‘257’ not in 
> >> enumerated type ‘ahc_chip’ [-Wswitch]
> >>drivers/scsi/aic7xxx_old.c:8510:5: warning: case value ‘513’ not in 
> >> enumerated type ‘ahc_chip’ [-Wswitch]
> >>
> >> [2] http://git.kernel.org/cgit/linux/kernel/git/tglx/history.git commit 
> >> 44e8778c
> >>
> >> [3] https://lkml.org/lkml/2012/10/29/215
> >>
> >> Cc: Hannes Reinecke 
> >> Cc: Doug Ledford 
> >> Cc: "James E.J. Bottomley" 
> >> Signed-off-by: Paul Gortmaker 
> 
> However, if we do this we're removing support for any non-PCI based
> adapters. I personally doubt that there are any installations left
> running on (E)ISA or VLB. But we should be clear on this.

Actually, that's not true: the aic7xxx driver has support for EISA (I
know because I've got one) but not the VLB and some of the really old
cards.

> In general I'm in favour removing obsolete drivers, so

OK, so do we have any real evidence that no-one uses this driver?  Does
any distro actually compile it, for instance?

James


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] scsi: delete decade+ obsolete aic7xxx_old driver

2013-09-17 Thread James Bottomley
On Tue, 2013-09-17 at 16:29 +0200, Hannes Reinecke wrote:
> On 09/17/2013 04:13 AM, Doug Ledford wrote:
> > Yes, this driver is well past ready to be removed.
> > 
> > Acked-by: Doug Ledford 
> > 
> > Sent from my ASUS Pad
> > 
> > Paul Gortmaker  wrote:
> > 
> >> After getting warnings in an allyesconfig build[1] from this
> >> driver, I decided to remind myself just how old it was, and
> >> whether it warranted fixing.  In the Kconfig help text, I found:
> >>
> >>  "This driver will eventually be phased out entirely"
> >>
> >> Going back to the history archive, I see the line was added[2]
> >> in Feb 2002, when we moved from v2.4.2.1 ---> v2.4.2.2
> >>
> >> So, with over a decade of notification, and multiple major releases
> >> since then, I think we can justify removing this.  Currently we have
> >> people wasting time building it during routine testing, and then
> >> wasting more time re-researching the known reported warnings, only to
> >> find that nobody really is willing to integrate the fixes[3] for it.
> >>
> >> A quick search didn't seem to indicate any active user base for it.
> >> If someone happens to have a quirky _old_ card that the eleven year
> >> old "new" driver doesn't work with, then it is entirely reasonable
> >> that they stick with a kernel version that predates this removal.
> >>
> >> [1] drivers/scsi/aic7xxx_old.c: In function ‘aic7xxx_register’:
> >>drivers/scsi/aic7xxx_old.c:7901:5: warning: case value ‘257’ not in 
> >> enumerated type ‘ahc_chip’ [-Wswitch]
> >>drivers/scsi/aic7xxx_old.c:7898:5: warning: case value ‘513’ not in 
> >> enumerated type ‘ahc_chip’ [-Wswitch]
> >>drivers/scsi/aic7xxx_old.c: In function ‘aic7xxx_load_seeprom’:
> >>drivers/scsi/aic7xxx_old.c:8517:5: warning: case value ‘257’ not in 
> >> enumerated type ‘ahc_chip’ [-Wswitch]
> >>drivers/scsi/aic7xxx_old.c:8510:5: warning: case value ‘513’ not in 
> >> enumerated type ‘ahc_chip’ [-Wswitch]
> >>
> >> [2] http://git.kernel.org/cgit/linux/kernel/git/tglx/history.git commit 
> >> 44e8778c
> >>
> >> [3] https://lkml.org/lkml/2012/10/29/215
> >>
> >> Cc: Hannes Reinecke 
> >> Cc: Doug Ledford 
> >> Cc: "James E.J. Bottomley" 
> >> Signed-off-by: Paul Gortmaker 
> 
> However, if we do this we're removing support for any non-PCI based
> adapters. I personally doubt that there are any installations left
> running on (E)ISA or VLB. But we should be clear on this.

Actually, that's not true: the aic7xxx driver has support for EISA (I
know because I've got one) but not the VLB and some of the really old
cards.

> In general I'm in favour removing obsolete drivers, so

OK, so do we have any real evidence that no-one uses this driver?  Does
any distro actually compile it, for instance?

James


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] scsi: delete decade+ obsolete aic7xxx_old driver

2013-09-17 Thread Doug Ledford
On 09/17/13 16:10, James Bottomley wrote:

> OK, so do we have any real evidence that no-one uses this driver?  Does
> any distro actually compile it, for instance?

Red Hat doesn't use it in any of their products (and it hasn't been the
preferred driver since about the old Red Hat Linux 7.0 days).


-- 
Doug Ledford 
  GPG KeyID: 0E572FDD
  http://people.redhat.com/dledford

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 3/6] uas: make work list per-device

2013-09-17 Thread Christoph Hellwig
On Fri, Sep 13, 2013 at 01:27:12PM +0200, Gerd Hoffmann wrote:
> Simplifies locking, we'll protect the list with the device spin lock.
> Also plugs races which can happen when two devices operate on the
> global list.
> 
> While being at it rename the list head from "list" to "work", preparing
> for the addition of a second list.

Why do you even the list?  What would a ordered per-device workqueue not
provide?

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 04/22] be2iscsi: Fix negotiated parameters upload to FW

2013-09-17 Thread Mike Christie
On 09/16/2013 11:28 PM, Jayamohan Kallickal wrote:
> 
> 
> -Original Message-
> From: Mike Christie [mailto:micha...@cs.wisc.edu] 
> Sent: Monday, September 16, 2013 7:59 PM
> To: Jayamohan Kallickal
> Cc: jbottom...@parallels.com; linux-scsi@vger.kernel.org; Jayamohan 
> Kallickal; Sony John-N
> Subject: Re: [PATCH 04/22] be2iscsi: Fix negotiated parameters upload to FW
> 
> On 09/13/2013 12:09 AM, Jayamohan Kallickal wrote:
>>  - If target does not send MaxRecvDSL in login repsonse, then
>>initiator should consider the MaxRecvDSL for target is 8K.
>>In this scenario driver was setting the value to 64K and this
>>caused target to close cxn as data xfer was more than the
>>MaxRecvDSL
>>  - Update connection offload data structure for SKH-R adapters.
>>
>> Signed-off-by: John Soni Jose 
>> Signed-off-by: Jayamohan Kallickal 
>> ---
>>  drivers/scsi/be2iscsi/be_iscsi.c |9 +++--
>>  drivers/scsi/be2iscsi/be_main.h  |   29 -
>>  drivers/scsi/be2iscsi/be_mgmt.c  |8 +++-
>>  3 files changed, 26 insertions(+), 20 deletions(-)
>>
>> diff --git a/drivers/scsi/be2iscsi/be_iscsi.c 
>> b/drivers/scsi/be2iscsi/be_iscsi.c
>> index 2496ea7..60c1dff 100644
>> --- a/drivers/scsi/be2iscsi/be_iscsi.c
>> +++ b/drivers/scsi/be2iscsi/be_iscsi.c
>> @@ -672,9 +672,10 @@ int beiscsi_set_param(struct iscsi_cls_conn *cls_conn,
>>  session->max_burst = 262144;
>>  break;
>>  case ISCSI_PARAM_MAX_XMIT_DLENGTH:
>> -if ((conn->max_xmit_dlength > 65536) ||
>> -(conn->max_xmit_dlength == 0))
>> +if (conn->max_xmit_dlength > 65536)
>>  conn->max_xmit_dlength = 65536;
>> +else if (conn->max_xmit_dlength == 0)
>> +conn->max_xmit_dlength = 8192;
> 
>> Was the target sending 0 or not sending anything at all? Userspace should 
>> not be sending 0 if the target did not send >MaxRecvDSL. It looks like it 
>> should be sending 8k for that case. It looks like there is a bug in the 
>> tools where it will pass 0 >if the target sent 0.
> 
>> It seems other drivers would be hitting this bug too and we should fix 
>> everyone.
> 
> This was an IET target that  did not send any value and we were defaulting to 
> 64K
> 
> Here is a small  userspace fix  that should  go along 
> 
> diff --git a/usr/be2iscsi.c b/usr/be2iscsi.c
> index ce8b719..ba4c29f 100644
> --- a/usr/be2iscsi.c
> +++ b/usr/be2iscsi.c
> @@ -33,10 +33,6 @@ void be2iscsi_create_conn(struct iscsi_conn *conn)
>   if (conn->max_xmit_dlength > 65536)
>   conn->max_xmit_dlength = 65536;
>  
> - if (!conn_rec->iscsi.MaxXmitDataSegmentLength ||
> - conn_rec->iscsi.MaxXmitDataSegmentLength > 65536)
> - conn_rec->iscsi.MaxXmitDataSegmentLength = 65536;
> -
>   session->erl = 0;
>   session->initial_r2t_en = 1;
>  }

For the case you are trying to fix are you getting 0 or 64K from
userspace?  In the kernel code you changed to set the value to 8K it
looks like you got 0 from userspace. Is that right?

Are you setting node.conn[0].iscsi.MaxXmitDataSegmentLength in
iscsif.conf to 64K or did you leave it as the default? Just to make sure
we are on the same page I really mean did you set it in iscsid.conf or
with iscsiadm. I am not talking about setting above in the be2iscsi
create_conn callout.

If it is the default of 0, then I think when the code above is called
iscsi_copy_operational_params will have set conn->max_xmit_dlength to
ISCSI_DEF_MAX_RECV_SEG_LEN (8k). The conn->max_xmit_dlength value is the
one we use for final negotiated value so that is what gets passed to the
kernel.

If the target does not negotiate for MRDSL then it should stay 8k.
iscsi_session_set_params will then pass down conn->max_xmit_dlength when
login is done.

If I am looking at the code right, the only way we can get 0 in the
kernel is if the target sends 0 for MRDSL. iscsid was not expecting that
and will just set conn->max_xmit_dlength to 0 and that will get passed
down to all drivers incorrectly. If I am right then we need to do a fix
for all drivers.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 04/22] be2iscsi: Fix negotiated parameters upload to FW

2013-09-17 Thread Mike Christie
On 09/16/2013 11:28 PM, Jayamohan Kallickal wrote:
> 
> 
> -Original Message-
> From: Mike Christie [mailto:micha...@cs.wisc.edu] 
> Sent: Monday, September 16, 2013 7:59 PM
> To: Jayamohan Kallickal
> Cc: jbottom...@parallels.com; linux-scsi@vger.kernel.org; Jayamohan 
> Kallickal; Sony John-N
> Subject: Re: [PATCH 04/22] be2iscsi: Fix negotiated parameters upload to FW
> 
> On 09/13/2013 12:09 AM, Jayamohan Kallickal wrote:
>>  - If target does not send MaxRecvDSL in login repsonse, then
>>initiator should consider the MaxRecvDSL for target is 8K.
>>In this scenario driver was setting the value to 64K and this
>>caused target to close cxn as data xfer was more than the
>>MaxRecvDSL
>>  - Update connection offload data structure for SKH-R adapters.
>>
>> Signed-off-by: John Soni Jose 
>> Signed-off-by: Jayamohan Kallickal 
>> ---
>>  drivers/scsi/be2iscsi/be_iscsi.c |9 +++--
>>  drivers/scsi/be2iscsi/be_main.h  |   29 -
>>  drivers/scsi/be2iscsi/be_mgmt.c  |8 +++-
>>  3 files changed, 26 insertions(+), 20 deletions(-)
>>
>> diff --git a/drivers/scsi/be2iscsi/be_iscsi.c 
>> b/drivers/scsi/be2iscsi/be_iscsi.c
>> index 2496ea7..60c1dff 100644
>> --- a/drivers/scsi/be2iscsi/be_iscsi.c
>> +++ b/drivers/scsi/be2iscsi/be_iscsi.c
>> @@ -672,9 +672,10 @@ int beiscsi_set_param(struct iscsi_cls_conn *cls_conn,
>>  session->max_burst = 262144;
>>  break;
>>  case ISCSI_PARAM_MAX_XMIT_DLENGTH:
>> -if ((conn->max_xmit_dlength > 65536) ||
>> -(conn->max_xmit_dlength == 0))
>> +if (conn->max_xmit_dlength > 65536)
>>  conn->max_xmit_dlength = 65536;
>> +else if (conn->max_xmit_dlength == 0)
>> +conn->max_xmit_dlength = 8192;
> 
>> Was the target sending 0 or not sending anything at all? Userspace should 
>> not be sending 0 if the target did not send >MaxRecvDSL. It looks like it 
>> should be sending 8k for that case. It looks like there is a bug in the 
>> tools where it will pass 0 >if the target sent 0.
> 
>> It seems other drivers would be hitting this bug too and we should fix 
>> everyone.
> 
> This was an IET target that  did not send any value and we were defaulting to 
> 64K
> 

I am still not sure how you are getting 0 passed from userspace.

Do you mean the target sent the MaxRecvDataSegmentLength key but no
value or that it did not even send the MaxRecvDataSegmentLength key.

The thing is that iscsi_copy_operational_params will set
conn->max_xmit_dlength to ISCSI_DEF_MAX_RECV_SEG_LEN (8K). We then do
the login negotiation dance. If the target does not send the
MaxRecvDataSegmentLength key then it will stay 8K and that is what
should be getting passed down to the drivers. If that is not working
correctly then we need to fix for all drivers.

If the target is sending 0 for the value then again we need to fix this
for all drivers since none of them can handle this.

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Low prices and discounts

2013-09-17 Thread RonaldzBruns

Dear Customer,

There is a lot of people in this world who spend so much time 
watching their health that they have not the time to enjoy it.

No doctor visits
Lowest price World Wide 
Discreet Packaging

http://onlineshop14.webnode.com/store

Best Regards,

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] scsi: delete decade+ obsolete aic7xxx_old driver

2013-09-17 Thread Paul Gortmaker
[Re: [PATCH] scsi: delete decade+ obsolete aic7xxx_old driver] On 17/09/2013 
(Tue 16:27) Doug Ledford wrote:

> On 09/17/13 16:10, James Bottomley wrote:
> 
> > OK, so do we have any real evidence that no-one uses this driver?  Does
> > any distro actually compile it, for instance?
> 
> Red Hat doesn't use it in any of their products (and it hasn't been the
> preferred driver since about the old Red Hat Linux 7.0 days).

The oldest ubuntu machine I could find was running a 2.6.32 kernel and
even back then, they weren't building/enabling this driver either.

Paul.
--

> 
> 
> -- 
> Doug Ledford 
>   GPG KeyID: 0E572FDD
> http://people.redhat.com/dledford
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] sd: dif sector calculation

2013-09-17 Thread Keith Busch
The ref tag should be the device's physical LBA rather than the 512 byte
bio sector.

Signed-off-by: Keith Busch 
Cc: Martin K. Petersen 
Cc: James E.J. Bottomley 
Cc: Ric Wheeler 
---
I CC'ed James and Ric as I think you guys expressed some interest in
seeing if this was a legit concern. :)

The patch goes out of its way to avoid division. The shifting requires
the physical sector size be a power of 2 of at least 512, which I believe
is true.

 drivers/scsi/sd_dif.c | 12 ++--
 fs/bio-integrity.c| 11 ---
 2 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/drivers/scsi/sd_dif.c b/drivers/scsi/sd_dif.c
index 6174ca4..dc9f095 100644
--- a/drivers/scsi/sd_dif.c
+++ b/drivers/scsi/sd_dif.c
@@ -382,8 +382,8 @@ void sd_dif_prepare(struct request *rq, sector_t hw_sector,
if (bio_flagged(bio, BIO_MAPPED_INTEGRITY))
break;
 
-   virt = bio->bi_integrity->bip_sector & 0x;
-
+   virt = (bio->bi_integrity->bip_sector >>
+   (__ffs(sector_sz) - 9)) & 0x;
bip_for_each_vec(iv, bio->bi_integrity, i) {
sdt = kmap_atomic(iv->bv_page)
+ iv->bv_offset;
@@ -425,14 +425,14 @@ void sd_dif_complete(struct scsi_cmnd *scmd, unsigned int 
good_bytes)
sector_sz = scmd->device->sector_size;
sectors = good_bytes / sector_sz;
 
-   phys = blk_rq_pos(scmd->request) & 0x;
-   if (sector_sz == 4096)
-   phys >>= 3;
+   phys = (blk_rq_pos(scmd->request) >> (__ffs(sector_sz) - 9)) &
+   0x;
 
__rq_for_each_bio(bio, scmd->request) {
struct bio_vec *iv;
 
-   virt = bio->bi_integrity->bip_sector & 0x;
+   virt = (bio->bi_integrity->bip_sector >>
+   (__ffs(sector_sz) - 9)) & 0x;
 
bip_for_each_vec(iv, bio->bi_integrity, i) {
sdt = kmap_atomic(iv->bv_page)
diff --git a/fs/bio-integrity.c b/fs/bio-integrity.c
index 6025084..6ee4f12 100644
--- a/fs/bio-integrity.c
+++ b/fs/bio-integrity.c
@@ -196,11 +196,7 @@ EXPORT_SYMBOL(bio_integrity_enabled);
 static inline unsigned int bio_integrity_hw_sectors(struct blk_integrity *bi,
unsigned int sectors)
 {
-   /* At this point there are only 512b or 4096b DIF/EPP devices */
-   if (bi->sector_size == 4096)
-   return sectors >>= 3;
-
-   return sectors;
+   return sectors >> (__ffs(bi->sector_size) - 9);
 }
 
 /**
@@ -300,7 +296,7 @@ static void bio_integrity_generate(struct bio *bio)
struct blk_integrity *bi = bdev_get_integrity(bio->bi_bdev);
struct blk_integrity_exchg bix;
struct bio_vec *bv;
-   sector_t sector = bio->bi_sector;
+   sector_t sector = bio->bi_sector >> (__ffs(bi->sector_size) - 9);
unsigned int i, sectors, total;
void *prot_buf = bio->bi_integrity->bip_buf;
 
@@ -442,7 +438,8 @@ static int bio_integrity_verify(struct bio *bio)
struct blk_integrity *bi = bdev_get_integrity(bio->bi_bdev);
struct blk_integrity_exchg bix;
struct bio_vec *bv;
-   sector_t sector = bio->bi_integrity->bip_sector;
+   sector_t sector = bio->bi_integrity->bip_sector >>
+   (__ffs(bi->sector_size) - 9);
unsigned int i, sectors, total, ret;
void *prot_buf = bio->bi_integrity->bip_buf;
 
-- 
1.8.2.1

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


donations.

2013-09-17 Thread Gillian Adrian Bayford
we will be donating £1.5 Million Pounds to you in our ongoing lucky draws 
donations. Please get back to us with your Name, Age, Tel, Country and i will 
send you more details how your funds will be sent to you.Please read the 
article - http://www.bbc.co.uk/news/uk-england-19254228
gillainadrianbayf...@outlook.com
 Gillian & Adrian Bayford 
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/4] Fixed a race condition and a rtnl_lock deadlock for bnx2fc

2013-09-17 Thread Eddie Wai
Hello Robert and all,

My name is Eddie and I'm taking over for Bhanu as the new maintainer
for bnx2fc (I'm also the current maintainer for bnx2i).  Please include
me in all bnx2fc related discussions moving forward.  Thanks!

The following is a set of patches which fixes a race condition and a
rtnl_lock in bnx2fc as described.

The first patch fixes the race condition between bnx2fc's SCSI_CMD timeout
handling and the SCSI layer's task abort handling.  There is a situation
where the corresponding scsi_done for the timed out SCSI_CMD would never
get called.

The second patch fixes a rtnl_lock deadlock in the rmmod bnx2x path where
the fcoemon's write to the ctlr->enabled sysfs control param made the call
to bnx2fc_disable which contented for the rtnl_lock.  In this path of
operation, there is no need to lock the netdev nor the interface
as the ctlr is directly passed from the store_ctlr_enabled routine and
the interface cannot be released until the this sysfs write is finished
anyway.  The __bnx2fc_enable/disable routine can continue to persist
even after the bnx2fc_enable/disable are deprecated.

I've also bumped the version to 2.4.1 in an effort to align the upstream
and the out-of-tree releases of bnx2fc.

Comments are welcome.  Thanks.

Eddie

Eddie Wai (4):
  BNX2FC:  Fixed a SCSI CMD cmpl race condition between ABTS and
CLEANUP
  BNX2FC: hung task timeout warning observed when rmmod bnx2x with
active FCoE targets
  BNX2FC: Bump version from 1.0.14 to 2.4.1
  MAINTAINER: Updated maintainer info for bnx2fc

 MAINTAINERS   |2 +-
 drivers/scsi/bnx2fc/bnx2fc.h  |2 +-
 drivers/scsi/bnx2fc/bnx2fc_fcoe.c |   62 +++-
 drivers/scsi/bnx2fc/bnx2fc_io.c   |6 +++
 4 files changed, 54 insertions(+), 18 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/4] MAINTAINER: Updated maintainer info for bnx2fc

2013-09-17 Thread Eddie Wai
Signed-off-by: Eddie Wai 
---
 MAINTAINERS |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index e5e2518..26bc416 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1825,7 +1825,7 @@ S:Supported
 F: drivers/net/wireless/brcm80211/
 
 BROADCOM BNX2FC 10 GIGABIT FCOE DRIVER
-M: Bhanu Prakash Gollapudi 
+M: Eddie Wai 
 L: linux-scsi@vger.kernel.org
 S: Supported
 F: drivers/scsi/bnx2fc/
-- 
1.7.1


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/4] BNX2FC: hung task timeout warning observed when rmmod bnx2x with active FCoE targets

2013-09-17 Thread Eddie Wai
A rtnl_lock deadlock was observed from the rmmod thread where it
tries to unregister the fcoe_ctlr device.  This unregistration
triggered a flush of the sysfs queue of the associated ctlr and led to
a call to the set_fcoe_ctlr_enabled routine.  This will eventually propagate
down to call the bnx2fc_disable routine and contented for the rtnl_lock
in the same context.

This patch creates a subset of the bnx2fc_enable/disable routine which
removes the unnecesary rtnl_lock and the bnx2fc_dev_lock acquisition from
the set_fcoe_ctlr_enabled path.

 kernel: INFO: task rmmod:7874 blocked for more than 120 seconds.
 kernel:  Tainted: GW  ---2.6.32-415.0.1.el6.x86_64 
#1
 kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this 
message.
 kernel: rmmod D 000f 0  7874   6518 0x0080
 kernel: 88022158f7d8 0086  
 kernel: 88023fe72600 88043c74d410 88043c74d400 88043c74d000
 kernel: 88021ecbe5f8 88022158ffd8 fbc8 88021ecbe5f8
 kernel: Call Trace:
 kernel: [] schedule_timeout+0x215/0x2e0
 kernel: [] ? pick_next_task_fair+0xd0/0x130
 kernel: [] ? schedule+0x178/0x3b2
 kernel: [] wait_for_common+0x123/0x180
 kernel: [] ? default_wake_function+0x0/0x20
 kernel: [] ? ifind_fast+0x5e/0xb0
 kernel: [] wait_for_completion+0x1d/0x20
 kernel: [] sysfs_addrm_finish+0x228/0x270
 kernel: [] sysfs_hash_and_remove+0x5b/0x90
 kernel: [] sysfs_remove_group+0x5f/0x100
 kernel: [] device_remove_groups+0x3b/0x60
 kernel: [] device_remove_attrs+0x3d/0x90
 kernel: [] device_del+0x125/0x1e0
 kernel: [] device_unregister+0x22/0x60
 kernel: [] fcoe_ctlr_device_delete+0xe2/0xf4 [libfcoe]
 kernel: [] bnx2fc_interface_release+0x5b/0x90 [bnx2fc]
 kernel: [] ? bnx2fc_interface_release+0x0/0x90 [bnx2fc]
 kernel: [] kref_put+0x37/0x70
 kernel: [] __bnx2fc_destroy+0x72/0xa0 [bnx2fc]
 kernel: [] bnx2fc_ulp_exit+0xf5/0x160 [bnx2fc]<- got 
bnx2fc_dev_lock mutex_lock
 kernel: [] cnic_ulp_exit+0xb6/0xc0 [cnic]
 kernel: [] cnic_netdev_event+0x368/0x370 [cnic]
 kernel: [] ? fcoe_del_netdev_mapping+0x8c/0xa0 [libfcoe]
 kernel: [] notifier_call_chain+0x55/0x80
 kernel: [] raw_notifier_call_chain+0x16/0x20
 kernel: [] call_netdevice_notifiers+0x1b/0x20
 kernel: [] rollback_registered_many+0x154/0x280
 kernel: [] rollback_registered+0x38/0x50
 kernel: [] unregister_netdevice_queue+0x58/0xa0
 kernel: [] unregister_netdevice+0x10/0x20
 kernel: [] unregister_netdev+0x1e/0x30  <- 
got rtnl_lock!
 kernel: [] __bnx2x_remove+0x48/0x270 [bnx2x] <- got & rel 
rtnl_lock
 kernel: [] bnx2x_remove_one+0x44/0x80 [bnx2x]
 kernel: [] pci_device_remove+0x37/0x70
 kernel: [] __device_release_driver+0x6f/0xe0
 kernel: [] driver_detach+0xc8/0xd0
 kernel: [] bus_remove_driver+0x8e/0x110
 kernel: [] driver_unregister+0x62/0xa0
 kernel: [] pci_unregister_driver+0x44/0xb0
 kernel: [] bnx2x_cleanup+0x18/0x73 [bnx2x]
 kernel: [] sys_delete_module+0x194/0x260
 kernel: [] ? audit_syscall_entry+0x1d7/0x200
 kernel: [] system_call_fastpath+0x16/0x1b

Signed-off-by: Eddie Wai 
---
 drivers/scsi/bnx2fc/bnx2fc_fcoe.c |   60 +++-
 1 files changed, 45 insertions(+), 15 deletions(-)

diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c 
b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index 69ac554..5d059cb 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -1809,6 +1809,7 @@ static void bnx2fc_stop(struct bnx2fc_interface 
*interface)
FC_PORTTYPE_UNKNOWN;
mutex_unlock(&lport->lp_mutex);
fc_host_port_type(lport->host) = FC_PORTTYPE_UNKNOWN;
+   interface->enabled = false;
fcoe_ctlr_link_down(ctlr);
fcoe_clean_pending_queue(lport);
 }
@@ -2004,6 +2005,24 @@ static void bnx2fc_ulp_init(struct cnic_dev *dev)
set_bit(BNX2FC_CNIC_REGISTERED, &hba->reg_with_cnic);
 }
 
+/* Assumes rtnl_lock and the bnx2fc_dev_lock are already taken */
+static int __bnx2fc_disable(struct fcoe_ctlr *ctlr)
+{
+   struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr);
+
+   if (interface->enabled == true) {
+   if (!ctlr->lp) {
+   pr_err(PFX "__bnx2fc_disable: lport not found\n");
+   return -ENODEV;
+   } else {
+   interface->enabled = false;
+   fcoe_ctlr_link_down(ctlr);
+   fcoe_clean_pending_queue(ctlr->lp);
+   }
+   }
+   return 0;
+}
+
 /**
  * Deperecated: Use bnx2fc_enabled()
  */
@@ -2018,20 +2037,34 @@ static int bnx2fc_disable(struct net_device *netdev)
 
interface = bnx2fc_interface_lookup(netdev);
ctlr = bnx2fc_to_ctlr(interface);
-   if (!interface || !ctlr->lp) {
+
+   if (!interface) {
rc = -ENODEV;
-   printk(KERN_ERR PFX "bnx2fc_disable: interface or lport not 
found\n");
+ 

[PATCH 1/4] BNX2FC: Fixed a SCSI CMD cmpl race condition between ABTS and CLEANUP

2013-09-17 Thread Eddie Wai
In the case when a SCSI_CMD times out, bnx2fc will initiate the sending of the
ABTS.  However, if the SCSI layer's SCSI command timer also times out, it'll
instantiate a task abort of the same xid.

The race condition this patch tries to fix is as follows:

SCSI_CMD timeout (20s)
thread 1   thread 2
send ABTS
rx ABTS cmpl
   task abort_eh
   explicit LOGO since ABTS was engaged
   CLEANUP cmpl
SCSI_CMD cmpl (ABTS cmpl)
instantiate RRQ
wait 10s
attempt to send RRQ (because of LOGO, it wouldn't continue)

Note that there is no call to scsi_done for this SCSI_CMD cmpletion
in this path.

The patch changes the path of execution to call scsi_done immediately
instead of instantiating the RRQ.

Signed-off-by: Eddie Wai 
---
 drivers/scsi/bnx2fc/bnx2fc_io.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
index 575142e..ed88089 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_io.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
@@ -1246,6 +1246,12 @@ int bnx2fc_eh_abort(struct scsi_cmnd *sc_cmd)
kref_put(&io_req->refcount,
 bnx2fc_cmd_release); /* drop timer hold */
rc = bnx2fc_expl_logo(lport, io_req);
+   /* This only occurs when an task abort was requested while ABTS
+  is in progress.  Setting the IO_CLEANUP flag will skip the
+  RRQ process in the case when the fw generated SCSI_CMD cmpl
+  was a result from the ABTS request rather than the CLEANUP
+  request */
+   set_bit(BNX2FC_FLAG_IO_CLEANUP, &io_req->req_flags);
goto out;
}
 
-- 
1.7.1


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/4] BNX2FC: Bump version from 1.0.14 to 2.4.1

2013-09-17 Thread Eddie Wai
Signed-off-by: Eddie Wai 
---
 drivers/scsi/bnx2fc/bnx2fc.h  |2 +-
 drivers/scsi/bnx2fc/bnx2fc_fcoe.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/bnx2fc/bnx2fc.h b/drivers/scsi/bnx2fc/bnx2fc.h
index 08b22a9..6991027 100644
--- a/drivers/scsi/bnx2fc/bnx2fc.h
+++ b/drivers/scsi/bnx2fc/bnx2fc.h
@@ -64,7 +64,7 @@
 #include "bnx2fc_constants.h"
 
 #define BNX2FC_NAME"bnx2fc"
-#define BNX2FC_VERSION "1.0.14"
+#define BNX2FC_VERSION "2.4.1"
 
 #define PFX"bnx2fc: "
 
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c 
b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index 5d059cb..ae5220e 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -22,7 +22,7 @@ DEFINE_PER_CPU(struct bnx2fc_percpu_s, bnx2fc_percpu);
 
 #define DRV_MODULE_NAME"bnx2fc"
 #define DRV_MODULE_VERSION BNX2FC_VERSION
-#define DRV_MODULE_RELDATE "Mar 08, 2013"
+#define DRV_MODULE_RELDATE "Sep 17, 2013"
 
 
 static char version[] =
-- 
1.7.1


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 04/22] be2iscsi: Fix negotiated parameters upload to FW

2013-09-17 Thread Jayamohan Kallickal
-Original Message-
From: Mike Christie [mailto:micha...@cs.wisc.edu] 
Sent: Tuesday, September 17, 2013 2:16 PM
To: Jayamohan Kallickal
Cc: Jayamohan Kallickal; jbottom...@parallels.com; linux-scsi@vger.kernel.org; 
Sony John-N
Subject: Re: [PATCH 04/22] be2iscsi: Fix negotiated parameters upload to FW

On 09/16/2013 11:28 PM, Jayamohan Kallickal wrote:
> 
> 
> -Original Message-
> From: Mike Christie [mailto:micha...@cs.wisc.edu]
> Sent: Monday, September 16, 2013 7:59 PM
> To: Jayamohan Kallickal
> Cc: jbottom...@parallels.com; linux-scsi@vger.kernel.org; Jayamohan 
> Kallickal; Sony John-N
> Subject: Re: [PATCH 04/22] be2iscsi: Fix negotiated parameters upload 
> to FW
> 
> On 09/13/2013 12:09 AM, Jayamohan Kallickal wrote:
>>  - If target does not send MaxRecvDSL in login repsonse, then
>>initiator should consider the MaxRecvDSL for target is 8K.
>>In this scenario driver was setting the value to 64K and this
>>caused target to close cxn as data xfer was more than the
>>MaxRecvDSL
>>  - Update connection offload data structure for SKH-R adapters.
>>
>> Signed-off-by: John Soni Jose 
>> Signed-off-by: Jayamohan Kallickal 
>> ---
>>  drivers/scsi/be2iscsi/be_iscsi.c |9 +++--
>>  drivers/scsi/be2iscsi/be_main.h  |   29 -
>>  drivers/scsi/be2iscsi/be_mgmt.c  |8 +++-
>>  3 files changed, 26 insertions(+), 20 deletions(-)
>>
>> diff --git a/drivers/scsi/be2iscsi/be_iscsi.c
>> b/drivers/scsi/be2iscsi/be_iscsi.c
>> index 2496ea7..60c1dff 100644
>> --- a/drivers/scsi/be2iscsi/be_iscsi.c
>> +++ b/drivers/scsi/be2iscsi/be_iscsi.c
>> @@ -672,9 +672,10 @@ int beiscsi_set_param(struct iscsi_cls_conn *cls_conn,
>>  session->max_burst = 262144;
>>  break;
>>  case ISCSI_PARAM_MAX_XMIT_DLENGTH:
>> -if ((conn->max_xmit_dlength > 65536) ||
>> -(conn->max_xmit_dlength == 0))
>> +if (conn->max_xmit_dlength > 65536)
>>  conn->max_xmit_dlength = 65536;
>> +else if (conn->max_xmit_dlength == 0)
>> +conn->max_xmit_dlength = 8192;
> 
>> Was the target sending 0 or not sending anything at all? Userspace should 
>> not be sending 0 if the target did not send >MaxRecvDSL. It looks like it 
>> should be sending 8k for that case. It looks like there is a bug in the 
>> tools where it will pass 0 >if the target sent 0.
> 
>> It seems other drivers would be hitting this bug too and we should fix 
>> everyone.
> 
> This was an IET target that  did not send any value and we were 
> defaulting to 64K
> 
> Here is a small  userspace fix  that should  go along
> 
> diff --git a/usr/be2iscsi.c b/usr/be2iscsi.c index ce8b719..ba4c29f 
> 100644
> --- a/usr/be2iscsi.c
> +++ b/usr/be2iscsi.c
> @@ -33,10 +33,6 @@ void be2iscsi_create_conn(struct iscsi_conn *conn)
>   if (conn->max_xmit_dlength > 65536)
>   conn->max_xmit_dlength = 65536;
>  
> - if (!conn_rec->iscsi.MaxXmitDataSegmentLength ||
> - conn_rec->iscsi.MaxXmitDataSegmentLength > 65536)
> - conn_rec->iscsi.MaxXmitDataSegmentLength = 65536;
> -
>   session->erl = 0;
>   session->initial_r2t_en = 1;
>  }

>For the case you are trying to fix are you getting 0 or 64K from userspace?  
>In the kernel code you changed to set the from userspace. Is that right?

Before this fix, in the usespace we will  hit 
(!conn_rec->iscsi.MaxXmitDataSegmentLength)   and will set 
conn_rec->iscsi.MaxXmitDataSegmentLength = 65536.  The userspace patch would 
prevent that from happening.

So, in the Kernel space we would get 0 and which  would be set to 8K.

>Are you setting node.conn[0].iscsi.MaxXmitDataSegmentLength in iscsif.conf to 
>64K or did you leave it as the default? >Just to make sure we are on the same 
>page I really mean did you set it in iscsid.conf or with iscsiadm. I am not 
>talking >about setting above in the be2iscsi create_conn callout.

No changes were made. It was default values.

>If it is the default of 0, then I think when the code above is called 
>iscsi_copy_operational_params will have set conn->>max_xmit_dlength to 
>ISCSI_DEF_MAX_RECV_SEG_LEN (8k). The conn->max_xmit_dlength value is the one 
>we use for >final negotiated value so that is what gets passed to the kernel.

>If the target does not negotiate for MRDSL then it should stay 8k.
>iscsi_session_set_params will then pass down conn->max_xmit_dlength when login 
>is done.

>If I am looking at the code right, the only way we can get 0 in the kernel is 
>if the target sends 0 for MRDSL. iscsid was not >expecting that and will just 
>set conn->max_xmit_dlength to 0 and that will get passed down to all drivers 
>incorrectly. If I >am right then we need to do a fix for all drivers.

As an experiment, we tried applying just the userspace patch I sent earlier and 
we got the max_xmit_dlength as 8K.
 So, the basic issue was that the user space code in usr/be2iscsi was setting 
the con

Re: scsi: delete decade+ obsolete aic7xxx_old driver

2013-09-17 Thread Hannes Reinecke
On 09/17/2013 08:27 PM, Paul Bolle wrote:
> On Mon, 2013-09-16 at 21:51 -0400, Paul Gortmaker wrote:
>> Currently we have people wasting time building it during routine testing,
>> and then wasting more time re-researching the known reported warnings,
>> only to find that nobody really is willing to integrate the fixes[3] for
>> it.
>>
>> [...]
>>
>> [3] https://lkml.org/lkml/2012/10/29/215
> 
> Well, this didn't end up as an entire waste of my time. After that
> message I sent a patch to Fedora's kernel list, and a reminder a few
> months later[1]. That prompted Josh Boyer to remove this old driver from
> the Fedora build[2].
> 
> And now that driver is disabled in all kernels that Fedora currently
> ships. I'm not familiar with any complaints about this decision.
> 
Ok, good to know.
So this patch appears to be good, then.

Acked-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes Reinecke   zSeries & Storage
h...@suse.de  +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html