From owner-cvs-all@FreeBSD.ORG Tue Jan 30 14:16:24 2007 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC65F16A401; Tue, 30 Jan 2007 14:16:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id CCEC113C491; Tue, 30 Jan 2007 14:16:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l0UEGOhJ035588; Tue, 30 Jan 2007 14:16:24 GMT (envelope-from marius@repoman.freebsd.org) Received: (from marius@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l0UEGO2X035578; Tue, 30 Jan 2007 14:16:24 GMT (envelope-from marius) Message-Id: <200701301416.l0UEGO2X035578@repoman.freebsd.org> From: Marius Strobl Date: Tue, 30 Jan 2007 14:16:24 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: RELENG_6 Cc: Subject: cvs commit: src/sys/dev/re if_re.c src/sys/pci if_rlreg.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: Tue, 30 Jan 2007 14:16:25 -0000 marius 2007-01-30 14:16:24 UTC FreeBSD src repository Modified files: (Branch: RELENG_6) sys/dev/re if_re.c sys/pci if_rlreg.h Log: MFC: if_re.c 1.82, if_rlreg.h 1.64 o In re_newbuf() and re_encap() if re_dma_map_desc() aborts the mapping operation as it ran out of free descriptors or if there are too many segments in the first place, call bus_dmamap_unload() in order to unload the already loaded segments. For trying to map the defragmented mbuf (chain) in re_encap() this introduces re_dma_map_desc() setting arg.rl_maxsegs to 0 as a new failure mode. Previously we just ignored this case, corrupting our view of the TX ring. o In re_txeof(): - Don't clear IFF_DRV_OACTIVE unless there are at least 4 free TX descriptors. Further down the road re_encap() will bail if there aren't at least 4 free TX descriptors, causing re_start() to abort and prepend the dequeued mbuf again so it makes no sense to pretend we could process mbufs again when in fact we won't. While at it replace this magic 4 with a macro RL_TX_DESC_THLD throughout this driver. - Don't cancel the watchdog timeout as soon as there's at least one free TX descriptor but instead only if all descriptors have been handled. It's perfectly normal, especially in the DEVICE_POLLING case, that re_txeof() is called when only a part of the enqueued TX descriptors have been handled, causing the watchdog to be disarmed prematurely. o In re_encap(): - If m_defrag() fails just drop the packet like other NIC drivers do. This should only happen when there's a mbuf shortage, in which case it was possible to end up with an IFQ full of packets which couldn't be processed as they couldn't be defragmented as they were taking up all the mbufs themselves. This includes adjusting re_start() to not trying to prepend the mbuf (chain) if re_encap() has freed it. - Remove dupe initialization of members of struct rl_dmaload_arg to values that didn't change since trying to process the fragmented mbuf chain. While at it remove an unused member from struct rl_dmaload_arg. o In re_start() remove a abandoned, banal comment. The corresponding code was moved to re_attach() some time ago. Revision Changes Path 1.46.2.23 +43 -47 src/sys/dev/re/if_re.c 1.51.2.9 +1 -1 src/sys/pci/if_rlreg.h