From patchwork Wed Oct 11 20:36:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10000623 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 910186037F for ; Wed, 11 Oct 2017 20:37:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8565E28B37 for ; Wed, 11 Oct 2017 20:37:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A47128B69; Wed, 11 Oct 2017 20:37:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1257728B37 for ; Wed, 11 Oct 2017 20:37:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752553AbdJKUhC (ORCPT ); Wed, 11 Oct 2017 16:37:02 -0400 Received: from mail-dm3nam03on0055.outbound.protection.outlook.com ([104.47.41.55]:64975 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751866AbdJKUhA (ORCPT ); Wed, 11 Oct 2017 16:37:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=HXdm0ZvuSciz66TWokv+uvkO09M6ptRCYuluM30etrw=; b=YyZx8xyXHYs/wFciG5HOIVgtL6Wjtdwsd0rdg8+mWgzridkEM569tqDlO+oruLsDYX4gSHvarv/15AqtwCydKVRLhleggoCfpSvS2vYyPFA8E9DtyABR0/KNCHtcT7e54VFtVCV5TJIBkBaq4eo7f5b0ZuxpoGpkK1abiUqxEXc= Received: from CY1PR07CA0020.namprd07.prod.outlook.com (2a01:111:e400:c60a::30) by DM5PR0701MB3816.namprd07.prod.outlook.com (2603:10b6:4:7f::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Wed, 11 Oct 2017 20:36:58 +0000 Received: from BY2FFO11FD044.protection.gbl (2a01:111:f400:7c0c::160) by CY1PR07CA0020.outlook.office365.com (2a01:111:e400:c60a::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7 via Frontend Transport; Wed, 11 Oct 2017 20:36:58 +0000 Authentication-Results: spf=none (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=cavium.com; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BY2FFO11FD044.mail.protection.outlook.com (10.1.14.229) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.77.10 via Frontend Transport; Wed, 11 Oct 2017 20:36:57 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Wed, 11 Oct 2017 13:36:51 -0700 Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id v9BKap58023676; Wed, 11 Oct 2017 13:36:51 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id v9BKapGs023675; Wed, 11 Oct 2017 13:36:51 -0700 From: "Madhani, Himanshu" To: , CC: , Subject: [PATCH 3/5] qla2xxx: Allow MBC_GET_PORT_DATABASE to query and save the port states Date: Wed, 11 Oct 2017 13:36:48 -0700 Message-ID: <20171011203650.23629-4-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20171011203650.23629-1-himanshu.madhani@cavium.com> References: <20171011203650.23629-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(2980300002)(428002)(199003)(189002)(106466001)(8936002)(86362001)(110136005)(81166006)(575784001)(54906003)(36756003)(81156014)(105586002)(8676002)(305945005)(33646002)(5003940100001)(50226002)(189998001)(80596001)(69596002)(478600001)(72206003)(87636003)(101416001)(48376002)(16586007)(50466002)(6666003)(2950100002)(47776003)(1076002)(5660300001)(356003)(76176999)(50986999)(42186006)(4326008)(316002)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR0701MB3816; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; PTR:50-232-66-26-static.hfc.comcastbusiness.net; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD044; 1:PatyKS5wJd1slalBw46ZqQkiOgbecvTGTZPI1piLwmNiJyS56tFr70YN4abjDkD0TKSSaaC+Cqt4ysa0OICwVSLs+bNpM3eSmC9AVCLCs1gAcaW1qqkt6KYoorQneqJR X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9d7b13a5-e02f-413a-0e89-08d510e7d151 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR0701MB3816; X-Microsoft-Exchange-Diagnostics: 1; DM5PR0701MB3816; 3:7Y7He/eACcUA8f8Fmy4wJSBnSGRoVx4u9mSqhA7xOkANyvdZ7Pvppb+GFhLwdyMiekM+H4JcSvTtNbaieMrkbs6qt4P2a/eclzbdp5A8YU8MYWSJA+6/xKMFUouu/5uDYoQbLBAhYHjXxiyt06d6Do9VHKd1XZC1EsEjUhTKSaS/LLhmBkVYC2IQuox+zBcQvjwAK87+we5Xx1XfmbkkpkPh/G/vZJQT24hJt5GjnCBCdeWnDn6pgn4b6lKXBesl/xLxNGDPbd8K/QkIROkKP+UacYYVsJ2WZ0zVekl26c430vwr8CiKtK7zAoJ7o3s3STAdc3AWel6LOQpKBGMQbnSVDv3I8P/Xa8TO21ZF+PQ=; 25:J4qcstbbBRcQ8C+UnmrWoLkAWwkQqisV+DOtMK8qT8yWwWT7psj6IgITSyL0kWccrATrKj0fBWVN3+N+XXmVg/ywVYQn2jc0u8ziC6PyMLn+h7F5CSSjFY0duDdgv/uab8eUC/lfLe0unLzmt2NTIQPiT88TszZDDtD8b777DTllHbdKjJn7X3sGHF0OoKjLPtK8ZKXJZN26Cpa/A7ryhK9htk5bfgeUl+j27xiUq0sz2jht897G6vQQYAJzLQc9CyDWr7B/tqumHojXea1KburFGqbQHG64sz7BnLjD1WDVmD4WMBnYFwJb3K8iqkerb7gOF55AvL6PVL8sr71XRg== X-MS-TrafficTypeDiagnostic: DM5PR0701MB3816: X-Microsoft-Exchange-Diagnostics: 1; DM5PR0701MB3816; 31:YieSunWxq7jQ4lDWATxkCSlyLerlDhWQyPbSVwrmccrSMh0VNkJx7kpELar0/8mng9iXYTOX92YMmDEEhumMwVlaksYilEdA3H3n4vhDnVIwm0ZIUwKfaG3fEjo1xVZjstdDuI//Bi1sBtW47yws2ZpK10RmeyjnrAbmE9xyq3zLaqALQQTPoTU/GPs7crj8Oqb32z6m6e+5UTac2KvKK1z0rVMckgJXyjeytWIvURU=; 20:VbnK8cuVYw7I8ZD9rr/ehfDPHC2R3CSkSgp+lNHi8CIT9vhb6QXJDlUMl5KNNqPK9zFBDYeKh1VCFFPOtn99X13kk62fXSmzAqmnY/MLqDYzR84oaM8MC4DzPWVxj1PC2YZ1Txb3B4J4QDxr3OT18WJzj0Y+9inufSX2BSvmFEDGIZCfEdY94tV1WLrTC4zsd4clwelh/Np7cR+BxJf50w5ex6HV9VnizAGD9Jj840t88nnGUTrhtuLrVhH0Udjqo0IvOHOSxgmIVLlwaLw6TjOMGyiX7buoonhoUWpi9fTGH4Ofep67XHErmUv2eeOCxcCVvdzdaZ/Zpvw9pi+O3CHufEoStHpicQTr9LVRTfK5ZZdOxTQB1TYHNYeR2Hg+pF2GE14Der7kDfzKSRnzOIOX2J96oq50L/3Vo2YOijbOetXq9lizkBvdyliELhQQ+31odzsi5g0KE2t++sf17xdY/SoPgM2FUYO3MBrqLBEH6xG5uOhBz1eDIWW/nNgj X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123562025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR0701MB3816; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR0701MB3816; X-Microsoft-Exchange-Diagnostics: 1; DM5PR0701MB3816; 4:aUATf5mJ0YGBkI4WEPPiVORI7ObmDzNxDLb8iE0z2oIAh/n03dsKYezmy4+Vcgh+7tTgJKlj8RRNYMdJuGPYZKpczhB/7XvH68Zxc8fzTQdx/QFVUxO6miUsxqbpUC8VlvcznJe1OPRWXhAn7zT4GNPBquYqBdOv03wYSwFh5Yx0RvBUWv8Ctqqs9Asej9lK7QSoxkhEVc1hPbaH48BfCGHdqS0yMUxds6wVC0L4xuSgKinZQKzPKOXXJ73eoomD X-Forefront-PRVS: 0457F11EAF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR0701MB3816; 23:+S5UiWlF72chEWEiKpcqtprpyC8uLUxC6FAJQvY?= =?us-ascii?Q?P5zv7mAz00pm9HMx2zHQWk9d6G6sc7GdenQk0D2qVp+vUICjF+41IlodZPul?= =?us-ascii?Q?EEQZLMUMkFIGUitbxOmOA2pr33/4m3795nE1FfJFNyq/pNnjT2IyW2XuKzD/?= =?us-ascii?Q?Viw5kARcjs8uATAw7rv729/fwIUvYghM8LjS4bnpXuo3WQswsr266qZzlki7?= =?us-ascii?Q?6ap49jjdkw/lfQGUcfM8h0rDIB6LO+/uTxvnU7Yb8CVk+9doH5S8D50rvx5I?= =?us-ascii?Q?WTuIaPzzBEfBUlMetBnTfvcXJNvdjSHR0sYF8RCo9/K3LHnFdeVbPcVYWQeS?= =?us-ascii?Q?I3/J/P2nTmsTQhHhAxIVTXTbCIFdHR5ZAFP+CCeNkFH3PrDpZGpWzw1v4al7?= =?us-ascii?Q?xGIZKnsM1cbMPYDScvMEBv81l0Os1MSpfDqw1YIDedpOxTlNWqS5Vc1nQZT0?= =?us-ascii?Q?Vwp9e5BpoepemPXOKiqMVi0F64sW6wr3boMnOHUxzCvETx38Q7/D0gD8JqEZ?= =?us-ascii?Q?qnJz39Bb4kvtgNEyPTm812mjJJx04OT7d/Wi42AJmYG7N/sSNGbgaRw0wYpt?= =?us-ascii?Q?FVnhUdDcqruiowHsdWJfgs1qTMSZDgHNnhT8sZnMMlDS7tvd+uIKffLglo/s?= =?us-ascii?Q?8sHpYQ8ndkQ6Tjnrs2QkbU/2azagfU14O8YS6urCmDmK9HYjltr6kQXUJB10?= =?us-ascii?Q?oItVhg80Es0z/yizWz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lOX4x30la8EUT9hNk+nCB7cR/qMr52kqbab/U=; 7:ppM1p4BAzOwxdlcw4Xrr+R16B/N5PLnA8FZ55AXgupNSxCO3wx0kQyf3jcO3mhnIOH4Mw/Wy+rexO6wUBM/ykNn6XXoaPdLjqscm52JhBLJUB9+N+vIFM3ZptXrGJVMTRguvfXOvx2WJy7OFT0CAYOh4VGiWL8ghvxSR5nPF9mkHCP+MLPlVxBBwi6Spec3IFbQ+X9cEKg2UmFC9p/haPrjkfSUIh0BIZTtKyRWN5kw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2017 20:36:57.5848 (UTC) X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR0701MB3816 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Duane Grigsby The MBC_GET_PORT_DATABASE command normally checks the port state informationi. This patch allows it to save that info in the fcport structure and ignore the check if the query flag is set. Signed-off-by: Duane Grigsby Signed-off-by: Himanshu Madhani Reviewed-by: Johannes Thumshirn --- drivers/scsi/qla2xxx/qla_def.h | 4 ++++ drivers/scsi/qla2xxx/qla_mbx.c | 29 ++++++++++++++++++++++------- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 66d239cbbd66..f712c0cd46d6 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2303,6 +2303,7 @@ typedef struct fc_port { unsigned int send_els_logo:1; unsigned int login_pause:1; unsigned int login_succ:1; + unsigned int query:1; struct work_struct nvme_del_work; struct completion nvme_del_done; @@ -2369,6 +2370,8 @@ typedef struct fc_port { struct list_head gnl_entry; struct work_struct del_work; u8 iocb[IOCB_SIZE]; + u8 current_login_state; + u8 last_login_state; } fc_port_t; #define QLA_FCPORT_SCAN 1 @@ -4114,6 +4117,7 @@ typedef struct scsi_qla_host { #define QPAIR_ONLINE_CHECK_NEEDED 27 #define SET_ZIO_THRESHOLD_NEEDED 28 #define DETECT_SFP_CHANGE 29 +#define N2N_LOGIN_NEEDED 30 unsigned long pci_flags; #define PFLG_DISCONNECTED 0 /* PCI device removed */ diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 7f71fd378c27..71e56877e1eb 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -1822,17 +1822,32 @@ qla2x00_get_port_database(scsi_qla_host_t *vha, fc_port_t *fcport, uint8_t opt) if (IS_FWI2_CAPABLE(ha)) { uint64_t zero = 0; + u8 current_login_state, last_login_state; + pd24 = (struct port_database_24xx *) pd; /* Check for logged in state. */ - if (pd24->current_login_state != PDS_PRLI_COMPLETE && - pd24->last_login_state != PDS_PRLI_COMPLETE) { - ql_dbg(ql_dbg_mbx, vha, 0x1051, - "Unable to verify login-state (%x/%x) for " - "loop_id %x.\n", pd24->current_login_state, - pd24->last_login_state, fcport->loop_id); + if (fcport->fc4f_nvme) { + current_login_state = pd24->current_login_state >> 4; + last_login_state = pd24->last_login_state >> 4; + } else { + current_login_state = pd24->current_login_state & 0xf; + last_login_state = pd24->last_login_state & 0xf; + } + fcport->current_login_state = pd24->current_login_state; + fcport->last_login_state = pd24->last_login_state; + + /* Check for logged in state. */ + if (current_login_state != PDS_PRLI_COMPLETE && + last_login_state != PDS_PRLI_COMPLETE) { + ql_dbg(ql_dbg_mbx, vha, 0x119a, + "Unable to verify login-state (%x/%x) for loop_id %x.\n", + current_login_state, last_login_state, + fcport->loop_id); rval = QLA_FUNCTION_FAILED; - goto gpd_error_out; + + if (!fcport->query) + goto gpd_error_out; } if (fcport->loop_id == FC_NO_LOOP_ID ||