From owner-freebsd-hackers Sun Apr 2 20:48:08 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id UAA20886 for hackers-outgoing; Sun, 2 Apr 1995 20:48:08 -0700 Received: from hq.icb.chel.su (icb-rich-gw.icb.chel.su [193.125.10.34]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id UAA20879 for ; Sun, 2 Apr 1995 20:47:54 -0700 Received: from localhost (babkin@localhost) by hq.icb.chel.su (8.6.5/8.6.5) id JAA03876; Mon, 3 Apr 1995 09:47:04 -0500 From: "Serge A. Babkin" Message-Id: <199504031447.JAA03876@hq.icb.chel.su> Subject: Strange behavior of network subsystem To: phk@ref.tfs.com (Poul-Henning Kamp) Date: Mon, 3 Apr 1995 09:47:03 -0500 (GMT-0500) Cc: freebsd-hackers@FreeBSD.org In-Reply-To: <199503220845.AAA04589@ref.tfs.com> from "Poul-Henning Kamp" at Mar 22, 95 00:45:07 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Content-Length: 3259 Sender: hackers-owner@FreeBSD.org Precedence: bulk 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