diff options
| author | Amir Vadai <amirv@mellanox.com> | 2013-04-23 02:06:49 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2013-04-24 16:30:14 -0400 |
| commit | ec693d47010e8302e61e0bdf3f47496c5610641a (patch) | |
| tree | 8fbcfe632cb618318dcb1c9a9050afd025462b0a /include/linux/mlx4 | |
| parent | ddd8a6c12d7e494902a9435a9a7a543ef730b2d8 (diff) | |
net/mlx4_en: Add HW timestamping (TS) support
The patch allows to enable/disable HW timestamping for incoming and/or
outgoing packets. It adds and initializes all structs and callbacks
needed by kernel TS API.
To enable/disable HW timestamping appropriate ioctl should be used.
Currently HWTSTAMP_FILTER_ALL/NONE and HWTSAMP_TX_ON/OFF only are
supported.
When enabling TS on receive flow - VLAN stripping will be disabled.
Also were made all relevant changes in RX/TX flows to consider TS request
and plant HW timestamps into relevant structures.
mlx4_ib was fixed to compile with new mlx4_cq_alloc() signature.
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/mlx4')
| -rw-r--r-- | include/linux/mlx4/cq.h | 16 | ||||
| -rw-r--r-- | include/linux/mlx4/device.h | 6 |
2 files changed, 21 insertions, 1 deletions
diff --git a/include/linux/mlx4/cq.h b/include/linux/mlx4/cq.h index 6f65b2c8bb89..98fa492cf406 100644 --- a/include/linux/mlx4/cq.h +++ b/include/linux/mlx4/cq.h | |||
| @@ -64,6 +64,22 @@ struct mlx4_err_cqe { | |||
| 64 | u8 owner_sr_opcode; | 64 | u8 owner_sr_opcode; |
| 65 | }; | 65 | }; |
| 66 | 66 | ||
| 67 | struct mlx4_ts_cqe { | ||
| 68 | __be32 vlan_my_qpn; | ||
| 69 | __be32 immed_rss_invalid; | ||
| 70 | __be32 g_mlpath_rqpn; | ||
| 71 | __be32 timestamp_hi; | ||
| 72 | __be16 status; | ||
| 73 | u8 ipv6_ext_mask; | ||
| 74 | u8 badfcs_enc; | ||
| 75 | __be32 byte_cnt; | ||
| 76 | __be16 wqe_index; | ||
| 77 | __be16 checksum; | ||
| 78 | u8 reserved; | ||
| 79 | __be16 timestamp_lo; | ||
| 80 | u8 owner_sr_opcode; | ||
| 81 | } __packed; | ||
| 82 | |||
| 67 | enum { | 83 | enum { |
| 68 | MLX4_CQE_VLAN_PRESENT_MASK = 1 << 29, | 84 | MLX4_CQE_VLAN_PRESENT_MASK = 1 << 29, |
| 69 | MLX4_CQE_QPN_MASK = 0xffffff, | 85 | MLX4_CQE_QPN_MASK = 0xffffff, |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index e088290d9792..2fbc1464b53b 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
| @@ -40,6 +40,8 @@ | |||
| 40 | 40 | ||
| 41 | #include <linux/atomic.h> | 41 | #include <linux/atomic.h> |
| 42 | 42 | ||
| 43 | #include <linux/clocksource.h> | ||
| 44 | |||
| 43 | #define MAX_MSIX_P_PORT 17 | 45 | #define MAX_MSIX_P_PORT 17 |
| 44 | #define MAX_MSIX 64 | 46 | #define MAX_MSIX 64 |
| 45 | #define MSIX_LEGACY_SZ 4 | 47 | #define MSIX_LEGACY_SZ 4 |
| @@ -840,7 +842,7 @@ void mlx4_free_hwq_res(struct mlx4_dev *mdev, struct mlx4_hwq_resources *wqres, | |||
| 840 | 842 | ||
| 841 | int mlx4_cq_alloc(struct mlx4_dev *dev, int nent, struct mlx4_mtt *mtt, | 843 | int mlx4_cq_alloc(struct mlx4_dev *dev, int nent, struct mlx4_mtt *mtt, |
| 842 | struct mlx4_uar *uar, u64 db_rec, struct mlx4_cq *cq, | 844 | struct mlx4_uar *uar, u64 db_rec, struct mlx4_cq *cq, |
| 843 | unsigned vector, int collapsed); | 845 | unsigned vector, int collapsed, int timestamp_en); |
| 844 | void mlx4_cq_free(struct mlx4_dev *dev, struct mlx4_cq *cq); | 846 | void mlx4_cq_free(struct mlx4_dev *dev, struct mlx4_cq *cq); |
| 845 | 847 | ||
| 846 | int mlx4_qp_reserve_range(struct mlx4_dev *dev, int cnt, int align, int *base); | 848 | int mlx4_qp_reserve_range(struct mlx4_dev *dev, int cnt, int align, int *base); |
| @@ -1031,4 +1033,6 @@ int set_and_calc_slave_port_state(struct mlx4_dev *dev, int slave, u8 port, int | |||
| 1031 | void mlx4_put_slave_node_guid(struct mlx4_dev *dev, int slave, __be64 guid); | 1033 | void mlx4_put_slave_node_guid(struct mlx4_dev *dev, int slave, __be64 guid); |
| 1032 | __be64 mlx4_get_slave_node_guid(struct mlx4_dev *dev, int slave); | 1034 | __be64 mlx4_get_slave_node_guid(struct mlx4_dev *dev, int slave); |
| 1033 | 1035 | ||
| 1036 | cycle_t mlx4_read_clock(struct mlx4_dev *dev); | ||
| 1037 | |||
| 1034 | #endif /* MLX4_DEVICE_H */ | 1038 | #endif /* MLX4_DEVICE_H */ |
