linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/8] be2iscsi: Fix retrieving MCCQ_WRB in non-embedded Mbox path
@ 2014-05-06  1:41 Jay Kallickal
  2014-05-06  1:41 ` [PATCH 2/8] be2iscsi: Fix exposing Host in sysfs after adapter initialization is complete Jay Kallickal
                   ` (7 more replies)
  0 siblings, 8 replies; 20+ messages in thread
From: Jay Kallickal @ 2014-05-06  1:41 UTC (permalink / raw)
  To: jbottomley, linux-scsi, michaelc; +Cc: Jayamohan Kallickal, John Soni Jose

From: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>

 Getting WRB for MCCQ posting was done before looking if tag is
 available or not. This lead to increase phba->ctrl.mcc_obj.q.used
 variable and the WARN_ON message was coming from wrb_from_mccq().
 Moved getting wrb from mccq after checking for the tag.

 In wrb_from_mccq(), memset is done before returning wrb ptr.
 Removed memset of mccq wrb from all other functions.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
---
 drivers/scsi/be2iscsi/be_mgmt.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index 088bdf7..712911f 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -447,8 +447,8 @@ unsigned int mgmt_vendor_specific_fw_cmd(struct be_ctrl_info *ctrl,
 					 struct be_dma_mem *nonemb_cmd)
 {
 	struct be_cmd_resp_hdr *resp;
-	struct be_mcc_wrb *wrb = wrb_from_mccq(phba);
-	struct be_sge *mcc_sge = nonembedded_sgl(wrb);
+	struct be_mcc_wrb *wrb;
+	struct be_sge *mcc_sge;
 	unsigned int tag = 0;
 	struct iscsi_bsg_request *bsg_req = job->request;
 	struct be_bsg_vendor_cmd *req = nonemb_cmd->va;
@@ -465,7 +465,6 @@ unsigned int mgmt_vendor_specific_fw_cmd(struct be_ctrl_info *ctrl,
 	req->sector = sector;
 	req->offset = offset;
 	spin_lock(&ctrl->mbox_lock);
-	memset(wrb, 0, sizeof(*wrb));
 
 	switch (bsg_req->rqst_data.h_vendor.vendor_cmd[0]) {
 	case BEISCSI_WRITE_FLASH:
@@ -495,6 +494,8 @@ unsigned int mgmt_vendor_specific_fw_cmd(struct be_ctrl_info *ctrl,
 		return tag;
 	}
 
+	wrb = wrb_from_mccq(phba);
+	mcc_sge = nonembedded_sgl(wrb);
 	be_wrb_hdr_prepare(wrb, nonemb_cmd->size, false,
 			   job->request_payload.sg_cnt);
 	mcc_sge->pa_hi = cpu_to_le32(upper_32_bits(nonemb_cmd->dma));
@@ -525,7 +526,6 @@ int mgmt_epfw_cleanup(struct beiscsi_hba *phba, unsigned short ulp_num)
 	int status = 0;
 
 	spin_lock(&ctrl->mbox_lock);
-	memset(wrb, 0, sizeof(*wrb));
 
 	be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
 	be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI,
@@ -702,7 +702,6 @@ int mgmt_open_connection(struct beiscsi_hba *phba,
 		return tag;
 	}
 	wrb = wrb_from_mccq(phba);
-	memset(wrb, 0, sizeof(*wrb));
 	sge = nonembedded_sgl(wrb);
 
 	req = nonemb_cmd->va;
@@ -804,7 +803,7 @@ static int mgmt_exec_nonemb_cmd(struct beiscsi_hba *phba,
 				int resp_buf_len)
 {
 	struct be_ctrl_info *ctrl = &phba->ctrl;
-	struct be_mcc_wrb *wrb = wrb_from_mccq(phba);
+	struct be_mcc_wrb *wrb;
 	struct be_sge *sge;
 	unsigned int tag;
 	int rc = 0;
@@ -816,7 +815,8 @@ static int mgmt_exec_nonemb_cmd(struct beiscsi_hba *phba,
 		rc = -ENOMEM;
 		goto free_cmd;
 	}
-	memset(wrb, 0, sizeof(*wrb));
+
+	wrb = wrb_from_mccq(phba);
 	wrb->tag0 |= tag;
 	sge = nonembedded_sgl(wrb);
 
-- 
1.8.5.3


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 2/8] be2iscsi: Fix exposing Host in sysfs after adapter initialization is complete
  2014-05-06  1:41 [PATCH 1/8] be2iscsi: Fix retrieving MCCQ_WRB in non-embedded Mbox path Jay Kallickal
@ 2014-05-06  1:41 ` Jay Kallickal
  2014-05-06  1:41 ` [PATCH 3/8] be2iscsi: Fix interrupt Coalescing mechanism Jay Kallickal
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 20+ messages in thread
From: Jay Kallickal @ 2014-05-06  1:41 UTC (permalink / raw)
  To: jbottomley, linux-scsi, michaelc; +Cc: Jayamohan Kallickal, John Soni Jose

From: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>

 Before probe for function was completed, iSCSI Daemon had initiated login
 to target while OS was coming up. The targets which had node.startup=automatic,
 login process was initiated.Since function specific initialization was still in
 progress this lead to kernel panic.

 Fixed the issue by moving iscsi_host_add() call after adapter initialization
 is done.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
---
 drivers/scsi/be2iscsi/be_main.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 0d82229..a73af29 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -599,15 +599,7 @@ static struct beiscsi_hba *beiscsi_hba_alloc(struct pci_dev *pcidev)
 	pci_set_drvdata(pcidev, phba);
 	phba->interface_handle = 0xFFFFFFFF;
 
-	if (iscsi_host_add(shost, &phba->pcidev->dev))
-		goto free_devices;
-
 	return phba;
-
-free_devices:
-	pci_dev_put(phba->pcidev);
-	iscsi_host_free(phba->shost);
-	return NULL;
 }
 
 static void beiscsi_unmap_pci_function(struct beiscsi_hba *phba)
@@ -5621,6 +5613,9 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev,
 	}
 	hwi_enable_intr(phba);
 
+	if (iscsi_host_add(phba->shost, &phba->pcidev->dev))
+		goto free_blkenbld;
+
 	if (beiscsi_setup_boot_info(phba))
 		/*
 		 * log error but continue, because we may not be using
-- 
1.8.5.3


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 3/8] be2iscsi: Fix interrupt Coalescing mechanism.
  2014-05-06  1:41 [PATCH 1/8] be2iscsi: Fix retrieving MCCQ_WRB in non-embedded Mbox path Jay Kallickal
  2014-05-06  1:41 ` [PATCH 2/8] be2iscsi: Fix exposing Host in sysfs after adapter initialization is complete Jay Kallickal
@ 2014-05-06  1:41 ` Jay Kallickal
  2014-05-06  1:41 ` [PATCH 4/8] be2iscsi: Fix TCP parameters while connection offloading Jay Kallickal
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 20+ messages in thread
From: Jay Kallickal @ 2014-05-06  1:41 UTC (permalink / raw)
  To: jbottomley, linux-scsi, michaelc
  Cc: Jayamohan Kallickal, Minh Tran, John Soni Jose

From: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>

Signed-off-by: Minh Tran <minhduc.tran@emulex.com>
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
---
 drivers/scsi/be2iscsi/be.h      | 11 ++++++++
 drivers/scsi/be2iscsi/be_cmds.h | 10 ++++++-
 drivers/scsi/be2iscsi/be_main.c | 58 +++++++++++++++++++++++++++++++++++++++--
 drivers/scsi/be2iscsi/be_main.h |  5 ++--
 drivers/scsi/be2iscsi/be_mgmt.c | 37 ++++++++++++++++++++++++++
 drivers/scsi/be2iscsi/be_mgmt.h |  2 ++
 6 files changed, 118 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/be2iscsi/be.h b/drivers/scsi/be2iscsi/be.h
index 1bfb0bd..25c2164 100644
--- a/drivers/scsi/be2iscsi/be.h
+++ b/drivers/scsi/be2iscsi/be.h
@@ -83,9 +83,20 @@ static inline void queue_tail_inc(struct be_queue_info *q)
 
 /*ISCSI */
 
+struct be_aic_obj {		/* Adaptive interrupt coalescing (AIC) info */
+	bool enable;
+	u32 min_eqd;		/* in usecs */
+	u32 max_eqd;		/* in usecs */
+	u32 prev_eqd;		/* in usecs */
+	u32 et_eqd;		/* configured val when aic is off */
+	ulong jiffs;
+	u64 eq_prev;		/* Used to calculate eqe */
+};
+
 struct be_eq_obj {
 	bool todo_mcc_cq;
 	bool todo_cq;
+	u32 cq_count;
 	struct be_queue_info q;
 	struct beiscsi_hba *phba;
 	struct be_queue_info *cq;
diff --git a/drivers/scsi/be2iscsi/be_cmds.h b/drivers/scsi/be2iscsi/be_cmds.h
index 7cf7f99..cd4410f 100644
--- a/drivers/scsi/be2iscsi/be_cmds.h
+++ b/drivers/scsi/be2iscsi/be_cmds.h
@@ -271,6 +271,12 @@ struct be_cmd_resp_eq_create {
 	u16 rsvd0;		/* sword */
 } __packed;
 
+struct be_set_eqd {
+	u32 eq_id;
+	u32 phase;
+	u32 delay_multiplier;
+} __packed;
+
 struct mgmt_chap_format {
 	u32 flags;
 	u8  intr_chap_name[256];
@@ -622,7 +628,7 @@ struct be_cmd_req_modify_eq_delay {
 		u32 eq_id;
 		u32 phase;
 		u32 delay_multiplier;
-	} delay[8];
+	} delay[MAX_CPUS];
 } __packed;
 
 /******************** Get MAC ADDR *******************/
@@ -708,6 +714,8 @@ unsigned int be_cmd_get_port_speed(struct beiscsi_hba *phba);
 
 void free_mcc_tag(struct be_ctrl_info *ctrl, unsigned int tag);
 
+int be_cmd_modify_eq_delay(struct beiscsi_hba *phba, struct be_set_eqd *,
+			    int num);
 int beiscsi_mccq_compl(struct beiscsi_hba *phba,
 			uint32_t tag, struct be_mcc_wrb **wrb,
 			struct be_dma_mem *mbx_cmd_mem);
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index a73af29..9ff8667 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -2271,6 +2271,7 @@ static int be_iopoll(struct blk_iopoll *iop, int budget)
 
 	pbe_eq = container_of(iop, struct be_eq_obj, iopoll);
 	ret = beiscsi_process_cq(pbe_eq);
+	pbe_eq->cq_count += ret;
 	if (ret < budget) {
 		phba = pbe_eq->phba;
 		blk_iopoll_complete(iop);
@@ -3825,9 +3826,9 @@ static int hwi_init_port(struct beiscsi_hba *phba)
 
 	phwi_ctrlr = phba->phwi_ctrlr;
 	phwi_context = phwi_ctrlr->phwi_ctxt;
-	phwi_context->max_eqd = 0;
+	phwi_context->max_eqd = 128;
 	phwi_context->min_eqd = 0;
-	phwi_context->cur_eqd = 64;
+	phwi_context->cur_eqd = 0;
 	be_cmd_fw_initialize(&phba->ctrl);
 
 	status = beiscsi_create_eqs(phba, phwi_context);
@@ -5282,6 +5283,57 @@ static void beiscsi_msix_enable(struct beiscsi_hba *phba)
 	return;
 }
 
+static void be_eqd_update(struct beiscsi_hba *phba)
+{
+	struct be_set_eqd set_eqd[MAX_CPUS];
+	struct be_aic_obj *aic;
+	struct be_eq_obj *pbe_eq;
+	struct hwi_controller *phwi_ctrlr;
+	struct hwi_context_memory *phwi_context;
+	int eqd, i, num = 0;
+	ulong now;
+	u32 pps, delta;
+	unsigned int tag;
+
+	phwi_ctrlr = phba->phwi_ctrlr;
+	phwi_context = phwi_ctrlr->phwi_ctxt;
+
+	for (i = 0; i <= phba->num_cpus; i++) {
+		aic = &phba->aic_obj[i];
+		pbe_eq = &phwi_context->be_eq[i];
+		now = jiffies;
+		if (!aic->jiffs || time_before(now, aic->jiffs) ||
+		    pbe_eq->cq_count < aic->eq_prev) {
+			aic->jiffs = now;
+			aic->eq_prev = pbe_eq->cq_count;
+			continue;
+		}
+		delta = jiffies_to_msecs(now - aic->jiffs);
+		pps = (((u32)(pbe_eq->cq_count - aic->eq_prev) * 1000) / delta);
+		eqd = (pps / 1500) << 2;
+
+		if (eqd < 8)
+			eqd = 0;
+		eqd = min_t(u32, eqd, phwi_context->max_eqd);
+		eqd = max_t(u32, eqd, phwi_context->min_eqd);
+
+		aic->jiffs = now;
+		aic->eq_prev = pbe_eq->cq_count;
+
+		if (eqd != aic->prev_eqd) {
+			set_eqd[num].delay_multiplier = (eqd * 65)/100;
+			set_eqd[num].eq_id = pbe_eq->q.id;
+			aic->prev_eqd = eqd;
+			num++;
+		}
+	}
+	if (num) {
+		tag = be_cmd_modify_eq_delay(phba, set_eqd, num);
+		if (tag)
+			beiscsi_mccq_compl(phba, tag, NULL, NULL);
+	}
+}
+
 /*
  * beiscsi_hw_health_check()- Check adapter health
  * @work: work item to check HW health
@@ -5295,6 +5347,8 @@ beiscsi_hw_health_check(struct work_struct *work)
 		container_of(work, struct beiscsi_hba,
 			     beiscsi_hw_check_task.work);
 
+	be_eqd_update(phba);
+
 	beiscsi_ue_detect(phba);
 
 	schedule_delayed_work(&phba->beiscsi_hw_check_task,
diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h
index 9380b55..dc56ea9 100644
--- a/drivers/scsi/be2iscsi/be_main.h
+++ b/drivers/scsi/be2iscsi/be_main.h
@@ -71,8 +71,8 @@
 
 #define BEISCSI_SGLIST_ELEMENTS	30
 
-#define BEISCSI_CMD_PER_LUN	128	/* scsi_host->cmd_per_lun */
-#define BEISCSI_MAX_SECTORS	2048	/* scsi_host->max_sectors */
+#define BEISCSI_CMD_PER_LUN	128 /* scsi_host->cmd_per_lun */
+#define BEISCSI_MAX_SECTORS	1024 /* scsi_host->max_sectors */
 #define BEISCSI_TEMPLATE_HDR_PER_CXN_SIZE 128 /* Template size per cxn */
 
 #define BEISCSI_MAX_CMD_LEN	16	/* scsi_host->max_cmd_len */
@@ -427,6 +427,7 @@ struct beiscsi_hba {
 	struct mgmt_session_info boot_sess;
 	struct invalidate_command_table inv_tbl[128];
 
+	struct be_aic_obj aic_obj[MAX_CPUS];
 	unsigned int attr_log_enable;
 	int (*iotask_fn)(struct iscsi_task *,
 			struct scatterlist *sg,
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index 712911f..52a36fb 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -155,6 +155,43 @@ void beiscsi_ue_detect(struct beiscsi_hba *phba)
 	}
 }
 
+int be_cmd_modify_eq_delay(struct beiscsi_hba *phba,
+		 struct be_set_eqd *set_eqd, int num)
+{
+	struct be_ctrl_info *ctrl = &phba->ctrl;
+	struct be_mcc_wrb *wrb;
+	struct be_cmd_req_modify_eq_delay *req;
+	unsigned int tag = 0;
+	int i;
+
+	spin_lock(&ctrl->mbox_lock);
+	tag = alloc_mcc_tag(phba);
+	if (!tag) {
+		spin_unlock(&ctrl->mbox_lock);
+		return tag;
+	}
+
+	wrb = wrb_from_mccq(phba);
+	req = embedded_payload(wrb);
+
+	wrb->tag0 |= tag;
+	be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
+	be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
+		OPCODE_COMMON_MODIFY_EQ_DELAY, sizeof(*req));
+
+	req->num_eq = cpu_to_le32(num);
+	for (i = 0; i < num; i++) {
+		req->delay[i].eq_id = cpu_to_le32(set_eqd[i].eq_id);
+		req->delay[i].phase = 0;
+		req->delay[i].delay_multiplier =
+				cpu_to_le32(set_eqd[i].delay_multiplier);
+	}
+
+	be_mcc_notify(phba);
+	spin_unlock(&ctrl->mbox_lock);
+	return tag;
+}
+
 /**
  * mgmt_reopen_session()- Reopen a session based on reopen_type
  * @phba: Device priv structure instance
diff --git a/drivers/scsi/be2iscsi/be_mgmt.h b/drivers/scsi/be2iscsi/be_mgmt.h
index 01b8c97..24a8fc5 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.h
+++ b/drivers/scsi/be2iscsi/be_mgmt.h
@@ -335,5 +335,7 @@ void beiscsi_offload_cxn_v0(struct beiscsi_offload_params *params,
 void beiscsi_offload_cxn_v2(struct beiscsi_offload_params *params,
 			     struct wrb_handle *pwrb_handle);
 void beiscsi_ue_detect(struct beiscsi_hba *phba);
+int be_cmd_modify_eq_delay(struct beiscsi_hba *phba,
+			 struct be_set_eqd *, int num);
 
 #endif
-- 
1.8.5.3


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 4/8] be2iscsi: Fix TCP parameters while connection offloading.
  2014-05-06  1:41 [PATCH 1/8] be2iscsi: Fix retrieving MCCQ_WRB in non-embedded Mbox path Jay Kallickal
  2014-05-06  1:41 ` [PATCH 2/8] be2iscsi: Fix exposing Host in sysfs after adapter initialization is complete Jay Kallickal
  2014-05-06  1:41 ` [PATCH 3/8] be2iscsi: Fix interrupt Coalescing mechanism Jay Kallickal
@ 2014-05-06  1:41 ` Jay Kallickal
  2014-05-06  1:41 ` [PATCH 5/8] be2iscsi: Fix memory corruption in MBX path Jay Kallickal
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 20+ messages in thread
From: Jay Kallickal @ 2014-05-06  1:41 UTC (permalink / raw)
  To: jbottomley, linux-scsi, michaelc
  Cc: Jayamohan Kallickal, Minh Tran, John Soni Jose

From: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>

 SKH-R adapter, TCP Window Size/Scale parameters are passed
 in TCP Connection Offload Mbx Command.

Signed-off-by: Minh Tran <minhduc.tran@emulex.com>
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
---
 drivers/scsi/be2iscsi/be_cmds.h  | 21 +++++++++++++++++++++
 drivers/scsi/be2iscsi/be_iscsi.c | 12 +++++++++---
 drivers/scsi/be2iscsi/be_mgmt.c  | 13 ++++++++++---
 3 files changed, 40 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/be2iscsi/be_cmds.h b/drivers/scsi/be2iscsi/be_cmds.h
index cd4410f..cc7405c 100644
--- a/drivers/scsi/be2iscsi/be_cmds.h
+++ b/drivers/scsi/be2iscsi/be_cmds.h
@@ -71,6 +71,7 @@ struct be_mcc_wrb {
 #define BEISCSI_FW_MBX_TIMEOUT	100
 
 /* MBOX Command VER */
