net: stmmac: xgmac: fix l4 filter port overwrite on register update
authorNazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
Tue, 14 Jul 2026 02:37:14 +0000 (19:37 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 23 Jul 2026 10:32:14 +0000 (12:32 +0200)
commit9fcf274d93af17396f20cccb63f1d4c17492a000
tree653594f3e1ff6b4ae797e71c5dd8a39bc52faef7
parent980a813452754f8001704744e92f7aa697c53dd3
net: stmmac: xgmac: fix l4 filter port overwrite on register update

The XGMAC_L4_ADDR register holds both source and destination port
match values. The current implementation overwrites the entire register
when configuring either port, so setting one silently erases the other.

Fix this by reading the register first, then masking and updating only
the relevant field before writing back.

Fixes: 425eabddaf0f ("net: stmmac: Implement L3/L4 Filters using TC Flower")
Signed-off-by: Rohan G Thomas <rohan.g.thomas@altera.com>
Signed-off-by: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20260714023716.29865-3-muhammad.nazim.amirul.nazle.asmade@altera.com
Reviewed-by: Jakub Raczynski <j.raczynski@samsung.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c