From: <vikas.chaudhary@qlogic.com>
To: jbottomley@parallels.com, michaelc@cs.wisc.edu
Cc: linux-scsi@vger.kernel.org, vikas.chaudhary@qlogic.com,
lalit.chandivade@qlogic.com, ravi.anand@qlogic.com,
Manish Rangankar <manish.rangankar@qlogic.com>
Subject: [PATCH 7/8] qla4xxx: Add support to allow flashnode multi-session login.
Date: Thu, 9 May 2013 06:02:11 -0400 [thread overview]
Message-ID: <1368093732-8524-8-git-send-email-vikas.chaudhary@qlogic.com> (raw)
In-Reply-To: <1368093732-8524-1-git-send-email-vikas.chaudhary@qlogic.com>
From: Manish Rangankar <manish.rangankar@qlogic.com>
Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
---
drivers/scsi/qla4xxx/ql4_os.c | 69 ++++++++++++++++++++++++++++++++++++++-----
1 file changed, 62 insertions(+), 7 deletions(-)
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 171c0e4..5271807 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -6977,17 +6977,72 @@ exit_login_st_clr_bit:
}
static int qla4xxx_ddb_login_nt(struct scsi_qla_host *ha,
- struct dev_db_entry *fw_ddb_entry,
+ struct dev_db_entry *sfw_ddb_entry,
uint16_t idx)
{
- int ret = QLA_ERROR;
+ struct ql4_tuple_ddb *temp_tddb = NULL;
+ struct ql4_tuple_ddb *src_tddb = NULL;
+ struct ddb_entry *ddb_entry = NULL;
+ struct iscsi_session *session = NULL;
+ uint8_t is_isid_compare;
+ int ret = QLA_ERROR, status;
+ int i, max_ddbs;
- ret = qla4xxx_is_session_exists(ha, fw_ddb_entry);
- if (ret != QLA_SUCCESS)
- ret = qla4xxx_sess_conn_setup(ha, fw_ddb_entry, RESET_ADAPTER,
+ max_ddbs = is_qla40XX(ha) ? MAX_DEV_DB_ENTRIES_40XX :
+ MAX_DEV_DB_ENTRIES;
+
+ src_tddb = vzalloc(sizeof(*src_tddb));
+ if (!src_tddb) {
+ ql4_printk(KERN_WARNING, ha, "%s:Memory allocation failed\n",
+ __func__);
+ ret = -ENOMEM;
+ goto exit_ddb_login;
+ }
+
+ temp_tddb = vzalloc(sizeof(*temp_tddb));
+ if (!temp_tddb) {
+ ql4_printk(KERN_WARNING, ha, "%s:Memory allocation failed\n",
+ __func__);
+ ret = -ENOMEM;
+ goto exit_ddb_login;
+ }
+
+ qla4xxx_convert_param_ddb(sfw_ddb_entry, src_tddb, NULL);
+
+ for (i = 0; i < max_ddbs; i++) {
+ ddb_entry = qla4xxx_lookup_ddb_by_fw_index(ha, i);
+ if (ddb_entry == NULL)
+ continue;
+
+ memset(temp_tddb, 0, sizeof(*temp_tddb));
+ qla4xxx_get_param_ddb(ddb_entry, temp_tddb);
+
+ if (ddb_entry->ddb_type != FLASH_DDB) {
+ is_isid_compare = false;
+ } else {
+ session = ddb_entry->sess->dd_data;
+ COPY_ISID(temp_tddb->isid, session->isid);
+ is_isid_compare = true;
+ }
+
+ status = qla4xxx_compare_tuple_ddb(ha, src_tddb, temp_tddb,
+ is_isid_compare);
+ if (status == QLA_SUCCESS) {
+ ret = -EEXIST;
+ goto exit_ddb_login;
+ } else {
+ continue;
+ }
+ }
+
+ if (i == max_ddbs)
+ ret = qla4xxx_sess_conn_setup(ha, sfw_ddb_entry, RESET_ADAPTER,
idx);
- else
- ret = -EPERM;
+exit_ddb_login:
+ if (src_tddb)
+ vfree(src_tddb);
+ if (temp_tddb)
+ vfree(temp_tddb);
return ret;
}
--
1.8.2.GIT
next prev parent reply other threads:[~2013-05-09 10:26 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-09 10:02 [PATCH 0/8] qla4xxx: Updates for scsi "misc" branch vikas.chaudhary
2013-05-09 10:02 ` [PATCH 1/8] iscsi_transport: Remove net param enum numbers vikas.chaudhary
2013-05-09 10:02 ` [PATCH 2/8] iscsi_transport: Additional parameters for net settings vikas.chaudhary
2013-05-28 8:49 ` Mike Christie
2013-05-28 8:50 ` Mike Christie
2013-05-28 11:36 ` Vikas Chaudhary
2013-05-31 14:26 ` Mike Christie
2013-05-09 10:02 ` [PATCH 3/8] qla4xxx: " vikas.chaudhary
2013-05-09 10:02 ` [PATCH 4/8] scsi_transport_iscsi: Exporting new attrs for iscsi session and connection in sysfs vikas.chaudhary
2013-05-28 8:57 ` Mike Christie
2013-05-28 11:55 ` Vikas Chaudhary
2013-05-28 16:02 ` Mike Christie
2013-05-09 10:02 ` [PATCH 5/8] libiscsi: " vikas.chaudhary
2013-05-09 10:02 ` [PATCH 6/8] qla4xxx: " vikas.chaudhary
2013-05-09 10:02 ` vikas.chaudhary [this message]
2013-05-09 10:02 ` [PATCH 8/8] qla4xxx: Update driver version to 5.03.00-k10 vikas.chaudhary
2013-06-26 12:46 ` [PATCH 0/8] qla4xxx: Updates for scsi "misc" branch Vikas Chaudhary
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1368093732-8524-8-git-send-email-vikas.chaudhary@qlogic.com \
--to=vikas.chaudhary@qlogic.com \
--cc=jbottomley@parallels.com \
--cc=lalit.chandivade@qlogic.com \
--cc=linux-scsi@vger.kernel.org \
--cc=manish.rangankar@qlogic.com \
--cc=michaelc@cs.wisc.edu \
--cc=ravi.anand@qlogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).