netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@davemloft.net>
To: herbert@gondor.apana.org.au
Cc: hch@infradead.org, jmorris@redhat.com,
	linux-crypto@vger.kernel.org, netdev@oss.sgi.com
Subject: Re: [RFC] Replace scatterlist with crypto_frag
Date: Mon, 06 Jun 2005 15:46:53 -0700 (PDT)	[thread overview]
Message-ID: <20050606.154653.64001264.davem@davemloft.net> (raw)
In-Reply-To: <20050606124043.GA625@gondor.apana.org.au>

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Mon, 6 Jun 2005 22:40:43 +1000

> However, for skb_frag_t at least going to the 32-bit version on i386
> means at least 72 bytes extra for every skb->data allocation.
> 
> Dave, what are your views on making skb_frag_t bigger?

Good question.

There is an ancillary issue that I'd like to address at
some point, and what you do here is tied into that.

Currently, NETIF_F_SG drivers do one DMA mapping call for
each fragment of the packet.  That totally stinks performance
wise, and the PPC64 and SPARC64 folks feel this the most.

So I wanted to create a set of interfaces ala:

   int dma_map_skb(struct sk_buff *skb, ...);
   void dma_unmap_skb(struct sk_buff *skb, ...);
   void dma_sync_skb_for_cpu(struct sk_buff *skb, ...);
   void dma_sync_skb_for_device(struct sk_buff *skb, ...);

The question is where to put the DMA mapping cookies :-)

On i386 and alike, using something like the DECLARE_PCI_UNMAP_*()
macros would allow us to NOP out the DMA addresses entirely.  Since
they are computable from the page struct and offset.

Note that the above interface, on IOMMU platforms, would allow
DMA coalescing to be performed.  This would hit heavily with
TSO, for example.  Most packets would go out with a maximum of
2 DMA descriptors, 1 for the mapping of skb->data and 1 for
all of the paged SKB data afterwards combined.

Note that, due to this coalescing, the "size" member must be
larger than a __u16.

So I guess I'm taking you a step backwards, I want to make
skb_frag_struct a little bigger :-)  Ie. put the DMA mapping
cookies into the skb_frag_struct, then a set of accessor
macros like we have for scatterlist.  Well, in fact, it would
become a scatterlist and therefore the only thing special
about dma_map_skb() is that is maps a linear buffer via
skb->data then the scatterlist in skb_shared_info(skb).

  parent reply	other threads:[~2005-06-06 22:46 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-03 23:46 [RFC] Replace scatterlist with crypto_frag Herbert Xu
2005-06-04  0:02 ` Jeff Garzik
2005-06-04  0:42   ` Herbert Xu
2005-06-04  4:39     ` James Morris
2005-06-04  4:51       ` Herbert Xu
2005-06-04  5:23         ` James Morris
2005-06-04  5:33           ` Herbert Xu
2005-06-04 10:00     ` Evgeniy Polyakov
2005-06-04  9:55 ` Evgeniy Polyakov
2005-06-04  9:58   ` Herbert Xu
2005-06-04 10:17     ` Evgeniy Polyakov
2005-06-04 10:22       ` Herbert Xu
2005-06-04 10:29         ` Evgeniy Polyakov
2005-06-04 10:32           ` Herbert Xu
2005-06-04 10:40             ` Evgeniy Polyakov
2005-06-06 22:36             ` David S. Miller
2005-06-04 11:23 ` Christoph Hellwig
2005-06-04 11:26   ` Herbert Xu
2005-06-04 11:58     ` Christoph Hellwig
2005-06-06 11:59       ` Herbert Xu
2005-06-06 12:09         ` Christoph Hellwig
2005-06-06 12:40           ` Herbert Xu
2005-06-06 13:30             ` Christoph Hellwig
2005-06-06 22:46             ` David S. Miller [this message]
2005-06-06 23:04               ` Herbert Xu
2005-06-06 23:09                 ` David S. Miller
2005-06-06 23:14                   ` Herbert Xu
2005-06-06 23:18                     ` David S. Miller
2005-06-06 23:20                       ` Herbert Xu
2005-06-06 23:05               ` Jeff Garzik

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=20050606.154653.64001264.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=hch@infradead.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=jmorris@redhat.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=netdev@oss.sgi.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).