> the rx urb twice, in the completion handler and in the tasklet ?
Ahum, no. Rx urb is resubmited only if there is available sk_buff
_and_ default Rx urb (dev->rx_urb) == NULL. Which is the right thing
to do. Instead I've found possible memory leak in rx_fixup after
looking at ti closely. :-)
> Further you still don't solve the issue of rx dying due to low memory
> in urb submission.
Yes, kind of. I kill it if dev->rx_urb is zero which is supposed to be
fixed by the tasklet. This may only happen if read_bulk_callback is
called twice before the tasklet get executed. I moved this check below
the tasklet reschedule.
Here is the patch for review.
Petko
--- /usr/src/usb-2.5/drivers/usb/net/rtl8150.c Thu Apr 11 13:45:20 2002
+++ rtl8150.c Thu Apr 11 13:42:42 2002
@@ -318,6 +318,8 @@
goto goon;
}
+ tasklet_schedule(&dev->tl);
+
if (!dev->rx_skb) {
/* lost packets++ */
return;
@@ -333,8 +335,6 @@
dev->stats.rx_packets++;
dev->stats.rx_bytes += pkt_len;
- tasklet_schedule(&dev->tl);
-
skb = pull_skb(dev);
if (!skb) {
dev->rx_skb = NULL;
@@ -358,13 +358,12 @@
dev = (rtl8150_t *)data;
fill_skb_pool(dev);
- skb = pull_skb(dev);
- if (!skb) {
+ if (dev->rx_skb)
+ return;
+ if (!(skb = pull_skb(dev))) {
tasklet_schedule(&dev->tl);
return;
}
- if (dev->rx_skb)
- return;
dev->rx_skb = skb;
FILL_BULK_URB(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1),
dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev);