Subject: Re: [PATCH 2/2] ixgbe: support skb->xmit_more in netdev_ops->ndo_start_xmit()

From: Alexander Duyck <[email-masked]>
Date: Tue, 26 Aug 2014 08:00:10 -0700

On 08/25/2014 04:35 PM, David Miller wrote:
> 
> From: Daniel Borkmann <[email-masked]>
> 
> This implements the deferred tail pointer flush API for the ixgbe
> driver. Similar version also proposed longer time ago by Alexander Duyck.
> 
> Signed-off-by: Daniel Borkmann <[email-masked]>
> Signed-off-by: David S. Miller <[email-masked]>
> ---
>  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> index 87bd53f..ba9ceaa 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> @@ -6958,9 +6958,10 @@ static void ixgbe_tx_map(struct ixgbe_ring *tx_ring,
>  
>  	tx_ring->next_to_use = i;
>  
> -	/* notify HW of packet */
> -	ixgbe_write_tail(tx_ring, i);
> -
> +	if (!skb->xmit_more) {
> +		/* notify HW of packet */
> +		ixgbe_write_tail(tx_ring, i);
> +	}
>  	return;
>  dma_error:
>  	dev_err(tx_ring->dev, "TX DMA map failed\n");
> 

It might help to add some handling for the case where xmit_more is set,
but the ring has become full.  This current implementation introduces
the risk of triggering a Tx hang.

My advice would be to pull the ixgbe_maybe_stop_tx code at the end of
xmit_frame into the if check here, and perhaps look into adding an
additional check to see if BQL has stopped the ring as well.

Thanks,

Alex