]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: sja1105: fix VL lookup command packing for P/Q/R/S
authorVladimir Oltean <vladimir.oltean@nxp.com>
Mon, 24 May 2021 09:25:22 +0000 (12:25 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 May 2021 20:20:24 +0000 (13:20 -0700)
commitba61cf167cb77e54c1ec5adb7aa49a22ab3c9b28
treec6affbecd561407a3f50ac487ca9f0f6cd0b2151
parent1a6e9a9c68c1f183872e4bcc947382111c2e04eb
net: dsa: sja1105: fix VL lookup command packing for P/Q/R/S

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: 94f94d4acfb2 ("net: dsa: sja1105: add static tables for virtual links")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/sja1105/sja1105_dynamic_config.c