]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: mvpp2: prs: Don't override the sign bit in SRAM parser shift
authorMaxime Chevallier <maxime.chevallier@bootlin.com>
Thu, 20 Jun 2019 09:42:45 +0000 (11:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2019 07:12:46 +0000 (09:12 +0200)
commitaa6a8b84220c8225b2b7883be803ecfbf3af2e77
tree47c52987fbf81ef0d80f97903f6b7e18eec2abf4
parentd77aa90484840f2c04df3156a1d86f1c8de9a2ad
net: mvpp2: prs: Don't override the sign bit in SRAM parser shift

[ Upstream commit 8ec3ede559956f8ad58db7b57d25ac724bab69e9 ]

The Header Parser allows identifying various fields in the packet
headers, used for various kind of filtering and classification
steps.

This is a re-entrant process, where the offset in the packet header
depends on the previous lookup results. This offset is represented in
the SRAM results of the TCAM, as a shift to be operated.

This shift can be negative in some cases, such as in IPv6 parsing.

This commit prevents overriding the sign bit when setting the shift
value, which could cause instabilities when parsing IPv6 flows.

Fixes: 3f518509dedc ("ethernet: Add new driver for Marvell Armada 375 network unit")
Suggested-by: Alan Winkowski <walan@marvell.com>
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c