linux/drivers/net/ethernet/stmicro/stmmac
Simon Horman e9dbebae2e net: stmmac: Correct byte order of perfect_match
The perfect_match parameter of the update_vlan_hash operation is __le16,
and is correctly converted from host byte-order in the lone caller,
stmmac_vlan_update().

However, the implementations of this caller, dwxgmac2_update_vlan_hash()
and dwxgmac2_update_vlan_hash(), both treat this parameter as host byte
order, using the following pattern:

	u32 value = ...
	...
	writel(value | perfect_match, ...);

This is not correct because both:
1) value is host byte order; and
2) writel expects a host byte order value as it's first argument

I believe that this will break on big endian systems. And I expect it
has gone unnoticed by only being exercised on little endian systems.

The approach taken by this patch is to update the callback, and it's
caller to simply use a host byte order value.

Flagged by Sparse.
Compile tested only.

Fixes: c7ab0b8088 ("net: stmmac: Fallback to VLAN Perfect filtering if HASH is not available")
Signed-off-by: Simon Horman <horms@kernel.org>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-07-24 15:11:44 +01:00
..
chain_mode.c
common.h net: stmmac: Drop TBI/RTBI PCS flags 2024-05-30 18:30:10 -07:00
descs_com.h
descs.h
dwmac4_core.c net: stmmac: Correct byte order of perfect_match 2024-07-24 15:11:44 +01:00
dwmac4_descs.c net: stmmac: Add support for HW-accelerated VLAN stripping 2023-11-22 10:54:14 +00:00
dwmac4_descs.h
dwmac4_dma.c Revert "net: stmmac: Enable Per DMA Channel interrupt" 2024-01-07 17:12:11 -08:00
dwmac4_dma.h net: stmmac: fix typo in comment 2024-02-29 12:35:45 +01:00
dwmac4_lib.c net: stmmac: protect updates of 64-bit statistics counters 2024-02-07 09:00:34 +00:00
dwmac4.h
dwmac5.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-12-07 17:53:17 -08:00
dwmac5.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-12-07 17:53:17 -08:00
dwmac100_core.c net: stmmac: include linux/io.h rather than asm/io.h 2024-05-30 18:30:11 -07:00
dwmac100_dma.c net: stmmac: include linux/io.h rather than asm/io.h 2024-05-30 18:30:11 -07:00
dwmac100.h
dwmac1000_core.c net: stmmac: include linux/io.h rather than asm/io.h 2024-05-30 18:30:11 -07:00
dwmac1000_dma.c net: stmmac: include linux/io.h rather than asm/io.h 2024-05-30 18:30:11 -07:00
dwmac1000.h
dwmac_dma.h
dwmac_lib.c net: stmmac: protect updates of 64-bit statistics counters 2024-02-07 09:00:34 +00:00
dwmac-anarion.c net: stmmac: rename stmmac_pltfr_remove_no_dt to stmmac_pltfr_remove 2023-09-18 12:44:36 +01:00
dwmac-dwc-qos-eth.c
dwmac-generic.c
dwmac-imx.c net: stmmac: dwmac-imx: set TSO/TBS TX queues default settings 2024-01-30 12:58:12 +01:00
dwmac-ingenic.c net: stmmac: rename stmmac_pltfr_remove_no_dt to stmmac_pltfr_remove 2023-09-18 12:44:36 +01:00
dwmac-intel-plat.c net: ethernet: Use device_get_match_data() 2023-10-13 10:04:53 +01:00
dwmac-intel.c Networking changes for 6.11. Not much excitement - a handful of large 2024-07-16 19:28:34 -07:00
dwmac-intel.h
dwmac-ipq806x.c net: stmmac: dwmac-ipq806x: account for rgmii-txid/rxid/id phy-mode 2024-05-08 12:19:54 +01:00
dwmac-loongson1.c
dwmac-loongson.c stmmac: dwmac-loongson: drop useless check for compatible fallback 2023-12-13 10:57:00 +00:00
dwmac-lpc18xx.c net: stmmac: rename stmmac_pltfr_remove_no_dt to stmmac_pltfr_remove 2023-09-18 12:44:36 +01:00
dwmac-mediatek.c net: stmmac: rename stmmac_pltfr_remove_no_dt to stmmac_pltfr_remove 2023-09-18 12:44:36 +01:00
dwmac-meson8b.c net: stmmac: rename stmmac_pltfr_remove_no_dt to stmmac_pltfr_remove 2023-09-18 12:44:36 +01:00
dwmac-meson.c net: stmmac: rename stmmac_pltfr_remove_no_dt to stmmac_pltfr_remove 2023-09-18 12:44:36 +01:00
dwmac-qcom-ethqos.c net: stmmac: qcom-ethqos: enable SGMII loopback during DMA reset on sa8775p-ride-r3 2024-07-08 20:23:55 -07:00
dwmac-rk.c net: stmmac: dwmac-rk: Remove unused of_gpio.h 2024-03-15 12:14:39 +00:00
dwmac-rzn1.c net: stmmac: dwmac-rzn1: provide select_pcs() implementation 2024-06-14 19:06:40 -07:00
dwmac-socfpga.c net: stmmac: dwmac-socfpga: provide select_pcs() implementation 2024-06-14 19:06:41 -07:00
dwmac-starfive.c net: stmmac: dwmac-starfive: Add support for JH7100 SoC 2024-01-31 10:51:34 +00:00
dwmac-sti.c
dwmac-stm32.c net: stmmac: dwmac-stm32: update err status in case different of stm32mp13 2024-07-02 15:47:13 +02:00
dwmac-sun8i.c net: stmmac: Fix IP-cores specific MAC capabilities 2024-04-16 15:24:53 +02:00
dwmac-sunxi.c net: stmmac: rename stmmac_pltfr_remove_no_dt to stmmac_pltfr_remove 2023-09-18 12:44:36 +01:00
dwmac-tegra.c net: stmmac: rename stmmac_pltfr_remove_no_dt to stmmac_pltfr_remove 2023-09-18 12:44:36 +01:00
dwmac-visconti.c net: stmmac: rename stmmac_pltfr_remove_no_dt to stmmac_pltfr_remove 2023-09-18 12:44:36 +01:00
dwxgmac2_core.c net: stmmac: Correct byte order of perfect_match 2024-07-24 15:11:44 +01:00
dwxgmac2_descs.c
dwxgmac2_dma.c net: stmmac: protect updates of 64-bit statistics counters 2024-02-07 09:00:34 +00:00
dwxgmac2.h net: stmmac: xgmac: fix a typo of register name in DPP safety handling 2024-02-06 13:57:28 +01:00
dwxlgmac2.h
enh_desc.c
hwif.c net: stmmac: Fix EST offset for dwmac 5.10 2024-02-21 17:07:59 -08:00
hwif.h net: stmmac: Correct byte order of perfect_match 2024-07-24 15:11:44 +01:00
Kconfig net: stmmac: add support for RZ/N1 GMAC 2024-05-13 17:20:00 -07:00
Makefile net: stmmac: add support for RZ/N1 GMAC 2024-05-13 17:20:00 -07:00
mmc_core.c net: stmmac: mmc_core: Add GMAC mmc tx/rx missing statistics 2024-04-08 15:19:50 +01:00
mmc.h net: stmmac: mmc_core: Add GMAC mmc tx/rx missing statistics 2024-04-08 15:19:50 +01:00
norm_desc.c
ring_mode.c
stmmac_est.c net: stmmac: est: Per Tx-queue error count for HLBF 2024-01-31 12:24:06 +00:00
stmmac_est.h net: stmmac: Refactor EST implementation 2023-12-04 18:37:39 -08:00
stmmac_ethtool.c net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
stmmac_hwtstamp.c net: stmmac: Assign configured channel value to EXTTS event 2024-06-20 11:56:03 +02:00
stmmac_main.c net: stmmac: Correct byte order of perfect_match 2024-07-24 15:11:44 +01:00
stmmac_mdio.c net: stmmac: Add DW XPCS specified via "pcs-handle" support 2024-07-05 09:35:51 +01:00
stmmac_pci.c
stmmac_pcs.h net: stmmac: remove pcs_rane() method 2024-05-30 18:30:10 -07:00
stmmac_platform.c net: stmmac: unexport stmmac_pltfr_init/exit() 2024-06-20 19:29:34 -07:00
stmmac_platform.h net: stmmac: unexport stmmac_pltfr_init/exit() 2024-06-20 19:29:34 -07:00
stmmac_ptp.c net: stmmac: move the EST structure to struct stmmac_priv 2024-05-13 18:33:10 -07:00
stmmac_ptp.h net: stmmac: use correct PPS capture input index 2023-10-19 13:01:33 +02:00
stmmac_selftests.c netdev: replace napi_reschedule with napi_schedule 2023-10-11 17:28:06 -07:00
stmmac_tc.c net: stmmac: No need to calculate speed divider when offload is disabled 2024-06-18 17:51:52 -07:00
stmmac_xdp.c
stmmac_xdp.h
stmmac.h net: stmmac: move the EST structure to struct stmmac_priv 2024-05-13 18:33:10 -07:00