]> git.baikalelectronics.ru Git - kernel.git/commit
net: mscc: fix the injection header
authorAntoine Tenart <antoine.tenart@bootlin.com>
Wed, 20 Jun 2018 08:50:46 +0000 (10:50 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Jun 2018 01:29:46 +0000 (10:29 +0900)
commit776cfcf621dbce0f8d97d9dd4cec7369c5a1f50d
treea40b3a5e1608afe22717b80d4a92c4ff950326c1
parent6543ad94c2a1729cee7838310ea6710d70ea433b
net: mscc: fix the injection header

When injecting frames in the Ocelot switch driver an injection header
(IFH) should be used to configure various parameters related to a given
frame, such as the port onto which the frame should be departed or its
vlan id. Other parameters in the switch configuration can led to an
injected frame being sent without an IFH but this led to various issues
as the per-frame parameters are then not used. This is especially true
when using multiple ports for injection.

The IFH was injected with the wrong endianness which led to the switch
not taking it into account as the IFH_INJ_BYPASS bit was then unset.
(The bit tells the switch to use the IFH over its internal
configuration). This patch fixes it.

In addition to the endianness fix, the IFH is also fixed. As it was
(unwillingly) unused, some of its fields were not configured the right
way.

Fixes: 99c1e05296dd ("net: mscc: Add initial Ocelot switch support")
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mscc/ocelot.c