]> git.baikalelectronics.ru Git - kernel.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)
committerDavid S. Miller <davem@davemloft.net>
Fri, 28 Jun 2019 21:44:03 +0000 (14:44 -0700)
commit230f76ca8c0bcb6b267baeef6728f26b39c376b5
tree5af680353bb56b4f89e96b25ac22cee3469be329
parentae9be529e63c9dd78e9f77852c4420e84841559d
net: mvpp2: prs: Don't override the sign bit in SRAM parser shift

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: dc37d05f9885 ("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>
drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c