From patchwork Tue Dec 6 17:09:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 9462941 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 1A2B760231 for ; Tue, 6 Dec 2016 17:10:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04B5028480 for ; Tue, 6 Dec 2016 17:10:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EDBFD28484; Tue, 6 Dec 2016 17:10:22 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 A19662843B for ; Tue, 6 Dec 2016 17:10:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753757AbcLFRKM (ORCPT ); Tue, 6 Dec 2016 12:10:12 -0500 Received: from mail-pg0-f47.google.com ([74.125.83.47]:33898 "EHLO mail-pg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752162AbcLFRKG (ORCPT ); Tue, 6 Dec 2016 12:10:06 -0500 Received: by mail-pg0-f47.google.com with SMTP id x23so151275114pgx.1 for ; Tue, 06 Dec 2016 09:10:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7E7MH5PxvwYVVmiot/LfbmpVGKl+yMZs3xlzEY5icD8=; b=CFgyhdILb3djPD3DhKiHh04QNS5TM0H2LYl5o5m76iI8FhP1jVwJ1DZBZX/8Dpwn9J 0whpptY9egC6s4OEtcsmjpxamKUR6GXReC0N5PEDHFfQg1TuEki1DHfKPeb/xEoxYOgx Tmrf9kRnM78OjsJmi7GIASsikzoq9TfMtoqCg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7E7MH5PxvwYVVmiot/LfbmpVGKl+yMZs3xlzEY5icD8=; b=iCsEMWvhoOehJaM6qHaBxNFc3F/YSCa6PSImZ6PQI+NhkBc0usbfIZ8bHdekl+tySS k/0c2Dj0Q66lCEYqsHwhzxADyJeU+gAJGhz3L+RiMps1gGhjZEYlNXWMjO50H7CxNUFn fZj3WaYcDgfi3ddJKs3vHStIcvdGLO/QKRsGmet91bdxBxhHkP0MJUelu3X4kae1B2qk gsyxq7pMwpzrIz748feniCjWn8hf1qZnLQYOgrPqTaX7i1E6f1z0/CsphvtnkaszCssN fCvIkYyA+VEVyjzYL0aBAQgLUTQ61EuI8tHR/Jcjw200k/t61EsLaLLQd3D9GDZ/TLyd 3TcA== X-Gm-Message-State: AKaTC01mG3cO2CzmHTOtCTJkEvWcv2wD7fam4cfq965FhlGMQ7xu9Q+Wb3Kh352kjvzupwxw X-Received: by 10.84.128.78 with SMTP id 72mr138217155pla.110.1481044205345; Tue, 06 Dec 2016 09:10:05 -0800 (PST) Received: from localhost.broadcom.com ([192.19.255.250]) by smtp.gmail.com with ESMTPSA id v77sm36100804pfa.85.2016.12.06.09.10.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Dec 2016 09:10:04 -0800 (PST) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, selvin.xavier@broadcom.com, somnath.kotur@broadcom.com, dledford@redhat.com, linux-rdma@vger.kernel.org Subject: [PATCH net-next 1/7] bnxt_en: Add bnxt_set_max_func_irqs(). Date: Tue, 6 Dec 2016 12:09:32 -0500 Message-Id: <1481044178-25193-2-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1481044178-25193-1-git-send-email-michael.chan@broadcom.com> References: <1481044178-25193-1-git-send-email-michael.chan@broadcom.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP By refactoring existing code into this new function. The new function will be used in subsequent patches. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 17 +++++++++++------ drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 + 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index e8ab5fd..6cdfe3e 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -4743,6 +4743,16 @@ static int bnxt_trim_rings(struct bnxt *bp, int *rx, int *tx, int max, return 0; } +void bnxt_set_max_func_irqs(struct bnxt *bp, unsigned int max_irqs) +{ + if (BNXT_PF(bp)) + bp->pf.max_irqs = max_irqs; +#if defined(CONFIG_BNXT_SRIOV) + else + bp->vf.max_irqs = max_irqs; +#endif +} + static int bnxt_setup_msix(struct bnxt *bp) { struct msix_entry *msix_ent; @@ -6949,12 +6959,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) bnxt_set_tpa_flags(bp); bnxt_set_ring_params(bp); - if (BNXT_PF(bp)) - bp->pf.max_irqs = max_irqs; -#if defined(CONFIG_BNXT_SRIOV) - else - bp->vf.max_irqs = max_irqs; -#endif + bnxt_set_max_func_irqs(bp, max_irqs); bnxt_set_dflt_rings(bp); /* Default RSS hash cfg. */ diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h index b4abc1b..8327d0d 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h @@ -1235,6 +1235,7 @@ static inline void bnxt_disable_poll(struct bnxt_napi *bnapi) int hwrm_send_message_silent(struct bnxt *, void *, u32, int); int bnxt_hwrm_set_coal(struct bnxt *); int bnxt_hwrm_func_qcaps(struct bnxt *); +void bnxt_set_max_func_irqs(struct bnxt *bp, unsigned int max); void bnxt_tx_disable(struct bnxt *bp); void bnxt_tx_enable(struct bnxt *bp); int bnxt_hwrm_set_pause(struct bnxt *);