Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Nov 1999 20:16:50 +0100
From:      Gary Jennejohn <garyj@muc.de>
To:        freebsd-isdn@freebsd.org
Cc:        markk@knigma.org
Subject:   Re: Panic caused by mbuf exhaustion in i4b with AVM PCI
Message-ID:  <199911271916.UAA07365@peedub.muc.de>

next in thread | raw e-mail | index | archive | help
OK, I talked to Hellmuth about the problem and it looks like a change to
i4b_hscx.c, which handles it, was not back-ported to the Fritz! PCI driver.

This patch will hopefully alleviate, or maybe even fix, the problem. This
one compiles :) Please test and report back to the list, thanks.

Note that my previous patch is also in it.

This should be committed to -STABLE !!!! Not necessary for -current since
Hellmuth will be replacing the isdn4bsd code shortly and I've sent him the
appropriate patch already.


================================ Patch ===========================
*** i4b_avm_fritz_pci.c	Fri Nov 26 20:48:55 1999
--- i4b_avm_fritz_pci.c_patched	Sat Nov 27 19:19:16 1999
***************
*** 1095,1109 ****
  							MPH_Trace_Ind(&hdr, chan->in_mbuf->m_len, chan->in_mbuf->m_data);
  						}
  
  					  /* move rx'd data to rx queue */
  
! 					  IF_ENQUEUE(&chan->rx_queue, chan->in_mbuf);
! 				
  					  (*chan->drvr_linktab->bch_rx_data_ready)(chan->drvr_linktab->unit);
  
- 					  if(!(isic_hscx_silence(chan->in_mbuf->m_data, chan->in_mbuf->m_len)))
- 						 activity = ACT_RX;
- 				
  					  /* alloc new buffer */
  				
  					  if((chan->in_mbuf = i4b_Bgetmbuf(BCH_MAX_DATALEN)) == NULL)
--- 1095,1117 ----
  							MPH_Trace_Ind(&hdr, chan->in_mbuf->m_len, chan->in_mbuf->m_data);
  						}
  
+ 					  if(!(isic_hscx_silence(chan->in_mbuf->m_data, chan->in_mbuf->m_len)))
+ 						 activity = ACT_RX;
+ 				
  					  /* move rx'd data to rx queue */
  
! 					  if (!(IF_QFULL(&chan->rx_queue)))
! 					  {
! 					  	IF_ENQUEUE(&chan->rx_queue, chan->in_mbuf);
! 					  }
! 					  else
! 				       	  {
! 						i4b_Bfreembuf(chan->in_mbuf);
! 				          }
! 
! 					  /* signal upper layer that data are available */
  					  (*chan->drvr_linktab->bch_rx_data_ready)(chan->drvr_linktab->unit);
  
  					  /* alloc new buffer */
  				
  					  if((chan->in_mbuf = i4b_Bgetmbuf(BCH_MAX_DATALEN)) == NULL)
***************
*** 1121,1127 ****
  
  					  chan->rxcount += fifo_data_len;
  					}
! 				 else
  					{
  					  DBGL1(L1_H_XFRERR, "avma1pp_hscx_intr", ("RAWHDLC rx buffer overflow in RPF, in_len=%d\n", chan->in_len));
  					  chan->in_cbptr = chan->in_mbuf->m_data;
--- 1129,1135 ----
  
  					  chan->rxcount += fifo_data_len;
  					}
! 				 	else
  					{
  					  DBGL1(L1_H_XFRERR, "avma1pp_hscx_intr", ("RAWHDLC rx buffer overflow in RPF, in_len=%d\n", chan->in_len));
  					  chan->in_cbptr = chan->in_mbuf->m_data;
***************
*** 1364,1369 ****
--- 1372,1378 ----
  		if (sc->sc_chan[HSCX_CH_A].state != HSCX_IDLE ||
  			sc->sc_chan[HSCX_CH_B].state != HSCX_IDLE)
  		{
+ 			DBGL1(L1_BCHAN, "avma1pp_hscx_init", ("%d NOT deactivated\n", h_chan));
  			return;
  		}
  		sc->avma1pp_cmd = HSCX_CMD_XRS|HSCX_CMD_RRS;
***************
*** 1417,1423 ****
  	if(activate == 0)
  	{
  		/* deactivation */
! 		chan->state &= ~HSCX_AVMA1PP_ACTIVE;
  		avma1pp_hscx_init(sc, h_chan, activate);
  	}
  		
--- 1426,1432 ----
  	if(activate == 0)
  	{
  		/* deactivation */
! 		chan->state = HSCX_IDLE;
  		avma1pp_hscx_init(sc, h_chan, activate);
  	}
  		
***************
*** 1656,1662 ****
  	int len;
  	int nextlen;
  	int i;
! 	int cmd;
  	/* using a scratch buffer simplifies writing to the FIFO */
  	u_char scrbuf[HSCX_FIFO_LEN];
  
--- 1665,1671 ----
  	int len;
  	int nextlen;
  	int i;
! 	int cmd = 0;
  	/* using a scratch buffer simplifies writing to the FIFO */
  	u_char scrbuf[HSCX_FIFO_LEN];
  

--------
Gary Jennejohn / garyj@muc.de garyj@fkr.cpqcorp.net gj@freebsd.org




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isdn" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199911271916.UAA07365>