Re: [PATCH 2.6] netpoll: prevent transmission stall

From: Matt Mackall
Date: Thu Apr 08 2004 - 09:09:23 EST


On Thu, Apr 08, 2004 at 12:39:25PM +0200, Stelian Pop wrote:
> While working on kgdb over netpoll I found out another bug in
> netpoll.
>
> This one is in netpoll_send_skb(), and it is triggered by
> sending repeatedly more packets than the transmit buffers the
> ethernet card has, while being in the netpoll_trap. (this is
> rapidly triggered by kgdb when using a card with limited
> transmit buffers, like my pcmcia NE2000).
>
> One should poll() the ethernet card interrupt function in order
> to get the transmit acks from the card and free the transmit
> buffers in order to be able to transmit more packets.
>
> This is why in the original code, netpoll_send_skb() calls
> netpoll_poll() if dev->hard_start_xmit() fails. However, this
> does not work because netpoll_poll() is called only if
> netif_queue_stopped(). But the net queue functions are overridden
> if netpoll_trap() is on, causing netif_queue_stopped() to never
> return true.
>
> The attached patch 'fixes' this, by forcing a netpoll_poll()
> every time dev->hard_start_xmit() fails. Maybe there is a cleaner
> way to do this by making the queue functions work even under
> netpoll_trap, but it shouldn't really be necessary, I cannot
> see how forcing the netpoll_poll() call could break anything.

Ok, makes sense. I'll queue this up.

--
Matt Mackall : http://www.selenic.com : Linux development and consulting
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/