Subject: Re: [PATCH iwl-net v2 1/1] igc: Fix packet still tx after gate close by reducing i226 MAC retry buffer

From: Vinicius Costa Gomes <[email-masked]>
Date: Thu, 11 Jul 2024 11:22:26 -0700

Faizal Rahim <[email-masked]> writes:

> 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.
>
> Signed-off-by: Faizal Rahim <[email-masked]>
> ---
> v1: https://patchwork.kernel.org/project/netdevbpf/patch/[email-masked]/
>
> Changelog:
> v1 -> v2
> - Update commit description (Paul).
> - Rename qbvfullth -> qbvfullthreshold (Paul).
> ---

Looks fine.

Acked-by: Vinicius Costa Gomes <[email-masked]>

Cheers,
-- 
Vinicius