• Michael Chan's avatar
    bnxt_en: Add workaround to detect bad opaque in rx completion (part 1) · 376a5b86
    Michael Chan authored
    There is a rare hardware bug that can cause a bad opaque value in the RX
    or TPA completion.  When this happens, the hardware may have used the
    same buffer twice for 2 rx packets.  In addition, the driver will also
    crash later using the bad opaque as the index into the ring.
    
    The rx opaque value is predictable and is always monotonically increasing.
    The workaround is to keep track of the expected next opaque value and
    compare it with the one returned by hardware during RX and TPA start
    completions.  If they miscompare, we will not process any more RX and
    TPA completions and exit NAPI.  We will then schedule a workqueue to
    reset the function.
    
    This patch adds the logic to keep track of the next rx consumer index.
    Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    376a5b86
bnxt.h 32.6 KB