netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 2/2] mlx4_en: Only cycle port if HW timestamp config changes
@ 2013-12-17 20:22 Shawn Bohrer
  2013-12-17 20:32 ` Shawn Bohrer
  0 siblings, 1 reply; 3+ messages in thread
From: Shawn Bohrer @ 2013-12-17 20:22 UTC (permalink / raw)
  To: David S. Miller
  Cc: Or Gerlitz, Amir Vadai, Richard Cochran, netdev, tomk,
	Hadar Hen Zion, Shawn Bohrer

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next 2/2] mlx4_en: Only cycle port if HW timestamp config changes
  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
  0 siblings, 0 replies; 3+ messages in thread
From: Shawn Bohrer @ 2013-12-17 20:32 UTC (permalink / raw)
  To: David S. Miller
  Cc: Or Gerlitz, Amir Vadai, Richard Cochran, netdev, tomk,
	Hadar Hen Zion, Shawn Bohrer

On Tue, Dec 17, 2013 at 02:22:25PM -0600, Shawn Bohrer wrote:
> 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

Sorry had an email malfunction I'll resend this series again including
a cover and patch 1.

--
Shawn
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH net-next 2/2] mlx4_en: Only cycle port if HW timestamp config changes
  2013-12-17 20:32 [PATCH net-next 0/2] mlx4_en: Add PTP support Shawn Bohrer
@ 2013-12-17 20:32 ` Shawn Bohrer
  0 siblings, 0 replies; 3+ messages in thread
From: Shawn Bohrer @ 2013-12-17 20:32 UTC (permalink / raw)
  To: David S. Miller
  Cc: Or Gerlitz, Amir Vadai, Richard Cochran, netdev, tomk,
	Hadar Hen Zion, Shawn Bohrer

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-12-17 20:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
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 2/2] mlx4_en: Only cycle port if HW timestamp config changes Shawn Bohrer

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).