From: Paul Barker Date: Tue, 15 Oct 2024 13:36:31 +0000 (+0100) Subject: net: ravb: Simplify UDP TX checksum offload X-Git-Tag: v6.13-rc1~135^2~282 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e63b5fd02a00aab8e79691359e931dafcd9dfd05;p=thirdparty%2Fkernel%2Flinux.git net: ravb: Simplify UDP TX checksum offload The GbEth IP will pass through a zero UDP checksum without asserting any error flags so we do not need to resort to software checksum calculation in this case. Reviewed-by: Sergey Shtylyov Signed-off-by: Paul Barker Signed-off-by: Andrew Lunn --- diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index ca8f785b96b4c..80c0d36bffcb8 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2075,20 +2075,11 @@ static bool ravb_can_tx_csum_gbeth(struct sk_buff *skb) switch (ip->protocol) { case IPPROTO_TCP: - break; case IPPROTO_UDP: - /* If the checksum value in the UDP header field is 0, TOE does - * not calculate checksum for UDP part of this frame as it is - * optional function as per standards. - */ - if (udp_hdr(skb)->check == 0) - return false; - break; + return true; default: return false; } - - return true; } /* Packet transmit function for Ethernet AVB */