[comp.bugs.4bsd.ucb-fixes] V1.26

bostic@OKEEFFE.BERKELEY.EDU.UUCP (06/05/87)

Subject: rcv_xmtbuf panic
Index: sys/vaxif/if_uba.c 4.3BSD

Description:
	On systems with heavy usage of DEUNAs, you can get an
	rcv_xmtbuf panic.
Fix:
	Apply the following patch:

*** if_uba.c.old	Thu Jun  4 13:53:12 1987
--- if_uba.c.new	Thu Jun  4 13:53:26 1987
***************
*** 3,9 ****
   * All rights reserved.  The Berkeley software License Agreement
   * specifies the terms and conditions for redistribution.
   *
!  *	@(#)if_uba.c	7.1 (Berkeley) 6/5/86
   */
  
  #include "../machine/pte.h"
--- 3,9 ----
   * All rights reserved.  The Berkeley software License Agreement
   * specifies the terms and conditions for redistribution.
   *
!  *	@(#)if_uba.c	7.5.1.1 (Berkeley) 6/4/87
   */
  
  #include "../machine/pte.h"
***************
*** 97,105 ****
  	return (1);
  bad:
  	while (--nw >= 0)
! 		ubarelse(ifu->iff_uban, &ifr[nw].ifrw_info);
  	while (--nr >= 0)
! 		ubarelse(ifu->iff_uban, &ifw[nr].ifw_info);
  	m_pgfree(cp, (nr + nw) * ncl);
  	ifr[0].ifrw_addr = 0;
  	return (0);
--- 97,105 ----
  	return (1);
  bad:
  	while (--nw >= 0)
! 		ubarelse(ifu->iff_uban, &ifw[nw].ifw_info);
  	while (--nr >= 0)
! 		ubarelse(ifu->iff_uban, &ifr[nr].ifrw_info);
  	m_pgfree(cp, (nr + nw) * ncl);
  	ifr[0].ifrw_addr = 0;
  	return (0);
***************
*** 273,279 ****
  	register struct mbuf *m;
  	struct mbuf **mprev;
  	register i;
- 	int t;
  	char *cp;
  
  	while (i = ffs((long)ifw->ifw_xswapd)) {
--- 273,278 ----
***************
*** 280,299 ****
  		cp = ifw->ifw_base + i * CLBYTES;
  		i--;
  		ifw->ifw_xswapd &= ~(1<<i);
- 		i *= CLSIZE;
  		mprev = &ifw->ifw_xtofree;
  		for (m = ifw->ifw_xtofree; m && m->m_next; m = m->m_next)
  			mprev = &m->m_next;
  		if (m == NULL)
! 			panic("rcv_xmtbuf");
  		bcopy(mtod(m, caddr_t), cp, CLBYTES);
  		(void) m_free(m);
  		*mprev = NULL;
- 		for (t = 0; t < CLSIZE; t++) {
- 			ifw->ifw_mr[i] = ifw->ifw_wmap[i];
- 			i++;
- 		}
  	}
  }
  
  /*
--- 279,296 ----
  		cp = ifw->ifw_base + i * CLBYTES;
  		i--;
  		ifw->ifw_xswapd &= ~(1<<i);
  		mprev = &ifw->ifw_xtofree;
  		for (m = ifw->ifw_xtofree; m && m->m_next; m = m->m_next)
  			mprev = &m->m_next;
  		if (m == NULL)
! 			break;
  		bcopy(mtod(m, caddr_t), cp, CLBYTES);
  		(void) m_free(m);
  		*mprev = NULL;
  	}
+ 	ifw->ifw_xswapd = 0;
+ 	for (i = 0; i < ifw->ifw_nmr; i++)
+ 		ifw->ifw_mr[i] = ifw->ifw_wmap[i];
  }
  
  /*