From af86f489a4cc715382124da96a726b3274bee9aa Mon Sep 17 00:00:00 2001 From: Denis Kirjanov Date: Jan 30 2024 13:42:48 +0000 Subject: net: stmmac: don't overwrite discard_frame status (git-fixes). --- diff --git a/patches.suse/net-stmmac-don-t-overwrite-discard_frame-status.patch b/patches.suse/net-stmmac-don-t-overwrite-discard_frame-status.patch new file mode 100644 index 0000000..a7c6f93 --- /dev/null +++ b/patches.suse/net-stmmac-don-t-overwrite-discard_frame-status.patch @@ -0,0 +1,40 @@ +From 81b3e757c5f28385ea6b01886111e2d33f0225fe Mon Sep 17 00:00:00 2001 +From: Aaro Koskinen +Date: Wed, 27 Mar 2019 22:35:38 +0200 +Subject: [PATCH 3/4] net: stmmac: don't overwrite discard_frame status +Git-commit: 1b746ce8b397e58f9e40ce5c63b7198de6930482 +References: git-fixes +Patch-mainline: v5.1-rc4 + +If we have error bits set, the discard_frame status will get overwritten +by checksum bit checks, which might set the status back to good one. +Fix by checking the COE status only if the frame is good. + +Signed-off-by: Aaro Koskinen +Signed-off-by: David S. Miller +Signed-off-by: Denis Kirjanov +--- + drivers/net/ethernet/stmicro/stmmac/enh_desc.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c +index a2a14def80a9..f2150efddc88 100644 +--- a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c ++++ b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c +@@ -236,9 +236,10 @@ static int enh_desc_get_rx_status(void *data, struct stmmac_extra_stats *x, + * It doesn't match with the information reported into the databook. + * At any rate, we need to understand if the CSUM hw computation is ok + * and report this info to the upper layers. */ +- ret = enh_desc_coe_rdes0(!!(rdes0 & RDES0_IPC_CSUM_ERROR), +- !!(rdes0 & RDES0_FRAME_TYPE), +- !!(rdes0 & ERDES0_RX_MAC_ADDR)); ++ if (likely(ret == good_frame)) ++ ret = enh_desc_coe_rdes0(!!(rdes0 & RDES0_IPC_CSUM_ERROR), ++ !!(rdes0 & RDES0_FRAME_TYPE), ++ !!(rdes0 & ERDES0_RX_MAC_ADDR)); + + if (unlikely(rdes0 & RDES0_DRIBBLING)) + x->dribbling_bit++; +-- +2.16.4 + diff --git a/series.conf b/series.conf index 2fda476..0689745 100644 --- a/series.conf +++ b/series.conf @@ -48895,6 +48895,7 @@ patches.suse/bpf-fix-use-after-free-in-bpf_evict_inode.patch patches.suse/xdp-fix-cpumap-redirect-SKB-creation-bug.patch patches.suse/net-stmmac-don-t-stop-NAPI-processing-when-dropping-.patch + patches.suse/net-stmmac-don-t-overwrite-discard_frame-status.patch patches.suse/net-stmmac-fix-dropping-of-multi-descriptor-RX-frame.patch patches.suse/net-stmmac-don-t-log-oversized-frames.patch patches.suse/tipc-check-bearer-name-with-right-length-in-tipc_nl_.patch