From owner-cvs-all@FreeBSD.ORG Thu Oct 27 21:16:17 2005 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8CD0816A41F; Thu, 27 Oct 2005 21:16:17 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5F9F143D46; Thu, 27 Oct 2005 21:16:17 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j9RLGHTU035756; Thu, 27 Oct 2005 21:16:17 GMT (envelope-from jhb@repoman.freebsd.org) Received: (from jhb@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j9RLGHdW035755; Thu, 27 Oct 2005 21:16:17 GMT (envelope-from jhb) Message-Id: <200510272116.j9RLGHdW035755@repoman.freebsd.org> From: John Baldwin Date: Thu, 27 Oct 2005 21:16:17 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/dev/txp if_txp.c if_txpreg.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2005 21:16:17 -0000 jhb 2005-10-27 21:16:17 UTC FreeBSD src repository Modified files: sys/dev/txp if_txp.c if_txpreg.h Log: - Add locking and mark MPSAFE. The driver had a mutex in the softc and even initialized it, but it never used it. - Use callout_*() to manage the callout. - Use m_devget() to copy data out of the rx buffers rather than doing it all by hand. - Use m_getcl() to allocate mbuf clusters rather than doing it all by hand. - Don't free the software descriptor for a rx ring entry if we can't allocate an mbuf cluster for it. We left a dangling pointer and never reallocated the entry anyway. OpenBSD's code (from which this was derived) has the same bug. Tested by: NO ONE (despite repeated requests) Reviewed by: wpaul (5) Revision Changes Path 1.37 +81 -61 src/sys/dev/txp/if_txp.c 1.6 +5 -1 src/sys/dev/txp/if_txpreg.h