Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753150AbcJMJhQ (ORCPT ); Thu, 13 Oct 2016 05:37:16 -0400 Received: from mail-by2nam01on0048.outbound.protection.outlook.com ([104.47.34.48]:10400 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752863AbcJMJhG (ORCPT ); Thu, 13 Oct 2016 05:37:06 -0400 X-Greylist: delayed 713 seconds by postgrey-1.27 at vger.kernel.org; Thu, 13 Oct 2016 05:36:30 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: AQHSJHQqXc7bagFKAk28OJoEFUReSaCmEcpwgAAIVwCAAARmgA== Date: Thu, 13 Oct 2016 09:34:41 +0000 Message-ID: References: <20161012103340.978726-1-arnd@arndb.de> <6935319.6Adbod0g1H@wuerfel> In-Reply-To: <6935319.6Adbod0g1H@wuerfel> 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: 69e38cfe-9b59-458d-1d31-08d3f34c28a1 x-microsoft-exchange-diagnostics: 1;BN4PR07MB2196;6:iodzDiM+UBF569DhjuWPIErJjCZSeXOSpzvFuUhco0zQFI5uzJa0vIBvwkhCz2jgPqWGfulkpHNZqWOSaG/obmh7YiNDXrN2WhUY7nIZ3yAlDUPjF6QOkCiiJKwdmDAIjWVueo7YS9cIFkv26VAeNZ4+5PoVVGPpGFtrmo2T1Cp2Fq+MJxvnhnOSqpeGlxNyNgozunVjBPQ2fhz7EIGtnyupzXJj6xWaO/0iJEt937iN1kq9J9+29DF76PbFRzPW7bz3s+U9lWRYV5797bXENfOPqJ6z/9/y7c+lK1obyUea7rxbb2OCRI2Q7debMCZD;5:ZkpBpy7xxHry1H7nOVEGBbgpQflYP3GJouq5xB1y9Lwi/grwG2nKMouuPhvLmRBWY/vjxsFjB0wO6ASHktG2Poy/4hwyGn7HXLCoqeL0/2wKA483TWm3J7Af71RzvcRQJglcugKXhUzzvv9w/47JXg==;24:YLKvD7XpcIS3gWuufwEZNdTUqk2XmCMG4p3Zefoy5SEDWZqXY/V6gkyJDQqHdM/8Q6cLZbi0cN6es3Zd0IQRDfKk/CVhDMRXSp10ri9F/BQ=;7:3sjO4iXMSYLoBsHkvyVjD4uI0/HaD1R24030dPM9F+mh371g3+9Wzikk1okD54pFWLAWunwR17eCyl9kzrr5Gs0yKcqNyu/bskVQo68s1xmNtVyMg9WXOir8ErTAJlb9SiPGOADZOwNYBob8963oxJ7TPw1bR1tTCaMlxM/8+rKkcn3rZRsN4zaf0r+B/cs6o0wtNdVLo2HMEPukvmnY9ofaCYPQ/B6r6f6/c2eZQcSHk/PMloHCrLvfB7Oaf8qLuHej34VoQPY3896XcLHMnur6dHzW3Y7PADdLIY9u8u4K2+TRFKWNdkOqSITZ4uqgbd8LVVTRgPrFo4szDRYgZIELYos2E9f+RsO9IlsDoNs= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN4PR07MB2196; 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)(10201501046)(3002001);SRVR:BN4PR07MB2196;BCL:0;PCL:0;RULEID:;SRVR:BN4PR07MB2196; x-forefront-prvs: 0094E3478A x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(189002)(199003)(110136003)(3846002)(76176999)(7736002)(54356999)(66066001)(6116002)(3280700002)(92566002)(76576001)(7696004)(50986999)(8936002)(102836003)(6916009)(77096005)(586003)(5660300001)(9686002)(7846002)(305945005)(101416001)(4326007)(122556002)(2950100002)(74316002)(33656002)(2906002)(2900100001)(81166006)(106356001)(10400500002)(81156014)(105586002)(87936001)(189998001)(106116001)(97736004)(5002640100001)(8676002)(68736007)(86362001)(99286002)(3660700001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN4PR07MB2196;H:BY2PR07MB2309.namprd07.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A: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 09:34:41.2111 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN4PR07MB2196 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 u9D9bMNB017412 Content-Length: 2099 Lines: 54 > > > - 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? > > Mainly for consistency: we have a couple of interfaces that are called from the > qed driver that are implemented in qed_roce.c. We can either use a 'static inline' > helper for all of them, or use if(IS_ENABLED()) everywhere. Since this was the > only function that had a helper and that helper was defined incorrectly, I went > with the second option. Actually, that's not the case. I think with this exception, all the rest of the prototypes in qed_roce.h aren't really needed, as those functions should only be accessed via the qed_rdma_ops. I'll remove those later [or we can remove them as part of v2]. The genereal qed* preference is to have empty static-inline implementations in case content is compiled-out [Look at iov for example]. > > > -#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] > > That would add even more #ifdefs though. I agree. Although I'm never clear on the guidelines for the tradeoff - How much memory/code is considered too much so that you'd have To ifdef code out instead of 'wasting'? [I obviously don't claim 64 bytes of memory hit that threshold] BTW, are you interested in doing a v2 for this? Or would you prefer if we'd pick it up from here? Thanks, Yuval