+#define MBX_CMD_VER1	0x01
 #define MBX_CMD_VER2	0x02
 
 struct be_mcc_compl {
@@ -1013,6 +1014,26 @@ struct tcp_connect_and_offload_in {
 	u8 rsvd0[3];
 } __packed;
 
+struct tcp_connect_and_offload_in_v1 {
+	struct be_cmd_req_hdr hdr;
+	struct ip_addr_format ip_address;
+	u16 tcp_port;
+	u16 cid;
+	u16 cq_id;
+	u16 defq_id;
+	struct phys_addr dataout_template_pa;
+	u16 hdr_ring_id;
+	u16 data_ring_id;
+	u8 do_offload;
+	u8 ifd_state;
+	u8 rsvd0[2];
+	u16 tcp_window_size;
+	u8 tcp_window_scale_count;
+	u8 rsvd1;
+	u32 tcp_mss:24;
+	u8 rsvd2;
+} __packed;
+
 struct tcp_connect_and_offload_out {
 	struct be_cmd_resp_hdr hdr;
 	u32 connection_handle;
diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c
index a3df433..fd284ff 100644
--- a/drivers/scsi/be2iscsi/be_iscsi.c
+++ b/drivers/scsi/be2iscsi/be_iscsi.c
@@ -1106,7 +1106,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep,
 	struct beiscsi_hba *phba = beiscsi_ep->phba;
 	struct tcp_connect_and_offload_out *ptcpcnct_out;
 	struct be_dma_mem nonemb_cmd;
-	unsigned int tag;
+	unsigned int tag, req_memsize;
 	int ret = -ENOMEM;
 
 	beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
@@ -1127,8 +1127,14 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep,
 		       (beiscsi_ep->ep_cid)] = ep;
 
 	beiscsi_ep->cid_vld = 0;
+
+	if (is_chip_be2_be3r(phba))
+		req_memsize = sizeof(struct tcp_connect_and_offload_in);
+	else
+		req_memsize = sizeof(struct tcp_connect_and_offload_in_v1);
+
 	nonemb_cmd.va = pci_alloc_consistent(phba->ctrl.pdev,
-				sizeof(struct tcp_connect_and_offload_in),
+				req_memsize,
 				&nonemb_cmd.dma);
 	if (nonemb_cmd.va == NULL) {
 
@@ -1139,7 +1145,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep,
 		beiscsi_free_ep(beiscsi_ep);
 		return -ENOMEM;
 	}
-	nonemb_cmd.size = sizeof(struct tcp_connect_and_offload_in);
+	nonemb_cmd.size = req_memsize;
 	memset(nonemb_cmd.va, 0, nonemb_cmd.size);
 	tag = mgmt_open_connection(phba, dst_addr, beiscsi_ep, &nonemb_cmd);
 	if (tag <= 0) {
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index 52a36fb..6045aa7 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -712,7 +712,7 @@ int mgmt_open_connection(struct beiscsi_hba *phba,
 	struct sockaddr_in6 *daddr_in6 = (struct sockaddr_in6 *)dst_addr;
 	struct be_ctrl_info *ctrl = &phba->ctrl;
 	struct be_mcc_wrb *wrb;
-	struct tcp_connect_and_offload_in *req;
+	struct tcp_connect_and_offload_in_v1 *req;
 	unsigned short def_hdr_id;
 	unsigned short def_data_id;
 	struct phys_addr template_address = { 0, 0 };
@@ -745,10 +745,10 @@ int mgmt_open_connection(struct beiscsi_hba *phba,
 	memset(req, 0, sizeof(*req));
 	wrb->tag0 |= tag;
 
-	be_wrb_hdr_prepare(wrb, sizeof(*req), false, 1);
+	be_wrb_hdr_prepare(wrb, nonemb_cmd->size, false, 1);
 	be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI,
 			   OPCODE_COMMON_ISCSI_TCP_CONNECT_AND_OFFLOAD,
-			   sizeof(*req));
+			   nonemb_cmd->size);
 	if (dst_addr->sa_family == PF_INET) {
 		__be32 s_addr = daddr_in->sin_addr.s_addr;
 		req->ip_address.ip_type = BE2_IPV4;
@@ -794,6 +794,13 @@ int mgmt_open_connection(struct beiscsi_hba *phba,
 	sge->pa_hi = cpu_to_le32(upper_32_bits(nonemb_cmd->dma));
 	sge->pa_lo = cpu_to_le32(nonemb_cmd->dma & 0xFFFFFFFF);
 	sge->len = cpu_to_le32(nonemb_cmd->size);
+
+	if (!is_chip_be2_be3r(phba)) {
+		req->hdr.version = MBX_CMD_VER1;
+		req->tcp_window_size = 0;
+		req->tcp_window_scale_count = 2;
+	}
+
 	be_mcc_notify(phba);
 	spin_unlock(&ctrl->mbox_lock);
 	return tag;
-- 
1.8.5.3


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 5/8] be2iscsi: Fix memory corruption in MBX path
  2014-05-06  1:41 [PATCH 1/8] be2iscsi: Fix retrieving MCCQ_WRB in non-embedded Mbox path Jay Kallickal
                   ` (2 preceding siblings ...)
  2014-05-06  1:41 ` [PATCH 4/8] be2iscsi: Fix TCP parameters while connection offloading Jay Kallickal
@ 2014-05-06  1:41 ` Jay Kallickal
  2014-05-06  1:41 ` [PATCH 6/8] be2iscsi: Fix destroy MCC-CQ before MCC-EQ is destroyed Jay Kallickal
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 20+ messages in thread
From: Jay Kallickal @ 2014-05-06  1:41 UTC (permalink / raw)
  To: jbottomley, linux-scsi, michaelc; +Cc: Jayamohan Kallickal, John Soni Jose

From: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>

 From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
 Sent: Friday, March 28, 2014 1:42 AM
 Subject: re: [SCSI] be2iscsi: Fix handling timed out MBX completion from FW

 Hello Jayamohan Kallickal,

 The patch 1957aa7f6246: "[SCSI] be2iscsi: Fix handling timed out MBX completion from FW" from Jan 29, 2014, leads to the following static checker warning:

 drivers/scsi/be2iscsi/be_main.c:5581 beiscsi_dev_probe()
 error: memset() '&phba->ctrl.ptag_state[i]->tag_mem_state' too small (24 vs 32)

 drivers/scsi/be2iscsi/be_main.c
 5576          for (i = 0; i < MAX_MCC_CMD; i++) {
 5577                  init_waitqueue_head(&phba->ctrl.mcc_wait[i + 1]);
 5578                  phba->ctrl.mcc_tag[i] = i + 1;
 5579                  phba->ctrl.mcc_numtag[i + 1] = 0;
 5580                  phba->ctrl.mcc_tag_available++;
 5581                  memset(&phba->ctrl.ptag_state[i].tag_mem_state, 0,
 5582                         sizeof(struct beiscsi_mcc_tag_state));
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 Probably this this be change to sizeof(struct be_dma_mem struct)?  It looks like we are corrupting memory a bit here.

 5583          }

 regards,
 dan carpenter

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
---
 drivers/scsi/be2iscsi/be_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 9ff8667..e8bba90 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -5625,7 +5625,7 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev,
 		phba->ctrl.mcc_numtag[i + 1] = 0;
 		phba->ctrl.mcc_tag_available++;
 		memset(&phba->ctrl.ptag_state[i].tag_mem_state, 0,
-		       sizeof(struct beiscsi_mcc_tag_state));
+		       sizeof(struct be_dma_mem));
 	}
 
 	phba->ctrl.mcc_alloc_index = phba->ctrl.mcc_free_index = 0;
-- 
1.8.5.3


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 6/8] be2iscsi: Fix destroy MCC-CQ before MCC-EQ is destroyed
  2014-05-06  1:41 [PATCH 1/8] be2iscsi: Fix retrieving MCCQ_WRB in non-embedded Mbox path Jay Kallickal
                   ` (3 preceding siblings ...)
  2014-05-06  1:41 ` [PATCH 5/8] be2iscsi: Fix memory corruption in MBX path Jay Kallickal
