Re: kernel > 2.1.36 & nfs

Alan Cox (alan@lxorguk.ukuu.org.uk)
Tue, 3 Jun 1997 08:32:25 +0100 (BST)


> However, it is equally correct to say that the current fragment handling
> is broken too - it does an unnecessary packet re-assembly on receive.

This is only a tiny part of the issue.

> 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.

> UDP packets on receive without reassembling them - that would get better
> NFS performance due to getting rid of the copy, and it would also result
> in better network buffer allocation.

Its a partial fix.

What is really needed is something like

buffer=vreserve(65536); /* Allocate 64K of address space */

err=vfill(buffer, len, GFP_..); /* Put pages in where needed */
if(err==-ENOMEM) /* No pages */

vfree(buffer)

and the following other operations

for(i=vhead(buffer);i!=NULL;i=vnext(i))
{
scatter_gather[x]->ptr=virt_to_bus(vptr(i));
scatter_gather[x]->len=virt_to_bus(vlen(i));
}

x=simple_vbuf(x) /* Test if buffer has a simple linear
translation to physical */

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

skb=skb_dmalinear(skb)

can return the buffer for most cases (not overlapping a page where the
data is), or a copy for the rare case it isnt and NULL for awkward cases where
we have to copy and have no RAM. That will make fixing up most drivers simple.

Alan