[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1551EAE59135BE47B544934E30FC4FC094012F@nt-irva-0751.brcm.ad.broadcom.com>
Date: Fri, 18 May 2007 00:04:08 -0700
From: "Michael Chan" <mchan@...adcom.com>
To: "David Miller" <davem@...emloft.net>
cc: rdreier@...co.com, ak@...e.de, krkumar2@...ibm.com,
netdev@...r.kernel.org
Subject: Re: [RFC] New driver API to speed up small packets xmits
David Miller wrote:
> From: "Michael Chan" <mchan@...adcom.com>
> Date: Tue, 15 May 2007 15:05:28 -0700
>
> > For each gso_seg, there will be a header and the payload may span 2
> > pages for 1500-byte packets. We always assume 1500-byte packets
> > because the buggy chips do not support jumbo frames.
>
> Correct.
>
> I think there may be a case where you could see up to 4 segments.
> If the user corks the TCP socket, does a sendmsg() (which puts
> the data in the per-socket page) then does a sendfile() you'll
> see something like:
>
> skb->data IP, TCP, ethernet headers, etc.
> page0 sendmsg() data
> page1 sendfile
> page2 sendfile
>
> Ie. this can happen if the sendfile() part starts near the
> end of a page, so it would get split even for a 1500 MTU
> frame.
>
> Even more complex variants are possible if the user does
> tiny sendfile() requests to different pages within the file.
>
> So in fact it can span up to N pages.
>
> But there is an upper limit defined by the original GSO
> frame, and that is controlled by MAX_SKB_FRAGS, so at most
> you would see MAX_SKB_FRAGS plus some small constant.
>
>
I see. Is the following a better estimate?
(gso_segs * 2) + skb_shinfo(skb)->nr_frags
For each gso_seg, you get at least a header segment and a
segment from a page for 1500-byte packets. You can get more
segments if packets cross page boundaries or if there are tiny
sendfile pages or some sendmsg pages mixed in. But these
additional segments will never be more than nr_frags.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists