Re: [PATCH] ndis: safe fpu on amd64
On Mon, Nov 21, 2011 at 03:49:16PM +, Paul B. Mahol wrote: > Hi, > > This patch should fix panic on amd64 when using ndis with drivers > which make use of fpu registers. Do not allocate fpu_kern_ctx on stack. Its size is 528 bytes on amd64 right now, and potentially can grow after AVX support is finished. pgps9mfMzx4Qe.pgp Description: PGP signature
Re[2]: PCI-E VT6130 NIC (if_vge) hang system with gigabit link
Hi! Some days back I put card in Win7 machine. Win7 hang own network subsystem if connected to gigabit switch. I tried last night your patches. Now when put in gigabit switch no hangs or errors, but link (autodetect) 100mbit/s and work good. I think I bought buggy network cards :((. Index: sys/dev/mii/ip1000phy.c === --- sys/dev/mii/ip1000phy.c (revision 227501) +++ sys/dev/mii/ip1000phy.c (working copy) @@ -324,7 +324,6 @@ PHY_WRITE(sc, IP1000PHY_MII_ANAR, reg | IP1000PHY_ANAR_CSMA); reg = IP1000PHY_1000CR_1000T | IP1000PHY_1000CR_1000T_FDX; - reg |= IP1000PHY_1000CR_MASTER; PHY_WRITE(sc, IP1000PHY_MII_1000CR, reg); PHY_WRITE(sc, IP1000PHY_MII_BMCR, (IP1000PHY_BMCR_FDX | IP1000PHY_BMCR_AUTOEN | IP1000PHY_BMCR_STARTNEG)); Index: sys/dev/vge/if_vge.c === --- sys/dev/vge/if_vge.c(revision 227501) +++ sys/dev/vge/if_vge.c(working copy) @@ -173,6 +173,7 @@ static voidvge_freebufs(struct vge_softc *); static voidvge_ifmedia_sts(struct ifnet *, struct ifmediareq *); static int vge_ifmedia_upd(struct ifnet *); +static int vge_ifmedia_upd_locked(struct vge_softc *); static voidvge_init(void *); static voidvge_init_locked(struct vge_softc *); static voidvge_intr(void *); @@ -180,7 +181,6 @@ static int vge_ioctl(struct ifnet *, u_long, caddr_t); static voidvge_link_statchg(void *); static int vge_miibus_readreg(device_t, int, int); -static voidvge_miibus_statchg(device_t); static int vge_miibus_writereg(device_t, int, int, int); static voidvge_miipoll_start(struct vge_softc *); static voidvge_miipoll_stop(struct vge_softc *); @@ -190,6 +190,7 @@ static int vge_rx_list_init(struct vge_softc *); static int vge_rxeof(struct vge_softc *, int); static voidvge_rxfilter(struct vge_softc *); +static voidvge_setmedia(struct vge_softc *); static voidvge_setvlan(struct vge_softc *); static voidvge_setwol(struct vge_softc *); static voidvge_start(struct ifnet *); @@ -218,7 +219,6 @@ /* MII interface */ DEVMETHOD(miibus_readreg, vge_miibus_readreg), DEVMETHOD(miibus_writereg, vge_miibus_writereg), - DEVMETHOD(miibus_statchg, vge_miibus_statchg), { 0, 0 } }; @@ -1099,10 +1099,11 @@ goto fail; } + vge_miipoll_start(sc); /* Do MII setup */ error = mii_attach(dev, &sc->vge_miibus, ifp, vge_ifmedia_upd, vge_ifmedia_sts, BMSR_DEFCAPMASK, sc->vge_phyaddr, MII_OFFSET_ANY, - 0); + MIIF_DOPAUSE); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); goto fail; @@ -1660,30 +1661,41 @@ { struct vge_softc *sc; struct ifnet *ifp; - struct mii_data *mii; + uint8_t physts; sc = xsc; ifp = sc->vge_ifp; VGE_LOCK_ASSERT(sc); - mii = device_get_softc(sc->vge_miibus); - mii_pollstat(mii); - if ((sc->vge_flags & VGE_FLAG_LINK) != 0) { - if (!(mii->mii_media_status & IFM_ACTIVE)) { + physts = CSR_READ_1(sc, VGE_PHYSTS0); + if ((physts & VGE_PHYSTS_RESETSTS) == 0) { + if ((physts & VGE_PHYSTS_LINK) == 0) { sc->vge_flags &= ~VGE_FLAG_LINK; if_link_state_change(sc->vge_ifp, LINK_STATE_DOWN); - } - } else { - if (mii->mii_media_status & IFM_ACTIVE && - IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { + } else { sc->vge_flags |= VGE_FLAG_LINK; if_link_state_change(sc->vge_ifp, LINK_STATE_UP); + CSR_WRITE_1(sc, VGE_CRC2, VGE_CR2_FDX_TXFLOWCTL_ENABLE | + VGE_CR2_FDX_RXFLOWCTL_ENABLE); + if ((physts & VGE_PHYSTS_FDX) != 0) { + if ((physts & VGE_PHYSTS_TXFLOWCAP) != 0) + CSR_WRITE_1(sc, VGE_CRS2, + VGE_CR2_FDX_TXFLOWCTL_ENABLE); + if ((physts & VGE_PHYSTS_RXFLOWCAP) != 0) + CSR_WRITE_1(sc, VGE_CRS2, + VGE_CR2_FDX_RXFLOWCTL_ENABLE); + } if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) vge_start_locked(ifp); } } + /* +* Restart MII auto-polling because link state change interrupt +* will disable it. +*/ + vge_miipoll_start(sc); } #ifdef DEVICE_POLLING @@ -2028,6 +2040,7 @@ */ vge_stop(sc); vge_reset(sc)
Re: [PATCH] ndis: safe fpu on amd64
On 11/22/11, Kostik Belousov wrote: > On Mon, Nov 21, 2011 at 03:49:16PM +, Paul B. Mahol wrote: >> Hi, >> >> This patch should fix panic on amd64 when using ndis with drivers >> which make use of fpu registers. > Do not allocate fpu_kern_ctx on stack. Its size is 528 bytes on amd64 right > now, and potentially can grow after AVX support is finished. So I need to introduce locks and allocate fpu_kern_ctx per CPU because otherwise memory leaks are possible. ___ freebsd-net@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"
Re: arprequest triggered panic
Nikos, On Fri, Nov 18, 2011 at 01:10:47PM +0200, Nikos Vassiliadis wrote: N> I was playing with lagg and found out a kernel panic. Here is N> the backtrace: N> > #5 0xc0a65613 in kdb_trap (type=12, code=0, tf=0xc3f1bb1c) at /usr/src/sys/kern/subr_kdb.c:625 N> > #6 0xc0dbbc1f in trap_fatal (frame=0xc3f1bb1c, eva=24) at /usr/src/sys/i386/i386/trap.c:966 N> > #7 0xc0dbbd1c in trap_pfault (frame=0xc3f1bb1c, usermode=0, eva=24) at /usr/src/sys/i386/i386/trap.c:839 N> > #8 0xc0dbc9b5 in trap (frame=0xc3f1bb1c) at /usr/src/sys/i386/i386/trap.c:558 N> > #9 0xc0da54fc in calltrap () at /usr/src/sys/i386/i386/exception.s:168 N> > #10 0xc0b496eb in arprequest (ifp=0xc42c5400, sip=0xc46625ac, tip=0xc46625ac, enaddr=0xc41d3d9b "\b") at /usr/src/sys/netinet/if_ether.c:264 N> > #11 0xc0b4acef in arp_ifinit (ifp=0xc42c5400, ifa=0xc4662500) at /usr/src/sys/netinet/if_ether.c:880 N> > #12 0xc0aea7ae in if_setlladdr (ifp=0xc42c5400, lladdr=0xc49ac204 "\b", len=6) at /usr/src/sys/net/if.c:3317 N> > #13 0xc4bb7bd3 in lagg_port_setlladdr (arg=0xc4a47b00, pending=1) at /usr/src/sys/modules/if_lagg/../../net/if_lagg.c:476 N> > #14 0xc0a730fb in taskqueue_run_locked (queue=0xc42f3400) at /usr/src/sys/kern/subr_taskqueue.c:308 N> > #15 0xc0a7321f in taskqueue_run (queue=0xc42f3400) at /usr/src/sys/kern/subr_taskqueue.c:322 N> > #16 0xc0a732d3 in taskqueue_swi_run (dummy=0x0) at /usr/src/sys/kern/subr_taskqueue.c:418 N> N> It's triggered with these commands: N> ifconfig em2 10.0.156.1/24 N> ifconfig em3 10.0.156.2/24 N> i=`ifconfig lagg create` N> ifconfig $i laggport em2 laggport em3 N> ifconfig $i 10.0.156.3/24 N> N> Just reporting, should I fill a PR? Can't reproduce this on head. May be some additional measures are needed? Traffic? Or LACP capable switch? My log: behemoth# ifconfig igb0: flags=8843 metric 0 mtu 1500 options=401bb ether 00:25:90:03:0e:fa inet6 fe80::225:90ff:fe03:efa%igb0 prefixlen 64 scopeid 0x1 nd6 options=29 media: Ethernet autoselect (1000baseT ) status: active igb1: flags=8802 metric 0 mtu 1500 options=401bb ether 00:25:90:03:0e:fb nd6 options=29 media: Ethernet autoselect (1000baseT ) status: active lo0: flags=8049 metric 0 mtu 16384 options=3 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 inet 127.0.0.1 netmask 0xff00 nd6 options=21 behemoth# ifconfig igb0 10.0.156.1/24 behemoth# ifconfig igb1 10.0.156.2/24 behemoth# behemoth# ifconfig lagg0 create behemoth# ifconfig lagg0 laggport igb0 laggport igb1 behemoth# ifconfig lagg0 10.0.156.3/24 behemoth# ifconfig igb0: flags=8843 metric 0 mtu 1500 options=401bb ether 00:25:90:03:0e:fa inet6 fe80::225:90ff:fe03:efa%igb0 prefixlen 64 scopeid 0x1 inet 10.0.156.1 netmask 0xff00 broadcast 10.0.156.255 nd6 options=29 media: Ethernet autoselect (1000baseT ) status: active igb1: flags=8843 metric 0 mtu 1500 options=401bb ether 00:25:90:03:0e:fa inet 10.0.156.2 netmask 0xff00 broadcast 10.0.156.255 nd6 options=29 media: Ethernet autoselect (1000baseT ) status: active lo0: flags=8049 metric 0 mtu 16384 options=3 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 inet 127.0.0.1 netmask 0xff00 nd6 options=21 lagg0: flags=8843 metric 0 mtu 1500 options=401bb ether 00:25:90:03:0e:fa inet 10.0.156.3 netmask 0xff00 broadcast 10.0.156.255 nd6 options=29 media: Ethernet autoselect status: active laggproto failover laggport: igb1 flags=0<> laggport: igb0 flags=5 behemoth# -- Totus tuus, Glebius. ___ freebsd-net@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"
Re: PCI-E VT6130 NIC (if_vge) hang system with gigabit link
On Tue, Nov 22, 2011 at 10:59:14AM +0400, Andrey Smagin wrote: > Hi! Some days back I put card in Win7 machine. > Win7 hang own network subsystem if connected to gigabit switch. > I tried last night your patches. Now when put in gigabit switch no hangs or > errors, > but link (autodetect) 100mbit/s and work good. > I think I bought buggy network cards :((. > Thanks. Committed to HEAD(r227828, r227835 and r227837). ___ freebsd-net@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"