• Petr Machata's avatar
    mlxsw: pci: PTP: Hook into packet transmit path · 0714256c
    Petr Machata authored
    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: default avatarPetr Machata <petrm@mellanox.com>
    Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    0714256c
core.h 13.7 KB