diff options
author | Eran Ben Elisha <eranbe@mellanox.com> | 2015-12-29 12:58:32 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-01-05 19:11:50 (GMT) |
commit | 3d8c38af149309feb2541b995b3a45df170d6da3 (patch) | |
tree | da57592cc23e5b7ff6a640a0173a30f373a6e5ba /drivers/net/ethernet/mellanox/mlx5/core/en.h | |
parent | ef9814deafd0c83a358d49e3709c3e16cc352118 (diff) | |
download | linux-3d8c38af149309feb2541b995b3a45df170d6da3.tar.xz |
net/mlx5e: Add PTP Hardware Clock (PHC) support
Add a PHC support to the mlx5_en driver. Use reader/writer spinlocks to
protect the timecounter since every packet received needs to call
timecounter_cycle2time() when timestamping is enabled. This can become
a performance bottleneck with RSS and multiple receive queues if normal
spinlocks are used.
The driver has been tested with both Documentation/ptp/testptp and the
linuxptp project (http://linuxptp.sourceforge.net/) on a Mellanox
ConnectX-4 card.
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/en.h')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h index 477e248..9ea49a8 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h @@ -34,6 +34,7 @@ #include <linux/etherdevice.h> #include <linux/timecounter.h> #include <linux/net_tstamp.h> +#include <linux/ptp_clock_kernel.h> #include <linux/mlx5/driver.h> #include <linux/mlx5/qp.h> #include <linux/mlx5/cq.h> @@ -295,6 +296,8 @@ struct mlx5e_tstamp { unsigned long overflow_period; struct delayed_work overflow_work; struct mlx5_core_dev *mdev; + struct ptp_clock *ptp; + struct ptp_clock_info ptp_info; }; enum { |