All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/15] qedf: Update driver to version 8.18.22.0.
@ 2017-05-23 13:19 Dupuis, Chad
  2017-05-23 13:19 ` [PATCH 01/15] qedf: Enable basic FDMI information Dupuis, Chad
                   ` (16 more replies)
  0 siblings, 17 replies; 33+ messages in thread
From: Dupuis, Chad @ 2017-05-23 13:19 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

Hi Martin,

Please apply the following patches to the scsi tree at your earliest convenience.

Thanks,
Chad

Dupuis, Chad (15):
  qedf: Enable basic FDMI information.
  qedf: Update copyright to 2017.
  qedf: Honor qed_ops->common->set_fp_int() return code.
  qedf: Look at all descriptors when processing a clear virtual link.
  qedf: Check that fcport is offloaded before dereferencing pointers in
    initiate_abts|cleanup.
  qedf: Add fka_period SCSI host attribute to show fip keep alive
    period.
  qedf: Set qed logging level to QED_LEVEL_NOTICE.
  qedf: Use same logic for SCSI host reset and FC lip_reset.
  qedf: Add bus_reset No-op.
  qedf: Add non-offload receive filters.
  qedf: Fixup unnecessary paratheses around test_bit operations.
  qedf: Move some prints to a debug level so they do not print when no
    debugging is enabled.
  qedf: Change cmd_per_lun in scsi_host_template to 32 to increase
    performance.
  qedf: Add change_queue_depth member to scsi_host_template().
  qedf: Update version number to 8.18.22.0.

 drivers/scsi/qedf/drv_fcoe_fw_funcs.c |   2 +-
 drivers/scsi/qedf/drv_fcoe_fw_funcs.h |   2 +-
 drivers/scsi/qedf/drv_scsi_fw_funcs.c |   2 +-
 drivers/scsi/qedf/drv_scsi_fw_funcs.h |   2 +-
 drivers/scsi/qedf/qedf.h              |   2 +-
 drivers/scsi/qedf/qedf_attr.c         |  62 ++++++++-----
 drivers/scsi/qedf/qedf_dbg.h          |   2 +-
 drivers/scsi/qedf/qedf_debugfs.c      |   2 +-
 drivers/scsi/qedf/qedf_els.c          |   8 +-
 drivers/scsi/qedf/qedf_fip.c          |  22 +++--
 drivers/scsi/qedf/qedf_hsi.h          |   2 +-
 drivers/scsi/qedf/qedf_io.c           |  26 ++++--
 drivers/scsi/qedf/qedf_main.c         | 165 +++++++++++++++++++++++++++++-----
 drivers/scsi/qedf/qedf_version.h      |   8 +-
 14 files changed, 231 insertions(+), 76 deletions(-)

-- 
1.8.5.6

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

* [PATCH 01/15] qedf: Enable basic FDMI information.
  2017-05-23 13:19 [PATCH 00/15] qedf: Update driver to version 8.18.22.0 Dupuis, Chad
@ 2017-05-23 13:19 ` Dupuis, Chad
  2017-05-24 16:16   ` Bart Van Assche
  2017-05-23 13:19 ` [PATCH 02/15] qedf: Update copyright to 2017 Dupuis, Chad
                   ` (15 subsequent siblings)
  16 siblings, 1 reply; 33+ messages in thread
From: Dupuis, Chad @ 2017-05-23 13:19 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

For libfc to register FDMI attributes we need to do two things:

- Set the appropriate fc_host attributes that libfc will use to form the
  FDMI registration commands
- Set lport->fdmi_enabled to 1

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
---
 drivers/scsi/qedf/qedf_main.c | 57 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index cceddd9..2949932 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -22,6 +22,7 @@
 #include <linux/if_vlan.h>
 #include <linux/cpu.h>
 #include "qedf.h"
+#include <uapi/linux/pci_regs.h>
 
 const struct qed_fcoe_ops *qed_ops;
 
@@ -1334,6 +1335,60 @@ static void qedf_fcoe_ctlr_setup(struct qedf_ctx *qedf)
 	ether_addr_copy(qedf->ctlr.ctl_src_addr, qedf->mac);
 }
 
+static void qedf_setup_fdmi(struct qedf_ctx *qedf)
+{
+	struct fc_lport *lport = qedf->lport;
+	u8 buf[8];
+	int i, pos;
+
+	/*
+	 * fdmi_enabled needs to be set for libfc to execute FDMI registration.
+	 */
+	lport->fdmi_enabled = 1;
+
+	/*
+	 * Setup the necessary fc_host attributes to that will be used to fill
+	 * in the FDMI information.
+	 */
+
+	/* Get the PCI-e Device Serial Number Capability */
+	pos = pci_find_ext_capability(qedf->pdev, PCI_EXT_CAP_ID_DSN);
+	if (pos) {
+		pos += 4;
+		for (i = 0; i < 8; i++)
+			pci_read_config_byte(qedf->pdev, pos + i, &buf[i]);
+
+		snprintf(fc_host_serial_number(lport->host),
+		    FC_SERIAL_NUMBER_SIZE,
+		    "%02X%02X%02X%02X%02X%02X%02X%02X",
+		    buf[7], buf[6], buf[5], buf[4],
+		    buf[3], buf[2], buf[1], buf[0]);
+	} else
+		snprintf(fc_host_serial_number(lport->host),
+		    FC_SERIAL_NUMBER_SIZE, "Unknown");
+
+	snprintf(fc_host_manufacturer(lport->host),
+	    FC_SERIAL_NUMBER_SIZE, "%s", "Cavium Inc.");
+
+	snprintf(fc_host_model(lport->host),
+	    FC_SYMBOLIC_NAME_SIZE, "%s", "QL41000");
+
+	snprintf(fc_host_model_description(lport->host),
+	    FC_SYMBOLIC_NAME_SIZE, "%s", "QLogic FastLinQ QL41000 Series "
+	    "10/25/40/50GGbE Controller (FCoE)");
+
+	snprintf(fc_host_hardware_version(lport->host),
+	    FC_VERSION_STRING_SIZE, "Rev %d", qedf->pdev->revision);
+
+	snprintf(fc_host_driver_version(lport->host),
+	    FC_VERSION_STRING_SIZE, "%s", QEDF_VERSION);
+
+	snprintf(fc_host_firmware_version(lport->host),
+	    FC_VERSION_STRING_SIZE, "%d.%d.%d.%d",
+	    FW_MAJOR_VERSION, FW_MINOR_VERSION, FW_REVISION_VERSION,
+	    FW_ENGINEERING_VERSION);
+}
+
 static int qedf_lport_setup(struct qedf_ctx *qedf)
 {
 	struct fc_lport *lport = qedf->lport;
@@ -1377,6 +1432,8 @@ static int qedf_lport_setup(struct qedf_ctx *qedf)
 	snprintf(fc_host_symbolic_name(lport->host), 256,
 	    "QLogic %s v%s", QEDF_MODULE_NAME, QEDF_VERSION);
 
+	qedf_setup_fdmi(qedf);
+
 	return 0;
 }
 
-- 
1.8.5.6

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

