From patchwork Tue Mar 5 10:58:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saurav Kashyap X-Patchwork-Id: 10839261 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 79B311803 for ; Tue, 5 Mar 2019 10:59:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65552297DE for ; Tue, 5 Mar 2019 10:59:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 58F092AE4C; Tue, 5 Mar 2019 10:59:15 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 D0792297DE for ; Tue, 5 Mar 2019 10:59:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727332AbfCEK7O (ORCPT ); Tue, 5 Mar 2019 05:59:14 -0500 Received: from mail-eopbgr770059.outbound.protection.outlook.com ([40.107.77.59]:43175 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726765AbfCEK7O (ORCPT ); Tue, 5 Mar 2019 05:59:14 -0500 Received: from BYAPR07CA0005.namprd07.prod.outlook.com (2603:10b6:a02:bc::18) by BN7PR07MB4756.namprd07.prod.outlook.com (2603:10b6:406:f0::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1665.19; Tue, 5 Mar 2019 10:59:10 +0000 Received: from BY2NAM05FT059.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::202) by BYAPR07CA0005.outlook.office365.com (2603:10b6:a02:bc::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1686.16 via Frontend Transport; Tue, 5 Mar 2019 10:59:10 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by BY2NAM05FT059.mail.protection.outlook.com (10.152.100.196) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1686.5 via Frontend Transport; Tue, 5 Mar 2019 10:59:10 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Tue, 5 Mar 2019 02:59:07 -0800 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 x25Ax7Yl013228; Tue, 5 Mar 2019 02:59:07 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x25Ax7Cc013227; Tue, 5 Mar 2019 02:59:07 -0800 From: Saurav Kashyap To: CC: , Subject: [PATCH 02/26] qedf: Correct xid range overlap between offloaded requests and libfc requests. Date: Tue, 5 Mar 2019 02:58:37 -0800 Message-ID: <20190305105901.13185-3-skashyap@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190305105901.13185-1-skashyap@marvell.com> References: <20190305105901.13185-1-skashyap@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131962571504280695;(abac79dc-c90b-41ba-8033-08d666125e47);(abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38;IPV:CAL;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(346002)(39860400002)(396003)(376002)(136003)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(69596002)(126002)(26005)(6862004)(305945005)(97736004)(2351001)(26826003)(80596001)(4326008)(53936002)(50466002)(16586007)(68736007)(316002)(54906003)(47776003)(76176011)(42186006)(85426001)(36906005)(48376002)(356004)(81166006)(6666004)(476003)(2616005)(14444005)(1076003)(8676002)(8936002)(81156014)(86362001)(5660300002)(106466001)(105606002)(11346002)(50226002)(336012)(36756003)(87636003)(51416003)(486006)(498600001)(2906002)(446003);DIR:OUT;SFP:1101;SCL:1;SRVR:BN7PR07MB4756;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d5df28cf-234a-4f01-6f4b-08d6a159989f X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600127)(711020)(4605104)(2017052603328);SRVR:BN7PR07MB4756; X-MS-TrafficTypeDiagnostic: BN7PR07MB4756: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0967749BC1 X-Microsoft-Exchange-Diagnostics: 1;BN7PR07MB4756;23:p++k2ceVpQej2+By5lOy0FeV11ilKz+EVqRkoKjYFDkAcdB229BvomeqhzY6cIWjOFRXGXC5mRqVaZa4f/c81e2HhTaOeh12eVw27u+qu36yQJ0OdUdCV8286V9+1HiefES9UTAvcEaJsNX0+LwrAYXJK2LDBVn9HKnYBKkH1p7fT8k6vTqvNZu4fbCyIpw/M9p44YCi1INq5PvhyQ7+UwIVh3NwGd5wQVgGq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yTv+VDTHwqdqCO4w5BSNYRCL6YPVclFG7zPL4io9D1RCiX0gCb92i8laqBmRdGsXeMUXWeeaV/eIjdiiP6aiPiwi3au6FOSupXqGf/bfzRCyb1EukwwtLwqsp/5H7IUeVX3qXpRI8+b8REALtMs6viVVTInm2rN0bTv3P+HBFja9kX11u6AYYcxhwj/+OwXcynGZjT5LZMlHpliqalI/mRPaXD+UgAydda1NNWpijq8tXz75kO6tbVJjzp/FpVUvTcUhCRsnn3Y4nejZR4SPzt5p66HjOspx/1oVF9g7atd8mhsyJp00Dwr8XpueLYOh9cX5vS88dtMva219CVoDvqO4aYL9rQQLtXJmiAFwb5yiTHtUGBpJk4bbz1hA4EplojI4i9BRptXwg2o4a2725KeL2ryp+OC0= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2019 10:59:10.1828 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d5df28cf-234a-4f01-6f4b-08d6a159989f X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[199.233.58.38];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR07MB4756 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: Chad Dupuis There is currently an overlap where exchange IDs between what is used for offloaded commands and by libfc for ELS commands. Correct this so that exchange ID range is: Offloaded requests: 0 to 0xfff libfc requests: 0x1000 to 0xfffe Signed-off-by: Chad Dupuis Signed-off-by: Saurav Kashyap --- drivers/scsi/qedf/qedf.h | 5 ----- drivers/scsi/qedf/qedf_io.c | 6 +++--- drivers/scsi/qedf/qedf_main.c | 13 ++++--------- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/qedf/qedf.h b/drivers/scsi/qedf/qedf.h index 2c78d8f..8e75c21 100644 --- a/drivers/scsi/qedf/qedf.h +++ b/drivers/scsi/qedf/qedf.h @@ -35,9 +35,6 @@ #define QEDF_DESCR "QLogic FCoE Offload Driver" #define QEDF_MODULE_NAME "qedf" -#define QEDF_MIN_XID 0 -#define QEDF_MAX_SCSI_XID (NUM_TASKS_PER_CONNECTION - 1) -#define QEDF_MAX_ELS_XID 4095 #define QEDF_FLOGI_RETRY_CNT 3 #define QEDF_RPORT_RETRY_CNT 255 #define QEDF_MAX_SESSIONS 1024 @@ -295,8 +292,6 @@ struct qedf_ctx { #define QEDF_DCBX_PENDING 0 #define QEDF_DCBX_DONE 1 atomic_t dcbx; - uint16_t max_scsi_xid; - uint16_t max_els_xid; #define QEDF_NULL_VLAN_ID -1 #define QEDF_FALLBACK_VLAN 1002 #define QEDF_DEFAULT_PRIO 3 diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c index 6ca583b..7c2ecf3 100644 --- a/drivers/scsi/qedf/qedf_io.c +++ b/drivers/scsi/qedf/qedf_io.c @@ -103,7 +103,7 @@ void qedf_cmd_mgr_free(struct qedf_cmd_mgr *cmgr) struct io_bdt *bdt_info; struct qedf_ctx *qedf = cmgr->qedf; size_t bd_tbl_sz; - u16 min_xid = QEDF_MIN_XID; + u16 min_xid = 0; u16 max_xid = (FCOE_PARAMS_NUM_TASKS - 1); int num_ios; int i; @@ -169,7 +169,7 @@ struct qedf_cmd_mgr *qedf_cmd_mgr_alloc(struct qedf_ctx *qedf) u16 xid; int i; int num_ios; - u16 min_xid = QEDF_MIN_XID; + u16 min_xid = 0; u16 max_xid = (FCOE_PARAMS_NUM_TASKS - 1); /* Make sure num_queues is already set before calling this function */ @@ -201,7 +201,7 @@ struct qedf_cmd_mgr *qedf_cmd_mgr_alloc(struct qedf_ctx *qedf) /* * Initialize I/O request fields. */ - xid = QEDF_MIN_XID; + xid = 0; for (i = 0; i < num_ios; i++) { io_req = &cmgr->cmds[i]; diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index edcaf4b..432026b 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -1500,8 +1500,8 @@ static int qedf_lport_setup(struct qedf_ctx *qedf) fcoe_libfc_config(lport, &qedf->ctlr, &qedf_lport_template, 0); /* Allocate the exchange manager */ - fc_exch_mgr_alloc(lport, FC_CLASS_3, qedf->max_scsi_xid + 1, - qedf->max_els_xid, NULL); + fc_exch_mgr_alloc(lport, FC_CLASS_3, FCOE_PARAMS_NUM_TASKS, + 0xfffe, NULL); if (fc_lport_init_stats(lport)) return -ENOMEM; @@ -1624,7 +1624,7 @@ static int qedf_vport_create(struct fc_vport *vport, bool disabled) vport_qedf->wwpn = vn_port->wwpn; vn_port->host->transportt = qedf_fc_vport_transport_template; - vn_port->host->can_queue = QEDF_MAX_ELS_XID; + vn_port->host->can_queue = FCOE_PARAMS_NUM_TASKS; vn_port->host->max_lun = qedf_max_lun; vn_port->host->sg_tablesize = QEDF_MAX_BDS_PER_CMD; vn_port->host->max_cmd_len = QEDF_MAX_CDB_LEN; @@ -3176,11 +3176,6 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) sprintf(host_buf, "host_%d", host->host_no); qed_ops->common->set_name(qedf->cdev, host_buf); - - /* Set xid max values */ - qedf->max_scsi_xid = QEDF_MAX_SCSI_XID; - qedf->max_els_xid = QEDF_MAX_ELS_XID; - /* Allocate cmd mgr */ qedf->cmd_mgr = qedf_cmd_mgr_alloc(qedf); if (!qedf->cmd_mgr) { @@ -3191,9 +3186,9 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) if (mode != QEDF_MODE_RECOVERY) { host->transportt = qedf_fc_transport_template; - host->can_queue = QEDF_MAX_ELS_XID; host->max_lun = qedf_max_lun; host->max_cmd_len = QEDF_MAX_CDB_LEN; + host->can_queue = FCOE_PARAMS_NUM_TASKS; rc = scsi_add_host(host, &pdev->dev); if (rc) goto err6;