Date: Thu, 8 Feb 2007 21:31:11 GMT From: "Christian S.J. Peron" <csjp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 114260 for review Message-ID: <200702082131.l18LVBu5017457@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=114260 Change 114260 by csjp@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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200702082131.l18LVBu5017457>