All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Ioana Ciornei' <ioana.ciornei@nxp.com>
Cc: 'Daniel Thompson' <daniel.thompson@linaro.org>,
	"linux-netdev@vger.kernel.org" <linux-netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH RESEND net-next 1/2] dpaa2-eth: send a scatter-gather FD instead of realloc-ing
Date: Fri, 11 Dec 2020 10:03:47 +0000	[thread overview]
Message-ID: <cc8ec04373a14e8880a6ca35da5c151d@AcuMS.aculab.com> (raw)
In-Reply-To: <20201211093856.gj3do6ntnmxsqtzp@skbuf>

From: Ioana Ciornei
> Sent: 11 December 2020 09:39
> 
> On Fri, Dec 11, 2020 at 09:30:43AM +0000, David Laight wrote:
> > From: Daniel Thompson
> > > Sent: 10 December 2020 17:32
> > >
> > > On Mon, Jun 29, 2020 at 06:47:11PM +0000, Ioana Ciornei wrote:
> > > > Instead of realloc-ing the skb on the Tx path when the provided headroom
> > > > is smaller than the HW requirements, create a Scatter/Gather frame
> > > > descriptor with only one entry.
> >
> > Is it worth simplifying the code by permanently allocating (and dma-mapping)
> > the extra structure for every ring entry.
> > It is (probably) only one page and 1 iommu entry.
> 
> 
> That is exactly what I was thinking. At the moment the SGT structure is
> pre-allocated but not pre-mapped.
> 
> I'll let you know how it goes.

How much does the dma-map actually cost?
For short fragments it is probably worth copying into a pre-allocated
pre-mapped transmit buffer area.
You'd want to do aligned full-word copies and use separate cache lines
for each frame.
It does make tx setup more error prone - since you need the space in
the tx buffer area as well as in the tx ring.

For one OS (not sun's) on a sparc mbus+sbus system one of my colleagues
measured a cutoff point of about 1k.

The copy to tx buffer path also helps with the pathological skb that
are 1500 bytes in 1 byte fragments.
(Maybe skb can't get that bad, but I've seen that on other OS.)

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


  reply	other threads:[~2020-12-11 10:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200629184712.12449-2-ioana.ciornei () nxp ! com>
2020-12-10 17:31 ` [PATCH RESEND net-next 1/2] dpaa2-eth: send a scatter-gather FD instead of realloc-ing Daniel Thompson
2020-12-10 18:06   ` Ioana Ciornei
2020-12-11  7:21     ` Jon Nettleton
2020-12-11 14:01     ` Ioana Ciornei
2020-12-11 16:29       ` Daniel Thompson
2020-12-11 16:54         ` Ioana Ciornei
2020-12-12 15:58           ` Jon Nettleton
2020-12-12 19:31             ` Ioana Ciornei
2020-12-11  9:30   ` David Laight
2020-12-11  9:38     ` Ioana Ciornei
2020-12-11 10:03       ` David Laight [this message]
2020-06-29 18:47 [PATCH RESEND net-next 0/2] " Ioana Ciornei
2020-06-29 18:47 ` [PATCH RESEND net-next 1/2] " Ioana Ciornei

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=cc8ec04373a14e8880a6ca35da5c151d@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=daniel.thompson@linaro.org \
    --cc=ioana.ciornei@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.