Skip to contentSkip to conversation

qedf: Misc fixes for the driver.

PATCH In review Javed Hasan 2 participants 10 messages Aug 25, 2020 – Sep 1, 2020

Subsystems (2)
lore
Share & tools
lore

Javed Hasan

author maintainer
#0 lore raw

cover qedf: Misc fixes for the driver.

This series has misc bug fixes and code enhancements.

Kindly apply this series to scsi-queue at your earliest convenience.

Thanks,
~Javed

Javed Hasan (3):
qedf: Changed the debug parameter permission from read to read &
write.
qedf: Fix for the session’s E_D_TOV value.
qedf: FDMI Enhancement.

Saurav Kashyap (5):
qedf: Correct the comment in qedf_initiate_els.
qedf: Return SUCCESS if stale rport in encounteredon eh_abort.
qedf: Add schedule_hw_err_handler callback for fan failure.
qedf: Retry qed->probe during recovery.
qedf: Changes the %p to %px to print pointers.

 drivers/scsi/qedf/qedf.h      |   9 +++
 drivers/scsi/qedf/qedf_els.c  |  24 +++---
 drivers/scsi/qedf/qedf_fip.c  |   2 +-
 drivers/scsi/qedf/qedf_io.c   |  56 ++++++-------
 drivers/scsi/qedf/qedf_main.c | 184 ++++++++++++++++++++++++++++++------------
 5 files changed, 184 insertions(+), 91 deletions(-)
Signature · 1 line
1.8.3.1
author maintainer
#1 lore raw

PATCH 1/8 qedf: Changed the debug parameter permission from read to read & write.

-Changed the debug parameter permission from read to
read & write.

---
 drivers/scsi/qedf/qedf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qedf/qedf_main.c +1 -1
index 86b9479..5770692 100644
@@ -40,7 +40,7 @@
 	"remote ports (default 60)");
 
 uint qedf_debug = QEDF_LOG_INFO;
