Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Dec 2007 11:38:44 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 131515 for review
Message-ID:  <200712241138.lBOBcifm084185@repoman.freebsd.org>

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

Change 131515 by rwatson@rwatson_cinnamon on 2007/12/24 11:38:24

	Update comments.

Affected files ...

.. //depot/projects/zcopybpf/src/contrib/libpcap/pcap-bpf.c#14 edit

Differences ...

==== //depot/projects/zcopybpf/src/contrib/libpcap/pcap-bpf.c#14 (text+ko) ====

@@ -143,8 +143,11 @@
 
 #ifdef BIOCGETBUFMODE
 /*
- * Simple version of pcap_next_zbuf() -- do the shared memory part, but no
- * blocking.
+ * Zero-copy BPF buffer routines to check for and acknowledge BPF data in
+ * shared memory buffers.
+ *
+ * pcap_next_zbuf_shm(): Check for a newly available shared memory buffer,
+ * and set up p->buffer and cc to reflect one if available.
  */
 static int
 pcap_next_zbuf_shm(pcap_t *p, u_int *cc)
@@ -178,12 +181,11 @@
 }
 
 /*
- * Selection routine for zero-copy BPF: identify the next completed buffer,
- * if any.  Try shared memory first, and if that doesn't work, make a system
- * call, which may dislodge a buffer.
- *
- * Return (1) if the buffer is found, (0) if a retry is required, and (-1) if
- * there is an unrecoverable error.
+ * pcap_next_zbuf() -- Similar to pcap_next_zbuf_shm(), except wait using
+ * select() for data or a timeout, and possibly force rotation of the buffer
+ * in the event we time out or are in immediate mode.  Invoke the shared
+ * memory check before doing system calls in order to avoid doing avoidable
+ * work.
  */
 static int
 pcap_next_zbuf(pcap_t *p, u_int *cc)



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