netdev
[Top] [All Lists]

Re: [PATCH 2.6.8.1-mm4 8/11] r8169: Tx checksum offload

To: Francois Romieu <romieu@xxxxxxxxxxxxx>
Subject: Re: [PATCH 2.6.8.1-mm4 8/11] r8169: Tx checksum offload
From: Jeff Garzik <jgarzik@xxxxxxxxx>
Date: Sat, 28 Aug 2004 19:15:26 -0400
Cc: akpm@xxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <20040823225505.GH20726@electric-eye.fr.zoreil.com>
References: <20040823224100.GA14680@electric-eye.fr.zoreil.com> <20040823224425.GA20726@electric-eye.fr.zoreil.com> <20040823224548.GB20726@electric-eye.fr.zoreil.com> <20040823224706.GC20726@electric-eye.fr.zoreil.com> <20040823224813.GD20726@electric-eye.fr.zoreil.com> <20040823224927.GE20726@electric-eye.fr.zoreil.com> <20040823225120.GF20726@electric-eye.fr.zoreil.com> <20040823225335.GG20726@electric-eye.fr.zoreil.com> <20040823225505.GH20726@electric-eye.fr.zoreil.com>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803
Francois Romieu wrote:
+static inline u32 rtl8169_tx_csum(struct sk_buff *skb)
+{
+       if (skb->ip_summed == CHECKSUM_HW) {
+               const struct iphdr *ip = skb->nh.iph;
+
+               if (ip->protocol == IPPROTO_TCP)
+                       return IPCS | TCPCS;
+               else if (ip->protocol == IPPROTO_UDP)
+                       return IPCS | UDPCS;
+               BUG();
+       }
+       return 0;
+}

I am applying this patch BUT... BUG() is a bit too "rude" when you can obviously return safely. Prefer WARN_ON() because we don't need to kill the machine for this condition.





<Prev in Thread] Current Thread [Next in Thread>