-module_param_named(debug, qedf_debug, uint, S_IRUGO);
+module_param_named(debug, qedf_debug, uint, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(debug, " Debug mask. Pass '1' to enable default debugging"
 	" mask");
 
Signature · 1 line
1.8.3.1
author maintainer
#2 lore raw

PATCH 2/8 qedf: Correct the comment in qedf_initiate_els.

In reply to Javed Hasan

From: Saurav Kashyap <[email protected]>

-Corrected the comment in qedf_initiate_els().

---
 drivers/scsi/qedf/qedf_els.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qedf/qedf_els.c +1 -1
index 6cb8c9b..625e58c 100644
@@ -124,7 +124,7 @@ static int qedf_initiate_els(struct qedf_rport *fcport, unsigned int op,
 	task = qedf_get_task_mem(&qedf->tasks, xid);
 	qedf_init_mp_task(els_req, task, sqe);
 
-	/* Put timer on original I/O request */
+	/* Put timer on els request */
 	if (timer_msec)
 		qedf_cmd_timer_set(qedf, els_req, timer_msec);
 
Signature · 1 line
1.8.3.1
author maintainer
#3 lore raw

PATCH 3/8 qedf: Fix for the session’s E_D_TOV value.

In reply to Javed Hasan

-FW expects E_D_TOV field in connection offload
parameters as “msec”.
-Earlier incorrect value(100ms), was leading
to abort from driver in the case when data frames for read take more than 100ms from target side, resulting in FW reporting E_D_TOV expiration.

---
 drivers/scsi/qedf/qedf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qedf/qedf_main.c +1 -1
index 5770692..ccf6a99 100644
@@ -1311,7 +1311,7 @@ static int qedf_offload_connection(struct qedf_ctx *qedf,
 	ether_addr_copy(conn_info.dst_mac, qedf->ctlr.dest_addr);
 
 	conn_info.tx_max_fc_pay_len = fcport->rdata->maxframe_size;
-	conn_info.e_d_tov_timer_val = qedf->lport->e_d_tov / 20;
+	conn_info.e_d_tov_timer_val = qedf->lport->e_d_tov;
 	conn_info.rec_tov_timer_val = 3; /* I think this is what E3 was */
 	conn_info.rx_max_fc_pay_len = fcport->rdata->maxframe_size;
 
Signature · 1 line
1.8.3.1
author maintainer
#4 lore raw

PATCH 4/8 qedf: FDMI Enhancement.

In reply to Javed Hasan

-Added attributes for RHBA and RPA registration.

---
 drivers/scsi/qedf/qedf.h      |  5 +++
 drivers/scsi/qedf/qedf_main.c | 78 +++++++++++++++++++++++++++++--------------
 2 files changed, 58 insertions(+), 25 deletions(-)
drivers/scsi/qedf/qedf.h +5 -0
index e163be8..15d6cbe 100644
@@ -544,6 +544,11 @@ extern void qedf_process_seq_cleanup_compl(struct qedf_ctx *qedf,
 
 #define FCOE_WORD_TO_BYTE  4
 #define QEDF_MAX_TASK_NUM	0xFFFF
+#define QL45xxx			0x165C
+#define QL41xxx			0x8080
+#define MAX_CT_PAYLOAD		2048
+#define DISCOVERED_PORTS	4
+#define NUMBER_OF_PORTS		1
 
 struct fip_vlan {
 	struct ethhdr eth;
drivers/scsi/qedf/qedf_main.c +53 -25

104 lines not on this page · raw message

Signature · 1 line
1.8.3.1
author maintainer
#5 lore raw

PATCH 5/8 qedf: Return SUCCESS if stale rport in encounteredon eh_abort.

In reply to Javed Hasan

From: Saurav Kashyap <[email protected]>

-If SUCCESS is not return, it can get escalated. Hence, return
SUCCESS similar to other conditions.

---
 drivers/scsi/qedf/qedf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qedf/qedf_main.c +1 -1
index bf1b755..50af70a 100644
@@ -704,7 +704,7 @@ static int qedf_eh_abort(struct scsi_cmnd *sc_cmd)
 	rdata = fcport->rdata;
 	if (!rdata || !kref_get_unless_zero(&rdata->kref)) {
 		QEDF_ERR(&qedf->dbg_ctx, "stale rport, sc_cmd=%p\n", sc_cmd);
-		rc = 1;
+		rc = SUCCESS;
 		goto out;
 	}
 
Signature · 1 line
1.8.3.1
author maintainer
#6 lore raw

PATCH 6/8 qedf: Add schedule_hw_err_handler callback for fan failure.

In reply to Javed Hasan

From: Saurav Kashyap <[email protected]>

If we receive a fan failure message from qed, disable the PCI function. Initiate recovery for errors like ramrod failure

---
 drivers/scsi/qedf/qedf.h      |  4 ++++
 drivers/scsi/qedf/qedf_main.c | 45 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+)
drivers/scsi/qedf/qedf.h +4 -0
index 15d6cbe..0e2cbb1 100644
@@ -389,6 +389,7 @@ struct qedf_ctx {
 	mempool_t *io_mempool;
 	struct workqueue_struct *dpc_wq;
 	struct delayed_work recovery_work;
+	struct delayed_work board_disable_work;
 	struct delayed_work grcdump_work;
 	struct delayed_work stag_work;
 
@@ -541,6 +542,9 @@ extern void qedf_process_seq_cleanup_compl(struct qedf_ctx *qedf,
 extern void qedf_wq_grcdump(struct work_struct *work);
 void qedf_stag_change_work(struct work_struct *work);
 void qedf_ctx_soft_reset(struct fc_lport *lport);
+extern void qedf_board_disable_work(struct work_struct *work);
+extern void qedf_schedule_hw_err_handler(void *dev,
+		enum qed_hw_err_type err_type);
 
 #define FCOE_WORD_TO_BYTE  4
 #define QEDF_MAX_TASK_NUM	0xFFFF
drivers/scsi/qedf/qedf_main.c +45 -0

63 lines not on this page · raw message

Signature · 1 line
1.8.3.1
author maintainer
#7 lore raw

PATCH 7/8 qedf: Retry qed->probe during recovery.

In reply to Javed Hasan

From: Saurav Kashyap <[email protected]>

During recovery due to fcoe fn ramrod failure, we wait for 2 sec and then call qed->probe, if probe fails then re-try max 10 times.

---
 drivers/scsi/qedf/qedf_main.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/scsi/qedf/qedf_main.c +11 -0
index 3a45ca7..091cf86 100644
@@ -3245,11 +3245,16 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)
 	void *task_start, *task_end;
 	struct qed_slowpath_params slowpath_params;
 	struct qed_probe_params qed_params;
+	u16 retry_cnt = 10;
 
 	/*
 	 * When doing error recovery we didn't reap the lport so don't try
 	 * to reallocate it.
 	 */
+retry_probe:
+	if (mode == QEDF_MODE_RECOVERY)
+		msleep(2000);
+
 	if (mode != QEDF_MODE_RECOVERY) {
 		lport = libfc_host_alloc(&qedf_host_template,
 		    sizeof(struct qedf_ctx));
@@ -3336,6 +3341,12 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)
 	qed_params.is_vf = is_vf;
 	qedf->cdev = qed_ops->common->probe(pdev, &qed_params);
 	if (!qedf->cdev) {
+		if ((mode == QEDF_MODE_RECOVERY) && retry_cnt) {
+			QEDF_ERR(&qedf->dbg_ctx,
+				"Retry %d initialize hardware\n", retry_cnt);
+			retry_cnt--;
+			goto retry_probe;
+		}
 		QEDF_ERR(&qedf->dbg_ctx, "common probe failed.\n");
 		rc = -ENODEV;
 		goto err1;
Signature · 1 line
1.8.3.1
author maintainer
#8 lore raw

PATCH 8/8 qedf: Changes the %p to %px to print pointers.

In reply to Javed Hasan

From: Saurav Kashyap <[email protected]>

-Changed all the %p to %px to print pointers.

---
 drivers/scsi/qedf/qedf_els.c  | 22 ++++++++---------
 drivers/scsi/qedf/qedf_fip.c  |  2 +-
 drivers/scsi/qedf/qedf_io.c   | 56 +++++++++++++++++++++----------------------
 drivers/scsi/qedf/qedf_main.c | 44 +++++++++++++++++-----------------
 4 files changed, 62 insertions(+), 62 deletions(-)
drivers/scsi/qedf/qedf_els.c +11 -11
index 625e58c..04f37d0 100644
@@ -63,7 +63,7 @@ static int qedf_initiate_els(struct qedf_rport *fcport, unsigned int op,
 	}
 
 	QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_ELS, "initiate_els els_req = "
-		   "0x%p cb_arg = %p xid = %x\n", els_req, cb_arg,
+		   "0x%px cb_arg = %px xid = %x\n", els_req, cb_arg,
 		   els_req->xid);
 	els_req->sc_cmd = NULL;
 	els_req->cmd_type = QEDF_ELS;
@@ -204,12 +204,12 @@ static void qedf_rrq_compl(struct qedf_els_cb_arg *cb_arg)
 
 	if (!orig_io_req) {
 		QEDF_ERR(&qedf->dbg_ctx,
-			 "Original io_req is NULL, rrq_req = %p.\n", rrq_req);
+			 "Original io_req is NULL, rrq_req = %px.\n", rrq_req);
 		goto out_free;
 	}
 
 	refcount = kref_read(&orig_io_req->refcount);
-	QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_ELS, "rrq_compl: orig io = %p,"
+	QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_ELS, "rrq_compl: orig io = %px,"
 		   " orig xid = 0x%x, rrq_xid = 0x%x, refcount=%d\n",
 		   orig_io_req, orig_io_req->xid, rrq_req->xid, refcount);
 
@@ -283,7 +283,7 @@ int qedf_send_rrq(struct qedf_ioreq *aborted_io_req)
 	refcount = kref_read(&aborted_io_req->refcount);
 	if (refcount != 1) {
 		QEDF_INFO(&qedf->dbg_ctx, QEDF_LOG_ELS,
-			  "refcount for xid=%x io_req=%p refcount=%d is not 1.\n",
+			  "refcount for xid=%x io_req=%px refcount=%d is not 1.\n",
 			  aborted_io_req->xid, aborted_io_req, refcount);
 		return -EINVAL;
 	}
@@ -293,7 +293,7 @@ int qedf_send_rrq(struct qedf_ioreq *aborted_io_req)
 	r_a_tov = lport->r_a_tov;
 
 	QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_ELS, "Sending RRQ orig "
-		   "io = %p, orig_xid = 0x%x\n", aborted_io_req,
+		   "io = %px, orig_xid = 0x%x\n", aborted_io_req,
 		   aborted_io_req->xid);
 	memset(&rrq, 0, sizeof(rrq));
 
@@ -381,7 +381,7 @@ void qedf_restart_rport(struct qedf_rport *fcport)
 	if (test_bit(QEDF_RPORT_IN_RESET, &fcport->flags) ||
 	    !test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags) ||
 	    test_bit(QEDF_RPORT_UPLOADING_CONNECTION, &fcport->flags)) {
-		QEDF_ERR(&(fcport->qedf->dbg_ctx), "fcport %p already in reset or not offloaded.\n",
+		QEDF_ERR(&(fcport->qedf->dbg_ctx), "fcport %px already in reset or not offloaded.\n",
 		    fcport);
 		spin_unlock_irqrestore(&fcport->rport_lock, flags);
 		return;
@@ -567,7 +567,7 @@ static void qedf_srr_compl(struct qedf_els_cb_arg *cb_arg)
 		cancel_delayed_work_sync(&orig_io_req->timeout_work);
 
 	refcount = kref_read(&orig_io_req->refcount);
-	QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_ELS, "Entered: orig_io=%p,"
+	QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_ELS, "Entered: orig_io=%px,"
 		   " orig_io_xid=0x%x, rec_xid=0x%x, refcount=%d\n",
 		   orig_io_req, orig_io_req->xid, srr_req->xid, refcount);
 
@@ -655,7 +655,7 @@ static int qedf_send_srr(struct qedf_ioreq *orig_io_req, u32 offset, u8 r_ctl)
 	lport = qedf->lport;
 	r_a_tov = lport->r_a_tov;
 
-	QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_ELS, "Sending SRR orig_io=%p, "
+	QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_ELS, "Sending SRR orig_io=%px, "
 		   "orig_xid=0x%x\n", orig_io_req, orig_io_req->xid);
 	memset(&srr, 0, sizeof(srr));
 
@@ -866,14 +866,14 @@ static void qedf_rec_compl(struct qedf_els_cb_arg *cb_arg)
 		cancel_delayed_work_sync(&orig_io_req->timeout_work);
 
 	refcount = kref_read(&orig_io_req->refcount);
-	QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_ELS, "Entered: orig_io=%p,"
+	QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_ELS, "Entered: orig_io=%px,"
 		   " orig_io_xid=0x%x, rec_xid=0x%x, refcount=%d\n",
 		   orig_io_req, orig_io_req->xid, rec_req->xid, refcount);
 
 	/* If a REC times out, free resources */
 	if (rec_req->event == QEDF_IOREQ_EV_ELS_TMO) {
 		QEDF_ERR(&qedf->dbg_ctx,
-			 "Got TMO event, orig_io_req %p orig_io_xid=0x%x.\n",
+			 "Got TMO event, orig_io_req %px orig_io_xid=0x%x.\n",
 			 orig_io_req, orig_io_req->xid);
 		goto out_put;
 	}
