From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 17:05:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BBF1106567D; Fri, 11 Jun 2010 17:05:01 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout025.mac.com (asmtpout025.mac.com [17.148.16.100]) by mx1.freebsd.org (Postfix) with ESMTP id 4BA618FC14; Fri, 11 Jun 2010 17:05:01 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.lan.xcllnt.net (mail.xcllnt.net [75.101.29.67]) by asmtp025.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L3V00IM60RPUQ70@asmtp025.mac.com>; Fri, 11 Jun 2010 10:04:38 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1006110108 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2010-06-11_02:2010-02-06, 2010-06-11, 2010-06-11 signatures=0 From: Marcel Moolenaar In-reply-to: <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> Date: Fri, 11 Jun 2010 10:04:36 -0700 Message-id: <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> References: <201006110300.o5B30X9q045387@svn.freebsd.org> <201006110751.40735.jhb@freebsd.org> <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> To: Scott Long X-Mailer: Apple Mail (2.1078) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 17:05:01 -0000 On Jun 11, 2010, at 9:12 AM, Scott Long wrote: > On Jun 11, 2010, at 5:51 AM, John Baldwin wrote: >> On Thursday 10 June 2010 11:00:33 pm Marcel Moolenaar wrote: >>> Author: marcel >>> Date: Fri Jun 11 03:00:32 2010 >>> New Revision: 209026 >>> URL: http://svn.freebsd.org/changeset/base/209026 >>> >>> Log: >>> Bump MAX_BPAGES from 256 to 1024. It seems that a few drivers, bge(4) >>> in particular, do not handle deferred DMA map load operations at all. >>> Any error, and especially EINPROGRESS, is treated as a hard error and >>> typically abort the current operation. The fact that the busdma code >>> queues the load operation for when resources (i.e. bounce buffers in >>> this particular case) are available makes this especially problematic. >>> Bounce buffering, unlike what the PR synopsis would suggest, works >>> fine. >>> >>> While on the subject, properly implement swi_vm(). >> >> NIC drivers do not handle deferred load operations at all (note that >> bus_dmamap_load_mbuf() and bus_dmamap_load_mbuf_sg() enforce BUS_DMA_NOWAIT). >> It is common practice to just drop the packet in that case. >> > > Yes, long ago when network drivers started being converted to busdma, it was agreed that EINPROGRESS simply doesn't make sense for them. Any platform that winds up making extensive use of bounce buffers for network hardware is going to perform poorly no matter what, and should hopefully have some sort of IOMMU that can be used instead. Unfortunately things aren't as simple as is presented. For one, bge(4) wedges as soon as the platform runs out of bounce buffers when they're needed. The box needs to be reset in order to get the interface back. I pick any implementation that remains functional over a mis-optimized one that breaks. Deferred load operations are more performance optimal than failure is. Also: the kernel does nothing to guarantee maximum availability of DMA-able memory under load, so bounce buffers (or use of I/O MMUs for that matter) are a reality. Here too the performance argument doesn't necessarily hold because the kernel may be busy with more than just sending and receiving packets and the need to defer load operations is very appropriate. If the alternative is just dropped packets, I'm fine with that too, but I for one cannot say that *not* filling a H/W ring with buffers is not going to wedge the hardware in some cases. Plus: SGI Altix does not have any DMA-able memory for 32-bit hardware. The need for an I/O MMU is absolute and since there are typically less mapping registers than packets on a ring, the need for deferred operation seems quite acceptable if the alternative is, again, failure to operate. -- Marcel Moolenaar xcllnt@mac.com