Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: stmmac: Add DW QoS Eth v4/v5 ip payload error statistics

Add DW QoS Eth v4/v5 ip payload error statistics, and rename descriptor
bit macro because v4/v5 descriptor IPCE bit claims ip checksum
error or TCP/UDP/ICMP segment length error.

Here is bit description from DW QoS Eth data book(Part 19.6.2.2)

bit7 IPCE: IP Payload Error
When this bit is programmed, it indicates either of the following:
1).The 16-bit IP payload checksum (that is, the TCP, UDP, or ICMP
checksum) calculated by the MAC does not match the corresponding
checksum field in the received segment.
2).The TCP, UDP, or ICMP segment length does not match the payload
length value in the IP Header field.
3).The TCP, UDP, or ICMP segment length is less than minimum allowed
segment length for TCP, UDP, or ICMP.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
Link: https://patch.msgid.link/20241008111443.81467-1-minda.chen@starfivetech.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Minda Chen and committed by
Jakub Kicinski
0a316b16 3a1beabe

+3 -1
+2
drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
··· 118 118 x->ipv4_pkt_rcvd++; 119 119 if (rdes1 & RDES1_IPV6_HEADER) 120 120 x->ipv6_pkt_rcvd++; 121 + if (rdes1 & RDES1_IP_PAYLOAD_ERROR) 122 + x->ip_payload_err++; 121 123 122 124 if (message_type == RDES_EXT_NO_PTP) 123 125 x->no_ptp_rx_msg_type_ext++;
+1 -1
drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.h
··· 95 95 #define RDES1_IPV4_HEADER BIT(4) 96 96 #define RDES1_IPV6_HEADER BIT(5) 97 97 #define RDES1_IP_CSUM_BYPASSED BIT(6) 98 - #define RDES1_IP_CSUM_ERROR BIT(7) 98 + #define RDES1_IP_PAYLOAD_ERROR BIT(7) 99 99 #define RDES1_PTP_MSG_TYPE_MASK GENMASK(11, 8) 100 100 #define RDES1_PTP_PACKET_TYPE BIT(12) 101 101 #define RDES1_PTP_VER BIT(13)