aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2011-02-16 12:39:57 -0500
committerJames Bottomley <James.Bottomley@suse.de>2011-02-18 16:35:52 -0500
commitab56dc2e1d32556971e0729b3a6c37e0ff3104a6 (patch)
tree181e6ec72607f191b88aa7f0a56a4c00211c9aee /drivers/scsi/lpfc
parent924941444b481fc862b2de5e1dd7692ca85274d7 (diff)
[SCSI] lpfc 8.3.21: Initialization and user interface changes
- Make link speed not supported by port message an error message. - Add support for new SLI failure codes add sysfs parameter to reflect the security setting and current state. - Add all lpfc module parameters to the /sys/modules/lpfc/parameters directory. [jejb: fix up compile failure] Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r--drivers/scsi/lpfc/lpfc.h2
-rw-r--r--drivers/scsi/lpfc/lpfc_attr.c75
-rw-r--r--drivers/scsi/lpfc/lpfc_debugfs.c8
-rw-r--r--drivers/scsi/lpfc/lpfc_hw.h5
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c2
-rw-r--r--drivers/scsi/lpfc/lpfc_mbox.c3
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c14
7 files changed, 72 insertions, 37 deletions
diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h
index e2a763426a7c..f41722e8652a 100644
--- a/drivers/scsi/lpfc/lpfc.h
+++ b/drivers/scsi/lpfc/lpfc.h
@@ -662,7 +662,7 @@ struct lpfc_hba {
662#define LPFC_INITIALIZE_LINK 0 /* do normal init_link mbox */ 662#define LPFC_INITIALIZE_LINK 0 /* do normal init_link mbox */
663#define LPFC_DELAY_INIT_LINK 1 /* layered driver hold off */ 663#define LPFC_DELAY_INIT_LINK 1 /* layered driver hold off */
664#define LPFC_DELAY_INIT_LINK_INDEFINITELY 2 /* wait, manual intervention */ 664#define LPFC_DELAY_INIT_LINK_INDEFINITELY 2 /* wait, manual intervention */
665 665 uint32_t cfg_enable_dss;
666 lpfc_vpd_t vpd; /* vital product data */ 666 lpfc_vpd_t vpd; /* vital product data */
667 667
668 struct pci_dev *pcidev; 668 struct pci_dev *pcidev;
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index a57f6c0cbbba..e7c020df12fa 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -678,6 +678,7 @@ lpfc_do_offline(struct lpfc_hba *phba, uint32_t type)
678 * 678 *
679 * Notes: 679 * Notes:
680 * Assumes any error from lpfc_do_offline() will be negative. 680 * Assumes any error from lpfc_do_offline() will be negative.
681 * Do not make this function static.
681 * 682 *
682 * Returns: 683 * Returns:
683 * lpfc_do_offline() return code if not zero 684 * lpfc_do_offline() return code if not zero
@@ -1293,6 +1294,28 @@ lpfc_fips_rev_show(struct device *dev, struct device_attribute *attr,
1293} 1294}
1294 1295
1295/** 1296/**
1297 * lpfc_dss_show - Return the current state of dss and the configured state
1298 * @dev: class converted to a Scsi_host structure.
1299 * @attr: device attribute, not used.
1300 * @buf: on return contains the formatted text.
1301 *
1302 * Returns: size of formatted string.
1303 **/
1304static ssize_t
1305lpfc_dss_show(struct device *dev, struct device_attribute *attr,
1306 char *buf)
1307{
1308 struct Scsi_Host *shost = class_to_shost(dev);
1309 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
1310 struct lpfc_hba *phba = vport->phba;
1311
1312 return snprintf(buf, PAGE_SIZE, "%s - %sOperational\n",
1313 (phba->cfg_enable_dss) ? "Enabled" : "Disabled",
1314 (phba->sli3_options & LPFC_SLI3_DSS_ENABLED) ?
1315 "" : "Not ");
1316}
1317
1318/**
1296 * lpfc_param_show - Return a cfg attribute value in decimal 1319 * lpfc_param_show - Return a cfg attribute value in decimal
1297 * 1320 *
1298 * Description: 1321 * Description:
@@ -1611,13 +1634,13 @@ lpfc_##attr##_store(struct device *dev, struct device_attribute *attr, \
1611 1634
1612#define LPFC_ATTR(name, defval, minval, maxval, desc) \ 1635#define LPFC_ATTR(name, defval, minval, maxval, desc) \
1613static uint lpfc_##name = defval;\ 1636static uint lpfc_##name = defval;\
1614module_param(lpfc_##name, uint, 0);\ 1637module_param(lpfc_##name, uint, S_IRUGO);\
1615MODULE_PARM_DESC(lpfc_##name, desc);\ 1638MODULE_PARM_DESC(lpfc_##name, desc);\
1616lpfc_param_init(name, defval, minval, maxval) 1639lpfc_param_init(name, defval, minval, maxval)
1617 1640
1618#define LPFC_ATTR_R(name, defval, minval, maxval, desc) \ 1641#define LPFC_ATTR_R(name, defval, minval, maxval, desc) \
1619static uint lpfc_##name = defval;\ 1642static uint lpfc_##name = defval;\
1620module_param(lpfc_##name, uint, 0);\ 1643module_param(lpfc_##name, uint, S_IRUGO);\
1621MODULE_PARM_DESC(lpfc_##name, desc);\ 1644MODULE_PARM_DESC(lpfc_##name, desc);\
1622lpfc_param_show(name)\ 1645lpfc_param_show(name)\
1623lpfc_param_init(name, defval, minval, maxval)\ 1646lpfc_param_init(name, defval, minval, maxval)\
@@ -1625,7 +1648,7 @@ static DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL)
1625 1648
1626#define LPFC_ATTR_RW(name, defval, minval, maxval, desc) \ 1649#define LPFC_ATTR_RW(name, defval, minval, maxval, desc) \
1627static uint lpfc_##name = defval;\ 1650static uint lpfc_##name = defval;\
1628module_param(lpfc_##name, uint, 0);\ 1651module_param(lpfc_##name, uint, S_IRUGO);\
1629MODULE_PARM_DESC(lpfc_##name, desc);\ 1652MODULE_PARM_DESC(lpfc_##name, desc);\
1630lpfc_param_show(name)\ 1653lpfc_param_show(name)\
1631lpfc_param_init(name, defval, minval, maxval)\ 1654lpfc_param_init(name, defval, minval, maxval)\
@@ -1636,7 +1659,7 @@ static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
1636 1659
1637#define LPFC_ATTR_HEX_R(name, defval, minval, maxval, desc) \ 1660#define LPFC_ATTR_HEX_R(name, defval, minval, maxval, desc) \
1638static uint lpfc_##name = defval;\ 1661static uint lpfc_##name = defval;\
1639module_param(lpfc_##name, uint, 0);\ 1662module_param(lpfc_##name, uint, S_IRUGO);\
1640MODULE_PARM_DESC(lpfc_##name, desc);\ 1663MODULE_PARM_DESC(lpfc_##name, desc);\
1641lpfc_param_hex_show(name)\ 1664lpfc_param_hex_show(name)\
1642lpfc_param_init(name, defval, minval, maxval)\ 1665lpfc_param_init(name, defval, minval, maxval)\
@@ -1644,7 +1667,7 @@ static DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL)
1644 1667
1645#define LPFC_ATTR_HEX_RW(name, defval, minval, maxval, desc) \ 1668#define LPFC_ATTR_HEX_RW(name, defval, minval, maxval, desc) \
1646static uint lpfc_##name = defval;\ 1669static uint lpfc_##name = defval;\
1647module_param(lpfc_##name, uint, 0);\ 1670module_param(lpfc_##name, uint, S_IRUGO);\
1648MODULE_PARM_DESC(lpfc_##name, desc);\ 1671MODULE_PARM_DESC(lpfc_##name, desc);\
1649lpfc_param_hex_show(name)\ 1672lpfc_param_hex_show(name)\
1650lpfc_param_init(name, defval, minval, maxval)\ 1673lpfc_param_init(name, defval, minval, maxval)\
@@ -1655,13 +1678,13 @@ static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
1655 1678
1656#define LPFC_VPORT_ATTR(name, defval, minval, maxval, desc) \ 1679#define LPFC_VPORT_ATTR(name, defval, minval, maxval, desc) \
1657static uint lpfc_##name = defval;\ 1680static uint lpfc_##name = defval;\
1658module_param(lpfc_##name, uint, 0);\ 1681module_param(lpfc_##name, uint, S_IRUGO);\
1659MODULE_PARM_DESC(lpfc_##name, desc);\ 1682MODULE_PARM_DESC(lpfc_##name, desc);\
1660lpfc_vport_param_init(name, defval, minval, maxval) 1683lpfc_vport_param_init(name, defval, minval, maxval)
1661 1684
1662#define LPFC_VPORT_ATTR_R(name, defval, minval, maxval, desc) \ 1685#define LPFC_VPORT_ATTR_R(name, defval, minval, maxval, desc) \
1663static uint lpfc_##name = defval;\ 1686static uint lpfc_##name = defval;\
1664module_param(lpfc_##name, uint, 0);\ 1687module_param(lpfc_##name, uint, S_IRUGO);\
1665MODULE_PARM_DESC(lpfc_##name, desc);\ 1688MODULE_PARM_DESC(lpfc_##name, desc);\
1666lpfc_vport_param_show(name)\ 1689lpfc_vport_param_show(name)\
1667lpfc_vport_param_init(name, defval, minval, maxval)\ 1690lpfc_vport_param_init(name, defval, minval, maxval)\
@@ -1669,7 +1692,7 @@ static DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL)
1669 1692
1670#define LPFC_VPORT_ATTR_RW(name, defval, minval, maxval, desc) \ 1693#define LPFC_VPORT_ATTR_RW(name, defval, minval, maxval, desc) \
1671static uint lpfc_##name = defval;\ 1694static uint lpfc_##name = defval;\
1672module_param(lpfc_##name, uint, 0);\ 1695module_param(lpfc_##name, uint, S_IRUGO);\
1673MODULE_PARM_DESC(lpfc_##name, desc);\ 1696MODULE_PARM_DESC(lpfc_##name, desc);\
1674lpfc_vport_param_show(name)\ 1697lpfc_vport_param_show(name)\
1675lpfc_vport_param_init(name, defval, minval, maxval)\ 1698lpfc_vport_param_init(name, defval, minval, maxval)\
@@ -1680,7 +1703,7 @@ static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
1680 1703
1681#define LPFC_VPORT_ATTR_HEX_R(name, defval, minval, maxval, desc) \ 1704#define LPFC_VPORT_ATTR_HEX_R(name, defval, minval, maxval, desc) \
1682static uint lpfc_##name = defval;\ 1705static uint lpfc_##name = defval;\
1683module_param(lpfc_##name, uint, 0);\ 1706module_param(lpfc_##name, uint, S_IRUGO);\
1684MODULE_PARM_DESC(lpfc_##name, desc);\ 1707MODULE_PARM_DESC(lpfc_##name, desc);\
1685lpfc_vport_param_hex_show(name)\ 1708lpfc_vport_param_hex_show(name)\
1686lpfc_vport_param_init(name, defval, minval, maxval)\ 1709lpfc_vport_param_init(name, defval, minval, maxval)\
@@ -1688,7 +1711,7 @@ static DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL)
1688 1711
1689#define LPFC_VPORT_ATTR_HEX_RW(name, defval, minval, maxval, desc) \ 1712#define LPFC_VPORT_ATTR_HEX_RW(name, defval, minval, maxval, desc) \
1690static uint lpfc_##name = defval;\ 1713static uint lpfc_##name = defval;\
1691module_param(lpfc_##name, uint, 0);\ 1714module_param(lpfc_##name, uint, S_IRUGO);\
1692MODULE_PARM_DESC(lpfc_##name, desc);\ 1715MODULE_PARM_DESC(lpfc_##name, desc);\
1693lpfc_vport_param_hex_show(name)\ 1716lpfc_vport_param_hex_show(name)\
1694lpfc_vport_param_init(name, defval, minval, maxval)\ 1717lpfc_vport_param_init(name, defval, minval, maxval)\
@@ -1732,7 +1755,7 @@ static DEVICE_ATTR(npiv_info, S_IRUGO, lpfc_npiv_info_show, NULL);
1732static DEVICE_ATTR(lpfc_temp_sensor, S_IRUGO, lpfc_temp_sensor_show, NULL); 1755static DEVICE_ATTR(lpfc_temp_sensor, S_IRUGO, lpfc_temp_sensor_show, NULL);
1733static DEVICE_ATTR(lpfc_fips_level, S_IRUGO, lpfc_fips_level_show, NULL); 1756static DEVICE_ATTR(lpfc_fips_level, S_IRUGO, lpfc_fips_level_show, NULL);
1734static DEVICE_ATTR(lpfc_fips_rev, S_IRUGO, lpfc_fips_rev_show, NULL); 1757static DEVICE_ATTR(lpfc_fips_rev, S_IRUGO, lpfc_fips_rev_show, NULL);
1735 1758static DEVICE_ATTR(lpfc_dss, S_IRUGO, lpfc_dss_show, NULL);
1736 1759
1737static char *lpfc_soft_wwn_key = "C99G71SL8032A"; 1760static char *lpfc_soft_wwn_key = "C99G71SL8032A";
1738 1761
@@ -1973,7 +1996,7 @@ static DEVICE_ATTR(lpfc_soft_wwnn, S_IRUGO | S_IWUSR,\
1973 1996
1974 1997
1975static int lpfc_poll = 0; 1998static int lpfc_poll = 0;
1976module_param(lpfc_poll, int, 0); 1999module_param(lpfc_poll, int, S_IRUGO);
1977MODULE_PARM_DESC(lpfc_poll, "FCP ring polling mode control:" 2000MODULE_PARM_DESC(lpfc_poll, "FCP ring polling mode control:"
1978 " 0 - none," 2001 " 0 - none,"
1979 " 1 - poll with interrupts enabled" 2002 " 1 - poll with interrupts enabled"
@@ -1983,21 +2006,21 @@ static DEVICE_ATTR(lpfc_poll, S_IRUGO | S_IWUSR,
1983 lpfc_poll_show, lpfc_poll_store); 2006 lpfc_poll_show, lpfc_poll_store);
1984 2007
1985int lpfc_sli_mode = 0; 2008int lpfc_sli_mode = 0;
1986module_param(lpfc_sli_mode, int, 0); 2009module_param(lpfc_sli_mode, int, S_IRUGO);
1987MODULE_PARM_DESC(lpfc_sli_mode, "SLI mode selector:" 2010MODULE_PARM_DESC(lpfc_sli_mode, "SLI mode selector:"
1988 " 0 - auto (SLI-3 if supported)," 2011 " 0 - auto (SLI-3 if supported),"
1989 " 2 - select SLI-2 even on SLI-3 capable HBAs," 2012 " 2 - select SLI-2 even on SLI-3 capable HBAs,"
1990 " 3 - select SLI-3"); 2013 " 3 - select SLI-3");
1991 2014
1992int lpfc_enable_npiv = 1; 2015int lpfc_enable_npiv = 1;
1993module_param(lpfc_enable_npiv, int, 0); 2016module_param(lpfc_enable_npiv, int, S_IRUGO);
1994MODULE_PARM_DESC(lpfc_enable_npiv, "Enable NPIV functionality"); 2017MODULE_PARM_DESC(lpfc_enable_npiv, "Enable NPIV functionality");
1995lpfc_param_show(enable_npiv); 2018lpfc_param_show(enable_npiv);
1996lpfc_param_init(enable_npiv, 1, 0, 1); 2019lpfc_param_init(enable_npiv, 1, 0, 1);
1997static DEVICE_ATTR(lpfc_enable_npiv, S_IRUGO, lpfc_enable_npiv_show, NULL); 2020static DEVICE_ATTR(lpfc_enable_npiv, S_IRUGO, lpfc_enable_npiv_show, NULL);
1998 2021
1999int lpfc_enable_rrq; 2022int lpfc_enable_rrq;
2000module_param(lpfc_enable_rrq, int, 0); 2023module_param(lpfc_enable_rrq, int, S_IRUGO);
2001MODULE_PARM_DESC(lpfc_enable_rrq, "Enable RRQ functionality"); 2024MODULE_PARM_DESC(lpfc_enable_rrq, "Enable RRQ functionality");
2002lpfc_param_show(enable_rrq); 2025lpfc_param_show(enable_rrq);
2003lpfc_param_init(enable_rrq, 0, 0, 1); 2026lpfc_param_init(enable_rrq, 0, 0, 1);
@@ -2059,7 +2082,7 @@ static DEVICE_ATTR(txcmplq_hw, S_IRUGO,
2059 lpfc_txcmplq_hw_show, NULL); 2082 lpfc_txcmplq_hw_show, NULL);
2060 2083
2061int lpfc_iocb_cnt = 2; 2084int lpfc_iocb_cnt = 2;
2062module_param(lpfc_iocb_cnt, int, 1); 2085module_param(lpfc_iocb_cnt, int, S_IRUGO);
2063MODULE_PARM_DESC(lpfc_iocb_cnt, 2086MODULE_PARM_DESC(lpfc_iocb_cnt,
2064 "Number of IOCBs alloc for ELS, CT, and ABTS: 1k to 5k IOCBs"); 2087 "Number of IOCBs alloc for ELS, CT, and ABTS: 1k to 5k IOCBs");
2065lpfc_param_show(iocb_cnt); 2088lpfc_param_show(iocb_cnt);
@@ -2211,7 +2234,7 @@ static DEVICE_ATTR(lpfc_nodev_tmo, S_IRUGO | S_IWUSR,
2211# disappear until the timer expires. Value range is [0,255]. Default 2234# disappear until the timer expires. Value range is [0,255]. Default
2212# value is 30. 2235# value is 30.
2213*/ 2236*/
2214module_param(lpfc_devloss_tmo, int, 0); 2237module_param(lpfc_devloss_tmo, int, S_IRUGO);
2215MODULE_PARM_DESC(lpfc_devloss_tmo, 2238MODULE_PARM_DESC(lpfc_devloss_tmo,
2216 "Seconds driver will hold I/O waiting " 2239 "Seconds driver will hold I/O waiting "
2217 "for a device to come back"); 2240 "for a device to come back");
@@ -2321,7 +2344,7 @@ LPFC_VPORT_ATTR_R(peer_port_login, 0, 0, 1,
2321# Default value of this parameter is 1. 2344# Default value of this parameter is 1.
2322*/ 2345*/
2323static int lpfc_restrict_login = 1; 2346static int lpfc_restrict_login = 1;
2324module_param(lpfc_restrict_login, int, 0); 2347module_param(lpfc_restrict_login, int, S_IRUGO);
2325MODULE_PARM_DESC(lpfc_restrict_login, 2348MODULE_PARM_DESC(lpfc_restrict_login,
2326 "Restrict virtual ports login to remote initiators."); 2349 "Restrict virtual ports login to remote initiators.");
2327lpfc_vport_param_show(restrict_login); 2350lpfc_vport_param_show(restrict_login);
@@ -2492,7 +2515,7 @@ lpfc_topology_store(struct device *dev, struct device_attribute *attr,
2492 return -EINVAL; 2515 return -EINVAL;
2493} 2516}
2494static int lpfc_topology = 0; 2517static int lpfc_topology = 0;
2495module_param(lpfc_topology, int, 0); 2518module_param(lpfc_topology, int, S_IRUGO);
2496MODULE_PARM_DESC(lpfc_topology, "Select Fibre Channel topology"); 2519MODULE_PARM_DESC(lpfc_topology, "Select Fibre Channel topology");
2497lpfc_param_show(topology) 2520lpfc_param_show(topology)
2498lpfc_param_init(topology, 0, 0, 6) 2521lpfc_param_init(topology, 0, 0, 6)
@@ -2934,7 +2957,7 @@ lpfc_link_speed_store(struct device *dev, struct device_attribute *attr,
2934} 2957}
2935 2958
2936static int lpfc_link_speed = 0; 2959static int lpfc_link_speed = 0;
2937module_param(lpfc_link_speed, int, 0); 2960module_param(lpfc_link_speed, int, S_IRUGO);
2938MODULE_PARM_DESC(lpfc_link_speed, "Select link speed"); 2961MODULE_PARM_DESC(lpfc_link_speed, "Select link speed");
2939lpfc_param_show(link_speed) 2962lpfc_param_show(link_speed)
2940 2963
@@ -3062,7 +3085,7 @@ lpfc_aer_support_store(struct device *dev, struct device_attribute *attr,
3062} 3085}
3063 3086
3064static int lpfc_aer_support = 1; 3087static int lpfc_aer_support = 1;
3065module_param(lpfc_aer_support, int, 1); 3088module_param(lpfc_aer_support, int, S_IRUGO);
3066MODULE_PARM_DESC(lpfc_aer_support, "Enable PCIe device AER support"); 3089MODULE_PARM_DESC(lpfc_aer_support, "Enable PCIe device AER support");
3067lpfc_param_show(aer_support) 3090lpfc_param_show(aer_support)
3068 3091
@@ -3174,7 +3197,7 @@ LPFC_VPORT_ATTR_RW(use_adisc, 0, 0, 1,
3174# The value is set in milliseconds. 3197# The value is set in milliseconds.
3175*/ 3198*/
3176static int lpfc_max_scsicmpl_time; 3199static int lpfc_max_scsicmpl_time;
3177module_param(lpfc_max_scsicmpl_time, int, 0); 3200module_param(lpfc_max_scsicmpl_time, int, S_IRUGO);
3178MODULE_PARM_DESC(lpfc_max_scsicmpl_time, 3201MODULE_PARM_DESC(lpfc_max_scsicmpl_time,
3179 "Use command completion time to control queue depth"); 3202 "Use command completion time to control queue depth");
3180lpfc_vport_param_show(max_scsicmpl_time); 3203lpfc_vport_param_show(max_scsicmpl_time);
@@ -3350,7 +3373,7 @@ LPFC_ATTR_R(enable_bg, 0, 0, 1, "Enable BlockGuard Support");
3350*/ 3373*/
3351unsigned int lpfc_prot_mask = SHOST_DIF_TYPE1_PROTECTION; 3374unsigned int lpfc_prot_mask = SHOST_DIF_TYPE1_PROTECTION;
3352 3375
3353module_param(lpfc_prot_mask, uint, 0); 3376module_param(lpfc_prot_mask, uint, S_IRUGO);
3354MODULE_PARM_DESC(lpfc_prot_mask, "host protection mask"); 3377MODULE_PARM_DESC(lpfc_prot_mask, "host protection mask");
3355 3378
3356/* 3379/*
@@ -3362,7 +3385,7 @@ MODULE_PARM_DESC(lpfc_prot_mask, "host protection mask");
3362# 3385#
3363*/ 3386*/
3364unsigned char lpfc_prot_guard = SHOST_DIX_GUARD_IP; 3387unsigned char lpfc_prot_guard = SHOST_DIX_GUARD_IP;
3365module_param(lpfc_prot_guard, byte, 0); 3388module_param(lpfc_prot_guard, byte, S_IRUGO);
3366MODULE_PARM_DESC(lpfc_prot_guard, "host protection guard type"); 3389MODULE_PARM_DESC(lpfc_prot_guard, "host protection guard type");
3367 3390
3368/* 3391/*
@@ -3380,7 +3403,7 @@ MODULE_PARM_DESC(lpfc_prot_guard, "host protection guard type");
3380 * Default value is 0. 3403 * Default value is 0.
3381 */ 3404 */
3382int lpfc_delay_discovery; 3405int lpfc_delay_discovery;
3383module_param(lpfc_delay_discovery, int, 0); 3406module_param(lpfc_delay_discovery, int, S_IRUGO);
3384MODULE_PARM_DESC(lpfc_delay_discovery, 3407MODULE_PARM_DESC(lpfc_delay_discovery,
3385 "Delay NPort discovery when Clean Address bit is cleared. " 3408 "Delay NPort discovery when Clean Address bit is cleared. "
3386 "Allowed values: 0,1."); 3409 "Allowed values: 0,1.");
@@ -3475,6 +3498,7 @@ struct device_attribute *lpfc_hba_attrs[] = {
3475 &dev_attr_txcmplq_hw, 3498 &dev_attr_txcmplq_hw,
3476 &dev_attr_lpfc_fips_level, 3499 &dev_attr_lpfc_fips_level,
3477 &dev_attr_lpfc_fips_rev, 3500 &dev_attr_lpfc_fips_rev,
3501 &dev_attr_lpfc_dss,
3478 NULL, 3502 NULL,
3479}; 3503};
3480 3504
@@ -4677,6 +4701,7 @@ lpfc_get_cfgparam(struct lpfc_hba *phba)
4677 lpfc_aer_support_init(phba, lpfc_aer_support); 4701 lpfc_aer_support_init(phba, lpfc_aer_support);
4678 lpfc_suppress_link_up_init(phba, lpfc_suppress_link_up); 4702 lpfc_suppress_link_up_init(phba, lpfc_suppress_link_up);
4679 lpfc_iocb_cnt_init(phba, lpfc_iocb_cnt); 4703 lpfc_iocb_cnt_init(phba, lpfc_iocb_cnt);
4704 phba->cfg_enable_dss = 1;
4680 return; 4705 return;
4681} 4706}
4682 4707
diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c
index a80d938fafc9..3c8c91a7609c 100644
--- a/drivers/scsi/lpfc/lpfc_debugfs.c
+++ b/drivers/scsi/lpfc/lpfc_debugfs.c
@@ -82,23 +82,23 @@
82 * the HBA. X MUST also be a power of 2. 82 * the HBA. X MUST also be a power of 2.
83 */ 83 */
84static int lpfc_debugfs_enable = 1; 84static int lpfc_debugfs_enable = 1;
85module_param(lpfc_debugfs_enable, int, 0); 85module_param(lpfc_debugfs_enable, int, S_IRUGO);
86MODULE_PARM_DESC(lpfc_debugfs_enable, "Enable debugfs services"); 86MODULE_PARM_DESC(lpfc_debugfs_enable, "Enable debugfs services");
87 87
88/* This MUST be a power of 2 */ 88/* This MUST be a power of 2 */
89static int lpfc_debugfs_max_disc_trc; 89static int lpfc_debugfs_max_disc_trc;
90module_param(lpfc_debugfs_max_disc_trc, int, 0); 90module_param(lpfc_debugfs_max_disc_trc, int, S_IRUGO);
91MODULE_PARM_DESC(lpfc_debugfs_max_disc_trc, 91MODULE_PARM_DESC(lpfc_debugfs_max_disc_trc,
92 "Set debugfs discovery trace depth"); 92 "Set debugfs discovery trace depth");
93 93
94/* This MUST be a power of 2 */ 94/* This MUST be a power of 2 */
95static int lpfc_debugfs_max_slow_ring_trc; 95static int lpfc_debugfs_max_slow_ring_trc;
96module_param(lpfc_debugfs_max_slow_ring_trc, int, 0); 96module_param(lpfc_debugfs_max_slow_ring_trc, int, S_IRUGO);
97MODULE_PARM_DESC(lpfc_debugfs_max_slow_ring_trc, 97MODULE_PARM_DESC(lpfc_debugfs_max_slow_ring_trc,
98 "Set debugfs slow ring trace depth"); 98 "Set debugfs slow ring trace depth");
99 99
100static int lpfc_debugfs_mask_disc_trc; 100static int lpfc_debugfs_mask_disc_trc;
101module_param(lpfc_debugfs_mask_disc_trc, int, 0); 101module_param(lpfc_debugfs_mask_disc_trc, int, S_IRUGO);
102MODULE_PARM_DESC(lpfc_debugfs_mask_disc_trc, 102MODULE_PARM_DESC(lpfc_debugfs_mask_disc_trc,
103 "Set debugfs discovery trace mask"); 103 "Set debugfs discovery trace mask");
104 104
diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h
index 5a4a196baa90..94ae37c5111a 100644
--- a/drivers/scsi/lpfc/lpfc_hw.h
+++ b/drivers/scsi/lpfc/lpfc_hw.h
@@ -3204,7 +3204,10 @@ typedef struct {
3204#define IOERR_SLER_RRQ_RJT_ERR 0x4C 3204#define IOERR_SLER_RRQ_RJT_ERR 0x4C
3205#define IOERR_SLER_RRQ_RETRY_ERR 0x4D 3205#define IOERR_SLER_RRQ_RETRY_ERR 0x4D
3206#define IOERR_SLER_ABTS_ERR 0x4E 3206#define IOERR_SLER_ABTS_ERR 0x4E
3207 3207#define IOERR_ELXSEC_KEY_UNWRAP_ERROR 0xF0
3208#define IOERR_ELXSEC_KEY_UNWRAP_COMPARE_ERROR 0xF1
3209#define IOERR_ELXSEC_CRYPTO_ERROR 0xF2
3210#define IOERR_ELXSEC_CRYPTO_COMPARE_ERROR 0xF3
3208#define IOERR_DRVR_MASK 0x100 3211#define IOERR_DRVR_MASK 0x100
3209#define IOERR_SLI_DOWN 0x101 /* ulpStatus - Driver defined */ 3212#define IOERR_SLI_DOWN 0x101 /* ulpStatus - Driver defined */
3210#define IOERR_SLI_BRESET 0x102 3213#define IOERR_SLI_BRESET 0x102
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 5e84d2a6ada6..35665cfb5689 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -460,7 +460,7 @@ lpfc_config_port_post(struct lpfc_hba *phba)
460 || ((phba->cfg_link_speed == LPFC_USER_LINK_SPEED_16G) 460 || ((phba->cfg_link_speed == LPFC_USER_LINK_SPEED_16G)
461 && !(phba->lmt & LMT_16Gb))) { 461 && !(phba->lmt & LMT_16Gb))) {
462 /* Reset link speed to auto */ 462 /* Reset link speed to auto */
463 lpfc_printf_log(phba, KERN_WARNING, LOG_LINK_EVENT, 463 lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT,
464 "1302 Invalid speed for this board: " 464 "1302 Invalid speed for this board: "
465 "Reset link speed to auto: x%x\n", 465 "Reset link speed to auto: x%x\n",
466 phba->cfg_link_speed); 466 phba->cfg_link_speed);
diff --git a/drivers/scsi/lpfc/lpfc_mbox.c b/drivers/scsi/lpfc/lpfc_mbox.c
index 9fb4345ec021..dba32dfdb59b 100644
--- a/drivers/scsi/lpfc/lpfc_mbox.c
+++ b/drivers/scsi/lpfc/lpfc_mbox.c
@@ -1263,7 +1263,8 @@ lpfc_config_port(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
1263 if (phba->sli_rev == LPFC_SLI_REV3 && phba->vpd.sli3Feat.cerbm) { 1263 if (phba->sli_rev == LPFC_SLI_REV3 && phba->vpd.sli3Feat.cerbm) {
1264 if (phba->cfg_enable_bg) 1264 if (phba->cfg_enable_bg)
1265 mb->un.varCfgPort.cbg = 1; /* configure BlockGuard */ 1265 mb->un.varCfgPort.cbg = 1; /* configure BlockGuard */
1266 mb->un.varCfgPort.cdss = 1; /* Configure Security */ 1266 if (phba->cfg_enable_dss)
1267 mb->un.varCfgPort.cdss = 1; /* Configure Security */
1267 mb->un.varCfgPort.cerbm = 1; /* Request HBQs */ 1268 mb->un.varCfgPort.cerbm = 1; /* Request HBQs */
1268 mb->un.varCfgPort.ccrp = 1; /* Command Ring Polling */ 1269 mb->un.varCfgPort.ccrp = 1; /* Command Ring Polling */
1269 mb->un.varCfgPort.max_hbq = lpfc_sli_hbq_count(); 1270 mb->un.varCfgPort.max_hbq = lpfc_sli_hbq_count();
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index d482dfc951f3..1255b9d1b1b0 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -2508,6 +2508,15 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
2508 break; 2508 break;
2509 case IOSTAT_LOCAL_REJECT: 2509 case IOSTAT_LOCAL_REJECT:
2510 case IOSTAT_REMOTE_STOP: 2510 case IOSTAT_REMOTE_STOP:
2511 if (lpfc_cmd->result == IOERR_ELXSEC_KEY_UNWRAP_ERROR ||
2512 lpfc_cmd->result ==
2513 IOERR_ELXSEC_KEY_UNWRAP_COMPARE_ERROR ||
2514 lpfc_cmd->result == IOERR_ELXSEC_CRYPTO_ERROR ||
2515 lpfc_cmd->result ==
2516 IOERR_ELXSEC_CRYPTO_COMPARE_ERROR) {
2517 cmd->result = ScsiResult(DID_NO_CONNECT, 0);
2518 break;
2519 }
2511 if (lpfc_cmd->result == IOERR_INVALID_RPI || 2520 if (lpfc_cmd->result == IOERR_INVALID_RPI ||
2512 lpfc_cmd->result == IOERR_NO_RESOURCES || 2521 lpfc_cmd->result == IOERR_NO_RESOURCES ||
2513 lpfc_cmd->result == IOERR_ABORT_REQUESTED || 2522 lpfc_cmd->result == IOERR_ABORT_REQUESTED ||
@@ -2515,7 +2524,6 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
2515 cmd->result = ScsiResult(DID_REQUEUE, 0); 2524 cmd->result = ScsiResult(DID_REQUEUE, 0);
2516 break; 2525 break;
2517 } 2526 }
2518
2519 if ((lpfc_cmd->result == IOERR_RX_DMA_FAILED || 2527 if ((lpfc_cmd->result == IOERR_RX_DMA_FAILED ||
2520 lpfc_cmd->result == IOERR_TX_DMA_FAILED) && 2528 lpfc_cmd->result == IOERR_TX_DMA_FAILED) &&
2521 pIocbOut->iocb.unsli3.sli3_bg.bgstat) { 2529 pIocbOut->iocb.unsli3.sli3_bg.bgstat) {
@@ -2545,7 +2553,6 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
2545 lpfc_cmd->cur_iocbq.sli4_xritag, 2553 lpfc_cmd->cur_iocbq.sli4_xritag,
2546 0, 0); 2554 0, 0);
2547 } 2555 }
2548
2549 /* else: fall through */ 2556 /* else: fall through */
2550 default: 2557 default:
2551 cmd->result = ScsiResult(DID_ERROR, 0); 2558 cmd->result = ScsiResult(DID_ERROR, 0);
@@ -2556,9 +2563,8 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
2556 || (pnode->nlp_state != NLP_STE_MAPPED_NODE)) 2563 || (pnode->nlp_state != NLP_STE_MAPPED_NODE))
2557 cmd->result = ScsiResult(DID_TRANSPORT_DISRUPTED, 2564 cmd->result = ScsiResult(DID_TRANSPORT_DISRUPTED,
2558 SAM_STAT_BUSY); 2565 SAM_STAT_BUSY);
2559 } else { 2566 } else
2560 cmd->result = ScsiResult(DID_OK, 0); 2567 cmd->result = ScsiResult(DID_OK, 0);
2561 }
2562 2568
2563 if (cmd->result || lpfc_cmd->fcp_rsp->rspSnsLen) { 2569 if (cmd->result || lpfc_cmd->fcp_rsp->rspSnsLen) {
2564 uint32_t *lp = (uint32_t *)cmd->sense_buffer; 2570 uint32_t *lp = (uint32_t *)cmd->sense_buffer;