From patchwork Thu Aug 12 21:42:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 496444 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 70454C4338F for ; Thu, 12 Aug 2021 21:42:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4F92A60F57 for ; Thu, 12 Aug 2021 21:42:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229603AbhHLVnR (ORCPT ); Thu, 12 Aug 2021 17:43:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:53898 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233480AbhHLVnM (ORCPT ); Thu, 12 Aug 2021 17:43:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E2EA56103A; Thu, 12 Aug 2021 21:42:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628804566; bh=U/v7Ga7JuVqs6EDDtd4JuMjNWqfOQY4BRi9N+d+0Clo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mhLuySIWzlyYHGMDJlJ4RaGYMKOmBOleOj4KMy+3ZvogBM9lio2Ulgka5xcizyRu0 M8KDE2AW4p8+qzwh40UT6cJKPOJoAyR9YvFyZ5DyH9r6PtX5CgfXb4Cw7E6SmNpHA8 HWLRLFCfJPTL4QzgwkHXUzfTPRm7Jjgwn/gvWvc6hL6eOWZ9quzu/sJmOdWwbnFEm4 yMBMkhLu4fl9SLUv5G2X5KOwtXPTgdZxjSHs7r86HUdh8qt4cn3cBXdz3WVdcz0qbl YlXRy6WmrWes9Fv/1o1jHTalXnozYkpMerEer7Xt5ytjnzh80Vgsq9fYRq6Hto7LDJ jSnevP3uPJE7Q== From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, michael.chan@broadcom.com, prashant@broadcom.com, eddie.wai@broadcom.com, huangjw@broadcom.com, gospo@broadcom.com, edwin.peer@broadcom.com, Jakub Kicinski Subject: [PATCH net v3 2/4] bnxt: disable napi before canceling DIM Date: Thu, 12 Aug 2021 14:42:40 -0700 Message-Id: <20210812214242.578039-3-kuba@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210812214242.578039-1-kuba@kernel.org> References: <20210812214242.578039-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 canceled. 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 84aa25875050..721b5df36311 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -9134,10 +9134,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 Thu Aug 12 21:42:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 496443 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=-16.9 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,UNWANTED_LANGUAGE_BODY, 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 51C89C4338F for ; Thu, 12 Aug 2021 21:42:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3123F60F57 for ; Thu, 12 Aug 2021 21:42:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233480AbhHLVnV (ORCPT ); Thu, 12 Aug 2021 17:43:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:53918 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234075AbhHLVnN (ORCPT ); Thu, 12 Aug 2021 17:43:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 20D1E6109F; Thu, 12 Aug 2021 21:42:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628804567; bh=FDGPQNmkcRz+DxpsoVR3+WzeTBNFDfe6SaMpF2iQ3FU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FuiNfKznlumwLgv5WE1DhjTer43i4subffegp6IGbFIdhCemUGOmY7dszl1zxEhsz nN7Akb2Jl4lROW6wQC/Hf/SnE0PdVVfKiEAIannC2/+oW/zldDLIkUZD7p3e6Wm5pw HEf5oM4A2y8z9J/X1uN6Cx4o/kFvbDnp/+gdtNbr3Pl/n8ZHfbsvzkdfcS7laooLQZ YEVi5aGqVpd2aa6Z5W9o3RUg3hf+mAXfg5iAFPnNfaaHJu07ei3YbLEud8dGGDBreD qV9o6BqiL9lnv7Goahzs5iA2d3hpPG8P2ddTSotvw5nkQiOCI3pQow4GLcoWgHXa2c zTePQQvBuv+Rw== From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, michael.chan@broadcom.com, prashant@broadcom.com, eddie.wai@broadcom.com, huangjw@broadcom.com, gospo@broadcom.com, edwin.peer@broadcom.com, Jakub Kicinski Subject: [PATCH net v3 4/4] bnxt: count Tx drops Date: Thu, 12 Aug 2021 14:42:42 -0700 Message-Id: <20210812214242.578039-5-kuba@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210812214242.578039-1-kuba@kernel.org> References: <20210812214242.578039-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 389016ea65cf..dd2d2a5fef15 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -412,6 +412,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; } @@ -687,6 +688,7 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev) if (txr->kick_pending) bnxt_txr_db_kick(bp, txr, txr->tx_prod); txr->tx_buf_ring[txr->tx_prod].skb = NULL; + atomic_long_inc(&dev->tx_dropped); return NETDEV_TX_OK; }