Re: using software TSO on non-TSO capable netdevices

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: David Miller
Date: Wednesday, August 6, 2008 - 11:07 pm

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
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
using software TSO on non-TSO capable netdevices, Lennert Buytenhek, (Wed Jul 30, 4:50 pm)
Re: using software TSO on non-TSO capable netdevices, David Miller, (Wed Jul 30, 4:56 pm)
Re: using software TSO on non-TSO capable netdevices, Lennert Buytenhek, (Wed Jul 30, 5:41 pm)
Re: using software TSO on non-TSO capable netdevices, David Miller, (Wed Jul 30, 6:10 pm)
Re: using software TSO on non-TSO capable netdevices, Lennert Buytenhek, (Wed Jul 30, 6:45 pm)
Re: using software TSO on non-TSO capable netdevices, Herbert Xu, (Wed Jul 30, 7:29 pm)
Re: using software TSO on non-TSO capable netdevices, Lennert Buytenhek, (Wed Jul 30, 7:36 pm)
Re: using software TSO on non-TSO capable netdevices, Herbert Xu, (Wed Jul 30, 8:03 pm)
Re: using software TSO on non-TSO capable netdevices, Herbert Xu, (Wed Jul 30, 8:54 pm)
Re: using software TSO on non-TSO capable netdevices, Ilpo Järvinen, (Wed Jul 30, 11:55 pm)
Re: using software TSO on non-TSO capable netdevices, Ilpo Järvinen, (Thu Jul 31, 12:34 am)
Re: using software TSO on non-TSO capable netdevices, Lennert Buytenhek, (Thu Jul 31, 2:39 am)
Re: using software TSO on non-TSO capable netdevices, Lennert Buytenhek, (Thu Jul 31, 2:45 am)
Re: using software TSO on non-TSO capable netdevices, Lennert Buytenhek, (Thu Jul 31, 2:50 am)
Re: using software TSO on non-TSO capable netdevices, Lennert Buytenhek, (Thu Jul 31, 3:14 am)
Re: using software TSO on non-TSO capable netdevices, David Miller, (Thu Jul 31, 3:16 am)
Re: using software TSO on non-TSO capable netdevices, Ilpo Järvinen, (Thu Jul 31, 3:27 am)
Re: using software TSO on non-TSO capable netdevices, Herbert Xu, (Thu Jul 31, 3:55 am)
Re: using software TSO on non-TSO capable netdevices, Lennert Buytenhek, (Thu Jul 31, 5:25 am)
Re: using software TSO on non-TSO capable netdevices, David Miller, (Thu Jul 31, 5:35 am)
Re: using software TSO on non-TSO capable netdevices, Lennert Buytenhek, (Thu Jul 31, 5:37 am)
Re: using software TSO on non-TSO capable netdevices, Herbert Xu, (Thu Jul 31, 5:59 am)
Re: using software TSO on non-TSO capable netdevices, Ben Hutchings, (Thu Jul 31, 6:19 am)
Re: using software TSO on non-TSO capable netdevices, Herbert Xu, (Thu Jul 31, 6:27 am)
Re: using software TSO on non-TSO capable netdevices, Rick Jones, (Thu Jul 31, 10:00 am)
Re: using software TSO on non-TSO capable netdevices, Lennert Buytenhek, (Thu Jul 31, 10:45 am)
Re: using software TSO on non-TSO capable netdevices, David Miller, (Sun Aug 3, 1:19 am)
Re: using software TSO on non-TSO capable netdevices, David Miller, (Sun Aug 3, 1:23 am)
Re: using software TSO on non-TSO capable netdevices, David Miller, (Wed Aug 6, 11:07 pm)
Re: using software TSO on non-TSO capable netdevices, Herbert Xu, (Wed Aug 6, 11:15 pm)
Re: using software TSO on non-TSO capable netdevices, Lennert Buytenhek, (Thu Aug 7, 4:50 am)
Re: using software TSO on non-TSO capable netdevices, David Miller, (Thu Aug 7, 3:44 pm)
Re: using software TSO on non-TSO capable netdevices, David Miller, (Thu Sep 11, 9:08 pm)