@ 2014-05-06  1:41 ` Jay Kallickal
  2014-05-06  1:41 ` [PATCH 7/8] be2iscsi: Fix processing cqe for cxn whose endpoint is freed Jay Kallickal
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 20+ messages in thread
From: Jay Kallickal @ 2014-05-06  1:41 UTC (permalink / raw)
  To: jbottomley, linux-scsi, michaelc; +Cc: Jayamohan Kallickal, John Soni Jose

From: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>

 EQ teardown should happen only after all CQ are destroyed.
 In some FW config, adapter goes into a freeze state. This
 fix moves teardown of MCC-Q before the EQ teardown happens.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
---
 drivers/scsi/be2iscsi/be_main.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index e8bba90..dccda6c 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -3685,7 +3685,7 @@ static void hwi_cleanup(struct beiscsi_hba *phba)
 	struct hwi_controller *phwi_ctrlr;
 	struct hwi_context_memory *phwi_context;
 	struct hwi_async_pdu_context *pasync_ctx;
-	int i, eq_num, ulp_num;
+	int i, eq_for_mcc, ulp_num;
 
 	phwi_ctrlr = phba->phwi_ctrlr;
 	phwi_context = phwi_ctrlr->phwi_ctxt;
@@ -3722,16 +3722,17 @@ static void hwi_cleanup(struct beiscsi_hba *phba)
 		if (q->created)
 			beiscsi_cmd_q_destroy(ctrl, q, QTYPE_CQ);
 	}
