From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jesse Brandeburg <jesse.brandeburg@gmail.com>
Cc: Rick Jones <rick.jones2@hp.com>,
Stephen Hemminger <shemminger@vyatta.com>,
Vijay Subramanian <subramanian.vijay@gmail.com>,
tcpdump-workers@lists.tcpdump.org, netdev@vger.kernel.org,
Matthew Vick <matthew.vick@intel.com>,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: Re: twice past the taps, thence out to net?
Date: Fri, 16 Dec 2011 20:34:04 +0100 [thread overview]
Message-ID: <1324064044.2621.20.camel@edumazet-laptop> (raw)
In-Reply-To: <CAEuXFEy02BAL4+=RNOi7u=-4WBvwPpvTOJKPcwND2yxW+hw9FA@mail.gmail.com>
Le vendredi 16 décembre 2011 à 10:28 -0800, Jesse Brandeburg a écrit :
> On Thu, Dec 15, 2011 at 8:27 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > Le jeudi 15 décembre 2011 à 14:22 -0800, Rick Jones a écrit :
> >> On 12/15/2011 11:00 AM, Eric Dumazet wrote:
> >> >> Device's work better if the driver proactively manages stop_queue/wake_queue.
> >> >> Old devices used TX_BUSY, but newer devices tend to manage the queue
> >> >> themselves.
> >> >>
> >> >
> >> > Some 'new' drivers like igb can be fooled in case skb is gso segmented ?
> >> >
> >> > Because igb_xmit_frame_ring() needs skb_shinfo(skb)->nr_frags + 4
> >> > descriptors, igb should stop its queue not at MAX_SKB_FRAGS + 4, but
> >> > MAX_SKB_FRAGS*4
>
> can you please help me understand the need for MAX_SKB_FRAGS * 4 as
> the requirement? Currently driver uses logic like
>
> in hard_start_tx: hey I just finished a tx, I should stop the qdisc if
> I don't have room (in tx descriptors) for a worst case transmit skb
> (MAX_SKB_FRAGS + 4) the next time I'm called.
> when cleaning from interrupt: My cleanup is done, do I have enough
> free tx descriptors (should be MAX_SKB_FRAGS + 4) for a worst case
> transmit? If yes, restart qdisc.
>
> I'm missing the jump from the above logic to using MAX_SKB_FRAGS * 4
> (== (18 * 4) == 72) as the minimum number of descriptors I need for a
> worst case TSO. Each descriptor can point to up to 16kB of contiguous
> memory, typically we use 1 for offload context setup, 1 for skb->data,
> and 1 for each page. I think we may be overestimating with
> MAX_SKB_FRAGS + 4, but that should be no big deal.
Did you read my second patch ?
Problem is you wakeup the queue too soon (16 available descriptors,
while a full TSO packet needs more than that)
How would you explain high 'requeues' number if it was not the problem ?
Also, its suboptimal to wakeup the queue if available space is very low,
since only _one_ packet may be dequeued from qdisc (you pay high cost in
cache line bouncing)
My first patch was about a very rare event : A full TSO packet is
segmented in gso_segment() [ say if you dynamically disable sg on eth
device and an old tcp buffer is retransmitted ] : You end with 16 skbs
delivered to NIC : In this case we can hit tx ring limit at 4th or 5th
skb, and Rick complains tcpdump outputs some packets several times ;)
Since igb needs 4 descriptors for linear skb, I said : 4 *
MAX_SKB_FRAGS, but real problem is addressed in my second patch, I
believe ?
next prev parent reply other threads:[~2011-12-16 19:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-14 19:27 twice past the taps, thence out to net? Rick Jones
2011-12-15 0:58 ` Benjamin Poirier
2011-12-15 2:12 ` Vijay Subramanian
2011-12-15 17:43 ` Eric Dumazet
2011-12-15 18:32 ` Rick Jones
2011-12-15 18:44 ` Stephen Hemminger
2011-12-15 19:00 ` Eric Dumazet
2011-12-15 22:22 ` Rick Jones
2011-12-16 4:27 ` Eric Dumazet
2011-12-16 18:28 ` Jesse Brandeburg
2011-12-16 19:34 ` Eric Dumazet [this message]
2011-12-16 19:35 ` Rick Jones
2011-12-16 19:44 ` Eric Dumazet
2011-12-20 21:21 ` Wyborny, Carolyn
2011-12-15 18:54 ` Eric Dumazet
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=1324064044.2621.20.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=jeffrey.t.kirsher@intel.com \
--cc=jesse.brandeburg@gmail.com \
--cc=matthew.vick@intel.com \
--cc=netdev@vger.kernel.org \
--cc=rick.jones2@hp.com \
--cc=shemminger@vyatta.com \
--cc=subramanian.vijay@gmail.com \
--cc=tcpdump-workers@lists.tcpdump.org \
/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