netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shradha Shah <sshah@solarflare.com>
To: David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-net-drivers@solarflare.com>
Subject: [PATCH net-next 01/13] sfc: Removed adhoc scheme to rate limit PTP event queue overflow message
Date: Wed, 12 Feb 2014 18:58:24 +0000	[thread overview]
Message-ID: <52FBC450.7080301@solarflare.com> (raw)
In-Reply-To: <52FBC3C2.7030103@solarflare.com>

From: Laurence Evans <levans@solarflare.com>

Use conventional net_ratelimit() instead.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Shradha Shah <sshah@solarflare.com>
---
 drivers/net/ethernet/sfc/ptp.c |   22 ++--------------------
 1 files changed, 2 insertions(+), 20 deletions(-)

diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index eb75fbd..52be63d 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -223,7 +223,6 @@ struct efx_ptp_timeset {
  * @evt_list: List of MC receive events awaiting packets
  * @evt_free_list: List of free events
  * @evt_lock: Lock for manipulating evt_list and evt_free_list
- * @evt_overflow: Boolean indicating that event list has overflowed
  * @rx_evts: Instantiated events (on evt_list and evt_free_list)
  * @workwq: Work queue for processing pending PTP operations
  * @work: Work task
@@ -275,7 +274,6 @@ struct efx_ptp_data {
 	struct list_head evt_list;
 	struct list_head evt_free_list;
 	spinlock_t evt_lock;
-	bool evt_overflow;
 	struct efx_ptp_event_rx rx_evts[MAX_RECEIVE_EVENTS];
 	struct workqueue_struct *workwq;
 	struct work_struct work;
@@ -941,11 +939,6 @@ static void efx_ptp_drop_time_expired_events(struct efx_nic *efx)
 			}
 		}
 	}
-	/* If the event overflow flag is set and the event list is now empty
-	 * clear the flag to re-enable the overflow warning message.
-	 */
-	if (ptp->evt_overflow && list_empty(&ptp->evt_list))
-		ptp->evt_overflow = false;
 	spin_unlock_bh(&ptp->evt_lock);
 }
 
@@ -989,11 +982,6 @@ static enum ptp_packet_state efx_ptp_match_rx(struct efx_nic *efx,
 			break;
 		}
 	}
-	/* If the event overflow flag is set and the event list is now empty
-	 * clear the flag to re-enable the overflow warning message.
-	 */
-	if (ptp->evt_overflow && list_empty(&ptp->evt_list))
-		ptp->evt_overflow = false;
 	spin_unlock_bh(&ptp->evt_lock);
 
 	return rc;
@@ -1147,7 +1135,6 @@ static int efx_ptp_stop(struct efx_nic *efx)
 	list_for_each_safe(cursor, next, &efx->ptp_data->evt_list) {
 		list_move(cursor, &efx->ptp_data->evt_free_list);
 	}
-	ptp->evt_overflow = false;
 	spin_unlock_bh(&efx->ptp_data->evt_lock);
 
 	return rc;
@@ -1253,7 +1240,6 @@ int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel)
 	spin_lock_init(&ptp->evt_lock);
 	for (pos = 0; pos < MAX_RECEIVE_EVENTS; pos++)
 		list_add(&ptp->rx_evts[pos].link, &ptp->evt_free_list);
-	ptp->evt_overflow = false;
 
 	/* Get the NIC PTP attributes and set up time conversions */
 	rc = efx_ptp_get_attributes(efx);
@@ -1635,13 +1621,9 @@ static void ptp_event_rx(struct efx_nic *efx, struct efx_ptp_data *ptp)
 		list_add_tail(&evt->link, &ptp->evt_list);
 
 		queue_work(ptp->workwq, &ptp->work);
-	} else if (!ptp->evt_overflow) {
-		/* Log a warning message and set the event overflow flag.
-		 * The message won't be logged again until the event queue
-		 * becomes empty.
-		 */
+	} else if (net_ratelimit()) {
+		/* Log a rate-limited warning message. */
 		netif_err(efx, rx_err, efx->net_dev, "PTP event queue overflow\n");
-		ptp->evt_overflow = true;
 	}
 	spin_unlock_bh(&ptp->evt_lock);
 }

  reply	other threads:[~2014-02-12 18:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-12 18:56 [PATCH net-next 00/13] Cleanup patches for the SFC driver Shradha Shah
2014-02-12 18:58 ` Shradha Shah [this message]
2014-02-12 18:58 ` [PATCH net-next 02/13] sfc: Cache skb->data in local variable in efx_ptp_rx() Shradha Shah
2014-02-12 18:58 ` [PATCH net-next 03/13] sfc: Rewrite adjustment of PPS event in a clearer way Shradha Shah
2014-02-12 18:58 ` [PATCH net-next 04/13] sfc: Replace TSOH_OFFSET with the equivalent NET_IP_ALIGN Shradha Shah
2014-02-12 18:59 ` [PATCH net-next 06/13] sfc: Remove unused definitions of EF10 user-mode DMA descriptors Shradha Shah
2014-02-12 18:59 ` [PATCH net-next 07/13] sfc: Correct comment about number of TX queues used on EF10 Shradha Shah
2014-02-12 18:59 ` [PATCH net-next 08/13] sfc: Preserve rx_frm_trunc counters when resizing DMA rings Shradha Shah
2014-02-12 18:59 ` [PATCH net-next 05/13] sfc: Rename 'use_options' variable in tso_start() to clearer 'use_opt_desc' Shradha Shah
2014-02-12 18:59 ` [PATCH net-next 09/13] sfc: Use canonical pointer type for MAC address in efx_set_mac_address() Shradha Shah
2014-02-12 19:00 ` [PATCH net-next 10/13] sfc: Update product naming Shradha Shah
2014-02-12 19:00 ` [PATCH net-next 11/13] sfc: Cosmetic changes to self-test from the out-of-tree driver Shradha Shah
2014-02-12 19:00 ` [PATCH net-next 12/13] sfc: Fail self-test with -EBUSY, not -EIO, if the device is busy Shradha Shah
2014-02-12 19:00 ` [PATCH net-next 13/13] sfc: Add/remove blank lines to taste Shradha Shah
2014-02-12 23:42 ` [PATCH net-next 00/13] Cleanup patches for the SFC driver David Miller
  -- strict thread matches above, loose matches on Subject: below --
2014-02-03 23:21 [PATCH net-next 00/13] Cleanup patches Shradha Shah
2014-02-03 23:33 ` [PATCH net-next 01/13] sfc: Removed adhoc scheme to rate limit PTP event queue overflow message Shradha Shah

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=52FBC450.7080301@solarflare.com \
    --to=sshah@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=linux-net-drivers@solarflare.com \
    --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).