Skip to contentSkip to conversation

Miscellaneous fixes

PATCH Applied Manish Rangankar 3 participants 9 messages Apr 8, 2020 – Apr 14, 2020

Subsystems (2)
lore
Share & tools
lore

Manish Rangankar

author maintainer
#0 lore raw

cover Miscellaneous fixes

Hi Martin,

Please apply the below list of patches to the scsi tree at your convenience.

Manish Rangankar (4):
qedi: Remove additional char from boot target iqnname.
qedi: Avoid unnecessary endpoint allocation on link down
qedi: Use correct msix count for fastpath vectors.
qedi: Add modules param to enable qed iSCSI debug.

Nilesh Javali (2):
qedi: Do not flush offload work if ARP not resolved.
qedi: Fix termination timeouts in session logout

 drivers/scsi/qedi/qedi_iscsi.c | 17 ++++++++++-------
 drivers/scsi/qedi/qedi_main.c  | 11 +++++++----
 2 files changed, 17 insertions(+), 11 deletions(-)
Signature · 1 line
1.8.3.1
author maintainer
#1 lore raw

PATCH 1/6 qedi: Remove additional char from boot target iqnname.

While parsing the iSCSI TLV data to MFW request, fw boot target iqnname string was having additional character because of which we are getting below error even after the boot from SAN target were logged-in.

"[qedi_get_protocol_tlv_data:1197]:1: Boot target not set"

---
 drivers/scsi/qedi/qedi_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qedi/qedi_main.c +1 -1
