From nobody@FreeBSD.org  Sat Jun  5 17:11:55 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2ED6A1065676
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  5 Jun 2010 17:11:55 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 1E9558FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  5 Jun 2010 17:11:55 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o55HBs5u055482
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 5 Jun 2010 17:11:54 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o55HBsJX055481;
	Sat, 5 Jun 2010 17:11:54 GMT
	(envelope-from nobody)
Message-Id: <201006051711.o55HBsJX055481@www.freebsd.org>
Date: Sat, 5 Jun 2010 17:11:54 GMT
From: Marcel Moolenaar <marcel@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [ia64][busdma] bounce buffering does not work reliably
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         147502
>Category:       ia64
>Synopsis:       [ia64][busdma] bounce buffering does not work reliably
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-ia64
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 05 17:20:03 UTC 2010
>Closed-Date:    Fri Jun 11 03:04:50 UTC 2010
>Last-Modified:  Fri Jun 11 03:10:01 UTC 2010
>Originator:     Marcel Moolenaar
>Release:        9-CURRENT
>Organization:
>Environment:
FreeBSD hob.lan.xcllnt.net 9.0-CURRENT FreeBSD 9.0-CURRENT #1 r208634:208809M: Sat Jun  5 08:36:47 PDT 2010     marcel@hob.lan.xcllnt.net:/usr/obj/nfs/freebsd/base/head/sys/HOB  ia64

>Description:
When running pho's stress2 on a machine with 8GB of RAM, bge(4) becomes non-functional. Eliminating all memory above 4GB and thereby eliminating the need to do bounce buffering results in a "successful" run.
>How-To-Repeat:
On a machine with bge(4) and memory located above 4G:
o   checkout projects/stress2
o   compile and run
o   Wait for the network to become non-functional
o   Abort the test and observe that the I/F remains non-functional
o   Flap the I/F (bring it down and then up) and see that it remains non-functional

Non-functional in this context means that no packets go out and none come in.

>Fix:
swi_vm() has been castrated so that busdma_swi() isn't being called. This may be all there is to it (i.e. remove the #if 0 and #endif)...


>Release-Note:
>Audit-Trail:

From: Marcel Moolenaar <xcllnt@me.com>
To: "bug-followup@FreeBSD.org" <bug-followup@FreeBSD.org>,
 "marcel@FreeBSD.org" <marcel@FreeBSD.org>
Cc:  
Subject: Re: ia64/147502: [ia64][busdma] bounce buffering does not work reliably
Date: Sat, 05 Jun 2010 12:05:11 -0700

 Bounce buffering fundamentally works. The problem relates to there not being any free bounce pages left.
 
 -- 
 Marcel
State-Changed-From-To: open->closed 
State-Changed-By: marcel 
State-Changed-When: Fri Jun 11 03:04:13 UTC 2010 
State-Changed-Why:  
Fix committed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=147502 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ia64/147502: commit references a PR
Date: Fri, 11 Jun 2010 03:00:44 +0000 (UTC)

 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().
   
   PR:		147502
   MFC after:	1 week
 
 Modified:
   head/sys/ia64/ia64/busdma_machdep.c
   head/sys/ia64/ia64/vm_machdep.c
   head/sys/ia64/include/md_var.h
 
 Modified: head/sys/ia64/ia64/busdma_machdep.c
 ==============================================================================
 --- head/sys/ia64/ia64/busdma_machdep.c	Fri Jun 11 02:50:53 2010	(r209025)
 +++ head/sys/ia64/ia64/busdma_machdep.c	Fri Jun 11 03:00:32 2010	(r209026)
 @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$");
  #include <machine/bus.h>
  #include <machine/md_var.h>
  
 -#define MAX_BPAGES 256
 +#define	MAX_BPAGES	1024
  
  struct bus_dma_tag {
  	bus_dma_tag_t	  parent;
 @@ -77,7 +77,7 @@ struct bounce_page {
  	STAILQ_ENTRY(bounce_page) links;
  };
  
 -int busdma_swi_pending;
 +u_int busdma_swi_pending;
  
  static struct mtx bounce_lock;
  static STAILQ_HEAD(bp_list, bounce_page) bounce_page_list;
 
 Modified: head/sys/ia64/ia64/vm_machdep.c
 ==============================================================================
 --- head/sys/ia64/ia64/vm_machdep.c	Fri Jun 11 02:50:53 2010	(r209025)
 +++ head/sys/ia64/ia64/vm_machdep.c	Fri Jun 11 03:00:32 2010	(r209026)
 @@ -378,9 +378,8 @@ sf_buf_free(struct sf_buf *sf)
   */   
  void  
  swi_vm(void *dummy) 
 -{     
 -#if 0
 +{
 +
  	if (busdma_swi_pending != 0)
  		busdma_swi();
 -#endif
  }
 
 Modified: head/sys/ia64/include/md_var.h
 ==============================================================================
 --- head/sys/ia64/include/md_var.h	Fri Jun 11 02:50:53 2010	(r209025)
 +++ head/sys/ia64/include/md_var.h	Fri Jun 11 03:00:32 2010	(r209026)
 @@ -75,6 +75,7 @@ struct ia64_init_return {
  extern uint64_t ia64_lapic_addr;
  
  extern long Maxmem;
 +extern u_int busdma_swi_pending;
  
  void	busdma_swi(void);
  int	copyout_regstack(struct thread *, uint64_t *, uint64_t *);
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
