Skip to contentSkip to conversation

mlx4_en: Only cycle port if HW timestamp config changes

PATCH In review Shawn Bohrer 1 participant 2 messages Dec 17, 2013

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 mlx4_en: Only cycle port if HW timestamp config changes

From: Shawn Bohrer <[email protected]>

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.

---
 drivers/net/ethernet/mellanox/mlx4/en_clock.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/net/ethernet/mellanox/mlx4/en_clock.c +4 -0
index 9b0d515..cc6a546 100644
@@ -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;
Signature · 1 line
1.7.7.6
#1 lore raw
Quoted 29 lines · Shawn Bohrer

From: Shawn Bohrer <[email protected]>

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.

---
 drivers/net/ethernet/mellanox/mlx4/en_clock.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/net/ethernet/mellanox/mlx4/en_clock.c +4 -0
index 9b0d515..cc6a546 100644
@@ -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;
Signature · 1 line
1.7.7.6

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

--
Shawn