From patchwork Wed Aug 11 19:32:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 495597 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=-19.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, 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 0338AC432BE for ; Wed, 11 Aug 2021 19:32:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DCBB061008 for ; Wed, 11 Aug 2021 19:32:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231630AbhHKTdH (ORCPT ); Wed, 11 Aug 2021 15:33:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:37272 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbhHKTdF (ORCPT ); Wed, 11 Aug 2021 15:33:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 61E4F6105A; Wed, 11 Aug 2021 19:32:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628710361; bh=Y9ijIe3t+vSj65xBYYS1D5mdjRafr2aNgBVULU20ZOU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WLhjHxcFMN/OjdYiJ+V/fHY3Q7yaOqeLbEYExA+Fzasyso1H6Yxm7y0QmaVEdec31 wW4C+okhjv+luezAlwTuJnL5f0tdy+8e/5Mi7CoZqpRonOh5yRjyGvfvfN6GsH5vuk FQkwfloW+yegIdyZRV69ojXyHy0hZ6d3PqJoQVf2F4Puu3O6bMfRXfs5BLslcffLnD dTSwLmfI8TQxfZgomEjdqhmMYGqN8eqk9e5MOXPMvoxXrnv7/Ql6yxaFGTDF9Huk31 ucy1obW0vwKA6przexAyEl0ppkS6nHV86TlN8qaFao5fm8lApMRXkBLvgy90M/wcyz h2KbMtLhp4Q5Q== From: Jakub Kicinski To: davem@davemloft.net Cc: michael.chan@broadcom.com, huangjw@broadcom.com, eddie.wai@broadcom.com, prashant@broadcom.com, gospo@broadcom.com, netdev@vger.kernel.org, edwin.peer@broadcom.com, Jakub Kicinski Subject: [PATCH net 2/4] bnxt: disable napi before cancelling DIM Date: Wed, 11 Aug 2021 12:32:37 -0700 Message-Id: <20210811193239.3155396-3-kuba@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210811193239.3155396-1-kuba@kernel.org> References: <20210811193239.3155396-1-kuba@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org napi schedules DIM, napi has to be disabled first, then DIM cancelled. Noticed while reading the code. Fixes: 0bc0b97fca73 ("bnxt_en: cleanup DIM work on device shutdown") Fixes: 6a8788f25625 ("bnxt_en: add support for software dynamic interrupt moderation") Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 07827d6b0fec..2c0240ee2105 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -9222,10 +9222,9 @@ static void bnxt_disable_napi(struct bnxt *bp) for (i = 0; i < bp->cp_nr_rings; i++) { struct bnxt_cp_ring_info *cpr = &bp->bnapi[i]->cp_ring; + napi_disable(&bp->bnapi[i]->napi); if (bp->bnapi[i]->rx_ring) cancel_work_sync(&cpr->dim.work); - - napi_disable(&bp->bnapi[i]->napi); } } From patchwork Wed Aug 11 19:32:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 495596 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=-19.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, 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 56D70C432BE for ; Wed, 11 Aug 2021 19:32:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 358ED60F35 for ; Wed, 11 Aug 2021 19:32:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231685AbhHKTdL (ORCPT ); Wed, 11 Aug 2021 15:33:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:37306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231154AbhHKTdG (ORCPT ); Wed, 11 Aug 2021 15:33:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4FB3360E78; Wed, 11 Aug 2021 19:32:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628710362; bh=yRxR9zVxzDiH4C30JlrCZffn221Wwn2jJAMg7a3QOR8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qq7RSKYweqgpV5WcY72CukfkSU8azFVJSMGEGiw0OagzR5hgs9p5P85D3yfA+SKpi L68XjwLrqQUpF/QJtZixOciUgbiZHYqrkX799rwvEc2E/pknmDJpJ7Zq/kGoSKCPS9 d/fH2oZvItyUZqUBd+6hbHc8h1GOFT1Jp+KtGELjNO2SIAnOAvE2e59AjLwTKRuqcQ W6Li7exBJlhTrchhrAGKuvJxvezX3+xhD6gpaiq55+F2w9EFGdqqgoF3uphxhu/fYD /5usfs/9W2AN5YAkHc7MwWJV7TLP861VR4tZWm388ZfV6PoP0g1JbDYz2NmzORFsCn ro0A4u0gb4nGQ== From: Jakub Kicinski To: davem@davemloft.net Cc: michael.chan@broadcom.com, huangjw@broadcom.com, eddie.wai@broadcom.com, prashant@broadcom.com, gospo@broadcom.com, netdev@vger.kernel.org, edwin.peer@broadcom.com, Jakub Kicinski Subject: [PATCH net 4/4] bnxt: count Tx drops Date: Wed, 11 Aug 2021 12:32:39 -0700 Message-Id: <20210811193239.3155396-5-kuba@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210811193239.3155396-1-kuba@kernel.org> References: <20210811193239.3155396-1-kuba@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Drivers should count packets they are dropping. Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.") Signed-off-by: Jakub Kicinski --- 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 b80ed556c28b..d5049e714c94 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -393,6 +393,7 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev) i = skb_get_queue_mapping(skb); if (unlikely(i >= bp->tx_nr_rings)) { dev_kfree_skb_any(skb); + atomic_long_inc(&dev->tx_dropped); return NETDEV_TX_OK; } @@ -673,6 +674,7 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev) tx_buf->skb = NULL; if (txr->kick_pending) bnxt_txr_db_kick(bp, txr, prod); + atomic_long_inc(&dev->tx_dropped); return NETDEV_TX_OK; }