[PATCH net-next v2 4/4] net: xilinx: axienet: Relax partial rx checksum checks

From: Sean Anderson
Date: Mon Sep 09 2024 - 12:11:33 EST


The partial rx checksum feature computes a checksum over the entire
packet, regardless of the L3 protocol. Remove the check for IPv4.
Additionally, testing with csum.py (from kselftests) shows no anomalies
with 64-byte packets, so we can remove that check as well.

Signed-off-by: Sean Anderson <sean.anderson@xxxxxxxxx>
Reviewed-by: Simon Horman <horms@xxxxxxxxxx>
---
Testing was performed with csum.py between two axienet netdevs. I also tested
with a macb netdev, but I saw some errors due to 007e4ba3ee13 ("net: macb:
initialize checksum when using checksum offloading"). I also tested
manually with a dpaa netdev, but I wasn't set up for ssh.

Changes in v2:
- Expand commit message with testing methodology

drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index 2f7ab0922aed..4185c5708742 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -1188,9 +1188,7 @@ static int axienet_rx_poll(struct napi_struct *napi, int budget)
csumstatus == XAE_IP_UDP_CSUM_VALIDATED) {
skb->ip_summed = CHECKSUM_UNNECESSARY;
}
- } else if ((lp->features & XAE_FEATURE_PARTIAL_RX_CSUM) != 0 &&
- skb->protocol == htons(ETH_P_IP) &&
- skb->len > 64) {
+ } else if (lp->features & XAE_FEATURE_PARTIAL_RX_CSUM) {
skb->csum = be32_to_cpu(cur_p->app3 & 0xFFFF);
skb->ip_summed = CHECKSUM_COMPLETE;
}
--
2.35.1.1320.gc452695387.dirty