Subject: Re: [PATCHv2 net-next 2/2] sunvnet: Use one Tx queue per vnet_port

From: Sowmini Varadhan <[email-masked]>
Date: Thu, 6 Nov 2014 11:28:22 -0500

On (11/06/14 16:19), Ben Hutchings wrote:
> > +	txq = netdev_get_tx_queue(port->vp->dev, port->q_index);
> > +	__netif_tx_lock(txq, smp_processor_id());
> > +	if (likely(netif_tx_queue_stopped(txq))) {
> > +		struct vio_dring_state *dr;
> > +
> > +		dr = &port->vio.drings[VIO_DRIVER_TX_RING];
> 
> You seem to have dropped the condition for the netif_tx_wake_queue(),
> which I would guess based on the old code should be:
> 
> 		if (vnet_tx_dring_avail(dr) >= VNET_TX_WAKEUP_THRESH(dr))
> 
> > +			netif_tx_wake_queue(txq);

yes, this was deliberate.

As I indicated in the comments:

/* Got back a STOPPED LDC message on port. If the queue is stopped,
 * wake it up so that we'll send out another START message at the
 * next TX.
 */

We only call maybe_tx_wakeup() if the peer has sent us a STOPPED
ack (meaning that the peer is no longer reading the descriptor rings).
So if our tx queue is full and stopped, we need to poke the peer
on the next TX with a start message. (otherwise we'd never wake up!)

--Sowmini