On Tue, 3 Jun 1997, Alan Cox wrote:> > > This re-assembly simplifies some code, but it not only has a bad impact> > on memory management, it also involves a "useless" copy operation. > > That "useless" operation is somewhat temporary - its only useless because> we dont reassemble and checksum in one pass. Also ATM already and HIPPI> very soon will be giving us 65280 byte frames that are not fragmented.

The point is that the copy is _never_ needed - we'd be better off justleaving the packets fragmented, and let the higher level protocols (tcpand udp) take care of "reassembly" (ie copy them to user mode or to thepage cache and only _then_ do we make the DATA contiguous - never theactual packet itself).

Nope. I do not believe that it is a good idea to use virtual memory forstuff like this. SVR4 uses virtual memory for their page cache, and theyonly gain complexity from it.

Using virtual memory is also extremely fragile with SMP. And packetreception is definitly a multi-CPU issue (one CPU takes the actualinterrupt and creates the packet, but it's very possible that the packetwill be used on another CPU).

We don't handle SMP tlb's 100% correctly even for the _normal_ cases rightnow - don't tell me it would be simple to fix the problems when you haveinterrupt driven events that touch the TLB too. That's where I just say"NO" (you can try to convince me, but you'll have a hard and rocky pathdoing that).

For large packets (not fragments) we'll have to look into something else,and it's possible that we could have some kind of "fragment list" for it.That wouldn't be too hard, if only the upper layers knew of thepossibility that the packet (not the header) would be in multiple parts.

> The big problem we hit is that we need to rewrite a pile of DMA driven network> drivers to do scatter gather or at least to spot problems in buffers they> intend to DMA. Generally speaking it will be fine - something like

Hah. That's only _one_ of many problems with using virtual memory. Forgetthe idea of virtual memory - you're just setting yourself up for moreproblems than you really want.