Date: Sat, 29 Sep 2007 05:21:11 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 126950 for review Message-ID: <200709290521.l8T5LBlO020284@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=126950 Change 126950 by kmacy@kmacy_home:ethng on 2007/09/29 05:20:19 fix ring count to correctly account for prod < cons Affected files ... .. //depot/projects/ethng/src/sys/dev/cxgb/cxgb_osdep.h#11 edit Differences ... ==== //depot/projects/ethng/src/sys/dev/cxgb/cxgb_osdep.h#11 (text+ko) ==== @@ -72,7 +72,10 @@ static __inline int mbuf_ring_count(struct mbuf_ring *mr) { - return abs(mr->mr_cons - mr->mr_prod); + int size = mr->mr_size; + int mask = size - 1; + + return ((size + mr->mr_prod - mr->mr_cons) & mask); } static __inline int
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709290521.l8T5LBlO020284>