Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Apr 1995 09:47:03 -0500 (GMT-0500)
From:      "Serge A. Babkin" <babkin@hq.icb.chel.su>
To:        phk@ref.tfs.com (Poul-Henning Kamp)
Cc:        freebsd-hackers@FreeBSD.org
Subject:   Strange behavior of network subsystem
Message-ID:  <199504031447.JAA03876@hq.icb.chel.su>
In-Reply-To: <199503220845.AAA04589@ref.tfs.com> from "Poul-Henning Kamp" at Mar 22, 95 00:45:07 am

next in thread | previous in thread | raw e-mail | index | archive | help
I have tried to ftp to/from ICL minicomputer and found some
strangeness in behavior of FBSD's network subsystem. This ICL
wants TCP window to be set to 24K, and FBSD sets them to 17K. But then
it begins to lose interrupts. First I throught that network driver
does this and found that it really sometimes does this when tansmitting
files. Fix for 3C509 driver is at end of message. But when receiving
files the problem is somewhere in IP or TCP. It receives about 100K
then stops for about 2 seconds. I have tried to run network card's
watchdog routine 50 times per second but this gave no effect.
Therefore problem is not in driver. 

When transmitting/receiving to/from BSDI machine everything goes
OK (with TCP window size 4K).


And now fix for 3C509 driver (relative -current or wcarchive.cdrom.com:
pub/incoming/3c509.tgz):

*** 1.6	1995/03/28 07:12:59
--- if_ep.c	1995/04/03 03:02:06
***************
*** 422,427 ****
--- 422,428 ----
      ifp->if_start = epstart;
      ifp->if_ioctl = epioctl;
      ifp->if_watchdog = epwatchdog;
+ 	ifp->if_timer=1;
  
      if_attach(ifp);
      ep_registerdev(is);
***************
*** 487,494 ****
--- 488,497 ----
      register struct ifnet *ifp = &sc->arpcom.ac_if;
      int s, i, j;
  
+ 	/*
      if (ifp->if_addrlist == (struct ifaddr *) 0)
  	return;
+ 	*/
  
      s = splimp();
      while (inw(BASE + EP_STATUS) & S_COMMAND_IN_PROGRESS);
***************
*** 751,756 ****
--- 754,761 ----
      struct ifnet *ifp = &sc->arpcom.ac_if;
      struct mbuf *m;
  
+     outw(BASE + EP_COMMAND, SET_INTR_MASK); /* disable all Ints */
+ 
  rescan:
  
      while ((status = inw(BASE + EP_STATUS)) & S_5_INTS) {
***************
*** 765,770 ****
--- 770,777 ----
  	if (status & S_TX_AVAIL) {
  	    /* we need ACK */
  	    sc->arpcom.ac_if.if_flags &= ~IFF_OACTIVE;
+ 	    GO_WINDOW(1);
+ 	    inw(BASE + EP_W1_FREE_TX);
  	    epstart(&sc->arpcom.ac_if);
  	}
  	if (status & S_CARD_FAILURE) {
***************
*** 820,825 ****
--- 827,836 ----
  		outb(BASE + EP_W1_TX_STATUS, 0x0);	/* pops up the next
  							 * status */
  	    }			/* while */
+ 	    sc->arpcom.ac_if.if_flags &= ~IFF_OACTIVE;
+ 	    GO_WINDOW(1);
+ 	    inw(BASE + EP_W1_FREE_TX);
+ 	    epstart(&sc->arpcom.ac_if);
  	}			/* end TX_COMPLETE */
      }
  
***************
*** 827,832 ****
--- 838,847 ----
  
      if ((status = inw(BASE + EP_STATUS)) & S_5_INTS) 
  	goto rescan;
+ 
+     /* re-enable Ints */
+     outw(BASE + EP_COMMAND, SET_INTR_MASK | S_5_INTS);
+ 
  }
  
  void
***************
*** 1184,1194 ****
      int unit;
  {
      struct ep_softc *sc = &ep_softc[unit];
  
      log(LOG_ERR, "ep%d: watchdog\n", unit);
      ++sc->arpcom.ac_if.if_oerrors;
  
!     epreset(unit);
  }
  
  void
--- 1199,1219 ----
      int unit;
  {
      struct ep_softc *sc = &ep_softc[unit];
+     struct ifnet *ifp=&sc->arpcom.ac_if;
+ 
+     /*
+     printf("ep: watchdog\n");
  
      log(LOG_ERR, "ep%d: watchdog\n", unit);
      ++sc->arpcom.ac_if.if_oerrors;
+     */
+ 
+     /* epreset(unit); */
+     ifp->if_flags &= ~IFF_OACTIVE;
+     epstart(ifp);
+     epintr(unit);
  
!     ifp->if_timer=1;
  }
  
  void



		Serge Babkin

! (babkin@hq.icb.chel.su)
! Headquarter of Joint Stock Bank "Chelindbank"
! Chelyabinsk, Russia



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