netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shawn Bohrer <shawn.bohrer@gmail.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: Or Gerlitz <ogerlitz@mellanox.com>,
	Amir Vadai <amirv@mellanox.com>,
	Richard Cochran <richardcochran@gmail.com>,
	netdev@vger.kernel.org, tomk@rgmadvisors.com,
	Hadar Hen Zion <hadarh@mellanox.com>,
	Shawn Bohrer <sbohrer@rgmadvisors.com>
Subject: [PATCH net-next 2/2] mlx4_en: Only cycle port if HW timestamp config changes
Date: Tue, 17 Dec 2013 14:32:39 -0600	[thread overview]
Message-ID: <1387312359-9476-3-git-send-email-shawn.bohrer@gmail.com> (raw)
In-Reply-To: <1387312359-9476-1-git-send-email-shawn.bohrer@gmail.com>

From: Shawn Bohrer <sbohrer@rgmadvisors.com>

If the hwtstamp_config matches what is currently set for the device then
simply return.  Without this change any program that tries to enable
hardware timestamps will cause the link to cycle even if hardware
timstamps were already enabled.

Signed-off-by: Shawn Bohrer <sbohrer@rgmadvisors.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_clock.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_clock.c b/drivers/net/ethernet/mellanox/mlx4/en_clock.c
index 9b0d515..cc6a546 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_clock.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_clock.c
@@ -42,6 +42,10 @@ int mlx4_en_timestamp_config(struct net_device *dev, int tx_type, int rx_filter)
 	int port_up = 0;
 	int err = 0;
 
+	if (priv->hwtstamp_config.tx_type == tx_type &&
+	    priv->hwtstamp_config.rx_filter == rx_filter)
+		return 0;
+
 	mutex_lock(&mdev->state_lock);
 	if (priv->port_up) {
 		port_up = 1;
-- 
1.7.7.6

  parent reply	other threads:[~2013-12-17 20:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-17 20:32 [PATCH net-next 0/2] mlx4_en: Add PTP support Shawn Bohrer
2013-12-17 20:32 ` [PATCH net-next 1/2] mlx4_en: Add PTP hardware clock Shawn Bohrer
2013-12-17 21:04   ` Or Gerlitz
2013-12-17 21:46     ` Shawn Bohrer
2013-12-18  7:59       ` Or Gerlitz
2013-12-18 15:03         ` Shawn Bohrer
2013-12-22 13:13   ` Hadar Hen Zion
2013-12-23 16:29     ` Shawn Bohrer
2013-12-23 16:59       ` Shawn Bohrer
2013-12-24 15:38         ` Hadar Hen Zion
2013-12-25 11:49           ` Richard Cochran
2013-12-23 18:48     ` Richard Cochran
2013-12-24 13:58       ` Hadar Hen Zion
2013-12-25 11:53         ` Richard Cochran
     [not found]           ` <CAKBbMu33zXkG4+S1kP6zB+4iKMNNoy=XVBtoqZZEkqurRsgvQw@mail.gmail.com>
2013-12-25 17:02             ` Richard Cochran
2013-12-26  8:26           ` Hadar Hen Zion
2013-12-26  8:33             ` Hadar Hen Zion
2013-12-26  9:17               ` Richard Cochran
2013-12-26 14:41                 ` Hadar Hen-Zion
2013-12-26 14:49                   ` Richard Cochran
2013-12-17 20:32 ` Shawn Bohrer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-12-17 20:22 [PATCH net-next 2/2] mlx4_en: Only cycle port if HW timestamp config changes Shawn Bohrer
2013-12-17 20:32 ` Shawn Bohrer

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=1387312359-9476-3-git-send-email-shawn.bohrer@gmail.com \
    --to=shawn.bohrer@gmail.com \
    --cc=amirv@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=hadarh@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=richardcochran@gmail.com \
    --cc=sbohrer@rgmadvisors.com \
    --cc=tomk@rgmadvisors.com \
    /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).