• Vladimir Oltean's avatar
    net: dsa: sja1105: fix VL lookup command packing for P/Q/R/S · ba61cf16
    Vladimir Oltean authored
    At the beginning of the sja1105_dynamic_config.c file there is a diagram
    of the dynamic config interface layout:
    
     packed_buf
    
     |
     V
     +-----------------------------------------+------------------+
     |              ENTRY BUFFER               |  COMMAND BUFFER  |
     +-----------------------------------------+------------------+
    
     <----------------------- packed_size ------------------------>
    
    So in order to pack/unpack the command bits into the buffer,
    sja1105_vl_lookup_cmd_packing must first advance the buffer pointer by
    the length of the entry. This is similar to what the other *cmd_packing
    functions do.
    
    This bug exists because the command packing function for P/Q/R/S was
    copied from the E/T generation, and on E/T, the command was actually
    embedded within the entry buffer itself.
    
    Fixes: 94f94d4a ("net: dsa: sja1105: add static tables for virtual links")
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    ba61cf16
sja1105_dynamic_config.c 35.9 KB