From owner-cvs-src-old@FreeBSD.ORG Sat Jun 5 23:29:46 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73774106564A for ; Sat, 5 Jun 2010 23:29:46 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repoman.freebsd.org (unknown [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 622778FC08 for ; Sat, 5 Jun 2010 23:29:46 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o55NTkZ1060304 for ; Sat, 5 Jun 2010 23:29:46 GMT (envelope-from yongari@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o55NTkWQ060303 for cvs-src-old@freebsd.org; Sat, 5 Jun 2010 23:29:46 GMT (envelope-from yongari@repoman.freebsd.org) Message-Id: <201006052329.o55NTkWQ060303@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to yongari@repoman.freebsd.org using -f From: Pyun YongHyeon Date: Sat, 5 Jun 2010 23:29:24 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/dev/bge if_bge.c if_bgereg.h X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jun 2010 23:29:46 -0000 yongari 2010-06-05 23:29:24 UTC FreeBSD src repository Modified files: sys/dev/bge if_bge.c if_bgereg.h Log: SVN rev 208862 on 2010-06-05 23:29:24Z by yongari Fix a bug introduced in r199011. When bge(4) reuses loaded RX buffers it should also reinitialize RX descriptors otherwise some stale data could be passed to controller. This could end up with mbuf double free or unexpected NULL pointer dereference in upper stack. To fix the issue, save loaded buffer's length and reinitialize RX descriptors with the saved value whenever bge(4) reuses the loaded RX buffers. While I'm here, increase the number of RX buffers to 512 from 256. This simplifies RX buffer handling as well as giving more RX buffers. Controller supports just fixed number of RX buffers (i.e. 512) and bge(4) used to rely on hope that our CPU is fast enough to keep up with the controller. With this change, bge(4) will use 1MB for RX buffers but I don't think it would cause problems in these days. Reported by: marcel Tested by: marcel Revision Changes Path 1.286 +49 -16 src/sys/dev/bge/if_bge.c 1.98 +2 -0 src/sys/dev/bge/if_bgereg.h