• Amit Cohen's avatar
    mlxsw: spectrum: Add infrastructure for parsing configuration · 2d91f080
    Amit Cohen authored
    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. Currently, increasing parsing depth is
    maintained as part of VxLAN module, because the MPRS register which
    configures parsing depth also configures UDP destination port number
    used for VxLAN encapsulation and decapsulation.
    
    Add an API for increasing parsing depth as part of spectrum.c code, so
    that it will be possible to use it from other modules. In addition, add
    an API for setting UDP destination port and protect it using a dedicated
    lock for saving parsing configurations. The lock is needed as not all
    the callers hold RTNL lock.
    
    Maintain a counter for increased parsing depth consumers. For first
    consumer subscription, increase the parsing depth and for last consumer
    unsubscription, set parsing depth to default value.
    Signed-off-by: default avatarAmit Cohen <amcohen@nvidia.com>
    Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    2d91f080
spectrum.c 136 KB