From patchwork Sun Oct 4 19:23:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 267622 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=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MIME_HEADER_CTYPE_ONLY, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, T_TVD_MIME_NO_HEADERS, URIBL_BLOCKED, 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 D54CDC4363C for ; Sun, 4 Oct 2020 19:23:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 94C4320637 for ; Sun, 4 Oct 2020 19:23:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="bnaLZOTY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726345AbgJDTXm (ORCPT ); Sun, 4 Oct 2020 15:23:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726624AbgJDTXg (ORCPT ); Sun, 4 Oct 2020 15:23:36 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02B03C0613E8 for ; Sun, 4 Oct 2020 12:23:36 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id g29so4353395pgl.2 for ; Sun, 04 Oct 2020 12:23:35 -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=Keln/Qnb/Z2jonep27KzVYq+nsF9zU366rLziJ8qJV4=; b=bnaLZOTYGsJso5j8yIWHLPSMgNfiF5swSW0Hc3kiUNSTOpG87qZgUhroWlWPEn78vb fT3q5rBwLo6crxmE6KEYT4OJIybfdCB8Ds1BxCnEOmTmuTzxpqM+Gxn1650Rrzcp3UAu HEkCQKBARWEY/0z0CWmwKvuF+mNO2yA1GcSzc= 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=Keln/Qnb/Z2jonep27KzVYq+nsF9zU366rLziJ8qJV4=; b=fxZs+qFbw2ejrKB/w6LBu9+Bh9+BF4vVzIPCokZTyHF2YaOhGIhDvRMYf2fiLnelS4 v2r/ZHeNtmK1bDl0Hzle0ITUaHR0RILAwPdBNrxJwg1xnwa4gsQMNJB/aKbhLBLNBAZA wdOimY75tn1oZsgm0lIqOXreonGxRSxDkRr3BRdSb8UVaq0mLKFEps1TIEifOoh8WlXu cQb0OtWDfepnIpN7oE3u6bYcG3MpoJk/wKFAmwDfQ894x++gWI268a4lt6BOHchCGiXY gSZ6LLnRUyw3lWbp8AyojSj4JcBQlS8Z6B+0ue8vk0XL0HYyGvj1/FACoEHsPK2MAKjS 7hRA== X-Gm-Message-State: AOAM533c4HhwcGHL3qiYVHOjakBwlvzR4a3xqbZ5Zg4hxc1yNuM5Eqbc 1OijfQSpLlN/jlfM4mdL+Vb1jPWcJL4y8g== X-Google-Smtp-Source: ABdhPJzlOexsDs06u9CdQnfg6MXOv0EXb+apUt/iIoK4Ou1TJz7ye2ImJIqJahQy4UfV366Br5mkrw== X-Received: by 2002:a63:f807:: with SMTP id n7mr11241492pgh.311.1601839415347; Sun, 04 Oct 2020 12:23:35 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id 138sm9824234pfu.180.2020.10.04.12.23.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Oct 2020 12:23:34 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, gospo@broadcom.com Subject: [PATCH net-next 10/11] bnxt_en: Reduce unnecessary message log during RX errors. Date: Sun, 4 Oct 2020 15:23:00 -0400 Message-Id: <1601839381-10446-11-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1601839381-10446-1-git-send-email-michael.chan@broadcom.com> References: <1601839381-10446-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org There is logic in the RX path to detect unexpected handles in the RX completion. We'll print a warning and schedule a reset. The next expected handle is then set to 0xffff which is guaranteed to not match any valid handle. This will force all remaining packets in the ring to be discarded before the reset. There can be hundreds of these packets remaining in the ring and there is no need to print the warnings for these forced errors. Reviewed-by: Pavan Chebbi Reviewed-by: Edwin Peer Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 084588436b66..1e6764000a74 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -1741,8 +1741,10 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr, if (unlikely(cons != rxr->rx_next_cons)) { int rc1 = bnxt_discard_rx(bp, cpr, raw_cons, rxcmp); - netdev_warn(bp->dev, "RX cons %x != expected cons %x\n", - cons, rxr->rx_next_cons); + /* 0xffff is forced error, don't print it */ + if (rxr->rx_next_cons != 0xffff) + netdev_warn(bp->dev, "RX cons %x != expected cons %x\n", + cons, rxr->rx_next_cons); bnxt_sched_reset(bp, rxr); return rc1; }