From patchwork Thu Aug 10 13:32:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rangankar, Manish" X-Patchwork-Id: 9893749 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 1764460325 for ; Thu, 10 Aug 2017 13:32:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07C1E28B3C for ; Thu, 10 Aug 2017 13:32:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED960289D6; Thu, 10 Aug 2017 13:32:27 +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 BBB9F28B30 for ; Thu, 10 Aug 2017 13:32:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752227AbdHJNc0 (ORCPT ); Thu, 10 Aug 2017 09:32:26 -0400 Received: from mail-dm3nam03on0067.outbound.protection.outlook.com ([104.47.41.67]:59760 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751456AbdHJNcZ (ORCPT ); Thu, 10 Aug 2017 09:32:25 -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=74eyZ7nEkPNcA6L9c1otMPew62EpN4aJgpTr37ovphA=; b=NPTUFArVVroaGPQspYIQnfeuSAZB2hILUsVOtTo7vf10vH3Z8AWHcuVjtbyjLjj2VZxk8K/Kzbcn7nzd72+Q+XWU+zKC9LdbBNfkWdBzMFDtcDi/OaFd4kABiPi2M8A/R6CGOlZjHKo+8HxccgXlLps/Wzdy6k1zwSGLIVasCmM= Received: from SN1PR0701CA0050.namprd07.prod.outlook.com (10.163.126.18) by BLUPR0701MB2036.namprd07.prod.outlook.com (10.163.122.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1341.17; Thu, 10 Aug 2017 13:32:22 +0000 Received: from BY2FFO11FD006.protection.gbl (2a01:111:f400:7c0c::120) by SN1PR0701CA0050.outlook.office365.com (2a01:111:e400:52fd::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1341.17 via Frontend Transport; Thu, 10 Aug 2017 13:32:22 +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 BY2FFO11FD006.mail.protection.outlook.com (10.1.14.127) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.1304.16 via Frontend Transport; Thu, 10 Aug 2017 13:32:22 +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; Thu, 10 Aug 2017 06:32:21 -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 v7ADWL66031516; Thu, 10 Aug 2017 06:32:21 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id v7ADWHSn031515; Thu, 10 Aug 2017 06:32:17 -0700 From: Manish Rangankar To: , , CC: , Subject: [PATCH] qedi: Limit number for CQ queues. Date: Thu, 10 Aug 2017 06:32:17 -0700 Message-ID: <20170810133217.31481-1-manish.rangankar@cavium.com> X-Mailer: git-send-email 2.12.0 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)(39410400002)(39850400002)(39400400002)(39450400003)(39840400002)(2980300002)(428002)(189002)(199003)(107886003)(48376002)(38730400002)(54906002)(1076002)(106466001)(47776003)(50466002)(72206003)(105586002)(8676002)(86362001)(5660300001)(50226002)(189998001)(87636003)(36756003)(80596001)(305945005)(2201001)(356003)(626005)(478600001)(2906002)(50986999)(4326008)(42186005)(69596002)(101416001)(33646002)(81156014)(81166006)(8936002)(5003940100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB2036; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; PTR:50-232-66-26-static.hfc.comcastbusiness.net; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD006; 1:Vu0cyuO+tbFYXg7sADDDoKZseslG4/rPkmcWPPpeGR1Rhjym+ARCPtzpZ3gLyijOK6SLpwUplFkMtmFyzJC4DDvtA2povRH/5G2qaOLsqjvYbDkUCssCRoMH4+PjlUFqi9lCdUDxLF4FBcqI7eHRFvgSG4olRf41B/f9jkyanKQBONi5zmwkjnTe+Zusum+TPhGdEPetaDRgL4iwHYlxu2UMFw965wuhmmneMJ9N3zusW1JgBEuL8giEOQgptgFDhxL+KvhLKBySrHOEVSSETkqzKLo9Kqtq+NMp9T+4NiGNs5an/q44d7UY3f1UP2Yim0egySXpv332UbdpTzCWEYa+KcQmqwuaZzlhuZsCOsCGvDKYuNzPYJO9tSfRzboHq9JWQcpHKkyq85ntCEB9f/QU899pWzEf/j19EKDR025NtBFfRGvy7onVj/jVDBUyj7gO75KtXEthRpbyJ3+FulSuxacCaC/53Mx7XVOi8ppgrxGU9BM4hRHgMlp+2zDE9mglgC8vPAnZ9ovBaapCft7bbPjilKyibN8ReKxkm9n6n14Ep7LfF1/+/GacVp31L8H43atajIH2tiq3lFUqbd/GzQdNxbRWyz5QAvspdKojh99EyG2SSefVUGkvSYxtSXH14AdCdGfnraBXRuZPeDJobbulhTPdFr4nZYOy+h9pEpcc0Sx4TVETBPj5Gij2wAHMe6O43M4TM/WR8v8taL2Gf+8DoKVByoFHENQM41ggEEA6V8AokhnaPtBDQ924wEHF+nz7WT/ilx3jBf+0OY9dSMfWUAi14csBYTZEzGU= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a9684396-0e78-4a12-c1f1-08d4dff43b3c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BLUPR0701MB2036; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2036; 3:eZoOmtJyTXUUVmXEsZVLkHtJrk7s3xtLBrbc7X4JPXmah+8HhGuBR5LeAB+Vxab1O6yDB3m/m1zbz/159+Np33bGN2jZn27zxPKvsGEwhrY+7CoIdywzplK0TsHAFFz0K/JWs+T7YsRIMOuLkebvVApaOdXaDdTUlVCC3dSSUpe79ryI6HUuW3E2wiyF3E5A/aRlWLejGMLdh6s/jOb0pNeqVa1A3ELpx3ScUXm4ZlqrZf8jwBm16a99fXnD1bH3bp94W9TTDpb55rdcjDAa0edj5wlMvIxoEeyO8G8m9AhPVcNCbuzSOm2UP822UBTeg2YBF4YQKN+e0s4/oupOZw==; 25:nX9liGAT7/RE8DZ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NzOsR835sfwKwYr1Ot1OER0vsLlHF59rw3XI+4zfcA67L4PW+Mj+QaBc1+XaV8/aRr1D4Avm; 4:7DYvOO80v6gpg0+/2HlbWAQPL1BQKRubYmQNzeSPlRnlZxB6s3f/iwWWl565JvuDIH1g+iDo06wu8ExGjTiCLg6Fj09aZavu5ZRj5aSVKWjCFaZ0naEnUCbWhTEqneqb9wR/Ze+cx2vBAHYU+DIiZ/LSGKA9AMV32+KLfc9G3tQMOOL5u03oqSTUZTnDYMZwYp2GPBF+EOVUYLAH3O5k9snr9xKjqvrL0bOWTpr8WBcG9wkIEnFbg6bf0ufAbrDd 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)(601004)(2401047)(8121501046)(13016025)(13018025)(5005006)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6041248)(20161123560025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR0701MB2036; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR0701MB2036; X-Forefront-PRVS: 03950F25EC X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB2036; 23:Ae8GSPhR/laxZGCXZUCBpmjlGWA8dVOViIezX8O?= =?us-ascii?Q?lL1IB9gP4Vb31kiG4sjUk9Vehewmbpq88jPyMvVSAnKLBsdx+PspV7ZlT3n1?= =?us-ascii?Q?3S6IHAbviR00/P4SaiRVP+0iZSJV2lN5bK7JT7ooFA4c0Nreos3Ur4hR8VjQ?= =?us-ascii?Q?GF3XKFK0NdTubAzF8fpBlipDsbTZBTktW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L/3vkhJqUIY3Ddp+ea0x1Ww39TqykntqTm82BHLrJw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2036; 6:A3QHalrISJ2XKkhz9qJ3K7F3+DRuSlG+bybWIcpdLRV0jYFTkiUhOrggkIatj9z/ILwSryLJclb6ZZPaP/iqwLKdL064lywWplO/7CcFwXWQJrPnOaQiWYdRmNiP7ekN9uK6NyonL2viiE0/zEvCZX6xg4fvL7WHghx6pUSOOJn11cLMynJ8hL4cGU28K0JfUoifrcWwdPfUHRbnVBVq7b+C369k1G/v3kQf3Xw89j0DYO35OGBEe+1NMdrSPMZvcT+5+9Beuhn8e0wfn/6YcRaBbiw/YY6CsBY8nbHRNdLyZv5Kv/SgkpdC5mznt+dtJOfJ4pWlq6NmzpngcYMp3g==; 5:H/nqPfgbnm3S4/tHipl1WJPmKTHH58Y3Q1YOwjFAi2usnhtRuY/t3A09JOM44lvuBwn+KP0ho6Imhir0JaFbCNpH7RuYDFEJAzOawF9ZEJxKIaKB+TF/LKTR3AFNKW0c3QGKKKFI/+/hmI2p2xtW9w==; 24:nALJZ2bZLqe1JzpVgOFKmkHYcYPrbVJE87lKkUD/g40UicbORVgLEYzbqh88+108xdIN1MBUuDk87uFXAHa490+PohOmSJHsG2h8WGloRX4=; 7:5f9rZ7HjPkVW6HKuFN3KHEC4YBGtvd4uabNixqkrwK/WyEiQZAoR4qR+ldTF9Ws7pjaGFJNw33tKdOPhlVIq44M61+ip/ZlVrhDJmo+OtvwQ3vOFfAZYY64XzT1XGx3+vvbHQCcZRpJU0Hl1wPKsn8ldjjptHHD88Xrg4UFGSlPnW9e94aY/6AP0eJ4VMilw+TPc9nQD9G14pr23fyY2xwCH3qGHCPh1TtITP7iN+7M= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2017 13:32:22.2750 (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: BLUPR0701MB2036 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 [qed_sp_iscsi_func_start:189(host_7-0)]Cannot satisfy CQ amount. Queues requested 8, CQs available 4. Aborting function start Above condition will resolve as management firmware is capable of telling us the number of CQs available for a given PF, qed will communicate the same number to qedi, So that qedi will know how much CQs are allowed. Signed-off-by: Manish Rangankar --- drivers/scsi/qedi/qedi.h | 5 ++--- drivers/scsi/qedi/qedi_iscsi.c | 2 +- drivers/scsi/qedi/qedi_main.c | 10 +++++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/qedi/qedi.h b/drivers/scsi/qedi/qedi.h index 91d2f51..b8b22ce 100644 --- a/drivers/scsi/qedi/qedi.h +++ b/drivers/scsi/qedi/qedi.h @@ -54,8 +54,8 @@ /* MAX Length for cached SGL */ #define MAX_SGLEN_FOR_CACHESGL ((1U << 16) - 1) -#define MAX_NUM_MSIX_PF 8 -#define MIN_NUM_CPUS_MSIX(x) min((x)->msix_count, num_online_cpus()) +#define MIN_NUM_CPUS_MSIX(x) min_t(u32, x->dev_info.num_cqs, \ + num_online_cpus()) #define QEDI_LOCAL_PORT_MIN 60000 #define QEDI_LOCAL_PORT_MAX 61024 @@ -301,7 +301,6 @@ struct qedi_ctx { u16 bdq_prod_idx; u16 rq_num_entries; - u32 msix_count; u32 max_sqes; u8 num_queues; u32 max_active_conns; diff --git a/drivers/scsi/qedi/qedi_iscsi.c b/drivers/scsi/qedi/qedi_iscsi.c index 37da9a8..a02b34e 100644 --- a/drivers/scsi/qedi/qedi_iscsi.c +++ b/drivers/scsi/qedi/qedi_iscsi.c @@ -534,7 +534,7 @@ static int qedi_iscsi_offload_conn(struct qedi_endpoint *qedi_ep) SET_FIELD(conn_info->tcp_flags, TCP_OFFLOAD_PARAMS_DA_CNT_EN, 1); SET_FIELD(conn_info->tcp_flags, TCP_OFFLOAD_PARAMS_KA_EN, 1); - conn_info->default_cq = (qedi_ep->fw_cid % 8); + conn_info->default_cq = (qedi_ep->fw_cid % qedi->num_queues); conn_info->ka_max_probe_cnt = DEF_KA_MAX_PROBE_COUNT; conn_info->dup_ack_theshold = 3; diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c index 2c37836..c4a470b 100644 --- a/drivers/scsi/qedi/qedi_main.c +++ b/drivers/scsi/qedi/qedi_main.c @@ -794,13 +794,14 @@ static int qedi_set_iscsi_pf_param(struct qedi_ctx *qedi) u32 log_page_size; int rval = 0; - QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_DISC, "Min number of MSIX %d\n", - MIN_NUM_CPUS_MSIX(qedi)); num_sq_pages = (MAX_OUSTANDING_TASKS_PER_CON * 8) / PAGE_SIZE; qedi->num_queues = MIN_NUM_CPUS_MSIX(qedi); + QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_INFO, + "Number of CQ count is %d\n", qedi->num_queues); + memset(&qedi->pf_params.iscsi_pf_params, 0, sizeof(qedi->pf_params.iscsi_pf_params)); @@ -2179,9 +2180,12 @@ static int __qedi_probe(struct pci_dev *pdev, int mode) goto free_host; } - qedi->msix_count = MAX_NUM_MSIX_PF; atomic_set(&qedi->link_state, QEDI_LINK_DOWN); + rc = qedi_ops->fill_dev_info(qedi->cdev, &qedi->dev_info); + if (rc) + goto free_host; + if (mode != QEDI_MODE_RECOVERY) { rc = qedi_set_iscsi_pf_param(qedi); if (rc) {