[patch] 2.3.99-pre plip fixes

From: Ivan Kokshaysky (ink@jurassic.park.msu.ru)
Date: Thu Apr 06 2000 - 12:04:34 EST


The patch fixes
 - connection freeze on large transfers (stopped queue)
 - IP header alignment as in other network drivers
   (important for non-i386 platforms)

Ivan.

--- 2.3.99-pre3/drivers/net/plip.c Mon Mar 13 06:18:55 2000
+++ linux/drivers/net/plip.c Thu Apr 6 18:41:49 2000
@@ -687,11 +687,12 @@
                         return ERROR;
                 }
                 /* Malloc up new buffer. */
- rcv->skb = dev_alloc_skb(rcv->length.h);
+ rcv->skb = dev_alloc_skb(rcv->length.h + 2);
                 if (rcv->skb == NULL) {
                         printk(KERN_ERR "%s: Memory squeeze.\n", dev->name);
                         return ERROR;
                 }
+ skb_reserve(rcv->skb, 2); /* Align IP on 16 byte boundaries */
                 skb_put(rcv->skb,rcv->length.h);
                 rcv->skb->dev = dev;
                 rcv->state = PLIP_PK_DATA;
@@ -989,7 +990,7 @@
 
         switch (nl->connection) {
         case PLIP_CN_CLOSING:
- netif_start_queue (dev);
+ netif_wake_queue (dev);
         case PLIP_CN_NONE:
         case PLIP_CN_SEND:
                 dev->last_rx = jiffies;
@@ -1035,7 +1036,7 @@
         if (skb->len > dev->mtu + dev->hard_header_len) {
                 printk(KERN_WARNING "%s: packet too big, %d.\n", dev->name, (int)skb->len);
                 netif_start_queue (dev);
- return 0;
+ return 1;
         }
 
         if (net_debug > 2)
@@ -1054,7 +1055,6 @@
         mark_bh(IMMEDIATE_BH);
         spin_unlock_irq(&nl->lock);
         
- netif_start_queue (dev);
         return 0;
 }
 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Apr 07 2000 - 21:00:17 EST