From patchwork Sun Mar 8 22:45:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 222845 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37A6FC10DCE for ; Sun, 8 Mar 2020 22:46:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0ADAD2083E for ; Sun, 8 Mar 2020 22:46:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="KBh0urzv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726467AbgCHWqO (ORCPT ); Sun, 8 Mar 2020 18:46:14 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:32837 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726332AbgCHWqN (ORCPT ); Sun, 8 Mar 2020 18:46:13 -0400 Received: by mail-pg1-f193.google.com with SMTP id m5so3846112pgg.0 for ; Sun, 08 Mar 2020 15:46:12 -0700 (PDT) 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=a1VIuOcE2zPGBsUhFsZ6s3lMMsGSnpI8RoJUaMMeLO0=; b=KBh0urzvujpmrbh/Hca1B16XxXt2b8j9e86tsQksJvq++eNPmLw1ulGn2Lz7QVFaxt OBXpWf1tiRdyQIaaKZ6C2S1l/NLL7Zu0RFfcGfpNVFG/VB4sfPQEZ16f/KC4fnxT0/xg nB5cNIxHuBp6AuPrF6CQqIq5CP0Zh7mKeDT74= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=a1VIuOcE2zPGBsUhFsZ6s3lMMsGSnpI8RoJUaMMeLO0=; b=JKRNgp6IS6rZ7SsGkfjPz7DJHDJzL2sgO64K/2CJCjiZ3XSh/DY/B4/4DaViorM9cH EF3DlDEyOWvneXAwITEv2RGJ8PFf1Q+UsmzJp88XESW3V5P9GbOEIw6pLHYyWsftsNKb yMxDC9fpgH2BeTi+RUZE2zWLv8M0Az4ZntUrTyTLNZHWAhCVvefS61WcU1iG5ih6j6KN yNntprsDm93VM2wI8bSKqW8Tj2XWAOWtTIxuwN99ogk+a9t2vF6Ni1YiJ8cEKOQh/8RJ u+bdB069hIcO9xPEJ3vrWbgtUG9UftAWoHuNVuCvX0V4Gq9W1M4/qR4VvMBwKDMU0ztj BwHA== X-Gm-Message-State: ANhLgQ1Yb9e+YSK45dFqzpFLePrPbJVBkhlexJIHz/UOLCiUtEcmgeBY U5XbP2NNHeZTh/ngUPvON9DkhQ== X-Google-Smtp-Source: ADFU+vuUng19IZI9LiE3w4eCzcFMOgI0uKUjnaeX/CyVGrcP0G71GhF7m7TzpswdonNu5DqUVkhB1Q== X-Received: by 2002:a65:420b:: with SMTP id c11mr12935802pgq.297.1583707572374; Sun, 08 Mar 2020 15:46:12 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.com ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x66sm31241397pgb.9.2020.03.08.15.46.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Mar 2020 15:46:11 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org Subject: [PATCH net-next 2/8] bnxt_en: Simplify __bnxt_poll_cqs_done(). Date: Sun, 8 Mar 2020 18:45:48 -0400 Message-Id: <1583707554-1163-3-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1583707554-1163-1-git-send-email-michael.chan@broadcom.com> References: <1583707554-1163-1-git-send-email-michael.chan@broadcom.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Simplify the function by removing tha 'all' parameter. In the current code, the caller has to specify whether to update/arm both completion rings with the 'all' parameter. Instead of this, we can just update/arm all the completion rings that have been polled. By setting cpr->had_work_done earlier in __bnxt_poll_work(), we know which completion ring has been polled and can just update/arm all the completion rings with cpr->had_work_done set. This simplifies the function with one less parameter and works just as well. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 0b1af02..6b4f8d8 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -2162,6 +2162,7 @@ static int __bnxt_poll_work(struct bnxt *bp, struct bnxt_cp_ring_info *cpr, struct tx_cmp *txcmp; cpr->has_more_work = 0; + cpr->had_work_done = 1; while (1) { int rc; @@ -2175,7 +2176,6 @@ static int __bnxt_poll_work(struct bnxt *bp, struct bnxt_cp_ring_info *cpr, * reading any further. */ dma_rmb(); - cpr->had_work_done = 1; if (TX_CMP_TYPE(txcmp) == CMP_TYPE_TX_L2_CMP) { tx_pkts++; /* return full budget so NAPI will complete. */ @@ -2392,7 +2392,7 @@ static int __bnxt_poll_cqs(struct bnxt *bp, struct bnxt_napi *bnapi, int budget) } static void __bnxt_poll_cqs_done(struct bnxt *bp, struct bnxt_napi *bnapi, - u64 dbr_type, bool all) + u64 dbr_type) { struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; int i; @@ -2401,7 +2401,7 @@ static void __bnxt_poll_cqs_done(struct bnxt *bp, struct bnxt_napi *bnapi, struct bnxt_cp_ring_info *cpr2 = cpr->cp_ring_arr[i]; struct bnxt_db_info *db; - if (cpr2 && (all || cpr2->had_work_done)) { + if (cpr2 && cpr2->had_work_done) { db = &cpr2->cp_db; writeq(db->db_key64 | dbr_type | RING_CMP(cpr2->cp_raw_cons), db->doorbell); @@ -2425,10 +2425,10 @@ static int bnxt_poll_p5(struct napi_struct *napi, int budget) cpr->has_more_work = 0; work_done = __bnxt_poll_cqs(bp, bnapi, budget); if (cpr->has_more_work) { - __bnxt_poll_cqs_done(bp, bnapi, DBR_TYPE_CQ, false); + __bnxt_poll_cqs_done(bp, bnapi, DBR_TYPE_CQ); return work_done; } - __bnxt_poll_cqs_done(bp, bnapi, DBR_TYPE_CQ_ARMALL, true); + __bnxt_poll_cqs_done(bp, bnapi, DBR_TYPE_CQ_ARMALL); if (napi_complete_done(napi, work_done)) BNXT_DB_NQ_ARM_P5(&cpr->cp_db, cpr->cp_raw_cons); return work_done; @@ -2441,8 +2441,7 @@ static int bnxt_poll_p5(struct napi_struct *napi, int budget) if (cpr->has_more_work) break; - __bnxt_poll_cqs_done(bp, bnapi, DBR_TYPE_CQ_ARMALL, - false); + __bnxt_poll_cqs_done(bp, bnapi, DBR_TYPE_CQ_ARMALL); cpr->cp_raw_cons = raw_cons; if (napi_complete_done(napi, work_done)) BNXT_DB_NQ_ARM_P5(&cpr->cp_db, @@ -2468,7 +2467,7 @@ static int bnxt_poll_p5(struct napi_struct *napi, int budget) } raw_cons = NEXT_RAW_CMP(raw_cons); } - __bnxt_poll_cqs_done(bp, bnapi, DBR_TYPE_CQ, true); + __bnxt_poll_cqs_done(bp, bnapi, DBR_TYPE_CQ); cpr->cp_raw_cons = raw_cons; return work_done; } From patchwork Sun Mar 8 22:45:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 222844 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72772C10F28 for ; Sun, 8 Mar 2020 22:46:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3F46F20675 for ; Sun, 8 Mar 2020 22:46:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="ZUBkhBqg" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726491AbgCHWqS (ORCPT ); Sun, 8 Mar 2020 18:46:18 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:41166 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726480AbgCHWqR (ORCPT ); Sun, 8 Mar 2020 18:46:17 -0400 Received: by mail-pg1-f194.google.com with SMTP id b1so3826486pgm.8 for ; Sun, 08 Mar 2020 15:46:16 -0700 (PDT) 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=sIhLz3JqshierJBCPK3n6bnAOk/E9mLpFiyDts6FU0Y=; b=ZUBkhBqgBnO2XTup3rb5q99OJFU8+xKN1O0PZaaFNnBKVEoDSgurGH+njONR2rW6Gf JnYOenZlemca0LpLylAvRhN6BFksFPK83FG81Tr5gsVzcEkfWSPrZobeiVvCe5RFwn0I xlz/yNYqY0gsTrP7UTNS258l1H1w9EF7sGUkk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sIhLz3JqshierJBCPK3n6bnAOk/E9mLpFiyDts6FU0Y=; b=YJRnr8Xoe1AOVYQ8xINu2YDYe4W7ep1CFomrRArBjdaJ5YJXvPbp4XnXQrKg24FYXI UHOaFLIPS20no6+S9E5JqhfViyzleR5K7dZthJREBkJLIGtWjtLe6iyx0d+RFW+zGb7q nbxpVehFEBPAOhVW9jYh3+d12sQEruuMh5PeoTpyb8xZp6YlfUcPvyOlsTq7bjyTdIDy uQB+eTYvcGe3udxyQK8gQMwdjB810yqfPCUkX17gAsexcrQHDpb2156iwrZ0s2Ylh6oO namrjEXTjt0CLmmSvvb80BWNLwl4STKtEEfraMVn7tgO0QaKfPcsUflDy6KZ+eKgQHZa G+OA== X-Gm-Message-State: ANhLgQ3MaSjgVijvCeODgrh0jhDwJBQLuXejPWYQvyDWd7V8/5C92PYb HnActh/QXVxD8f4fYXFCJCeKlw== X-Google-Smtp-Source: ADFU+vsmf/8SGOASn9KcEHTNkoe1ori5kGb6LF8xLkZabSnpvEPZrJXm72SRMJicQcgzGitdkYmJRw== X-Received: by 2002:aa7:84c6:: with SMTP id x6mr13412022pfn.181.1583707576372; Sun, 08 Mar 2020 15:46:16 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.com ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x66sm31241397pgb.9.2020.03.08.15.46.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Mar 2020 15:46:15 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org Subject: [PATCH net-next 4/8] bnxt_en: Clear DCB settings after firmware reset. Date: Sun, 8 Mar 2020 18:45:50 -0400 Message-Id: <1583707554-1163-5-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1583707554-1163-1-git-send-email-michael.chan@broadcom.com> References: <1583707554-1163-1-git-send-email-michael.chan@broadcom.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The driver stores a copy of the DCB settings that have been applied to the firmware. After firmware reset, the firmware settings are gone and will revert back to default. Clear the driver's copy so that if there is a DCBNL request to get the settings, the driver will retrieve the current settings from the firmware. lldpad keeps the DCB settings in userspace and will re-apply the settings if it is running. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 634b1bd..500d4c8 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -8787,6 +8787,7 @@ static int bnxt_hwrm_if_change(struct bnxt *bp, bool up) bnxt_free_ctx_mem(bp); kfree(bp->ctx); bp->ctx = NULL; + bnxt_dcb_free(bp); rc = bnxt_fw_init_one(bp); if (rc) { set_bit(BNXT_STATE_ABORT_ERR, &bp->state); From patchwork Sun Mar 8 22:45:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 222843 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00600C10DCE for ; Sun, 8 Mar 2020 22:46:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CA9EE20675 for ; Sun, 8 Mar 2020 22:46:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="UTWxPiq+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726515AbgCHWqX (ORCPT ); Sun, 8 Mar 2020 18:46:23 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:40789 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726480AbgCHWqW (ORCPT ); Sun, 8 Mar 2020 18:46:22 -0400 Received: by mail-pl1-f194.google.com with SMTP id h11so11127plk.7 for ; Sun, 08 Mar 2020 15:46:21 -0700 (PDT) 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=DUia9G+5l+9JAHv39OQjncEP05LgQjt5zWj0oBoun4k=; b=UTWxPiq+VPzsgUxZwfFTMZI9fin+/5sJWqqAbRN0xoeCZyxxv00SoxC7UEQlEAOXep r2shzF5W1dO0Mwzgqhe4eiW22gEn6aJuK8a3fRsMVIoXfqvtvv0KjlrNmisBz4rWG+v0 /9rr/4F0fqnlUDy8h3mVkumrtoabYqnqR8Ybw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DUia9G+5l+9JAHv39OQjncEP05LgQjt5zWj0oBoun4k=; b=ckI9nlKw7iJ9u0MnV4TWAwvi9OU/wB9G+4FdC2a75jjHPetxwPL8c7pz3lKxtw0S0q Cn/E1LlhHWXc9P+4uUJklsZ99z0qSnc5Eqg3pl2mdds0iYCiWX/72lJWx3mnwubYMCIF XPKiwj8Hyz5bYwusSDnGhjcm1BDg/tWAWpbYDjQQF8lWYxOs5LS6y6ONhyADjW+1o+aM W3OB1BiAIF0Ku1GcFFbapDCUeuRekgoNbwp+5dTDFk7itH0ikYM9BGlqWkW1pvFMDdn+ esYFtq2Ls2BPf8OcqNNzzxsExKjzhL0zaXiqDe6LeLBGCewM4BEGECw5LVTSOjHmY3Ar 8NDg== X-Gm-Message-State: ANhLgQ1eQm6FdhTqeYIcq80VA9+wsC52/4JkVKCiKXlsMbEoFQOw0JqX bFQSfcJ3D2Z7OV2bgZji/b1y2r8XB2A= X-Google-Smtp-Source: ADFU+vvS+t37Z/XaUctZ9e1c4/VAtZR0zmbYgdN3DPNR6paKubSxrnZYyZo+q+/MWkc4dDtYIxXWEA== X-Received: by 2002:a17:90a:ba89:: with SMTP id t9mr14924443pjr.93.1583707581057; Sun, 08 Mar 2020 15:46:21 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.com ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x66sm31241397pgb.9.2020.03.08.15.46.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Mar 2020 15:46:20 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, Vasundhara Volam Subject: [PATCH net-next 6/8] bnxt_en: Modify some bnxt_hwrm_*_free() functions to void. Date: Sun, 8 Mar 2020 18:45:52 -0400 Message-Id: <1583707554-1163-7-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1583707554-1163-1-git-send-email-michael.chan@broadcom.com> References: <1583707554-1163-1-git-send-email-michael.chan@broadcom.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Vasundhara Volam Return code is not needed in some of these functions, as the return code from firmware message is ignored. Remove the unused rc variable and also convert functions to void. Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index b4a551a..e5da60a 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -5060,10 +5060,8 @@ int bnxt_hwrm_vnic_cfg(struct bnxt *bp, u16 vnic_id) return hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); } -static int bnxt_hwrm_vnic_free_one(struct bnxt *bp, u16 vnic_id) +static void bnxt_hwrm_vnic_free_one(struct bnxt *bp, u16 vnic_id) { - u32 rc = 0; - if (bp->vnic_info[vnic_id].fw_vnic_id != INVALID_HW_RING_ID) { struct hwrm_vnic_free_input req = {0}; @@ -5071,10 +5069,9 @@ static int bnxt_hwrm_vnic_free_one(struct bnxt *bp, u16 vnic_id) req.vnic_id = cpu_to_le32(bp->vnic_info[vnic_id].fw_vnic_id); - rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); + hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); bp->vnic_info[vnic_id].fw_vnic_id = INVALID_HW_RING_ID; } - return rc; } static void bnxt_hwrm_vnic_free(struct bnxt *bp) @@ -5191,14 +5188,13 @@ static int bnxt_hwrm_ring_grp_alloc(struct bnxt *bp) return rc; } -static int bnxt_hwrm_ring_grp_free(struct bnxt *bp) +static void bnxt_hwrm_ring_grp_free(struct bnxt *bp) { u16 i; - u32 rc = 0; struct hwrm_ring_grp_free_input req = {0}; if (!bp->grp_info || (bp->flags & BNXT_FLAG_CHIP_P5)) - return 0; + return; bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_RING_GRP_FREE, -1, -1); @@ -5209,12 +5205,10 @@ static int bnxt_hwrm_ring_grp_free(struct bnxt *bp) req.ring_group_id = cpu_to_le32(bp->grp_info[i].fw_grp_id); - rc = _hwrm_send_message(bp, &req, sizeof(req), - HWRM_CMD_TIMEOUT); + _hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); bp->grp_info[i].fw_grp_id = INVALID_HW_RING_ID; } mutex_unlock(&bp->hwrm_cmd_lock); - return rc; } static int hwrm_ring_alloc_send_msg(struct bnxt *bp, @@ -6302,16 +6296,16 @@ int bnxt_hwrm_set_coal(struct bnxt *bp) return rc; } -static int bnxt_hwrm_stat_ctx_free(struct bnxt *bp) +static void bnxt_hwrm_stat_ctx_free(struct bnxt *bp) { - int rc = 0, i; struct hwrm_stat_ctx_free_input req = {0}; + int i; if (!bp->bnapi) - return 0; + return; if (BNXT_CHIP_TYPE_NITRO_A0(bp)) - return 0; + return; bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_STAT_CTX_FREE, -1, -1); @@ -6323,14 +6317,13 @@ static int bnxt_hwrm_stat_ctx_free(struct bnxt *bp) if (cpr->hw_stats_ctx_id != INVALID_STATS_CTX_ID) { req.stat_ctx_id = cpu_to_le32(cpr->hw_stats_ctx_id); - rc = _hwrm_send_message(bp, &req, sizeof(req), - HWRM_CMD_TIMEOUT); + _hwrm_send_message(bp, &req, sizeof(req), + HWRM_CMD_TIMEOUT); cpr->hw_stats_ctx_id = INVALID_STATS_CTX_ID; } } mutex_unlock(&bp->hwrm_cmd_lock); - return rc; } static int bnxt_hwrm_stat_ctx_alloc(struct bnxt *bp) From patchwork Sun Mar 8 22:45:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 222842 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C77DAC10DCE for ; Sun, 8 Mar 2020 22:46:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 92E0220675 for ; Sun, 8 Mar 2020 22:46:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="aISMWM0K" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726540AbgCHWq1 (ORCPT ); Sun, 8 Mar 2020 18:46:27 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:45290 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726533AbgCHWq0 (ORCPT ); Sun, 8 Mar 2020 18:46:26 -0400 Received: by mail-pg1-f194.google.com with SMTP id m15so3819667pgv.12 for ; Sun, 08 Mar 2020 15:46:26 -0700 (PDT) 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=CAoVTG0moicyEN68mWeiUhSf+E1MnfdqCLnPCEmAe7I=; b=aISMWM0KQSkLZ8XTiUTGQ5/knLymTUXKKg5i0XTsyvJFB84LhZP6kiNyvRwE/9H8Xq YxEjGNNXjN62v2thRHL97G+xeq0JcS9kzQnRhwPE5E1gkZ6mRUeqPBuM1EShgCKXEME8 Yguvb57RTCtcas5w1wMAtaNuCtRxKrCJ6DIJQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CAoVTG0moicyEN68mWeiUhSf+E1MnfdqCLnPCEmAe7I=; b=hApcZ7JUcrCSSexRWcFLDVG0B+oJIYA3ILBPR7cquQrM39/ZQHj3tx830lL3rd4dfs 4ZPcSsGjy/vsLQxNmNESsoUhKfPxuEaFhsjzzy1GEPq6u2smlsjQl92pWe8VvdYZ1c40 2o9bxFr7wnz8QVNoBQ2ImctA24eOMZcev6Pd0nhLOuWLhxxosWtVYXg3OmZQwIjGZGWf oZHIdXVq1ByqBVKOwrz34/ythwA1djEWwC4Tb4gbfkEe8wE7XEa1zadtqI4GdYx82cTl +Ov29/aKqyjxyVpYbkQw7mxbBgcgry/L8+gwweYnbxGhNymCq9EKYKlD/U29kqpUS0hr M5Nw== X-Gm-Message-State: ANhLgQ3NxAkFUjMppa3KvGPvNUyl7qcoiIedRnTB/4WKeYy8uwawul+Z 4ghdUIUXZcFWq0baBii42WwBig== X-Google-Smtp-Source: ADFU+vv8vgGva0CEYMi9UBwpsAxgW/vSNLYyDSwtOfEcyZOmnZjjNm2kAbHMez6zMyRSVEoMzu+iFA== X-Received: by 2002:a63:9c4:: with SMTP id 187mr11485224pgj.389.1583707586005; Sun, 08 Mar 2020 15:46:26 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.com ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x66sm31241397pgb.9.2020.03.08.15.46.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Mar 2020 15:46:25 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, Vasundhara Volam , Jiri Pirko Subject: [PATCH net-next 8/8] bnxt_en: Call devlink_port_type_clear() in remove() Date: Sun, 8 Mar 2020 18:45:54 -0400 Message-Id: <1583707554-1163-9-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1583707554-1163-1-git-send-email-michael.chan@broadcom.com> References: <1583707554-1163-1-git-send-email-michael.chan@broadcom.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Vasundhara Volam Similar to other drivers, properly clear the devlink port type when removing the device before unregistration. Cc: Jiri Pirko Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 02ac718..4c9696a 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -11429,6 +11429,8 @@ static void bnxt_remove_one(struct pci_dev *pdev) bnxt_sriov_disable(bp); bnxt_dl_fw_reporters_destroy(bp, true); + if (BNXT_PF(bp)) + devlink_port_type_clear(&bp->dl_port); pci_disable_pcie_error_reporting(pdev); unregister_netdev(dev); bnxt_dl_unregister(bp);