• Radu Bulie's avatar
    dpaa2-eth: Update SINGLE_STEP register access · c4680c97
    Radu Bulie authored
    DPAA2 MAC supports 1588 one step timestamping.
    If this option is enabled then for each transmitted PTP event packet,
    the 1588 SINGLE_STEP register is accessed to modify the following fields:
    
    -offset of the correction field inside the PTP packet
    -UDP checksum update bit,  in case the PTP event packet has
     UDP encapsulation
    
    These values can change any time, because there may be multiple
    PTP clients connected, that receive various 1588 frame types:
    - L2 only frame
    - UDP / Ipv4
    - UDP / Ipv6
    - other
    
    The current implementation uses dpni_set_single_step_cfg to update the
    SINLGE_STEP register.
    Using an MC command  on the Tx datapath for each transmitted 1588 message
    introduces high delays, leading to low throughput and consequently to a
    small number of supported PTP clients. Besides these, the nanosecond
    correction field from the PTP packet will contain the high delay from the
    driver which together with the originTimestamp will render timestamp
    values that are unacceptable in a GM clock implementation.
    
    This patch updates the Tx datapath for 1588 messages when single step
    timestamp is enabled and provides direct access to SINGLE_STEP register,
    eliminating the  overhead caused by the dpni_set_single_step_cfg
    MC command. MC version >= 10.32 implements this functionality.
    If the MC version does not have support for returning the
    single step register base address, the driver will use
    dpni_set_single_step_cfg command for updates operations.
    
    All the delay introduced by dpni_set_single_step_cfg
    function will be eliminated (if MC version has support for returning the
    base address of the single step register), improving the egress driver
    performance for PTP packets when single step timestamping is enabled.
    
    Before these changes the maximum throughput for 1588 messages with
    single step hardware timestamp enabled was around 2000pps.
    After the updates the throughput increased up to 32.82 Mbps / 46631.02 pps.
    Signed-off-by: default avatarRadu Bulie <radu-andrei.bulie@nxp.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    c4680c97
dpaa2-eth.c 126 KB