PERFORCE change 114260 for review

Christian S.J. Peron csjp at FreeBSD.org
Thu Feb 8 21:31:13 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=114260

Change 114260 by csjp at csjp_rnd01 on 2007/02/08 21:30:37

	Change the prefetch algorithm to fetch the next packet's
	header instead of unconditionally prefetching everything.

Affected files ...

.. //depot/projects/zcopybpf/utils/bpfnull/bpfnull.c#15 edit

Differences ...

==== //depot/projects/zcopybpf/utils/bpfnull/bpfnull.c#15 (text+ko) ====

@@ -102,14 +102,9 @@
 		return;
 	b = bp = bz->bz_bufa;
 	p = ep = bp + bz->bz_buflen;
-	if (pflag) {
-		for (i = 0; i < bz->bz_buflen;
-		    i += CACHE_LINE_SIZE) {
-			p += i;
-			__builtin_prefetch(p, 0, 2);
-		}
-	}
 	while (bp < ep) {
+		if (pflag)
+			__builtin_prefetch(bp + bhp->bh_datalen, 0, 3);
 		clen = bhp->bh_caplen;
 		hlen = bhp->bh_hdrlen;
 		p = (u_char *)bp + hlen;


More information about the p4-projects mailing list