[parisc-linux-cvs] tcp.c hack

Grant Grundler grundler@puffin.external.hp.com
Wed, 16 May 2001 15:50:07 -0600


I've committed the following hack as a workaround until we merge to 2.4.4.

grant

Index: net/ipv4/tcp.c
===================================================================
RCS file: /home/cvs/parisc/linux/net/ipv4/tcp.c,v
retrieving revision 1.9
diff -u -p -r1.9 tcp.c
--- tcp.c	2001/02/02 03:37:24	1.9
+++ tcp.c	2001/05/16 21:42:18
@@ -953,11 +953,29 @@ int tcp_sendmsg(struct sock *sk, struct 
 			 * built packet we can tack some data onto.
 			 */
 			skb = sk->write_queue.prev;
+#ifndef __hppa__
+/*
+** Avoid skb_over_panic() called by skb_put().
+** When rsyncing from A500 to other box, 64-bit kernel crashes with
+** NULL ptr deref (trap 26,) in tulip_rx() after printing:
+skput:over: 000000001026e0ac:1436 put:-12 dev:<NULL>kernel BUG at skbuff.c:93!
+** Format is insn_address:buflen  putsize, skb->dev value
+** insn_address points to txn_sendmsg+714.
+** "-12" value seems to be a problem.
+**
+** The code I'm omitting seems to try to coalesce data heading
+** for the same destination into bigger packets.
+**
+** Not chasing this down since tcp.c has been rewritten
+** between 2.4.0 and 2.4.4. 
+** Getting ~2MB/s w/o this code doing rsync via ssh over private 100BT
+** switch (a500 to lxr8000 - tulip to 3com905b respectively).
+*/
 			if (tp->send_head &&
 			    (mss_now - skb->len) > 0) {
 				copy = skb->len;
 				if (skb_tailroom(skb) > 0) {
-					int last_byte_was_odd = (copy % 4);
+					int last_byte_was_odd = (copy % sizeof(unsigned long));
 
 					copy = mss_now - copy;
 					if(copy > skb_tailroom(skb))
@@ -1009,7 +1027,7 @@ int tcp_sendmsg(struct sock *sk, struct 
 					tp->pushed_seq = tp->write_seq;
 				}
 			}
-
+#endif /* !__hppa__ */
 			copy = min(seglen, mss_now);
 
 			/* Determine how large of a buffer to allocate.  */