Re: [PATCH v3 2/5] staging: et131x: drop packet when error occurs in et131x_tx

ZHAO Gang
2013-11-22T12:26:05Z

On Fri, Nov 22, 2013 at 7:56 PM, Denis Kirjanov <kirjanov@gmail.com> wrote:
> If you have no free TX descriptors that means that something went
> wrong and it's a BUG. You have to tell the stack to stop sending
> packets using netif_stop_queue() and reenable transmissions once tx
> descriptors will be available. There are a lot of live examples in the
> source tree.
>
The stop queue code dose not show in the diff, actually it is at the
beginning of et131x_tx:

/* stop the queue if it's getting full */
if (adapter->tx_ring.used >= NUM_TCB - 1 &&
!netif_queue_stopped(netdev))
netif_stop_queue(netdev);

I think the logic is when there is only one descriptor left, stop the
queue and transmit this packet, if tx queue is full, it must have been
stopped, so just drop the packet.

Cheers