+
+	be_mcc_queues_destroy(phba);
 	if (phba->msix_enabled)
-		eq_num = 1;
+		eq_for_mcc = 1;
 	else
-		eq_num = 0;
-	for (i = 0; i < (phba->num_cpus + eq_num); i++) {
+		eq_for_mcc = 0;
+	for (i = 0; i < (phba->num_cpus + eq_for_mcc); i++) {
 		q = &phwi_context->be_eq[i].q;
 		if (q->created)
 			beiscsi_cmd_q_destroy(ctrl, q, QTYPE_EQ);
 	}
-	be_mcc_queues_destroy(phba);
 	be_cmd_fw_uninit(ctrl);
 }
 
-- 
1.8.5.3


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 7/8] be2iscsi: Fix processing cqe for cxn whose endpoint is freed
  2014-05-06  1:41 [PATCH 1/8] be2iscsi: Fix retrieving MCCQ_WRB in non-embedded Mbox path Jay Kallickal
                   ` (4 preceding siblings ...)
  2014-05-06  1:41 ` [PATCH 6/8] be2iscsi: Fix destroy MCC-CQ before MCC-EQ is destroyed Jay Kallickal
@ 2014-05-06  1:41 ` Jay Kallickal
  2014-05-07 22:18   ` Mike Christie
  2014-05-06  1:41 ` [PATCH 8/8] be2iscsi: Bump the driver version Jay Kallickal
  2014-05-06  1:41 ` [PATCH 0/8] be2iscsi: update to 10.2.273.0 Jay Kallickal
  7 siblings, 1 reply; 20+ messages in thread
From: Jay Kallickal @ 2014-05-06  1:41 UTC (permalink / raw)
  To: jbottomley, linux-scsi, michaelc
  Cc: Jayamohan Kallickal, Minh Tran, John Soni Jose

From: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>

 During heavy IO in multipath environment with many active sessions
 and port-bouncing happening, there is a race condition because of
 which beiscsi_prcess_cqe() gets called for a connection whose
 endpoint is freed.

 Checking endpoint reference for a connection before processing in
 beiscsi_process_cq().

Signed-off-by: Minh Tran <minhduc.tran@emulex.com>
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
---
 drivers/scsi/be2iscsi/be_main.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index dccda6c..5a7022f 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -2110,6 +2110,16 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
 
 		cri_index = BE_GET_CRI_FROM_CID(cid);
 		ep = phba->ep_array[cri_index];
+		if (unlikely(ep == NULL)) {
+			/* connection has already been freed
+			 * just move on to next one
+			 */
+			beiscsi_log(phba, KERN_WARNING,
+				    BEISCSI_LOG_INIT,
+				    "BM_%d : proc cqe of disconn ep: cid %d\n",
+				    cid);
+			goto proc_next_cqe;
+		}
 		beiscsi_ep = ep->dd_data;
 		beiscsi_conn = beiscsi_ep->conn;
 
@@ -2219,6 +2229,7 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
 			break;
 		}
 
+proc_next_cqe:
 		AMAP_SET_BITS(struct amap_sol_cqe, valid, sol, 0);
 		queue_tail_inc(cq);
 		sol = queue_tail_node(cq);
-- 
1.8.5.3


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 8/8] be2iscsi: Bump the driver version
  2014-05-06  1:41 [PATCH 1/8] be2iscsi: Fix retrieving MCCQ_WRB in non-embedded Mbox path Jay Kallickal
                   ` (5 preceding siblings ...)
  2014-05-06  1:41 ` [PATCH 7/8] be2iscsi: Fix processing cqe for cxn whose endpoint is freed Jay Kallickal
@ 2014-05-06  1:41 ` Jay Kallickal
  2014-05-06  1:41 ` [PATCH 0/8] be2iscsi: update to 10.2.273.0 Jay Kallickal
  7 siblings, 0 replies; 20+ messages in thread
From: Jay Kallickal @ 2014-05-06  1:41 UTC (permalink / raw)
  To: jbottomley, linux-scsi, michaelc; +Cc: Jayamohan Kallickal, John Soni Jose

From: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>

 Bumping the driver version.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
---
 drivers/scsi/be2iscsi/be_main.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h
index dc56ea9..9ceab42 100644
--- a/drivers/scsi/be2iscsi/be_main.h
+++ b/drivers/scsi/be2iscsi/be_main.h
@@ -36,7 +36,7 @@
 #include <scsi/scsi_transport_iscsi.h>
 
 #define DRV_NAME		"be2iscsi"
-#define BUILD_STR		"10.2.125.0"
+#define BUILD_STR		"10.2.273.0"
 #define BE_NAME			"Emulex OneConnect" \
 				"Open-iSCSI Driver version" BUILD_STR
 #define DRV_DESC		BE_NAME " " "Driver"
-- 
1.8.5.3


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 0/8] be2iscsi: update to 10.2.273.0
  2014-05-06  1:41 [PATCH 1/8] be2iscsi: Fix retrieving MCCQ_WRB in non-embedded Mbox path Jay Kallickal
                   ` (6 preceding siblings ...)
  2014-05-06  1:41 ` [PATCH 8/8] be2iscsi: Bump the driver version Jay Kallickal
