Subject: Re: [PATCH net] mlxsw: spectrum: Fix incorrect parsing depth after reload

From: Jakub Kicinski <[email-masked]>
Date: Fri, 10 Feb 2023 19:33:50 -0800

On Thu, 9 Feb 2023 12:40:24 +0100 Petr Machata wrote:
> Spectrum ASICs have a configurable limit on how deep into the packet
> they parse. By default, the limit is 96 bytes.
> 
> There are several cases where this parsing depth is not enough and there
> is a need to increase it. For example, timestamping of PTP packets and a
> FIB multipath hash policy that requires hashing on inner fields. The
> driver therefore maintains a reference count that reflects the number of
> consumers that require an increased parsing depth.
> 
> During reload_down() the parsing depth reference count does not
> necessarily drop to zero, but the parsing depth itself is restored to
> the default during reload_up() when the firmware is reset. It is
> therefore possible to end up in situations where the driver thinks that
> the parsing depth was increased (reference count is non-zero), when it
> is not.

Sounds quite odd TBH, something doesn't get de-registered during _down()
but is registered again during _up()?