net: sparx5: fix handling uneven length packets in manual extraction
authorCasper Andersson <casper.casan@gmail.com>
Thu, 25 Aug 2022 08:49:55 +0000 (10:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Sep 2022 10:28:02 +0000 (12:28 +0200)
commitcc2b9170aa34e0e1ae54c8da52c5bb1dfb01b0c5
tree7f0d44a9d08d391f0723829449a1e0d1582f33bf
parent5359524251d27d5fb50e425bac0108a134ed682c
net: sparx5: fix handling uneven length packets in manual extraction

[ Upstream commit 7498a457ecf7ff2c4d379360aa8f24566bb1543e ]

Packets that are not of length divisible by 4 (e.g. 77, 78, 79) would
have the checksum included up to next multiple of 4 (a 77 bytes packet
would have 3 bytes of ethernet checksum included). The check for the
value expects it in host (Little) endian.

Fixes: f3cad2611a77 ("net: sparx5: add hostmode with phylink support")
Signed-off-by: Casper Andersson <casper.casan@gmail.com>
Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Link: https://lore.kernel.org/r/20220825084955.684637-1-casper.casan@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/microchip/sparx5/sparx5_packet.c