@ 2014-05-06  1:41 ` Jay Kallickal
  7 siblings, 0 replies; 20+ messages in thread
From: Jay Kallickal @ 2014-05-06  1:41 UTC (permalink / raw)
  To: jbottomley, linux-scsi, michaelc; +Cc: Jayamohan Kallickal, Jayamohan Kallickal

From: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>


 This patchset updates be2iscsi driver to 10.2.273.0.

This patchset supercedes any patches that have been submitted
but not accepted

These patches are based on scsi-misc branch of scsi.git.

0001 - Fix retrieving MCCQ_WRB in non embedded Mbox
0002 - Fix exposing Host in sysfs after adapter init is done
0003 - Fix interrupt Coalescing mechanism
0004 - Fix TCP parameters while connection offloadling
0005 - Fix memory corruption in MBX path
0006 - Fix destroy MCC CQ before MCC EQ is destroy.patch
0007 - Fix processing cqe for cxn whose endpoint is freed 
0008 - Bump the driver version

Thanks
Jay

Signed-off-by: Jayamohan Kallickal <Jayamohan.Kallickal@emulex.com>
---

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 7/8] be2iscsi: Fix processing cqe for cxn whose endpoint is freed
  2014-05-06  1:41 ` [PATCH 7/8] be2iscsi: Fix processing cqe for cxn whose endpoint is freed Jay Kallickal
@ 2014-05-07 22:18   ` Mike Christie
  2014-05-28 15:51     ` Christoph Hellwig
  2014-06-02  5:52     ` Sony John-N
  0 siblings, 2 replies; 20+ messages in thread
From: Mike Christie @ 2014-05-07 22:18 UTC (permalink / raw)
  To: Jay Kallickal
  Cc: jbottomley, linux-scsi, Jayamohan Kallickal, Minh Tran,
	John Soni Jose

On 05/05/2014 08:41 PM, Jay Kallickal wrote:
> From: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
> 
>  During heavy IO in multipath environment with many active sessions
>  and port-bouncing happening, there is a race condition because of
>  which beiscsi_prcess_cqe() gets called for a connection whose
>  endpoint is freed.
> 
>  Checking endpoint reference for a connection before processing in
>  beiscsi_process_cq().
> 
> Signed-off-by: Minh Tran <minhduc.tran@emulex.com>
> Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
> ---
>  drivers/scsi/be2iscsi/be_main.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
> index dccda6c..5a7022f 100644
> --- a/drivers/scsi/be2iscsi/be_main.c
> +++ b/drivers/scsi/be2iscsi/be_main.c
> @@ -2110,6 +2110,16 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
>  
>  		cri_index = BE_GET_CRI_FROM_CID(cid);
>  		ep = phba->ep_array[cri_index];
> +		if (unlikely(ep == NULL)) {
> +			/* connection has already been freed
> +			 * just move on to next one
> +			 */
> +			beiscsi_log(phba, KERN_WARNING,
> +				    BEISCSI_LOG_INIT,
> +				    "BM_%d : proc cqe of disconn ep: cid %d\n",
> +				    cid);
> +			goto proc_next_cqe;
> +		}
>  		beiscsi_ep = ep->dd_data;
>  		beiscsi_conn = beiscsi_ep->conn;
>  

It looks like if that race is possible then we could also free the ep
while you are accessing right? I think you would need to get a ref to
the ep.

What command/function tells the card to stop sending the driver
events/notifications/ios for that connection? Is it beiscsi_close_conn
or mgmt_invalidate_connection?

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 7/8] be2iscsi: Fix processing cqe for cxn whose endpoint is freed
  2014-05-07 22:18   ` Mike Christie
@ 2014-05-28 15:51     ` Christoph Hellwig
  2014-06-02  5:52     ` Sony John-N
  1 sibling, 0 replies; 20+ messages in thread
From: Christoph Hellwig @ 2014-05-28 15:51 UTC (permalink / raw)
  To: Mike Christie
  Cc: Jay Kallickal, jbottomley, linux-scsi, Jayamohan Kallickal,
	Minh Tran, John Soni Jose

On Wed, May 07, 2014 at 05:18:38PM -0500, Mike Christie wrote:
> It looks like if that race is possible then we could also free the ep
> while you are accessing right? I think you would need to get a ref to
> the ep.
> 
> What command/function tells the card to stop sending the driver
> events/notifications/ios for that connection? Is it beiscsi_close_conn
> or mgmt_invalidate_connection?

Jay,

can you look into this issue please?  I've applied the series to the
scsi queue for now, but I'd really prefer to see this addressed ASAP.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [PATCH 7/8] be2iscsi: Fix processing cqe for cxn whose endpoint is freed
  2014-05-07 22:18   ` Mike Christie
  2014-05-28 15:51     ` Christoph Hellwig
@ 2014-06-02  5:52     ` Sony John-N
  2014-06-02  6:46       ` Christoph Hellwig
  1 sibling, 1 reply; 20+ messages in thread
From: Sony John-N @ 2014-06-02  5:52 UTC (permalink / raw)
  To: Mike Christie, Jay Kallickal
  Cc: jbottomley@parallels.com, linux-scsi@vger.kernel.org,
	Jayamohan Kallickal, Minh Duc Tran



-----Original Message-----
From: Mike Christie [mailto:michaelc@cs.wisc.edu] 
Sent: Thursday, May 08, 2014 3:49 AM
To: Jay Kallickal
Cc: jbottomley@parallels.com; linux-scsi@vger.kernel.org; Jayamohan Kallickal; Minh Duc Tran; Sony John-N
Subject: Re: [PATCH 7/8] be2iscsi: Fix processing cqe for cxn whose endpoint is freed

On 05/05/2014 08:41 PM, Jay Kallickal wrote:
> From: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
> 
>  During heavy IO in multipath environment with many active sessions  
> and port-bouncing happening, there is a race condition because of  
> which beiscsi_prcess_cqe() gets called for a connection whose  
> endpoint is freed.
> 
>  Checking endpoint reference for a connection before processing in  
> beiscsi_process_cq().
> 
> Signed-off-by: Minh Tran <minhduc.tran@emulex.com>
> Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
> ---
>  drivers/scsi/be2iscsi/be_main.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/scsi/be2iscsi/be_main.c 
> b/drivers/scsi/be2iscsi/be_main.c index dccda6c..5a7022f 100644
> --- a/drivers/scsi/be2iscsi/be_main.c
> +++ b/drivers/scsi/be2iscsi/be_main.c
> @@ -2110,6 +2110,16 @@ static unsigned int beiscsi_process_cq(struct 
> be_eq_obj *pbe_eq)
>  
>  		cri_index = BE_GET_CRI_FROM_CID(cid);
>  		ep = phba->ep_array[cri_index];
> +		if (unlikely(ep == NULL)) {
> +			/* connection has already been freed
> +			 * just move on to next one
> +			 */
> +			beiscsi_log(phba, KERN_WARNING,
> +				    BEISCSI_LOG_INIT,
> +				    "BM_%d : proc cqe of disconn ep: cid %d\n",
> +				    cid);
> +			goto proc_next_cqe;
> +		}
>  		beiscsi_ep = ep->dd_data;
>  		beiscsi_conn = beiscsi_ep->conn;
>  

