From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Sun, 3 Aug 2008 16:55:53 +0800
So I had this idea. My goal is to minimize the number of DMA
mappings the driver has to make.
We don't touch anything in the original TSO skb. However we expand
the headroom (if necessary) and in the area in front of skb->data we
build the header areas for the sub-TSO frames, one by one.
We give the driver some iterator functions that walk through the
header areas and compute offset/length pairs into the
skb_shared_info() page list.
So basically the number of DMA mappings to make would be identical
to the number necessary for TSO capable hardware. And at the
top level we can arrange it such that the headroom will be large
enough already in the cases that matter.
The only fly in the ointment is that the driver has to store these
DMA mapping cookies away somewhere, because what's going to happen
is the driver will directly DMA map the skb_shared_info() area pages
but then slice and adjust DMA addresses as it unpacks the TSO frame
into the TX ring.
This might be where we get pushed over the edge and have to add a
dma_addr_t to sk_buff and skb_frag_struct. And that might not
be such a bad thing because it will allow other things that
we've always wanted to do.
Another nice aspect of this idea is that we can make the existing GSO
code just build this funny "TSO plus hidden headers" SKB, and then do
the by-hand unpacking into new SKB chunks that we will let smart
drivers do directly into their TX rings.
Herbert what do you think?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html