net: ravb: Simplify UDP TX checksum offload
authorPaul Barker <paul.barker.ct@bp.renesas.com>
Tue, 15 Oct 2024 13:36:31 +0000 (14:36 +0100)
committerAndrew Lunn <andrew@lunn.ch>
Fri, 18 Oct 2024 02:24:24 +0000 (21:24 -0500)
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 <s.shtylyov@omp.ru>
Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
drivers/net/ethernet/renesas/ravb_main.c

index ca8f785b96b4cb8f4ef73ddce5039c567295e731..80c0d36bffcb89a278ed7cdf16e370d5af463c8e 100644 (file)
@@ -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 */