> It looks like if that race is possible then we could also free the ep while you are accessing right? I think you would need to get a ref to the ep.
We will pull out this patch from this release. This is a very corner case and requires changes to be done in the IO path of the driver.  We will redo the patch and submit in our next release.
Please pull-in all the other patches in this set expect this particular one "[PATCH 7/8] be2iscsi: Fix processing cqe for cxn whose endpoint is freed".

> What command/function tells the card to stop sending the driver events/notifications/ios for that connection? Is it beiscsi_close_conn or mgmt_invalidate_connection?
Mgmt_invalidate_connection tell card to stop sending events to the driver for a particular connection.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 7/8] be2iscsi: Fix processing cqe for cxn whose endpoint is freed
  2014-06-02  5:52     ` Sony John-N
@ 2014-06-02  6:46       ` Christoph Hellwig
  2014-06-02 19:22         ` James Bottomley
  0 siblings, 1 reply; 20+ messages in thread
From: Christoph Hellwig @ 2014-06-02  6:46 UTC (permalink / raw)
  To: Sony John-N
  Cc: Mike Christie, Jay Kallickal, jbottomley@parallels.com,
	linux-scsi@vger.kernel.org, Jayamohan Kallickal, Minh Duc Tran


I will pull out that patch from the drivers queue, thanks.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 7/8] be2iscsi: Fix processing cqe for cxn whose endpoint is freed
  2014-06-02  6:46       ` Christoph Hellwig
@ 2014-06-02 19:22         ` James Bottomley
  2014-06-02 19:33           ` hch
  0 siblings, 1 reply; 20+ messages in thread
From: James Bottomley @ 2014-06-02 19:22 UTC (permalink / raw)
  To: hch@infradead.org
  Cc: linux-scsi@vger.kernel.org, MinhDuc.Tran@Emulex.Com,
	jayamohank@gmail.com, michaelc@cs.wisc.edu,
	Sony.John-N@Emulex.Com, Jayamohan.Kallickal@Emulex.Com

On Sun, 2014-06-01 at 23:46 -0700, Christoph Hellwig wrote:
> I will pull out that patch from the drivers queue, thanks.

Actually, can you really pull it out, not just revert it?  Reverts cause
problems with bisection and are unnecessary before the tree goes to
Linus.

If preserving history becomes a real goal, we'd have to move to a tip
like model, but I'm happy coping with the rebase that dropping a patch
from a monolithic tree causes.

James


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 7/8] be2iscsi: Fix processing cqe for cxn whose endpoint is freed
  2014-06-02 19:22         ` James Bottomley
@ 2014-06-02 19:33           ` hch
  2014-06-02 20:02             ` James Bottomley
  2014-06-02 20:05             ` Linus Torvalds
  0 siblings, 2 replies; 20+ messages in thread
From: hch @ 2014-06-02 19:33 UTC (permalink / raw)
  To: James Bottomley, Linus Torvalds
  Cc: linux-scsi@vger.kernel.org, MinhDuc.Tran@Emulex.Com,
	jayamohank@gmail.com, michaelc@cs.wisc.edu,
	Sony.John-N@Emulex.Com, Jayamohan.Kallickal@Emulex.Com

On Mon, Jun 02, 2014 at 07:22:07PM +0000, James Bottomley wrote:
> Actually, can you really pull it out, not just revert it?  Reverts cause
> problems with bisection and are unnecessary before the tree goes to
> Linus.
> 
> If preserving history becomes a real goal, we'd have to move to a tip
> like model, but I'm happy coping with the rebase that dropping a patch
> from a monolithic tree causes.

Linus has been very unappy about rebasing close to or in the merge
window, and other subsystems generally revert patches that late in the
cycle as well.  I'd prefer to stick to that model, but if you and Linus
prefer the rebase now I can do it as well of course.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 7/8] be2iscsi: Fix processing cqe for cxn whose endpoint is freed
  2014-06-02 19:33           ` hch
@ 2014-06-02 20:02             ` James Bottomley
  2014-06-02 20:05             ` Linus Torvalds
  1 sibling, 0 replies; 20+ messages in thread
From: James Bottomley @ 2014-06-02 20:02 UTC (permalink / raw)
  To: hch@infradead.org
  Cc: torvalds@linux-foundation.org, linux-scsi@vger.kernel.org,
	jayamohank@gmail.com, MinhDuc.Tran@Emulex.Com,
	michaelc@cs.wisc.edu, Sony.John-N@Emulex.Com,
	Jayamohan.Kallickal@Emulex.Com

On Mon, 2014-06-02 at 12:33 -0700, hch@infradead.org wrote:
> On Mon, Jun 02, 2014 at 07:22:07PM +0000, James Bottomley wrote:
> > Actually, can you really pull it out, not just revert it?  Reverts cause
> > problems with bisection and are unnecessary before the tree goes to
> > Linus.
> > 
> > If preserving history becomes a real goal, we'd have to move to a tip
> > like model, but I'm happy coping with the rebase that dropping a patch
> > from a monolithic tree causes.
> 
> Linus has been very unappy about rebasing close to or in the merge
> window, and other subsystems generally revert patches that late in the
> cycle as well.  I'd prefer to stick to that model, but if you and Linus
> prefer the rebase now I can do it as well of course.

Yes, please. I've done it before, but note what happened in the pull
message.  He doesn't usually object to this in SCSI because no-one
really develops based on our tree.  As I said, if they did, we'd need to
follow a tip model, so we could just drop the problem driver and redo
the patches.  I also tend to delay the pull a day or so to give
linux-next time to pick up the change, so that Stephen Rothwell doesn't
complain about it.

Thanks,

James


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 7/8] be2iscsi: Fix processing cqe for cxn whose endpoint is freed
  2014-06-02 19:33           ` hch
  2014-06-02 20:02             ` James Bottomley
@ 2014-06-02 20:05             ` Linus Torvalds
  2014-06-02 20:08               ` hch
  1 sibling, 1 reply; 20+ messages in thread
From: Linus Torvalds @ 2014-06-02 20:05 UTC (permalink / raw)
  To: hch@infradead.org
  Cc: James Bottomley, linux-scsi@vger.kernel.org,
	MinhDuc.Tran@Emulex.Com, jayamohank@gmail.com,
	michaelc@cs.wisc.edu, Sony.John-N@Emulex.Com,
	Jayamohan.Kallickal@Emulex.Com

On Mon, Jun 2, 2014 at 12:33 PM, hch@infradead.org <hch@infradead.org> wrote:
>
> Linus has been very unappy about rebasing close to or in the merge
> window, and other subsystems generally revert patches that late in the
> cycle as well.  I'd prefer to stick to that model, but if you and Linus
> prefer the rebase now I can do it as well of course.

I would indeed prefer to avoid rebases, _unless_ the tree is a real
mess without it.

Now, what constitues "real mess" can vary. It can be just really ugly
history, and part of that can be "it doesn't build or work at all
partway through". If it causes major build or boot failures the code
is *not* worth merging as-is, because that ends up being really
painful for bisection etc. But for it to matter for bisection, it has
to be a _major_ failure that actually matters to real people. So I'm
not talking about odd "make randomconfig" failures, but painful build
failures that actually hit reasonable configurations, and boot
failures that hit relevant hardware configurations.

Even in the absense of major build/working problems, "real mess" can
be about just horrible history with tons of stupid merges that just
makes it much harder to figure out what was going on.

So it's a judgment thing in the end, not a black-and-white "never
rebase". I don't know how core that revert is.

            Linus

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 7/8] be2iscsi: Fix processing cqe for cxn whose endpoint is freed
  2014-06-02 20:05             ` Linus Torvalds