@@ -1049,7 +1049,7 @@ int qedf_send_rec(struct qedf_ioreq *orig_io_req)
 	rec.rec_rx_id =
 	    htons(orig_io_req->task->tstorm_st_context.read_write.rx_id);
 
-	QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_ELS, "Sending REC orig_io=%p, "
+	QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_ELS, "Sending REC orig_io=%px, "
 	   "orig_xid=0x%x rx_id=0x%x\n", orig_io_req,
 	   orig_io_req->xid, rec.rec_rx_id);
 	rc = qedf_initiate_els(fcport, ELS_REC, &rec, sizeof(rec),
drivers/scsi/qedf/qedf_fip.c +1 -1
index ad6a56c..b2e44bf 100644
@@ -189,7 +189,7 @@ void qedf_fip_recv(struct qedf_ctx *qedf, struct sk_buff *skb)
 	sub = fiph->fip_subcode;
 
 	QEDF_INFO(&qedf->dbg_ctx, QEDF_LOG_LL2,
-		  "FIP frame received: skb=%p fiph=%p source=%pM destn=%pM op=%x sub=%x vlan=%04x",
+		  "FIP frame received: skb=%px fiph=%px source=%pM destn=%pM op=%x sub=%x vlan=%04x",
 		  skb, fiph, eth_hdr->h_source, eth_hdr->h_dest, op,
 		  sub, vlan);
 	if (qedf_dump_frames)
drivers/scsi/qedf/qedf_io.c +28 -28

218 lines not on this page · raw message

drivers/scsi/qedf/qedf_main.c +22 -22

166 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#9 lore raw
In reply to Javed Hasan

Hi Javed,

Quoted 3 lines

This series has misc bug fixes and code enhancements.

Kindly apply this series to scsi-queue at your earliest convenience.

Please see Documentation/process/submitting-patches.rst about how to write commit descriptions.

- Please use imperative mood.

- Please describe why the change is necessary.

- Please refrain from writing commit descriptions as lists ("-Changed the debug parameter permission from read to read & write.").

- Please skip the "." at the end of each patch title.

Thank you!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering