netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [PATCH net-next 05/10] bnxt_en: Allow the user to set ethtool stats-block-usecs to 0.
Date: Mon, 24 Jul 2017 12:34:24 -0400	[thread overview]
Message-ID: <1500914069-15724-6-git-send-email-michael.chan@broadcom.com> (raw)
In-Reply-To: <1500914069-15724-1-git-send-email-michael.chan@broadcom.com>

For debugging purpose, it is sometimes useful to disable periodic
port statistics updates, so that the firmware logs will not be
filled with statistics update messages.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c         | 3 ++-
 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 8 +++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 4acaeaf..5df9670 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -6843,7 +6843,8 @@ static void bnxt_timer(unsigned long data)
 	if (atomic_read(&bp->intr_sem) != 0)
 		goto bnxt_restart_timer;
 
-	if (bp->link_info.link_up && (bp->flags & BNXT_FLAG_PORT_STATS)) {
+	if (bp->link_info.link_up && (bp->flags & BNXT_FLAG_PORT_STATS) &&
+	    bp->stats_coal_ticks) {
 		set_bit(BNXT_PERIODIC_STATS_SP_EVENT, &bp->sp_event);
 		schedule_work(&bp->sp_task);
 	}
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index 4661b11..140e769 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -86,9 +86,11 @@ static int bnxt_set_coalesce(struct net_device *dev,
 	if (bp->stats_coal_ticks != coal->stats_block_coalesce_usecs) {
 		u32 stats_ticks = coal->stats_block_coalesce_usecs;
 
-		stats_ticks = clamp_t(u32, stats_ticks,
-				      BNXT_MIN_STATS_COAL_TICKS,
-				      BNXT_MAX_STATS_COAL_TICKS);
+		/* Allow 0, which means disable. */
+		if (stats_ticks)
+			stats_ticks = clamp_t(u32, stats_ticks,
+					      BNXT_MIN_STATS_COAL_TICKS,
+					      BNXT_MAX_STATS_COAL_TICKS);
 		stats_ticks = rounddown(stats_ticks, BNXT_MIN_STATS_COAL_TICKS);
 		bp->stats_coal_ticks = stats_ticks;
 		update_stats = true;
-- 
1.8.3.1

  parent reply	other threads:[~2017-07-24 16:34 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-24 16:34 [PATCH net-next 00/10] bnxt_en: Updates for net-next Michael Chan
2017-07-24 16:34 ` [PATCH net-next 01/10] bnxt_en: Update firmware interface spec to 1.8.0 Michael Chan
2017-07-24 16:34 ` [PATCH net-next 02/10] bnxt_en: Retrieve the hardware bridge mode from the firmware Michael Chan
2017-07-24 16:34 ` [PATCH net-next 03/10] bnxt_en: Implement ndo_bridge_{get|set}link methods Michael Chan
2017-07-24 16:34 ` [PATCH net-next 04/10] bnxt_en: Add bnxt_get_num_stats() to centrally get the number of ethtool stats Michael Chan
2017-07-24 16:34 ` Michael Chan [this message]
2017-07-24 16:34 ` [PATCH net-next 06/10] bnxt_en: Report firmware DCBX agent Michael Chan
2017-07-24 16:34 ` [PATCH net-next 07/10] bnxt_en: Set ETS min_bw parameter for older firmware Michael Chan
2017-07-24 16:34 ` [PATCH net-next 08/10] bnxt_en: add support to enable VF-representors Michael Chan
2017-07-25  2:28   ` kbuild test robot
2017-07-24 16:34 ` [PATCH net-next 09/10] bnxt_en: add vf-rep RX/TX and netdev implementation Michael Chan
2017-07-24 16:34 ` [PATCH net-next 10/10] bnxt_en: add support for port_attr_get and and get_phys_port_name Michael Chan
2017-07-25  2:44   ` kbuild test robot
2017-07-25  4:06     ` Jakub Kicinski
2017-07-25  4:21       ` David Miller
2017-07-25  4:45   ` Jakub Kicinski
2017-07-25  5:13     ` [RFC] switchdev: clarify ndo_get_phys_port_name() formats Jakub Kicinski
2017-07-25 15:22       ` Andy Gospodarek
2017-07-25 22:26         ` Jakub Kicinski
2017-07-26  1:48           ` Andy Gospodarek
2017-07-26  2:34             ` Jakub Kicinski
2017-07-26 17:54               ` Andy Gospodarek
2017-07-26  5:48       ` Jiri Pirko
2017-07-26  8:13         ` Jakub Kicinski
2017-07-26  9:23           ` Or Gerlitz
2017-07-26 20:11             ` Jakub Kicinski
2017-07-27 10:30               ` Or Gerlitz
2017-07-28  2:31                 ` [RFC] switchdev: generate phys_port_name in the core Jakub Kicinski
2017-07-28  2:37                   ` Jakub Kicinski
2017-07-28  5:35                   ` Jiri Pirko
2017-07-28  5:58                     ` Jiri Pirko
2017-07-28  7:28                       ` Jakub Kicinski
2017-07-28  7:27                     ` Jakub Kicinski
2017-07-28 14:13                   ` Andrew Lunn
2017-07-25  9:55     ` [PATCH net-next 10/10] bnxt_en: add support for port_attr_get and and get_phys_port_name Sathya Perla
2017-07-25 22:27       ` Jakub Kicinski
2017-07-26  9:13     ` Or Gerlitz
2017-07-25  0:32 ` [PATCH net-next 00/10] bnxt_en: Updates for net-next David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1500914069-15724-6-git-send-email-michael.chan@broadcom.com \
    --to=michael.chan@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).