PERFORCE change 113921 for review
Christian S.J. Peron
csjp at FreeBSD.org
Fri Feb 2 21:58:31 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=113921
Change 113921 by csjp at csjp_rnd01 on 2007/02/02 21:58:07
- Drop the Giant requirement for the system calls
- Fix a problem which resulted in select(2)/poll(2) waking up
constantly indicating that the file descriptor was ready to
read. This occured because the old old simply looked at the
size of the hold buffer and used that to indicate that there
was data ready to read. In the old world order we used set
the hold buffer length to 0 after bpf_uiomove() returned.
In the zero copy world, we tell the kernel we are done with
the buffer by incrementing the user generation number, leaving
the hold buffer length un-touched.
This change basically looks to see if the user and kernel
generation numbers are different, and if so, wakes up the
reader
Affected files ...
.. //depot/projects/zcopybpf/src/sys/net/bpf.c#10 edit
Differences ...
==== //depot/projects/zcopybpf/src/sys/net/bpf.c#10 (text+ko) ====
@@ -141,7 +141,6 @@
static struct cdevsw bpf_cdevsw = {
.d_version = D_VERSION,
- .d_flags = D_NEEDGIANT,
.d_open = bpfopen,
.d_close = bpfclose,
.d_read = bpfread,
@@ -809,7 +808,7 @@
// printf("bpf_ready: hlen: %d, immediate %d, state %d, slen %d\n",
// d->bd_hlen, d->bd_immediate, d->bd_state, d->bd_slen);
- if (d->bd_hlen != 0)
+ if (!bpf_buffree(d) && d->bd_hlen != 0)
return (1);
if ((d->bd_immediate || d->bd_state == BPF_TIMED_OUT) &&
d->bd_slen != 0)
More information about the p4-projects
mailing list