• Faizal Rahim's avatar
    igc: Fix packet still tx after gate close by reducing i226 MAC retry buffer · e037a26e
    Faizal Rahim authored
    Testing uncovered that even when the taprio gate is closed, some packets
    still transmit.
    
    According to i225/6 hardware errata [1], traffic might overflow the
    planned QBV window. This happens because MAC maintains an internal buffer,
    primarily for supporting half duplex retries. Therefore, even when the
    gate closes, residual MAC data in the buffer may still transmit.
    
    To mitigate this for i226, reduce the MAC's internal buffer from 192 bytes
    to the recommended 88 bytes by modifying the RETX_CTL register value.
    
    This follows guidelines from:
    [1] Ethernet Controller I225/I22 Spec Update Rev 2.1 Errata Item 9:
        TSN: Packet Transmission Might Cross Qbv Window
    [2] I225/6 SW User Manual Rev 1.2.4: Section 8.11.5 Retry Buffer Control
    
    Note that the RETX_CTL register can't be used in TSN mode because half
    duplex feature cannot coexist with TSN.
    
    Test Steps:
    1.  Send taprio cmd to board A:
        tc qdisc replace dev enp1s0 parent root handle 100 taprio \
        num_tc 4 \
        map 3 2 1 0 3 3 3 3 3 3 3 3 3 3 3 3 \
        queues 1@0 1@1 1@2 1@3 \
        base-time 0 \
        sched-entry S 0x07 500000 \
        sched-entry S 0x0f 500000 \
        flags 0x2 \
        txtime-delay 0
    
        Note that for TC3, gate should open for 500us and close for another
        500us.
    
    3.  Take tcpdump log on Board B.
    
    4.  Send udp packets via UDP tai app from Board A to Board B.
    
    5.  Analyze tcpdump log via wireshark log on Board B. Ensure that the
        total time from the first to the last packet received during one cycle
        for TC3 does not exceed 500us.
    
    Fixes: 43546211 ("igc: Add new device ID's")
    Signed-off-by: default avatarFaizal Rahim <faizal.abdul.rahim@linux.intel.com>
    Acked-by: default avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
    Tested-by: default avatarMor Bar-Gabay <morx.bar.gabay@intel.com>
    Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
    e037a26e
igc_defines.h 30 KB