diff options
author | Petr Machata | 2019-06-30 08:04:53 +0200 |
---|---|---|
committer | David S. Miller | 2019-07-02 03:58:34 +0200 |
commit | 0714256c3d76793b6ce52e74b4fa207cfb502246 (patch) | |
tree | 2c8ed35eb37f57dde9fbe4f586c47345e26156fd /drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h | |
parent | mlxsw: core: Add support for using SKB control buffer (diff) | |
download | kernel-qcow2-linux-0714256c3d76793b6ce52e74b4fa207cfb502246.tar.gz kernel-qcow2-linux-0714256c3d76793b6ce52e74b4fa207cfb502246.tar.xz kernel-qcow2-linux-0714256c3d76793b6ce52e74b4fa207cfb502246.zip |
mlxsw: pci: PTP: Hook into packet transmit path
On Spectrum-1, timestamps are delivered separately from the packets, and
need to paired up. Therefore, at some point after mlxsw_sp_port_xmit()
is invoked, it is necessary to involve the chip-specific driver code to
allow it to do the necessary bookkeeping and matching.
On Spectrum-2, timestamps are delivered in CQE. For that reason,
position the point of driver involvement into mlxsw_pci_cqe_sdq_handle()
to make it hopefully easier to extend for Spectrum-2 in the future.
To tell the driver what port the packet was sent on, keep tx_info
in SKB control buffer.
Introduce a new driver core interface mlxsw_core_ptp_transmitted(), a
driver callback ptp_transmitted, and a PTP op transmitted. The callee is
responsible for taking care of releasing the SKB passed to the new
interfaces, and correspondingly have the new stub callbacks just call
dev_kfree_skb_any().
Follow-up patches will introduce the actual content into
mlxsw_sp1_ptp_transmitted() in particular.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h index 06bb303b5407..84955aa79c01 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h @@ -20,6 +20,9 @@ void mlxsw_sp1_ptp_clock_fini(struct mlxsw_sp_ptp_clock *clock); void mlxsw_sp1_ptp_receive(struct mlxsw_sp *mlxsw_sp, struct sk_buff *skb, u8 local_port); +void mlxsw_sp1_ptp_transmitted(struct mlxsw_sp *mlxsw_sp, + struct sk_buff *skb, u8 local_port); + #else static inline struct mlxsw_sp_ptp_clock * @@ -38,6 +41,12 @@ static inline void mlxsw_sp1_ptp_receive(struct mlxsw_sp *mlxsw_sp, mlxsw_sp_rx_listener_no_mark_func(skb, local_port, mlxsw_sp); } +static inline void mlxsw_sp1_ptp_transmitted(struct mlxsw_sp *mlxsw_sp, + struct sk_buff *skb, u8 local_port) +{ + dev_kfree_skb_any(skb); +} + #endif static inline struct mlxsw_sp_ptp_clock * @@ -56,4 +65,10 @@ static inline void mlxsw_sp2_ptp_receive(struct mlxsw_sp *mlxsw_sp, mlxsw_sp_rx_listener_no_mark_func(skb, local_port, mlxsw_sp); } +static inline void mlxsw_sp2_ptp_transmitted(struct mlxsw_sp *mlxsw_sp, + struct sk_buff *skb, u8 local_port) +{ + dev_kfree_skb_any(skb); +} + #endif |