summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_subr.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2004-12-06 00:43:40 +0000
committeralc <alc@FreeBSD.org>2004-12-06 00:43:40 +0000
commit630d0d083870b74fcb3441a14addcf6de978481f (patch)
tree0a98b373a920dc14287bd0145a2fb88685470255 /sys/kern/kern_subr.c
parent29448bd3e8894f9cdc7c69f422529c405275bd1d (diff)
downloadFreeBSD-src-630d0d083870b74fcb3441a14addcf6de978481f.zip
FreeBSD-src-630d0d083870b74fcb3441a14addcf6de978481f.tar.gz
Update the Tigon 1 and 2 driver to use the sf_buf API for implementing
zero-copy receive of jumbo frames. This eliminates the need for the jumbo frame allocator implemented in kern/uipc_jumbo.c and sys/jumbo.h. Remove it. Note: Zero-copy receive of jumbo frames did not work without these changes; I believe there was insufficient locking on the jumbo vm object. Tested by: ken@ Discussed with: gallatin@
Diffstat (limited to 'sys/kern/kern_subr.c')
-rw-r--r--sys/kern/kern_subr.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c
index 6357c06..48c3af4 100644
--- a/sys/kern/kern_subr.c
+++ b/sys/kern/kern_subr.c
@@ -83,9 +83,7 @@ vm_pgmoveco(vm_map_t mapa, vm_offset_t kaddr, vm_offset_t uaddr)
* First lookup the kernel page.
*/
kern_pg = PHYS_TO_VM_PAGE(vtophys(kaddr));
- /*
- * XXX The vm object containing kern_pg needs locking.
- */
+
if ((vm_map_lookup(&map, uaddr,
VM_PROT_WRITE, &entry, &uobject,
&upindex, &prot, &wired)) != KERN_SUCCESS) {
@@ -111,7 +109,8 @@ vm_pgmoveco(vm_map_t mapa, vm_offset_t kaddr, vm_offset_t uaddr)
else
panic("vm_pgmoveco: renaming busy page");
}
- vm_page_rename(kern_pg, uobject, upindex);
+ vm_page_insert(kern_pg, uobject, upindex);
+ vm_page_dirty(kern_pg);
kern_pg->valid = VM_PAGE_BITS_ALL;
vm_page_unlock_queues();
VM_OBJECT_UNLOCK(uobject);
@@ -221,12 +220,11 @@ userspaceco(void *cp, u_int cnt, struct uio *uio, struct vm_object *obj,
iov = uio->uio_iov;
if (uio->uio_rw == UIO_READ) {
if ((so_zero_copy_receive != 0)
- && (obj != NULL)
+ && (obj == NULL)
&& ((cnt & PAGE_MASK) == 0)
&& ((((intptr_t) iov->iov_base) & PAGE_MASK) == 0)
&& ((uio->uio_offset & PAGE_MASK) == 0)
&& ((((intptr_t) cp) & PAGE_MASK) == 0)
- && (obj->type == OBJT_DEFAULT)
&& (disposable != 0)) {
/* SOCKET: use page-trading */
/*
OpenPOWER on IntegriCloud