Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755047AbcJMMZr (ORCPT ); Thu, 13 Oct 2016 08:25:47 -0400 Received: from mail-sn1nam02on0062.outbound.protection.outlook.com ([104.47.36.62]:33440 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753329AbcJMMZi (ORCPT ); Thu, 13 Oct 2016 08:25:38 -0400 X-Greylist: delayed 3563 seconds by postgrey-1.27 at vger.kernel.org; Thu, 13 Oct 2016 08:25:38 EDT From: "Mintz, Yuval" To: Arnd Bergmann CC: Ariel Elior , "everest-linux-l2@qlogic.com" , Alexander Duyck , "Amrani, Ram" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "David S. Miller" Subject: RE: [PATCH] qede: fix CONFIG_INFINIBAND_QEDR=m build error Thread-Topic: [PATCH] qede: fix CONFIG_INFINIBAND_QEDR=m build error Thread-Index: AQHSJHQqXc7bagFKAk28OJoEFUReSaCmEcpw Date: Thu, 13 Oct 2016 08:50:21 +0000 Message-ID: References: <20161012103340.978726-1-arnd@arndb.de> In-Reply-To: <20161012103340.978726-1-arnd@arndb.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Yuval.Mintz@cavium.com; x-originating-ip: [31.168.140.228] x-ms-office365-filtering-correlation-id: a106f5e6-e7c9-446b-e2b6-08d3f345f771 x-microsoft-exchange-diagnostics: 1;CY1PR07MB2200;6:JIEV6+75HFRjlT1sNwORifRVCnFz61FMsTOntJ3QOVkhJJLfSVlR55t/adB5wEuO384VS41eiqcqredwCORkn9QRmpfqxwEnBUXSBNsseFseRGFRw24t648Co9z8cE7kAdZkdI4E8xS3IlxY1JwZ9nX+bzmxZK9urYuXIVSuPmhtQgpXq+v50h2UFC5INmSyBKfHz52aH+CLl/cyAWQyESUgTcdTF1rZoW3QEqD/dR9ZhZkEfQJiMKbe3tJyVgm/z4bVB56IX6skHxbO8O01A3gsFk2Q6M7uy1k1aPzN6M0cL5PbUf2XXxLo7CXn3kuR;5:OflKSArsToPTj+ZbUGqg8eHtPxfXM5C9U2uKJQfNmXwVCsnWNq5g7kZqDfR54L0/0gzDyEm3QaCKkBs/OvgFWbAmLl2aUzd3KU69F3nMpUQqfufY1AmwCwkYzEHN+vG91qKKof5IOrJ3SiQKyc07aA==;24:OXZXPx3UAPSgBdzKbNn6Qy3PKn4LuIWzwK9HcpeKyD/MzE9cUu/u5VjzTp/BvYs/RCNME5xs4yndNcXm5Nq5hiFzMwy9YsyEV2UhX/ysowA=;7:Ew0OEo2sJ6SfSdUhPZDXO+6lHUb5wSSHv7i1xwaaIs8ZjWj7VIq5qEwu6uJTYiQFn6bw+/SDVAHuyOI8akhwujeC4Ha2cBTz0SgXzTsLKSk6c77v5Bx8k+uMOGm0J6ZF1Rp9CI80i3duCK9Dd9pe3GfbsH+IPLrNypveXLgdpNo6CsEI3FJrWItuJ83JXz2Wop+HucWn+m9OPri1MftaD8umN6IwxRmhxsV39/G6260fWt9wDx/XjsiA5V8w9fcbvRUQfHX4SGkBGN8MxUjQQlmiOVBoGAH7V5HIWGwdlDgo4vMqoLC3yYiUy4iskX42HTUSnYzt9tUN0FGeOEXZfk/fkNH297Y1ee8DvTqUlpk= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR07MB2200; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046);SRVR:CY1PR07MB2200;BCL:0;PCL:0;RULEID:;SRVR:CY1PR07MB2200; x-forefront-prvs: 0094E3478A x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(199003)(189002)(92566002)(110136003)(66066001)(10400500002)(2900100001)(5002640100001)(3280700002)(68736007)(189998001)(8936002)(87936001)(3660700001)(9686002)(2950100002)(6916009)(122556002)(5660300001)(7696004)(76576001)(33656002)(106116001)(99286002)(7736002)(105586002)(305945005)(77096005)(50986999)(106356001)(54356999)(76176999)(86362001)(102836003)(6116002)(586003)(101416001)(81156014)(74316002)(3846002)(8676002)(97736004)(81166006)(2906002)(7846002)(4326007);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR07MB2200;H:BL2PR07MB2306.namprd07.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Oct 2016 08:50:21.6968 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2200 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id u9DCPqId018168 Content-Length: 3132 Lines: 92 > config INFINIBAND_QEDR > - tristate "QLogic qede RoCE sources [debug]" > + bool "QLogic qede RoCE sources [debug]" Given that the qedr submission is going to turn this back into a tristate, are you certain this is a good thing [from compilation coverage perspective]? > - if (cond) > + if (IS_ENABLED(CONFIG_INFINIBAND_QEDR) && cond) > qed_rdma_dpm_bar(p_hwfn, p_ptt); Why not simply fix the qed_roce.h empty implementation? > -#if IS_ENABLED(CONFIG_INFINIBAND_QEDR) > /* Roce CNQ each requires: 1 status block + 1 CNQ. We divide the > * status blocks equally between L2 / RoCE but with consideration as > * to how many l2 queues / cnqs we have > */ > - if (p_hwfn->hw_info.personality == QED_PCI_ETH_ROCE) { > + if (IS_ENABLED(CONFIG_INFINIBAND_QEDR) && > + p_hwfn->hw_info.personality == QED_PCI_ETH_ROCE) { > num_features++; > > feat_num[QED_RDMA_CNQ] = > min_t(u32, RESC_NUM(p_hwfn, QED_SB) / > num_features, > RESC_NUM(p_hwfn, QED_RDMA_CNQ_RAM)); > } > -#endif Is there any non-cosmetic gain here? I would gain that having the comment under the #ifdef is more meaningful than having the check in the actual condition. > -#if IS_ENABLED(CONFIG_INFINIBAND_QEDR) > + if (!IS_ENABLED(CONFIG_INFINIBAND_QEDR)) > + return 0; > + > num_l2_queues = 0; > for_each_hwfn(cdev, i) > num_l2_queues += FEAT_NUM(&cdev->hwfns[i], > QED_PF_L2_QUE); @@ -738,7 +736,6 @@ static int > qed_slowpath_setup_int(struct qed_dev *cdev, > DP_VERBOSE(cdev, QED_MSG_RDMA, "roce_msix_cnt=%d > roce_msix_base=%d\n", > cdev->int_params.rdma_msix_cnt, > cdev->int_params.rdma_msix_base); > -#endif While I don't mind, you could have argued is that we're not removing enough, not too much. I.e., perhaps the rdma_msix_* fields should also have been ifdef-ed instead. [in which case this solution would not have worked] > -#if IS_ENABLED(CONFIG_INFINIBAND_QEDR) > - params->rdma_pf_params.num_qps = QED_ROCE_QPS; > - params->rdma_pf_params.min_dpis = QED_ROCE_DPIS; > - /* divide by 3 the MRs to avoid MF ILT overflow */ > - params->rdma_pf_params.num_mrs = RDMA_MAX_TIDS; > - params->rdma_pf_params.gl_pi = QED_ROCE_PROTOCOL_INDEX; > -#endif > + if (IS_ENABLED(CONFIG_INFINIBAND_QEDR)) { > + params->rdma_pf_params.num_qps = QED_ROCE_QPS; > + params->rdma_pf_params.min_dpis = QED_ROCE_DPIS; > + /* divide by 3 the MRs to avoid MF ILT overflow */ > + params->rdma_pf_params.num_mrs = RDMA_MAX_TIDS; > + params->rdma_pf_params.gl_pi = > QED_ROCE_PROTOCOL_INDEX; > + } Likewise > -#if IS_ENABLED(CONFIG_INFINIBAND_QEDR) > - case PROTOCOLID_ROCE: > - qed_async_roce_event(p_hwfn, p_eqe); > - return 0; > -#endif > case PROTOCOLID_COMMON: > return qed_sriov_eqe_event(p_hwfn, > p_eqe->opcode, > p_eqe->echo, &p_eqe->data); > + case PROTOCOLID_ROCE: > + if (IS_ENABLED(CONFIG_INFINIBAND_QEDR)) { > + qed_async_roce_event(p_hwfn, p_eqe); > + return 0; > + } > + /* fallthrough */ Not sure whether it helps readability; It might give the false Impression that it's possible to receive an async roce event if roce is compiled-out, which isn't the case.