Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jan 2007 23:38:49 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 113738 for review
Message-ID:  <200701302338.l0UNcnFo085650@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=113738

Change 113738 by rwatson@rwatson_peppercorn on 2007/01/30 23:38:17

	For now, entirely disable the uiomove in bpfread().  Still thinking
	through this, but we may want to make bpfread() be a per-buffer
	mode method, rather than making uiomove() vary.

Affected files ...

.. //depot/projects/zcopybpf/src/sys/net/bpf_zerocopy.c#4 edit

Differences ...

==== //depot/projects/zcopybpf/src/sys/net/bpf_zerocopy.c#4 (text+ko) ====

@@ -358,13 +358,9 @@
 }
 
 /*
- * Copy memory from BPF buffer to userspace.
- *
- * Since the memory is already shared, we just return (0) and allow this to
- * be a notification that the buffer is ready to be returned to service.  The
- * pointer to the buffer is ignored.
- *
- * XXX: Semantically dubious.
+ * For now, allow bpfread() to rotate the buffers, but don't perform a copy
+ * operation or return a value.  If we want to copy, we'll need to implement
+ * scatter-gather copying with a series of uiomove calls here.
  */
 int
 bpf_zerocopy_uiomove(struct bpf_d *d, caddr_t buf, u_int len,
@@ -377,8 +373,7 @@
 	// printf("bpf_zerocopy_uiomove(d: %p, buf: %p, len: %d, uio: %p)\n", d,
 	//     buf, len, uio);
 
-	uio->uio_resid -= d->bd_bufsize;
-	return (0);
+	return (EOPNOTSUPP);
 }
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701302338.l0UNcnFo085650>