* [PATCH 02/15] qedf: Update copyright to 2017.
  2017-05-23 13:19 [PATCH 00/15] qedf: Update driver to version 8.18.22.0 Dupuis, Chad
  2017-05-23 13:19 ` [PATCH 01/15] qedf: Enable basic FDMI information Dupuis, Chad
@ 2017-05-23 13:19 ` Dupuis, Chad
  2017-05-23 13:19 ` [PATCH 03/15] qedf: Honor qed_ops->common->set_fp_int() return code Dupuis, Chad
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 33+ messages in thread
From: Dupuis, Chad @ 2017-05-23 13:19 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
---
 drivers/scsi/qedf/drv_fcoe_fw_funcs.c | 2 +-
 drivers/scsi/qedf/drv_fcoe_fw_funcs.h | 2 +-
 drivers/scsi/qedf/drv_scsi_fw_funcs.c | 2 +-
 drivers/scsi/qedf/drv_scsi_fw_funcs.h | 2 +-
 drivers/scsi/qedf/qedf.h              | 2 +-
 drivers/scsi/qedf/qedf_attr.c         | 2 +-
 drivers/scsi/qedf/qedf_dbg.h          | 2 +-
 drivers/scsi/qedf/qedf_debugfs.c      | 2 +-
 drivers/scsi/qedf/qedf_els.c          | 2 +-
 drivers/scsi/qedf/qedf_fip.c          | 2 +-
 drivers/scsi/qedf/qedf_hsi.h          | 2 +-
 drivers/scsi/qedf/qedf_io.c           | 2 +-
 drivers/scsi/qedf/qedf_main.c         | 2 +-
 drivers/scsi/qedf/qedf_version.h      | 2 +-
 14 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/qedf/drv_fcoe_fw_funcs.c b/drivers/scsi/qedf/drv_fcoe_fw_funcs.c
index 8c65e3b..7d91e53 100644
--- a/drivers/scsi/qedf/drv_fcoe_fw_funcs.c
+++ b/drivers/scsi/qedf/drv_fcoe_fw_funcs.c
@@ -1,5 +1,5 @@
 /* QLogic FCoE Offload Driver
- * Copyright (c) 2016 Cavium Inc.
+ * Copyright (c) 2016-2017 Cavium Inc.
  *
  * This software is available under the terms of the GNU General Public License
  * (GPL) Version 2, available from the file COPYING in the main directory of
diff --git a/drivers/scsi/qedf/drv_fcoe_fw_funcs.h b/drivers/scsi/qedf/drv_fcoe_fw_funcs.h
index 617529b..f9c50fa 100644
--- a/drivers/scsi/qedf/drv_fcoe_fw_funcs.h
+++ b/drivers/scsi/qedf/drv_fcoe_fw_funcs.h
@@ -1,5 +1,5 @@
 /* QLogic FCoE Offload Driver
- * Copyright (c) 2016 Cavium Inc.
+ * Copyright (c) 2016-2017 Cavium Inc.
  *
  * This software is available under the terms of the GNU General Public License
  * (GPL) Version 2, available from the file COPYING in the main directory of
diff --git a/drivers/scsi/qedf/drv_scsi_fw_funcs.c b/drivers/scsi/qedf/drv_scsi_fw_funcs.c
index 11e0cc0..5d5095e 100644
--- a/drivers/scsi/qedf/drv_scsi_fw_funcs.c
+++ b/drivers/scsi/qedf/drv_scsi_fw_funcs.c
@@ -1,5 +1,5 @@
 /* QLogic FCoE Offload Driver
- * Copyright (c) 2016 Cavium Inc.
+ * Copyright (c) 2016-2017 Cavium Inc.
  *
  * This software is available under the terms of the GNU General Public License
  * (GPL) Version 2, available from the file COPYING in the main directory of
diff --git a/drivers/scsi/qedf/drv_scsi_fw_funcs.h b/drivers/scsi/qedf/drv_scsi_fw_funcs.h
index 9cb4541..8fbe6e4 100644
--- a/drivers/scsi/qedf/drv_scsi_fw_funcs.h
+++ b/drivers/scsi/qedf/drv_scsi_fw_funcs.h
@@ -1,5 +1,5 @@
 /* QLogic FCoE Offload Driver
- * Copyright (c) 2016 Cavium Inc.
+ * Copyright (c) 2016-2017 Cavium Inc.
  *
  * This software is available under the terms of the GNU General Public License
  * (GPL) Version 2, available from the file COPYING in the main directory of
diff --git a/drivers/scsi/qedf/qedf.h b/drivers/scsi/qedf/qedf.h
index 40aeb6b..a5b89b0 100644
--- a/drivers/scsi/qedf/qedf.h
+++ b/drivers/scsi/qedf/qedf.h
@@ -1,6 +1,6 @@
 /*
  *  QLogic FCoE Offload Driver
- *  Copyright (c) 2016 Cavium Inc.
+ *  Copyright (c) 2016-2017 Cavium Inc.
  *
  *  This software is available under the terms of the GNU General Public License
  *  (GPL) Version 2, available from the file COPYING in the main directory of
diff --git a/drivers/scsi/qedf/qedf_attr.c b/drivers/scsi/qedf/qedf_attr.c
index 4772061..1349f8a 100644
--- a/drivers/scsi/qedf/qedf_attr.c
+++ b/drivers/scsi/qedf/qedf_attr.c
@@ -1,6 +1,6 @@
 /*
  *  QLogic FCoE Offload Driver
- *  Copyright (c) 2016 Cavium Inc.
+ *  Copyright (c) 2016-2017 Cavium Inc.
  *
  *  This software is available under the terms of the GNU General Public License
  *  (GPL) Version 2, available from the file COPYING in the main directory of
diff --git a/drivers/scsi/qedf/qedf_dbg.h b/drivers/scsi/qedf/qedf_dbg.h
index 7d173f48..50083ca 100644
--- a/drivers/scsi/qedf/qedf_dbg.h
+++ b/drivers/scsi/qedf/qedf_dbg.h
@@ -1,6 +1,6 @@
 /*
  *  QLogic FCoE Offload Driver
- *  Copyright (c) 2016 Cavium Inc.
+ *  Copyright (c) 2016-2017 Cavium Inc.
  *
  *  This software is available under the terms of the GNU General Public License
  *  (GPL) Version 2, available from the file COPYING in the main directory of
diff --git a/drivers/scsi/qedf/qedf_debugfs.c b/drivers/scsi/qedf/qedf_debugfs.c
index 00a1d64..2b1ef30 100644
--- a/drivers/scsi/qedf/qedf_debugfs.c
+++ b/drivers/scsi/qedf/qedf_debugfs.c
@@ -1,6 +1,6 @@
 /*
  *  QLogic FCoE Offload Driver
- *  Copyright (c) 2016 QLogic Corporation
+ *  Copyright (c) 2016-2017 QLogic Corporation
  *
  *  This software is available under the terms of the GNU General Public License
  *  (GPL) Version 2, available from the file COPYING in the main directory of
diff --git a/drivers/scsi/qedf/qedf_els.c b/drivers/scsi/qedf/qedf_els.c
index c505d41..e197fd6 100644
--- a/drivers/scsi/qedf/qedf_els.c
+++ b/drivers/scsi/qedf/qedf_els.c
@@ -1,6 +1,6 @@
 /*
  *  QLogic FCoE Offload Driver
- *  Copyright (c) 2016 Cavium Inc.
+ *  Copyright (c) 2016-2017 Cavium Inc.
  *
  *  This software is available under the terms of the GNU General Public License
  *  (GPL) Version 2, available from the file COPYING in the main directory of
diff --git a/drivers/scsi/qedf/qedf_fip.c b/drivers/scsi/qedf/qedf_fip.c
index e10b91c..2dfb817 100644
--- a/drivers/scsi/qedf/qedf_fip.c
+++ b/drivers/scsi/qedf/qedf_fip.c
@@ -1,6 +1,6 @@
 /*
  *  QLogic FCoE Offload Driver
- *  Copyright (c) 2016 Cavium Inc.
+ *  Copyright (c) 2016-2017 Cavium Inc.
  *
  *  This software is available under the terms of the GNU General Public License
  *  (GPL) Version 2, available from the file COPYING in the main directory of
diff --git a/drivers/scsi/qedf/qedf_hsi.h b/drivers/scsi/qedf/qedf_hsi.h
index dfd65de..7faef80 100644
--- a/drivers/scsi/qedf/qedf_hsi.h
+++ b/drivers/scsi/qedf/qedf_hsi.h
@@ -1,6 +1,6 @@
 /*
  *  QLogic FCoE Offload Driver
- *  Copyright (c) 2016 Cavium Inc.
+ *  Copyright (c) 2016-2017 Cavium Inc.
  *
  *  This software is available under the terms of the GNU General Public License
  *  (GPL) Version 2, available from the file COPYING in the main directory of
diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c
index 1d7f90d..ca9097b 100644
--- a/drivers/scsi/qedf/qedf_io.c
+++ b/drivers/scsi/qedf/qedf_io.c
@@ -1,6 +1,6 @@
 /*
  *  QLogic FCoE Offload Driver
- *  Copyright (c) 2016 Cavium Inc.
+ *  Copyright (c) 2016-2017 Cavium Inc.
  *
  *  This software is available under the terms of the GNU General Public License
  *  (GPL) Version 2, available from the file COPYING in the main directory of
diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index 2949932..c8d1688 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -1,6 +1,6 @@
 /*
  *  QLogic FCoE Offload Driver
- *  Copyright (c) 2016 Cavium Inc.
+ *  Copyright (c) 2016-2017 Cavium Inc.
  *
  *  This software is available under the terms of the GNU General Public License
  *  (GPL) Version 2, available from the file COPYING in the main directory of
diff --git a/drivers/scsi/qedf/qedf_version.h b/drivers/scsi/qedf/qedf_version.h
index 4ae5f53..d46c487 100644
--- a/drivers/scsi/qedf/qedf_version.h
+++ b/drivers/scsi/qedf/qedf_version.h
@@ -1,6 +1,6 @@
 /*
  *  QLogic FCoE Offload Driver
- *  Copyright (c) 2016 Cavium Inc.
+ *  Copyright (c) 2016-2017 Cavium Inc.
  *
  *  This software is available under the terms of the GNU General Public License
  *  (GPL) Version 2, available from the file COPYING in the main directory of
-- 
1.8.5.6

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

* [PATCH 03/15] qedf: Honor qed_ops->common->set_fp_int() return code.
  2017-05-23 13:19 [PATCH 00/15] qedf: Update driver to version 8.18.22.0 Dupuis, Chad
  2017-05-23 13:19 ` [PATCH 01/15] qedf: Enable basic FDMI information Dupuis, Chad
  2017-05-23 13:19 ` [PATCH 02/15] qedf: Update copyright to 2017 Dupuis, Chad
@ 2017-05-23 13:19 ` Dupuis, Chad
  2017-05-24 16:22   ` Bart Van Assche
  2017-05-23 13:19 ` [PATCH 04/15] qedf: Look at all descriptors when processing a clear virtual link Dupuis, Chad
                   ` (13 subsequent siblings)
  16 siblings, 1 reply; 33+ messages in thread
From: Dupuis, Chad @ 2017-05-23 13:19 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

We need to check the return code the set_fp_int() callback in case we were
not allocated any fastpath interrupts or there was an error setting up the
fastpath interrupts from the qed perspective.

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
---
 drivers/scsi/qedf/qedf_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index c8d1688..f703801 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -2036,6 +2036,8 @@ static int qedf_setup_int(struct qedf_ctx *qedf)
 	 * Learn interrupt configuration
 	 */
 	rc = qed_ops->common->set_fp_int(qedf->cdev, num_online_cpus());
+	if (rc <= 0)
+		return 0;
 
 	rc  = qed_ops->common->get_fp_int(qedf->cdev, &qedf->int_info);
 	if (rc)
-- 
1.8.5.6

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

* [PATCH 04/15] qedf: Look at all descriptors when processing a clear virtual link.
  2017-05-23 13:19 [PATCH 00/15] qedf: Update driver to version 8.18.22.0 Dupuis, Chad
                   ` (2 preceding siblings ...)
  2017-05-23 13:19 ` [PATCH 03/15] qedf: Honor qed_ops->common->set_fp_int() return code Dupuis, Chad
@ 2017-05-23 13:19 ` Dupuis, Chad
  2017-05-24 16:24   ` Bart Van Assche
  2017-05-23 13:19 ` [PATCH 05/15] qedf: Check that fcport is offloaded before dereferencing pointers in initiate_abts|cleanup Dupuis, Chad
                   ` (12 subsequent siblings)
  16 siblings, 1 reply; 33+ messages in thread
From: Dupuis, Chad @ 2017-05-23 13:19 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

If there are multiple descriptors for a particular type in a clear virtual
link we receive, we will not process it correctly but rather take the last
value. This can cause us not to not flap the virtual link as the value from
the descriptors that we compare against the our stored FCF or fc_lport values
may not match.

Change is to do a comparison when processing the each descriptor instead of at
the end and then set a bool if we need to do the reset.

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
---
 drivers/scsi/qedf/qedf_fip.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/scsi/qedf/qedf_fip.c b/drivers/scsi/qedf/qedf_fip.c
index 2dfb817..64b04f2 100644
--- a/drivers/scsi/qedf/qedf_fip.c
+++ b/drivers/scsi/qedf/qedf_fip.c
@@ -156,10 +156,9 @@ void qedf_fip_recv(struct qedf_ctx *qedf, struct sk_buff *skb)
 	struct fip_wwn_desc *wp;
 	struct fip_vn_desc *vp;
 	size_t rlen, dlen;
-	uint32_t cvl_port_id;
-	__u8 cvl_mac[ETH_ALEN];
 	u16 op;
 	u8 sub;
+	bool do_reset = false;
 
 	eth_hdr = (struct ethhdr *)skb_mac_header(skb);
 	fiph = (struct fip_header *) ((void *)skb->data + 2 * ETH_ALEN + 2);
@@ -190,8 +189,6 @@ void qedf_fip_recv(struct qedf_ctx *qedf, struct sk_buff *skb)
 			return;
 		}
 
-		cvl_port_id = 0;
-		memset(cvl_mac, 0, ETH_ALEN);
 		/*
 		 * We need to loop through the CVL descriptors to determine
 		 * if we want to reset the fcoe link
@@ -205,7 +202,9 @@ void qedf_fip_recv(struct qedf_ctx *qedf, struct sk_buff *skb)
 				mp = (struct fip_mac_desc *)desc;
 				QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_LL2,
 				    "fd_mac=%pM\n", mp->fd_mac);
-				ether_addr_copy(cvl_mac, mp->fd_mac);
+				if (ether_addr_equal(mp->fd_mac,
+				    qedf->ctlr.sel_fcf->fcf_mac))
+					do_reset = true;
 				break;
 			case FIP_DT_NAME:
 				wp = (struct fip_wwn_desc *)desc;
@@ -217,7 +216,9 @@ void qedf_fip_recv(struct qedf_ctx *qedf, struct sk_buff *skb)
 				vp = (struct fip_vn_desc *)desc;
 				QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_LL2,
 				    "fd_fc_id=%x.\n", ntoh24(vp->fd_fc_id));
-				cvl_port_id = ntoh24(vp->fd_fc_id);
+				if (ntoh24(vp->fd_fc_id) ==
+				    qedf->lport->port_id)
+					do_reset = true;
 				break;
 			default:
 				/* Ignore anything else */
@@ -228,11 +229,8 @@ void qedf_fip_recv(struct qedf_ctx *qedf, struct sk_buff *skb)
 		}
 
 		QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_LL2,
-		    "cvl_port_id=%06x cvl_mac=%pM.\n", cvl_port_id,
-		    cvl_mac);
-		if (cvl_port_id == qedf->lport->port_id &&
-		    ether_addr_equal(cvl_mac,
-		    qedf->ctlr.sel_fcf->fcf_mac)) {
+		    "do_reset=%d.\n", do_reset);
+		if (do_reset) {
 			fcoe_ctlr_link_down(&qedf->ctlr);
 			qedf_wait_for_upload(qedf);
 			fcoe_ctlr_link_up(&qedf->ctlr);
-- 
1.8.5.6

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

* [PATCH 05/15] qedf: Check that fcport is offloaded before dereferencing pointers in initiate_abts|cleanup.
  2017-05-23 13:19 [PATCH 00/15] qedf: Update driver to version 8.18.22.0 Dupuis, Chad
                   ` (3 preceding siblings ...)
  2017-05-23 13:19 ` [PATCH 04/15] qedf: Look at all descriptors when processing a clear virtual link Dupuis, Chad
@ 2017-05-23 13:19 ` Dupuis, Chad
  2017-05-24 16:25   ` Bart Van Assche
  2017-05-23 13:19 ` [PATCH 06/15] qedf: Add fka_period SCSI host attribute to show fip keep alive period Dupuis, Chad
                   ` (11 subsequent siblings)
  16 siblings, 1 reply; 33+ messages in thread
From: Dupuis, Chad @ 2017-05-23 13:19 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

If an fcport is not offloaded then the members of the qedf_rport struct
are undefined which may cause a system crash.

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
---
 drivers/scsi/qedf/qedf_io.c | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c
index ca9097b..db16004 100644
--- a/drivers/scsi/qedf/qedf_io.c
+++ b/drivers/scsi/qedf/qedf_io.c
@@ -1476,8 +1476,8 @@ int qedf_initiate_abts(struct qedf_ioreq *io_req, bool return_scsi_cmd_on_abts)
 {
 	struct fc_lport *lport;
 	struct qedf_rport *fcport = io_req->fcport;
-	struct fc_rport_priv *rdata = fcport->rdata;
-	struct qedf_ctx *qedf = fcport->qedf;
+	struct fc_rport_priv *rdata;
+	struct qedf_ctx *qedf;
 	u16 xid;
 	u32 r_a_tov = 0;
 	int rc = 0;
@@ -1485,15 +1485,18 @@ int qedf_initiate_abts(struct qedf_ioreq *io_req, bool return_scsi_cmd_on_abts)
 	struct fcoe_wqe *sqe;
 	u16 sqe_idx;
 
-	r_a_tov = rdata->r_a_tov;
-	lport = qedf->lport;
-
+	/* Sanity check qedf_rport before dereferencing any pointers */
 	if (!test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags)) {
-		QEDF_ERR(&(qedf->dbg_ctx), "tgt not offloaded\n");
+		QEDF_ERR(NULL, "tgt not offloaded\n");
 		rc = 1;
 		goto abts_err;
 	}
 
+	rdata = fcport->rdata;
+	r_a_tov = rdata->r_a_tov;
+	qedf = fcport->qedf;
+	lport = qedf->lport;
+
 	if (lport->state != LPORT_ST_READY || !(lport->link_up)) {
 		QEDF_ERR(&(qedf->dbg_ctx), "link is not ready\n");
 		rc = 1;
@@ -1729,6 +1732,13 @@ int qedf_initiate_cleanup(struct qedf_ioreq *io_req,
 		return SUCCESS;
 	}
 
+	/* Sanity check qedf_rport before dereferencing any pointers */
+	if (!test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags)) {
+		QEDF_ERR(NULL, "tgt not offloaded\n");
+		rc = 1;
+		return SUCCESS;
+	}
+
 	qedf = fcport->qedf;
 	if (!qedf) {
 		QEDF_ERR(NULL, "qedf is NULL.\n");
-- 
1.8.5.6

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

* [PATCH 06/15] qedf: Add fka_period SCSI host attribute to show fip keep alive period.
  2017-05-23 13:19 [PATCH 00/15] qedf: Update driver to version 8.18.22.0 Dupuis, Chad
                   ` (4 preceding siblings ...)
  2017-05-23 13:19 ` [PATCH 05/15] qedf: Check that fcport is offloaded before dereferencing pointers in initiate_abts|cleanup Dupuis, Chad
@ 2017-05-23 13:19 ` Dupuis, Chad
  2017-05-24 16:34   ` Bart Van Assche
  2017-05-23 13:19 ` [PATCH 07/15] qedf: Set qed logging level to QED_LEVEL_NOTICE Dupuis, Chad
                   ` (10 subsequent siblings)
  16 siblings, 1 reply; 33+ messages in thread
From: Dupuis, Chad @ 2017-05-23 13:19 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

Expose this information for interested applications.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
---
 drivers/scsi/qedf/qedf_attr.c | 60 +++++++++++++++++++++++++++++--------------
 1 file changed, 41 insertions(+), 19 deletions(-)

diff --git a/drivers/scsi/qedf/qedf_attr.c b/drivers/scsi/qedf/qedf_attr.c
index 1349f8a..68e2b77 100644
--- a/drivers/scsi/qedf/qedf_attr.c
+++ b/drivers/scsi/qedf/qedf_attr.c
@@ -8,6 +8,25 @@
  */
 #include "qedf.h"
 
+inline bool qedf_is_vport(struct qedf_ctx *qedf)
+{
+	return (!(qedf->lport->vport == NULL));
+}
+
+/* Get base qedf for physical port from vport */
+static struct qedf_ctx *qedf_get_base_qedf(struct qedf_ctx *qedf)
+{
+	struct fc_lport *lport;
+	struct fc_lport *base_lport;
+
+	if (!(qedf_is_vport(qedf)))
+		return NULL;
+
+	lport = qedf->lport;
+	base_lport = shost_priv(vport_to_shost(lport->vport));
+	return (struct qedf_ctx *)(lport_priv(base_lport));
+}
+
 static ssize_t
 qedf_fcoe_mac_show(struct device *dev,
 	struct device_attribute *attr, char *buf)
@@ -26,34 +45,37 @@
 	return scnprintf(buf, PAGE_SIZE, "%pM\n", fcoe_mac);
 }
 
+static ssize_t
+qedf_fka_period_show(struct device *dev,
+	struct device_attribute *attr, char *buf)
+{
+	struct fc_lport *lport = shost_priv(class_to_shost(dev));
+	struct qedf_ctx *qedf = lport_priv(lport);
+	int fka_period = -1;
+
+	if (qedf_is_vport(qedf))
+		qedf = qedf_get_base_qedf(qedf);
+
+	if (!qedf->ctlr.sel_fcf)
+		goto out;
+
+	fka_period = qedf->ctlr.sel_fcf->fka_period;
+
+out:
+	return scnprintf(buf, PAGE_SIZE, "%d\n", fka_period);
+}
+
 static DEVICE_ATTR(fcoe_mac, S_IRUGO, qedf_fcoe_mac_show, NULL);
+static DEVICE_ATTR(fka_period, S_IRUGO, qedf_fka_period_show, NULL);
 
 struct device_attribute *qedf_host_attrs[] = {
 	&dev_attr_fcoe_mac,
+	&dev_attr_fka_period,
 	NULL,
 };
 
 extern const struct qed_fcoe_ops *qed_ops;
 
-inline bool qedf_is_vport(struct qedf_ctx *qedf)
-{
-	return (!(qedf->lport->vport == NULL));
-}
-
-/* Get base qedf for physical port from vport */
-static struct qedf_ctx *qedf_get_base_qedf(struct qedf_ctx *qedf)
-{
-	struct fc_lport *lport;
-	struct fc_lport *base_lport;
-
-	if (!(qedf_is_vport(qedf)))
-		return NULL;
-
-	lport = qedf->lport;
-	base_lport = shost_priv(vport_to_shost(lport->vport));
-	return (struct qedf_ctx *)(lport_priv(base_lport));
-}
-
 void qedf_capture_grc_dump(struct qedf_ctx *qedf)
 {
 	struct qedf_ctx *base_qedf;
-- 
1.8.5.6

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

* [PATCH 07/15] qedf: Set qed logging level to QED_LEVEL_NOTICE.
  2017-05-23 13:19 [PATCH 00/15] qedf: Update driver to version 8.18.22.0 Dupuis, Chad
                   ` (5 preceding siblings ...)
  2017-05-23 13:19 ` [PATCH 06/15] qedf: Add fka_period SCSI host attribute to show fip keep alive period Dupuis, Chad
@ 2017-05-23 13:19 ` Dupuis, Chad
  2017-05-24 16:35   ` Bart Van Assche
  2017-05-23 13:19 ` [PATCH 08/15] qedf: Use same logic for SCSI host reset and FC lip_reset Dupuis, Chad
                   ` (9 subsequent siblings)
  16 siblings, 1 reply; 33+ messages in thread
From: Dupuis, Chad @ 2017-05-23 13:19 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

Reduce the logging level we set for qed messages pertaining to this PCI
function so that unnecessary messages are not printed in the kernel
message log.

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
---
 drivers/scsi/qedf/qedf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index f703801..d6049cd 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -95,7 +95,7 @@
 MODULE_PARM_DESC(dp_module, " bit flags control for verbose printk passed "
 	"qed module during probe.");
 
-static uint qedf_dp_level;
+static uint qedf_dp_level = QED_LEVEL_NOTICE;
 module_param_named(dp_level, qedf_dp_level, uint, S_IRUGO);
 MODULE_PARM_DESC(dp_level, " printk verbosity control passed to qed module  "
 	"during probe (0-3: 0 more verbose).");
-- 
1.8.5.6

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

* [PATCH 08/15] qedf: Use same logic for SCSI host reset and FC lip_reset.
  2017-05-23 13:19 [PATCH 00/15] qedf: Update driver to version 8.18.22.0 Dupuis, Chad
                   ` (6 preceding siblings ...)
  2017-05-23 13:19 ` [PATCH 07/15] qedf: Set qed logging level to QED_LEVEL_NOTICE Dupuis, Chad
@ 2017-05-23 13:19 ` Dupuis, Chad
  2017-05-24 16:36   ` Bart Van Assche
  2017-05-23 13:19 ` [PATCH 09/15] qedf: Add bus_reset No-op Dupuis, Chad
                   ` (8 subsequent siblings)
  16 siblings, 1 reply; 33+ messages in thread
From: Dupuis, Chad @ 2017-05-23 13:19 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

We should be using the same logic to do a soft reset of the FCoE function
whether it is initiated via sg_reset or the fc_host issue_lip attribute.
Refactor the host reset and fcoe reset handlers to use the preferred logic
which is currently contained in qedf_eh_host_reset().

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
---
 drivers/scsi/qedf/qedf_main.c | 39 +++++++++++++++++++++++----------------
 1 file changed, 23 insertions(+), 16 deletions(-)

diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index d6049cd..fa5a2f8 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -640,27 +640,17 @@ void qedf_wait_for_upload(struct qedf_ctx *qedf)
 	}
 }
 
-/* Reset the host by gracefully logging out and then logging back in */
-static int qedf_eh_host_reset(struct scsi_cmnd *sc_cmd)
+/* Performs soft reset of qedf_ctx by simulating a link down/up */
+static void qedf_ctx_soft_reset(struct fc_lport *lport)
 {
-	struct fc_lport *lport;
 	struct qedf_ctx *qedf;
 
-	lport = shost_priv(sc_cmd->device->host);
-
 	if (lport->vport) {
 		QEDF_ERR(NULL, "Cannot issue host reset on NPIV port.\n");
-		return SUCCESS;
+		return;
 	}
 
-	qedf = (struct qedf_ctx *)lport_priv(lport);
-
-	if (atomic_read(&qedf->link_state) == QEDF_LINK_DOWN ||
-	    test_bit(QEDF_UNLOADING, &qedf->flags) ||
-	    test_bit(QEDF_DBG_STOP_IO, &qedf->flags))
-		return FAILED;
-
-	QEDF_ERR(&(qedf->dbg_ctx), "HOST RESET Issued...");
+	qedf = lport_priv(lport);
 
 	/* For host reset, essentially do a soft link up/down */
 	atomic_set(&qedf->link_state, QEDF_LINK_DOWN);
@@ -672,6 +662,24 @@ static int qedf_eh_host_reset(struct scsi_cmnd *sc_cmd)
 	qedf->vlan_id  = 0;
 	queue_delayed_work(qedf->link_update_wq, &qedf->link_update,
 	    0);
+}
+
+/* Reset the host by gracefully logging out and then logging back in */
+static int qedf_eh_host_reset(struct scsi_cmnd *sc_cmd)
+{
+	struct fc_lport *lport;
+	struct qedf_ctx *qedf;
+
+	lport = shost_priv(sc_cmd->device->host);
+	qedf = lport_priv(lport);
+
+	if (atomic_read(&qedf->link_state) == QEDF_LINK_DOWN ||
+	    test_bit(QEDF_UNLOADING, &qedf->flags))
+		return FAILED;
+
+	QEDF_ERR(&(qedf->dbg_ctx), "HOST RESET Issued...");
+
+	qedf_ctx_soft_reset(lport);
 
 	return SUCCESS;
 }
@@ -1670,8 +1678,7 @@ static int qedf_fcoe_reset(struct Scsi_Host *shost)
 {
 	struct fc_lport *lport = shost_priv(shost);
 
-	fc_fabric_logoff(lport);
-	fc_fabric_login(lport);
+	qedf_ctx_soft_reset(lport);
 	return 0;
 }
 
-- 
1.8.5.6

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

* [PATCH 09/15] qedf: Add bus_reset No-op.
  2017-05-23 13:19 [PATCH 00/15] qedf: Update driver to version 8.18.22.0 Dupuis, Chad
                   ` (7 preceding siblings ...)
  2017-05-23 13:19 ` [PATCH 08/15] qedf: Use same logic for SCSI host reset and FC lip_reset Dupuis, Chad
@ 2017-05-23 13:19 ` Dupuis, Chad
  2017-05-24 16:37   ` Bart Van Assche
  2017-05-23 13:19 ` [PATCH 10/15] qedf: Add non-offload receive filters Dupuis, Chad
                   ` (7 subsequent siblings)
  16 siblings, 1 reply; 33+ messages in thread
From: Dupuis, Chad @ 2017-05-23 13:19 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

We need to add a bus reset no-op as without it some of the LUNs attached to a
vport may go offline when the error handler escalates to host reset due to not
having a bus reset handler in the driver. What happens is we escalate to host
reset which does a soft link down/link up to reset the adapter. However with
multiple vports attached it's been observed that if the vports do log back into
the target within 5 seconds, the SCSI layer offlines the devices most likely
due to a TUR timing out to verify that the device is online. Adding a bus
reset handler will cause the TUR to be sent after the bus reset handler where
the devices will still be online if the bus reset is initiated by sg_reset
(which is the case in the test that was failing). The bus reset will succeed
and not needlessly bring the device offline/online.

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
---
 drivers/scsi/qedf/qedf_main.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index fa5a2f8..7dae915 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -628,6 +628,16 @@ static int qedf_eh_device_reset(struct scsi_cmnd *sc_cmd)
 	return qedf_initiate_tmf(sc_cmd, FCP_TMF_LUN_RESET);
 }
 
+static int qedf_eh_bus_reset(struct scsi_cmnd *sc_cmd)
+{
+	QEDF_ERR(NULL, "BUS RESET Issued...\n");
+	/*
+	 * Essentially a no-op but return SUCCESS to prevent
+	 * unnecessary escalation to the host reset handler.
+	 */
+	return SUCCESS;
+}
+
 void qedf_wait_for_upload(struct qedf_ctx *qedf)
 {
 	while (1) {
@@ -705,6 +715,7 @@ static int qedf_slave_configure(struct scsi_device *sdev)
 	.eh_abort_handler	= qedf_eh_abort,
 	.eh_device_reset_handler = qedf_eh_device_reset, /* lun reset */
 	.eh_target_reset_handler = qedf_eh_target_reset, /* target reset */
+	.eh_bus_reset_handler = qedf_eh_bus_reset,
 	.eh_host_reset_handler  = qedf_eh_host_reset,
 	.slave_configure	= qedf_slave_configure,
 	.dma_boundary = QED_HW_DMA_BOUNDARY,
-- 
1.8.5.6

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

* [PATCH 10/15] qedf: Add non-offload receive filters.
  2017-05-23 13:19 [PATCH 00/15] qedf: Update driver to version 8.18.22.0 Dupuis, Chad
                   ` (8 preceding siblings ...)
  2017-05-23 13:19 ` [PATCH 09/15] qedf: Add bus_reset No-op Dupuis, Chad
@ 2017-05-23 13:19 ` Dupuis, Chad
  2017-05-24 16:39   ` Bart Van Assche
  2017-05-23 13:19 ` [PATCH 11/15] qedf: Fixup unnecessary paratheses around test_bit operations Dupuis, Chad
                   ` (6 subsequent siblings)
  16 siblings, 1 reply; 33+ messages in thread
From: Dupuis, Chad @ 2017-05-23 13:19 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

Drop invalid or unexpected FCoE frames that come into the non-offload path
since the FCoE firmware would not do the filtering for us.

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
---
 drivers/scsi/qedf/qedf_main.c | 46 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index 7dae915..7d1a953 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -2088,6 +2088,8 @@ static void qedf_recv_frame(struct qedf_ctx *qedf,
 	u8 *dest_mac = NULL;
 	struct fcoe_hdr *hp;
 	struct qedf_rport *fcport;
+	struct fc_lport *vn_port;
+	u32 f_ctl;
 
 	lport = qedf->lport;
 	if (lport == NULL || lport->state == LPORT_ST_DISABLED) {
@@ -2124,6 +2126,10 @@ static void qedf_recv_frame(struct qedf_ctx *qedf,
 
 	fh = fc_frame_header_get(fp);
 
+	/*
+	 * Invalid frame filters.
+	 */
+
 	if (fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA &&
 	    fh->fh_type == FC_TYPE_FCP) {
 		/* Drop FCP data. We dont this in L2 path */
@@ -2149,6 +2155,46 @@ static void qedf_recv_frame(struct qedf_ctx *qedf,
 		return;
 	}
 
+	if (ntoh24(&dest_mac[3]) != ntoh24(fh->fh_d_id)) {
+		QEDF_ERR(&(qedf->dbg_ctx), "FC frame d_id mismatch with MAC "
+		    "%pM.\n", dest_mac);
+		return;
+	}
+
+	if (qedf->ctlr.state) {
+		if (!ether_addr_equal(mac, qedf->ctlr.dest_addr)) {
+			QEDF_ERR(&(qedf->dbg_ctx), "Wrong source address: "
+			    "mac:%pM dest_addr:%pM.\n", mac,
+			    qedf->ctlr.dest_addr);
+			kfree_skb(skb);
+			return;
+		}
+	}
+
+	vn_port = fc_vport_id_lookup(lport, ntoh24(fh->fh_d_id));
+
+	/*
+	 * If the destination ID from the frame header does not match what we
+	 * have on record for lport and the search for a NPIV port came up
+	 * empty then this is not addressed to our port so simply drop it.
+	 */
+	if (lport->port_id != ntoh24(fh->fh_d_id) && !vn_port) {
+		QEDF_ERR(&(qedf->dbg_ctx), "Dropping frame due to "
+		    "destination mismatch: lport->port_id=%x "
+		    "fh->d_id=%x.\n",
+		    lport->port_id, ntoh24(fh->fh_d_id));
+		kfree_skb(skb);
+		return;
+	}
+
+	f_ctl = ntoh24(fh->fh_f_ctl);
+	if ((fh->fh_type == FC_TYPE_BLS) && (f_ctl & FC_FC_SEQ_CTX) &&
+	    (f_ctl & FC_FC_EX_CTX)) {
+		/* Drop incoming ABTS response that has both SEQ/EX CTX set */
+		kfree_skb(skb);
+		return;
+	}
+
 	/*
 	 * If a connection is uploading, drop incoming FCoE frames as there
 	 * is a small window where we could try to return a frame while libfc
-- 
1.8.5.6

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

* [PATCH 11/15] qedf: Fixup unnecessary paratheses around test_bit operations.
  2017-05-23 13:19 [PATCH 00/15] qedf: Update driver to version 8.18.22.0 Dupuis, Chad
                   ` (9 preceding siblings ...)
  2017-05-23 13:19 ` [PATCH 10/15] qedf: Add non-offload receive filters Dupuis, Chad
@ 2017-05-23 13:19 ` Dupuis, Chad
  2017-05-24 16:41   ` Bart Van Assche
  2017-05-23 13:19 ` [PATCH 12/15] qedf: Move some prints to a debug level so they do not print when no debugging is enabled Dupuis, Chad
                   ` (5 subsequent siblings)
  16 siblings, 1 reply; 33+ messages in thread
From: Dupuis, Chad @ 2017-05-23 13:19 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
---
 drivers/scsi/qedf/qedf_els.c | 6 +++---
 drivers/scsi/qedf/qedf_io.c  | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/qedf/qedf_els.c b/drivers/scsi/qedf/qedf_els.c
index e197fd6..78d9f1c 100644
--- a/drivers/scsi/qedf/qedf_els.c
+++ b/drivers/scsi/qedf/qedf_els.c
@@ -44,7 +44,7 @@ static int qedf_initiate_els(struct qedf_rport *fcport, unsigned int op,
 		goto els_err;
 	}
 
-	if (!(test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags))) {
+	if (!test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags)) {
 		QEDF_ERR(&(qedf->dbg_ctx), "els 0x%x: fcport not ready\n", op);
 		rc = -EINVAL;
 		goto els_err;
@@ -225,7 +225,7 @@ int qedf_send_rrq(struct qedf_ioreq *aborted_io_req)
 	fcport = aborted_io_req->fcport;
 
 	/* Check that fcport is still offloaded */
-	if (!(test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags))) {
+	if (!test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags)) {
 		QEDF_ERR(NULL, "fcport is no longer offloaded.\n");
 		return -EINVAL;
 	}
@@ -550,7 +550,7 @@ static int qedf_send_srr(struct qedf_ioreq *orig_io_req, u32 offset, u8 r_ctl)
 	fcport = orig_io_req->fcport;
 
 	/* Check that fcport is still offloaded */
-	if (!(test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags))) {
+	if (!test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags)) {
 		QEDF_ERR(NULL, "fcport is no longer offloaded.\n");
 		return -EINVAL;
 	}
diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c
index db16004..ea37c78 100644
--- a/drivers/scsi/qedf/qedf_io.c
+++ b/drivers/scsi/qedf/qedf_io.c
@@ -1847,7 +1847,7 @@ static int qedf_execute_tmf(struct qedf_rport *fcport, struct scsi_cmnd *sc_cmd,
 		return FAILED;
 	}
 
-	if (!(test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags))) {
+	if (!test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags)) {
 		QEDF_ERR(&(qedf->dbg_ctx), "fcport not offloaded\n");
 		rc = FAILED;
 		return FAILED;
-- 
1.8.5.6

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

* [PATCH 12/15] qedf: Move some prints to a debug level so they do not print when no debugging is enabled.
  2017-05-23 13:19 [PATCH 00/15] qedf: Update driver to version 8.18.22.0 Dupuis, Chad
                   ` (10 preceding siblings ...)
  2017-05-23 13:19 ` [PATCH 11/15] qedf: Fixup unnecessary paratheses around test_bit operations Dupuis, Chad
@ 2017-05-23 13:19 ` Dupuis, Chad
  2017-05-24 16:43   ` Bart Van Assche
  2017-05-23 13:19 ` [PATCH 13/15] qedf: Change cmd_per_lun in scsi_host_template to 32 to increase performance Dupuis, Chad
                   ` (4 subsequent siblings)
  16 siblings, 1 reply; 33+ messages in thread
From: Dupuis, Chad @ 2017-05-23 13:19 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
---
 drivers/scsi/qedf/qedf_main.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index 7d1a953..340cf74 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -442,7 +442,8 @@ static void qedf_link_update(void *dev, struct qed_link_output *link)
 		qedf_update_link_speed(qedf, link);
 
 		if (atomic_read(&qedf->dcbx) == QEDF_DCBX_DONE) {
-			QEDF_ERR(&(qedf->dbg_ctx), "DCBx done.\n");
+			QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC,
+			     "DCBx done.\n");
 			if (atomic_read(&qedf->link_down_tmo_valid) > 0)
 				queue_delayed_work(qedf->link_update_wq,
 				    &qedf->link_recovery, 0);
@@ -2156,16 +2157,16 @@ static void qedf_recv_frame(struct qedf_ctx *qedf,
 	}
 
 	if (ntoh24(&dest_mac[3]) != ntoh24(fh->fh_d_id)) {
-		QEDF_ERR(&(qedf->dbg_ctx), "FC frame d_id mismatch with MAC "
-		    "%pM.\n", dest_mac);
+		QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_LL2,
+		    "FC frame d_id mismatch with MAC %pM.\n", dest_mac);
 		return;
 	}
 
 	if (qedf->ctlr.state) {
 		if (!ether_addr_equal(mac, qedf->ctlr.dest_addr)) {
-			QEDF_ERR(&(qedf->dbg_ctx), "Wrong source address: "
-			    "mac:%pM dest_addr:%pM.\n", mac,
-			    qedf->ctlr.dest_addr);
+			QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_LL2,
+			    "Wrong source address: mac:%pM dest_addr:%pM.\n",
+			    mac, qedf->ctlr.dest_addr);
 			kfree_skb(skb);
 			return;
 		}
@@ -2179,9 +2180,9 @@ static void qedf_recv_frame(struct qedf_ctx *qedf,
 	 * empty then this is not addressed to our port so simply drop it.
 	 */
 	if (lport->port_id != ntoh24(fh->fh_d_id) && !vn_port) {
-		QEDF_ERR(&(qedf->dbg_ctx), "Dropping frame due to "
-		    "destination mismatch: lport->port_id=%x "
-		    "fh->d_id=%x.\n",
+		QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_LL2,
+		    "Dropping frame due to destination mismatch: "
+		    "lport->port_id=%x fh->d_id=%x.\n",
 		    lport->port_id, ntoh24(fh->fh_d_id));
 		kfree_skb(skb);
 		return;
-- 
1.8.5.6

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

* [PATCH 13/15] qedf: Change cmd_per_lun in scsi_host_template to 32 to increase performance.
  2017-05-23 13:19 [PATCH 00/15] qedf: Update driver to version 8.18.22.0 Dupuis, Chad
                   ` (11 preceding siblings ...)
  2017-05-23 13:19 ` [PATCH 12/15] qedf: Move some prints to a debug level so they do not print when no debugging is enabled Dupuis, Chad
@ 2017-05-23 13:19 ` Dupuis, Chad
  2017-05-24 16:43   ` Bart Van Assche
  2017-05-23 13:19 ` [PATCH 14/15] qedf: Add change_queue_depth member to scsi_host_template() Dupuis, Chad
                   ` (3 subsequent siblings)
  16 siblings, 1 reply; 33+ messages in thread
From: Dupuis, Chad @ 2017-05-23 13:19 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

Increase the default number of commands that the driver tells the
SCSI mid-layer it can do to increase the default performance of the
driver.

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
---
 drivers/scsi/qedf/qedf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index 340cf74..bc85c56 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -708,7 +708,7 @@ static int qedf_slave_configure(struct scsi_device *sdev)
 	.module 	= THIS_MODULE,
 	.name 		= QEDF_MODULE_NAME,
 	.this_id 	= -1,
-	.cmd_per_lun 	= 3,
+	.cmd_per_lun	= 32,
 	.use_clustering = ENABLE_CLUSTERING,
 	.max_sectors 	= 0xffff,
 	.queuecommand 	= qedf_queuecommand,
-- 
1.8.5.6

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

* [PATCH 14/15] qedf: Add change_queue_depth member to scsi_host_template().
  2017-05-23 13:19 [PATCH 00/15] qedf: Update driver to version 8.18.22.0 Dupuis, Chad
                   ` (12 preceding siblings ...)
  2017-05-23 13:19 ` [PATCH 13/15] qedf: Change cmd_per_lun in scsi_host_template to 32 to increase performance Dupuis, Chad
@ 2017-05-23 13:19 ` Dupuis, Chad
  2017-05-24 16:44   ` Bart Van Assche
  2017-05-23 13:19 ` [PATCH 15/15] qedf: Update version number to 8.18.22.0 Dupuis, Chad
                   ` (2 subsequent siblings)
  16 siblings, 1 reply; 33+ messages in thread
From: Dupuis, Chad @ 2017-05-23 13:19 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

Add the change_queue_depth member to our SCSI host template so the queue
depth of devices attached to qedf can be changed dynamically.

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
---
 drivers/scsi/qedf/qedf_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index bc85c56..5610803 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -722,6 +722,7 @@ static int qedf_slave_configure(struct scsi_device *sdev)
 	.dma_boundary = QED_HW_DMA_BOUNDARY,
 	.sg_tablesize = QEDF_MAX_BDS_PER_CMD,
 	.can_queue = FCOE_PARAMS_NUM_TASKS,
+	.change_queue_depth = scsi_change_queue_depth,
 };
 
 static int qedf_get_paged_crc_eof(struct sk_buff *skb, int tlen)
-- 
1.8.5.6

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

* [PATCH 15/15] qedf: Update version number to 8.18.22.0.
  2017-05-23 13:19 [PATCH 00/15] qedf: Update driver to version 8.18.22.0 Dupuis, Chad
                   ` (13 preceding siblings ...)
  2017-05-23 13:19 ` [PATCH 14/15] qedf: Add change_queue_depth member to scsi_host_template() Dupuis, Chad
@ 2017-05-23 13:19 ` Dupuis, Chad
  2017-05-24 16:51   ` Bart Van Assche
  2017-05-24  2:35 ` [PATCH 00/15] qedf: Update driver to version 8.18.22.0 Martin K. Petersen
  2017-05-24 19:12 ` Martin K. Petersen
  16 siblings, 1 reply; 33+ messages in thread
From: Dupuis, Chad @ 2017-05-23 13:19 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
---
 drivers/scsi/qedf/qedf_version.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/qedf/qedf_version.h b/drivers/scsi/qedf/qedf_version.h
index d46c487..6fa4420 100644
--- a/drivers/scsi/qedf/qedf_version.h
+++ b/drivers/scsi/qedf/qedf_version.h
@@ -7,9 +7,9 @@
  *  this source tree.
  */
 
-#define QEDF_VERSION		"8.10.7.0"
+#define QEDF_VERSION		"8.18.22.0"
 #define QEDF_DRIVER_MAJOR_VER		8
-#define QEDF_DRIVER_MINOR_VER		10
-#define QEDF_DRIVER_REV_VER		7
+#define QEDF_DRIVER_MINOR_VER		18
+#define QEDF_DRIVER_REV_VER		22
 #define QEDF_DRIVER_ENG_VER		0
 
-- 
1.8.5.6

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

* Re: [PATCH 00/15] qedf: Update driver to version 8.18.22.0.
  2017-05-23 13:19 [PATCH 00/15] qedf: Update driver to version 8.18.22.0 Dupuis, Chad
                   ` (14 preceding siblings ...)
  2017-05-23 13:19 ` [PATCH 15/15] qedf: Update version number to 8.18.22.0 Dupuis, Chad
@ 2017-05-24  2:35 ` Martin K. Petersen
  2017-05-24 19:12 ` Martin K. Petersen
  16 siblings, 0 replies; 33+ messages in thread
From: Martin K. Petersen @ 2017-05-24  2:35 UTC (permalink / raw)
  To: Dupuis, Chad
  Cc: martin.petersen, linux-scsi, james.bottomley, QLogic-Storage-Upstream


Chad,

> Please apply the following patches to the scsi tree at your earliest
> convenience.

Reviewers wanted!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH 01/15] qedf: Enable basic FDMI information.
  2017-05-23 13:19 ` [PATCH 01/15] qedf: Enable basic FDMI information Dupuis, Chad