index b995b19..2fe1140 100644
@@ -921,7 +921,7 @@ static void qedi_get_boot_tgt_info(struct nvm_iscsi_block *block,
 	ipv6_en = !!(block->generic.ctrl_flags &
 		     NVM_ISCSI_CFG_GEN_IPV6_ENABLED);
 
-	snprintf(tgt->iscsi_name, sizeof(tgt->iscsi_name), "%s\n",
+	snprintf(tgt->iscsi_name, sizeof(tgt->iscsi_name), "%s",
 		 block->target[index].target_name.byte);
 
 	tgt->ipv6_en = ipv6_en;
Signature · 1 line
1.8.3.1
author maintainer
#2 lore raw

PATCH 2/6 qedi: Avoid unnecessary endpoint allocation on link down

In reply to Manish Rangankar

No need to allocate and deallocate endpoint memory, if the physical link is down.

---
 drivers/scsi/qedi/qedi_iscsi.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/scsi/qedi/qedi_iscsi.c +5 -6
index 1f4a5fb..26b1151 100644
@@ -836,6 +836,11 @@ static int qedi_task_xmit(struct iscsi_task *task)
 		return ERR_PTR(ret);
 	}
 
+	if (atomic_read(&qedi->link_state) != QEDI_LINK_UP) {
+		QEDI_WARN(&qedi->dbg_ctx, "qedi link down\n");
+		return ERR_PTR(-ENXIO);
+	}
+
 	ep = iscsi_create_endpoint(sizeof(struct qedi_endpoint));
 	if (!ep) {
 		QEDI_ERR(&qedi->dbg_ctx, "endpoint create fail\n");
@@ -870,12 +875,6 @@ static int qedi_task_xmit(struct iscsi_task *task)
 		QEDI_ERR(&qedi->dbg_ctx, "Invalid endpoint\n");
 	}
 
-	if (atomic_read(&qedi->link_state) != QEDI_LINK_UP) {
-		QEDI_WARN(&qedi->dbg_ctx, "qedi link down\n");
-		ret = -ENXIO;
-		goto ep_conn_exit;
-	}
-
 	ret = qedi_alloc_sq(qedi, qedi_ep);
 	if (ret)
 		goto ep_conn_exit;
Signature · 1 line
1.8.3.1
author maintainer
#3 lore raw

PATCH 3/6 qedi: Use correct msix count for fastpath vectors.

In reply to Manish Rangankar

For proper allocation between slow-path and fast-path use msix count provided by qed.

---
 drivers/scsi/qedi/qedi_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qedi/qedi_main.c +1 -1
index 2fe1140..f1d998c 100644
@@ -1360,7 +1360,7 @@ static int qedi_request_msix_irq(struct qedi_ctx *qedi)
 	u16 idx;
 
 	cpu = cpumask_first(cpu_online_mask);
-	for (i = 0; i < MIN_NUM_CPUS_MSIX(qedi); i++) {
+	for (i = 0; i < qedi->int_info.msix_cnt; i++) {
 		idx = i * qedi->dev_info.common.num_hwfns +
 			  qedi_ops->common->get_affin_hwfn_idx(qedi->cdev);
 
Signature · 1 line
1.8.3.1
author maintainer
#4 lore raw

PATCH 4/6 qedi: Do not flush offload work if ARP not resolved.

In reply to Manish Rangankar

From: Nilesh Javali <[email protected]>

For non-reachable target offload_work is not initialized, and endpoint state is set to OFLD_NONE. This result into the WARN_ON due to check of work function field set to zero.

------------[ cut here ]------------
WARNING: CPU: 24 PID: 18587 at ../kernel/workqueue.c:3037 __flush_work+0x1c1/0x1d0
:
Hardware name: HPE ProLiant DL380 Gen10/ProLiant DL380 Gen10, BIOS U30 02/01/2020
RIP: 0010:__flush_work+0x1c1/0x1d0
Code: ba 6d 00 03 80 c9 f0 eb b6 48 c7 c7 20 ee 6c a4 e8 52 d3 04 00 0f 0b 31 c0 e9 d1 fe ff
ff 48 c7 c7 20 ee 6c a4 e8 3d d3 04 00 <0f> 0b 31 c0 e9 bc fe ff ff e8 11 f3 f
 00 31 f6
RSP: 0018:ffffac5a8cd47a80 EFLAGS: 00010282
RAX: 0000000000000024 RBX: ffff98d68c1fcaf0 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffff98ce9fd99898 RDI: ffff98ce9fd99898
RBP: ffff98d68c1fcbc0 R08: 00000000000006fa R09: 0000000000000001
R10: ffffac5a8cd47b50 R11: 0000000000000001 R12: 0000000000000000
R13: 000000000000489b R14: ffff98d68c1fc800 R15: ffff98d692132c00
FS:  00007f65f7f62280(0000) GS:ffff98ce9fd80000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffd2435e880 CR3: 0000000809334003 CR4: 00000000007606e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
Call Trace:
 ? class_create_release+0x40/0x40
 ? klist_put+0x2c/0x80
 qedi_ep_disconnect+0xdd/0x400 [qedi]
 iscsi_if_ep_disconnect.isra.20+0x59/0x70 [scsi_transport_iscsi]
 iscsi_if_rx+0x129b/0x1670 [scsi_transport_iscsi]
 ? __netlink_lookup+0xe7/0x160
 netlink_unicast+0x21d/0x300
 netlink_sendmsg+0x30f/0x430
 sock_sendmsg+0x5b/0x60
 ____sys_sendmsg+0x1e2/0x240
 ? copy_msghdr_from_user+0xd9/0x160
 ___sys_sendmsg+0x88/0xd0
 ? ___sys_recvmsg+0xa2/0xe0
 ? hrtimer_try_to_cancel+0x25/0x100
 ? do_nanosleep+0x9c/0x170
 ? __sys_sendmsg+0x5e/0xa0
 __sys_sendmsg+0x5e/0xa0
 do_syscall_64+0x60/0x1f0
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f65f6f16107
Code: 64 89 02 48 c7 c0 ff ff ff ff eb b9 0f 1f 80 00 00 00 00 8b 05 aa d2 2b 00 48 63 d2 48
63 ff 85 c0 75 18 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 59 f3 c3 0f 1f 8
    0 00 00 00 00 53 48 89 f3 48
 RSP: 002b:00007ffd24367ca8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
 RAX: ffffffffffffffda RBX: 000055a7aeaaf110 RCX: 00007f65f6f16107
 RDX: 0000000000000000 RSI: 00007ffd24367cc0 RDI: 0000000000000003
 RBP: 0000000000000070 R08: 0000000000000000 R09: 0000000000000000
 R10: 000000000000075c R11: 0000000000000246 R12: 00007ffd24367cc0
 R13: 000055a7ae560008 R14: 00007ffd24367db0 R15: 0000000000000000
 ---[ end trace 54f499c05d41f8bb ]---
---
 drivers/scsi/qedi/qedi_iscsi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/qedi/qedi_iscsi.c +2 -1
index 26b1151..80c724b 100644
@@ -1000,7 +1000,8 @@ static void qedi_ep_disconnect(struct iscsi_endpoint *ep)
 	if (qedi_ep->state == EP_STATE_OFLDCONN_START)
 		goto ep_exit_recover;
 
-	flush_work(&qedi_ep->offload_work);
+	if (qedi_ep->state != EP_STATE_OFLDCONN_NONE)
+		flush_work(&qedi_ep->offload_work);
 
 	if (qedi_ep->conn) {
 		qedi_conn = qedi_ep->conn;
Signature · 1 line
1.8.3.1
author maintainer
#5 lore raw

PATCH 5/6 qedi: Add modules param to enable qed iSCSI debug.

In reply to Manish Rangankar

Add module parameter support to enable debug message specific to iSCSI functions.

---
 drivers/scsi/qedi/qedi_main.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/scsi/qedi/qedi_main.c +5 -2
index f1d998c..b9a5c84 100644
@@ -28,6 +28,10 @@
 #include "qedi_gbl.h"
 #include "qedi_iscsi.h"
 
+static uint qedi_qed_debug;
+module_param(qedi_qed_debug, uint, 0644);
+MODULE_PARM_DESC(qedi_qed_debug, " QED debug level 0 (default)");
+
 static uint qedi_fw_debug;
 module_param(qedi_fw_debug, uint, 0644);
 MODULE_PARM_DESC(qedi_fw_debug, " Firmware debug level 0(default) to 3");
@@ -2422,7 +2426,6 @@ static int __qedi_probe(struct pci_dev *pdev, int mode)
 {
 	struct qedi_ctx *qedi;
 	struct qed_ll2_params params;
-	u32 dp_module = 0;
 	u8 dp_level = 0;
 	bool is_vf = false;
 	char host_buf[16];
@@ -2445,7 +2448,7 @@ static int __qedi_probe(struct pci_dev *pdev, int mode)
 
 	memset(&qed_params, 0, sizeof(qed_params));
 	qed_params.protocol = QED_PROTOCOL_ISCSI;
-	qed_params.dp_module = dp_module;
+	qed_params.dp_module = qedi_qed_debug;
 	qed_params.dp_level = dp_level;
 	qed_params.is_vf = is_vf;
 	qedi->cdev = qedi_ops->common->probe(pdev, &qed_params);
Signature · 1 line
1.8.3.1
author maintainer
#6 lore raw

PATCH 6/6 qedi: Fix termination timeouts in session logout

In reply to Manish Rangankar

From: Nilesh Javali <[email protected]>

The destroy conn ramrod timedout while session logouts. Fix the wait delay for graceful vs abortive termination as per the FW requirements.

---
 drivers/scsi/qedi/qedi_iscsi.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/scsi/qedi/qedi_iscsi.c +3 -0
index 80c724b..b867a14 100644
@@ -1065,6 +1065,9 @@ static void qedi_ep_disconnect(struct iscsi_endpoint *ep)
 		break;
 	}
 
+	if (!abrt_conn)
+		wait_delay += qedi->pf_params.iscsi_pf_params.two_msl_timer;
+
 	qedi_ep->state = EP_STATE_DISCONN_START;
 	ret = qedi_ops->destroy_conn(qedi->cdev, qedi_ep->handle, abrt_conn);
 	if (ret) {
Signature · 1 line
1.8.3.1
Reviewed-by on the v1 series
#7 lore raw
In reply to Manish Rangankar
Quoted 11 lines · Manish Rangankar

Hi Martin,

Please apply the below list of patches to the scsi tree at your convenience.

Manish Rangankar (4):
qedi: Remove additional char from boot target iqnname.
qedi: Avoid unnecessary endpoint allocation on link down
qedi: Use correct msix count for fastpath vectors.
qedi: Add modules param to enable qed iSCSI debug.

Quoted 8 lines

Nilesh Javali (2):
qedi: Do not flush offload work if ARP not resolved.
qedi: Fix termination timeouts in session logout

 drivers/scsi/qedi/qedi_iscsi.c | 17 ++++++++++-------
 drivers/scsi/qedi/qedi_main.c  | 11 +++++++----
 2 files changed, 17 insertions(+), 11 deletions(-)

Please add my:

tag to all 6 patches. Thank you.

Signature · 1 line
Lee
#8 lore raw
In reply to Manish Rangankar

Manish,

Quoted 2 lines

Please apply the below list of patches to the scsi tree at your convenience.

Applied to 5.8/scsi-queue. Please write better commit descriptions next time. I clarified a few.

Also, qedi shows several problems when compiled with -Werror C=1. Please fix!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering