I am using nfe on 6.3 amd63 system with the code from here: http://www.f.csce.kyushu-u.ac.jp/~shigeaki/software/freebsd-nfe.html Everything is OK except for one small, but annoying problem. Sometimes when my system hangs and I have to use reset button, nfe stops working after reboot. ifconfig shows proper status and medium, there are no kernel error/debug messages, on the surface everything seems good. But if I try to ping a machine connected to the same switch I get "host down" responses. So, no network at all. Unloading and reloading if_nfe module doesn't help, various ifconfig re-configurations do not help too. Although, if I do power off and then boot, everything is perfect again. Until a couple of weeks ago I used 6.2 amd64 and nve (patched to recognize pci id of this card) and I never had such a problem. To un-enlightened me it seems like some resetting/re-initialization of the card is not done properly by nfe. Additional info. dmesg: nfe0: <NVIDIA nForce 430 MCP13 Networking Adapter> port 0xc800-0xc807 mem 0xfe02b000-0xfe02bfff irq 23 at device 20.0 on pci0 miibus0: <MII bus> on nfe0 e1000phy0: <Marvell 88E1116 Gigabit PHY> on miibus0 e1000phy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseTX-FDX, auto nfe0: Ethernet address: 00:18:f3:d4:43:1e nfe0: [FAST] ifconfig (output is the same in both working and non-working cases): nfe0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 options=8<VLAN_MTU> inet 10.2.1.87 netmask 0xfffffc00 broadcast 10.2.3.255 ether 00:18:f3:d4:43:1e media: Ethernet autoselect (1000baseTX <full-duplex,flag0,flag1>) status: active pciconf: nfe0@pci0:20:0: class=0x068000 card=0x816a1043 chip=0x026910de rev=0xa3 hdr=0x00 vendor = 'Nvidia Corp' device = 'MCP51 Network Bus Enumerator' class = bridge P.S. as always with network issues, I understand that it may be not so simple, e.g. some interaction between the card and the switch, etc. -- Andriy Gapon
On Fri, Feb 01, 2008 at 01:35:57PM +0200, Andriy Gapon wrote: > > I am using nfe on 6.3 amd63 system with the code from here: > http://www.f.csce.kyushu-u.ac.jp/~shigeaki/software/freebsd-nfe.html > > Everything is OK except for one small, but annoying problem. Sometimes > when my system hangs and I have to use reset button, nfe stops working > after reboot. ifconfig shows proper status and medium, there are no > kernel error/debug messages, on the surface everything seems good. But > if I try to ping a machine connected to the same switch I get "host > down" responses. So, no network at all. Unloading and reloading if_nfe > module doesn't help, various ifconfig re-configurations do not help too. > Although, if I do power off and then boot, everything is perfect again. > > Until a couple of weeks ago I used 6.2 amd64 and nve (patched to > recognize pci id of this card) and I never had such a problem. > > To un-enlightened me it seems like some resetting/re-initialization of > the card is not done properly by nfe. > > Additional info. > dmesg: > nfe0: <NVIDIA nForce 430 MCP13 Networking Adapter> port 0xc800-0xc807 > mem 0xfe02b000-0xfe02bfff irq 23 at device 20.0 on pci0 > miibus0: <MII bus> on nfe0 > e1000phy0: <Marvell 88E1116 Gigabit PHY> on miibus0 > e1000phy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, > 1000baseTX-FDX, auto > nfe0: Ethernet address: 00:18:f3:d4:43:1e > nfe0: [FAST] > > ifconfig (output is the same in both working and non-working cases): > nfe0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 > options=8<VLAN_MTU> > inet 10.2.1.87 netmask 0xfffffc00 broadcast 10.2.3.255 > ether 00:18:f3:d4:43:1e > media: Ethernet autoselect (1000baseTX <full-duplex,flag0,flag1>) > status: active > > pciconf: > nfe0@pci0:20:0: class=0x068000 card=0x816a1043 chip=0x026910de rev=0xa3 > hdr=0x00 > vendor = 'Nvidia Corp' > device = 'MCP51 Network Bus Enumerator' > class = bridge > > > P.S. as always with network issues, I understand that it may be not so > simple, e.g. some interaction between the card and the switch, etc. > After applying attached patch and let me know the output of "devid : xxx, revid : xxx, pwr = xxx". It would be even better if you can show me the above message for working/non-working case. -- Regards, Pyun YongHyeon -------------- next part -------------- --- if_nfe.c.orig 2008-01-18 10:50:48.000000000 +0900 +++ if_nfe.c 2008-02-01 21:30:27.000000000 +0900 @@ -770,6 +770,10 @@ DELAY(100); NFE_WRITE(sc, NFE_RXTX_CTL, NFE_RXTX_BIT2); pwr = NFE_READ(sc, NFE_PWR2_CTL); +#if 1 + printf("devid : %x, revid : %x, pwr = %08x\n", + sc->nfe_devid, sc->nfe_devid, pwr); +#endif pwr &= ~NFE_PWR2_WAKEUP_MASK; if (sc->nfe_revid >= 0xa3 && (sc->nfe_devid == PCI_PRODUCT_NVIDIA_NFORCE430_LAN1 ||
on 01/02/2008 14:36 Pyun YongHyeon said the following:> > After applying attached patch and let me know the output of > "devid : xxx, revid : xxx, pwr = xxx". It would be even better > if you can show me the above message for working/non-working case. > >Applied the patch with correction to actually print rev instead of dev for the second time :-) This is in working case: devid : 269, revid : a3, pwr = 00000003 Will wait for the non-working situation. -- Andriy Gapon
on 01/02/2008 15:42 Andriy Gapon said the following:> on 01/02/2008 14:36 Pyun YongHyeon said the following: >> After applying attached patch and let me know the output of >> "devid : xxx, revid : xxx, pwr = xxx". It would be even better >> if you can show me the above message for working/non-working case. >> >> > > Applied the patch with correction to actually print rev instead of dev > for the second time :-) > This is in working case: > devid : 269, revid : a3, pwr = 00000003A clarification: I just applied the patch, recompiled and re-loaded the module. There was no reboot/poweroff/reset in between.> Will wait for the non-working situation. >-- Andriy Gapon
On Fri, Feb 01, 2008 at 03:56:17PM +0200, Andriy Gapon wrote: > on 01/02/2008 15:42 Andriy Gapon said the following: > > on 01/02/2008 14:36 Pyun YongHyeon said the following: > >> After applying attached patch and let me know the output of > >> "devid : xxx, revid : xxx, pwr = xxx". It would be even better > >> if you can show me the above message for working/non-working case. > >> > >> > > > > Applied the patch with correction to actually print rev instead of dev > > for the second time :-) > > This is in working case: > > devid : 269, revid : a3, pwr = 00000003 > > A clarification: I just applied the patch, recompiled and re-loaded the > module. There was no reboot/poweroff/reset in between. > > > Will wait for the non-working situation. > > > Revert previous patch and try attached patch again and let me know how it goes. -- Regards, Pyun YongHyeon -------------- next part -------------- --- sys/dev/nfe/if_nfe.c.orig 2008-02-02 04:36:24.000000000 +0900 +++ sys/dev/nfe/if_nfe.c 2008-02-04 12:47:11.000000000 +0900 @@ -763,12 +763,6 @@ if ((sc->nfe_flags & NFE_PWR_MGMT) == 0) return; - NFE_WRITE(sc, NFE_RXTX_CTL, NFE_RXTX_RESET | NFE_RXTX_BIT2); - NFE_WRITE(sc, NFE_MAC_RESET, NFE_MAC_RESET_MAGIC); - DELAY(100); - NFE_WRITE(sc, NFE_MAC_RESET, 0); - DELAY(100); - NFE_WRITE(sc, NFE_RXTX_CTL, NFE_RXTX_BIT2); pwr = NFE_READ(sc, NFE_PWR2_CTL); pwr &= ~NFE_PWR2_WAKEUP_MASK; if (sc->nfe_revid >= 0xa3 && @@ -776,6 +770,12 @@ sc->nfe_devid == PCI_PRODUCT_NVIDIA_NFORCE430_LAN2)) pwr |= NFE_PWR2_REVA3; NFE_WRITE(sc, NFE_PWR2_CTL, pwr); + NFE_WRITE(sc, NFE_RXTX_CTL, NFE_RXTX_RESET | NFE_RXTX_BIT2); + NFE_WRITE(sc, NFE_MAC_RESET, NFE_MAC_RESET_MAGIC); + DELAY(100); + NFE_WRITE(sc, NFE_MAC_RESET, 0); + DELAY(100); + NFE_WRITE(sc, NFE_RXTX_CTL, NFE_RXTX_BIT2); }
on 04/02/2008 05:52 Pyun YongHyeon said the following:> On Fri, Feb 01, 2008 at 03:56:17PM +0200, Andriy Gapon wrote: > > on 01/02/2008 15:42 Andriy Gapon said the following: > > > on 01/02/2008 14:36 Pyun YongHyeon said the following: > > >> After applying attached patch and let me know the output of > > >> "devid : xxx, revid : xxx, pwr = xxx". It would be even better > > >> if you can show me the above message for working/non-working case. > > >> > > >> > > > > > > Applied the patch with correction to actually print rev instead of dev > > > for the second time :-) > > > This is in working case: > > > devid : 269, revid : a3, pwr = 00000003 > > > > A clarification: I just applied the patch, recompiled and re-loaded the > > module. There was no reboot/poweroff/reset in between. > > > > > Will wait for the non-working situation. > > > > > > > Revert previous patch and try attached patch again and let me know > how it goes. > >Tried it - still no joy, the behavior is as before. If I gracefully reboot the machine or power down and then up, then everything is OK. But if I press "reset" button and boot up, the nfe interface is "dead". BTW, I kept the line for printing devid/revid/pwr and output is the same in all cases. -- Andriy Gapon