@ 2017-05-24 16:16   ` Bart Van Assche
  0 siblings, 0 replies; 33+ messages in thread
From: Bart Van Assche @ 2017-05-24 16:16 UTC (permalink / raw)
  To: chad.dupuis, martin.petersen
  Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

On Tue, 2017-05-23 at 06:19 -0700, Dupuis, Chad wrote:
> +		snprintf(fc_host_serial_number(lport->host),
> +		    FC_SERIAL_NUMBER_SIZE,
> +		    "%02X%02X%02X%02X%02X%02X%02X%02X",
> +		    buf[7], buf[6], buf[5], buf[4],
> +		    buf[3], buf[2], buf[1], buf[0]);
> +	} else
> +		snprintf(fc_host_serial_number(lport->host),
> +		    FC_SERIAL_NUMBER_SIZE, "Unknown");
> +
> +	snprintf(fc_host_manufacturer(lport->host),
> +	    FC_SERIAL_NUMBER_SIZE, "%s", "Cavium Inc.");

Hello Chad,

I think this code would be a lot easier to read and to verify if it would be
modified as follows:
* Instead of using the fc_host_<field>() macros, assign shost_to_fc_host(lport->host)
  to a variable and change fc_host_<field>() into ...-><field>.
* Instead of using the FC_*_SIZE macros, use sizeof(...-><field>).

Thanks,

Bart.

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

* Re: [PATCH 03/15] qedf: Honor qed_ops->common->set_fp_int() return code.
  2017-05-23 13:19 ` [PATCH 03/15] qedf: Honor qed_ops->common->set_fp_int() return code Dupuis, Chad
@ 2017-05-24 16:22   ` Bart Van Assche
  0 siblings, 0 replies; 33+ messages in thread
From: Bart Van Assche @ 2017-05-24 16:22 UTC (permalink / raw)
  To: chad.dupuis, martin.petersen
  Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

On Tue, 2017-05-23 at 06:19 -0700, Dupuis, Chad wrote:
> We need to check the return code the set_fp_int() callback in case we were
> not allocated any fastpath interrupts or there was an error setting up the
> fastpath interrupts from the qed perspective.

Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com>

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

* Re: [PATCH 04/15] qedf: Look at all descriptors when processing a clear virtual link.
  2017-05-23 13:19 ` [PATCH 04/15] qedf: Look at all descriptors when processing a clear virtual link Dupuis, Chad
@ 2017-05-24 16:24   ` Bart Van Assche
  0 siblings, 0 replies; 33+ messages in thread
From: Bart Van Assche @ 2017-05-24 16:24 UTC (permalink / raw)
  To: chad.dupuis, martin.petersen
  Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

On Tue, 2017-05-23 at 06:19 -0700, Dupuis, Chad wrote:
> If there are multiple descriptors for a particular type in a clear virtual
> link we receive, we will not process it correctly but rather take the last
> value. This can cause us not to not flap the virtual link as the value from
> the descriptors that we compare against the our stored FCF or fc_lport values
> may not match.
> 
> Change is to do a comparison when processing the each descriptor instead of at
> the end and then set a bool if we need to do the reset.

Did you perhaps mean "Change this" instead of "Change is"? Anyway:

Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com>

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

* Re: [PATCH 05/15] qedf: Check that fcport is offloaded before dereferencing pointers in initiate_abts|cleanup.
  2017-05-23 13:19 ` [PATCH 05/15] qedf: Check that fcport is offloaded before dereferencing pointers in initiate_abts|cleanup Dupuis, Chad
@ 2017-05-24 16:25   ` Bart Van Assche
  0 siblings, 0 replies; 33+ messages in thread
From: Bart Van Assche @ 2017-05-24 16:25 UTC (permalink / raw)
  To: chad.dupuis, martin.petersen
  Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

On Tue, 2017-05-23 at 06:19 -0700, Dupuis, Chad wrote:
> If an fcport is not offloaded then the members of the qedf_rport struct
> are undefined which may cause a system crash.

Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com>

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

* Re: [PATCH 06/15] qedf: Add fka_period SCSI host attribute to show fip keep alive period.
  2017-05-23 13:19 ` [PATCH 06/15] qedf: Add fka_period SCSI host attribute to show fip keep alive period Dupuis, Chad
@ 2017-05-24 16:34   ` Bart Van Assche
  0 siblings, 0 replies; 33+ messages in thread
From: Bart Van Assche @ 2017-05-24 16:34 UTC (permalink / raw)
  To: chad.dupuis, martin.petersen
  Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

On Tue, 2017-05-23 at 06:19 -0700, Dupuis, Chad wrote:
> Expose this information for interested applications.
> 
> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
> ---
>  drivers/scsi/qedf/qedf_attr.c | 60 +++++++++++++++++++++++++++++--------------
>  1 file changed, 41 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/scsi/qedf/qedf_attr.c b/drivers/scsi/qedf/qedf_attr.c
> index 1349f8a..68e2b77 100644
> --- a/drivers/scsi/qedf/qedf_attr.c
> +++ b/drivers/scsi/qedf/qedf_attr.c
> @@ -8,6 +8,25 @@
>   */
>  #include "qedf.h"
>  
> +inline bool qedf_is_vport(struct qedf_ctx *qedf)
> +{
> +	return (!(qedf->lport->vport == NULL));
> +}

Have you considered to write the return statement as follows?

	return qedf->lport->vport != NULL;

Checkpatch should have recommended not to use parentheses in the return
statement.

> +
> +/* Get base qedf for physical port from vport */
> +static struct qedf_ctx *qedf_get_base_qedf(struct qedf_ctx *qedf)
> +{
> +	struct fc_lport *lport;
> +	struct fc_lport *base_lport;
> +
> +	if (!(qedf_is_vport(qedf)))
> +		return NULL;
> +
> +	lport = qedf->lport;
> +	base_lport = shost_priv(vport_to_shost(lport->vport));
> +	return (struct qedf_ctx *)(lport_priv(base_lport));
> +}

lport_priv() returns a void pointer so the cast in the return statement is not
necessary.

> +static ssize_t
> +qedf_fka_period_show(struct device *dev,
> +	struct device_attribute *attr, char *buf)
> +{
> +	struct fc_lport *lport = shost_priv(class_to_shost(dev));
> +	struct qedf_ctx *qedf = lport_priv(lport);
> +	int fka_period = -1;
> +
> +	if (qedf_is_vport(qedf))
> +		qedf = qedf_get_base_qedf(qedf);
> +
> +	if (!qedf->ctlr.sel_fcf)
> +		goto out;
> +
> +	fka_period = qedf->ctlr.sel_fcf->fka_period;
> +
> +out:
> +	return scnprintf(buf, PAGE_SIZE, "%d\n", fka_period);
> +}

Do we really need a goto statement to skip a single statement? How about the
following:

	if (qedf->ctlr.sel_fcf)
		fka_period = qedf->ctlr.sel_fcf->fka_period;

	return scnprintf(buf, PAGE_SIZE, "%d\n", fka_period);

or this:

	return scnprintf(buf, PAGE_SIZE, "%d\n", qedf->ctlr.sel_fcf ?
                         qedf->ctlr.sel_fcf->fka_period : -1);

Bart.

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

* Re: [PATCH 07/15] qedf: Set qed logging level to QED_LEVEL_NOTICE.
  2017-05-23 13:19 ` [PATCH 07/15] qedf: Set qed logging level to QED_LEVEL_NOTICE Dupuis, Chad
@ 2017-05-24 16:35   ` Bart Van Assche
  0 siblings, 0 replies; 33+ messages in thread
From: Bart Van Assche @ 2017-05-24 16:35 UTC (permalink / raw)
  To: chad.dupuis, martin.petersen
  Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

On Tue, 2017-05-23 at 06:19 -0700, Dupuis, Chad wrote:
> Reduce the logging level we set for qed messages pertaining to this PCI
> function so that unnecessary messages are not printed in the kernel
> message log.

Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com>

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

* Re: [PATCH 08/15] qedf: Use same logic for SCSI host reset and FC lip_reset.
  2017-05-23 13:19 ` [PATCH 08/15] qedf: Use same logic for SCSI host reset and FC lip_reset Dupuis, Chad
@ 2017-05-24 16:36   ` Bart Van Assche
  0 siblings, 0 replies; 33+ messages in thread
From: Bart Van Assche @ 2017-05-24 16:36 UTC (permalink / raw)
  To: chad.dupuis, martin.petersen
  Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

On Tue, 2017-05-23 at 06:19 -0700, Dupuis, Chad wrote:
> We should be using the same logic to do a soft reset of the FCoE function
> whether it is initiated via sg_reset or the fc_host issue_lip attribute.
> Refactor the host reset and fcoe reset handlers to use the preferred logic
> which is currently contained in qedf_eh_host_reset().

Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com>

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

* Re: [PATCH 09/15] qedf: Add bus_reset No-op.
  2017-05-23 13:19 ` [PATCH 09/15] qedf: Add bus_reset No-op Dupuis, Chad
@ 2017-05-24 16:37   ` Bart Van Assche
  0 siblings, 0 replies; 33+ messages in thread
From: Bart Van Assche @ 2017-05-24 16:37 UTC (permalink / raw)
  To: chad.dupuis, martin.petersen
  Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

On Tue, 2017-05-23 at 06:19 -0700, Dupuis, Chad wrote:
> We need to add a bus reset no-op as without it some of the LUNs attached to a
> vport may go offline when the error handler escalates to host reset due to not
> having a bus reset handler in the driver. What happens is we escalate to host
> reset which does a soft link down/link up to reset the adapter. However with
> multiple vports attached it's been observed that if the vports do log back into
> the target within 5 seconds, the SCSI layer offlines the devices most likely
> due to a TUR timing out to verify that the device is online. Adding a bus
> reset handler will cause the TUR to be sent after the bus reset handler where
> the devices will still be online if the bus reset is initiated by sg_reset
> (which is the case in the test that was failing). The bus reset will succeed
> and not needlessly bring the device offline/online.

Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com>

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

* Re: [PATCH 10/15] qedf: Add non-offload receive filters.
  2017-05-23 13:19 ` [PATCH 10/15] qedf: Add non-offload receive filters Dupuis, Chad
@ 2017-05-24 16:39   ` Bart Van Assche
  0 siblings, 0 replies; 33+ messages in thread
From: Bart Van Assche @ 2017-05-24 16:39 UTC (permalink / raw)
  To: chad.dupuis, martin.petersen
  Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

On Tue, 2017-05-23 at 06:19 -0700, Dupuis, Chad wrote:
> +	if (ntoh24(&dest_mac[3]) != ntoh24(fh->fh_d_id)) {
> +		QEDF_ERR(&(qedf->dbg_ctx), "FC frame d_id mismatch with MAC "
> +		    "%pM.\n", dest_mac);
> [ ... ]
> +			QEDF_ERR(&(qedf->dbg_ctx), "Wrong source address: "
> +			    "mac:%pM dest_addr:%pM.\n", mac,
> +			    qedf->ctlr.dest_addr);

Hello Chad,

Are you aware that the 80 column limit does not hold for error messages
and that the recommended style is to keep these on a single line?

Bart.

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

* Re: [PATCH 11/15] qedf: Fixup unnecessary paratheses around test_bit operations.
  2017-05-23 13:19 ` [PATCH 11/15] qedf: Fixup unnecessary paratheses around test_bit operations Dupuis, Chad
