netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Zhu Yanjun <yanjun.zhu@oracle.com>
Cc: rain.1986.08.12@gmail.com, davem@davemloft.net,
	netdev@vger.kernel.org,
	Alexander Duyck <alexander.duyck@gmail.com>
Subject: Re: [PATCH] net: forcedeth: add xmit_more support
Date: Tue, 22 Oct 2019 08:40:19 -0700	[thread overview]
Message-ID: <20191022084019.72c92347@cakuba.netronome.com> (raw)
In-Reply-To: <c728e606-c449-d72a-5b3a-fb457b0c34ff@oracle.com>

On Tue, 22 Oct 2019 13:32:35 +0800, Zhu Yanjun wrote:
> On 2019/10/21 23:33, Jakub Kicinski wrote:
> > On Mon, 21 Oct 2019 17:56:06 +0800, Zhu Yanjun wrote:  
> >> On 2019/10/19 6:48, Jakub Kicinski wrote:  
> >>> On Fri, 18 Oct 2019 06:01:25 -0400, Zhu Yanjun wrote:  
> >>>> This change adds support for xmit_more based on the igb commit 6f19e12f6230
> >>>> ("igb: flush when in xmit_more mode and under descriptor pressure") and
> >>>> commit 6b16f9ee89b8 ("net: move skb->xmit_more hint to softnet data") that
> >>>> were made to igb to support this feature. The function netif_xmit_stopped
> >>>> is called to check if transmit queue on device is currently unable to send
> >>>> to determine if we must write the tail because we can add no further
> >>>> buffers.
> >>>> When normal packets and/or xmit_more packets fill up tx_desc, it is
> >>>> necessary to trigger NIC tx reg.  
> >>> Looks broken. You gotta make sure you check the kick on _every_ return
> >>> path. There are 4 return statements in each function, you only touched
> >>> 2.  
> >> In nv_start_xmit,
> >>
> >> [...]
> >>
> >> The above are dma_mapping_error. It seems that triggering NIC HW xmit is
> >> not needed.
> >>
> >> So when "tx_desc full" error, HW NIC xmit is triggerred. When
> >> dma_mapping_error,
> >>
> >> NIC HW xmit is not triggerred.
> >>
> >> That is why only 2 "return" are touched.  
> > Imagine you have the following sequence of frames:
> >
> > 	skbA  | xmit_more() == true
> > 	skbB  | xmit_more() == true
> > 	skbC  | xmit_more() == true
> > 	skbD  | xmit_more() == false
> >
> > A, B, and C got queued successfully but the driver didn't kick the
> > queue because of xmit_more(). Now D gets dropped due to a DMA error.
> > Queue never gets kicked.  
> 
> DMA error is a complicated problem. We will delve into this problem later.
> 
>  From the above commit log, this commit is based on the igb commit 
> 6f19e12f6230
> ("igb: flush when in xmit_more mode and under descriptor pressure") and
> commit 6b16f9ee89b8 ("net: move skb->xmit_more hint to softnet data").
> 
> It seems that the 2 commits did not consider the DMA errors that you 
> mentioned.

Then igb is buggy, too.

  reply	other threads:[~2019-10-22 15:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-18 10:01 [PATCH] net: forcedeth: add xmit_more support Zhu Yanjun
2019-10-18 22:48 ` Jakub Kicinski
2019-10-21  9:56   ` Zhu Yanjun
2019-10-21 15:33     ` Jakub Kicinski
2019-10-22  5:32       ` Zhu Yanjun
2019-10-22 15:40         ` Jakub Kicinski [this message]
2019-10-23  0:45           ` Zhu Yanjun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191022084019.72c92347@cakuba.netronome.com \
    --to=jakub.kicinski@netronome.com \
    --cc=alexander.duyck@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=rain.1986.08.12@gmail.com \
    --cc=yanjun.zhu@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).