Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753100AbcJMJLz (ORCPT ); Thu, 13 Oct 2016 05:11:55 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:65059 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751529AbcJMJLn (ORCPT ); Thu, 13 Oct 2016 05:11:43 -0400 From: Arnd Bergmann To: "Mintz, Yuval" 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 Date: Thu, 13 Oct 2016 11:09:36 +0200 Message-ID: <6935319.6Adbod0g1H@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: References: <20161012103340.978726-1-arnd@arndb.de> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:0bhzcGNMe2lMDmV5V9rGJFiBCaNE+LO+IKiAkqzCdqtyeTbQa5w Eu4tFCW++KWKJXCr/LqovpVqfKf3DGp9bHhm5oYEsFsuZTRkSvNj9UKNeBo8tl/GQSoCcKs Pf7IeGE8VrFfUYDHJ5DAbw8gwUko0g1j+7CsinuDXIOi20dDHWhUXb9neXocSR8YEWSzvKy YQoq8StBeGHibhukWMkOQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:0JImICIkXSs=:meCxQ643L9N5ct3bZMvHJA 9ydsyeDiXPIEtd0WT+mN/l6inQC/XGLB1Q/frfGbqifvxNr9vj3Ieqlh+u2MylWgxuS9zqx10 G3NWRDn1+NDMUodSh8ZP9Csq1mb2EuJVaLRq7VPneVKUsmb1bA5AyQAQNAWcVt1kK4+Aci9qO RJzSHchozUzAZGJAq7ZUwwVUx7RwKZXOtOioIMXKpQn+YJJNUR2SaWIxx8bgtUB6/kKI0ttHi YfpEoUjsF6HS1Z9CWQxHUhkoQyco9o0ebzfvEbbyoY0S8Wx2/iMQJjJT680XLxAkbhOrSusdv DzjSHZpwoF1BKlxGfpeH8qilw5oFyrGVbdwtaVSH9j8qZxeIKmJNza0PYaQzAAfnexl1ZkLqN /nRQSOCxCAyx2yzAt6rmK/APSxwdyc3ObsSbAKs4bLKqmRBID855ANZ66BDY4XdyiQWeWh/dK rbAO8PqDDA7We/Hx3avUzJDZrPXD+KTkFUwA7YqhnPVethPgs7oBF9K9HYNF94MGH4BfjkFhh zP0crDUz5NkypzxzmKY1JgpJgFovyYJA1YZhChiM2jTX7ShsHf3/VCcOrowJQhaS31DoXVYrY zkVDF927h5SaLAleHv2+8+J4OWHRC9Y5xgfwDVT7iB1wrDMnZPP11+7qcA46/rav2/5xuscaI 1N2OeYeRp6JXjhWMpsUCDlSBs05faCtacaq6riNTa2XYxl258c99Y6s79llWm5u7BAdTYJgmi INL8bAfuOaBFlphS Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2876 Lines: 75 On Thursday, October 13, 2016 8:50:21 AM CEST Mintz, Yuval wrote: > > 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]? I haven't seen that submission, I just looked at the current state in linux-next. If we want this to be a separately loadable module, that seems fine too, but then we should fix the Makefile to do that, and add the necessary Kconfig magic to ensure that INFINIBAND_QED cannot be built-in when INFINIBAND_QEDR=m. > > - 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. > > -#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. No, it's purely cosmetic. Moving the comment inside of the if() block seems fine, I just didn't want to touch that as it was unrelated. > > -#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. Arnd