mlx4_en: Only cycle port if HW timestamp config changes
Subsystems (4)
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.
Signed-off-by Shawn Bohrer <[email protected]>
--- 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
@@ -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
Quoted 29 lines · Shawn Bohrer
From: Shawn Bohrer <[email protected]>
If the
hwtstamp_configmatches 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 <[email protected]>--- 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@@ -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