@ 2017-05-24 16:41   ` Bart Van Assche
  0 siblings, 0 replies; 33+ messages in thread
From: Bart Van Assche @ 2017-05-24 16:41 UTC (permalink / raw)
  To: chad.dupuis, martin.petersen
  Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

On Tue, 2017-05-23 at 06:19 -0700, Dupuis, Chad wrote:
> Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>

Did you perhaps mean "parentheses" instead of "paratheses"? Please also
keep in mind that the recommended style for patch titles is the imperative
mood without trailing dot.

Anyway:

Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com>

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

* Re: [PATCH 12/15] qedf: Move some prints to a debug level so they do not print when no debugging is enabled.
  2017-05-23 13:19 ` [PATCH 12/15] qedf: Move some prints to a debug level so they do not print when no debugging is enabled Dupuis, Chad
@ 2017-05-24 16:43   ` Bart Van Assche
  0 siblings, 0 replies; 33+ messages in thread
From: Bart Van Assche @ 2017-05-24 16:43 UTC (permalink / raw)
  To: chad.dupuis, martin.petersen
  Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

On Tue, 2017-05-23 at 06:19 -0700, Dupuis, Chad wrote:
>  	if (lport->port_id != ntoh24(fh->fh_d_id) && !vn_port) {
> -		QEDF_ERR(&(qedf->dbg_ctx), "Dropping frame due to "
> -		    "destination mismatch: lport->port_id=%x "
> -		    "fh->d_id=%x.\n",
> +		QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_LL2,
> +		    "Dropping frame due to destination mismatch: "
> +		    "lport->port_id=%x fh->d_id=%x.\n",
>  		    lport->port_id, ntoh24(fh->fh_d_id));
>  		kfree_skb(skb);
>  		return;

Hello Chad,

Please consider to keep the above error message on a single line.

Thanks,

Bart.

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

* Re: [PATCH 13/15] qedf: Change cmd_per_lun in scsi_host_template to 32 to increase performance.
  2017-05-23 13:19 ` [PATCH 13/15] qedf: Change cmd_per_lun in scsi_host_template to 32 to increase performance Dupuis, Chad
@ 2017-05-24 16:43   ` Bart Van Assche
  0 siblings, 0 replies; 33+ messages in thread
From: Bart Van Assche @ 2017-05-24 16:43 UTC (permalink / raw)
  To: chad.dupuis, martin.petersen
  Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

On Tue, 2017-05-23 at 06:19 -0700, Dupuis, Chad wrote:
> Increase the default number of commands that the driver tells the
> SCSI mid-layer it can do to increase the default performance of the
> driver.

Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com>

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

* Re: [PATCH 14/15] qedf: Add change_queue_depth member to scsi_host_template().
  2017-05-23 13:19 ` [PATCH 14/15] qedf: Add change_queue_depth member to scsi_host_template() Dupuis, Chad
@ 2017-05-24 16:44   ` Bart Van Assche
  0 siblings, 0 replies; 33+ messages in thread
From: Bart Van Assche @ 2017-05-24 16:44 UTC (permalink / raw)
  To: chad.dupuis, martin.petersen
  Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

On Tue, 2017-05-23 at 06:19 -0700, Dupuis, Chad wrote:
> Add the change_queue_depth member to our SCSI host template so the queue
> depth of devices attached to qedf can be changed dynamically.

Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com>

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

* Re: [PATCH 15/15] qedf: Update version number to 8.18.22.0.
  2017-05-23 13:19 ` [PATCH 15/15] qedf: Update version number to 8.18.22.0 Dupuis, Chad
@ 2017-05-24 16:51   ` Bart Van Assche
  0 siblings, 0 replies; 33+ messages in thread
From: Bart Van Assche @ 2017-05-24 16:51 UTC (permalink / raw)
  To: chad.dupuis, martin.petersen
  Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream

On Tue, 2017-05-23 at 06:19 -0700, Dupuis, Chad wrote:
> Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
> ---
>  drivers/scsi/qedf/qedf_version.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/qedf/qedf_version.h b/drivers/scsi/qedf/qedf_version.h
> index d46c487..6fa4420 100644
> --- a/drivers/scsi/qedf/qedf_version.h
> +++ b/drivers/scsi/qedf/qedf_version.h
> @@ -7,9 +7,9 @@
>   *  this source tree.
>   */
>  
> -#define QEDF_VERSION		"8.10.7.0"
> +#define QEDF_VERSION		"8.18.22.0"
>  #define QEDF_DRIVER_MAJOR_VER		8
> -#define QEDF_DRIVER_MINOR_VER		10
> -#define QEDF_DRIVER_REV_VER		7
> +#define QEDF_DRIVER_MINOR_VER		18
> +#define QEDF_DRIVER_REV_VER		22
>  #define QEDF_DRIVER_ENG_VER		0
>  

Although I'm not sure having driver version information in an upstream
driver is useful:

Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com>

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

* Re: [PATCH 00/15] qedf: Update driver to version 8.18.22.0.
  2017-05-23 13:19 [PATCH 00/15] qedf: Update driver to version 8.18.22.0 Dupuis, Chad
                   ` (15 preceding siblings ...)
  2017-05-24  2:35 ` [PATCH 00/15] qedf: Update driver to version 8.18.22.0 Martin K. Petersen
@ 2017-05-24 19:12 ` Martin K. Petersen
  2017-05-24 19:14   ` Chad Dupuis
  16 siblings, 1 reply; 33+ messages in thread
From: Martin K. Petersen @ 2017-05-24 19:12 UTC (permalink / raw)
  To: Dupuis, Chad
  Cc: martin.petersen, linux-scsi, james.bottomley, QLogic-Storage-Upstream


Chad,

> Please apply the following patches to the scsi tree at your earliest
> convenience.

Please address Bart's comments and resubmit.

Thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH 00/15] qedf: Update driver to version 8.18.22.0.
  2017-05-24 19:12 ` Martin K. Petersen
@ 2017-05-24 19:14   ` Chad Dupuis
  0 siblings, 0 replies; 33+ messages in thread
From: Chad Dupuis @ 2017-05-24 19:14 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: linux-scsi, james.bottomley, QLogic-Storage-Upstream


On Wed, 24 May 2017, 3:12pm, Martin K. Petersen wrote:

> 
> Chad,
> 
> > Please apply the following patches to the scsi tree at your earliest
> > convenience.
> 
> Please address Bart's comments and resubmit.
> 
> Thanks!
> 
> 

Sure, will submit a V2 that addresses Bart's comments.

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

end of thread, other threads:[~2017-05-24 19:14 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-23 13:19 [PATCH 00/15] qedf: Update driver to version 8.18.22.0 Dupuis, Chad
2017-05-23 13:19 ` [PATCH 01/15] qedf: Enable basic FDMI information Dupuis, Chad
2017-05-24 16:16   ` Bart Van Assche
2017-05-23 13:19 ` [PATCH 02/15] qedf: Update copyright to 2017 Dupuis, Chad
2017-05-23 13:19 ` [PATCH 03/15] qedf: Honor qed_ops->common->set_fp_int() return code Dupuis, Chad
2017-05-24 16:22   ` Bart Van Assche
2017-05-23 13:19 ` [PATCH 04/15] qedf: Look at all descriptors when processing a clear virtual link Dupuis, Chad
2017-05-24 16:24   ` Bart Van Assche
2017-05-23 13:19 ` [PATCH 05/15] qedf: Check that fcport is offloaded before dereferencing pointers in initiate_abts|cleanup Dupuis, Chad
2017-05-24 16:25   ` Bart Van Assche
2017-05-23 13:19 ` [PATCH 06/15] qedf: Add fka_period SCSI host attribute to show fip keep alive period Dupuis, Chad
2017-05-24 16:34   ` Bart Van Assche
2017-05-23 13:19 ` [PATCH 07/15] qedf: Set qed logging level to QED_LEVEL_NOTICE Dupuis, Chad
2017-05-24 16:35   ` Bart Van Assche
2017-05-23 13:19 ` [PATCH 08/15] qedf: Use same logic for SCSI host reset and FC lip_reset Dupuis, Chad
2017-05-24 16:36   ` Bart Van Assche
2017-05-23 13:19 ` [PATCH 09/15] qedf: Add bus_reset No-op Dupuis, Chad
2017-05-24 16:37   ` Bart Van Assche
2017-05-23 13:19 ` [PATCH 10/15] qedf: Add non-offload receive filters Dupuis, Chad
2017-05-24 16:39   ` Bart Van Assche
2017-05-23 13:19 ` [PATCH 11/15] qedf: Fixup unnecessary paratheses around test_bit operations Dupuis, Chad
2017-05-24 16:41   ` Bart Van Assche
2017-05-23 13:19 ` [PATCH 12/15] qedf: Move some prints to a debug level so they do not print when no debugging is enabled Dupuis, Chad
2017-05-24 16:43   ` Bart Van Assche
2017-05-23 13:19 ` [PATCH 13/15] qedf: Change cmd_per_lun in scsi_host_template to 32 to increase performance Dupuis, Chad
2017-05-24 16:43   ` Bart Van Assche
2017-05-23 13:19 ` [PATCH 14/15] qedf: Add change_queue_depth member to scsi_host_template() Dupuis, Chad
2017-05-24 16:44   ` Bart Van Assche
2017-05-23 13:19 ` [PATCH 15/15] qedf: Update version number to 8.18.22.0 Dupuis, Chad
2017-05-24 16:51   ` Bart Van Assche
2017-05-24  2:35 ` [PATCH 00/15] qedf: Update driver to version 8.18.22.0 Martin K. Petersen
2017-05-24 19:12 ` Martin K. Petersen
2017-05-24 19:14   ` Chad Dupuis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.