net: hns3: fix byte order conversion issue in hclge_dbg_fd_tcam_read()
authorHao Chen <chenhao418@huawei.com>
Wed, 6 Sep 2023 07:20:14 +0000 (15:20 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Sep 2023 10:28:04 +0000 (12:28 +0200)
commitb5087697130aff8b25b7b237586f96e65a306272
tree0acf7fa0c0fcaa706e42d90f4592c019da5a7a33
parent5c28780f4232626409eaccde4b48f2f99294261b
net: hns3: fix byte order conversion issue in hclge_dbg_fd_tcam_read()

[ Upstream commit efccf655e99b6907ca07a466924e91805892e7d3 ]

req1->tcam_data is defined as "u8 tcam_data[8]", and we convert it as
(u32 *) without considerring byte order conversion,
it may result in printing wrong data for tcam_data.

Convert tcam_data to (__le32 *) first to fix it.

Fixes: b5a0b70d77b9 ("net: hns3: refactor dump fd tcam of debugfs")
Signed-off-by: Hao Chen <chenhao418@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c