* [PATCH 00/11] qla4xxx: Update for scsi-misc
@ 2012-02-13 13:00 vikas.chaudhary
2012-02-13 13:00 ` [PATCH 01/11] qla4xxx: Remove unused code vikas.chaudhary
` (10 more replies)
0 siblings, 11 replies; 19+ messages in thread
From: vikas.chaudhary @ 2012-02-13 13:00 UTC (permalink / raw)
To: jbottomley, michaelc
Cc: linux-scsi, ravi.anand, lalit.chandivade, vikas.chaudhary
From: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
James,
Please apply the following patches to scsi-misc for inclusion in mainline.
Lalit Chandivade (3):
qla4xxx: Fix un-necessary delay on invalid DDB
qla4xxx: Fix verify boot idx correctly
qla4xxx: Remove un-necessary print statment
Manish Rangankar (1):
qla4xxx: Modified debug log messages for boot info.
Vikas Chaudhary (7):
qla4xxx: Remove unused code
qla4xxx: Proper detection of firmware abort error code for ISP82xx
scsi_transport_iscsi: added support for host event
qla4xxx: added support for host event
iscsi_transport: Added Ping support
qla4xxx: added ping support
qla4xxx: Update driver version to 5.02.00-k14
drivers/scsi/qla4xxx/ql4_def.h | 41 ++++++-
drivers/scsi/qla4xxx/ql4_fw.h | 20 +++
drivers/scsi/qla4xxx/ql4_glbl.h | 7 +
drivers/scsi/qla4xxx/ql4_init.c | 5 +
drivers/scsi/qla4xxx/ql4_iocb.c | 92 ++++++++++++++
drivers/scsi/qla4xxx/ql4_isr.c | 78 ++++++++++++
drivers/scsi/qla4xxx/ql4_mbx.c | 2 +
drivers/scsi/qla4xxx/ql4_nx.c | 17 +---
drivers/scsi/qla4xxx/ql4_nx.h | 1 +
drivers/scsi/qla4xxx/ql4_os.c | 235 ++++++++++++++++++++++++++++++++---
drivers/scsi/qla4xxx/ql4_version.h | 2 +-
drivers/scsi/scsi_transport_iscsi.c | 90 +++++++++++++
include/scsi/iscsi_if.h | 30 +++++
include/scsi/scsi_transport_iscsi.h | 14 ++
Thanks,
Vikas.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 01/11] qla4xxx: Remove unused code
2012-02-13 13:00 [PATCH 00/11] qla4xxx: Update for scsi-misc vikas.chaudhary
@ 2012-02-13 13:00 ` vikas.chaudhary
2012-02-13 13:00 ` [PATCH 02/11] qla4xxx: Fix un-necessary delay on invalid DDB vikas.chaudhary
` (9 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: vikas.chaudhary @ 2012-02-13 13:00 UTC (permalink / raw)
To: jbottomley, michaelc
Cc: linux-scsi, ravi.anand, lalit.chandivade, vikas.chaudhary
From: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
This code initially added for FW debugging, we don't need this
code now so taking it out.
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
---
drivers/scsi/qla4xxx/ql4_nx.c | 12 ------------
1 files changed, 0 insertions(+), 12 deletions(-)
diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
index 78f1111..225e921 100644
--- a/drivers/scsi/qla4xxx/ql4_nx.c
+++ b/drivers/scsi/qla4xxx/ql4_nx.c
@@ -1015,18 +1015,6 @@ qla4_8xxx_pinit_from_rom(struct scsi_qla_host *ha, int verbose)
else
qla4_8xxx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0xffffffff);
- /* reset ms */
- val = qla4_8xxx_rd_32(ha, QLA82XX_CRB_QDR_NET + 0xe4);
- val |= (1 << 1);
- qla4_8xxx_wr_32(ha, QLA82XX_CRB_QDR_NET + 0xe4, val);
-
- msleep(20);
- /* unreset ms */
- val = qla4_8xxx_rd_32(ha, QLA82XX_CRB_QDR_NET + 0xe4);
- val &= ~(1 << 1);
- qla4_8xxx_wr_32(ha, QLA82XX_CRB_QDR_NET + 0xe4, val);
- msleep(20);
-
qla4_8xxx_rom_unlock(ha);
/* Read the signature value from the flash.
--
1.7.8.247.g10f4e
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 02/11] qla4xxx: Fix un-necessary delay on invalid DDB
2012-02-13 13:00 [PATCH 00/11] qla4xxx: Update for scsi-misc vikas.chaudhary
2012-02-13 13:00 ` [PATCH 01/11] qla4xxx: Remove unused code vikas.chaudhary
@ 2012-02-13 13:00 ` vikas.chaudhary
2012-02-13 13:00 ` [PATCH 03/11] qla4xxx: Fix verify boot idx correctly vikas.chaudhary
` (8 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: vikas.chaudhary @ 2012-02-13 13:00 UTC (permalink / raw)
To: jbottomley, michaelc
Cc: linux-scsi, ravi.anand, lalit.chandivade, vikas.chaudhary
From: Lalit Chandivade <lalit.chandivade@qlogic.com>
Fix the un-necessary wait for completion of a sendtarget on an
invalid DDB entry. The state of an invalid DDB entry is 0 (unassigned)
This will also avoid the delays during system boot.
Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
---
drivers/scsi/qla4xxx/ql4_mbx.c | 2 ++
drivers/scsi/qla4xxx/ql4_os.c | 4 ++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index e1e66a4..eaf2185 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -661,6 +661,8 @@ int qla4xxx_get_fwddb_entry(struct scsi_qla_host *ha,
}
memset(&mbox_cmd, 0, sizeof(mbox_cmd));
memset(&mbox_sts, 0, sizeof(mbox_sts));
+ if (fw_ddb_entry)
+ memset(fw_ddb_entry, 0, sizeof(struct dev_db_entry));
mbox_cmd[0] = MBOX_CMD_GET_DATABASE_ENTRY;
mbox_cmd[1] = (uint32_t) fw_ddb_index;
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index c1189e5..089443a 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -4090,6 +4090,10 @@ static void qla4xxx_build_st_list(struct scsi_qla_host *ha,
if (ret == QLA_ERROR)
break;
+ /* Ignore DDB if invalid state (unassigned) */
+ if (state == DDB_DS_UNASSIGNED)
+ goto continue_next_st;
+
/* Check if ST, add to the list_st */
if (strlen((char *) fw_ddb_entry->iscsi_name) != 0)
goto continue_next_st;
--
1.7.8.247.g10f4e
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 03/11] qla4xxx: Fix verify boot idx correctly
2012-02-13 13:00 [PATCH 00/11] qla4xxx: Update for scsi-misc vikas.chaudhary
2012-02-13 13:00 ` [PATCH 01/11] qla4xxx: Remove unused code vikas.chaudhary
2012-02-13 13:00 ` [PATCH 02/11] qla4xxx: Fix un-necessary delay on invalid DDB vikas.chaudhary
@ 2012-02-13 13:00 ` vikas.chaudhary
2012-02-13 13:00 ` [PATCH 04/11] qla4xxx: Modified debug log messages for boot info vikas.chaudhary
` (7 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: vikas.chaudhary @ 2012-02-13 13:00 UTC (permalink / raw)
To: jbottomley, michaelc
Cc: linux-scsi, ravi.anand, lalit.chandivade, vikas.chaudhary
From: Lalit Chandivade <lalit.chandivade@qlogic.com>
qla4xxx_verify_boot_idx can falsely report a DDB to be boot target
if ha->pri_ddb_idx and ha->sec_ddb_idx are not initialized correctly.
What this could cause is if there is DDB entry in FLash at index 0, then
qla4xxx_verify_boot_idx would return wrong result as ha->pri_ddb_idx is not
set correctly. Fixed the qla4xxx_get_boot_info to set the ha->pri_ddb_idx and
ha->sec_ddb_idx correctly.
Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
---
drivers/scsi/qla4xxx/ql4_os.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 089443a..a9ff05e 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -3463,12 +3463,11 @@ static int get_fw_boot_info(struct scsi_qla_host *ha, uint16_t ddb_index[])
" target ID %d\n", __func__, ddb_index[0],
ddb_index[1]));
- ha->pri_ddb_idx = ddb_index[0];
- ha->sec_ddb_idx = ddb_index[1];
-
exit_boot_info_free:
dma_free_coherent(&ha->pdev->dev, size, buf, buf_dma);
exit_boot_info:
+ ha->pri_ddb_idx = ddb_index[0];
+ ha->sec_ddb_idx = ddb_index[1];
return ret;
}
--
1.7.8.247.g10f4e
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 04/11] qla4xxx: Modified debug log messages for boot info.
2012-02-13 13:00 [PATCH 00/11] qla4xxx: Update for scsi-misc vikas.chaudhary
` (2 preceding siblings ...)
2012-02-13 13:00 ` [PATCH 03/11] qla4xxx: Fix verify boot idx correctly vikas.chaudhary
@ 2012-02-13 13:00 ` vikas.chaudhary
2012-02-13 13:00 ` [PATCH 05/11] qla4xxx: Remove un-necessary print statment vikas.chaudhary
` (6 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: vikas.chaudhary @ 2012-02-13 13:00 UTC (permalink / raw)
To: jbottomley, michaelc
Cc: linux-scsi, ravi.anand, lalit.chandivade, vikas.chaudhary,
Manish Rangankar
From: Manish Rangankar <manish.rangankar@qlogic.com>
In some configurations user may not have boot targets configured.
In such cases the debug messages printed out by driver look like
some kind of failure happening. However this could be a valid
case, so modified the messages to appear as warning messages
versus failure messages.
Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
---
drivers/scsi/qla4xxx/ql4_os.c | 26 ++++++++++++--------------
1 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index a9ff05e..3339cc1 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -3393,9 +3393,8 @@ static int get_fw_boot_info(struct scsi_qla_host *ha, uint16_t ddb_index[])
/* Check Boot Mode */
val = rd_nvram_byte(ha, addr);
if (!(val & 0x07)) {
- DEBUG2(ql4_printk(KERN_ERR, ha,
- "%s: Failed Boot options : 0x%x\n",
- __func__, val));
+ DEBUG2(ql4_printk(KERN_INFO, ha, "%s: Adapter boot "
+ "options : 0x%x\n", __func__, val));
ret = QLA_ERROR;
goto exit_boot_info;
}
@@ -3440,9 +3439,8 @@ static int get_fw_boot_info(struct scsi_qla_host *ha, uint16_t ddb_index[])
}
/* Check Boot Mode */
if (!(buf[1] & 0x07)) {
- DEBUG2(ql4_printk(KERN_INFO, ha,
- "Failed: Boot options : 0x%x\n",
- buf[1]));
+ DEBUG2(ql4_printk(KERN_INFO, ha, "Firmware boot options"
+ " : 0x%x\n", buf[1]));
ret = QLA_ERROR;
goto exit_boot_info_free;
}
@@ -3548,8 +3546,8 @@ static int qla4xxx_get_boot_target(struct scsi_qla_host *ha,
if (qla4xxx_bootdb_by_index(ha, fw_ddb_entry,
fw_ddb_entry_dma, ddb_index)) {
- DEBUG2(ql4_printk(KERN_ERR, ha,
- "%s: Flash DDB read Failed\n", __func__));
+ DEBUG2(ql4_printk(KERN_INFO, ha, "%s: No Flash DDB found at "
+ "index [%d]\n", __func__, ddb_index));
ret = QLA_ERROR;
goto exit_boot_target;
}
@@ -3627,8 +3625,8 @@ static int qla4xxx_get_boot_info(struct scsi_qla_host *ha)
ddb_index[1] = 0xffff;
ret = get_fw_boot_info(ha, ddb_index);
if (ret != QLA_SUCCESS) {
- DEBUG2(ql4_printk(KERN_ERR, ha,
- "%s: Failed to set boot info.\n", __func__));
+ DEBUG2(ql4_printk(KERN_INFO, ha,
+ "%s: No boot target configured.\n", __func__));
return ret;
}
@@ -3641,8 +3639,8 @@ static int qla4xxx_get_boot_info(struct scsi_qla_host *ha)
rval = qla4xxx_get_boot_target(ha, &(ha->boot_tgt.boot_pri_sess),
ddb_index[0]);
if (rval != QLA_SUCCESS) {
- DEBUG2(ql4_printk(KERN_ERR, ha, "%s: Failed to get "
- "primary target\n", __func__));
+ DEBUG2(ql4_printk(KERN_INFO, ha, "%s: Primary boot target not "
+ "configured\n", __func__));
} else
ret = QLA_SUCCESS;
@@ -3653,8 +3651,8 @@ sec_target:
rval = qla4xxx_get_boot_target(ha, &(ha->boot_tgt.boot_sec_sess),
ddb_index[1]);
if (rval != QLA_SUCCESS) {
- DEBUG2(ql4_printk(KERN_ERR, ha, "%s: Failed to get "
- "secondary target\n", __func__));
+ DEBUG2(ql4_printk(KERN_INFO, ha, "%s: Secondary boot target not"
+ " configured\n", __func__));
} else
ret = QLA_SUCCESS;
--
1.7.8.247.g10f4e
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 05/11] qla4xxx: Remove un-necessary print statment
2012-02-13 13:00 [PATCH 00/11] qla4xxx: Update for scsi-misc vikas.chaudhary
` (3 preceding siblings ...)
2012-02-13 13:00 ` [PATCH 04/11] qla4xxx: Modified debug log messages for boot info vikas.chaudhary
@ 2012-02-13 13:00 ` vikas.chaudhary
2012-02-13 13:00 ` [PATCH 06/11] qla4xxx: Proper detection of firmware abort error code for ISP82xx vikas.chaudhary
` (5 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: vikas.chaudhary @ 2012-02-13 13:00 UTC (permalink / raw)
To: jbottomley, michaelc
Cc: linux-scsi, ravi.anand, lalit.chandivade, vikas.chaudhary
From: Lalit Chandivade <lalit.chandivade@qlogic.com>
On ROM lock acquiring timeout failure, driver spews lot of warning
messages in a for loop, remove the unwanted warning message to reduce
kernel messages clutter.
Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
---
drivers/scsi/qla4xxx/ql4_nx.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
index 225e921..af8dcf6 100644
--- a/drivers/scsi/qla4xxx/ql4_nx.c
+++ b/drivers/scsi/qla4xxx/ql4_nx.c
@@ -860,11 +860,8 @@ qla4_8xxx_rom_lock(struct scsi_qla_host *ha)
done = qla4_8xxx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM2_LOCK));
if (done == 1)
break;
- if (timeout >= qla4_8xxx_rom_lock_timeout) {
- ql4_printk(KERN_WARNING, ha,
- "%s: Failed to acquire rom lock", __func__);
+ if (timeout >= qla4_8xxx_rom_lock_timeout)
return -1;
- }
timeout++;
--
1.7.8.247.g10f4e
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 06/11] qla4xxx: Proper detection of firmware abort error code for ISP82xx
2012-02-13 13:00 [PATCH 00/11] qla4xxx: Update for scsi-misc vikas.chaudhary
` (4 preceding siblings ...)
2012-02-13 13:00 ` [PATCH 05/11] qla4xxx: Remove un-necessary print statment vikas.chaudhary
@ 2012-02-13 13:00 ` vikas.chaudhary
2012-02-13 13:00 ` [PATCH 07/11] scsi_transport_iscsi: added support for host event vikas.chaudhary
` (4 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: vikas.chaudhary @ 2012-02-13 13:00 UTC (permalink / raw)
To: jbottomley, michaelc
Cc: linux-scsi, ravi.anand, lalit.chandivade, vikas.chaudhary
From: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
---
drivers/scsi/qla4xxx/ql4_def.h | 2 --
drivers/scsi/qla4xxx/ql4_nx.h | 1 +
drivers/scsi/qla4xxx/ql4_os.c | 2 +-
3 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
index bfe6854..ec48dc3 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
@@ -150,8 +150,6 @@
#define QL4_SESS_RECOVERY_TMO 120 /* iSCSI session */
/* recovery timeout */
-#define MSB(x) ((uint8_t)((uint16_t)(x) >> 8))
-#define LSW(x) ((uint16_t)(x))
#define LSDW(x) ((u32)((u64)(x)))
#define MSDW(x) ((u32)((((u64)(x)) >> 16) >> 16))
diff --git a/drivers/scsi/qla4xxx/ql4_nx.h b/drivers/scsi/qla4xxx/ql4_nx.h
index dc45ac9..dc7500e 100644
--- a/drivers/scsi/qla4xxx/ql4_nx.h
+++ b/drivers/scsi/qla4xxx/ql4_nx.h
@@ -623,6 +623,7 @@ struct crb_addr_pair {
#define ADDR_ERROR ((unsigned long) 0xffffffff)
#define MAX_CTL_CHECK 1000
+#define QLA82XX_FWERROR_CODE(code) ((code >> 8) & 0x1fffff)
/***************************************************************************
* PCI related defines.
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 3339cc1..2cd2077 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -2165,7 +2165,7 @@ void qla4_8xxx_watchdog(struct scsi_qla_host *ha)
halt_status = qla4_8xxx_rd_32(ha,
QLA82XX_PEG_HALT_STATUS1);
- if (LSW(MSB(halt_status)) == 0x67)
+ if (QLA82XX_FWERROR_CODE(halt_status) == 0x67)
ql4_printk(KERN_ERR, ha, "%s:"
" Firmware aborted with"
" error code 0x00006700."
--
1.7.8.247.g10f4e
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 07/11] scsi_transport_iscsi: added support for host event
2012-02-13 13:00 [PATCH 00/11] qla4xxx: Update for scsi-misc vikas.chaudhary
` (5 preceding siblings ...)
2012-02-13 13:00 ` [PATCH 06/11] qla4xxx: Proper detection of firmware abort error code for ISP82xx vikas.chaudhary
@ 2012-02-13 13:00 ` vikas.chaudhary
2012-02-13 13:00 ` [PATCH 09/11] iscsi_transport: Added Ping support vikas.chaudhary
` (3 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: vikas.chaudhary @ 2012-02-13 13:00 UTC (permalink / raw)
To: jbottomley, michaelc
Cc: linux-scsi, ravi.anand, lalit.chandivade, vikas.chaudhary
From: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Added support to post kernel host event to application using
netlink interface.
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
---
drivers/scsi/scsi_transport_iscsi.c | 31 +++++++++++++++++++++++++++++++
include/scsi/iscsi_if.h | 13 +++++++++++++
include/scsi/scsi_transport_iscsi.h | 6 ++++++
3 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 97832a2..1ad5860 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -1476,6 +1476,37 @@ void iscsi_conn_login_event(struct iscsi_cls_conn *conn,
}
EXPORT_SYMBOL_GPL(iscsi_conn_login_event);
+void iscsi_post_host_event(uint32_t host_no, struct iscsi_transport *transport,
+ enum iscsi_host_event_code code, uint32_t data_size,
+ uint8_t *data)
+{
+ struct nlmsghdr *nlh;
+ struct sk_buff *skb;
+ struct iscsi_uevent *ev;
+ int len = NLMSG_SPACE(sizeof(*ev) + data_size);
+
+ skb = alloc_skb(len, GFP_KERNEL);
+ if (!skb) {
+ printk(KERN_ERR "gracefully ignored host event (%d):%d OOM\n",
+ host_no, code);
+ return;
+ }
+
+ nlh = __nlmsg_put(skb, 0, 0, 0, (len - sizeof(*nlh)), 0);
+ ev = NLMSG_DATA(nlh);
+ ev->transport_handle = iscsi_handle(transport);
+ ev->type = ISCSI_KEVENT_HOST_EVENT;
+ ev->r.host_event.host_no = host_no;
+ ev->r.host_event.code = code;
+ ev->r.host_event.data_size = data_size;
+
+ if (data_size)
+ memcpy((char *)ev + sizeof(*ev), data, data_size);
+
+ iscsi_multicast_skb(skb, ISCSI_NL_GRP_ISCSID, GFP_KERNEL);
+}
+EXPORT_SYMBOL_GPL(iscsi_post_host_event);
+
static int
iscsi_if_send_reply(uint32_t group, int seq, int type, int done, int multi,
void *payload, int size)
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index e49b7c8..3aac991 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -72,6 +72,7 @@ enum iscsi_uevent_e {
ISCSI_KEVENT_PATH_REQ = KEVENT_BASE + 7,
ISCSI_KEVENT_IF_DOWN = KEVENT_BASE + 8,
ISCSI_KEVENT_CONN_LOGIN_STATE = KEVENT_BASE + 9,
+ ISCSI_KEVENT_HOST_EVENT = KEVENT_BASE + 10,
};
enum iscsi_tgt_dscvr {
@@ -80,6 +81,13 @@ enum iscsi_tgt_dscvr {
ISCSI_TGT_DSCVR_SLP = 3,
};
+enum iscsi_host_event_code {
+ ISCSI_EVENT_LINKUP = 1,
+ ISCSI_EVENT_LINKDOWN,
+ /* must always be last */
+ ISCSI_EVENT_MAX,
+};
+
struct iscsi_uevent {
uint32_t type; /* k/u events type */
uint32_t iferror; /* carries interface or resource errors */
@@ -222,6 +230,11 @@ struct iscsi_uevent {
struct msg_notify_if_down {
uint32_t host_no;
} notify_if_down;
+ struct msg_host_event {
+ uint32_t host_no;
+ uint32_t data_size;
+ enum iscsi_host_event_code code;
+ } host_event;
} r;
} __attribute__ ((aligned (sizeof(uint64_t))));
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index fa7ca4e..7f04731 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -166,6 +166,12 @@ extern int iscsi_offload_mesg(struct Scsi_Host *shost,
struct iscsi_transport *transport, uint32_t type,
char *data, uint16_t data_size);
+extern void iscsi_post_host_event(uint32_t host_no,
+ struct iscsi_transport *transport,
+ enum iscsi_host_event_code code,
+ uint32_t data_size,
+ uint8_t *data);
+
struct iscsi_cls_conn {
struct list_head conn_list; /* item in connlist */
void *dd_data; /* LLD private data */
--
1.7.8.247.g10f4e
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 09/11] iscsi_transport: Added Ping support
2012-02-13 13:00 [PATCH 00/11] qla4xxx: Update for scsi-misc vikas.chaudhary
` (6 preceding siblings ...)
2012-02-13 13:00 ` [PATCH 07/11] scsi_transport_iscsi: added support for host event vikas.chaudhary
@ 2012-02-13 13:00 ` vikas.chaudhary
2012-02-21 21:55 ` Or Gerlitz
2012-02-13 13:00 ` [PATCH 10/11] qla4xxx: Added ping support vikas.chaudhary
` (2 subsequent siblings)
10 siblings, 1 reply; 19+ messages in thread
From: vikas.chaudhary @ 2012-02-13 13:00 UTC (permalink / raw)
To: jbottomley, michaelc
Cc: linux-scsi, ravi.anand, lalit.chandivade, vikas.chaudhary
From: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Added ping support for iscsi adapter, application can use this
interface for diagnostic network connection.
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
---
drivers/scsi/scsi_transport_iscsi.c | 59 +++++++++++++++++++++++++++++++++++
include/scsi/iscsi_if.h | 17 ++++++++++
include/scsi/scsi_transport_iscsi.h | 8 +++++
3 files changed, 84 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 1ad5860..c5f1581 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -1507,6 +1507,35 @@ void iscsi_post_host_event(uint32_t host_no, struct iscsi_transport *transport,
}
EXPORT_SYMBOL_GPL(iscsi_post_host_event);
+void iscsi_ping_comp_event(uint32_t host_no, struct iscsi_transport *transport,
+ uint32_t status, uint32_t pid, uint32_t data_size,
+ uint8_t *data)
+{
+ struct nlmsghdr *nlh;
+ struct sk_buff *skb;
+ struct iscsi_uevent *ev;
+ int len = NLMSG_SPACE(sizeof(*ev) + data_size);
+
+ skb = alloc_skb(len, GFP_KERNEL);
+ if (!skb) {
+ printk(KERN_ERR "gracefully ignored ping comp: OOM\n");
+ return;
+ }
+
+ nlh = __nlmsg_put(skb, 0, 0, 0, (len - sizeof(*nlh)), 0);
+ ev = NLMSG_DATA(nlh);
+ ev->transport_handle = iscsi_handle(transport);
+ ev->type = ISCSI_KEVENT_PING_COMP;
+ ev->r.ping_comp.host_no = host_no;
+ ev->r.ping_comp.status = status;
+ ev->r.ping_comp.pid = pid;
+ ev->r.ping_comp.data_size = data_size;
+ memcpy((char *)ev + sizeof(*ev), data, data_size);
+
+ iscsi_multicast_skb(skb, ISCSI_NL_GRP_ISCSID, GFP_KERNEL);
+}
+EXPORT_SYMBOL_GPL(iscsi_ping_comp_event);
+
static int
iscsi_if_send_reply(uint32_t group, int seq, int type, int done, int multi,
void *payload, int size)
@@ -1946,6 +1975,33 @@ iscsi_set_iface_params(struct iscsi_transport *transport,
}
static int
+iscsi_send_ping(struct iscsi_transport *transport, struct iscsi_uevent *ev)
+{
+ struct Scsi_Host *shost;
+ struct sockaddr *dst_addr;
+ int err;
+
+ if (!transport->send_ping)
+ return -ENOSYS;
+
+ shost = scsi_host_lookup(ev->u.iscsi_ping.host_no);
+ if (!shost) {
+ printk(KERN_ERR "iscsi_ping could not find host no %u\n",
+ ev->u.iscsi_ping.host_no);
+ return -ENODEV;
+ }
+
+ dst_addr = (struct sockaddr *)((char *)ev + sizeof(*ev));
+ err = transport->send_ping(shost, ev->u.iscsi_ping.iface_num,
+ ev->u.iscsi_ping.iface_type,
+ ev->u.iscsi_ping.payload_size,
+ ev->u.iscsi_ping.pid,
+ dst_addr);
+ scsi_host_put(shost);
+ return err;
+}
+
+static int
iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, uint32_t *group)
{
int err = 0;
@@ -2090,6 +2146,9 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, uint32_t *group)
err = iscsi_set_iface_params(transport, ev,
nlmsg_attrlen(nlh, sizeof(*ev)));
break;
+ case ISCSI_UEVENT_PING:
+ err = iscsi_send_ping(transport, ev);
+ break;
default:
err = -ENOSYS;
break;
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index 3aac991..7ff9678 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -60,6 +60,7 @@ enum iscsi_uevent_e {
ISCSI_UEVENT_PATH_UPDATE = UEVENT_BASE + 20,
ISCSI_UEVENT_SET_IFACE_PARAMS = UEVENT_BASE + 21,
+ ISCSI_UEVENT_PING = UEVENT_BASE + 22,
/* up events */
ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1,
@@ -73,6 +74,7 @@ enum iscsi_uevent_e {
ISCSI_KEVENT_IF_DOWN = KEVENT_BASE + 8,
ISCSI_KEVENT_CONN_LOGIN_STATE = KEVENT_BASE + 9,
ISCSI_KEVENT_HOST_EVENT = KEVENT_BASE + 10,
+ ISCSI_KEVENT_PING_COMP = KEVENT_BASE + 11,
};
enum iscsi_tgt_dscvr {
@@ -186,6 +188,14 @@ struct iscsi_uevent {
uint32_t host_no;
uint32_t count;
} set_iface_params;
+ struct msg_iscsi_ping {
+ uint32_t host_no;
+ uint32_t iface_num;
+ uint32_t iface_type;
+ uint32_t payload_size;
+ uint32_t pid; /* unique ping id associated
+ with each ping request */
+ } iscsi_ping;
} u;
union {
/* messages k -> u */
@@ -235,6 +245,13 @@ struct iscsi_uevent {
uint32_t data_size;
enum iscsi_host_event_code code;
} host_event;
+ struct msg_ping_comp {
+ uint32_t host_no;
+ uint32_t status;
+ uint32_t pid; /* unique ping id associated
+ with each ping request */
+ uint32_t data_size;
+ } ping_comp;
} r;
} __attribute__ ((aligned (sizeof(uint64_t))));
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index 7f04731..aede513 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -144,6 +144,9 @@ struct iscsi_transport {
int param, char *buf);
umode_t (*attr_is_visible)(int param_type, int param);
int (*bsg_request)(struct bsg_job *job);
+ int (*send_ping) (struct Scsi_Host *shost, uint32_t iface_num,
+ uint32_t iface_type, uint32_t payload_size,
+ uint32_t pid, struct sockaddr *dst_addr);
};
/*
@@ -172,6 +175,11 @@ extern void iscsi_post_host_event(uint32_t host_no,
uint32_t data_size,
uint8_t *data);
+extern void iscsi_ping_comp_event(uint32_t host_no,
+ struct iscsi_transport *transport,
+ uint32_t status, uint32_t pid,
+ uint32_t data_size, uint8_t *data);
+
struct iscsi_cls_conn {
struct list_head conn_list; /* item in connlist */
void *dd_data; /* LLD private data */
--
1.7.8.247.g10f4e
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 10/11] qla4xxx: Added ping support
2012-02-13 13:00 [PATCH 00/11] qla4xxx: Update for scsi-misc vikas.chaudhary
` (7 preceding siblings ...)
2012-02-13 13:00 ` [PATCH 09/11] iscsi_transport: Added Ping support vikas.chaudhary
@ 2012-02-13 13:00 ` vikas.chaudhary
2012-03-06 2:49 ` Mike Christie
2012-02-13 13:00 ` [PATCH 11/11] qla4xxx: Update driver version to 5.02.00-k14 vikas.chaudhary
2012-02-15 7:00 ` [PATCH 00/11] qla4xxx: Update for scsi-misc Mike Christie
10 siblings, 1 reply; 19+ messages in thread
From: vikas.chaudhary @ 2012-02-13 13:00 UTC (permalink / raw)
To: jbottomley, michaelc
Cc: linux-scsi, ravi.anand, lalit.chandivade, vikas.chaudhary
From: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Added ping support for network connection diagnostics.
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
---
drivers/scsi/qla4xxx/ql4_def.h | 21 +++++++
drivers/scsi/qla4xxx/ql4_fw.h | 20 +++++++
drivers/scsi/qla4xxx/ql4_glbl.h | 5 ++
drivers/scsi/qla4xxx/ql4_init.c | 5 ++
drivers/scsi/qla4xxx/ql4_iocb.c | 92 +++++++++++++++++++++++++++++++
drivers/scsi/qla4xxx/ql4_isr.c | 72 +++++++++++++++++++++++++
drivers/scsi/qla4xxx/ql4_os.c | 113 +++++++++++++++++++++++++++++++++++++++
7 files changed, 328 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
index f91808c..776714d 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
@@ -221,6 +221,15 @@ struct srb {
uint16_t reserved2;
};
+/* Mailbox request block structure */
+struct mrb {
+ struct scsi_qla_host *ha;
+ struct mbox_cmd_iocb *mbox;
+ uint32_t mbox_cmd;
+ uint16_t iocb_cnt; /* Number of used iocbs */
+ uint32_t pid;
+};
+
/*
* Asynchronous Event Queue structure
*/
@@ -303,6 +312,7 @@ struct ql4_tuple_ddb {
enum qla4_work_type {
QLA4_EVENT_AEN,
+ QLA4_EVENT_PING_STATUS,
};
struct qla4_work_evt {
@@ -314,6 +324,12 @@ struct qla4_work_evt {
uint32_t data_size;
uint8_t data[0];
} aen;
+ struct {
+ uint32_t status;
+ uint32_t pid;
+ uint32_t data_size;
+ uint8_t data[0];
+ } ping;
} u;
};
@@ -690,6 +706,11 @@ struct scsi_qla_host {
/* event work list */
struct list_head work_list;
spinlock_t work_lock;
+
+ /* mbox iocb */
+#define MAX_MRB 128
+ struct mrb *active_mrb_array[MAX_MRB];
+ uint32_t mrb_index;
};
struct ql4_task_data {
diff --git a/drivers/scsi/qla4xxx/ql4_fw.h b/drivers/scsi/qla4xxx/ql4_fw.h
index 5f82b5d..210cd1d 100644
--- a/drivers/scsi/qla4xxx/ql4_fw.h
+++ b/drivers/scsi/qla4xxx/ql4_fw.h
@@ -331,6 +331,10 @@ struct qla_flt_region {
/* Mailbox command definitions */
#define MBOX_CMD_ABOUT_FW 0x0009
#define MBOX_CMD_PING 0x000B
+#define PING_IPV6_PROTOCOL_ENABLE 0x1
+#define PING_IPV6_LINKLOCAL_ADDR 0x4
+#define PING_IPV6_ADDR0 0x8
+#define PING_IPV6_ADDR1 0xC
#define MBOX_CMD_ENABLE_INTRS 0x0010
#define INTR_DISABLE 0
#define INTR_ENABLE 1
@@ -922,6 +926,8 @@ struct qla4_header {
#define ET_CMND_T3 0x19
#define ET_PASSTHRU0 0x3A
#define ET_PASSTHRU_STATUS 0x3C
+#define ET_MBOX_CMD 0x38
+#define ET_MBOX_STATUS 0x39
uint8_t entryStatus;
uint8_t systemDefined;
@@ -1122,6 +1128,20 @@ struct passthru_status {
uint8_t res4[16]; /* 30-3F */
};
+struct mbox_cmd_iocb {
+ struct qla4_header hdr; /* 00-03 */
+ uint32_t handle; /* 04-07 */
+ uint32_t in_mbox[8]; /* 08-25 */
+ uint32_t res1[6]; /* 26-3F */
+};
+
+struct mbox_status_iocb {
+ struct qla4_header hdr; /* 00-03 */
+ uint32_t handle; /* 04-07 */
+ uint32_t out_mbox[8]; /* 08-25 */
+ uint32_t res1[6]; /* 26-3F */
+};
+
/*
* ISP queue - response queue entry definition.
*/
diff --git a/drivers/scsi/qla4xxx/ql4_glbl.h b/drivers/scsi/qla4xxx/ql4_glbl.h
index 34cf851..954ba91 100644
--- a/drivers/scsi/qla4xxx/ql4_glbl.h
+++ b/drivers/scsi/qla4xxx/ql4_glbl.h
@@ -183,6 +183,11 @@ int qla4xxx_ddb_change(struct scsi_qla_host *ha, uint32_t fw_ddb_index,
void qla4xxx_build_ddb_list(struct scsi_qla_host *ha, int is_reset);
int qla4xxx_post_aen_work(struct scsi_qla_host *ha, uint32_t aen_code,
uint32_t data_size, uint8_t *data);
+int qla4xxx_ping_iocb(struct scsi_qla_host *ha, uint32_t options,
+ uint32_t payload_size, uint32_t pid, uint8_t *ipaddr);
+int qla4xxx_post_ping_evt_work(struct scsi_qla_host *ha,
+ uint32_t status, uint32_t pid,
+ uint32_t data_size, uint8_t *data);
/* BSG Functions */
int qla4xxx_bsg_request(struct bsg_job *bsg_job);
diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx/ql4_init.c
index 90614f3..90ee5d8 100644
--- a/drivers/scsi/qla4xxx/ql4_init.c
+++ b/drivers/scsi/qla4xxx/ql4_init.c
@@ -86,6 +86,7 @@ static void qla4xxx_init_response_q_entries(struct scsi_qla_host *ha)
int qla4xxx_init_rings(struct scsi_qla_host *ha)
{
unsigned long flags = 0;
+ int i;
/* Initialize request queue. */
spin_lock_irqsave(&ha->hardware_lock, flags);
@@ -125,6 +126,10 @@ int qla4xxx_init_rings(struct scsi_qla_host *ha)
qla4xxx_init_response_q_entries(ha);
+ /* Initialize mabilbox active array */
+ for (i = 0; i < MAX_MRB; i++)
+ ha->active_mrb_array[i] = NULL;
+
spin_unlock_irqrestore(&ha->hardware_lock, flags);
return QLA_SUCCESS;
diff --git a/drivers/scsi/qla4xxx/ql4_iocb.c b/drivers/scsi/qla4xxx/ql4_iocb.c
index 4106693..c70651d 100644
--- a/drivers/scsi/qla4xxx/ql4_iocb.c
+++ b/drivers/scsi/qla4xxx/ql4_iocb.c
@@ -445,3 +445,95 @@ queuing_error:
spin_unlock_irqrestore(&ha->hardware_lock, flags);
return ret;
}
+
+static struct mrb *qla4xxx_get_new_mrb(struct scsi_qla_host *ha)
+{
+ struct mrb *mrb;
+
+ mrb = kzalloc(sizeof(*mrb), GFP_KERNEL);
+ if (!mrb)
+ return mrb;
+
+ mrb->ha = ha;
+ return mrb;
+}
+
+int qla4xxx_send_mbox_iocb(struct scsi_qla_host *ha, struct mrb *mrb,
+ uint32_t *in_mbox)
+{
+ int rval = QLA_SUCCESS;
+ uint32_t i;
+ unsigned long flags;
+ uint32_t index = 0;
+
+ /* Acquire hardware specific lock */
+ spin_lock_irqsave(&ha->hardware_lock, flags);
+
+ /* Get pointer to the queue entry for the marker */
+ rval = qla4xxx_get_req_pkt(ha, (struct queue_entry **) &(mrb->mbox));
+ if (rval != QLA_SUCCESS)
+ goto exit_mbox_iocb;
+
+ index = ha->mrb_index;
+ /* get valid mrb index*/
+ for (i = 0; i < MAX_MRB; i++) {
+ index++;
+ if (index == MAX_MRB)
+ index = 1;
+ if (ha->active_mrb_array[index] == NULL) {
+ ha->mrb_index = index;
+ break;
+ }
+ }
+
+ mrb->iocb_cnt = 1;
+ ha->active_mrb_array[index] = mrb;
+ mrb->mbox->handle = index;
+ mrb->mbox->hdr.entryType = ET_MBOX_CMD;
+ mrb->mbox->hdr.entryCount = mrb->iocb_cnt;
+ memcpy(mrb->mbox->in_mbox, in_mbox, 32);
+ mrb->mbox_cmd = in_mbox[0];
+ wmb();
+
+ ha->isp_ops->queue_iocb(ha);
+exit_mbox_iocb:
+ spin_unlock_irqrestore(&ha->hardware_lock, flags);
+ return rval;
+}
+
+int qla4xxx_ping_iocb(struct scsi_qla_host *ha, uint32_t options,
+ uint32_t payload_size, uint32_t pid, uint8_t *ipaddr)
+{
+ uint32_t in_mbox[8];
+ struct mrb *mrb = NULL;
+ int rval = QLA_SUCCESS;
+
+ memset(in_mbox, 0, sizeof(in_mbox));
+
+ mrb = qla4xxx_get_new_mrb(ha);
+ if (!mrb) {
+ DEBUG2(ql4_printk(KERN_WARNING, ha, "%s: fail to get new mrb\n",
+ __func__));
+ rval = QLA_ERROR;
+ goto exit_ping;
+ }
+
+ in_mbox[0] = MBOX_CMD_PING;
+ in_mbox[1] = options;
+ memcpy(&in_mbox[2], &ipaddr[0], 4);
+ memcpy(&in_mbox[3], &ipaddr[4], 4);
+ memcpy(&in_mbox[4], &ipaddr[8], 4);
+ memcpy(&in_mbox[5], &ipaddr[12], 4);
+ in_mbox[6] = payload_size;
+
+ mrb->pid = pid;
+ rval = qla4xxx_send_mbox_iocb(ha, mrb, in_mbox);
+
+ if (rval != QLA_SUCCESS)
+ goto exit_ping;
+
+ return rval;
+exit_ping:
+ kfree(mrb);
+ return rval;
+}
diff --git a/drivers/scsi/qla4xxx/ql4_isr.c b/drivers/scsi/qla4xxx/ql4_isr.c
index 954fe84..7c9f28b 100644
--- a/drivers/scsi/qla4xxx/ql4_isr.c
+++ b/drivers/scsi/qla4xxx/ql4_isr.c
@@ -385,6 +385,71 @@ static void qla4xxx_passthru_status_entry(struct scsi_qla_host *ha,
queue_work(ha->task_wq, &task_data->task_work);
}
+static struct mrb *qla4xxx_del_mrb_from_active_array(struct scsi_qla_host *ha,
+ uint32_t index)
+{
+ struct mrb *mrb = NULL;
+
+ /* validate handle and remove from active array */
+ if (index >= MAX_MRB)
+ return mrb;
+
+ mrb = ha->active_mrb_array[index];
+ ha->active_mrb_array[index] = NULL;
+ if (!mrb)
+ return mrb;
+
+ /* update counters */
+ ha->req_q_count += mrb->iocb_cnt;
+ ha->iocb_cnt -= mrb->iocb_cnt;
+
+ return mrb;
+}
+
+static void qla4xxx_mbox_status_entry(struct scsi_qla_host *ha,
+ struct mbox_status_iocb *mbox_sts_entry)
+{
+ struct mrb *mrb;
+ uint32_t status;
+ uint32_t data_size;
+
+ mrb = qla4xxx_del_mrb_from_active_array(ha,
+ le32_to_cpu(mbox_sts_entry->handle));
+
+ if (mrb == NULL) {
+ ql4_printk(KERN_WARNING, ha, "%s: mrb[%d] is null\n", __func__,
+ mbox_sts_entry->handle);
+ return;
+ }
+
+ switch (mrb->mbox_cmd) {
+ case MBOX_CMD_PING:
+ DEBUG2(ql4_printk(KERN_INFO, ha, "%s: mbox_cmd = 0x%x, "
+ "mbox_sts[0] = 0x%x, mbox_sts[6] = 0x%x\n",
+ __func__, mrb->mbox_cmd,
+ mbox_sts_entry->out_mbox[0],
+ mbox_sts_entry->out_mbox[6]));
+
+ if (mbox_sts_entry->out_mbox[0] == MBOX_STS_COMMAND_COMPLETE)
+ status = QLA_SUCCESS;
+ else
+ status = QLA_ERROR;
+
+ data_size = sizeof(mbox_sts_entry->out_mbox);
+
+ qla4xxx_post_ping_evt_work(ha, status, mrb->pid, data_size,
+ (uint8_t *) mbox_sts_entry->out_mbox);
+ break;
+
+ default:
+ DEBUG2(ql4_printk(KERN_WARNING, ha, "%s: invalid mbox_cmd = "
+ "0x%x\n", __func__, mrb->mbox_cmd));
+ }
+
+ kfree(mrb);
+ return;
+}
+
/**
* qla4xxx_process_response_queue - process response queue completions
* @ha: Pointer to host adapter structure.
@@ -461,6 +526,13 @@ void qla4xxx_process_response_queue(struct scsi_qla_host *ha)
"ignoring\n", ha->host_no, __func__));
break;
+ case ET_MBOX_STATUS:
+ DEBUG2(ql4_printk(KERN_INFO, ha,
+ "%s: mbox status IOCB\n", __func__));
+ qla4xxx_mbox_status_entry(ha,
+ (struct mbox_status_iocb *)sts_entry);
+ break;
+
default:
/*
* Invalid entry in response queue, reset RISC
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index d423f7a..877c0e2 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -118,6 +118,10 @@ static void qla4xxx_task_cleanup(struct iscsi_task *);
static void qla4xxx_fail_session(struct iscsi_cls_session *cls_session);
static void qla4xxx_conn_get_stats(struct iscsi_cls_conn *cls_conn,
struct iscsi_stats *stats);
+static int qla4xxx_send_ping(struct Scsi_Host *shost, uint32_t iface_num,
+ uint32_t iface_type, uint32_t payload_size,
+ uint32_t pid, struct sockaddr *dst_addr);
+
/*
* SCSI host template entry points
*/
@@ -194,10 +198,91 @@ static struct iscsi_transport qla4xxx_iscsi_transport = {
.set_iface_param = qla4xxx_iface_set_param,
.get_iface_param = qla4xxx_get_iface_param,
.bsg_request = qla4xxx_bsg_request,
+ .send_ping = qla4xxx_send_ping,
};
static struct scsi_transport_template *qla4xxx_scsi_transport;
+static int qla4xxx_send_ping(struct Scsi_Host *shost, uint32_t iface_num,
+ uint32_t iface_type, uint32_t payload_size,
+ uint32_t pid, struct sockaddr *dst_addr)
+{
+ struct scsi_qla_host *ha = to_qla_host(shost);
+ struct sockaddr_in *addr;
+ struct sockaddr_in6 *addr6;
+ uint32_t options = 0;
+ uint8_t ipaddr[IPv6_ADDR_LEN];
+ int rval;
+
+ memset(ipaddr, 0, IPv6_ADDR_LEN);
+ /* IPv4 to IPv4 */
+ if ((iface_type == ISCSI_IFACE_TYPE_IPV4) &&
+ (dst_addr->sa_family == AF_INET)) {
+ addr = (struct sockaddr_in *)dst_addr;
+ memcpy(ipaddr, &addr->sin_addr.s_addr, IP_ADDR_LEN);
+ DEBUG2(ql4_printk(KERN_INFO, ha, "%s: IPv4 Ping src: %pI4 "
+ "dest: %pI4\n", __func__,
+ &ha->ip_config.ip_address, ipaddr));
+ rval = qla4xxx_ping_iocb(ha, options, payload_size, pid,
+ ipaddr);
+ if (rval)
+ rval = -EINVAL;
+ } else if ((iface_type == ISCSI_IFACE_TYPE_IPV6) &&
+ (dst_addr->sa_family == AF_INET6)) {
+ /* IPv6 to IPv6 */
+ addr6 = (struct sockaddr_in6 *)dst_addr;
+ memcpy(ipaddr, &addr6->sin6_addr.in6_u.u6_addr8, IPv6_ADDR_LEN);
+
+ options |= PING_IPV6_PROTOCOL_ENABLE;
+
+ /* Ping using LinkLocal address */
+ if ((iface_num == 0) || (iface_num == 1)) {
+ DEBUG2(ql4_printk(KERN_INFO, ha, "%s: LinkLocal Ping "
+ "src: %pI6 dest: %pI6\n", __func__,
+ &ha->ip_config.ipv6_link_local_addr,
+ ipaddr));
+ options |= PING_IPV6_LINKLOCAL_ADDR;
+ rval = qla4xxx_ping_iocb(ha, options, payload_size,
+ pid, ipaddr);
+ } else {
+ ql4_printk(KERN_WARNING, ha, "%s: iface num = %d "
+ "not supported\n", __func__, iface_num);
+ rval = -ENOSYS;
+ goto exit_send_ping;
+ }
+
+ /*
+ * If ping using LinkLocal address fails, try ping using
+ * IPv6 address
+ */
+ if (rval != QLA_SUCCESS) {
+ options &= ~PING_IPV6_LINKLOCAL_ADDR;
+ if (iface_num == 0) {
+ options |= PING_IPV6_ADDR0;
+ DEBUG2(ql4_printk(KERN_INFO, ha, "%s: IPv6 "
+ "Ping src: %pI6 "
+ "dest: %pI6\n", __func__,
+ &ha->ip_config.ipv6_addr0,
+ ipaddr));
+ } else if (iface_num == 1) {
+ options |= PING_IPV6_ADDR1;
+ DEBUG2(ql4_printk(KERN_INFO, ha, "%s: IPv6 "
+ "Ping src: %pI6 "
+ "dest: %pI6\n", __func__,
+ &ha->ip_config.ipv6_addr1,
+ ipaddr));
+ }
+ rval = qla4xxx_ping_iocb(ha, options, payload_size,
+ pid, ipaddr);
+ if (rval)
+ rval = -EINVAL;
+ }
+ } else
+ rval = -ENOSYS;
+exit_send_ping:
+ return rval;
+}
+
static umode_t ql4_attr_is_visible(int param_type, int param)
{
switch (param_type) {
@@ -2897,6 +2982,26 @@ int qla4xxx_post_aen_work(struct scsi_qla_host *ha,
return QLA_SUCCESS;
}
+int qla4xxx_post_ping_evt_work(struct scsi_qla_host *ha,
+ uint32_t status, uint32_t pid,
+ uint32_t data_size, uint8_t *data)
+{
+ struct qla4_work_evt *e;
+
+ e = qla4xxx_alloc_work(ha, data_size, QLA4_EVENT_PING_STATUS);
+ if (!e)
+ return QLA_ERROR;
+
+ e->u.ping.status = status;
+ e->u.ping.pid = pid;
+ e->u.ping.data_size = data_size;
+ memcpy(e->u.ping.data, data, data_size);
+
+ qla4xxx_post_work(ha, e);
+
+ return QLA_SUCCESS;
+}
+
void qla4xxx_do_work(struct scsi_qla_host *ha)
{
struct qla4_work_evt *e, *tmp;
@@ -2918,6 +3023,14 @@ void qla4xxx_do_work(struct scsi_qla_host *ha)
e->u.aen.data_size,
e->u.aen.data);
break;
+ case QLA4_EVENT_PING_STATUS:
+ iscsi_ping_comp_event(ha->host_no,
+ &qla4xxx_iscsi_transport,
+ e->u.ping.status,
+ e->u.ping.pid,
+ e->u.ping.data_size,
+ e->u.ping.data);
+ break;
default:
ql4_printk(KERN_WARNING, ha, "event type: 0x%x not "
"supported", e->type);
--
1.7.8.247.g10f4e
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 11/11] qla4xxx: Update driver version to 5.02.00-k14
2012-02-13 13:00 [PATCH 00/11] qla4xxx: Update for scsi-misc vikas.chaudhary
` (8 preceding siblings ...)
2012-02-13 13:00 ` [PATCH 10/11] qla4xxx: Added ping support vikas.chaudhary
@ 2012-02-13 13:00 ` vikas.chaudhary
2012-02-15 7:00 ` [PATCH 00/11] qla4xxx: Update for scsi-misc Mike Christie
10 siblings, 0 replies; 19+ messages in thread
From: vikas.chaudhary @ 2012-02-13 13:00 UTC (permalink / raw)
To: jbottomley, michaelc
Cc: linux-scsi, ravi.anand, lalit.chandivade, vikas.chaudhary
From: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
---
drivers/scsi/qla4xxx/ql4_version.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/scsi/qla4xxx/ql4_version.h b/drivers/scsi/qla4xxx/ql4_version.h
index 601ee3d..7f20b7f 100644
--- a/drivers/scsi/qla4xxx/ql4_version.h
+++ b/drivers/scsi/qla4xxx/ql4_version.h
@@ -5,4 +5,4 @@
* See LICENSE.qla4xxx for copyright and licensing details.
*/
-#define QLA4XXX_DRIVER_VERSION "5.02.00-k13"
+#define QLA4XXX_DRIVER_VERSION "5.02.00-k14"
--
1.7.8.247.g10f4e
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 00/11] qla4xxx: Update for scsi-misc
2012-02-13 13:00 [PATCH 00/11] qla4xxx: Update for scsi-misc vikas.chaudhary
` (9 preceding siblings ...)
2012-02-13 13:00 ` [PATCH 11/11] qla4xxx: Update driver version to 5.02.00-k14 vikas.chaudhary
@ 2012-02-15 7:00 ` Mike Christie
10 siblings, 0 replies; 19+ messages in thread
From: Mike Christie @ 2012-02-15 7:00 UTC (permalink / raw)
To: vikas.chaudhary; +Cc: jbottomley, linux-scsi, ravi.anand, lalit.chandivade
On 02/13/2012 07:00 AM, vikas.chaudhary@qlogic.com wrote:
> From: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
>
> James,
>
> Please apply the following patches to scsi-misc for inclusion in mainline.
>
> Lalit Chandivade (3):
> qla4xxx: Fix un-necessary delay on invalid DDB
> qla4xxx: Fix verify boot idx correctly
> qla4xxx: Remove un-necessary print statment
>
> Manish Rangankar (1):
> qla4xxx: Modified debug log messages for boot info.
>
> Vikas Chaudhary (7):
> qla4xxx: Remove unused code
> qla4xxx: Proper detection of firmware abort error code for ISP82xx
> scsi_transport_iscsi: added support for host event
> qla4xxx: added support for host event
> iscsi_transport: Added Ping support
> qla4xxx: added ping support
> qla4xxx: Update driver version to 5.02.00-k14
>
Looks ok.
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 09/11] iscsi_transport: Added Ping support
2012-02-13 13:00 ` [PATCH 09/11] iscsi_transport: Added Ping support vikas.chaudhary
@ 2012-02-21 21:55 ` Or Gerlitz
2012-02-21 22:33 ` Mike Christie
0 siblings, 1 reply; 19+ messages in thread
From: Or Gerlitz @ 2012-02-21 21:55 UTC (permalink / raw)
To: vikas.chaudhary
Cc: jbottomley, michaelc, linux-scsi, ravi.anand, lalit.chandivade
On Mon, Feb 13, 2012 at 3:00 PM, <vikas.chaudhary@qlogic.com> wrote:
> Added ping support for iscsi adapter, application can use this
> interface for diagnostic network connection.
Could you elaborate a little further on the motivation here? what's
the difference between the pings you're suggesting to the initiator
initiated iscsi NOPs which are fully supported by the current
initiator stack?
Or.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 09/11] iscsi_transport: Added Ping support
2012-02-21 21:55 ` Or Gerlitz
@ 2012-02-21 22:33 ` Mike Christie
2012-02-21 22:39 ` Or Gerlitz
0 siblings, 1 reply; 19+ messages in thread
From: Mike Christie @ 2012-02-21 22:33 UTC (permalink / raw)
To: Or Gerlitz
Cc: vikas.chaudhary, jbottomley, linux-scsi, ravi.anand,
lalit.chandivade
On 02/21/2012 03:55 PM, Or Gerlitz wrote:
> On Mon, Feb 13, 2012 at 3:00 PM, <vikas.chaudhary@qlogic.com> wrote:
>> Added ping support for iscsi adapter, application can use this
>> interface for diagnostic network connection.
>
> Could you elaborate a little further on the motivation here? what's
> the difference between the pings you're suggesting to the initiator
> initiated iscsi NOPs which are fully supported by the current
> initiator stack?
This is network based. ICMP pings. The stuff we have today is iscsi
based pings.
So you can do some basic network diag type of stuff.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 09/11] iscsi_transport: Added Ping support
2012-02-21 22:33 ` Mike Christie
@ 2012-02-21 22:39 ` Or Gerlitz
2012-02-21 22:54 ` Ravi Anand
2012-02-21 22:58 ` Mike Christie
0 siblings, 2 replies; 19+ messages in thread
From: Or Gerlitz @ 2012-02-21 22:39 UTC (permalink / raw)
To: Mike Christie
Cc: vikas.chaudhary, jbottomley, linux-scsi, ravi.anand,
lalit.chandivade
On Wed, Feb 22, 2012 at 12:33 AM, Mike Christie <michaelc@cs.wisc.edu> wrote:
> This is network based. ICMP pings. The stuff we have today is iscsi
> based pings. So you can do some basic network diag type of stuff.
So what's wrong with plain ICMP pings... or is this is for
cards/drivers which don't expose plain network interface to the
kernel?
Or.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 09/11] iscsi_transport: Added Ping support
2012-02-21 22:39 ` Or Gerlitz
@ 2012-02-21 22:54 ` Ravi Anand
2012-02-21 22:58 ` Mike Christie
1 sibling, 0 replies; 19+ messages in thread
From: Ravi Anand @ 2012-02-21 22:54 UTC (permalink / raw)
To: Or Gerlitz
Cc: Mike Christie, Vikas Chaudhary, jbottomley@parallels.com,
linux-scsi@vger.kernel.org, Lalit Chandivade
On Feb 21, 2012, at 2:39 PM, Or Gerlitz wrote:
> On Wed, Feb 22, 2012 at 12:33 AM, Mike Christie <michaelc@cs.wisc.edu> wrote:
>> This is network based. ICMP pings. The stuff we have today is iscsi
>> based pings. So you can do some basic network diag type of stuff.
>
> So what's wrong with plain ICMP pings... or is this is for
> cards/drivers which don't expose plain network interface to the
> kernel?
>
> Or.
>
Mike is correct - Btw QLogic iSCSI H/W Offload function is totally independent of NIC function.
Idea is that using iSCSI interface only, one can do network troubleshooting where it comes in handy.
You don't necessarily have to load NIC driver.
Ravi
This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 09/11] iscsi_transport: Added Ping support
2012-02-21 22:39 ` Or Gerlitz
2012-02-21 22:54 ` Ravi Anand
@ 2012-02-21 22:58 ` Mike Christie
1 sibling, 0 replies; 19+ messages in thread
From: Mike Christie @ 2012-02-21 22:58 UTC (permalink / raw)
To: Or Gerlitz
Cc: vikas.chaudhary, jbottomley, linux-scsi, ravi.anand,
lalit.chandivade
On 02/21/2012 04:39 PM, Or Gerlitz wrote:
> On Wed, Feb 22, 2012 at 12:33 AM, Mike Christie <michaelc@cs.wisc.edu> wrote:
>> This is network based. ICMP pings. The stuff we have today is iscsi
>> based pings. So you can do some basic network diag type of stuff.
>
> So what's wrong with plain ICMP pings... or is this is for
> cards/drivers which don't expose plain network interface to the
> kernel?
Yeah, the latter. There is a network driver for the card, but the
networking stack is completely different for the 2 functions. The
network driver is a normal old net device driver. Then for the iscsi
function they basically have a complete network stack in fw. The
networking settings for the 2 functions are going to be separate. So the
iscsi function port has a different ip and MAC than the network driver
one. The ip could then be on different subnets, different vlans, etc. So
you might not be able to reach the target from the normal network driver
net device.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 10/11] qla4xxx: Added ping support
2012-02-13 13:00 ` [PATCH 10/11] qla4xxx: Added ping support vikas.chaudhary
@ 2012-03-06 2:49 ` Mike Christie
2012-03-06 12:26 ` Vikas Chaudhary
0 siblings, 1 reply; 19+ messages in thread
From: Mike Christie @ 2012-03-06 2:49 UTC (permalink / raw)
To: vikas.chaudhary; +Cc: jbottomley, linux-scsi, ravi.anand, lalit.chandivade
On 02/13/2012 07:00 AM, vikas.chaudhary@qlogic.com wrote:
> +
> + if (mbox_sts_entry->out_mbox[0] == MBOX_STS_COMMAND_COMPLETE)
> + status = QLA_SUCCESS;
> + else
> + status = QLA_ERROR;
> +
> + data_size = sizeof(mbox_sts_entry->out_mbox);
> +
> + qla4xxx_post_ping_evt_work(ha, status, mrb->pid, data_size,
> + (uint8_t *) mbox_sts_entry->out_mbox);
> + break;
> +
Not sure what I was thinking. This is not going to work.
We are not going to pass back vendor specific values, and then have
multiple decoders in userspace.
What are you trying to pass back up to userspace? Can you add a enum or
defines for some common error values? We can also pass back vendor
specific info, but we have to also have some common error cls info or it
is completely useless to other apps.
And, can we get more info that if it failed or not?
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 10/11] qla4xxx: Added ping support
2012-03-06 2:49 ` Mike Christie
@ 2012-03-06 12:26 ` Vikas Chaudhary
0 siblings, 0 replies; 19+ messages in thread
From: Vikas Chaudhary @ 2012-03-06 12:26 UTC (permalink / raw)
To: Mike Christie
Cc: jbottomley@parallels.com, scsi, Ravi Anand, Lalit Chandivade
-----Original Message-----
From: Mike Christie <michaelc@cs.wisc.edu>
Date: Mon, 5 Mar 2012 18:49:37 -0800
To: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Cc: "jbottomley@parallels.com" <jbottomley@parallels.com>, scsi
<linux-scsi@vger.kernel.org>, Ravi Anand <ravi.anand@qlogic.com>, Lalit
Chandivade <lalit.chandivade@qlogic.com>
Subject: Re: [PATCH 10/11] qla4xxx: Added ping support
>On 02/13/2012 07:00 AM, vikas.chaudhary@qlogic.com wrote:
>> +
>> + if (mbox_sts_entry->out_mbox[0] == MBOX_STS_COMMAND_COMPLETE)
>> + status = QLA_SUCCESS;
>> + else
>> + status = QLA_ERROR;
>> +
>> + data_size = sizeof(mbox_sts_entry->out_mbox);
>> +
>> + qla4xxx_post_ping_evt_work(ha, status, mrb->pid, data_size,
>> + (uint8_t *) mbox_sts_entry->out_mbox);
>> + break;
>> +
>
>Not sure what I was thinking. This is not going to work.
>
>We are not going to pass back vendor specific values, and then have
>multiple decoders in userspace.
>
>What are you trying to pass back up to userspace? Can you add a enum or
>defines for some common error values? We can also pass back vendor
>specific info, but we have to also have some common error cls info or it
>is completely useless to other apps.
>
>And, can we get more info that if it failed or not?
I modified code to return detail error code that other vendors can also
use.
I am sending patch for same in next email.
This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2012-03-06 12:26 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-13 13:00 [PATCH 00/11] qla4xxx: Update for scsi-misc vikas.chaudhary
2012-02-13 13:00 ` [PATCH 01/11] qla4xxx: Remove unused code vikas.chaudhary
2012-02-13 13:00 ` [PATCH 02/11] qla4xxx: Fix un-necessary delay on invalid DDB vikas.chaudhary
2012-02-13 13:00 ` [PATCH 03/11] qla4xxx: Fix verify boot idx correctly vikas.chaudhary
2012-02-13 13:00 ` [PATCH 04/11] qla4xxx: Modified debug log messages for boot info vikas.chaudhary
2012-02-13 13:00 ` [PATCH 05/11] qla4xxx: Remove un-necessary print statment vikas.chaudhary
2012-02-13 13:00 ` [PATCH 06/11] qla4xxx: Proper detection of firmware abort error code for ISP82xx vikas.chaudhary
2012-02-13 13:00 ` [PATCH 07/11] scsi_transport_iscsi: added support for host event vikas.chaudhary
2012-02-13 13:00 ` [PATCH 09/11] iscsi_transport: Added Ping support vikas.chaudhary
2012-02-21 21:55 ` Or Gerlitz
2012-02-21 22:33 ` Mike Christie
2012-02-21 22:39 ` Or Gerlitz
2012-02-21 22:54 ` Ravi Anand
2012-02-21 22:58 ` Mike Christie
2012-02-13 13:00 ` [PATCH 10/11] qla4xxx: Added ping support vikas.chaudhary
2012-03-06 2:49 ` Mike Christie
2012-03-06 12:26 ` Vikas Chaudhary
2012-02-13 13:00 ` [PATCH 11/11] qla4xxx: Update driver version to 5.02.00-k14 vikas.chaudhary
2012-02-15 7:00 ` [PATCH 00/11] qla4xxx: Update for scsi-misc Mike Christie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).