@ 2014-06-02 20:08               ` hch
  2014-06-02 20:24                 ` Linus Torvalds
  0 siblings, 1 reply; 20+ messages in thread
From: hch @ 2014-06-02 20:08 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: hch@infradead.org, James Bottomley, linux-scsi@vger.kernel.org,
	MinhDuc.Tran@Emulex.Com, jayamohank@gmail.com,
	michaelc@cs.wisc.edu, Sony.John-N@Emulex.Com,
	Jayamohan.Kallickal@Emulex.Com

On Mon, Jun 02, 2014 at 01:05:38PM -0700, Linus Torvalds wrote:
> I would indeed prefer to avoid rebases, _unless_ the tree is a real
> mess without it.
> 
> Now, what constitues "real mess" can vary. It can be just really ugly
> history, and part of that can be "it doesn't build or work at all
> partway through". If it causes major build or boot failures the code
> is *not* worth merging as-is, because that ends up being really
> painful for bisection etc. But for it to matter for bisection, it has
> to be a _major_ failure that actually matters to real people. So I'm
> not talking about odd "make randomconfig" failures, but painful build
> failures that actually hit reasonable configurations, and boot
> failures that hit relevant hardware configurations.

It's reverting a patch that just doesn't fix a problem fully, so the
prime reviewer and the patch author decided to withdraw it.  It won't
cause any kind of problem during bisection.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 7/8] be2iscsi: Fix processing cqe for cxn whose endpoint is freed
  2014-06-02 20:08               ` hch
@ 2014-06-02 20:24                 ` Linus Torvalds
  2014-06-02 20:32                   ` hch
  0 siblings, 1 reply; 20+ messages in thread
From: Linus Torvalds @ 2014-06-02 20:24 UTC (permalink / raw)
  To: hch@infradead.org
  Cc: James Bottomley, linux-scsi@vger.kernel.org,
	MinhDuc.Tran@Emulex.Com, jayamohank@gmail.com,
	michaelc@cs.wisc.edu, Sony.John-N@Emulex.Com,
	Jayamohan.Kallickal@Emulex.Com

On Mon, Jun 2, 2014 at 1:08 PM, hch@infradead.org <hch@infradead.org> wrote:
>
> It's reverting a patch that just doesn't fix a problem fully, so the
> prime reviewer and the patch author decided to withdraw it.  It won't
> cause any kind of problem during bisection.

If it isn't a particularly large patch and doesn't have any other
issues, I'd suggest just reverting it.

Particularly large patches can be worth undoing just to avoid
unnecessary noise in "git blame" etc, but that's an issue mainly for
things like whitespace crap that really touches a *lot* of code and so
the noise is a big thing.

              Linus

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 7/8] be2iscsi: Fix processing cqe for cxn whose endpoint is freed
  2014-06-02 20:24                 ` Linus Torvalds
@ 2014-06-02 20:32                   ` hch
  0 siblings, 0 replies; 20+ messages in thread
From: hch @ 2014-06-02 20:32 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: hch@infradead.org, James Bottomley, linux-scsi@vger.kernel.org,
	MinhDuc.Tran@Emulex.Com, jayamohank@gmail.com,
	michaelc@cs.wisc.edu, Sony.John-N@Emulex.Com,
	Jayamohan.Kallickal@Emulex.Com

On Mon, Jun 02, 2014 at 01:24:22PM -0700, Linus Torvalds wrote:
> If it isn't a particularly large patch and doesn't have any other
> issues, I'd suggest just reverting it.
> 
> Particularly large patches can be worth undoing just to avoid
> unnecessary noise in "git blame" etc, but that's an issue mainly for
> things like whitespace crap that really touches a *lot* of code and so
> the noise is a big thing.

It's an smal and simple driver patch:

http://git.infradead.org/users/hch/scsi-queue.git/commitdiff/4f96827dd55981ec4bfcbc7584eb155bcd8d1849

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2014-06-02 20:32 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-06  1:41 [PATCH 1/8] be2iscsi: Fix retrieving MCCQ_WRB in non-embedded Mbox path Jay Kallickal
2014-05-06  1:41 ` [PATCH 2/8] be2iscsi: Fix exposing Host in sysfs after adapter initialization is complete Jay Kallickal
2014-05-06  1:41 ` [PATCH 3/8] be2iscsi: Fix interrupt Coalescing mechanism Jay Kallickal
2014-05-06  1:41 ` [PATCH 4/8] be2iscsi: Fix TCP parameters while connection offloading Jay Kallickal
2014-05-06  1:41 ` [PATCH 5/8] be2iscsi: Fix memory corruption in MBX path Jay Kallickal
2014-05-06  1:41 ` [PATCH 6/8] be2iscsi: Fix destroy MCC-CQ before MCC-EQ is destroyed Jay Kallickal
2014-05-06  1:41 ` [PATCH 7/8] be2iscsi: Fix processing cqe for cxn whose endpoint is freed Jay Kallickal
2014-05-07 22:18   ` Mike Christie
2014-05-28 15:51     ` Christoph Hellwig
2014-06-02  5:52     ` Sony John-N
2014-06-02  6:46       ` Christoph Hellwig
2014-06-02 19:22         ` James Bottomley
2014-06-02 19:33           ` hch
2014-06-02 20:02             ` James Bottomley
2014-06-02 20:05             ` Linus Torvalds
2014-06-02 20:08               ` hch
2014-06-02 20:24                 ` Linus Torvalds
2014-06-02 20:32                   ` hch
2014-05-06  1:41 ` [PATCH 8/8] be2iscsi: Bump the driver version Jay Kallickal
2014-05-06  1:41 ` [PATCH 0/8] be2iscsi: update to 10.2.273.0 Jay Kallickal

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).